diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java index 2b53e8dabd..f004cec040 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java @@ -38,7 +38,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; -import org.springframework.extensions.webscripts.GUID; /** diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordsManagementSearchBehaviour.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordsManagementSearchBehaviour.java index 62a665882a..320b84c629 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordsManagementSearchBehaviour.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordsManagementSearchBehaviour.java @@ -452,24 +452,32 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel * * @param childAssocRef child association reference */ - public void dispositionActionCreate(ChildAssociationRef childAssocRef) + public void dispositionActionCreate(final ChildAssociationRef childAssocRef) { - NodeRef child = childAssocRef.getChildRef(); - if (nodeService.exists(child) && - childAssocRef.getTypeQName().equals(ASSOC_NEXT_DISPOSITION_ACTION)) - { - // Get the record (or record folder) - NodeRef record = childAssocRef.getParentRef(); + AuthenticationUtil.runAsSystem(new RunAsWork() + { + public Void doWork() throws Exception + { + NodeRef child = childAssocRef.getChildRef(); + if (nodeService.exists(child) && + childAssocRef.getTypeQName().equals(ASSOC_NEXT_DISPOSITION_ACTION)) + { + // Get the record (or record folder) + NodeRef record = childAssocRef.getParentRef(); - // Apply the search aspect - applySearchAspect(record); + // Apply the search aspect + applySearchAspect(record); - // Update disposition properties - updateDispositionActionProperties(record, childAssocRef.getChildRef()); + // Update disposition properties + updateDispositionActionProperties(record, childAssocRef.getChildRef()); - // Clear the events - nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, null); - } + // Clear the events + nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, null); + } + + return null; + } + }); } /** diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java index 6520d914bf..0cc4cd45f2 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordServiceImpl.java @@ -780,8 +780,16 @@ public class RecordServiceImpl extends BaseBehaviourBean // get the documents primary parent assoc ChildAssociationRef parentAssoc = nodeService.getPrimaryParent(nodeRef); - // move the document into the file plan - nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName()); + behaviourFilter.disableBehaviour(); + try + { + // move the document into the file plan + nodeService.moveNode(nodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName()); + } + finally + { + behaviourFilter.enableBehaviour(); + } // save the information about the originating details Map aspectProperties = new HashMap(3); @@ -928,7 +936,15 @@ public class RecordServiceImpl extends BaseBehaviourBean postfix = name.substring(dotIndex); } String recordName = prefix + " (" + recordId + ")" + postfix; - fileFolderService.rename(document, recordName); + behaviourFilter.disableBehaviour(); + try + { + fileFolderService.rename(document, recordName); + } + finally + { + behaviourFilter.enableBehaviour(); + } if (logger.isDebugEnabled()) {