diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/action-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/action-context.xml
index b308c58434..3179870f95 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/action-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/action-context.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-group-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-group-context.xml
index 8b06e20f26..555f89a78d 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-group-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-group-context.xml
@@ -6,6 +6,7 @@
+
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml
index 754d382efd..50d4493ca5 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml
@@ -90,8 +90,8 @@
-
- New Records Container
+
+ Unfiled Record Container
rma:recordsManagementContainer
@@ -624,14 +624,14 @@
-
- New Records
+
+ Unfiled Records
true
false
- rma:newRecordsContainer
+ rma:unfiledRecordContainer
true
true
@@ -844,13 +844,12 @@
-
+
-
+
- d:text
- true
+ d:any
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/module-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/module-context.xml
index 139c502bb0..6c663e725c 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/module-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/module-context.xml
@@ -46,12 +46,12 @@
-
+
-
+
+
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml
index 937a12005d..d27cff9d0d 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml
@@ -67,6 +67,7 @@
org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.isFilePlanComponent=RM.Read.0
org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.getFilePlanComponentKind=ACL_NODE.0.sys:base.ReadProperties, RM.Read.0
org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.getFilePlanComponentKindFromType=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.isRecordsManagementContainer=RM.Read.0
org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.isFilePlan=RM.Read.0
org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.isRecordCategory=RM.Read.0
org.alfresco.module.org_alfresco_module_rm.RecordsManagementService.isRecordFolder=RM.Read.0
@@ -480,7 +481,12 @@
org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.createRole=RM_ALLOW
org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.updateRole=RM_ALLOW
org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.deleteRole=RM_ALLOW
- org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.assignRoleToAuthority=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.assignRoleToAuthority=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.getExtendedReaders=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.setExtendedReaders=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.removeExtendedReaders=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.removeAllExtendedReaders=RM_ALLOW
+ org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService.*=RM_DENY
]]>
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml
index 72a35ea07a..925fa0cee7 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml
@@ -7,6 +7,7 @@
class="org.alfresco.module.org_alfresco_module_rm.jscript.app.JSONConversionComponent"
parent="baseJsonConversionComponent">
+
@@ -14,6 +15,7 @@
abstract="true">
+
diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-filters.lib.js b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-filters.lib.js
index 25a0234d47..fa31ed974e 100644
--- a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-filters.lib.js
+++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-filters.lib.js
@@ -179,6 +179,13 @@ Filters.getFilterParams = function RecordsManagementFilter_getFilterParams(filte
filterParams.query = "+PARENT:\"" + filterData + "\"";
}
break;
+
+ case "unfiledRecords":
+ filterParams.variablePath = false;
+ filterQuery = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "/rma:Unfiled_x0020_Records/*\"";
+ filterParams.query = filterQuery + filterQueryDefaults;
+
+ break;
default:
filterParams.variablePath = false;
diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js
index 09c27856d2..8dd5e01d78 100644
--- a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js
+++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/rm-treenode.get.js
@@ -120,7 +120,7 @@ function itemIsAllowed(item)
var typeShort = String(item.typeShort);
// Don't show Hold and Transfer top-level containers
- if (typeShort == "rma:hold" || typeShort == "rma:transfer")
+ if (typeShort == "rma:hold" || typeShort == "rma:transfer" || typeShort == "rma:unfiledRecordContainer")
{
return false;
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementService.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementService.java
index cf6fe257c5..3d25fb2bfe 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementService.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementService.java
@@ -73,6 +73,14 @@ public interface RecordsManagementService
*/
FilePlanComponentKind getFilePlanComponentKindFromType(QName type);
+ /**
+ * Indicates whether the given node is a records management container or not.
+ *
+ * @param nodeRef node reference
+ * @return boolean true if node is a record container, false otherwise.
+ */
+ boolean isRecordsManagementContainer(NodeRef nodeRef);
+
/**
* Indicates whether the given node is file plan node or not.
*
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java
index 6c09f8bea4..eef43031b7 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java
@@ -436,6 +436,15 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
return instanceOf(nodeRef, TYPE_FILE_PLAN);
}
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementService#isRecordsManagementContainer(org.alfresco.service.cmr.repository.NodeRef)
+ */
+ @Override
+ public boolean isRecordsManagementContainer(NodeRef nodeRef)
+ {
+ return instanceOf(nodeRef, TYPE_RECORDS_MANAGEMENT_CONTAINER);
+ }
+
/**
* Utility method to safely and quickly determine if a node is a type (or sub-type) of the one specified.
*/
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java
index 6da56869ab..89f8c020e2 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/dm/CreateRecordAction.java
@@ -18,19 +18,14 @@
*/
package org.alfresco.module.org_alfresco_module_rm.action.dm;
-import java.io.Serializable;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
-import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
-import org.alfresco.module.org_alfresco_module_rm.permission.RecordReadersDynamicAuthority;
-import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
+import org.alfresco.module.org_alfresco_module_rm.security.RecordsManagementSecurityService;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
@@ -40,7 +35,6 @@ 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.cmr.security.PermissionService;
-import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
/**
@@ -56,8 +50,8 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
public static final String NAME = "create-record";
private RecordsManagementService recordsManagementService;
-
- private RecordService recordService;
+
+ private RecordsManagementSecurityService recordsManagementSecurityService;
private PermissionService permissionService;
@@ -68,9 +62,9 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
this.recordsManagementService = recordsManagementService;
}
- public void setRecordService(RecordService recordService)
+ public void setRecordsManagementSecurityService(RecordsManagementSecurityService recordsManagementSecurityService)
{
- this.recordService = recordService;
+ this.recordsManagementSecurityService = recordsManagementSecurityService;
}
public void setPermissionService(PermissionService permissionService)
@@ -111,29 +105,15 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
{
throw new AlfrescoRuntimeException("Unable to create record, because new record container could not be found.");
}
-
+
// move the document into the file plan
nodeService.moveNode(actionedUponNodeRef, newRecordContainer, ContentModel.ASSOC_CONTAINS, parentAssoc.getQName());
// maintain the original primary location
nodeService.addChild(parentAssoc.getParentRef(), actionedUponNodeRef, parentAssoc.getTypeQName(), parentAssoc.getQName());
- // add extended security information to the record
- Map props = new HashMap(1);
- props.put(PROP_READERS, (Serializable)readers);
- nodeService.addAspect(actionedUponNodeRef, ASPECT_EXTENDED_RECORD_SECURITY, props);
-
- // add permission so readers can still 'see' the new record
- // Note: using the regular permission service as we don't want to reflect this permission up (and down) the
- // hierarchy
- permissionService.setPermission(actionedUponNodeRef,
- RecordReadersDynamicAuthority.RECORD_READERS,
- RMPermissionModel.READ_RECORDS,
- true);
- permissionService.setPermission(filePlan,
- RecordReadersDynamicAuthority.RECORD_READERS,
- RMPermissionModel.VIEW_RECORDS,
- true);
+ // set the readers
+ recordsManagementSecurityService.setExtendedReaders(actionedUponNodeRef, readers);
return null;
}
@@ -141,13 +121,13 @@ public class CreateRecordAction extends ActionExecuterAbstractBase
}
else
{
- throw new AlfrescoRuntimeException("Unable to file file plan.");
+ throw new AlfrescoRuntimeException("Unable to find file plan.");
}
}
private NodeRef getNewRecordContainer(NodeRef filePlan)
{
- List assocs = nodeService.getChildAssocs(filePlan, ASSOC_NEW_RECORDS, RegexQNamePattern.MATCH_ALL);
+ List assocs = nodeService.getChildAssocs(filePlan, ASSOC_UNFILED_RECORDS, RegexQNamePattern.MATCH_ALL);
if (assocs.size() != 1)
{
throw new AlfrescoRuntimeException("Error getting the new record container, because the container cannot be indentified.");
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java
index e0ca52355d..7d725a9d1a 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMAfterInvocationProvider.java
@@ -61,6 +61,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
+/**
+ * RM After Invocation Provider
+ */
public class RMAfterInvocationProvider extends RMSecurityCommon
implements AfterInvocationProvider, InitializingBean
{
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 d2dde825dc..756faefff9 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
@@ -31,6 +31,9 @@ import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
/**
* @author Roy Wetherall
@@ -42,10 +45,11 @@ public class RMSecurityCommon
private static Log logger = LogFactory.getLog(RMSecurityCommon.class);
+ private ApplicationContext applicationContext;
+
protected NodeService nodeService;
protected PermissionService permissionService;
protected RecordsManagementService rmService;
- protected RecordService recordService;
protected RMCaveatConfigComponent caveatConfigComponent;
public void setNodeService(NodeService nodeService)
@@ -63,11 +67,6 @@ public class RMSecurityCommon
this.rmService = rmService;
}
- public void setRecordService(RecordService recordService)
- {
- this.recordService = recordService;
- }
-
public void setCaveatConfigComponent(RMCaveatConfigComponent caveatConfigComponent)
{
this.caveatConfigComponent = caveatConfigComponent;
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/CreateCapability.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/CreateCapability.java
index e4acc7b194..c606f4a7b7 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/CreateCapability.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/capability/impl/CreateCapability.java
@@ -26,6 +26,7 @@ import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
import org.alfresco.module.org_alfresco_module_rm.capability.declarative.DeclarativeCapability;
+import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.namespace.QName;
@@ -37,6 +38,13 @@ import org.alfresco.service.namespace.QName;
*/
public class CreateCapability extends DeclarativeCapability
{
+ private RecordService recordService;
+
+ public void setRecordService(RecordService recordService)
+ {
+ this.recordService = recordService;
+ }
+
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef)
*/
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/RecordsManagementModel.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/RecordsManagementModel.java
index 992059c02a..6a18bf9a60 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/RecordsManagementModel.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/RecordsManagementModel.java
@@ -57,8 +57,8 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
// Records management root container
public static final QName TYPE_FILE_PLAN = QName.createQName(RM_URI, "filePlan");
- // New records container
- public static final QName TYPE_NEW_RECORDS_CONTAINER = QName.createQName(RM_URI, "newRecordsContainer");
+ // Unfiled record container
+ public static final QName TYPE_UNFILED_RECORD_CONTAINER = QName.createQName(RM_URI, "unfiledRecordContainer");
// Disposition instructions aspect
public static final QName ASPECT_SCHEDULED = QName.createQName(RM_URI, "scheduled");
@@ -170,7 +170,7 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
public static final QName ASPECT_RECORDS_MANAGEMENT_ROOT = QName.createQName(RM_URI, "recordsManagementRoot");
public static final QName ASSOC_HOLDS = QName.createQName(RM_URI, "holds");
public static final QName ASSOC_TRANSFERS = QName.createQName(RM_URI, "transfers");
- public static final QName ASSOC_NEW_RECORDS = QName.createQName(RM_URI, "newRecords");
+ public static final QName ASSOC_UNFILED_RECORDS = QName.createQName(RM_URI, "unfiledRecords");
// Hold type
public static final QName TYPE_HOLD = QName.createQName(RM_URI, "hold");
@@ -224,7 +224,7 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
public static final QName PROP_RS_DISPOITION_AUTHORITY = QName.createQName(RM_URI, "recordSearchDispositionAuthority");
public static final QName PROP_RS_HOLD_REASON = QName.createQName(RM_URI, "recordSearchHoldReason");
- // Extended record security aspect
- public static final QName ASPECT_EXTENDED_RECORD_SECURITY = QName.createQName(RM_URI, "extendedRecordSecurity");
+ // Extended readers aspect
+ public static final QName ASPECT_EXTENDED_READERS = QName.createQName(RM_URI, "extendedReaders");
public static final QName PROP_READERS = QName.createQName(RM_URI, "readers");
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanType.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanType.java
index 5f961b6185..350e2ea7a9 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanType.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/FilePlanType.java
@@ -18,21 +18,12 @@
*/
package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
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.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.PermissionService;
-import org.alfresco.service.namespace.QName;
/**
* Behaviour associated with the file plan type
@@ -82,10 +73,10 @@ public class FilePlanType implements RecordsManagementModel,
*/
public void init()
{
- policyComponent.bindClassBehaviour(
- NodeServicePolicies.OnCreateNodePolicy.QNAME,
- TYPE_FILE_PLAN,
- new JavaBehaviour(this, "onCreateNode", NotificationFrequency.TRANSACTION_COMMIT));
+ // policyComponent.bindClassBehaviour(
+ // NodeServicePolicies.OnCreateNodePolicy.QNAME,
+ // TYPE_FILE_PLAN,
+ // new JavaBehaviour(this, "onCreateNode", NotificationFrequency.TRANSACTION_COMMIT));
}
/**
@@ -94,22 +85,6 @@ public class FilePlanType implements RecordsManagementModel,
@Override
public void onCreateNode(ChildAssociationRef assoc)
{
- // grab the newly created file plan
- NodeRef filePlan = assoc.getChildRef();
-
- // create the properties map
- Map properties = new HashMap(1);
- properties.put(ContentModel.PROP_NAME, NAME_NR_CONTAINER);
-
- // create the 'new records' folder
- NodeRef container = nodeService.createNode(
- filePlan,
- ASSOC_NEW_RECORDS,
- QName.createQName(RM_URI, NAME_NR_CONTAINER),
- TYPE_NEW_RECORDS_CONTAINER,
- properties).getChildRef();
-
- // set inheritance to false
- permissionService.setInheritParentPermissions(container, false);
+ // TODO refactor the file plan behaviours from the service code
}
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RmSiteType.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RmSiteType.java
index c66039c5a0..51a0ea48de 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RmSiteType.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/behaviour/RmSiteType.java
@@ -56,6 +56,9 @@ public class RmSiteType implements RecordsManagementModel,
/** Record Management Search Service */
private RecordsManagementSearchService recordsManagementSearchService;
+ /** Behaviour */
+ JavaBehaviour behaviour = new JavaBehaviour(this, "onCreateNode", NotificationFrequency.FIRST_EVENT);
+
/**
* Set the policy component
* @param policyComponent policy component
@@ -99,7 +102,7 @@ public class RmSiteType implements RecordsManagementModel,
policyComponent.bindClassBehaviour(
NodeServicePolicies.OnCreateNodePolicy.QNAME,
TYPE_RM_SITE,
- new JavaBehaviour(this, "onCreateNode", NotificationFrequency.FIRST_EVENT));
+ behaviour);
}
/**
@@ -108,33 +111,41 @@ public class RmSiteType implements RecordsManagementModel,
@Override
public void onCreateNode(ChildAssociationRef childAssocRef)
{
- final NodeRef rmSite = childAssocRef.getChildRef();
-
- // Do not execute behaviour if this has been created in the archive store
- if(rmSite.getStoreRef().equals(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE) == true)
- {
- // This is not the spaces store - probably the archive store
- return;
- }
-
- if (nodeService.exists(rmSite) == true)
- {
- AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork