From e54ab8dcead8e40d84f816ace7771f25e60c2cd4 Mon Sep 17 00:00:00 2001 From: Elena Hardon Date: Thu, 21 Dec 2017 10:58:30 +0200 Subject: [PATCH] RM-5970 - Removed onCopyComplete method from RecordComponentIdentifierAspect because it was overwriting the existing unique id for a record on copy to action --- .../RecordComponentIdentifierAspect.java | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordComponentIdentifierAspect.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordComponentIdentifierAspect.java index 8395eb92ea..7238e68188 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordComponentIdentifierAspect.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordComponentIdentifierAspect.java @@ -63,8 +63,7 @@ import org.springframework.extensions.surf.util.I18NUtil; ) public class RecordComponentIdentifierAspect extends BaseBehaviourBean implements NodeServicePolicies.OnUpdatePropertiesPolicy, - NodeServicePolicies.BeforeDeleteNodePolicy, - CopyServicePolicies.OnCopyCompletePolicy + NodeServicePolicies.BeforeDeleteNodePolicy { /** I18N */ private static final String MSG_SET_ID = "rm.service.set-id"; @@ -177,31 +176,6 @@ public class RecordComponentIdentifierAspect extends BaseBehaviourBean return new DoNothingCopyBehaviourCallback(); } - @SuppressWarnings("rawtypes") - @Override - @Behaviour - ( - kind = BehaviourKind.CLASS, - notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT - ) - public void onCopyComplete(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef, boolean copyToNewNode, Map copyMap) - { - //Generate the id for the copy - String id = identifierService.generateIdentifier( - nodeService.getType(nodeService.getPrimaryParent(targetNodeRef).getParentRef()), - nodeService.getPrimaryParent(targetNodeRef).getParentRef()); - - //We need to allow the id to be overwritten disable the policy protecting changes to the id - behaviourFilter.disableBehaviour(); - try - { - nodeService.setProperty(targetNodeRef, PROP_IDENTIFIER, id); - } - finally - { - behaviourFilter.enableBehaviour(); - } - } /** * Updates the uniqueness check using the values provided. If the after value is null