Class AutomaticCandidateNumberHelper
java.lang.Object
ch.tocco.nice2.optional.candidatenumber.impl.service.AutomaticCandidateNumberHelper
-
Constructor Summary
ConstructorsConstructorDescriptionAutomaticCandidateNumberHelper(EventRelationshipTraverser relationshipTraverser, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisRootEvent(Entity event) Checks if the event passed to this method is the root node of its hierarchyvoidremoves the candidate number from all registrations of an event and all its childrenretrieveConfig(Entity event) Resolves to the root event of the hierarchy and tries to get the Automatic_candidate_number configurationvoidsetCandidateNumber(Entity config, Entity registration) sets the candidate number using the automatic candidate number and writes it to all "child-event-registrations" If the user has no key (when it is created at the same time as the registration, e.g.
-
Constructor Details
-
AutomaticCandidateNumberHelper
public AutomaticCandidateNumberHelper(EventRelationshipTraverser relationshipTraverser, PersistenceService persistenceService)
-
-
Method Details
-
isRootEvent
Checks if the event passed to this method is the root node of its hierarchy -
retrieveConfig
Resolves to the root event of the hierarchy and tries to get the Automatic_candidate_number configuration- Parameters:
event- root or child event- Returns:
- the Automatic_candidate_number configuration (if available)
-
removeCandidateNumbersFromEventHierarchy
removes the candidate number from all registrations of an event and all its children -
setCandidateNumber
sets the candidate number using the automatic candidate number and writes it to all "child-event-registrations" If the user has no key (when it is created at the same time as the registration, e.g. in event_registration the relation "relModule_registration" is resolved to get child registrations. If the user has a key, the- Parameters:
config- the Automatic_candidate_number configurationregistration- the registration (root event!) that should get a new candidate number
-