mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V1.3 to HEAD (3106:3116)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3106 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3116 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3401 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -318,7 +318,7 @@ public abstract class AbstractNodeServiceImpl implements NodeService
|
||||
/**
|
||||
* @see NodeServicePolicies.OnDeleteNodePolicy#onDeleteNode(ChildAssociationRef)
|
||||
*/
|
||||
protected void invokeOnDeleteNode(ChildAssociationRef childAssocRef, QName childNodeTypeQName, Set<QName> childAspectQnames)
|
||||
protected void invokeOnDeleteNode(ChildAssociationRef childAssocRef, QName childNodeTypeQName, Set<QName> childAspectQnames, boolean isArchivedNode)
|
||||
{
|
||||
// get qnames to invoke against
|
||||
Set<QName> qnames = new HashSet<QName>(childAspectQnames.size() + 1);
|
||||
@@ -327,7 +327,7 @@ public abstract class AbstractNodeServiceImpl implements NodeService
|
||||
|
||||
// execute policy for node type and aspects
|
||||
NodeServicePolicies.OnDeleteNodePolicy policy = onDeleteNodeDelegate.get(childAssocRef.getChildRef(), qnames);
|
||||
policy.onDeleteNode(childAssocRef);
|
||||
policy.onDeleteNode(childAssocRef, isArchivedNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -679,7 +679,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
nodeService.addAspect(nodeRef, ASPECT_QNAME_TEST_TITLED, null);
|
||||
}
|
||||
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef)
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef, boolean isArchivedNode)
|
||||
{
|
||||
// add the child to the list
|
||||
deletedNodeRefs.add(childAssocRef.getChildRef());
|
||||
|
@@ -140,9 +140,10 @@ public interface NodeServicePolicies
|
||||
* which has been deleted and cannot be used to retrieve node or associaton
|
||||
* information from any of the services.
|
||||
*
|
||||
* @param childAssocRef the primary parent-child association of the deleted node
|
||||
* @param childAssocRef the primary parent-child association of the deleted node
|
||||
* @param isNodeArchived indicates whether the node has been archived rather than purged
|
||||
*/
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef);
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef, boolean isNodeArchived);
|
||||
}
|
||||
|
||||
public interface BeforeAddAspectPolicy extends ClassPolicy
|
||||
|
@@ -451,7 +451,9 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
// invoke policy behaviour
|
||||
if (movingStore)
|
||||
{
|
||||
invokeOnDeleteNode(oldAssocRef, nodeToMoveTypeQName, nodeToMoveAspects);
|
||||
// TODO for now indicate that the node has been archived to prevent the version history from being removed
|
||||
// in the future a onMove policy could be added and remove the need for onDelete and onCreate to be fired here
|
||||
invokeOnDeleteNode(oldAssocRef, nodeToMoveTypeQName, nodeToMoveAspects, true);
|
||||
invokeOnCreateNode(newAssoc.getChildAssocRef());
|
||||
}
|
||||
else
|
||||
@@ -643,6 +645,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
|
||||
public void deleteNode(NodeRef nodeRef)
|
||||
{
|
||||
boolean isArchivedNode = false;
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeDeleteNode(nodeRef);
|
||||
|
||||
@@ -663,15 +667,17 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
{
|
||||
// perform a normal deletion
|
||||
nodeDaoService.deleteNode(node, true);
|
||||
isArchivedNode = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// archive it
|
||||
archiveNode(nodeRef, archiveStoreRef);
|
||||
isArchivedNode = true;
|
||||
}
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeOnDeleteNode(childAssocRef, nodeTypeQName, nodeAspectQNames);
|
||||
invokeOnDeleteNode(childAssocRef, nodeTypeQName, nodeAspectQNames, isArchivedNode);
|
||||
}
|
||||
|
||||
public ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName assocQName)
|
||||
|
@@ -96,7 +96,7 @@ public class NodeIndexer
|
||||
indexer.updateNode(nodeRef);
|
||||
}
|
||||
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef)
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef, boolean isArchivedNode)
|
||||
{
|
||||
indexer.deleteNode(childAssocRef);
|
||||
}
|
||||
|
@@ -335,7 +335,7 @@ public class IntegrityChecker
|
||||
/**
|
||||
* No checking performed: The association changes will be handled
|
||||
*/
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef)
|
||||
public void onDeleteNode(ChildAssociationRef childAssocRef, boolean isArchivedNode)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user