Class SummarizeMaxPointsEntityListener

java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingEntityListener
ch.tocco.nice2.optional.qualification.impl.entitylistener.SummarizeMaxPointsEntityListener
All Implemented Interfaces:
ContextListener, EntityFacadeListener, CommitListener, EventListener

public class SummarizeMaxPointsEntityListener extends CollectingEntityListener
When using the Input_type "points" or "points_average", the amount of points reachable in a course is defined by the various Input_nodes of a structure. The maximum reachable points of an Evaluation_node is implicitly defined by the maximum reachable points of its child Input_nodes (and child Evaluation_nodes with other Input_nodes below it). Thus, changing one Input_node's MAX_POINTS value affects all parent nodes respectively bottom-up. This listener listens for changes to POINTS_MAX, SUMMARIZE_POINTS and relInput_type on Input_nodes and changes to POINTS_MAX and SUMMARIZE_POINTS on Evaluation_nodes. If such a change happens, the POINTS_MAX and AVERAGE_POINTS_MAX of all Evaluation_nodes and their parents related to that Input_node get their POINTS_MAX value recalculated according to the change.