Class AspectLifecycle<T extends ComplexEntity>

java.lang.Object
mc.core.system.base.BaseBean
mc.core.domain.base.dobj.AbstractAspect<T>
mc.core.domain.base.aspect.AspectLifecycle<T>

public class AspectLifecycle<T extends ComplexEntity> extends AbstractAspect<T>
domain logic related to setting different lifeCycleFlags. See javadoc on LifeCycleFlag enum constants for a description of the various lifeCycleFlags.
  • Constructor Details

    • AspectLifecycle

      public AspectLifecycle()
  • Method Details

    • recycle

      public void recycle(T entity, boolean force) throws UserException
      mark an entity as "in recycle bin". set LifeCycleFlag.RECYCLED, change the owner to current user, remove fields from FTI. entity maybe filtered in DB or FTI queries, but keeps all data and references
      Parameters:
      entity - mandatory
      Throws:
      UserException
    • recycleRestore

      public void recycleRestore(T entity) throws UserException
      restore an entity from recycle bin. set LifeCycleFlag.RELEASED, change the owner to current user, re-index in FTI.
      Parameters:
      entity - mandatory
      Throws:
      UserException
    • recycledSearch

      public mc.core.system.util.misc.Pair<List<T>,mc.core.system.search.SearchResult> recycledSearch(User user)
      search all recycled entities for current user (where current user is entityOwner)
      Returns:
      pair of first result page and SearchResult to retrieve further results
    • archive

      public void archive(T entity) throws UserException
      mark an entity as "in archive". set LifeCycleFlag.ARCHIVED, change the owner to current user, remove fields from FTI. entity maybe filtered in DB or FTI queries, but keeps all data and references
      Parameters:
      entity - mandatory
      Throws:
      UserException
    • archiveRestore

      public void archiveRestore(T entity) throws UserException
      restore an entity from archive. set LifeCycleFlag.RELEASED, change the owner to current user, re-index in FTI.
      Parameters:
      entity - mandatory
      Throws:
      UserException
    • archivedSearch

      public mc.core.system.util.misc.Pair<List<T>,mc.core.system.search.SearchResult> archivedSearch(User user)
      search all archived entities for current user (where current user is entityOwner)
      if parameter user set, else all archived by all owners
      Returns:
      pair of first result page and SearchResult to retrieve further results
    • getSearchFilter

      public mc.core.system.search.SearchFilter getSearchFilter(LifeCycleFlag flag, User user)
    • addCriteriaLifeCycleFlag

      public void addCriteriaLifeCycleFlag(mc.core.system.search.SearchFilter sf, LifeCycleFlag flag)
    • addOrReplaceCriteriaOwner

      public void addOrReplaceCriteriaOwner(mc.core.system.search.SearchFilter sf, User user)