[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:
Jared Ottley
2013-09-03 17:25:54 +00:00
parent a5295c2039
commit 7fa2ecbc8a

View File

@@ -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
*