use of org.alfresco.repo.action.ParameterDefinitionImpl in project records-management by Alfresco.
the class ApplyCustomTypeAction method getParameterDefintions.
@Override
protected synchronized List<ParameterDefinition> getParameterDefintions() {
// We can take these parameter definitions from the properties defined in the dod model.
if (this.parameterDefinitions == null) {
AspectDefinition aspectDefinition = getDictionaryService().getAspect(customTypeAspect);
if (aspectDefinition == null) {
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_ASPECT_NOT_RECOGNISED, customTypeAspect));
}
Map<QName, PropertyDefinition> props = aspectDefinition.getProperties();
this.parameterDefinitions = new ArrayList<ParameterDefinition>(props.size());
for (Map.Entry<QName, PropertyDefinition> entry : props.entrySet()) {
String paramName = entry.getKey().toPrefixString(getNamespaceService());
PropertyDefinition value = entry.getValue();
QName paramType = value.getDataType().getName();
boolean paramIsMandatory = value.isMandatory();
parameterDefinitions.add(new ParameterDefinitionImpl(paramName, paramType, paramIsMandatory, null));
}
}
return parameterDefinitions;
}
Aggregations