Interface CopyServicePolicies
A typical registration and invocation would look like this:
public void init()
{
this.policyComponent.bindClassBehaviour(
OnCopyNodePolicy.QNAME,
ActionModel.ASPECT_ACTIONS,
new JavaBehaviour(this, "getCopyCallback"));
this.policyComponent.bindClassBehaviour(
OnCopyCompletePolicy.QNAME,
ActionModel.ASPECT_ACTIONS,
new JavaBehaviour(this, "onCopyComplete"));
...
}
public CopyBehaviourCallback getCopyCallback(QName classRef, CopyDetails copyDetails)
{
return new XyzAspectCopyBehaviourCallback();
}
private static class XyzAspectCopyBehaviourCallback extends DefaultCopyBehaviourCallback
{
// Override methods any to achieve the desired behaviour
public boolean mustCopyChildAssociation(QName classQName, CopyDetails copyDetails, ChildAssociationRef childAssocRef)
{
...
}
}
public void onCopyComplete(
NodeRef sourceNodeRef,
NodeRef targetNodeRef,
boolean copyToNewNode,
Map<NodeRef,NodeRef> copyMap)
{
...
}
- Author:
- Derek Hulley
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe intermediate copy callback, which occurs once it has been decided which properties and aspects will be copied, but before the copy occurs.static interfaceFinal callback after the copy (including any cascading) has been completed.static interfacePolicy invoked when a node is copied.