Enhanced 'beforeCreateChildAssociaton' and 'onCreateChildAssociation' to carry an 'isNewNode' flag.

Fixed Lock and Rules to react correctly to this new information.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6003 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-18 11:29:00 +00:00
parent 832c1b599e
commit 6e0c406488
9 changed files with 106 additions and 45 deletions

View File

@@ -322,7 +322,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
NodeRef childNodeRef = childNode.getNodeRef();
// We now have enough to declare the child association creation
invokeBeforeCreateChildAssociation(parentRef, childNodeRef, assocTypeQName, assocQName);
invokeBeforeCreateChildAssociation(parentRef, childNodeRef, assocTypeQName, assocQName, true);
// Get the parent node
Node parentNode = getNodeNotNull(parentRef);
@@ -354,7 +354,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// Invoke policy behaviour
invokeOnCreateNode(childAssocRef);
invokeOnCreateChildAssociation(childAssocRef);
invokeOnCreateChildAssociation(childAssocRef, true);
if (propertiesAfter != null)
{
invokeOnUpdateProperties(childAssocRef.getChildRef(), propertiesBefore, propertiesAfter);
@@ -427,7 +427,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
else
{
invokeBeforeDeleteChildAssociation(oldAssocRef);
invokeBeforeCreateChildAssociation(newParentRef, nodeToMoveRef, assocTypeQName, assocQName);
invokeBeforeCreateChildAssociation(newParentRef, nodeToMoveRef, assocTypeQName, assocQName, false);
}
// remove the child assoc from the old parent
@@ -467,7 +467,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
else
{
invokeOnCreateChildAssociation(newAssoc.getChildAssocRef());
invokeOnCreateChildAssociation(newAssoc.getChildAssocRef(), false);
invokeOnDeleteChildAssociation(oldAssoc.getChildAssocRef());
}
invokeOnMoveNode(oldAssocRef, newAssocRef);
@@ -741,7 +741,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
public ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName assocQName)
{
// Invoke policy behaviours
invokeBeforeCreateChildAssociation(parentRef, childRef, assocTypeQName, assocQName);
invokeBeforeCreateChildAssociation(parentRef, childRef, assocTypeQName, assocQName, false);
// get the parent node and ensure that it is a container node
Node parentNode = getNodeNotNull(parentRef);
@@ -764,7 +764,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
getPaths(childNodeRef, false);
// Invoke policy behaviours
invokeOnCreateChildAssociation(assocRef);
invokeOnCreateChildAssociation(assocRef, false);
return assoc.getChildAssocRef();
}