Class ExternalQualificationServiceImpl
java.lang.Object
ch.tocco.nice2.optional.qualification.impl.services.ExternalQualificationServiceImpl
- All Implemented Interfaces:
ExternalQualificationService
@Component
public class ExternalQualificationServiceImpl
extends Object
implements ExternalQualificationService
-
Constructor Summary
ConstructorDescriptionExternalQualificationServiceImpl
(Context ctx, QualificationService qualificationService, org.slf4j.Logger log, QualificationBeanFactory qualificationBeanFactory) -
Method Summary
Modifier and TypeMethodDescriptionGet rating data for a specific user from within a particular qualification treegetEvaluationScale
(Entity input) returns the scale for the givenEvaluationNode
.int
getMc()
int
getValidRegistrations
(Entity evaluationDataEntity) boolean
hasInputTypeRatings
(Entity inputNode) checks if input node has ratings according to its typeboolean
isDataEmpty
(Entity inputNode, Entity inputData) checks if input data is empty according to type of input nodeboolean
isInstancePublished
(Entity publicationInstance) checks Evaluation for publication dates and Evaluation_visibility_status or Input for visible dates and Input_visibility_statusvoid
updateInputDatasForParticipants
(Entity inputEntity) helper method to call QualificationService#updateInputDatasForParticipants(Entity) from outside the qualification moduleboolean
usesInputTypePoints
(Entity inputNode) checks if input node uses points according to its typewrapEvaluationEntity
(Entity evaluationEntity) wrap an Evaluation instance
-
Constructor Details
-
ExternalQualificationServiceImpl
public ExternalQualificationServiceImpl(Context ctx, QualificationService qualificationService, org.slf4j.Logger log, QualificationBeanFactory qualificationBeanFactory)
-
-
Method Details
-
getValidRegistrations
- Specified by:
getValidRegistrations
in interfaceExternalQualificationService
- Throws:
PersistException
-
wrapEvaluationEntity
Description copied from interface:ExternalQualificationService
wrap an Evaluation instance- Specified by:
wrapEvaluationEntity
in interfaceExternalQualificationService
- Parameters:
evaluationEntity
- an evaluation entity- Returns:
- an object wrapping the provided entity
- Throws:
PersistException
-
getData
Description copied from interface:ExternalQualificationService
Get rating data for a specific user from within a particular qualification tree- Specified by:
getData
in interfaceExternalQualificationService
- Parameters:
evaluation
- root evaluation of the qualification treeuser
- the user entitynodeId
- the short id of the node- Returns:
- a rating data object (e.g. BigDecimal, String, etc.)
-
getUsers
- Specified by:
getUsers
in interfaceExternalQualificationService
- Parameters:
evaluation
- the evaluation to get all connected users from- Returns:
- a list of user entities
-
getGradeDecimalDigits
public int getGradeDecimalDigits()- Specified by:
getGradeDecimalDigits
in interfaceExternalQualificationService
- Returns:
- the amount of digits defined in QualificationService
-
getPointsDecimalDigits
public int getPointsDecimalDigits()- Specified by:
getPointsDecimalDigits
in interfaceExternalQualificationService
-
getMc
- Specified by:
getMc
in interfaceExternalQualificationService
-
updateInputDatasForParticipants
Description copied from interface:ExternalQualificationService
helper method to call QualificationService#updateInputDatasForParticipants(Entity) from outside the qualification module- Specified by:
updateInputDatasForParticipants
in interfaceExternalQualificationService
- Parameters:
inputEntity
- an Input entity
-
isDataEmpty
Description copied from interface:ExternalQualificationService
checks if input data is empty according to type of input node- Specified by:
isDataEmpty
in interfaceExternalQualificationService
- Parameters:
inputNode
- the node to get the type frominputData
- the data to check- Returns:
- true if data is empty, false otherwise
-
hasInputTypeRatings
Description copied from interface:ExternalQualificationService
checks if input node has ratings according to its type- Specified by:
hasInputTypeRatings
in interfaceExternalQualificationService
- Parameters:
inputNode
- the node to get the type from- Returns:
- true if type hasRatings
-
usesInputTypePoints
Description copied from interface:ExternalQualificationService
checks if input node uses points according to its type- Specified by:
usesInputTypePoints
in interfaceExternalQualificationService
- Parameters:
inputNode
- the node to get the type from- Returns:
- true if type usesPoints
-
getEvaluationScale
Description copied from interface:ExternalQualificationService
returns the scale for the givenEvaluationNode
.- Specified by:
getEvaluationScale
in interfaceExternalQualificationService
- Parameters:
input
- input to get the scale from- Returns:
- the Tuple containing (1) minimum and (2) maximum value of the scale
-
isInstancePublished
Description copied from interface:ExternalQualificationService
checks Evaluation for publication dates and Evaluation_visibility_status or Input for visible dates and Input_visibility_status- Specified by:
isInstancePublished
in interfaceExternalQualificationService
- Parameters:
publicationInstance
- the instance to check- Returns:
- true if instance is published, false otherwise
-