Class ContributionManagementContext


  • public class ContributionManagementContext
    extends Object
    This class permits to specify a context into which a contribution has to be managed. For example, it permits to define the context on the save action of a WYSIWYG of a contribution from kmelia component.
    Author:
    Yohann Chastagnier
    • Method Detail

      • aboutSubscriptionResource

        public ContributionManagementContext aboutSubscriptionResource​(SubscriptionResource linkedSubscriptionResource)
        Setup the finest subscription resource linked to the entity that is handled.
        Parameters:
        linkedSubscriptionResource - the finest subscription resource (the resource on which subscriptions are registered) linked to the entity that is handled.
        Returns:
        itself.
      • atLocation

        public ContributionManagementContext atLocation​(Location location)
        Setup the location at which the subscription resource is aimed.
        Parameters:
        location - a Location instance from which MUST contribution is handled.
        Returns:
        itself.
      • getLinkedSubscriptionResource

        public SubscriptionResource getLinkedSubscriptionResource()
        Gets the finest subscription resource linked to the current managed entity.
        Returns:
        the finest subscription resource linked to the current managed entity.
      • forPersistenceAction

        public ContributionManagementContext forPersistenceAction​(ContributionStatus entityStatusBeforePersistenceAction,
                                                                  ActionType entityPersistenceAction,
                                                                  ContributionStatus entityStatusAfterPersistenceAction)
        Sets the context of persistence action performed on the entity.
        Parameters:
        entityStatusBeforePersistenceAction - the status of the entity before its persistence (or validation).
        entityPersistenceAction - the type of persistence action performed on the persisted entity.
        entityStatusAfterPersistenceAction - the status of the entity after a successful persist operation (or validation).
        Returns:
        the instance of the current completed context.
      • getEntityPersistenceAction

        public ActionType getEntityPersistenceAction()
        Gets the persistence (or validation) action that is performed on the entity.
        Returns:
        the persistence (or validation) action that is performed on the entity.
      • getEntityStatusBeforePersistAction

        public ContributionStatus getEntityStatusBeforePersistAction()
        Gets the status of the entity before the persistence (or validation) action is performed.
        Returns:
        the status of the entity before the persistence (or validation) action is performed.
      • getEntityStatusAfterPersistAction

        public ContributionStatus getEntityStatusAfterPersistAction()
        Gets the status of the entity after the persistence (or validation) action is performed.
        Returns:
        the status of the entity after the persistence (or validation) action is performed.
      • getLocation

        public Location getLocation()
        Gets the optional location of the contribution from which it is managed.
        Returns:
        a Location if any, null otherwise.