use of com.agiletec.aps.system.common.entity.parse.IApsEntityDOM in project entando-core by entando.
the class ApsEntity method getXML.
@Override
public String getXML() {
IApsEntityDOM entityDOM = this.getBuildJDOM();
String xml = entityDOM.getXMLDocument();
entityDOM.dispose();
return xml;
}
use of com.agiletec.aps.system.common.entity.parse.IApsEntityDOM in project entando-core by entando.
the class ApsEntity method getBuildJDOM.
/**
* Return the DOM class that generates the XML corresponding to the entity
* with its data.
* This method must be extended to support customized XML structures;
* this happen when, for example, a custom entity is based on an
* object class which, in turn, extends ApsEntity.
* @return The DOM class that generates the XML
*/
protected IApsEntityDOM getBuildJDOM() {
IApsEntityDOM entityDom = this.getEntityDOM().clone();
entityDom.init();
entityDom.setId(String.valueOf(this.getId()));
entityDom.setTypeCode(this._typeCode);
entityDom.setTypeDescription(this._typeDescription);
entityDom.setDescription(this._description);
entityDom.setMainGroup(this._mainGroup);
Iterator<String> iterGroups = this.getGroups().iterator();
while (iterGroups.hasNext()) {
String groupName = iterGroups.next();
entityDom.addGroup(groupName);
}
Iterator<Category> iterCategory = this._categories.iterator();
while (iterCategory.hasNext()) {
Category category = iterCategory.next();
entityDom.addCategory(category.getCode());
}
Iterator<AttributeInterface> iterAttribute = this._attributeList.iterator();
while (iterAttribute.hasNext()) {
AttributeInterface currentAttribute = iterAttribute.next();
Element attributeElement = currentAttribute.getJDOMElement();
if (attributeElement != null) {
entityDom.addAttribute(currentAttribute.getJDOMElement());
}
}
return entityDom;
}
Aggregations