mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
RM-5175_Complete_record_with_missing_metadata changes after review
This commit is contained in:
@@ -197,16 +197,12 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
|||||||
// check for missing mandatory metadata from custom aspect definitions
|
// check for missing mandatory metadata from custom aspect definitions
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
QName aspect;
|
QName aspect = ASPECT_RECORD;
|
||||||
if (nodeRefType.equals(TYPE_NON_ELECTRONIC_DOCUMENT))
|
if (nodeRefType.equals(TYPE_NON_ELECTRONIC_DOCUMENT))
|
||||||
//if (nodeRefType.getLocalName()))
|
|
||||||
{
|
{
|
||||||
aspect = TYPE_NON_ELECTRONIC_DOCUMENT;
|
aspect = TYPE_NON_ELECTRONIC_DOCUMENT;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
aspect = ASPECT_RECORD;
|
|
||||||
}
|
|
||||||
// get customAspectImpl
|
// get customAspectImpl
|
||||||
String localName = aspect.toPrefixString(getNamespaceService()).replace(":", "");
|
String localName = aspect.toPrefixString(getNamespaceService()).replace(":", "");
|
||||||
localName = MessageFormat.format("{0}CustomProperties", localName);
|
localName = MessageFormat.format("{0}CustomProperties", localName);
|
||||||
|
@@ -310,28 +310,14 @@ public class CommonRMTestUtils implements RecordsManagementModel
|
|||||||
{
|
{
|
||||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
|
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
|
||||||
props.put(ContentModel.PROP_TITLE, title);
|
props.put(ContentModel.PROP_TITLE, title);
|
||||||
return createNonElectronicRecordImpl(recordFolder, name, props);
|
props.put(ContentModel.PROP_NAME, name);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper to consolidate creation of non-electronic record
|
|
||||||
*/
|
|
||||||
private NodeRef createNonElectronicRecordImpl(NodeRef recordFolder, String name, Map<QName, Serializable> properties)
|
|
||||||
{
|
|
||||||
// Create the document
|
// Create the document
|
||||||
if (properties == null)
|
|
||||||
{
|
|
||||||
properties = new HashMap<QName, Serializable>(1);
|
|
||||||
}
|
|
||||||
if (!properties.containsKey(ContentModel.PROP_NAME))
|
|
||||||
{
|
|
||||||
properties.put(ContentModel.PROP_NAME, name);
|
|
||||||
}
|
|
||||||
NodeRef record = nodeService.createNode(recordFolder,
|
NodeRef record = nodeService.createNode(recordFolder,
|
||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name),
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name),
|
||||||
RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT,
|
RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT,
|
||||||
properties).getChildRef();
|
props).getChildRef();
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user