findMetadataForProfile(versionId, profileId, handler);
return answer.get();
}
protected static MetaTypeObjectDTO createMetaTypeObjectDTO(Properties resources, OCD ocd) {
MetaTypeObjectDTO answer = new MetaTypeObjectDTO();
answer.setId(ocd.getID());
answer.setName(localize(resources, ocd.getName()));
answer.setDescription(localize(resources, ocd.getDescription()));
List<MetaTypeAttributeDTO> attributeList = new ArrayList<>();
Map<String, Object> attributes = ocd.getAttributeDefinitions();
if (attributes != null) {
Set<Map.Entry<String, Object>> entries = attributes.entrySet();
for (Map.Entry<String, Object> entry : entries) {
String name = entry.getKey();
Object value = entry.getValue();
if (value instanceof AD) {
AD ad = (AD) value;
MetaTypeAttributeDTO attributeDTO = createMetaTypeAttributeDTO(resources, ocd, name, ad);
if (attributeDTO != null) {
attributeList.add(attributeDTO);
}
}
}
}
answer.setAttributes(attributeList);
return answer;
}