public class DefaultCopyBehaviourCallback extends AbstractCopyBehaviourCallback implements Extensible
behaviour
.
This implementation is stateless
and therefore thread-safe.
The default behaviour is:
CopyBehaviourCallback.AssocCopySourceAction, CopyBehaviourCallback.AssocCopyTargetAction, CopyBehaviourCallback.ChildAssocCopyAction, CopyBehaviourCallback.ChildAssocRecurseAction, CopyBehaviourCallback.CopyAssociationDetails, CopyBehaviourCallback.CopyChildAssociationDetails
Constructor and Description |
---|
DefaultCopyBehaviourCallback() |
Modifier and Type | Method and Description |
---|---|
org.alfresco.util.Pair<CopyBehaviourCallback.AssocCopySourceAction,CopyBehaviourCallback.AssocCopyTargetAction> |
getAssociationCopyAction(org.alfresco.service.namespace.QName classQName,
CopyDetails copyDetails,
CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails)
Default behaviour:
* AssocCopySourceAction.COPY_REMOVE_EXISTING * AssocCopyTargetAction.USE_COPIED_OTHERWISE_ORIGINAL_TARGET |
CopyBehaviourCallback.ChildAssocCopyAction |
getChildAssociationCopyAction(org.alfresco.service.namespace.QName classQName,
CopyDetails copyDetails,
CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails)
Default behaviour: Cascade if we are copying children AND the association is primary
|
Map<org.alfresco.service.namespace.QName,Serializable> |
getCopyProperties(org.alfresco.service.namespace.QName classQName,
CopyDetails copyDetails,
Map<org.alfresco.service.namespace.QName,Serializable> properties)
Default behaviour: Copy all associated properties
|
static CopyBehaviourCallback |
getInstance() |
boolean |
getMustCopy(org.alfresco.service.namespace.QName classQName,
CopyDetails copyDetails)
Default behaviour: Always copy
|
<T extends Trait> |
getTrait(Class<? extends T> traitAPI) |
getChildAssociationRecurseAction, isTopLevelCanBeRenamed, recordNodeRefsForRepointing, repointNodeRefs, throwExceptionForUnexpectedBehaviour
public static CopyBehaviourCallback getInstance()
public boolean getMustCopy(org.alfresco.service.namespace.QName classQName, CopyDetails copyDetails)
getMustCopy
in interface CopyBehaviourCallback
classQName
- the name of the class that this is being invoked forcopyDetails
- the source node's copy details for quick referencepublic org.alfresco.util.Pair<CopyBehaviourCallback.AssocCopySourceAction,CopyBehaviourCallback.AssocCopyTargetAction> getAssociationCopyAction(org.alfresco.service.namespace.QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails)
getAssociationCopyAction
in interface CopyBehaviourCallback
getAssociationCopyAction
in class AbstractCopyBehaviourCallback
classQName
- the name of the class that this is being invoked forcopyDetails
- the source node's copy details for quick referenceassocCopyDetails
- all other details relating to the associationCopyBehaviourCallback.AssocCopySourceAction.COPY_REMOVE_EXISTING
and
CopyBehaviourCallback.AssocCopyTargetAction.USE_COPIED_TARGET
public CopyBehaviourCallback.ChildAssocCopyAction getChildAssociationCopyAction(org.alfresco.service.namespace.QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails)
getChildAssociationCopyAction
in interface CopyBehaviourCallback
classQName
- the name of the class that this is being invoked forcopyDetails
- the source node's copy details for quick referencechildAssocCopyDetails
- all other details relating to the child associationcopyChildren == true
public Map<org.alfresco.service.namespace.QName,Serializable> getCopyProperties(org.alfresco.service.namespace.QName classQName, CopyDetails copyDetails, Map<org.alfresco.service.namespace.QName,Serializable> properties)
getCopyProperties
in interface CopyBehaviourCallback
classQName
- the name of the class that this is being invoked forcopyDetails
- the source node's copy details for quick referenceproperties
- the type- or aspect-specific properties that can be copied.
The map can be manipulated and returned as required.public <T extends Trait> ExtendedTrait<T> getTrait(Class<? extends T> traitAPI)
getTrait
in interface Extensible
Copyright © 2005–2017 Alfresco Software. All rights reserved.