Package org.alfresco.repo.copy
Class DefaultCopyBehaviourCallback
java.lang.Object
org.alfresco.repo.copy.AbstractCopyBehaviourCallback
org.alfresco.repo.copy.DefaultCopyBehaviourCallback
- All Implemented Interfaces:
CopyBehaviourCallback,Extensible
- Direct Known Subclasses:
AliasableAspectCopyBehaviourCallback
@AlfrescoPublicApi
public class DefaultCopyBehaviourCallback
extends AbstractCopyBehaviourCallback
implements Extensible
The default behaviour that a type of aspect implements if there is no associated <
behaviour.
This implementation is stateless and therefore thread-safe.
The default behaviour is:
- Must Copy: YES
- Must Cascade: YES, if cascade is on
- Properties to Copy:ALL
- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.copy.CopyBehaviourCallback
CopyBehaviourCallback.AssocCopySourceAction, CopyBehaviourCallback.AssocCopyTargetAction, CopyBehaviourCallback.ChildAssocCopyAction, CopyBehaviourCallback.ChildAssocRecurseAction, CopyBehaviourCallback.CopyAssociationDetails, CopyBehaviourCallback.CopyChildAssociationDetails -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails) Default behaviour:
* AssocCopySourceAction.COPY_REMOVE_EXISTING
* AssocCopyTargetAction.USE_COPIED_OTHERWISE_ORIGINAL_TARGETgetChildAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails) Default behaviour: Cascade if we are copying children AND the association is primarygetCopyProperties(QName classQName, CopyDetails copyDetails, Map<QName, Serializable> properties) Default behaviour: Copy all associated propertiesstatic CopyBehaviourCallbackbooleangetMustCopy(QName classQName, CopyDetails copyDetails) Default behaviour: Always copy<T extends Trait>
ExtendedTrait<T>Methods inherited from class org.alfresco.repo.copy.AbstractCopyBehaviourCallback
getChildAssociationRecurseAction, isTopLevelCanBeRenamed, recordNodeRefsForRepointing, repointNodeRefs, throwExceptionForUnexpectedBehaviour
-
Constructor Details
-
DefaultCopyBehaviourCallback
public DefaultCopyBehaviourCallback()
-
-
Method Details
-
getInstance
- Returns:
- Returns a stateless singleton
-
getMustCopy
Default behaviour: Always copy- Specified by:
getMustCopyin interfaceCopyBehaviourCallback- Parameters:
classQName- the name of the class that this is being invoked forcopyDetails- the source node's copy details for quick reference- Returns:
- Returns true always
-
getAssociationCopyAction
public Pair<CopyBehaviourCallback.AssocCopySourceAction,CopyBehaviourCallback.AssocCopyTargetAction> getAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails) Default behaviour:
* AssocCopySourceAction.COPY_REMOVE_EXISTING
* AssocCopyTargetAction.USE_COPIED_OTHERWISE_ORIGINAL_TARGET- Specified by:
getAssociationCopyActionin interfaceCopyBehaviourCallback- Overrides:
getAssociationCopyActionin classAbstractCopyBehaviourCallback- Parameters:
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 association- Returns:
- Returns
CopyBehaviourCallback.AssocCopySourceAction.COPY_REMOVE_EXISTINGandCopyBehaviourCallback.AssocCopyTargetAction.USE_COPIED_TARGET
-
getChildAssociationCopyAction
public CopyBehaviourCallback.ChildAssocCopyAction getChildAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails) Default behaviour: Cascade if we are copying children AND the association is primary- Specified by:
getChildAssociationCopyActionin interfaceCopyBehaviourCallback- Parameters:
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 association- Returns:
- Returns true if the association is primary and
copyChildren == true
-
getCopyProperties
public Map<QName,Serializable> getCopyProperties(QName classQName, CopyDetails copyDetails, Map<QName, Serializable> properties) Default behaviour: Copy all associated properties- Specified by:
getCopyPropertiesin interfaceCopyBehaviourCallback- Parameters:
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.- Returns:
- Returns all the properties passes in
-
getTrait
- Specified by:
getTraitin interfaceExtensible
-