Class AutomaticCandidateNumberHelper

java.lang.Object
ch.tocco.nice2.optional.candidatenumber.impl.service.AutomaticCandidateNumberHelper

@Component public class AutomaticCandidateNumberHelper extends Object
  • Constructor Details

  • Method Details

    • isRootEvent

      public boolean isRootEvent(Entity event)
      Checks if the event passed to this method is the root node of its hierarchy
    • retrieveConfig

      public Optional<Entity> retrieveConfig(Entity event)
      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

      public void removeCandidateNumbersFromEventHierarchy(Entity root)
      removes the candidate number from all registrations of an event and all its children
    • setCandidateNumber

      public void setCandidateNumber(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. 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 configuration
      registration - the registration (root event!) that should get a new candidate number