Package mc.core.domain.base.dobj
Class AbstractComplexEntityDO<T extends ComplexEntity>
java.lang.Object
mc.core.system.base.BaseBean
mc.core.domain.base.dobj.AbstractBaseDO<T>
mc.core.domain.base.dobj.AbstractEntityBaseDO<T>
mc.core.domain.base.dobj.AbstractComplexEntityDO<T>
- All Implemented Interfaces:
IBaseDO<T>
- Direct Known Subclasses:
AbstractAssetDO,AbstractHrcEntityDO,AbstractPrincipalDO,AttributeDO,ClassificationHrcDO,ComplexEntityDO,EntityProfileDO,ImportDO,ImportProfileDO,NavigationHrcDO,NodeHrcDO,ProjectDO,ProjectTaskDO,PublicationDO,PublicationProfileDO
public abstract class AbstractComplexEntityDO<T extends ComplexEntity>
extends AbstractEntityBaseDO<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefaultSearchCriteria(List<mc.core.system.search.BaseSearchCriteria<?>> critList, String param) add entity specific default search criteria to list for search by given paramvoidassertPermission(ComplexEntity entity, RightType rightType) assert permission for current session user and content locale.voidassertPermission(Collection collection, RightType rightType, boolean forItem) assert collection permission for current session user.Subclass of ComplexEntity passed to this method must implement a constructor that takes as sole argument an instance of this class, otherwise an ApplicationException is thrown.copyDataSync(ComplexEntity source, List<T> targetEntities, CopyFilter copyFilter) copies data always directly, will not start a workflow.copyToCollection(T source, Collection parentCollection) create a copy of given source entity in parentCollection if givenvoidNOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!booleandoRecursiveActionAsync(ComplexEntity entity) voidentityProfileApply(List<T> entities, EntityProfile entityProfile, CopyFilter copyFilter) voidentityProfileApply(T entity, EntityProfile entityProfile, CopyFilter copyFilter) filter()getCollectionsAll(ComplexEntity entity) getFromExternalKey(String externalKey) mc.core.system.search.SearchFilterget at least needed user base role for the entity classnewComplexEntityEvent(mc.core.service.event.Event.IEventType eventType, T entity) voidonChange(ComplexEntity entity, String keyPostfix, Object... args) mc.core.system.search.SearchFilterprepareSearchFilter(mc.core.system.search.SearchFilter sf) prepare searchFilter for (paged) SearchService search() methods.voidsecondaryCollectionAdd(ComplexEntity entity, Collection collection) add given collection as secondary collection if not already present in collections (secondary and primary) of given entity.voidsecondaryCollectionCopy(List<T> entityList, Collection targetCollection) add secondary collection link to given target collection for all entities of list for which user has EDIT rightvoidsecondaryCollectionMove(List<T> entityList, Collection sourceCollection, Collection targetCollection) move secondary collection link from given source collection to target collection for all entities of lists for which user has EDIT right and state.voidsecondaryCollectionRemove(ComplexEntity entity, Collection collection) removes given collection from secondary collections of given entity.voidsetRightInheritanceDisabled(ComplexEntity entity, boolean disable) states()versions()watches()Methods inherited from class mc.core.domain.base.dobj.AbstractEntityBaseDO
getFromInternalDescription, save, sendEvent, sendEventMethods inherited from class mc.core.domain.base.dobj.AbstractBaseDO
delete, getAll, getAllActive, getEntityDisplay, getFromId, getFromKey, getOne, map, map, save, validator
-
Constructor Details
-
AbstractComplexEntityDO
public AbstractComplexEntityDO()
-
-
Method Details
-
getUserRole
Description copied from interface:IBaseDOget at least needed user base role for the entity class- Specified by:
getUserRolein interfaceIBaseDO<T extends ComplexEntity>- Overrides:
getUserRolein classAbstractEntityBaseDO<T extends ComplexEntity>
-
permissions
-
attributes
-
relations
-
states
-
parameter
-
filter
-
versions
-
watches
-
lifecycle
-
assertPermission
assert permission for current session user and content locale. rightType optional, default is READ- Throws:
UserException
-
assertPermission
public void assertPermission(Collection collection, RightType rightType, boolean forItem) throws UserException assert collection permission for current session user. rightType optional, default is READ- Throws:
UserException
-
setRightInheritanceDisabled
- Throws:
UserException
-
getFromExternalKey
public T getFromExternalKey(String externalKey) throws EntityNotFoundException, NotUniqueResultException -
getFromKeySearchFilter
-
addDefaultSearchCriteria
public void addDefaultSearchCriteria(List<mc.core.system.search.BaseSearchCriteria<?>> critList, String param) Description copied from interface:IBaseDOadd entity specific default search criteria to list for search by given param- Specified by:
addDefaultSearchCriteriain interfaceIBaseDO<T extends ComplexEntity>- Overrides:
addDefaultSearchCriteriain classAbstractEntityBaseDO<T extends ComplexEntity>param- mandatory
-
prepareSearchFilter
public mc.core.system.search.SearchFilter prepareSearchFilter(mc.core.system.search.SearchFilter sf) Description copied from class:AbstractBaseDOprepare searchFilter for (paged) SearchService search() methods. override to add type specific criteria or ordering. always call super first when overriding and use returned filter- Overrides:
prepareSearchFilterin classAbstractEntityBaseDO<T extends ComplexEntity>- Returns:
- prepared
SearchFilter. never null
-
edit
- Throws:
ApplicationException
-
translate
- Throws:
ApplicationException
-
insert
- Throws:
ApplicationException
-
delete
Description copied from class:AbstractBaseDONOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!- Overrides:
deletein classAbstractBaseDO<T extends ComplexEntity>- Parameters:
entity- mandatoryforce- if true delete without usage check, which can result in db constraints error unless references are taken care of- Throws:
ApplicationException
-
copy
Subclass of ComplexEntity passed to this method must implement a constructor that takes as sole argument an instance of this class, otherwise an ApplicationException is thrown. The copy constructor should set all properties that must be copied but not the dependent objects such as entityToAttributes.- Overrides:
copyin classAbstractEntityBaseDO<T extends ComplexEntity>- Parameters:
source- ComplexEntity, mandatory- Returns:
- copy
- Throws:
ApplicationException
-
copyToCollection
create a copy of given source entity in parentCollection if given- Overrides:
copyToCollectionin classAbstractEntityBaseDO<T extends ComplexEntity>- Parameters:
source- mandatoryparentCollection- optional, default is parent collection of source- Returns:
- copy
- Throws:
ApplicationException
-
entityProfileApply
public void entityProfileApply(T entity, EntityProfile entityProfile, CopyFilter copyFilter) throws UserException, ApplicationException - Throws:
UserExceptionApplicationException
-
entityProfileApply
public void entityProfileApply(List<T> entities, EntityProfile entityProfile, CopyFilter copyFilter) throws UserException, ApplicationException - Throws:
UserExceptionApplicationException
-
copyDataSync
public Map<T,Set<Attribute>> copyDataSync(ComplexEntity source, List<T> targetEntities, CopyFilter copyFilter) throws ApplicationException copies data always directly, will not start a workflow. Caller must be mindful not to use this method for big lists or deep hierarchies. See#ceCopyData(ComplexEntity, List, CopyFilter, SessionData)for details- Parameters:
source- mandatory, the source entitytargetEntities- mandatory, list of target entitiescopyFilter- CECopyFilter optional, use to differentiate which data should be copied. If null all data is copied.- Returns:
- a map per target entity of the attributes that could not be copied because they are not configured by type of target entity
- Throws:
ApplicationException
-
secondaryCollectionAdd
public void secondaryCollectionAdd(ComplexEntity entity, Collection collection) throws ApplicationException add given collection as secondary collection if not already present in collections (secondary and primary) of given entity. Checks edit right and state on entity, insert right on collection- Parameters:
entity- mandatorycollection- mandatory- Throws:
ApplicationException
-
secondaryCollectionRemove
public void secondaryCollectionRemove(ComplexEntity entity, Collection collection) throws UserException, ApplicationException removes given collection from secondary collections of given entity. Checks edit right and state on entity, delete right on collection- Parameters:
entity- mandatorycollection- mandatory- Throws:
ApplicationExceptionUserException
-
secondaryCollectionCopy
public void secondaryCollectionCopy(List<T> entityList, Collection targetCollection) throws ApplicationException add secondary collection link to given target collection for all entities of list for which user has EDIT right- Throws:
ApplicationException
-
secondaryCollectionMove
public void secondaryCollectionMove(List<T> entityList, Collection sourceCollection, Collection targetCollection) throws ApplicationException move secondary collection link from given source collection to target collection for all entities of lists for which user has EDIT right and state.- Throws:
ApplicationException
-
getCollectionHierarchies
- Parameters:
entity- must be ICollectionManaged or ICollectionListManaged- Returns:
- a list that has for each assigned collection of entity (primary or secondary) the collection hierarchy as list, each list starting with the root collection and having the assigned collection as last member.
-
getCollectionsAll
- Parameters:
entity- mandatory- Returns:
- flattened list with no duplicates of
getCollectionHierarchies(ComplexEntity)
-
onChange
-
doRecursiveActionAsync
-
newComplexEntityEvent
public ComplexEntityEvent<T> newComplexEntityEvent(mc.core.service.event.Event.IEventType eventType, T entity)
-