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 8fa9c83db3..30237164ee 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
@@ -254,7 +254,8 @@
cm:titled
rma:recordComponentIdentifier
rma:commonRecordDetails
- rma:filePlanComponent
+ rma:filePlanComponent
+
diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml
index b9957f7141..78e9836a8f 100644
--- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml
+++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml
@@ -64,34 +64,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW
- org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
- org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
-
-
-
-
-
-
-
@@ -278,32 +250,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW
- org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
- org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
-
-
-
-
-
-
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 7a9777937f..c19cdd615b 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
@@ -156,11 +156,12 @@
-
+
+
@@ -966,21 +967,31 @@
+
+
+
+
+
+
+
+
-
+
+
+
- org.alfresco.module.org_alfresco_module_rm.record.RecordService
+ org.alfresco.module.org_alfresco_module_rm.disposableitem.RecordService
@@ -1018,14 +1029,13 @@
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 0869148a72..4081812ce8 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
@@ -175,13 +175,7 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
*/
public void init()
{
- // Register the association behaviours
- policyComponent.bindAssociationBehaviour(
- QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
- TYPE_RECORD_FOLDER,
- ContentModel.ASSOC_CONTAINS,
- new JavaBehaviour(this, "onFileContent", NotificationFrequency.TRANSACTION_COMMIT));
-
+ // Register the association behaviours
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
TYPE_FILE_PLAN,
@@ -193,6 +187,7 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
ContentModel.ASSOC_CONTAINS,
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
+ // TODO move this into the record service
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
ASPECT_RECORD,
@@ -226,32 +221,6 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
new JavaBehaviour(this, "onIdentifierUpdate", NotificationFrequency.TRANSACTION_COMMIT));
}
- /**
- * Try to file any record created in a record folder
- *
- * @see org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy#onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean)
- */
- public void onFileContent(ChildAssociationRef childAssocRef, boolean bNew)
- {
- NodeRef nodeRef = childAssocRef.getChildRef();
- if (nodeService.exists(nodeRef) == true)
- {
- // Ensure that the filed item is cm:content
- QName type = nodeService.getType(nodeRef);
- if (ContentModel.TYPE_CONTENT.equals(type) == true ||
- dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT) == true)
- {
- // File the document
- rmActionService.executeRecordsManagementAction(childAssocRef.getChildRef(), "file");
- }
- else
- {
- // Raise an exception since we should only be filling content into a record folder
- throw new AlfrescoRuntimeException("Unable to complete operation, because only content can be filed within a record folder.");
- }
- }
- }
-
/**
* On add content to container
*
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/FileAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/FileAction.java
deleted file mode 100644
index bcb0607e24..0000000000
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/FileAction.java
+++ /dev/null
@@ -1,168 +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.action.impl;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
-import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
-import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
-import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordDefinition;
-import org.alfresco.repo.action.ParameterDefinitionImpl;
-import org.alfresco.service.cmr.action.Action;
-import org.alfresco.service.cmr.action.ParameterDefinition;
-import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-import org.apache.commons.lang.StringUtils;
-
-/**
- * Files a record into a particular record folder
- *
- * @author Roy Wetherall
- */
-public class FileAction extends RMActionExecuterAbstractBase
-{
- /** Parameter names */
- public static final String PARAM_RECORD_METADATA_ASPECTS = "recordMetadataAspects";
-
- /**
- * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
- */
- @SuppressWarnings("unchecked")
- @Override
- protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
- {
- // Permissions perform the following checks so this action doesn't need to.
- //
- // check the record is within a folder
- // check that the folder we are filing into is not closed
-
- // Get the optional list of record meta-data aspects
- List recordMetadataAspects = (List)action.getParameterValue(PARAM_RECORD_METADATA_ASPECTS);
-
- // Add the record aspect (doesn't matter if it is already present)
- if (nodeService.hasAspect(actionedUponNodeRef, ASPECT_RECORD) == false)
- {
- nodeService.addAspect(actionedUponNodeRef, RecordsManagementModel.ASPECT_RECORD, null);
- }
-
- // Get the records properties
- Map recordProperties = this.nodeService.getProperties(actionedUponNodeRef);
-
- Calendar fileCalendar = Calendar.getInstance();
- if (recordProperties.get(RecordsManagementModel.PROP_IDENTIFIER) == null)
- {
- // Calculate the filed date and record identifier
- String year = Integer.toString(fileCalendar.get(Calendar.YEAR));
- QName nodeDbid = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "node-dbid");
- String recordId = year + "-" + StringUtils.leftPad(recordProperties.get(nodeDbid).toString(), 10, "0");
- recordProperties.put(RecordsManagementModel.PROP_IDENTIFIER, recordId);
- }
-
- // Update/set the date this record was refiled/filed
- recordProperties.put(RecordsManagementModel.PROP_DATE_FILED, fileCalendar.getTime());
-
- // Set the record properties
- this.nodeService.setProperties(actionedUponNodeRef, recordProperties);
-
- // Apply any record meta-data aspects
- if (recordMetadataAspects != null && recordMetadataAspects.size() != 0)
- {
- for (QName aspect : recordMetadataAspects)
- {
- nodeService.addAspect(actionedUponNodeRef, aspect, null);
- }
- }
-
- // Calculate the review schedule
- VitalRecordDefinition viDef = vitalRecordService.getVitalRecordDefinition(actionedUponNodeRef);
- if (viDef != null && viDef.isEnabled() == true)
- {
- Date reviewAsOf = viDef.getNextReviewDate();
- if (reviewAsOf != null)
- {
- Map reviewProps = new HashMap(1);
- reviewProps.put(RecordsManagementModel.PROP_REVIEW_AS_OF, reviewAsOf);
-
- if (!nodeService.hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD))
- {
- this.nodeService.addAspect(actionedUponNodeRef, RecordsManagementModel.ASPECT_VITAL_RECORD, reviewProps);
- }
- else
- {
- Map props = nodeService.getProperties(actionedUponNodeRef);
- props.putAll(reviewProps);
- nodeService.setProperties(actionedUponNodeRef, props);
- }
- }
- }
-
- // Get the disposition instructions for the actioned upon record
- DispositionSchedule di = this.dispositionService.getDispositionSchedule(actionedUponNodeRef);
-
- // Set up the disposition schedule if the dispositions are being managed at the record level
- if (di != null && di.isRecordLevelDisposition() == true)
- {
- // Setup the next disposition action
- updateNextDispositionAction(actionedUponNodeRef);
- }
- }
-
- /**
- * @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
- */
- @Override
- protected void addParameterDefinitions(List paramList)
- {
- // No parameters
- paramList.add(new ParameterDefinitionImpl(PARAM_RECORD_METADATA_ASPECTS, DataTypeDefinition.QNAME, false, "Record Metadata Aspects", true));
- }
-
-// @Override
-// public Set getProtectedAspects()
-// {
-// HashSet qnames = new HashSet();
-// qnames.add(ASPECT_RECORD);
-// qnames.add(ASPECT_VITAL_RECORD);
-// return qnames;
-// }
-//
-// @Override
-// public Set getProtectedProperties()
-// {
-// HashSet qnames = new HashSet();
-// qnames.add(PROP_DATE_FILED);
-// qnames.add(PROP_REVIEW_AS_OF);
-// return qnames;
-// }
-
- @Override
- protected boolean isExecutableImpl(NodeRef filePlanComponent, Map parameters, boolean throwException)
- {
- return true;
- }
-
-}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SetupRecordFolderAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SetupRecordFolderAction.java
deleted file mode 100644
index ac1793448e..0000000000
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SetupRecordFolderAction.java
+++ /dev/null
@@ -1,70 +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.action.impl;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
-import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
-import org.alfresco.service.cmr.action.Action;
-import org.alfresco.service.cmr.action.ParameterDefinition;
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * Action to close the records folder
- *
- * @author Roy Wetherall
- */
-public class SetupRecordFolderAction extends RMActionExecuterAbstractBase
-{
- /**
- * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
- */
- @Override
- protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
- {
- if (this.recordsManagementService.isRecordFolder(actionedUponNodeRef) == true)
- {
- // Set up the disposition schedule if the dispositions are being managed at the folder level
- DispositionSchedule di = this.dispositionService.getDispositionSchedule(actionedUponNodeRef);
- if (di != null && di.isRecordLevelDisposition() == false)
- {
- // Setup the next disposition action
- updateNextDispositionAction(actionedUponNodeRef);
- }
- }
- }
-
- /**
- * @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
- */
- @Override
- protected void addParameterDefinitions(List paramList)
- {
- }
-
- @Override
- protected boolean isExecutableImpl(NodeRef filePlanComponent, Map parameters, boolean throwException)
- {
- return true;
- }
-
-}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
index ed279bd596..f483d59f5e 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
@@ -140,7 +140,6 @@ public class RecordsManagementAuditServiceImpl
protected static final String AUDIT_TRAIL_FILE_PREFIX = "audit_";
protected static final String AUDIT_TRAIL_JSON_FILE_SUFFIX = ".json";
protected static final String AUDIT_TRAIL_HTML_FILE_SUFFIX = ".html";
- protected static final String FILE_ACTION = "file";
private PolicyComponent policyComponent;
private DictionaryService dictionaryService;
@@ -268,8 +267,6 @@ public class RecordsManagementAuditServiceImpl
this.auditEvents.put(RM_AUDIT_EVENT_LOGIN_FAILURE,
new AuditEvent(RM_AUDIT_EVENT_LOGIN_FAILURE, MSG_LOGIN_FAILED));
- this.auditEvents.put("file",
- new AuditEvent("file", MSG_FILED_RECORD));
this.auditEvents.put("reviewed",
new AuditEvent("reviewed", MSG_REVIEWED));
this.auditEvents.put("cutoff",
@@ -282,8 +279,6 @@ public class RecordsManagementAuditServiceImpl
new AuditEvent("openRecordFolder", MSG_OPENED_RECORD_FOLDER));
this.auditEvents.put("closeRecordFolder",
new AuditEvent("closeRecordFolder", MSG_CLOSED_RECORD_FOLDER));
- this.auditEvents.put("setupRecordFolder",
- new AuditEvent("setupRecordFolder", MSG_SETUP_RECORD_FOLDER));
this.auditEvents.put("declareRecord",
new AuditEvent("declareRecord", MSG_DECLARED_RECORD));
this.auditEvents.put("undeclareRecord",
@@ -994,10 +989,7 @@ public class RecordsManagementAuditServiceImpl
ContentWriter writer = this.contentService.getWriter(record, ContentModel.PROP_CONTENT, true);
writer.setMimetype(format == ReportFormat.HTML ? MimetypeMap.MIMETYPE_HTML : MimetypeMap.MIMETYPE_JSON);
writer.setEncoding("UTF-8");
- writer.putContent(auditTrail);
-
- // file the node as a record
- this.rmActionService.executeRecordsManagementAction(record, FILE_ACTION);
+ writer.putContent(auditTrail);
}
finally
{
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 d7ba5dbf28..3377921ded 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
@@ -17,6 +17,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionService;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
+import org.alfresco.module.org_alfresco_module_rm.disposableitem.RecordFolderServiceImpl;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
@@ -38,475 +39,479 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
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;
-public class DataSetServiceImpl implements DataSetService, RecordsManagementModel
+public class DataSetServiceImpl implements DataSetService, RecordsManagementModel, ApplicationContextAware
{
- /** Logger */
- private static Log logger = LogFactory.getLog(DataSetServiceImpl.class);
+ /** Logger */
+ private static Log logger = LogFactory.getLog(DataSetServiceImpl.class);
- /** Registered data set implementations */
- private Map dataSets = new HashMap();
+ /** Registered data set implementations */
+ private Map dataSets = new HashMap();
- /** Spaces store */
- private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE,
- "SpacesStore");
+ /** Spaces store */
+ private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
- /** Importer service */
- private ImporterService importerService;
+ /** Importer service */
+ private ImporterService importerService;
- /** Search service */
- private SearchService searchService;
+ /** Search service */
+ private SearchService searchService;
- /** Node service */
- private NodeService nodeService;
+ /** Node service */
+ private NodeService nodeService;
- /** Records management service */
- private RecordsManagementService recordsManagementService;
+ /** Records management service */
+ private RecordsManagementService recordsManagementService;
- /** Records management action service */
- private RecordsManagementActionService recordsManagementActionService;
+ /** Records management action service */
+ private RecordsManagementActionService recordsManagementActionService;
- /** Permission service */
- private PermissionService permissionService;
+ /** Permission service */
+ private PermissionService permissionService;
- /** Authority service */
- private AuthorityService authorityService;
+ /** Authority service */
+ private AuthorityService authorityService;
- /** Records management security service */
- private RecordsManagementSecurityService recordsManagementSecurityService;
+ /** Records management security service */
+ private RecordsManagementSecurityService recordsManagementSecurityService;
- /** Records management search behaviour */
- private RecordsManagementSearchBehaviour recordsManagementSearchBehaviour;
+ /** Records management search behaviour */
+ private RecordsManagementSearchBehaviour recordsManagementSearchBehaviour;
- /** Disposition service */
- private DispositionService dispositionService;
+ /** Disposition service */
+ private DispositionService dispositionService;
- /**
- * Set importer service
- *
- * @param importerService the importer service
- */
- public void setImporterService(ImporterService importerService)
- {
- this.importerService = importerService;
- }
+ /** Application context */
+ private ApplicationContext applicationContext;
- /**
- * Set search service
- *
- * @param searchService the search service
- */
- public void setSearchService(SearchService searchService)
- {
- this.searchService = searchService;
- }
+ /**
+ * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
+ */
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
+ {
+ this.applicationContext = applicationContext;
+ }
- /**
- * Set node service
- *
- * @param nodeService the node service
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
+ /**
+ * Set importer service
+ *
+ * @param importerService the importer service
+ */
+ public void setImporterService(ImporterService importerService)
+ {
+ this.importerService = importerService;
+ }
- /**
- * Set records management service
- *
- * @param recordsManagementService the records management service
- */
- public void setRecordsManagementService(RecordsManagementService recordsManagementService)
- {
- this.recordsManagementService = recordsManagementService;
- }
+ /**
+ * Set search service
+ *
+ * @param searchService the search service
+ */
+ public void setSearchService(SearchService searchService)
+ {
+ this.searchService = searchService;
+ }
- /**
- * Set records management action service
- *
- * @param recordsManagementActionService the records management action
- * service
- */
- public void setRecordsManagementActionService(
- RecordsManagementActionService recordsManagementActionService)
- {
- this.recordsManagementActionService = recordsManagementActionService;
- }
+ /**
+ * Set node service
+ *
+ * @param nodeService the node service
+ */
+ public void setNodeService(NodeService nodeService)
+ {
+ this.nodeService = nodeService;
+ }
- /**
- * Set permission service
- *
- * @param permissionService the permission service
- */
- public void setPermissionService(PermissionService permissionService)
- {
- this.permissionService = permissionService;
- }
+ /**
+ * Set records management service
+ *
+ * @param recordsManagementService the records management service
+ */
+ public void setRecordsManagementService(RecordsManagementService recordsManagementService)
+ {
+ this.recordsManagementService = recordsManagementService;
+ }
- /**
- * Set authority service
- *
- * @param authorityService the authority service
- */
- public void setAuthorityService(AuthorityService authorityService)
- {
- this.authorityService = authorityService;
- }
+ /**
+ * Set records management action service
+ *
+ * @param recordsManagementActionService the records management action
+ * service
+ */
+ public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
+ {
+ this.recordsManagementActionService = recordsManagementActionService;
+ }
- /**
- * Set records management security service
- *
- * @param recordsManagementSecurityService the records management security
- * service
- */
- public void setRecordsManagementSecurityService(
- RecordsManagementSecurityService recordsManagementSecurityService)
- {
- this.recordsManagementSecurityService = recordsManagementSecurityService;
- }
+ /**
+ * Set permission service
+ *
+ * @param permissionService the permission service
+ */
+ public void setPermissionService(PermissionService permissionService)
+ {
+ this.permissionService = permissionService;
+ }
- /**
- * Set records management search behaviour
- *
- * @param recordsManagementSearchBehaviour the records management search
- * behaviour
- */
- public void setRecordsManagementSearchBehaviour(
- RecordsManagementSearchBehaviour recordsManagementSearchBehaviour)
- {
- this.recordsManagementSearchBehaviour = recordsManagementSearchBehaviour;
- }
+ /**
+ * Set authority service
+ *
+ * @param authorityService the authority service
+ */
+ public void setAuthorityService(AuthorityService authorityService)
+ {
+ this.authorityService = authorityService;
+ }
- /**
- * Set disposition service
- *
- * @param dispositionService the disposition service
- */
- public void setDispositionService(DispositionService dispositionService)
- {
- this.dispositionService = dispositionService;
- }
+ /**
+ * Set records management security service
+ *
+ * @param recordsManagementSecurityService the records management security
+ * service
+ */
+ public void setRecordsManagementSecurityService(RecordsManagementSecurityService recordsManagementSecurityService)
+ {
+ this.recordsManagementSecurityService = recordsManagementSecurityService;
+ }
- /**
- * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#register(org.alfresco.module.org_alfresco_module_rm.dataset.DataSet)
- */
- @Override
- public void register(DataSet dataSet)
- {
- ParameterCheck.mandatory("dataSet", dataSet);
+ /**
+ * Set records management search behaviour
+ *
+ * @param recordsManagementSearchBehaviour the records management search
+ * behaviour
+ */
+ public void setRecordsManagementSearchBehaviour(RecordsManagementSearchBehaviour recordsManagementSearchBehaviour)
+ {
+ this.recordsManagementSearchBehaviour = recordsManagementSearchBehaviour;
+ }
- this.dataSets.put(dataSet.getId(), dataSet);
- }
+ /**
+ * Set disposition service
+ *
+ * @param dispositionService the disposition service
+ */
+ public void setDispositionService(DispositionService dispositionService)
+ {
+ this.dispositionService = dispositionService;
+ }
- /**
- * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#getDataSets()
- */
- @Override
- public Map getDataSets()
- {
- return this.dataSets;
- }
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#register(org.alfresco.module.org_alfresco_module_rm.dataset.DataSet)
+ */
+ @Override
+ public void register(DataSet dataSet)
+ {
+ ParameterCheck.mandatory("dataSet", dataSet);
- /**
- * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#getDataSets(NodeRef,
- * boolean)
- */
- @Override
- public Map getDataSets(NodeRef filePlan, boolean excludeLoaded)
- {
- ParameterCheck.mandatory("filePlan", filePlan);
- ParameterCheck.mandatory("excludeLoaded", excludeLoaded);
+ this.dataSets.put(dataSet.getId(), dataSet);
+ }
- // Get the list of all available data sets
- Map dataSets = new HashMap(getDataSets());
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#getDataSets()
+ */
+ @Override
+ public Map getDataSets()
+ {
+ return this.dataSets;
+ }
- // Should the list of unloaded data sets be retrieved
- if (excludeLoaded)
- {
- dataSets.keySet().removeAll(getLoadedDataSets(filePlan).keySet());
- }
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#getDataSets(NodeRef,
+ * boolean)
+ */
+ @Override
+ public Map getDataSets(NodeRef filePlan, boolean excludeLoaded)
+ {
+ ParameterCheck.mandatory("filePlan", filePlan);
+ ParameterCheck.mandatory("excludeLoaded", excludeLoaded);
- // Return the (filtered) list of data sets
- return dataSets;
- }
+ // Get the list of all available data sets
+ Map dataSets = new HashMap(getDataSets());
- /**
- * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#loadDataSet(java.lang.String,
- * org.alfresco.service.cmr.repository.NodeRef)
- */
- @Override
- public void loadDataSet(NodeRef filePlan, String dataSetId)
- {
- ParameterCheck.mandatory("filePlan", filePlan);
- ParameterCheck.mandatoryString("dataSetId", dataSetId);
+ // Should the list of unloaded data sets be retrieved
+ if (excludeLoaded)
+ {
+ dataSets.keySet().removeAll(getLoadedDataSets(filePlan).keySet());
+ }
- // Get the data set
- DataSet dataSet = getDataSets().get(dataSetId);
+ // Return the (filtered) list of data sets
+ return dataSets;
+ }
- // Import the RM test data ACP into the the provided file plan node reference
- InputStream is = null;
- try
- {
- is = getClass().getClassLoader().getResourceAsStream(dataSet.getPath());
- if (is == null)
- {
- throw new AlfrescoRuntimeException("The '" + dataSet.getLabel()
- + "' import file could not be found!");
- }
-
- // Import view
- Reader viewReader = new InputStreamReader(is);
- Location location = new Location(filePlan);
- importerService.importView(viewReader, location, null, null);
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#loadDataSet(java.lang.String,
+ * org.alfresco.service.cmr.repository.NodeRef)
+ */
+ @Override
+ public void loadDataSet(NodeRef filePlan, String dataSetId)
+ {
+ ParameterCheck.mandatory("filePlan", filePlan);
+ ParameterCheck.mandatoryString("dataSetId", dataSetId);
- // Patch data
- patchLoadedData();
+ // Get the data set
+ DataSet dataSet = getDataSets().get(dataSetId);
- // Set the data set id into the file plan's custom aspect
- setDataSetIdIntoFilePlan(dataSetId, filePlan);
- }
- catch (Exception ex)
- {
- throw new RuntimeException("Unexpected exception thrown. Please refer to the log files for details.", ex);
- }
- finally
- {
- if (is != null)
- {
- try
+ // Import the RM test data ACP into the the provided file plan node
+ // reference
+ InputStream is = null;
+ try
+ {
+ is = getClass().getClassLoader().getResourceAsStream(dataSet.getPath());
+ if (is == null) { throw new AlfrescoRuntimeException("The '" + dataSet.getLabel()
+ + "' import file could not be found!"); }
+
+ // Import view
+ Reader viewReader = new InputStreamReader(is);
+ Location location = new Location(filePlan);
+ importerService.importView(viewReader, location, null, null);
+
+ // Patch data
+ patchLoadedData();
+
+ // Set the data set id into the file plan's custom aspect
+ setDataSetIdIntoFilePlan(dataSetId, filePlan);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException("Unexpected exception thrown. Please refer to the log files for details.", ex);
+ }
+ finally
+ {
+ if (is != null)
{
- is.close();
- is = null;
+ try
+ {
+ is.close();
+ is = null;
+ }
+ catch (IOException ex)
+ {
+ throw new RuntimeException("Failed to close the input stream!", ex);
+ }
}
- catch (IOException ex)
+ }
+ }
+
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#existsDataSet(java.lang.String)
+ */
+ @Override
+ public boolean existsDataSet(String dataSetId)
+ {
+ ParameterCheck.mandatoryString("dataSetId", dataSetId);
+
+ return getDataSets().containsKey(dataSetId);
+ }
+
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#getLoadedDataSets(org.alfresco.service.cmr.repository.NodeRef)
+ */
+ @Override
+ public Map getLoadedDataSets(NodeRef filePlan)
+ {
+ ParameterCheck.mandatory("filePlan", filePlan);
+
+ // Get the list of available data sets
+ Map availableDataSets = new HashMap(getDataSets());
+
+ // Get the property value of the aspect
+ Serializable dataSetIds = nodeService.getProperty(filePlan, PROP_LOADED_DATA_SET_IDS);
+ // Check if any data has been loaded before
+ if (dataSetIds != null)
+ {
+ // Filter the data sets which have already been loaded
+ @SuppressWarnings("unchecked")
+ ArrayList loadedDataSetIds = (ArrayList) dataSetIds;
+ Iterator> iterator = availableDataSets.entrySet().iterator();
+ while (iterator.hasNext())
{
- throw new RuntimeException("Failed to close the input stream!", ex);
+ Entry entry = iterator.next();
+ String key = entry.getKey();
+ if (!loadedDataSetIds.contains(key))
+ {
+ iterator.remove();
+ }
}
- }
- }
- }
+ return availableDataSets;
+ }
- /**
- * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#existsDataSet(java.lang.String)
- */
- @Override
- public boolean existsDataSet(String dataSetId)
- {
- ParameterCheck.mandatoryString("dataSetId", dataSetId);
+ return new HashMap();
+ }
- return getDataSets().containsKey(dataSetId);
- }
+ /**
+ * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#isLoadedDataSet(org.alfresco.service.cmr.repository.NodeRef,
+ * java.lang.String)
+ */
+ @Override
+ public boolean isLoadedDataSet(NodeRef filePlan, String dataSetId)
+ {
+ ParameterCheck.mandatory("filePlan", filePlan);
+ ParameterCheck.mandatory("dataSetId", dataSetId);
- /**
- * @see org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService#getLoadedDataSets(org.alfresco.service.cmr.repository.NodeRef)
- */
- @Override
- public Map getLoadedDataSets(NodeRef filePlan)
- {
- ParameterCheck.mandatory("filePlan", filePlan);
+ return getLoadedDataSets(filePlan).containsKey(dataSetId);
+ }
- // Get the list of available data sets
- Map availableDataSets = new HashMap(getDataSets());
-
- // Get the property value of the aspect
- Serializable dataSetIds = nodeService.getProperty(filePlan, PROP_LOADED_DATA_SET_IDS);
- // Check if any data has been loaded before
- if (dataSetIds != null)
- {
- // Filter the data sets which have already been loaded
- @SuppressWarnings("unchecked")
- ArrayList loadedDataSetIds = (ArrayList) dataSetIds;
- Iterator> iterator = availableDataSets.entrySet().iterator();
- while (iterator.hasNext())
- {
- Entry entry = iterator.next();
- String key = entry.getKey();
- if (!loadedDataSetIds.contains(key))
+ /**
+ * Temp method to patch AMP'ed data
+ *
+ * @param searchService
+ * @param nodeService
+ * @param recordsManagementService
+ * @param recordsManagementActionService
+ */
+ private void patchLoadedData()
+ {
+ AuthenticationUtil.RunAsWork