mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-5175_Complete_record_with_missing_metadata
This commit is contained in:
@@ -29,6 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.action.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -193,6 +194,27 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
// check for missing mandatory metadata from custom aspect definitions
|
||||
if (result)
|
||||
{
|
||||
Collection<QName> aspects = this.getDictionaryService().getAspects(RM_CUSTOM_MODEL);
|
||||
for (QName aspect : aspects)
|
||||
{
|
||||
// TODO should not apply record custom metadata for non-electronic and vice versa
|
||||
AspectDefinition aspectDef = this.getDictionaryService().getAspect(aspect);
|
||||
for (PropertyDefinition propDef : aspectDef.getProperties().values())
|
||||
{
|
||||
if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null)
|
||||
{
|
||||
logMissingProperty(propDef, missingProperties);
|
||||
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user