Package mc.core.domain.base.aspect
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>
domain logic related to setting different lifeCycleFlags. See javadoc on
LifeCycleFlag enum constants for a
description of the various lifeCycleFlags.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCriteriaLifeCycleFlag(mc.core.system.search.SearchFilter sf, LifeCycleFlag flag) voidaddOrReplaceCriteriaOwner(mc.core.system.search.SearchFilter sf, User user) voidmark an entity as "in archive".archivedSearch(User user) search all archived entities for current user (where current user is entityOwner)
if parameter user set, else all archived by all ownersvoidarchiveRestore(T entity) restore an entity from archive.mc.core.system.search.SearchFiltergetSearchFilter(LifeCycleFlag flag, User user) voidmark an entity as "in recycle bin".recycledSearch(User user) search all recycled entities for current user (where current user is entityOwner)voidrecycleRestore(T entity) restore an entity from recycle bin.
-
Constructor Details
-
AspectLifecycle
public AspectLifecycle()
-
-
Method Details
-
recycle
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
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
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
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
-
addCriteriaLifeCycleFlag
-
addOrReplaceCriteriaOwner
-