org.alfresco.repo.copy
Class DefaultCopyBehaviourCallback

java.lang.Object
  extended by org.alfresco.repo.copy.AbstractCopyBehaviourCallback
      extended by org.alfresco.repo.copy.DefaultCopyBehaviourCallback
All Implemented Interfaces:
CopyBehaviourCallback

public class DefaultCopyBehaviourCallback
extends AbstractCopyBehaviourCallback

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:

Since:
3.2

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
DefaultCopyBehaviourCallback()
           
 
Method Summary
 org.alfresco.util.Pair 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
 java.util.Map getCopyProperties(org.alfresco.service.namespace.QName classQName, CopyDetails copyDetails, java.util.Map properties)
          Default behaviour: Copy all associated properties
static CopyBehaviourCallback getInstance()
           
 boolean getMustCopy(org.alfresco.service.namespace.QName classQName, CopyDetails copyDetails)
          Default behaviour: Always copy
 
Methods inherited from class org.alfresco.repo.copy.AbstractCopyBehaviourCallback
getChildAssociationRecurseAction, recordNodeRefsForRepointing, repointNodeRefs, throwExceptionForUnexpectedBehaviour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCopyBehaviourCallback

public DefaultCopyBehaviourCallback()
Method Detail

getInstance

public static CopyBehaviourCallback getInstance()
Returns:
Returns a stateless singleton

getMustCopy

public boolean getMustCopy(org.alfresco.service.namespace.QName classQName,
                           CopyDetails copyDetails)
Default behaviour: Always copy

Parameters:
classQName - the name of the class that this is being invoked for
copyDetails - the source node's copy details for quick reference
Returns:
Returns true always

getAssociationCopyAction

public org.alfresco.util.Pair getAssociationCopyAction(org.alfresco.service.namespace.QName classQName,
                                                       CopyDetails copyDetails,
                                                       CopyBehaviourCallback.CopyAssociationDetails assocCopyDetails)
Default behaviour:
* AssocCopySourceAction#COPY_REMOVE_EXISTING
* AssocCopyTargetAction#USE_COPIED_OTHERWISE_ORIGINAL_TARGET

Specified by:
getAssociationCopyAction in interface CopyBehaviourCallback
Overrides:
getAssociationCopyAction in class AbstractCopyBehaviourCallback
Parameters:
classQName - the name of the class that this is being invoked for
copyDetails - the source node's copy details for quick reference
assocCopyDetails - all other details relating to the association
Returns:
Returns CopyBehaviourCallback.AssocCopySourceAction.COPY_REMOVE_EXISTING and CopyBehaviourCallback.AssocCopyTargetAction.USE_COPIED_TARGET

getChildAssociationCopyAction

public 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

Parameters:
classQName - the name of the class that this is being invoked for
copyDetails - the source node's copy details for quick reference
childAssocCopyDetails - all other details relating to the child association
Returns:
Returns true if the association is primary and copyChildren == true

getCopyProperties

public java.util.Map getCopyProperties(org.alfresco.service.namespace.QName classQName,
                                       CopyDetails copyDetails,
                                       java.util.Map properties)
Default behaviour: Copy all associated properties

Parameters:
classQName - the name of the class that this is being invoked for
copyDetails - the source node's copy details for quick reference
properties - 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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.