Package mc.core.domain.generic.dobj
Class NodeDO
java.lang.Object
mc.core.system.base.BaseBean
-
Nested Class Summary
Nested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClassification(Node node, Classification classification) voidchangeOrderOfClassification(Node node, Classification classification, int targetPosition) Creates a deep copy of given Node, i.e.copy(Node source, Node parentForCopy, NodeCopyFilter copyFilter) Creates a deep copy of given Node, i.e.voidDelete node listvoidNOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!voiddeleteSync(Node entity) called from actionlet for final deletegetAttributesOfClassification(List<Node> nodes, Classification selectedClassification) loads all attributes of classification(s) and their classification parents given nodes are assigned to, including inheritable attributes of classifications that are assigned to parents of nodes.getAttributesOfClassification(Node node, Classification selectedClassification) loads all attributes of classification(s) and their classification parents this node is assigned to including inheritable attributes of classifications that are assigned to parents of the node.getAttributeValuesOfClassification(Node node, Classification classification) voidpreview(Node node, String format, String templateName, OutputStream os) voidremoveClassification(Node node, Classification classification, boolean removeClassificationAttributes) map data to entity if any, validate and savemc.core.domain.generic.dobj.NodeDO.NodeValidatorfor persistent entity copy constructor be used, the copy of entity be mapped and validated
WARNING: in error case param map be changed! non valid fields be deleted from it
all error be collect as ValidationResults in ValidationException and throw only by validate() call
Examples to use:
1.Methods inherited from class mc.core.domain.base.dobj.AbstractHrcEntityDO
getAllOffspringMethods inherited from class mc.core.domain.base.dobj.AbstractComplexEntityDO
addDefaultSearchCriteria, assertPermission, assertPermission, attributes, copy, copyDataSync, copyToCollection, doRecursiveActionAsync, entityProfileApply, entityProfileApply, filter, getCollectionHierarchies, getCollectionsAll, getFromExternalKey, getFromKeySearchFilter, getUserRole, lifecycle, newComplexEntityEvent, onChange, parameter, permissions, prepareSearchFilter, relations, secondaryCollectionAdd, secondaryCollectionCopy, secondaryCollectionMove, secondaryCollectionRemove, setRightInheritanceDisabled, states, translate, versions, watchesMethods inherited from class mc.core.domain.base.dobj.AbstractEntityBaseDO
getFromInternalDescription, sendEvent, sendEventMethods inherited from class mc.core.domain.base.dobj.AbstractBaseDO
delete, getAll, getAllActive, getEntityDisplay, getFromId, getFromKey, getOne, map, map, save
-
Constructor Details
-
NodeDO
public NodeDO()
-
-
Method Details
-
insert
- Overrides:
insertin classAbstractComplexEntityDO<Node>- Throws:
ApplicationException
-
save
Description copied from interface:IBaseDOmap data to entity if any, validate and save- Specified by:
savein interfaceIBaseDO<Node>- Overrides:
savein classAbstractEntityBaseDO<Node>- Parameters:
node- mandatorydataMap- optional- Returns:
- mapped entity
- Throws:
ApplicationException
-
edit
- Overrides:
editin classAbstractComplexEntityDO<Node>- Throws:
ApplicationException
-
validator
public mc.core.domain.generic.dobj.NodeDO.NodeValidator validator(Node node, DataMap map) throws ApplicationException Description copied from class:AbstractBaseDOfor persistent entity copy constructor be used, the copy of entity be mapped and validated
WARNING: in error case param map be changed! non valid fields be deleted from it
all error be collect as ValidationResults in ValidationException and throw only by validate() call
Examples to use:
1. validator( navigationHrc, dataMap).thatValidField( NavigationHrc.Field.navigationHrcType).validate(); 2. validator( navigation, dataMap).thatValidField( Navigation.Field.navigationType, Navigation.Field.navigationHrc) .thatNotNullIf( HrcEntity.Field.parent, n -> n.getNavigationType().getParentNavigationType() != null).validate(); 3. validator( entity, dataMap).thatValidField( Country.Field.iso2Code, "message.validate.Country.iso2Code.missing").thatUnique( Country.Field.iso2Code).validate();- Overrides:
validatorin classAbstractBaseDO<Node>- Parameters:
node- mandatorymap- optional- Returns:
- the validator
- Throws:
ApplicationException- the application exception
-
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 classAbstractComplexEntityDO<Node>- Parameters:
node- mandatoryforce- if true delete without usage check, which can result in db constraints error unless references are taken care of- Throws:
ApplicationException
-
delete
Delete node list- Parameters:
nodes-- Throws:
ApplicationException
-
deleteSync
called from actionlet for final delete- Throws:
ApplicationException
-
copy
Creates a deep copy of given Node, i.e. copies also all offspring. Also copies classification assignments for each Node. For large hierarchical trees the copying can take substantial time. Subclass of Node 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 classAbstractHrcEntityDO<Node>- Parameters:
source- Node, mandatoryparentForCopy- Node, mandatory if hierarchy level of source demands a parent. Gives the parent to which copied object should belong. parentForCopy must be of same type as parent of source if the levels of the hierarchy are differentiated by type.- Returns:
- copy
- Throws:
ApplicationException
-
copy
public Node copy(Node source, Node parentForCopy, NodeCopyFilter copyFilter) throws ApplicationException Creates a deep copy of given Node, i.e. copies also all offspring. Also copies classification assignments for each Node. For large hierarchical trees the copying can take substantial time. Subclass of Node 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.- Parameters:
source- Node, mandatoryparentForCopy- Node, mandatory if hierarchy level of source demands a parent. Gives the parent to which copied object should belong. parentForCopy must be of same type as parent of source if the levels of the hierarchy are differentiated by type.copyFilter- copy flags, optional. ifCopyFilter.addNamePostfix(boolean)is true postfix copy be added to name in all locales inAbstractEntityBaseDO#setCopyNamePostfix()- Returns:
- copy
- Throws:
ApplicationException
-
addClassification
public ClassificationToNode addClassification(Node node, Classification classification) throws ApplicationException - Throws:
ApplicationException
-
removeClassification
public void removeClassification(Node node, Classification classification, boolean removeClassificationAttributes) throws ApplicationException - Throws:
ApplicationException
-
changeOrderOfClassification
public void changeOrderOfClassification(Node node, Classification classification, int targetPosition) throws UserException - Throws:
UserException
-
move
- Throws:
ApplicationException
-
preview
public void preview(Node node, String format, String templateName, OutputStream os) throws ApplicationException - Throws:
ApplicationException
-
getAttributesOfClassification
public List<IAttributeAssignment> getAttributesOfClassification(Node node, Classification selectedClassification) loads all attributes of classification(s) and their classification parents this node is assigned to including inheritable attributes of classifications that are assigned to parents of the node.- Parameters:
node- mandatoryselectedClassification- optional, if given only returns attributes of classification and their parents to which node is assigned. By default returns all attributes of all classification classes, filter duplicate attributes.
-
getAttributesOfClassification
public Map<Node,List<IAttributeAssignment>> getAttributesOfClassification(List<Node> nodes, Classification selectedClassification) loads all attributes of classification(s) and their classification parents given nodes are assigned to, including inheritable attributes of classifications that are assigned to parents of nodes.- Parameters:
nodes- mandatoryselectedClassification- optional, if given only returns attributes of classification and their parents to which node is assigned. By default returns all attributes of all classification classes, filter duplicate attributes
-
getAttributeValuesOfClassification
- Parameters:
node- mandatoryclassification- mandatory- Returns:
- AttributeValues for all assigned attributes of given classification, ordered by prio of assignment. If node has no attribute value of a given attribute an empty AttributeValue is inserted in list. All AttributeValues have mandatory-flag and standardvalues-filter set.
-