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