mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
[RM-892] Record metadata is not copied. The record aspects properties will now be copied. The Date Filed property is not copied. This property will be generated during the copy.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@54864 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -124,7 +125,7 @@ public class RecordCopyBehaviours implements RecordsManagementModel
|
||||
this.policyComponent.bindClassBehaviour(
|
||||
QName.createQName(NamespaceService.ALFRESCO_URI, "getCopyCallback"),
|
||||
ASPECT_RECORD,
|
||||
new JavaBehaviour(this, "getDoNothingCopyCallback"));
|
||||
new JavaBehaviour(this, "onCopyRecord"));
|
||||
|
||||
// Move behaviour
|
||||
this.policyComponent.bindClassBehaviour(
|
||||
@@ -225,6 +226,38 @@ public class RecordCopyBehaviours implements RecordsManagementModel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the copying of the record aspect.
|
||||
* Excludes the Date Filed property. The Date Filed will be generated on copy.
|
||||
*
|
||||
* @param classRef
|
||||
* @param copyDetails
|
||||
* @return
|
||||
*/
|
||||
public CopyBehaviourCallback onCopyRecord(final QName classRef, final CopyDetails copyDetails)
|
||||
{
|
||||
return new DefaultCopyBehaviourCallback()
|
||||
{
|
||||
|
||||
@Override
|
||||
public Map<QName, Serializable> getCopyProperties(QName classRef, CopyDetails copyDetails,
|
||||
Map<QName, Serializable> properties)
|
||||
{
|
||||
Map<QName, Serializable> sourceProperties = super.getCopyProperties(classRef, copyDetails, properties);
|
||||
|
||||
// Remove the Date Filed property from record properties on copy.
|
||||
// It will be generated for the copy
|
||||
if (sourceProperties.containsKey(PROP_DATE_FILED))
|
||||
{
|
||||
sourceProperties.remove(PROP_DATE_FILED);
|
||||
}
|
||||
|
||||
return sourceProperties;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Record Folder Copy Behaviour
|
||||
*
|
||||
|
Reference in New Issue
Block a user