mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
- Addition of copyToNew flag to onCopyComplete policy for Gav
- Implementation and unit tests for admin web service - Implementation and unit tests for access control web service git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2222 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -154,6 +154,7 @@ public class ActionsAspect
|
|||||||
QName classRef,
|
QName classRef,
|
||||||
NodeRef sourceNodeRef,
|
NodeRef sourceNodeRef,
|
||||||
NodeRef destinationRef,
|
NodeRef destinationRef,
|
||||||
|
boolean copyToNew,
|
||||||
Map<NodeRef, NodeRef> copyMap)
|
Map<NodeRef, NodeRef> copyMap)
|
||||||
{
|
{
|
||||||
this.onAddAspectBehaviour.enable();
|
this.onAddAspectBehaviour.enable();
|
||||||
|
@@ -172,7 +172,7 @@ public class CopyServiceImpl implements CopyService
|
|||||||
// Foreach of the newly created copies call the copy complete policy
|
// Foreach of the newly created copies call the copy complete policy
|
||||||
for (Map.Entry<NodeRef, NodeRef> entry : copiedChildren.entrySet())
|
for (Map.Entry<NodeRef, NodeRef> entry : copiedChildren.entrySet())
|
||||||
{
|
{
|
||||||
invokeCopyComplete(entry.getKey(), entry.getValue(), copiedChildren);
|
invokeCopyComplete(entry.getKey(), entry.getValue(), true, copiedChildren);
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
@@ -188,16 +188,17 @@ public class CopyServiceImpl implements CopyService
|
|||||||
private void invokeCopyComplete(
|
private void invokeCopyComplete(
|
||||||
NodeRef sourceNodeRef,
|
NodeRef sourceNodeRef,
|
||||||
NodeRef destinationNodeRef,
|
NodeRef destinationNodeRef,
|
||||||
|
boolean copyToNewNode,
|
||||||
Map<NodeRef, NodeRef> copiedNodeRefs)
|
Map<NodeRef, NodeRef> copiedNodeRefs)
|
||||||
{
|
{
|
||||||
QName sourceClassRef = this.nodeService.getType(sourceNodeRef);
|
QName sourceClassRef = this.nodeService.getType(sourceNodeRef);
|
||||||
invokeCopyComplete(sourceClassRef, sourceNodeRef, destinationNodeRef, copiedNodeRefs);
|
invokeCopyComplete(sourceClassRef, sourceNodeRef, destinationNodeRef, copyToNewNode, copiedNodeRefs);
|
||||||
|
|
||||||
// Get the source aspects
|
// Get the source aspects
|
||||||
Set<QName> sourceAspects = this.nodeService.getAspects(sourceNodeRef);
|
Set<QName> sourceAspects = this.nodeService.getAspects(sourceNodeRef);
|
||||||
for (QName sourceAspect : sourceAspects)
|
for (QName sourceAspect : sourceAspects)
|
||||||
{
|
{
|
||||||
invokeCopyComplete(sourceAspect, sourceNodeRef, destinationNodeRef, copiedNodeRefs);
|
invokeCopyComplete(sourceAspect, sourceNodeRef, destinationNodeRef, copyToNewNode, copiedNodeRefs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,6 +213,7 @@ public class CopyServiceImpl implements CopyService
|
|||||||
QName typeQName,
|
QName typeQName,
|
||||||
NodeRef sourceNodeRef,
|
NodeRef sourceNodeRef,
|
||||||
NodeRef destinationNodeRef,
|
NodeRef destinationNodeRef,
|
||||||
|
boolean copyToNewNode,
|
||||||
Map<NodeRef, NodeRef> copiedNodeRefs)
|
Map<NodeRef, NodeRef> copiedNodeRefs)
|
||||||
{
|
{
|
||||||
Collection<CopyServicePolicies.OnCopyCompletePolicy> policies = this.onCopyCompleteDelegate.getList(typeQName);
|
Collection<CopyServicePolicies.OnCopyCompletePolicy> policies = this.onCopyCompleteDelegate.getList(typeQName);
|
||||||
@@ -223,7 +225,7 @@ public class CopyServiceImpl implements CopyService
|
|||||||
{
|
{
|
||||||
for (CopyServicePolicies.OnCopyCompletePolicy policy : policies)
|
for (CopyServicePolicies.OnCopyCompletePolicy policy : policies)
|
||||||
{
|
{
|
||||||
policy.onCopyComplete(typeQName, sourceNodeRef, destinationNodeRef, copiedNodeRefs);
|
policy.onCopyComplete(typeQName, sourceNodeRef, destinationNodeRef, copyToNewNode, copiedNodeRefs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -723,6 +725,11 @@ public class CopyServiceImpl implements CopyService
|
|||||||
copyProperties(destinationNodeRef, copyDetails);
|
copyProperties(destinationNodeRef, copyDetails);
|
||||||
copyAspects(destinationNodeRef, copyDetails);
|
copyAspects(destinationNodeRef, copyDetails);
|
||||||
copyAssociations(destinationNodeRef, copyDetails, false, new HashMap<NodeRef, NodeRef>());
|
copyAssociations(destinationNodeRef, copyDetails, false, new HashMap<NodeRef, NodeRef>());
|
||||||
|
|
||||||
|
// invoke the copy complete policy
|
||||||
|
Map<NodeRef, NodeRef> copiedNodes = new HashMap<NodeRef, NodeRef>(1);
|
||||||
|
copiedNodes.put(sourceNodeRef, destinationNodeRef);
|
||||||
|
invokeCopyComplete(sourceNodeRef, destinationNodeRef, false, copiedNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -750,6 +757,7 @@ public class CopyServiceImpl implements CopyService
|
|||||||
QName classRef,
|
QName classRef,
|
||||||
NodeRef sourceNodeRef,
|
NodeRef sourceNodeRef,
|
||||||
NodeRef destinationRef,
|
NodeRef destinationRef,
|
||||||
|
boolean copyToNew,
|
||||||
Map<NodeRef, NodeRef> copyMap)
|
Map<NodeRef, NodeRef> copyMap)
|
||||||
{
|
{
|
||||||
// Do nothing since we do not want the copy from aspect to be relative to the copied nodes
|
// Do nothing since we do not want the copy from aspect to be relative to the copied nodes
|
||||||
|
@@ -67,6 +67,7 @@ public interface CopyServicePolicies
|
|||||||
QName classRef,
|
QName classRef,
|
||||||
NodeRef sourceNodeRef,
|
NodeRef sourceNodeRef,
|
||||||
NodeRef destinationRef,
|
NodeRef destinationRef,
|
||||||
|
boolean copyToNewNode,
|
||||||
Map<NodeRef, NodeRef> copyMap);
|
Map<NodeRef, NodeRef> copyMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -152,6 +152,7 @@ public class RulesAspect
|
|||||||
QName classRef,
|
QName classRef,
|
||||||
NodeRef sourceNodeRef,
|
NodeRef sourceNodeRef,
|
||||||
NodeRef destinationRef,
|
NodeRef destinationRef,
|
||||||
|
boolean copyToNew,
|
||||||
Map<NodeRef, NodeRef> copyMap)
|
Map<NodeRef, NodeRef> copyMap)
|
||||||
{
|
{
|
||||||
this.onAddAspectBehaviour.enable();
|
this.onAddAspectBehaviour.enable();
|
||||||
|
Reference in New Issue
Block a user