use of com.agiletec.aps.system.common.entity.model.SmallEntityType in project entando-core by entando.
the class EntityTypeDOM method extractSmallEntityTypes.
@Override
public List<SmallEntityType> extractSmallEntityTypes(String xml) throws ApsSystemException {
List<SmallEntityType> list = new ArrayList<>();
Document document = this.decodeDOM(xml);
List<Element> entityElements = document.getRootElement().getChildren();
for (int i = 0; i < entityElements.size(); i++) {
Element entityElem = entityElements.get(i);
String typeCode = this.extractXmlAttribute(entityElem, "typecode", true);
String typeDescr = this.extractXmlAttribute(entityElem, "typedescr", true);
list.add(new SmallEntityType(typeCode, typeDescr));
}
return list;
}
use of com.agiletec.aps.system.common.entity.model.SmallEntityType in project entando-core by entando.
the class ApsEntityManager method getSmallEntityTypes.
@Override
public List<SmallEntityType> getSmallEntityTypes() {
List<SmallEntityType> smallTypes = null;
try {
smallTypes = this.getEntityTypeFactory().extractSmallEntityTypes(this.getConfigItemName(), this.getEntityTypeDom());
BeanComparator comparator = new BeanComparator("description");
Collections.sort(smallTypes, comparator);
} catch (Exception e) {
logger.error("Error while extracting small entity types", e);
throw new RuntimeException("Error while extracting small entity types", e);
}
return smallTypes;
}
use of com.agiletec.aps.system.common.entity.model.SmallEntityType in project entando-core by entando.
the class DataObjectManager method getSmallDataTypesMap.
/**
* Return the map of the prototypes of the dataobjects types. Return a map,
* index by the code of the type, of the prototypes of the available
* dataobject types.
*
* @return The map of the prototypes of the dataobject types in a
* 'SmallDataObjectType' objects.
*/
@Override
public Map<String, SmallDataType> getSmallDataTypesMap() {
Map<String, SmallDataType> smallDataTypes = new HashMap<>();
List<SmallEntityType> entityTypes = super.getSmallEntityTypes();
for (SmallEntityType entityType : entityTypes) {
SmallDataType sdt = new SmallDataType();
sdt.setCode(entityType.getCode());
sdt.setDescription(entityType.getDescription());
smallDataTypes.put(entityType.getCode(), sdt);
}
return smallDataTypes;
}
use of com.agiletec.aps.system.common.entity.model.SmallEntityType in project entando-core by entando.
the class ContentManager method getSmallContentTypesMap.
/**
* Return the map of the prototypes of the contents types. Return a map,
* index by the code of the type, of the prototypes of the available content
* types.
*
* @return The map of the prototypes of the content types in a
* 'SmallContentType' objects.
*/
@Override
public Map<String, SmallContentType> getSmallContentTypesMap() {
Map<String, SmallContentType> smallContentTypes = new HashMap<>();
List<SmallEntityType> entityTypes = super.getSmallEntityTypes();
for (SmallEntityType entityType : entityTypes) {
SmallContentType sct = new SmallContentType();
sct.setCode(entityType.getCode());
sct.setDescription(entityType.getDescription());
smallContentTypes.put(entityType.getCode(), sct);
}
return smallContentTypes;
}
use of com.agiletec.aps.system.common.entity.model.SmallEntityType in project entando-core by entando.
the class ApsEntityManager method getEntityTypeCodes.
protected List<String> getEntityTypeCodes() {
List<String> codes = new ArrayList<>();
List<SmallEntityType> smallTypes = this.getSmallEntityTypes();
for (SmallEntityType smallType : smallTypes) {
codes.add(smallType.getCode());
}
return codes;
}
Aggregations