Package org.alfresco.repo.copy
Interface CopyBehaviourCallback
- All Known Implementing Classes:
AbstractCopyBehaviourCallback,AliasableAspectCopyBehaviourCallback,CompoundCopyBehaviourCallback,DefaultCopyBehaviourCallback,DoNothingCopyBehaviourCallback
public interface CopyBehaviourCallback
A callback to modify copy behaviour associated with a given type or aspect. This
callback is called per type and per aspect.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDescription of how the copy process should handle multiplicity of peer associations at the source end of the association.
The order of this enum denotes the priority when mixing behaviour as well; that is to say that a 'ignore' behaviour will occur even if an 'copy' is also provided by the registered behaviour callbacks.static enumDescription of how the copy process should handle multiplicity of peer associations at the target end of the association.
The order of this enum denotes the priority when mixing behaviour as well; that is to say that a 'ignore' behaviour will occur even if an 'copy' is also provided by the registered behaviour callbacks.static enumDescription of how the copy process should traverse a child association.static enumDescription of how the copy process should behave when copying an association.static final classA simple bean class to convey information to the callback methods dealing with copying of associations.static final classA simple bean class to convey information to the callback methods dealing with copying of child associations. -
Method Summary
Modifier and TypeMethodDescriptiongetAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails) Determine the copy behaviour associated with a given peer association.getChildAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails) Determine if a copy should copy the child, the association only or do nothing with the given association.getChildAssociationRecurseAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails) Once the child association copy action has been chosen, the policy callback can dictate whether or not to force further recursion.getCopyProperties(QName classQName, CopyDetails copyDetails, Map<QName, Serializable> properties) Modify the properties that are copied across.booleangetMustCopy(QName classQName, CopyDetails copyDetails) Determine if this type or aspect must be copied.booleanisTopLevelCanBeRenamed(QName classQName, CopyDetails copyDetails) Determine if this top-level node with type or aspect can be renamed during copy.
-
Method Details
-
getMustCopy
Determine if this type or aspect must be copied. If the callback is for a type (not aspect) then this determines if the node is copied at all. If the callback is for an aspect, then this determines if the aspect is copied.- Parameters:
classQName- the name of the class that this is being invoked forcopyDetails- the source node's copy details for quick reference- Returns:
- true if the type or aspect that this behaviour represents must be copied.
-
isTopLevelCanBeRenamed
Determine if this top-level node with type or aspect can be renamed during copy.- Parameters:
classQName- the name of the class that this is being invoked forcopyDetails- the source node's copy details for quick reference- Returns:
- true if the top-level node with type or aspect can be renamed during copy.
-
getAssociationCopyAction
Pair<CopyBehaviourCallback.AssocCopySourceAction,CopyBehaviourCallback.AssocCopyTargetAction> getAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails) Determine the copy behaviour associated with a given peer association. -
getChildAssociationCopyAction
CopyBehaviourCallback.ChildAssocCopyAction getChildAssociationCopyAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails) Determine if a copy should copy the child, the association only or do nothing with the given association.This is called regardless of whether 'cascade' copy has been selected by the client of the copy. Some type and aspect behaviour will mandate a copy of the child associations regardless of whether recursion is on.
- 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 the copy
actionto take with the given child association
-
getChildAssociationRecurseAction
CopyBehaviourCallback.ChildAssocRecurseAction getChildAssociationRecurseAction(QName classQName, CopyDetails copyDetails, CopyBehaviourCallback.CopyChildAssociationDetails childAssocCopyDetails) Once the child association copy action has been chosen, the policy callback can dictate whether or not to force further recursion. This cannot prevent behaviour further down the hierarchy from stopping the copy.- 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 the type of
recursionto perform after having copied the child association - See Also:
-
getCopyProperties
Map<QName,Serializable> getCopyProperties(QName classQName, CopyDetails copyDetails, Map<QName, Serializable> properties) Modify the properties that are copied across.- 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 the type or aspect properties that should be copied.
-