mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Storing the information about the original location of a record
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@45740 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
</namespaces>
|
||||
|
||||
<types>
|
||||
|
||||
|
||||
<!-- Custom RM site type -->
|
||||
<type name="rma:rmsite">
|
||||
<title>RM Site</title>
|
||||
@@ -54,9 +54,9 @@
|
||||
</type>
|
||||
|
||||
<!-- Records management container types -->
|
||||
|
||||
|
||||
<type name="rma:recordsManagementContainer">
|
||||
|
||||
|
||||
<title>Records Management Container</title>
|
||||
<parent>cm:folder</parent>
|
||||
<archive>false</archive>
|
||||
@@ -68,28 +68,28 @@
|
||||
</mandatory-aspects>
|
||||
|
||||
</type>
|
||||
|
||||
|
||||
<type name="rma:recordCategory">
|
||||
|
||||
|
||||
<title>Record Category</title>
|
||||
<parent>rma:recordsManagementContainer</parent>
|
||||
|
||||
<mandatory-aspects>
|
||||
<parent>rma:recordsManagementContainer</parent>
|
||||
|
||||
<mandatory-aspects>
|
||||
<aspect>rma:vitalRecordDefinition</aspect>
|
||||
</mandatory-aspects>
|
||||
|
||||
|
||||
</type>
|
||||
|
||||
<type name="rma:filePlan">
|
||||
|
||||
|
||||
<type name="rma:filePlan">
|
||||
|
||||
<title>File Plan</title>
|
||||
<parent>rma:recordsManagementContainer</parent>
|
||||
<mandatory-aspects>
|
||||
<parent>rma:recordsManagementContainer</parent>
|
||||
<mandatory-aspects>
|
||||
<aspect>rma:recordsManagementRoot</aspect>
|
||||
</mandatory-aspects>
|
||||
|
||||
|
||||
</type>
|
||||
|
||||
|
||||
<type name="rma:unfiledRecordContainer">
|
||||
<title>Unfiled Record Container</title>
|
||||
<parent>rma:recordsManagementContainer</parent>
|
||||
@@ -254,7 +254,7 @@
|
||||
<aspect>cm:titled</aspect>
|
||||
<aspect>rma:recordComponentIdentifier</aspect>
|
||||
<aspect>rma:commonRecordDetails</aspect>
|
||||
<aspect>rma:filePlanComponent</aspect>
|
||||
<aspect>rma:filePlanComponent</aspect>
|
||||
<!-- <aspect>rma:vitalRecordDefinition</aspect> -->
|
||||
</mandatory-aspects>
|
||||
|
||||
@@ -263,10 +263,10 @@
|
||||
<type name="rma:nonElectronicDocument">
|
||||
|
||||
<title>Non-Electronic Document</title>
|
||||
<parent>cm:content</parent>
|
||||
<parent>cm:content</parent>
|
||||
<archive>false</archive>
|
||||
<properties>
|
||||
|
||||
|
||||
<property name="rma:physicalSize">
|
||||
<title>Document Physical Size</title>
|
||||
<type>d:int</type>
|
||||
@@ -277,10 +277,10 @@
|
||||
<tokenised>false</tokenised>
|
||||
</index>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="rma:numberOfCopies">
|
||||
<title>Number Of Copies</title>
|
||||
<type>d:int</type>
|
||||
<type>d:int</type>
|
||||
<mandatory>false</mandatory>
|
||||
<default>1</default>
|
||||
<index enabled="true">
|
||||
@@ -289,7 +289,7 @@
|
||||
<tokenised>false</tokenised>
|
||||
</index>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="rma:storageLocation">
|
||||
<title>Storage Location</title>
|
||||
<type>d:text</type>
|
||||
@@ -299,8 +299,8 @@
|
||||
<stored>false</stored>
|
||||
<tokenised>false</tokenised>
|
||||
</index>
|
||||
</property>
|
||||
|
||||
</property>
|
||||
|
||||
<property name="rma:shelf">
|
||||
<title>Shelf</title>
|
||||
<type>d:text</type>
|
||||
@@ -311,7 +311,7 @@
|
||||
<tokenised>false</tokenised>
|
||||
</index>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="rma:box">
|
||||
<title>Box</title>
|
||||
<type>d:text</type>
|
||||
@@ -322,7 +322,7 @@
|
||||
<tokenised>false</tokenised>
|
||||
</index>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="rma:file">
|
||||
<title>File</title>
|
||||
<type>d:text</type>
|
||||
@@ -333,7 +333,7 @@
|
||||
<tokenised>false</tokenised>
|
||||
</index>
|
||||
</property>
|
||||
|
||||
|
||||
</properties>
|
||||
<mandatory-aspects>
|
||||
<aspect>rma:filePlanComponent</aspect>
|
||||
@@ -535,7 +535,7 @@
|
||||
<mandatory>true</mandatory>
|
||||
<default>true</default>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="rma:transferPDFIndicator">
|
||||
<title>Transfer PDF Indicator</title>
|
||||
<description>Indicates that transfer includes PDF</description>
|
||||
@@ -543,7 +543,7 @@
|
||||
<mandatory>true</mandatory>
|
||||
<default>false</default>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="rma:transferLocation">
|
||||
<title>Transfer PDF Indicator</title>
|
||||
<description>Transfer Location</description>
|
||||
@@ -624,7 +624,7 @@
|
||||
<many>true</many>
|
||||
</target>
|
||||
</child-association>
|
||||
|
||||
|
||||
<child-association name="rma:unfiledRecords">
|
||||
<title>Unfiled Records</title>
|
||||
<source>
|
||||
@@ -820,7 +820,7 @@
|
||||
</mandatory-aspects>
|
||||
|
||||
</aspect>
|
||||
|
||||
|
||||
<!-- Marker aspect used to indicate an aspect is used for record meta-data -->
|
||||
<aspect name="rma:recordMetaData">
|
||||
</aspect>
|
||||
@@ -842,16 +842,16 @@
|
||||
<mandatory-aspects>
|
||||
<aspect>rma:filePlanComponent</aspect>
|
||||
</mandatory-aspects>
|
||||
</aspect>
|
||||
|
||||
</aspect>
|
||||
|
||||
<!-- Extended readers for RM object -->
|
||||
<!-- @since 2.1 -->
|
||||
<aspect name="rma:extendedReaders">
|
||||
<aspect name="rma:extendedReaders">
|
||||
<properties>
|
||||
<property name="rma:readers">
|
||||
<type>d:any</type>
|
||||
</property>
|
||||
</properties>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
<!-- State management aspects -->
|
||||
@@ -947,10 +947,10 @@
|
||||
</property>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
|
||||
<!-- Indicates that an object is being transferred -->
|
||||
<aspect name="rma:transferring">
|
||||
<title>Transferring</title>
|
||||
<title>Transferring</title>
|
||||
</aspect>
|
||||
|
||||
<!-- Transfered marker aspect -->
|
||||
@@ -1030,12 +1030,12 @@
|
||||
|
||||
|
||||
<!-- Aspect to facilitate search -->
|
||||
<aspect name="rma:recordSearch">
|
||||
<title>Record Search</title>
|
||||
<properties>
|
||||
<aspect name="rma:recordSearch">
|
||||
<title>Record Search</title>
|
||||
<properties>
|
||||
<property name="rma:recordSearchHasDispositionSchedule">
|
||||
<type>d:boolean</type>
|
||||
</property>
|
||||
</property>
|
||||
<property name="rma:recordSearchDispositionActionName">
|
||||
<type>d:text</type>
|
||||
<index enabled="true">
|
||||
@@ -1111,21 +1111,21 @@
|
||||
<aspect name="rma:versionedRecord">
|
||||
<title>Versioned Record</title>
|
||||
</aspect>
|
||||
|
||||
|
||||
<aspect name="rma:unpublishedUpdate">
|
||||
<title>Unpublished Update</title>
|
||||
<properties>
|
||||
<properties>
|
||||
<property name="rma:unpublishedUpdate">
|
||||
<type>d:boolean</type>
|
||||
<mandatory>true</mandatory>
|
||||
<default>true</default>
|
||||
</property>
|
||||
</property>
|
||||
<property name="rma:updateTo">
|
||||
<type>d:text</type>
|
||||
</property>
|
||||
</property>
|
||||
<property name="rma:updatedProperties">
|
||||
<type>d:any</type>
|
||||
</property>
|
||||
</property>
|
||||
<property name="rma:publishInProgress">
|
||||
<type>d:boolean</type>
|
||||
<mandatory>true</mandatory>
|
||||
@@ -1133,12 +1133,12 @@
|
||||
</property>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
<!-- Ghosted record marker -->
|
||||
|
||||
<!-- Ghosted record marker -->
|
||||
<aspect name="rma:ghosted">
|
||||
<title>Ghosted Record</title>
|
||||
<title>Ghosted Record</title>
|
||||
<archive>false</archive>
|
||||
</aspect>
|
||||
</aspect>
|
||||
|
||||
<!-- Aspect to hold the data for the loaded Data Set Ids -->
|
||||
<aspect name="rma:loadedDataSetId">
|
||||
@@ -1152,6 +1152,16 @@
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
<!-- Aspect to hold the information about the original location of a record -->
|
||||
<aspect name="rma:originalLocation">
|
||||
<title>The original location of a record</title>
|
||||
<properties>
|
||||
<property name="rma:orgLocation">
|
||||
<type>d:any</type>
|
||||
</property>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
</aspects>
|
||||
|
||||
</model>
|
@@ -103,10 +103,11 @@ public class HideRecordAction extends ActionExecuterAbstractBase implements Reco
|
||||
}
|
||||
else
|
||||
{
|
||||
NodeRef originalLocation = (NodeRef) nodeService.getProperty(actionedUponNodeRef, PROP_ORIGINAL_LOCATION);
|
||||
List<ChildAssociationRef> parentAssocs = nodeService.getParentAssocs(actionedUponNodeRef);
|
||||
for (ChildAssociationRef childAssociationRef : parentAssocs)
|
||||
{
|
||||
if (childAssociationRef.isPrimary() == false)
|
||||
if (childAssociationRef.isPrimary() == false && childAssociationRef.getParentRef().equals(originalLocation))
|
||||
{
|
||||
nodeService.removeChildAssociation(childAssociationRef);
|
||||
}
|
||||
|
@@ -22,55 +22,55 @@ import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Helper class containing records management qualified names
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
{
|
||||
{
|
||||
// Namespace details
|
||||
public static final String RM_URI = "http://www.alfresco.org/model/recordsmanagement/1.0";
|
||||
public static final String RM_PREFIX = "rma";
|
||||
|
||||
|
||||
// Model
|
||||
public static final QName RM_MODEL = QName.createQName(RM_URI, "recordsmanagement");
|
||||
|
||||
|
||||
// RM Site
|
||||
public static final QName TYPE_RM_SITE = QName.createQName(RM_URI, "rmsite");
|
||||
|
||||
|
||||
// Caveat config
|
||||
public static final QName TYPE_CAVEAT_CONFIG = QName.createQName(RM_URI, "caveatConfig");
|
||||
|
||||
|
||||
public static final QName ASPECT_CAVEAT_CONFIG_ROOT = QName.createQName(RM_URI, "caveatConfigRoot");
|
||||
public static final QName ASSOC_CAVEAT_CONFIG = QName.createQName(RM_URI, "caveatConfigAssoc");
|
||||
|
||||
|
||||
// Email config
|
||||
public static final QName TYPE_EMAIL_CONFIG = QName.createQName(RM_URI, "emailConfig");
|
||||
public static final QName TYPE_EMAIL_CONFIG = QName.createQName(RM_URI, "emailConfig");
|
||||
public static final QName ASPECT_EMAIL_CONFIG_ROOT = QName.createQName(RM_URI, "emailConfigRoot");
|
||||
public static final QName ASSOC_EMAIL_CONFIG = QName.createQName(RM_URI, "emailConfigAssoc");
|
||||
|
||||
// Records management container
|
||||
public static final QName TYPE_RECORDS_MANAGEMENT_CONTAINER = QName.createQName(RM_URI, "recordsManagementContainer");
|
||||
|
||||
|
||||
// Record Category
|
||||
public static final QName TYPE_RECORD_CATEGORY = QName.createQName(RM_URI, "recordCategory");
|
||||
|
||||
|
||||
// Records management root container
|
||||
public static final QName TYPE_FILE_PLAN = QName.createQName(RM_URI, "filePlan");
|
||||
|
||||
|
||||
// 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");
|
||||
public static final QName ASSOC_DISPOSITION_SCHEDULE = QName.createQName(RM_URI, "dispositionSchedule");
|
||||
|
||||
|
||||
// Disposition definition type
|
||||
public static final QName TYPE_DISPOSITION_SCHEDULE = QName.createQName(RM_URI, "dispositionSchedule");
|
||||
public static final QName PROP_DISPOSITION_AUTHORITY = QName.createQName(RM_URI, "dispositionAuthority");
|
||||
public static final QName PROP_DISPOSITION_INSTRUCTIONS = QName.createQName(RM_URI, "dispositionInstructions");
|
||||
public static final QName PROP_RECORD_LEVEL_DISPOSITION = QName.createQName(RM_URI, "recordLevelDisposition");
|
||||
public static final QName ASSOC_DISPOSITION_ACTION_DEFINITIONS = QName.createQName(RM_URI, "dispositionActionDefinitions");
|
||||
|
||||
public static final QName ASSOC_DISPOSITION_ACTION_DEFINITIONS = QName.createQName(RM_URI, "dispositionActionDefinitions");
|
||||
|
||||
// Disposition action type
|
||||
public static final QName TYPE_DISPOSITION_ACTION_DEFINITION = QName.createQName(RM_URI, "dispositionActionDefinition");
|
||||
public static final QName PROP_DISPOSITION_ACTION_NAME = QName.createQName(RM_URI, "dispositionActionName");
|
||||
@@ -80,16 +80,16 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
public static final QName PROP_DISPOSITION_EVENT = QName.createQName(RM_URI, "dispositionEvent");
|
||||
public static final QName PROP_DISPOSITION_EVENT_COMBINATION = QName.createQName(RM_URI, "dispositionEventCombination");
|
||||
public static final QName PROP_DISPOSITION_LOCATION = QName.createQName(RM_URI, "dispositionLocation");
|
||||
|
||||
|
||||
// Records folder
|
||||
public static final QName TYPE_RECORD_FOLDER = QName.createQName(RM_URI, "recordFolder");
|
||||
public static final QName PROP_IS_CLOSED = QName.createQName(RM_URI, "isClosed");
|
||||
|
||||
|
||||
// Declared record aspect
|
||||
public static final QName ASPECT_DECLARED_RECORD = QName.createQName(RM_URI, "declaredRecord");
|
||||
public static final QName PROP_DECLARED_AT = QName.createQName(RM_URI, "declaredAt");
|
||||
public static final QName PROP_DECLARED_BY = QName.createQName(RM_URI, "declaredBy");
|
||||
|
||||
|
||||
// Record aspect
|
||||
public static final QName ASPECT_RECORD = QName.createQName(RM_URI, "record");
|
||||
public static final QName PROP_DATE_FILED = QName.createQName(RM_URI, "dateFiled");
|
||||
@@ -98,44 +98,44 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
public static final QName PROP_PUBLICATION_DATE = QName.createQName(RM_URI, "publicationDate");
|
||||
public static final QName PROP_MEDIA_TYPE = QName.createQName(RM_URI, "mediaType");
|
||||
public static final QName PROP_FORMAT = QName.createQName(RM_URI, "format");
|
||||
public static final QName PROP_DATE_RECEIVED = QName.createQName(RM_URI, "dateReceived");
|
||||
|
||||
public static final QName PROP_DATE_RECEIVED = QName.createQName(RM_URI, "dateReceived");
|
||||
|
||||
// Common record details
|
||||
public static final QName PROP_LOCATION = QName.createQName(RM_URI, "location");
|
||||
|
||||
|
||||
// Fileable aspect
|
||||
public static final QName ASPECT_FILABLE = QName.createQName(RM_URI, "fileable");
|
||||
|
||||
|
||||
// Record component identifier aspect
|
||||
public static final QName ASPECT_RECORD_COMPONENT_ID = QName.createQName(RM_URI, "recordComponentIdentifier");
|
||||
public static final QName PROP_IDENTIFIER = QName.createQName(RM_URI, "identifier");
|
||||
public static final QName PROP_DB_UNIQUENESS_ID = QName.createQName(RM_URI, "dbUniquenessId");
|
||||
|
||||
|
||||
// Vital record definition aspect
|
||||
public static final QName ASPECT_VITAL_RECORD_DEFINITION = QName.createQName(RM_URI, "vitalRecordDefinition");
|
||||
public static final QName PROP_VITAL_RECORD_INDICATOR = QName.createQName(RM_URI, "vitalRecordIndicator");
|
||||
public static final QName PROP_REVIEW_PERIOD = QName.createQName(RM_URI, "reviewPeriod");
|
||||
|
||||
|
||||
// Vital record aspect
|
||||
public static final QName ASPECT_VITAL_RECORD = QName.createQName(RM_URI, "vitalRecord");
|
||||
public static final QName PROP_REVIEW_AS_OF = QName.createQName(RM_URI, "reviewAsOf");
|
||||
public static final QName PROP_NOTIFICATION_ISSUED = QName.createQName(RM_URI, "notificationIssued");
|
||||
|
||||
|
||||
// Cut off aspect
|
||||
public static final QName ASPECT_CUT_OFF = QName.createQName(RM_URI, "cutOff");
|
||||
public static final QName PROP_CUT_OFF_DATE = QName.createQName(RM_URI, "cutOffDate");
|
||||
|
||||
|
||||
// Transferred aspect
|
||||
public static final QName ASPECT_TRANSFERRED = QName.createQName(RM_URI, "transferred");
|
||||
|
||||
|
||||
// Ascended aspect
|
||||
public static final QName ASPECT_ASCENDED = QName.createQName(RM_URI, "ascended");
|
||||
|
||||
|
||||
// Disposition schedule aspect
|
||||
public static final QName ASPECT_DISPOSITION_LIFECYCLE = QName.createQName(RM_URI, "dispositionLifecycle");
|
||||
public static final QName ASSOC_NEXT_DISPOSITION_ACTION = QName.createQName(RM_URI, "nextDispositionAction");
|
||||
public static final QName ASSOC_DISPOSITION_ACTION_HISTORY = QName.createQName(RM_URI, "dispositionActionHistory");
|
||||
|
||||
|
||||
// Disposition action type
|
||||
public static final QName TYPE_DISPOSITION_ACTION = QName.createQName(RM_URI, "dispositionAction");
|
||||
public static final QName PROP_DISPOSITION_ACTION_ID = QName.createQName(RM_URI, "dispositionActionId");
|
||||
@@ -147,7 +147,7 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
public static final QName PROP_DISPOSITION_ACTION_COMPLETED_AT = QName.createQName(RM_URI, "dispositionActionCompletedAt");
|
||||
public static final QName PROP_DISPOSITION_ACTION_COMPLETED_BY = QName.createQName(RM_URI, "dispositionActionCompletedBy");
|
||||
public static final QName ASSOC_EVENT_EXECUTIONS = QName.createQName(RM_URI, "eventExecutions");
|
||||
|
||||
|
||||
// Event execution type
|
||||
public static final QName TYPE_EVENT_EXECUTION = QName.createQName(RM_URI, "eventExecution");
|
||||
public static final QName PROP_EVENT_EXECUTION_NAME = QName.createQName(RM_URI, "eventExecutionName");
|
||||
@@ -155,60 +155,60 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
public static final QName PROP_EVENT_EXECUTION_COMPLETE = QName.createQName(RM_URI, "eventExecutionComplete");
|
||||
public static final QName PROP_EVENT_EXECUTION_COMPLETED_BY = QName.createQName(RM_URI, "eventExecutionCompletedBy");
|
||||
public static final QName PROP_EVENT_EXECUTION_COMPLETED_AT = QName.createQName(RM_URI, "eventExecutionCompletedAt");
|
||||
|
||||
|
||||
// Custom RM data aspect
|
||||
public static final QName ASPECT_CUSTOM_RM_DATA = QName.createQName(RM_URI, "customRMData");
|
||||
|
||||
|
||||
// marker aspect on all RM objercts (except caveat root)
|
||||
public static final QName ASPECT_FILE_PLAN_COMPONENT = QName.createQName(RM_URI, "filePlanComponent");
|
||||
public static final QName PROP_ROOT_NODEREF = QName.createQName(RM_URI, "rootNodeRef");
|
||||
|
||||
|
||||
// Non-electronic document
|
||||
public static final QName TYPE_NON_ELECTRONIC_DOCUMENT = QName.createQName(RM_URI, "nonElectronicDocument");
|
||||
|
||||
|
||||
// Records management root aspect
|
||||
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_UNFILED_RECORDS = QName.createQName(RM_URI, "unfiledRecords");
|
||||
|
||||
|
||||
// Hold type
|
||||
public static final QName TYPE_HOLD = QName.createQName(RM_URI, "hold");
|
||||
public static final QName PROP_HOLD_REASON = QName.createQName(RM_URI, "holdReason");
|
||||
public static final QName ASSOC_FROZEN_RECORDS = QName.createQName(RM_URI, "frozenRecords");
|
||||
|
||||
|
||||
// Record meta data aspect
|
||||
public static final QName ASPECT_RECORD_META_DATA = QName.createQName(RM_URI, "recordMetaData");
|
||||
|
||||
|
||||
// Frozen aspect
|
||||
public static final QName ASPECT_FROZEN = QName.createQName(RM_URI, "frozen");
|
||||
public static final QName PROP_FROZEN_AT = QName.createQName(RM_URI, "frozenAt");
|
||||
public static final QName PROP_FROZEN_BY = QName.createQName(RM_URI, "frozenBy");
|
||||
|
||||
|
||||
// Transfer aspect
|
||||
public static final QName TYPE_TRANSFER = QName.createQName(RM_URI, "transfer");
|
||||
public static final QName PROP_TRANSFER_ACCESSION_INDICATOR = QName.createQName(RM_URI, "transferAccessionIndicator");
|
||||
public static final QName PROP_TRANSFER_PDF_INDICATOR = QName.createQName(RM_URI, "transferPDFIndicator");
|
||||
public static final QName PROP_TRANSFER_LOCATION = QName.createQName(RM_URI, "transferLocation");
|
||||
public static final QName ASSOC_TRANSFERRED = QName.createQName(RM_URI, "transferred");
|
||||
|
||||
|
||||
// Transferring aspect
|
||||
public static final QName ASPECT_TRANSFERRING = QName.createQName(RM_URI, "transferring");
|
||||
|
||||
|
||||
// Versioned record aspect
|
||||
public static final QName ASPECT_VERSIONED_RECORD = QName.createQName(RM_URI, "versionedRecord");
|
||||
|
||||
|
||||
// Unpublished update aspect
|
||||
public static final QName ASPECT_UNPUBLISHED_UPDATE = QName.createQName(RM_URI, "unpublishedUpdate");
|
||||
public static final QName PROP_UNPUBLISHED_UPDATE = QName.createQName(RM_URI, "unpublishedUpdate");
|
||||
public static final QName PROP_UPDATE_TO = QName.createQName(RM_URI, "updateTo");
|
||||
public static final QName PROP_UPDATED_PROPERTIES = QName.createQName(RM_URI, "updatedProperties");
|
||||
public static final QName PROP_PUBLISH_IN_PROGRESS = QName.createQName(RM_URI, "publishInProgress");
|
||||
public static final String UPDATE_TO_DISPOSITION_ACTION_DEFINITION = "dispositionActionDefinition";
|
||||
|
||||
public static final String UPDATE_TO_DISPOSITION_ACTION_DEFINITION = "dispositionActionDefinition";
|
||||
|
||||
// Ghosted aspect
|
||||
public static QName ASPECT_GHOSTED = QName.createQName(RM_URI, "ghosted");
|
||||
|
||||
|
||||
// Search rollup aspect
|
||||
public static final QName ASPECT_RM_SEARCH = QName.createQName(RM_URI, "recordSearch");
|
||||
public static final QName PROP_RS_DISPOSITION_ACTION_NAME = QName.createQName(RM_URI, "recordSearchDispositionActionName");
|
||||
@@ -231,4 +231,8 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
// 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");
|
||||
|
||||
// Original location of a record
|
||||
public static final QName ASPECT_ORIGINAL_LOCATION = QName.createQName(RM_URI, "originalLocation");
|
||||
public static final QName PROP_ORIGINAL_LOCATION = QName.createQName(RM_URI, "orgLocation");
|
||||
}
|
||||
|
@@ -18,10 +18,13 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.record;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
@@ -34,9 +37,9 @@ import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordServiceImpl;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
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.repo.security.permissions.AccessDeniedException;
|
||||
@@ -56,18 +59,18 @@ import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
/**
|
||||
* Record service implementation
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 2.1
|
||||
*/
|
||||
public class RecordServiceImpl implements RecordService,
|
||||
public class RecordServiceImpl implements RecordService,
|
||||
RecordsManagementModel,
|
||||
NodeServicePolicies.OnCreateChildAssociationPolicy,
|
||||
ApplicationContextAware
|
||||
{
|
||||
/** Application context */
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
|
||||
/** Node service **/
|
||||
private NodeService nodeService;
|
||||
|
||||
@@ -82,23 +85,23 @@ public class RecordServiceImpl implements RecordService,
|
||||
|
||||
/** Extended security service */
|
||||
private ExtendedSecurityService extendedSecurityService;
|
||||
|
||||
|
||||
/** Records management service */
|
||||
private RecordsManagementService recordsManagementService;
|
||||
|
||||
|
||||
/** Disposition service */
|
||||
private DispositionService dispositionService;
|
||||
|
||||
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
/** List of available record meta-data aspects */
|
||||
private Set<QName> recordMetaDataAspects;
|
||||
|
||||
|
||||
/** Behaviours */
|
||||
private JavaBehaviour onCreateChildAssociation = new JavaBehaviour(
|
||||
this,
|
||||
"onCreateChildAssociation",
|
||||
this,
|
||||
"onCreateChildAssociation",
|
||||
NotificationFrequency.FIRST_EVENT);
|
||||
|
||||
@Override
|
||||
@@ -106,7 +109,7 @@ public class RecordServiceImpl implements RecordService,
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param nodeService node service
|
||||
*/
|
||||
@@ -154,7 +157,7 @@ public class RecordServiceImpl implements RecordService,
|
||||
{
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param dispositionService disposition service
|
||||
*/
|
||||
@@ -162,7 +165,7 @@ public class RecordServiceImpl implements RecordService,
|
||||
{
|
||||
this.dispositionService = dispositionService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param policyComponent policy component
|
||||
*/
|
||||
@@ -170,22 +173,22 @@ public class RecordServiceImpl implements RecordService,
|
||||
{
|
||||
this.policyComponent = policyComponent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init method
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
policyComponent.bindAssociationBehaviour(
|
||||
NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME,
|
||||
TYPE_RECORD_FOLDER,
|
||||
NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME,
|
||||
TYPE_RECORD_FOLDER,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
onCreateChildAssociation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Behaviour executed when a new item is added to a record folder.
|
||||
*
|
||||
*
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy#onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean)
|
||||
*/
|
||||
@Override
|
||||
@@ -195,10 +198,10 @@ public class RecordServiceImpl implements RecordService,
|
||||
if (nodeService.exists(nodeRef) == true)
|
||||
{
|
||||
// create and file the content as a record
|
||||
file(nodeRef);
|
||||
file(nodeRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#getRecordMetaDataAspects()
|
||||
*/
|
||||
@@ -246,8 +249,8 @@ public class RecordServiceImpl implements RecordService,
|
||||
|
||||
return nodeService.hasAspect(record, ASPECT_DECLARED_RECORD);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#getUnfiledRootContainer(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@@ -255,26 +258,26 @@ public class RecordServiceImpl implements RecordService,
|
||||
public NodeRef getUnfiledContainer(NodeRef filePlan)
|
||||
{
|
||||
ParameterCheck.mandatory("filePlan", filePlan);
|
||||
|
||||
|
||||
if (recordsManagementService.isFilePlan(filePlan) == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to get the unfiled container, because passed node is not a file plan.");
|
||||
}
|
||||
|
||||
NodeRef result = null;
|
||||
|
||||
|
||||
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(filePlan, ASSOC_UNFILED_RECORDS,
|
||||
RegexQNamePattern.MATCH_ALL);
|
||||
if (assocs.size() > 1)
|
||||
{
|
||||
if (assocs.size() > 1)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(
|
||||
"Unable to get the unfiled container, because the container cannot be indentified.");
|
||||
"Unable to get the unfiled container, because the container cannot be indentified.");
|
||||
}
|
||||
else if (assocs.size() == 1 )
|
||||
{
|
||||
{
|
||||
result = assocs.get(0).getChildRef();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -287,60 +290,65 @@ public class RecordServiceImpl implements RecordService,
|
||||
{
|
||||
ParameterCheck.mandatory("filePlan", filePlan);
|
||||
ParameterCheck.mandatory("document", nodeRef);
|
||||
|
||||
|
||||
if (nodeService.hasAspect(nodeRef, ASPECT_RECORD) == false)
|
||||
{
|
||||
{
|
||||
// first we do a sanity check to ensure that the user has at least write permissions on the document
|
||||
if (permissionService.hasPermission(nodeRef, PermissionService.WRITE) != AccessStatus.ALLOWED)
|
||||
{
|
||||
throw new AccessDeniedException("Can not create record from document, because the user " +
|
||||
throw new AccessDeniedException("Can not create record from document, because the user " +
|
||||
AuthenticationUtil.getFullyAuthenticatedUser() +
|
||||
" does not have Write permissions on the doucment " +
|
||||
nodeRef.toString());
|
||||
}
|
||||
|
||||
|
||||
// do the work of creating the record as the system user
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
|
||||
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
// get the new record container for the file plan
|
||||
NodeRef newRecordContainer = getUnfiledContainer(filePlan);
|
||||
if (newRecordContainer == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to create record, because new record container could not be found.");
|
||||
if (newRecordContainer == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to create record, because new record container could not be found.");
|
||||
}
|
||||
|
||||
|
||||
// get the documents readers
|
||||
Long aclId = nodeService.getNodeAclId(nodeRef);
|
||||
Set<String> readers = permissionService.getReaders(aclId);
|
||||
|
||||
|
||||
// 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());
|
||||
|
||||
|
||||
// maintain the original primary location
|
||||
nodeService.addChild(parentAssoc.getParentRef(), nodeRef, parentAssoc.getTypeQName(), parentAssoc.getQName());
|
||||
|
||||
ChildAssociationRef child = nodeService.addChild(parentAssoc.getParentRef(), nodeRef, parentAssoc.getTypeQName(), parentAssoc.getQName());
|
||||
|
||||
// Add the information about the original location
|
||||
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(1);
|
||||
aspectProperties.put(PROP_ORIGINAL_LOCATION, (Serializable) child.getParentRef());
|
||||
nodeService.addAspect(nodeRef, ASPECT_ORIGINAL_LOCATION, aspectProperties);
|
||||
|
||||
// make the document a record
|
||||
makeRecord(nodeRef);
|
||||
|
||||
|
||||
// set the readers
|
||||
extendedSecurityService.setExtendedReaders(nodeRef, readers);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a record from the given document
|
||||
*
|
||||
*
|
||||
* @param document the document from which a record will be created
|
||||
*/
|
||||
private void makeRecord(NodeRef document)
|
||||
@@ -351,7 +359,7 @@ public class RecordServiceImpl implements RecordService,
|
||||
.getParentRef());
|
||||
nodeService.setProperty(document, PROP_IDENTIFIER, recordId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.disposableitem.RecordService#isFiled(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@@ -359,38 +367,38 @@ public class RecordServiceImpl implements RecordService,
|
||||
public boolean isFiled(NodeRef nodeRef)
|
||||
{
|
||||
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||
|
||||
|
||||
boolean result = false;
|
||||
|
||||
|
||||
if (isRecord(nodeRef) == true)
|
||||
{
|
||||
ChildAssociationRef childAssocRef = nodeService.getPrimaryParent(nodeRef);
|
||||
if (childAssocRef != null)
|
||||
{
|
||||
NodeRef parent = childAssocRef.getParentRef();
|
||||
if (parent != null &&
|
||||
if (parent != null &&
|
||||
recordsManagementService.isRecordFolder(parent) == true)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to 'file' a new document that arrived in the file plan structure.
|
||||
*
|
||||
*
|
||||
* TODO atm we only 'file' content as a record .. may need to consider other types if we
|
||||
* are to support the notion of composite records.
|
||||
*
|
||||
* @param record node reference to record (or soon to be record!)
|
||||
*
|
||||
* @param record node reference to record (or soon to be record!)
|
||||
*/
|
||||
private void file(NodeRef record)
|
||||
{
|
||||
ParameterCheck.mandatory("item", record);
|
||||
|
||||
|
||||
// we only support filling of content items
|
||||
// TODO composite record support needs to file containers too
|
||||
QName type = nodeService.getType(record);
|
||||
@@ -403,19 +411,19 @@ public class RecordServiceImpl implements RecordService,
|
||||
// make the item a record
|
||||
makeRecord(record);
|
||||
}
|
||||
|
||||
// set filed date
|
||||
|
||||
// set filed date
|
||||
if (nodeService.getProperty(record, PROP_DATE_FILED) == null)
|
||||
{
|
||||
Calendar fileCalendar = Calendar.getInstance();
|
||||
nodeService.setProperty(record, PROP_DATE_FILED, fileCalendar.getTime());
|
||||
}
|
||||
|
||||
|
||||
// initialise vital record details
|
||||
// TODO .. change this to add the aspect which will trigger the init behaviour
|
||||
VitalRecordServiceImpl vitalRecordService = (VitalRecordServiceImpl)applicationContext.getBean("vitalRecordService");
|
||||
vitalRecordService.initialiseVitalRecord(record);
|
||||
|
||||
|
||||
// initialise disposition details
|
||||
if (nodeService.hasAspect(record, ASPECT_DISPOSITION_LIFECYCLE) == false)
|
||||
{
|
||||
|
Reference in New Issue
Block a user