mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
fixing IDE whitespaces
This commit is contained in:
@@ -149,8 +149,8 @@ public class RecordsAPI extends RMModelRequest
|
|||||||
* <li>Invalid parameter: {@code recordId} is not a record</li>
|
* <li>Invalid parameter: {@code recordId} is not a record</li>
|
||||||
* <li>authentication fails</li>
|
* <li>authentication fails</li>
|
||||||
* <li>current user does not have permission to complete {@code recordId}</li>
|
* <li>current user does not have permission to complete {@code recordId}</li>
|
||||||
* <li>{@code recordId} does not exist</li>
|
* <li>{@code recordId} does not exist or is frozen</li>
|
||||||
* <li>model integrity exception: the record is already complete</li>
|
* <li>model integrity exception: the record is already completed</li>
|
||||||
* <li>model integrity exception: the record has missing meta-data</li>
|
* <li>model integrity exception: the record has missing meta-data</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
@@ -242,7 +242,7 @@ public class RecordsAPI extends RMModelRequest
|
|||||||
* @param recordModel The record model which holds the information
|
* @param recordModel The record model which holds the information
|
||||||
* @param recordId The identifier of a record
|
* @param recordId The identifier of a record
|
||||||
* @param parameters The URL parameters to add
|
* @param parameters The URL parameters to add
|
||||||
* @param returns The updated {@link Record}
|
* @return The updated {@link Record}
|
||||||
* @throws Exception for the following cases:
|
* @throws Exception for the following cases:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>the update request is invalid or {@code recordId} is not a valid format or {@code recordModel} is invalid</li>
|
* <li>the update request is invalid or {@code recordId} is not a valid format or {@code recordModel} is invalid</li>
|
||||||
|
@@ -207,8 +207,7 @@ public class CompleteRecordTests extends BaseRMRestTest
|
|||||||
description = "Cannot complete a document that is not a record"
|
description = "Cannot complete a document that is not a record"
|
||||||
)
|
)
|
||||||
@AlfrescoTest (jira = "RM-4431")
|
@AlfrescoTest (jira = "RM-4431")
|
||||||
public void completeNonRecord(String nonRecordId)
|
public void completeNonRecord(String nonRecordId) throws Exception
|
||||||
throws Exception
|
|
||||||
{
|
{
|
||||||
// Get the recordsAPI
|
// Get the recordsAPI
|
||||||
RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
|
RecordsAPI recordsAPI = getRestAPIFactory().getRecordsAPI();
|
||||||
@@ -254,7 +253,7 @@ public class CompleteRecordTests extends BaseRMRestTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to create an electronic record and and assert successfully creation
|
* Helper method to create an electronic record and and assert successful creation
|
||||||
*/
|
*/
|
||||||
private Record createAndVerifyElectronicRecord(String recordFolderId) throws Exception
|
private Record createAndVerifyElectronicRecord(String recordFolderId) throws Exception
|
||||||
{
|
{
|
||||||
@@ -268,7 +267,7 @@ public class CompleteRecordTests extends BaseRMRestTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to create a non-electronic record and and assert successfully creation
|
* Helper method to create a non-electronic record and and assert successful creation
|
||||||
*/
|
*/
|
||||||
private Record createAndVerifyNonElectronicRecord(String recordFolderId) throws Exception
|
private Record createAndVerifyNonElectronicRecord(String recordFolderId) throws Exception
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -42,14 +42,10 @@ import org.alfresco.util.ParameterCheck;
|
|||||||
*/
|
*/
|
||||||
public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||||
{
|
{
|
||||||
/**
|
/** action name */
|
||||||
* action name
|
|
||||||
*/
|
|
||||||
public static final String NAME = "declareRecord";
|
public static final String NAME = "declareRecord";
|
||||||
|
|
||||||
/**
|
/** Record service */
|
||||||
* Record service
|
|
||||||
*/
|
|
||||||
private RecordService recordService;
|
private RecordService recordService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -55,8 +55,9 @@ public interface RecordService
|
|||||||
* A record metadata aspect can be registered more than once if it applies to more than one
|
* A record metadata aspect can be registered more than once if it applies to more than one
|
||||||
* file plan type.
|
* file plan type.
|
||||||
*
|
*
|
||||||
* @param recordMetadataAspect record metadata aspect qualified name
|
* @param recordMetadataAspect record metadata aspect qualified name
|
||||||
* @param filePlanType file plan type
|
* @param filePlanType file plan type
|
||||||
|
*
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
void registerRecordMetadataAspect(QName recordMetadataAspect, QName filePlanType);
|
void registerRecordMetadataAspect(QName recordMetadataAspect, QName filePlanType);
|
||||||
@@ -71,7 +72,8 @@ public interface RecordService
|
|||||||
/**
|
/**
|
||||||
* Disables the property editable check for a given node in this transaction only.
|
* Disables the property editable check for a given node in this transaction only.
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
|
*
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
void disablePropertyEditableCheck(NodeRef nodeRef);
|
void disablePropertyEditableCheck(NodeRef nodeRef);
|
||||||
@@ -82,194 +84,200 @@ public interface RecordService
|
|||||||
void enablePropertyEditableCheck();
|
void enablePropertyEditableCheck();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all the record meta-data aspects
|
* Gets a list of all the record meta-data aspects
|
||||||
*
|
*
|
||||||
* @return {@link Set}<{@link QName}> list of record meta-data aspects
|
* @return {@link Set}<{@link QName}> list of record meta-data aspects
|
||||||
* @deprecated since 2.2, file plan component required to provide context
|
*
|
||||||
*/
|
* @deprecated since 2.2, file plan component required to provide context
|
||||||
@Deprecated
|
*/
|
||||||
Set<QName> getRecordMetaDataAspects();
|
@Deprecated
|
||||||
|
Set<QName> getRecordMetaDataAspects();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the provided aspect is a registered record meta-data
|
* Indicates whether the provided aspect is a registered record meta-data
|
||||||
* aspect.
|
* aspect.
|
||||||
*
|
*
|
||||||
* @param aspect aspect {@link QName}
|
* @param aspect aspect {@link QName}
|
||||||
* @return boolean true if the aspect is a registered record meta-data aspect, false otherwise
|
* @return boolean true if the aspect is a registered record meta-data aspect, false otherwise
|
||||||
* @since 2.3
|
*
|
||||||
*/
|
* @since 2.3
|
||||||
boolean isRecordMetadataAspect(QName aspect);
|
*/
|
||||||
|
boolean isRecordMetadataAspect(QName aspect);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whther the provided property is declared on a registered record
|
* Indicates whther the provided property is declared on a registered record
|
||||||
* meta-data aspect.
|
* meta-data aspect.
|
||||||
*
|
*
|
||||||
* @param property property {@link QName}
|
* @param property property {@link QName}
|
||||||
* @return boolean true if the property is declared on a registered record meta-data aspect,
|
* @return boolean true if the property is declared on a registered record meta-data aspect,
|
||||||
* false otherwise
|
* false otherwise
|
||||||
* @since 2.3
|
*
|
||||||
*/
|
* @since 2.3
|
||||||
boolean isRecordMetadataProperty(QName property);
|
*/
|
||||||
|
boolean isRecordMetadataProperty(QName property);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all the record metadata aspects relevant to the file plan type of the
|
* Gets a list of all the record metadata aspects relevant to the file plan type of the
|
||||||
* file plan component provided.
|
* file plan component provided.
|
||||||
* <p>
|
* <p>
|
||||||
* If a null context is provided all record meta-data aspects are returned, but this is not
|
* If a null context is provided all record meta-data aspects are returned, but this is not
|
||||||
* recommended.
|
* recommended.
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference to file plan component providing context
|
* @param nodeRef node reference to file plan component providing context
|
||||||
* @return {@link Set}<{@link QName}> list of record meta-data aspects
|
* @return {@link Set}<{@link QName}> list of record meta-data aspects
|
||||||
* @since 2.2
|
*
|
||||||
*/
|
* @since 2.2
|
||||||
Set<QName> getRecordMetadataAspects(NodeRef nodeRef);
|
*/
|
||||||
|
Set<QName> getRecordMetadataAspects(NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all the record metadata aspect that relate to the provided file plan type.
|
* Gets a list of all the record metadata aspect that relate to the provided file plan type.
|
||||||
* <p>
|
* <p>
|
||||||
* If null is provided for the file plan type then record metadata aspects for the default
|
* If null is provided for the file plan type then record metadata aspects for the default
|
||||||
* file plan type (rma:filePlan) are returned.
|
* file plan type (rma:filePlan) are returned.
|
||||||
*
|
*
|
||||||
* @param filePlanType file plan type
|
* @param filePlanType file plan type
|
||||||
* @return{@link Set}<{@link QName}> list of record meta-data aspects
|
* @return{@link Set}<{@link QName}> list of record meta-data aspects
|
||||||
* @since 2.2
|
*
|
||||||
*/
|
* @since 2.2
|
||||||
Set<QName> getRecordMetadataAspects(QName filePlanType);
|
*/
|
||||||
|
Set<QName> getRecordMetadataAspects(QName filePlanType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether if the given node reference is a record or not
|
* Checks whether if the given node reference is a record or not
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference to be checked
|
* @param nodeRef node reference to be checked
|
||||||
* @return boolean true if the node reference is a record, false otherwise
|
* @return boolean true if the node reference is a record, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isRecord(NodeRef nodeRef);
|
boolean isRecord(NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the record is declared
|
* Indicates whether the record is declared
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference of the record for which the check would be performed
|
* @param nodeRef node reference of the record for which the check would be performed
|
||||||
* @return boolean true if record is declared, false otherwise
|
* @return boolean true if record is declared, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isDeclared(NodeRef nodeRef);
|
boolean isDeclared(NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new unfiled record from an existing node.
|
* Creates a new unfiled record from an existing node.
|
||||||
* <p>
|
* <p>
|
||||||
* Note that the node reference of the record will be the same as the original
|
* Note that the node reference of the record will be the same as the original
|
||||||
* document.
|
* document.
|
||||||
*
|
*
|
||||||
* @param filePlan The filePlan in which the record should be placed. filePlan can be <code>null</code> in this case the default RM site will be used.
|
* @param filePlan The filePlan in which the record should be placed. filePlan can be <code>null</code> in this case the default RM site will be used.
|
||||||
* @param nodeRef The node from which the record will be created
|
* @param nodeRef The node from which the record will be created
|
||||||
* @param isLinked indicates if the newly created record is linked to it's original location or not.
|
* @param isLinked indicates if the newly created record is linked to it's original location or not.
|
||||||
*/
|
*/
|
||||||
void createRecord(NodeRef filePlan, NodeRef nodeRef, boolean isLinked);
|
void createRecord(NodeRef filePlan, NodeRef nodeRef, boolean isLinked);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Links the newly created record to it's original location.
|
* Links the newly created record to it's original location.
|
||||||
*
|
*
|
||||||
* @see #createRecord(NodeRef, NodeRef, boolean)
|
* @see #createRecord(NodeRef, NodeRef, boolean)
|
||||||
*/
|
*/
|
||||||
void createRecord(NodeRef filePlan, NodeRef nodeRef);
|
void createRecord(NodeRef filePlan, NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a record from a copy of the node reference provided.
|
* Creates a record from a copy of the node reference provided.
|
||||||
*
|
*
|
||||||
* @param filePlan file plan
|
* @param filePlan file plan
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
*/
|
*/
|
||||||
NodeRef createRecordFromCopy(NodeRef filePlan, NodeRef nodeRef);
|
NodeRef createRecordFromCopy(NodeRef filePlan, NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new document in the unfiled records container if the given node reference is a file plan
|
* Creates a new document in the unfiled records container if the given node reference is a file plan
|
||||||
* node reference otherwise the node reference will be used as the destination for the new record.
|
* node reference otherwise the node reference will be used as the destination for the new record.
|
||||||
*
|
*
|
||||||
* @param parent parent node reference
|
* @param parent parent node reference
|
||||||
* @param name name of the new record
|
* @param name name of the new record
|
||||||
* @param type content type, cm:content if null
|
* @param type content type, cm:content if null
|
||||||
* @param properties properties
|
* @param properties properties
|
||||||
* @param reader content reader
|
* @param reader content reader
|
||||||
*/
|
*/
|
||||||
NodeRef createRecordFromContent(NodeRef parent, String name, QName type, Map<QName, Serializable> properties, ContentReader reader);
|
NodeRef createRecordFromContent(NodeRef parent, String name, QName type, Map<QName, Serializable> properties, ContentReader reader);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the record is filed or not
|
* Indicates whether the record is filed or not
|
||||||
*
|
*
|
||||||
* @param record Record node reference
|
* @param record nodeRef of record
|
||||||
* @return boolean true if filed, false otherwise
|
* @return boolean true if filed, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isFiled(NodeRef record);
|
boolean isFiled(NodeRef record);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'File' a new document that arrived in the file plan structure.
|
* 'File' a new document that arrived in the file plan structure.
|
||||||
*
|
*
|
||||||
* @param record Record node reference
|
* @param record noderef of record
|
||||||
*/
|
*/
|
||||||
void file(NodeRef record);
|
void file(NodeRef record);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rejects a record with the provided reason
|
* Rejects a record with the provided reason
|
||||||
*
|
*
|
||||||
* @param nodeRef The record which will be rejected
|
* @param nodeRef The record which will be rejected
|
||||||
* @param reason The reason for rejection
|
* @param reason The reason for rejection
|
||||||
*/
|
*/
|
||||||
void rejectRecord(NodeRef nodeRef, String reason);
|
void rejectRecord(NodeRef nodeRef, String reason);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether a property of a record is editable for the current user or not.
|
* Indicates whether a property of a record is editable for the current user or not.
|
||||||
*
|
*
|
||||||
* @param record record
|
* @param record record
|
||||||
* @param property property
|
* @param property property
|
||||||
* @return boolean true if editable, false otherwise.
|
* @return boolean true if editable, false otherwise.
|
||||||
*/
|
*/
|
||||||
boolean isPropertyEditable(NodeRef record, QName property);
|
boolean isPropertyEditable(NodeRef record, QName property);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the given node (record or record folder) is a metadata stub or not.
|
* Indicates whether the given node (record or record folder) is a metadata stub or not.
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
* @return boolean true if a metadata stub, false otherwise
|
* @return boolean true if a metadata stub, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isMetadataStub(NodeRef nodeRef);
|
boolean isMetadataStub(NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all the records within a record folder
|
* Gets a list of all the records within a record folder
|
||||||
*
|
*
|
||||||
* @param recordFolder record folder
|
* @param recordFolder record folder
|
||||||
* @return List<NodeRef> list of records in the record folder
|
* @return List<NodeRef> list of records in the record folder
|
||||||
*/
|
*/
|
||||||
List<NodeRef> getRecords(NodeRef recordFolder);
|
List<NodeRef> getRecords(NodeRef recordFolder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the specified type to the record
|
* Adds the specified type to the record
|
||||||
*
|
*
|
||||||
* @param nodeRef Record node reference
|
* @param nodeRef Record node reference
|
||||||
* @param typeQName Type to add
|
* @param typeQName Type to add
|
||||||
*/
|
*/
|
||||||
void addRecordType(NodeRef nodeRef, QName typeQName);
|
void addRecordType(NodeRef nodeRef, QName typeQName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a record from the given document
|
* Creates a record from the given document
|
||||||
*
|
*
|
||||||
* @param nodeRef The document node reference from which a record will be created
|
* @param nodeRef The document node reference from which a record will be created
|
||||||
*/
|
*/
|
||||||
void makeRecord(NodeRef nodeRef);
|
void makeRecord(NodeRef nodeRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Links a record to a record folder
|
* Links a record to a record folder
|
||||||
*
|
*
|
||||||
* @param record the record to link
|
* @param record the record to link
|
||||||
* @param recordFolder the record folder to link it to
|
* @param recordFolder the record folder to link it to
|
||||||
*/
|
*/
|
||||||
void link(NodeRef record, NodeRef recordFolder);
|
void link(NodeRef record, NodeRef recordFolder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlinks a record from a specified record folder.
|
* Unlinks a record from a specified record folder.
|
||||||
*
|
*
|
||||||
* @param record the record to unlink
|
* @param record the record to unlink
|
||||||
* @param recordFolder the record folder to unlink it from
|
* @param recordFolder the record folder to unlink it from
|
||||||
* @since 2.3
|
*
|
||||||
*/
|
* @since 2.3
|
||||||
void unlink(NodeRef record, NodeRef recordFolder);
|
*/
|
||||||
|
void unlink(NodeRef record, NodeRef recordFolder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Completes a record
|
* Completes a record
|
||||||
|
@@ -136,56 +136,42 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
|||||||
*/
|
*/
|
||||||
@BehaviourBean
|
@BehaviourBean
|
||||||
public class RecordServiceImpl extends BaseBehaviourBean
|
public class RecordServiceImpl extends BaseBehaviourBean
|
||||||
implements RecordService,
|
implements RecordService,
|
||||||
RecordsManagementModel,
|
RecordsManagementModel,
|
||||||
RecordsManagementCustomModel,
|
RecordsManagementCustomModel,
|
||||||
NodeServicePolicies.OnAddAspectPolicy,
|
NodeServicePolicies.OnAddAspectPolicy,
|
||||||
NodeServicePolicies.OnCreateChildAssociationPolicy,
|
NodeServicePolicies.OnCreateChildAssociationPolicy,
|
||||||
NodeServicePolicies.OnRemoveAspectPolicy,
|
NodeServicePolicies.OnRemoveAspectPolicy,
|
||||||
NodeServicePolicies.OnUpdatePropertiesPolicy,
|
NodeServicePolicies.OnUpdatePropertiesPolicy,
|
||||||
ContentServicePolicies.OnContentUpdatePolicy
|
ContentServicePolicies.OnContentUpdatePolicy
|
||||||
{
|
{
|
||||||
/**
|
/** Logger */
|
||||||
* Logger
|
|
||||||
*/
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(RecordServiceImpl.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(RecordServiceImpl.class);
|
||||||
|
|
||||||
/**
|
/** Sync Model URI */
|
||||||
* Sync Model URI
|
|
||||||
*/
|
|
||||||
private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0";
|
private static final String SYNC_MODEL_1_0_URI = "http://www.alfresco.org/model/sync/1.0";
|
||||||
|
|
||||||
/**
|
/** Synced aspect */
|
||||||
* Synced aspect
|
|
||||||
*/
|
|
||||||
private static final QName ASPECT_SYNCED = QName.createQName(SYNC_MODEL_1_0_URI, "synced");
|
private static final QName ASPECT_SYNCED = QName.createQName(SYNC_MODEL_1_0_URI, "synced");
|
||||||
|
|
||||||
/**
|
/** transation data key */
|
||||||
* transation data key
|
|
||||||
*/
|
|
||||||
private static final String KEY_IGNORE_ON_UPDATE = "ignoreOnUpdate";
|
private static final String KEY_IGNORE_ON_UPDATE = "ignoreOnUpdate";
|
||||||
public static final String KEY_NEW_RECORDS = "newRecords";
|
public static final String KEY_NEW_RECORDS = "newRecords";
|
||||||
|
|
||||||
/**
|
/** I18N */
|
||||||
* I18N
|
|
||||||
*/
|
|
||||||
private static final String MSG_NODE_HAS_ASPECT = "rm.service.node-has-aspect";
|
private static final String MSG_NODE_HAS_ASPECT = "rm.service.node-has-aspect";
|
||||||
private static final String FINAL_VERSION = "rm.service.final-version";
|
private static final String FINAL_VERSION = "rm.service.final-version";
|
||||||
private static final String FINAL_DESCRIPTION = "rm.service.final-version-description";
|
private static final String FINAL_DESCRIPTION = "rm.service.final-version-description";
|
||||||
private static final String MSG_UNDECLARED_ONLY_RECORDS = "rm.action.undeclared-only-records";
|
private static final String MSG_UNDECLARED_ONLY_RECORDS = "rm.action.undeclared-only-records";
|
||||||
private static final String MSG_NO_DECLARE_MAND_PROP = "rm.action.no-declare-mand-prop";
|
private static final String MSG_NO_DECLARE_MAND_PROP = "rm.action.no-declare-mand-prop";
|
||||||
|
|
||||||
/**
|
/** Always edit property array */
|
||||||
* Always edit property array
|
|
||||||
*/
|
|
||||||
private static final QName[] ALWAYS_EDIT_PROPERTIES = new QName[]
|
private static final QName[] ALWAYS_EDIT_PROPERTIES = new QName[]
|
||||||
{
|
{
|
||||||
ContentModel.PROP_LAST_THUMBNAIL_MODIFICATION_DATA
|
ContentModel.PROP_LAST_THUMBNAIL_MODIFICATION_DATA
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** always edit model URI's */
|
||||||
* always edit model URI's
|
|
||||||
*/
|
|
||||||
private List<String> alwaysEditURIs;
|
private List<String> alwaysEditURIs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -209,140 +195,92 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
return this.alwaysEditURIs;
|
return this.alwaysEditURIs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** record model URI's */
|
||||||
* record model URI's
|
|
||||||
*/
|
|
||||||
public static final List<String> RECORD_MODEL_URIS = Collections.unmodifiableList(
|
public static final List<String> RECORD_MODEL_URIS = Collections.unmodifiableList(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
RM_URI,
|
RM_URI,
|
||||||
RM_CUSTOM_URI,
|
RM_CUSTOM_URI,
|
||||||
ReportModel.RMR_URI,
|
ReportModel.RMR_URI,
|
||||||
RecordableVersionModel.RMV_URI,
|
RecordableVersionModel.RMV_URI,
|
||||||
DOD5015Model.DOD_URI
|
DOD5015Model.DOD_URI
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/** non-record model URI's */
|
||||||
* non-record model URI's
|
|
||||||
*/
|
|
||||||
private static final String[] NON_RECORD_MODEL_URIS = new String[]
|
private static final String[] NON_RECORD_MODEL_URIS = new String[]
|
||||||
{
|
{
|
||||||
NamespaceService.AUDIO_MODEL_1_0_URI,
|
NamespaceService.AUDIO_MODEL_1_0_URI,
|
||||||
NamespaceService.CONTENT_MODEL_1_0_URI,
|
NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||||
NamespaceService.EMAILSERVER_MODEL_URI,
|
NamespaceService.EMAILSERVER_MODEL_URI,
|
||||||
NamespaceService.EXIF_MODEL_1_0_URI,
|
NamespaceService.EXIF_MODEL_1_0_URI,
|
||||||
NamespaceService.FORUMS_MODEL_1_0_URI,
|
NamespaceService.FORUMS_MODEL_1_0_URI,
|
||||||
NamespaceService.LINKS_MODEL_1_0_URI,
|
NamespaceService.LINKS_MODEL_1_0_URI,
|
||||||
NamespaceService.REPOSITORY_VIEW_1_0_URI
|
NamespaceService.REPOSITORY_VIEW_1_0_URI
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** Indentity service */
|
||||||
* Indentity service
|
|
||||||
*/
|
|
||||||
private IdentifierService identifierService;
|
private IdentifierService identifierService;
|
||||||
|
|
||||||
/**
|
/** Extended permission service */
|
||||||
* Extended permission service
|
|
||||||
*/
|
|
||||||
private ExtendedPermissionService extendedPermissionService;
|
private ExtendedPermissionService extendedPermissionService;
|
||||||
|
|
||||||
/**
|
/** Extended security service */
|
||||||
* Extended security service
|
|
||||||
*/
|
|
||||||
private ExtendedSecurityService extendedSecurityService;
|
private ExtendedSecurityService extendedSecurityService;
|
||||||
|
|
||||||
/**
|
/** File plan service */
|
||||||
* File plan service
|
|
||||||
*/
|
|
||||||
private FilePlanService filePlanService;
|
private FilePlanService filePlanService;
|
||||||
|
|
||||||
/**
|
/** Records management notification helper */
|
||||||
* Records management notification helper
|
|
||||||
*/
|
|
||||||
private RecordsManagementNotificationHelper notificationHelper;
|
private RecordsManagementNotificationHelper notificationHelper;
|
||||||
|
|
||||||
/**
|
/** Policy component */
|
||||||
* Policy component
|
|
||||||
*/
|
|
||||||
private PolicyComponent policyComponent;
|
private PolicyComponent policyComponent;
|
||||||
|
|
||||||
/**
|
/** Ownable service */
|
||||||
* Ownable service
|
|
||||||
*/
|
|
||||||
private OwnableService ownableService;
|
private OwnableService ownableService;
|
||||||
|
|
||||||
/**
|
/** Capability service */
|
||||||
* Capability service
|
|
||||||
*/
|
|
||||||
private CapabilityService capabilityService;
|
private CapabilityService capabilityService;
|
||||||
|
|
||||||
/**
|
/** Rule service */
|
||||||
* Rule service
|
|
||||||
*/
|
|
||||||
private RuleService ruleService;
|
private RuleService ruleService;
|
||||||
|
|
||||||
/**
|
/** File folder service */
|
||||||
* File folder service
|
|
||||||
*/
|
|
||||||
private FileFolderService fileFolderService;
|
private FileFolderService fileFolderService;
|
||||||
|
|
||||||
/**
|
/** Record folder service */
|
||||||
* Record folder service
|
|
||||||
*/
|
|
||||||
private RecordFolderService recordFolderService;
|
private RecordFolderService recordFolderService;
|
||||||
|
|
||||||
/**
|
/** File plan role service */
|
||||||
* File plan role service
|
|
||||||
*/
|
|
||||||
private FilePlanRoleService filePlanRoleService;
|
private FilePlanRoleService filePlanRoleService;
|
||||||
|
|
||||||
/**
|
/** Permission service */
|
||||||
* Permission service
|
|
||||||
*/
|
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
|
|
||||||
/**
|
/** Version service */
|
||||||
* Version service
|
|
||||||
*/
|
|
||||||
private VersionService versionService;
|
private VersionService versionService;
|
||||||
|
|
||||||
/**
|
/** Relationship service */
|
||||||
* Relationship service
|
|
||||||
*/
|
|
||||||
private RelationshipService relationshipService;
|
private RelationshipService relationshipService;
|
||||||
|
|
||||||
/**
|
/** Disposition service */
|
||||||
* Disposition service
|
|
||||||
*/
|
|
||||||
private DispositionService dispositionService;
|
private DispositionService dispositionService;
|
||||||
|
|
||||||
/**
|
/** records management container type */
|
||||||
* records management container type
|
|
||||||
*/
|
|
||||||
private RecordsManagementContainerType recordsManagementContainerType;
|
private RecordsManagementContainerType recordsManagementContainerType;
|
||||||
|
|
||||||
/**
|
/** recordable version service */
|
||||||
* recordable version service
|
|
||||||
*/
|
|
||||||
private RecordableVersionService recordableVersionService;
|
private RecordableVersionService recordableVersionService;
|
||||||
|
|
||||||
/**
|
/** list of available record meta-data aspects and the file plan types the are applicable to */
|
||||||
* list of available record meta-data aspects and the file plan types the are applicable to
|
|
||||||
*/
|
|
||||||
private Map<QName, Set<QName>> recordMetaDataAspects;
|
private Map<QName, Set<QName>> recordMetaDataAspects;
|
||||||
|
|
||||||
/**
|
/** Freeze service */
|
||||||
* Freeze service
|
|
||||||
*/
|
|
||||||
private FreezeService freezeService;
|
private FreezeService freezeService;
|
||||||
|
|
||||||
/**
|
/** Namespace service */
|
||||||
* Namespace service
|
|
||||||
*/
|
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
|
|
||||||
/**
|
/** policies */
|
||||||
* policies
|
|
||||||
*/
|
|
||||||
private ClassPolicyDelegate<BeforeFileRecord> beforeFileRecord;
|
private ClassPolicyDelegate<BeforeFileRecord> beforeFileRecord;
|
||||||
private ClassPolicyDelegate<OnFileRecord> onFileRecord;
|
private ClassPolicyDelegate<OnFileRecord> onFileRecord;
|
||||||
private ClassPolicyDelegate<BeforeRecordDeclaration> beforeRecordDeclarationDelegate;
|
private ClassPolicyDelegate<BeforeRecordDeclaration> beforeRecordDeclarationDelegate;
|
||||||
@@ -369,7 +307,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param extendedSecurityService extended security service
|
* @param extendedSecurityService extended security service
|
||||||
*/
|
*/
|
||||||
public void setExtendedSecurityService(ExtendedSecurityService extendedSecurityService)
|
public void setExtendedSecurityService(ExtendedSecurityService extendedSecurityService)
|
||||||
{
|
{
|
||||||
@@ -377,7 +315,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param filePlanService file plan service
|
* @param filePlanService file plan service
|
||||||
*/
|
*/
|
||||||
public void setFilePlanService(FilePlanService filePlanService)
|
public void setFilePlanService(FilePlanService filePlanService)
|
||||||
{
|
{
|
||||||
@@ -393,7 +331,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param policyComponent policy component
|
* @param policyComponent policy component
|
||||||
*/
|
*/
|
||||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||||
{
|
{
|
||||||
@@ -401,7 +339,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ownableService ownable service
|
* @param ownableService ownable service
|
||||||
*/
|
*/
|
||||||
public void setOwnableService(OwnableService ownableService)
|
public void setOwnableService(OwnableService ownableService)
|
||||||
{
|
{
|
||||||
@@ -417,7 +355,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ruleService rule service
|
* @param ruleService rule service
|
||||||
*/
|
*/
|
||||||
public void setRuleService(RuleService ruleService)
|
public void setRuleService(RuleService ruleService)
|
||||||
{
|
{
|
||||||
@@ -465,7 +403,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param relationshipService relationship service
|
* @param relationshipService relationship service
|
||||||
*/
|
*/
|
||||||
public void setRelationshipService(RelationshipService relationshipService)
|
public void setRelationshipService(RelationshipService relationshipService)
|
||||||
{
|
{
|
||||||
@@ -473,7 +411,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dispositionService disposition service
|
* @param dispositionService disposition service
|
||||||
*/
|
*/
|
||||||
public void setDispositionService(DispositionService dispositionService)
|
public void setDispositionService(DispositionService dispositionService)
|
||||||
{
|
{
|
||||||
@@ -481,7 +419,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param recordsManagementContainerType records management container type
|
* @param recordsManagementContainerType records management container type
|
||||||
*/
|
*/
|
||||||
public void setRecordsManagementContainerType(RecordsManagementContainerType recordsManagementContainerType)
|
public void setRecordsManagementContainerType(RecordsManagementContainerType recordsManagementContainerType)
|
||||||
{
|
{
|
||||||
@@ -489,7 +427,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param recordableVersionService recordable version service
|
* @param recordableVersionService recordable version service
|
||||||
*/
|
*/
|
||||||
public void setRecordableVersionService(RecordableVersionService recordableVersionService)
|
public void setRecordableVersionService(RecordableVersionService recordableVersionService)
|
||||||
{
|
{
|
||||||
@@ -544,11 +482,11 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
type = "rma:record",
|
type = "rma:record",
|
||||||
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
|
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
|
||||||
)
|
)
|
||||||
public void onAddAspect(NodeRef nodeRef, QName aspect)
|
public void onAddAspect(NodeRef nodeRef, QName aspect)
|
||||||
{
|
{
|
||||||
authenticationUtil.runAsSystem(new RunAsWork<Void>()
|
authenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||||
@@ -571,10 +509,10 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
type = "sys:noContent"
|
type = "sys:noContent"
|
||||||
)
|
)
|
||||||
public void onRemoveAspect(NodeRef nodeRef, QName aspect)
|
public void onRemoveAspect(NodeRef nodeRef, QName aspect)
|
||||||
{
|
{
|
||||||
if (nodeService.hasAspect(nodeRef, ASPECT_RECORD))
|
if (nodeService.hasAspect(nodeRef, ASPECT_RECORD))
|
||||||
@@ -595,11 +533,11 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = ASSOCIATION,
|
kind = ASSOCIATION,
|
||||||
type = "rma:recordFolder",
|
type = "rma:recordFolder",
|
||||||
notificationFrequency = FIRST_EVENT
|
notificationFrequency = FIRST_EVENT
|
||||||
)
|
)
|
||||||
public void onCreateChildAssociation(final ChildAssociationRef childAssocRef, final boolean bNew)
|
public void onCreateChildAssociation(final ChildAssociationRef childAssocRef, final boolean bNew)
|
||||||
{
|
{
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Void>()
|
AuthenticationUtil.runAs(new RunAsWork<Void>()
|
||||||
@@ -610,10 +548,10 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
NodeRef nodeRef = childAssocRef.getChildRef();
|
NodeRef nodeRef = childAssocRef.getChildRef();
|
||||||
if (nodeService.exists(nodeRef) &&
|
if (nodeService.exists(nodeRef) &&
|
||||||
!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY) &&
|
!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TEMPORARY) &&
|
||||||
!nodeService.getType(nodeRef).equals(TYPE_RECORD_FOLDER) &&
|
!nodeService.getType(nodeRef).equals(TYPE_RECORD_FOLDER) &&
|
||||||
!nodeService.getType(nodeRef).equals(TYPE_RECORD_CATEGORY))
|
!nodeService.getType(nodeRef).equals(TYPE_RECORD_CATEGORY))
|
||||||
{
|
{
|
||||||
// store information about the 'new' record in the transaction
|
// store information about the 'new' record in the transaction
|
||||||
// @since 2.3
|
// @since 2.3
|
||||||
@@ -622,7 +560,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
Set<NodeRef> newRecords = transactionalResourceHelper.getSet(KEY_NEW_RECORDS);
|
Set<NodeRef> newRecords = transactionalResourceHelper.getSet(KEY_NEW_RECORDS);
|
||||||
newRecords.add(nodeRef);
|
newRecords.add(nodeRef);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// if we are linking a record
|
// if we are linking a record
|
||||||
NodeRef parentNodeRef = childAssocRef.getParentRef();
|
NodeRef parentNodeRef = childAssocRef.getParentRef();
|
||||||
@@ -638,11 +577,13 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
// recalculate disposition schedule for the record when linking it
|
// recalculate disposition schedule for the record when linking it
|
||||||
dispositionService.recalculateNextDispositionStep(nodeRef);
|
dispositionService.recalculateNextDispositionStep(nodeRef);
|
||||||
}
|
}
|
||||||
} catch (RecordLinkRuntimeException e)
|
}
|
||||||
|
catch (RecordLinkRuntimeException e)
|
||||||
{
|
{
|
||||||
// rethrow exception
|
// rethrow exception
|
||||||
throw e;
|
throw e;
|
||||||
} catch (AlfrescoRuntimeException e)
|
}
|
||||||
|
catch (AlfrescoRuntimeException e)
|
||||||
{
|
{
|
||||||
// do nothing but log error
|
// do nothing but log error
|
||||||
LOGGER.warn("Unable to file pending record.", e);
|
LOGGER.warn("Unable to file pending record.", e);
|
||||||
@@ -695,18 +636,18 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
name = "onUpdateProperties",
|
name = "onUpdateProperties",
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
type = "rma:record"
|
type= "rma:record"
|
||||||
)
|
)
|
||||||
public void onUpdateProperties(final NodeRef nodeRef, final Map<QName, Serializable> before, final Map<QName, Serializable> after)
|
public void onUpdateProperties(final NodeRef nodeRef, final Map<QName, Serializable> before, final Map<QName, Serializable> after)
|
||||||
{
|
{
|
||||||
if (AuthenticationUtil.getFullyAuthenticatedUser() != null &&
|
if (AuthenticationUtil.getFullyAuthenticatedUser() != null &&
|
||||||
!AuthenticationUtil.isRunAsUserTheSystemUser() &&
|
!AuthenticationUtil.isRunAsUserTheSystemUser() &&
|
||||||
nodeService.exists(nodeRef) &&
|
nodeService.exists(nodeRef) &&
|
||||||
isRecord(nodeRef) &&
|
isRecord(nodeRef) &&
|
||||||
!transactionalResourceHelper.getSet(KEY_IGNORE_ON_UPDATE).contains(nodeRef))
|
!transactionalResourceHelper.getSet(KEY_IGNORE_ON_UPDATE).contains(nodeRef))
|
||||||
{
|
{
|
||||||
for (Map.Entry<QName, Serializable> entry : after.entrySet())
|
for (Map.Entry<QName, Serializable> entry : after.entrySet())
|
||||||
{
|
{
|
||||||
@@ -724,32 +665,34 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
// deal with date values, remove the seconds and milliseconds for the
|
// deal with date values, remove the seconds and milliseconds for the
|
||||||
// comparison as they are removed from the submitted for data
|
// comparison as they are removed from the submitted for data
|
||||||
Calendar beforeCal = Calendar.getInstance();
|
Calendar beforeCal = Calendar.getInstance();
|
||||||
beforeCal.setTime((Date) beforeValue);
|
beforeCal.setTime((Date)beforeValue);
|
||||||
Calendar afterCal = Calendar.getInstance();
|
Calendar afterCal = Calendar.getInstance();
|
||||||
afterCal.setTime((Date) afterValue);
|
afterCal.setTime((Date)afterValue);
|
||||||
beforeCal.set(Calendar.SECOND, 0);
|
beforeCal.set(Calendar.SECOND, 0);
|
||||||
beforeCal.set(Calendar.MILLISECOND, 0);
|
beforeCal.set(Calendar.MILLISECOND, 0);
|
||||||
afterCal.set(Calendar.SECOND, 0);
|
afterCal.set(Calendar.SECOND, 0);
|
||||||
afterCal.set(Calendar.MILLISECOND, 0);
|
afterCal.set(Calendar.MILLISECOND, 0);
|
||||||
propertyUnchanged = (beforeCal.compareTo(afterCal) == 0);
|
propertyUnchanged = (beforeCal.compareTo(afterCal) == 0);
|
||||||
} else if ((afterValue instanceof Boolean) && (beforeValue == null) && (afterValue.equals(Boolean.FALSE)))
|
}
|
||||||
|
else if ((afterValue instanceof Boolean) && (beforeValue == null) && (afterValue.equals(Boolean.FALSE)))
|
||||||
{
|
{
|
||||||
propertyUnchanged = true;
|
propertyUnchanged = true;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// otherwise
|
// otherwise
|
||||||
propertyUnchanged = EqualsHelper.nullSafeEquals(beforeValue, afterValue);
|
propertyUnchanged = EqualsHelper.nullSafeEquals(beforeValue, afterValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!propertyUnchanged &&
|
if (!propertyUnchanged &&
|
||||||
!(ContentModel.PROP_CONTENT.equals(property) && beforeValue == null) &&
|
!(ContentModel.PROP_CONTENT.equals(property) && beforeValue == null) &&
|
||||||
!isPropertyEditable(nodeRef, property))
|
!isPropertyEditable(nodeRef, property))
|
||||||
{
|
{
|
||||||
// the user can't edit the record property
|
// the user can't edit the record property
|
||||||
throw new ModelAccessDeniedException(
|
throw new ModelAccessDeniedException(
|
||||||
"The user " + AuthenticationUtil.getFullyAuthenticatedUser() +
|
"The user " + AuthenticationUtil.getFullyAuthenticatedUser() +
|
||||||
" does not have the permission to edit the record property " + property.toString() +
|
" does not have the permission to edit the record property " + property.toString() +
|
||||||
" on the node " + nodeRef.toString());
|
" on the node " + nodeRef.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -758,7 +701,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Get map containing record metadata aspects.
|
* Get map containing record metadata aspects.
|
||||||
*
|
*
|
||||||
* @return {@link Map}<{@link QName}, {@link Set}<{@link QName}>> map containing record metadata aspects
|
* @return {@link Map}<{@link QName}, {@link Set}<{@link QName}>> map containing record metadata aspects
|
||||||
|
*
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
protected Map<QName, Set<QName>> getRecordMetadataAspectsMap()
|
protected Map<QName, Set<QName>> getRecordMetadataAspectsMap()
|
||||||
@@ -816,7 +760,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
// get the current set of file plan types for this aspect
|
// get the current set of file plan types for this aspect
|
||||||
filePlanTypes = getRecordMetadataAspectsMap().get(recordMetadataAspect);
|
filePlanTypes = getRecordMetadataAspectsMap().get(recordMetadataAspect);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// create a new set for the file plan type
|
// create a new set for the file plan type
|
||||||
filePlanTypes = new HashSet<QName>(1);
|
filePlanTypes = new HashSet<QName>(1);
|
||||||
@@ -838,7 +783,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#isRecordMetadataAspect(org.alfresco.service.namespace.QName)
|
* @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#isRecordMetadataAspect(org.alfresco.service.namespace.QName)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isRecordMetadataAspect(QName aspect)
|
public boolean isRecordMetadataAspect(QName aspect)
|
||||||
@@ -858,7 +803,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
ClassDefinition classDefinition = propertyDefinition.getContainerClass();
|
ClassDefinition classDefinition = propertyDefinition.getContainerClass();
|
||||||
if (classDefinition != null &&
|
if (classDefinition != null &&
|
||||||
getRecordMetadataAspectsMap().containsKey(classDefinition.getName()))
|
getRecordMetadataAspectsMap().containsKey(classDefinition.getName()))
|
||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
@@ -961,7 +906,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
// 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());
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
behaviourFilter.enableBehaviour();
|
behaviourFilter.enableBehaviour();
|
||||||
}
|
}
|
||||||
@@ -1000,12 +946,14 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
// set the extended security
|
// set the extended security
|
||||||
extendedSecurityService.set(nodeRef, readersAndWriters);
|
extendedSecurityService.set(nodeRef, readersAndWriters);
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
ruleService.enableRules();
|
ruleService.enableRules();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
ruleService.enableRuleType("outbound");
|
ruleService.enableRuleType("outbound");
|
||||||
}
|
}
|
||||||
@@ -1046,7 +994,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
LOGGER.debug(msg);
|
LOGGER.debug(msg);
|
||||||
throw new RecordCreationException(msg);
|
throw new RecordCreationException(msg);
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// verify that the provided file plan is actually a file plan
|
// verify that the provided file plan is actually a file plan
|
||||||
if (!filePlanService.isFilePlan(filePlan))
|
if (!filePlanService.isFilePlan(filePlan))
|
||||||
@@ -1162,7 +1111,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
// create a copy of the original state and add it to the unfiled record container
|
// create a copy of the original state and add it to the unfiled record container
|
||||||
FileInfo recordInfo = fileFolderService.copy(nodeRef, unfiledRecordFolder, null);
|
FileInfo recordInfo = fileFolderService.copy(nodeRef, unfiledRecordFolder, null);
|
||||||
record = recordInfo.getNodeRef();
|
record = recordInfo.getNodeRef();
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
recordsManagementContainerType.enable();
|
recordsManagementContainerType.enable();
|
||||||
}
|
}
|
||||||
@@ -1173,7 +1123,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
nodeService.removeAspect(record, ContentModel.ASPECT_VERSIONABLE);
|
nodeService.removeAspect(record, ContentModel.ASPECT_VERSIONABLE);
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
behaviourFilter.enableBehaviour(ContentModel.ASPECT_VERSIONABLE);
|
behaviourFilter.enableBehaviour(ContentModel.ASPECT_VERSIONABLE);
|
||||||
}
|
}
|
||||||
@@ -1196,14 +1147,16 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (originalAssocs == null)
|
if (originalAssocs == null)
|
||||||
{
|
{
|
||||||
nodeService.removeAspect(record, ContentModel.ASPECT_COPIEDFROM);
|
nodeService.removeAspect(record, ContentModel.ASPECT_COPIEDFROM);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (AssociationRef originalAssoc : originalAssocs)
|
for (AssociationRef originalAssoc : originalAssocs)
|
||||||
{
|
{
|
||||||
nodeService.createAssociation(record, originalAssoc.getTargetRef(), ContentModel.ASSOC_ORIGINAL);
|
nodeService.createAssociation(record, originalAssoc.getTargetRef(), ContentModel.ASSOC_ORIGINAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e)
|
}
|
||||||
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Can't create recorded version, because copy fails.", e);
|
throw new AlfrescoRuntimeException("Can't create recorded version, because copy fails.", e);
|
||||||
}
|
}
|
||||||
@@ -1219,7 +1172,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Helper to get the latest version record for a given document (ie non-record)
|
* Helper to get the latest version record for a given document (ie non-record)
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
* @return NodeRef latest version record, null otherwise
|
* @return NodeRef latest version record, null otherwise
|
||||||
*/
|
*/
|
||||||
private NodeRef getLatestVersionRecord(NodeRef nodeRef)
|
private NodeRef getLatestVersionRecord(NodeRef nodeRef)
|
||||||
@@ -1274,7 +1227,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (type == null)
|
if (type == null)
|
||||||
{
|
{
|
||||||
type = ContentModel.TYPE_CONTENT;
|
type = ContentModel.TYPE_CONTENT;
|
||||||
} else if (!dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT))
|
}
|
||||||
|
else if (!dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT))
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Record can only be created from a sub-type of cm:content.");
|
throw new AlfrescoRuntimeException("Record can only be created from a sub-type of cm:content.");
|
||||||
}
|
}
|
||||||
@@ -1319,7 +1273,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
enablePropertyEditableCheck();
|
enablePropertyEditableCheck();
|
||||||
}
|
}
|
||||||
@@ -1344,7 +1299,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
authenticationUtil.runAsSystem(new RunAsWork<Void>()
|
authenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public Void doWork() throws Exception
|
public Void doWork() throws Exception
|
||||||
{
|
{
|
||||||
nodeService.addAspect(document, RecordsManagementModel.ASPECT_RECORD, null);
|
nodeService.addAspect(document, RecordsManagementModel.ASPECT_RECORD, null);
|
||||||
|
|
||||||
@@ -1357,7 +1312,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
ruleService.enableRules();
|
ruleService.enableRules();
|
||||||
enablePropertyEditableCheck();
|
enablePropertyEditableCheck();
|
||||||
@@ -1391,9 +1347,9 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
* <p>
|
*
|
||||||
* 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!)
|
||||||
*/
|
*/
|
||||||
@@ -1405,8 +1361,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
// 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);
|
||||||
if (ContentModel.TYPE_CONTENT.equals(type) ||
|
if (ContentModel.TYPE_CONTENT.equals(type) ||
|
||||||
dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT))
|
dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT))
|
||||||
{
|
{
|
||||||
// fire before file record policy
|
// fire before file record policy
|
||||||
beforeFileRecord.get(getTypeAndApsects(record)).beforeFileRecord(record);
|
beforeFileRecord.get(getTypeAndApsects(record)).beforeFileRecord(record);
|
||||||
@@ -1464,10 +1420,10 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
// get record property values
|
// get record property values
|
||||||
final Map<QName, Serializable> properties = nodeService.getProperties(nodeRef);
|
final Map<QName, Serializable> properties = nodeService.getProperties(nodeRef);
|
||||||
final String recordId = (String) properties.get(PROP_IDENTIFIER);
|
final String recordId = (String)properties.get(PROP_IDENTIFIER);
|
||||||
final String documentOwner = (String) properties.get(PROP_RECORD_ORIGINATING_USER_ID);
|
final String documentOwner = (String)properties.get(PROP_RECORD_ORIGINATING_USER_ID);
|
||||||
final String originalName = (String) properties.get(PROP_ORIGIONAL_NAME);
|
final String originalName = (String)properties.get(PROP_ORIGIONAL_NAME);
|
||||||
final NodeRef originatingLocation = (NodeRef) properties.get(PROP_RECORD_ORIGINATING_LOCATION);
|
final NodeRef originatingLocation = (NodeRef)properties.get(PROP_RECORD_ORIGINATING_LOCATION);
|
||||||
|
|
||||||
// we can only reject if the originating location is present
|
// we can only reject if the originating location is present
|
||||||
if (originatingLocation != null)
|
if (originatingLocation != null)
|
||||||
@@ -1496,7 +1452,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
fileFolderService.rename(nodeRef, originalName);
|
fileFolderService.rename(nodeRef, originalName);
|
||||||
|
|
||||||
String name = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
String name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||||
LOGGER.debug("Rename {} to {}", name, originalName);
|
LOGGER.debug("Rename {} to {}", name, originalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1523,7 +1479,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
// send an email to the record creator
|
// send an email to the record creator
|
||||||
notificationHelper.recordRejectedEmailNotification(nodeRef, recordId, documentOwner);
|
notificationHelper.recordRejectedEmailNotification(nodeRef, recordId, documentOwner);
|
||||||
}
|
}
|
||||||
} finally
|
}
|
||||||
|
finally
|
||||||
{
|
{
|
||||||
ruleService.enableRules();
|
ruleService.enableRules();
|
||||||
}
|
}
|
||||||
@@ -1540,7 +1497,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
for (QName aspect : aspects)
|
for (QName aspect : aspects)
|
||||||
{
|
{
|
||||||
if (RM_URI.equals(aspect.getNamespaceURI()) ||
|
if (RM_URI.equals(aspect.getNamespaceURI()) ||
|
||||||
RecordableVersionModel.RMV_URI.equals(aspect.getNamespaceURI()))
|
RecordableVersionModel.RMV_URI.equals(aspect.getNamespaceURI()))
|
||||||
{
|
{
|
||||||
nodeService.removeAspect(nodeRef, aspect);
|
nodeService.removeAspect(nodeRef, aspect);
|
||||||
}
|
}
|
||||||
@@ -1551,7 +1508,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
// Do not attempt to clean up rendition nodes which are not children of their source node.
|
// Do not attempt to clean up rendition nodes which are not children of their source node.
|
||||||
final boolean renditionRequiresCleaning = nodeService.exists(renditionNode) &&
|
final boolean renditionRequiresCleaning = nodeService.exists(renditionNode) &&
|
||||||
renditionAssoc.isPrimary();
|
renditionAssoc.isPrimary();
|
||||||
|
|
||||||
if (renditionRequiresCleaning)
|
if (renditionRequiresCleaning)
|
||||||
{
|
{
|
||||||
@@ -1607,7 +1564,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
for (AccessPermission perm : perms)
|
for (AccessPermission perm : perms)
|
||||||
{
|
{
|
||||||
if ((perm.getPermission().contains(RMPermissionModel.EDIT_NON_RECORD_METADATA) ||
|
if ((perm.getPermission().contains(RMPermissionModel.EDIT_NON_RECORD_METADATA) ||
|
||||||
perm.getPermission().contains(RMPermissionModel.EDIT_RECORD_METADATA)))
|
perm.getPermission().contains(RMPermissionModel.EDIT_RECORD_METADATA)))
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... " + perm.getAuthority() + " - " + perm.getPermission() + " - " + perm.getAccessStatus().toString());
|
LOGGER.debug(" ... " + perm.getAuthority() + " - " + perm.getPermission() + " - " + perm.getAccessStatus().toString());
|
||||||
}
|
}
|
||||||
@@ -1624,7 +1581,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... property marked as always editable.");
|
LOGGER.debug(" ... property marked as always editable.");
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
boolean allowRecordEdit = false;
|
boolean allowRecordEdit = false;
|
||||||
boolean allowNonRecordEdit = false;
|
boolean allowNonRecordEdit = false;
|
||||||
@@ -1639,8 +1597,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
allowNonRecordEdit = true;
|
allowNonRecordEdit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AccessStatus.ALLOWED.equals(accessRecord) ||
|
if (AccessStatus.ALLOWED.equals(accessRecord) ||
|
||||||
AccessStatus.ALLOWED.equals(accessDeclaredRecord))
|
AccessStatus.ALLOWED.equals(accessDeclaredRecord))
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... user has edit record or declared metadata capability");
|
LOGGER.debug(" ... user has edit record or declared metadata capability");
|
||||||
allowRecordEdit = true;
|
allowRecordEdit = true;
|
||||||
@@ -1650,25 +1608,29 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
LOGGER.debug(" ... so all properties can be edited.");
|
LOGGER.debug(" ... so all properties can be edited.");
|
||||||
result = true;
|
result = true;
|
||||||
} else if (allowNonRecordEdit && !allowRecordEdit)
|
}
|
||||||
|
else if (allowNonRecordEdit && !allowRecordEdit)
|
||||||
{
|
{
|
||||||
// can only edit non record properties
|
// can only edit non record properties
|
||||||
if (!isRecordMetadata(filePlan, property))
|
if (!isRecordMetadata(filePlan, property))
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... property is not considered record metadata so editable.");
|
LOGGER.debug(" ... property is not considered record metadata so editable.");
|
||||||
result = true;
|
result = true;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... property is considered record metadata so not editable.");
|
LOGGER.debug(" ... property is considered record metadata so not editable.");
|
||||||
}
|
}
|
||||||
} else if (!allowNonRecordEdit && allowRecordEdit)
|
}
|
||||||
|
else if (!allowNonRecordEdit && allowRecordEdit)
|
||||||
{
|
{
|
||||||
// can only edit record properties
|
// can only edit record properties
|
||||||
if (isRecordMetadata(filePlan, property))
|
if (isRecordMetadata(filePlan, property))
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... property is considered record metadata so editable.");
|
LOGGER.debug(" ... property is considered record metadata so editable.");
|
||||||
result = true;
|
result = true;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
LOGGER.debug(" ... property is not considered record metadata so not editable.");
|
LOGGER.debug(" ... property is not considered record metadata so not editable.");
|
||||||
}
|
}
|
||||||
@@ -1681,7 +1643,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Helper method that indicates whether a property is considered record metadata or not.
|
* Helper method that indicates whether a property is considered record metadata or not.
|
||||||
*
|
*
|
||||||
* @param property property
|
* @param property property
|
||||||
* @return boolea true if record metadata, false otherwise
|
* @return boolea true if record metadata, false otherwise
|
||||||
*/
|
*/
|
||||||
private boolean isRecordMetadata(NodeRef filePlan, QName property)
|
private boolean isRecordMetadata(NodeRef filePlan, QName property)
|
||||||
@@ -1701,7 +1663,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (parent != null && TYPE_NON_ELECTRONIC_DOCUMENT.equals(parent.getName()))
|
if (parent != null && TYPE_NON_ELECTRONIC_DOCUMENT.equals(parent.getName()))
|
||||||
{
|
{
|
||||||
result = false;
|
result = false;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// check the URI's
|
// check the URI's
|
||||||
result = RECORD_MODEL_URIS.contains(property.getNamespaceURI());
|
result = RECORD_MODEL_URIS.contains(property.getNamespaceURI());
|
||||||
@@ -1736,7 +1699,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
* Helper method to determine whether a property is protected at a dictionary definition
|
* Helper method to determine whether a property is protected at a dictionary definition
|
||||||
* level.
|
* level.
|
||||||
*
|
*
|
||||||
* @param property property qualified name
|
* @param property property qualified name
|
||||||
* @return booelan true if protected, false otherwise
|
* @return booelan true if protected, false otherwise
|
||||||
*/
|
*/
|
||||||
private boolean isProtectedProperty(QName property)
|
private boolean isProtectedProperty(QName property)
|
||||||
@@ -1796,7 +1759,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (!nodeService.hasAspect(nodeRef, typeQName))
|
if (!nodeService.hasAspect(nodeRef, typeQName))
|
||||||
{
|
{
|
||||||
nodeService.addAspect(nodeRef, typeQName, null);
|
nodeService.addAspect(nodeRef, typeQName, null);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
LOGGER.info(I18NUtil.getMessage(MSG_NODE_HAS_ASPECT, nodeRef.toString(), typeQName.toString()));
|
LOGGER.info(I18NUtil.getMessage(MSG_NODE_HAS_ASPECT, nodeRef.toString(), typeQName.toString()));
|
||||||
}
|
}
|
||||||
@@ -1812,7 +1776,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
ParameterCheck.mandatory("recordFolder", recordFolder);
|
ParameterCheck.mandatory("recordFolder", recordFolder);
|
||||||
|
|
||||||
// ensure we are linking a record to a record folder
|
// ensure we are linking a record to a record folder
|
||||||
if (isRecord(record) && isRecordFolder(recordFolder))
|
if(isRecord(record) && isRecordFolder(recordFolder))
|
||||||
{
|
{
|
||||||
// ensure that we are not linking a record to an existing location
|
// ensure that we are not linking a record to an existing location
|
||||||
List<ChildAssociationRef> parents = nodeService.getParentAssocs(record);
|
List<ChildAssociationRef> parents = nodeService.getParentAssocs(record);
|
||||||
@@ -1833,14 +1797,15 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
// create a secondary link to the record folder
|
// create a secondary link to the record folder
|
||||||
nodeService.addChild(
|
nodeService.addChild(
|
||||||
recordFolder,
|
recordFolder,
|
||||||
record,
|
record,
|
||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name));
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name));
|
||||||
|
|
||||||
// recalculate disposition schedule for the record when linking it
|
// recalculate disposition schedule for the record when linking it
|
||||||
dispositionService.recalculateNextDispositionStep(record);
|
dispositionService.recalculateNextDispositionStep(record);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// can only link a record to a record folder
|
// can only link a record to a record folder
|
||||||
throw new RecordLinkRuntimeException("Can only link a record to a record folder.");
|
throw new RecordLinkRuntimeException("Can only link a record to a record folder.");
|
||||||
@@ -1848,6 +1813,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @param record
|
* @param record
|
||||||
* @param recordFolder
|
* @param recordFolder
|
||||||
*/
|
*/
|
||||||
@@ -1867,7 +1833,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
// we can't link a record to an incompatible disposition schedule
|
// we can't link a record to an incompatible disposition schedule
|
||||||
throw new RecordLinkRuntimeException("Cannot link a record to a record folder with an incompatible retention schedule. "
|
throw new RecordLinkRuntimeException("Cannot link a record to a record folder with an incompatible retention schedule. "
|
||||||
+ "They must either both be record level or record folder level retentions.");
|
+ "They must either both be record level or record folder level retentions.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1883,7 +1849,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
ParameterCheck.mandatory("recordFolder", recordFolder);
|
ParameterCheck.mandatory("recordFolder", recordFolder);
|
||||||
|
|
||||||
// ensure we are unlinking a record from a record folder
|
// ensure we are unlinking a record from a record folder
|
||||||
if (isRecord(record) && isRecordFolder(recordFolder))
|
if(isRecord(record) && isRecordFolder(recordFolder))
|
||||||
{
|
{
|
||||||
// check that we are not trying to unlink the primary parent
|
// check that we are not trying to unlink the primary parent
|
||||||
NodeRef primaryParent = nodeService.getPrimaryParent(record).getParentRef();
|
NodeRef primaryParent = nodeService.getPrimaryParent(record).getParentRef();
|
||||||
@@ -1897,7 +1863,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
// recalculate disposition schedule for record after unlinking it
|
// recalculate disposition schedule for record after unlinking it
|
||||||
dispositionService.recalculateNextDispositionStep(record);
|
dispositionService.recalculateNextDispositionStep(record);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// can only unlink a record from a record folder
|
// can only unlink a record from a record folder
|
||||||
throw new RecordLinkRuntimeException("Can only unlink a record from a record folder.");
|
throw new RecordLinkRuntimeException("Can only unlink a record from a record folder.");
|
||||||
@@ -1909,11 +1876,11 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
type = "rma:record",
|
type = "rma:record",
|
||||||
notificationFrequency = TRANSACTION_COMMIT
|
notificationFrequency = TRANSACTION_COMMIT
|
||||||
)
|
)
|
||||||
public void onContentUpdate(NodeRef nodeRef, boolean newContent)
|
public void onContentUpdate(NodeRef nodeRef, boolean newContent)
|
||||||
{
|
{
|
||||||
if (nodeService.exists(nodeRef) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
|
if (nodeService.exists(nodeRef) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
|
||||||
@@ -1926,7 +1893,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Invoke invokeBeforeRecordDeclaration policy
|
* Invoke invokeBeforeRecordDeclaration policy
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
*/
|
*/
|
||||||
protected void invokeBeforeRecordDeclaration(NodeRef nodeRef)
|
protected void invokeBeforeRecordDeclaration(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
@@ -1940,7 +1907,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Invoke invokeOnRecordDeclaration policy
|
* Invoke invokeOnRecordDeclaration policy
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
*/
|
*/
|
||||||
protected void invokeOnRecordDeclaration(NodeRef nodeRef)
|
protected void invokeOnRecordDeclaration(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
@@ -1954,7 +1921,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Invoke invokeBeforeRecordRejection policy
|
* Invoke invokeBeforeRecordRejection policy
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
*/
|
*/
|
||||||
protected void invokeBeforeRecordRejection(NodeRef nodeRef)
|
protected void invokeBeforeRecordRejection(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
@@ -1968,7 +1935,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
/**
|
/**
|
||||||
* Invoke invokeOnRecordRejection policy
|
* Invoke invokeOnRecordRejection policy
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
*/
|
*/
|
||||||
protected void invokeOnRecordRejection(NodeRef nodeRef)
|
protected void invokeOnRecordRejection(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
@@ -1981,17 +1948,17 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* RM-5244 - workaround to make sure the incomplete aspect is removed
|
* RM-5244 - workaround to make sure the incomplete aspect is removed
|
||||||
*
|
*
|
||||||
* @param nodeRef the node to reevaluate for
|
* @param nodeRef the node to reevaluate for
|
||||||
*/
|
*/
|
||||||
private void reevaluateIncompleteTag(NodeRef nodeRef)
|
private void reevaluateIncompleteTag(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Check if the node has the aspect because the reevaluation is expensive.
|
* Check if the node has the aspect because the reevaluation is expensive.
|
||||||
* If the node doesn't have the aspect it means IncompleteNodeTagger didn't load before TransactionBehaviourQueue
|
* If the node doesn't have the aspect it means IncompleteNodeTagger didn't load before TransactionBehaviourQueue
|
||||||
* and we don't need to reevaluate.
|
* and we don't need to reevaluate.
|
||||||
*/
|
*/
|
||||||
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INCOMPLETE))
|
if(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INCOMPLETE))
|
||||||
{
|
{
|
||||||
incompleteNodeTagger.beforeCommit(false);
|
incompleteNodeTagger.beforeCommit(false);
|
||||||
}
|
}
|
||||||
@@ -2162,4 +2129,4 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
localName = MessageFormat.format("{0}CustomProperties", localName);
|
localName = MessageFormat.format("{0}CustomProperties", localName);
|
||||||
return QName.createQName(RM_CUSTOM_URI, localName);
|
return QName.createQName(RM_CUSTOM_URI, localName);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -76,6 +76,7 @@ public class FilePlanRuleInheritanceTest extends BaseRMTestCase
|
|||||||
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
||||||
{
|
{
|
||||||
private NodeRef filePlan = null;
|
private NodeRef filePlan = null;
|
||||||
|
private Rule rule = null;
|
||||||
private List<Rule> rules = null;
|
private List<Rule> rules = null;
|
||||||
|
|
||||||
public void given()
|
public void given()
|
||||||
@@ -83,24 +84,24 @@ public class FilePlanRuleInheritanceTest extends BaseRMTestCase
|
|||||||
filePlan = createFilePlan();
|
filePlan = createFilePlan();
|
||||||
|
|
||||||
// create a rule that applies to childre
|
// create a rule that applies to childre
|
||||||
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
||||||
Rule rule = new Rule();
|
rule = new Rule();
|
||||||
rule.setRuleType("inbound");
|
rule.setRuleType("inbound");
|
||||||
rule.setAction(completeRecordAction);
|
rule.setAction(completeRecordAction);
|
||||||
rule.applyToChildren(true);
|
rule.applyToChildren(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void when()
|
||||||
|
{
|
||||||
// save rule on file plan root parent folder
|
// save rule on file plan root parent folder
|
||||||
ruleService.saveRule(folder, rule);
|
ruleService.saveRule(folder, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void when()
|
public void then()
|
||||||
{
|
{
|
||||||
// get rules, including those inherited
|
// get rules, including those inherited
|
||||||
rules = ruleService.getRules(filePlan, true);
|
rules = ruleService.getRules(filePlan, true);
|
||||||
}
|
|
||||||
|
|
||||||
public void then()
|
|
||||||
{
|
|
||||||
// rules aren't inhreited from file plan root parent folder
|
// rules aren't inhreited from file plan root parent folder
|
||||||
assertEquals(0, rules.size());
|
assertEquals(0, rules.size());
|
||||||
}
|
}
|
||||||
@@ -121,31 +122,32 @@ public class FilePlanRuleInheritanceTest extends BaseRMTestCase
|
|||||||
{
|
{
|
||||||
private NodeRef filePlan = null;
|
private NodeRef filePlan = null;
|
||||||
private List<Rule> rules = null;
|
private List<Rule> rules = null;
|
||||||
|
private Rule rule = null;
|
||||||
|
|
||||||
public void given()
|
public void given()
|
||||||
{
|
{
|
||||||
filePlan = createFilePlan();
|
filePlan = createFilePlan();
|
||||||
|
|
||||||
// create a rule that applies to childre
|
// create a rule that applies to childre
|
||||||
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
||||||
Rule rule = new Rule();
|
rule = new Rule();
|
||||||
rule.setRuleType("inbound");
|
rule.setRuleType("inbound");
|
||||||
rule.setAction(completeRecordAction);
|
rule.setAction(completeRecordAction);
|
||||||
rule.applyToChildren(true);
|
rule.applyToChildren(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void when()
|
||||||
|
{
|
||||||
// save rule on file plan root
|
// save rule on file plan root
|
||||||
ruleService.saveRule(filePlan, rule);
|
ruleService.saveRule(filePlan, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void when()
|
public void then()
|
||||||
{
|
{
|
||||||
// get rules, including those inherited
|
// get rules, including those inherited
|
||||||
NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan);
|
NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan);
|
||||||
rules = ruleService.getRules(unfiledRecordContainer, true);
|
rules = ruleService.getRules(unfiledRecordContainer, true);
|
||||||
}
|
|
||||||
|
|
||||||
public void then()
|
|
||||||
{
|
|
||||||
// rules aren't inhreited from file plan root
|
// rules aren't inhreited from file plan root
|
||||||
assertEquals(0, rules.size());
|
assertEquals(0, rules.size());
|
||||||
}
|
}
|
||||||
@@ -164,31 +166,32 @@ public class FilePlanRuleInheritanceTest extends BaseRMTestCase
|
|||||||
{
|
{
|
||||||
private NodeRef filePlan = null;
|
private NodeRef filePlan = null;
|
||||||
private List<Rule> rules = null;
|
private List<Rule> rules = null;
|
||||||
|
private Rule rule = null;
|
||||||
|
|
||||||
public void given()
|
public void given()
|
||||||
{
|
{
|
||||||
filePlan = createFilePlan();
|
filePlan = createFilePlan();
|
||||||
|
|
||||||
// create a rule that applies to childre
|
// create a rule that applies to childre
|
||||||
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
||||||
Rule rule = new Rule();
|
rule = new Rule();
|
||||||
rule.setRuleType("inbound");
|
rule.setRuleType("inbound");
|
||||||
rule.setAction(completeRecordAction);
|
rule.setAction(completeRecordAction);
|
||||||
rule.applyToChildren(true);
|
rule.applyToChildren(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void when()
|
||||||
|
{
|
||||||
// save rule on file plan root
|
// save rule on file plan root
|
||||||
ruleService.saveRule(filePlan, rule);
|
ruleService.saveRule(filePlan, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void when()
|
public void then()
|
||||||
{
|
{
|
||||||
// get rules, including those inherited
|
// get rules, including those inherited
|
||||||
NodeRef container = filePlanService.getHoldContainer(filePlan);
|
NodeRef container = filePlanService.getHoldContainer(filePlan);
|
||||||
rules = ruleService.getRules(container, true);
|
rules = ruleService.getRules(container, true);
|
||||||
}
|
|
||||||
|
|
||||||
public void then()
|
|
||||||
{
|
|
||||||
// rules aren't inhreited from file plan root
|
// rules aren't inhreited from file plan root
|
||||||
assertEquals(0, rules.size());
|
assertEquals(0, rules.size());
|
||||||
}
|
}
|
||||||
@@ -207,31 +210,32 @@ public class FilePlanRuleInheritanceTest extends BaseRMTestCase
|
|||||||
{
|
{
|
||||||
private NodeRef filePlan = null;
|
private NodeRef filePlan = null;
|
||||||
private List<Rule> rules = null;
|
private List<Rule> rules = null;
|
||||||
|
private Rule rule = null;
|
||||||
|
|
||||||
public void given()
|
public void given()
|
||||||
{
|
{
|
||||||
filePlan = createFilePlan();
|
filePlan = createFilePlan();
|
||||||
|
|
||||||
// create a rule that applies to childre
|
// create a rule that applies to childre
|
||||||
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
||||||
Rule rule = new Rule();
|
rule = new Rule();
|
||||||
rule.setRuleType("inbound");
|
rule.setRuleType("inbound");
|
||||||
rule.setAction(completeRecordAction);
|
rule.setAction(completeRecordAction);
|
||||||
rule.applyToChildren(true);
|
rule.applyToChildren(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void when()
|
||||||
|
{
|
||||||
// save rule on file plan root
|
// save rule on file plan root
|
||||||
ruleService.saveRule(filePlan, rule);
|
ruleService.saveRule(filePlan, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void when()
|
public void then()
|
||||||
{
|
{
|
||||||
// get rules, including those inherited
|
// get rules, including those inherited
|
||||||
NodeRef container = filePlanService.getTransferContainer(filePlan);
|
NodeRef container = filePlanService.getTransferContainer(filePlan);
|
||||||
rules = ruleService.getRules(container, true);
|
rules = ruleService.getRules(container, true);
|
||||||
}
|
|
||||||
|
|
||||||
public void then()
|
|
||||||
{
|
|
||||||
// rules aren't inhreited from file plan root
|
// rules aren't inhreited from file plan root
|
||||||
assertEquals(0, rules.size());
|
assertEquals(0, rules.size());
|
||||||
}
|
}
|
||||||
@@ -251,31 +255,32 @@ public class FilePlanRuleInheritanceTest extends BaseRMTestCase
|
|||||||
private NodeRef filePlan = null;
|
private NodeRef filePlan = null;
|
||||||
private NodeRef recordCategory = null;
|
private NodeRef recordCategory = null;
|
||||||
private List<Rule> rules = null;
|
private List<Rule> rules = null;
|
||||||
|
private Rule rule = null;
|
||||||
|
|
||||||
public void given()
|
public void given()
|
||||||
{
|
{
|
||||||
filePlan = createFilePlan();
|
filePlan = createFilePlan();
|
||||||
recordCategory = filePlanService.createRecordCategory(filePlan, GUID.generate());
|
recordCategory = filePlanService.createRecordCategory(filePlan, GUID.generate());
|
||||||
|
|
||||||
// create a rule that applies to childre
|
// create a rule that applies to childre
|
||||||
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
Action completeRecordAction = actionService.createAction(DeclareRecordAction.NAME);
|
||||||
Rule rule = new Rule();
|
rule = new Rule();
|
||||||
rule.setRuleType("inbound");
|
rule.setRuleType("inbound");
|
||||||
rule.setAction(completeRecordAction);
|
rule.setAction(completeRecordAction);
|
||||||
rule.applyToChildren(true);
|
rule.applyToChildren(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void when()
|
||||||
|
{
|
||||||
// save rule on file plan root
|
// save rule on file plan root
|
||||||
ruleService.saveRule(filePlan, rule);
|
ruleService.saveRule(filePlan, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void when()
|
public void then()
|
||||||
{
|
{
|
||||||
// get rules, including those inherited
|
// get rules, including those inherited
|
||||||
rules = ruleService.getRules(recordCategory, true);
|
rules = ruleService.getRules(recordCategory, true);
|
||||||
}
|
|
||||||
|
|
||||||
public void then()
|
|
||||||
{
|
|
||||||
// rules aren't inhreited from file plan root
|
// rules aren't inhreited from file plan root
|
||||||
assertEquals(1, rules.size());
|
assertEquals(1, rules.size());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user