diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml
index dfd2820d82..8121e7d2a9 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml
@@ -37,44 +37,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -110,17 +70,31 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -128,10 +102,24 @@
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
@@ -1169,7 +1168,7 @@
org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.isRecordFolderClosed=RM.Read.0
org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.createRecordFolder=RM.Write.0
org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.getRecordFolders=RM.Read.0,AFTER_RM.FilterNode
- org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.initialiseRecordFolder=RM.Read.0
+ org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.setupRecordFolder=RM.Read.0
org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.closeRecordFolder=RM_CAP.0.rma:filePlanComponent.CloseFolders
org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService.*=RM_DENY
]]>
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dataset/DataSetServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dataset/DataSetServiceImpl.java
index 2d2cb23a1d..6701adce27 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dataset/DataSetServiceImpl.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/dataset/DataSetServiceImpl.java
@@ -438,7 +438,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
{
// Fire action to "set-up" the folder correctly
logger.info("Setting up bootstraped record folder: " + folderName);
- recordFolderService.initialiseRecordFolder(recordFolder);
+ recordFolderService.setupRecordFolder(recordFolder);
}
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanComponentAspect.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanComponentAspect.java
deleted file mode 100644
index 8d19f6143c..0000000000
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanComponentAspect.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
-import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
-import org.alfresco.repo.copy.AbstractCopyBehaviourCallback;
-import org.alfresco.repo.copy.CopyBehaviourCallback;
-import org.alfresco.repo.copy.CopyDetails;
-import org.alfresco.repo.node.NodeServicePolicies;
-import org.alfresco.repo.policy.JavaBehaviour;
-import org.alfresco.repo.policy.PolicyComponent;
-import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-
-/**
- * Behaviour associated with the file plan component aspect
- *
- * @author Roy Wetherall
- */
-public class FilePlanComponentAspect implements RecordsManagementModel,
- NodeServicePolicies.OnAddAspectPolicy,
- NodeServicePolicies.OnMoveNodePolicy
-{
- /** Policy component */
- private PolicyComponent policyComponent;
-
- /** Node service */
- private NodeService nodeService;
-
- /** File plan service */
- private FilePlanService filePlanService;
-
- /**
- * Set the policy component
- * @param policyComponent policy component
- */
- public void setPolicyComponent(PolicyComponent policyComponent)
- {
- this.policyComponent = policyComponent;
- }
-
- /**
- * Set node service
- * @param nodeService node service
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- /**
- * @param filePlanService file plan service
- */
- public void setFilePlanService(FilePlanService filePlanService)
- {
- this.filePlanService = filePlanService;
- }
-
- /**
- * Bean initialisation method
- */
- public void init()
- {
- policyComponent.bindClassBehaviour(
- NodeServicePolicies.OnAddAspectPolicy.QNAME,
- ASPECT_FILE_PLAN_COMPONENT,
- new JavaBehaviour(this, "onAddAspect", NotificationFrequency.TRANSACTION_COMMIT));
- policyComponent.bindClassBehaviour(
- NodeServicePolicies.OnMoveNodePolicy.QNAME,
- ASPECT_FILE_PLAN_COMPONENT,
- new JavaBehaviour(this, "onMoveNode", NotificationFrequency.TRANSACTION_COMMIT));
- this.policyComponent.bindClassBehaviour(
- QName.createQName(NamespaceService.ALFRESCO_URI, "getCopyCallback"),
- ASPECT_FILE_PLAN_COMPONENT,
- new JavaBehaviour(this, "getCopyCallback"));
- }
-
- /**
- * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
- */
- @Override
- public void onAddAspect(final NodeRef nodeRef, final QName aspectTypeQName)
- {
- AuthenticationUtil.runAs(new RunAsWork()
- {
- @Override
- public Void doWork() throws Exception
- {
- if (nodeService.exists(nodeRef) == true)
- {
- // Look up the root and set on the aspect if found
- NodeRef root = filePlanService.getFilePlan(nodeRef);
- if (root != null)
- {
- nodeService.setProperty(nodeRef, PROP_ROOT_NODEREF, root);
- }
- }
-
- return null;
- }
- }, AuthenticationUtil.getSystemUserName());
- }
-
- /**
- * @see org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy#onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef, org.alfresco.service.cmr.repository.ChildAssociationRef)
- */
- @Override
- public void onMoveNode(final ChildAssociationRef oldChildAssocRef, final ChildAssociationRef newChildAssocRef)
- {
- AuthenticationUtil.runAs(new RunAsWork()
- {
- @Override
- public Void doWork() throws Exception
- {
- if (nodeService.exists(newChildAssocRef.getParentRef()) == true &&
- nodeService.exists(newChildAssocRef.getChildRef()) == true)
- {
- // Look up the root and re-set the value currently stored on the aspect
- NodeRef root = filePlanService.getFilePlan(newChildAssocRef.getParentRef());
- // NOTE: set the null value if no root found
- nodeService.setProperty(newChildAssocRef.getChildRef(), PROP_ROOT_NODEREF, root);
- }
-
- return null;
- }
- }, AuthenticationUtil.getSystemUserName());
- }
-
- /**
- * Copy behaviour call back
- *
- * @param classRef class reference
- * @param copyDetail details of the information being copied
- * @return CopyBehaviourCallback
- */
- public CopyBehaviourCallback getCopyCallback(QName classRef, CopyDetails copyDetails)
- {
- return new AbstractCopyBehaviourCallback()
- {
- /**
- * @see org.alfresco.repo.copy.CopyBehaviourCallback#getChildAssociationCopyAction(org.alfresco.service.namespace.QName, org.alfresco.repo.copy.CopyDetails, org.alfresco.repo.copy.CopyBehaviourCallback.CopyChildAssociationDetails)
- */
- public ChildAssocCopyAction getChildAssociationCopyAction(
- QName classQName,
- CopyDetails copyDetails,
- CopyChildAssociationDetails childAssocCopyDetails)
- {
- // Do not copy the associations
- return null;
- }
-
- /**
- * @see org.alfresco.repo.copy.CopyBehaviourCallback#getCopyProperties(org.alfresco.service.namespace.QName, org.alfresco.repo.copy.CopyDetails, java.util.Map)
- */
- public Map getCopyProperties(
- QName classQName,
- CopyDetails copyDetails,
- Map properties)
- {
- // Only copy the root node reference if the new value can be looked up via the parent
- NodeRef root = filePlanService.getFilePlan(copyDetails.getTargetParentNodeRef());
- if (root != null)
- {
- properties.put(PROP_ROOT_NODEREF, root);
- }
- return properties;
- }
-
- /**
- * @see org.alfresco.repo.copy.CopyBehaviourCallback#getMustCopy(org.alfresco.service.namespace.QName, org.alfresco.repo.copy.CopyDetails)
- */
- public boolean getMustCopy(QName classQName, CopyDetails copyDetails)
- {
- // Ensure the aspect is copied
- return true;
- }
- };
- }
-}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordComponentIdentifierAspect.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordComponentIdentifierAspect.java
deleted file mode 100644
index 342e9b71c1..0000000000
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RecordComponentIdentifierAspect.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
-import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
-import org.alfresco.repo.node.NodeServicePolicies;
-import org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy;
-import org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy;
-import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
-import org.alfresco.repo.policy.JavaBehaviour;
-import org.alfresco.repo.policy.PolicyComponent;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
-import org.alfresco.service.cmr.attributes.AttributeService;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.PropertyCheck;
-
-/**
- * Record component identifier aspect behaviour
- *
- * @author Roy Wetherall
- */
-public class RecordComponentIdentifierAspect
- implements NodeServicePolicies.OnUpdatePropertiesPolicy,
- NodeServicePolicies.BeforeDeleteNodePolicy,
- RecordsManagementModel
-{
- private static final String CONTEXT_VALUE = "rma:identifier";
-
- private PolicyComponent policyComponent;
- private NodeService nodeService;
- private AttributeService attributeService;
- private FilePlanService filePlanService;
-
- /**
- * @param policyComponent the policyComponent to set
- */
- public void setPolicyComponent(PolicyComponent policyComponent)
- {
- this.policyComponent = policyComponent;
- }
-
- /**
- * @param nodeService the nodeService to set
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- /**
- * Set the component to manage the unique properties
- */
- public void setAttributeService(AttributeService attributeService)
- {
- this.attributeService = attributeService;
- }
-
- public void setFilePlanService(FilePlanService filePlanService)
- {
- this.filePlanService = filePlanService;
- }
-
- /**
- * Initialise method
- */
- public void init()
- {
- PropertyCheck.mandatory(this, "policyComponent", policyComponent);
- PropertyCheck.mandatory(this, "nodeService", nodeService);
- PropertyCheck.mandatory(this, "attributeService", attributeService);
-
- policyComponent.bindClassBehaviour(
- OnUpdatePropertiesPolicy.QNAME,
- ASPECT_RECORD_COMPONENT_ID,
- new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.EVERY_EVENT));
- policyComponent.bindClassBehaviour(
- BeforeDeleteNodePolicy.QNAME,
- ASPECT_RECORD_COMPONENT_ID,
- new JavaBehaviour(this, "beforeDeleteNode", NotificationFrequency.EVERY_EVENT));
- }
-
- /**
- * Ensures that the {@link RecordsManagementModel#PROP_IDENTIFIER rma:identifier} property remains
- * unique within the context of the parent node.
- */
- public void onUpdateProperties(final NodeRef nodeRef, final Map before, final Map after)
- {
- AuthenticationUtil.runAs(new RunAsWork