Class RequirementRuleServiceImpl

java.lang.Object
ch.tocco.nice2.optional.educationrequirement.impl.RequirementRuleServiceImpl
All Implemented Interfaces:
RequirementRuleService

@Component public class RequirementRuleServiceImpl extends Object implements RequirementRuleService
  • Constructor Details

  • Method Details

    • linkRequirementRules

      public void linkRequirementRules(EntityList sourceEntities, EntityList requirementPackages)
      Description copied from interface: RequirementRuleService
      Connect all the requirement rules with given single source entity. A requirement entity is created for each rule in the given requirement packages. If a rule is present in multiple packages only a single requirement entity is created. Each requirement entity knows from which package it originated.
      Specified by:
      linkRequirementRules in interface RequirementRuleService
      Parameters:
      sourceEntities - Entities of model 'Schooling' or 'Registration'
      requirementPackages - the requirement packages from which to load the rules to be used
    • linkRequirementRulesForSingleEntity

      public void linkRequirementRulesForSingleEntity(Entity sourceEntity, EntityList requirementPackages)
      Description copied from interface: RequirementRuleService
      Specified by:
      linkRequirementRulesForSingleEntity in interface RequirementRuleService
      Parameters:
      sourceEntity - Single entity of model 'Schooling' or 'Registration'
      requirementPackages - the Requirement_packages from which to load the rules to be used
    • getValidSchoolings

      public EntityList getValidSchoolings(Entity courseOfStudy)
      Description copied from interface: RequirementRuleService
      Return all schooling entites which are linked with given course of study and have an empty end date or in future
      Specified by:
      getValidSchoolings in interface RequirementRuleService
      Parameters:
      courseOfStudy - Source course of study entity
      Returns:
      EntityList with valid schooling entities
    • getValidRegistrations

      public EntityList getValidRegistrations(Entity event)
      Description copied from interface: RequirementRuleService
      Return all registrations for given event entity which have status 'registered' or 'booked'
      Specified by:
      getValidRegistrations in interface RequirementRuleService
      Parameters:
      event - Source event entity
      Returns:
      EntityList with valid registration entities
    • removeRequirementPackage

      public void removeRequirementPackage(EntityList sources, Entity requirementPackage)
      Description copied from interface: RequirementRuleService
      removes Requirement_packages from Requirements that were generated on sources. If the Requirements have any other status than 'open' a confirmation is sent to the user before anything else is done. Afterwards the Requirement_package is removed from Requirement_relRequirement_package. If that Requirement_package is the last one on the Requirement, it is deleted.
      Specified by:
      removeRequirementPackage in interface RequirementRuleService
      Parameters:
      sources - the sources from which to load Requirements
      requirementPackage - the Requirement to remove
    • filterOpenRequirements

      public EntityList filterOpenRequirements(EntityList requirements)
      Description copied from interface: RequirementRuleService
      filter out all Requirements that aren't open
      Specified by:
      filterOpenRequirements in interface RequirementRuleService
      Parameters:
      requirements - the Requirements to filter
      Returns:
      a list of Requirements with any status other than 'open'
    • confirmRequirementAdjustements

      public boolean confirmRequirementAdjustements(EntityList requirements)
      Description copied from interface: RequirementRuleService
      send the user a confirmation question if the Requirements should actually be updated
      Specified by:
      confirmRequirementAdjustements in interface RequirementRuleService
      Parameters:
      requirements - the Requirements to list in the question
      Returns:
      the answer from the user