Search in sources :

Example 1 with ResourceDOM

use of com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM in project entando-core by entando.

the class AbstractMonoInstanceResource method getXML.

@Override
public String getXML() {
    ResourceDOM resourceDom = this.getResourceDOM();
    resourceDom.addInstance(this.getInstance().getJDOMElement());
    return resourceDom.getXMLDocument();
}
Also used : ResourceDOM(com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM)

Example 2 with ResourceDOM

use of com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM in project entando-core by entando.

the class AbstractMultiInstanceResource method getXML.

/**
 * Restituisce l'xml completo della risorsa.
 * @return L'xml completo della risorsa.
 */
@Override
public String getXML() {
    ResourceDOM resourceDom = this.getResourceDOM();
    List<ResourceInstance> instances = new ArrayList<ResourceInstance>(this.getInstances().values());
    for (int i = 0; i < instances.size(); i++) {
        ResourceInstance currentInstance = instances.get(i);
        resourceDom.addInstance(currentInstance.getJDOMElement());
    }
    return resourceDom.getXMLDocument();
}
Also used : ArrayList(java.util.ArrayList) ResourceDOM(com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM)

Example 3 with ResourceDOM

use of com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM in project entando-core by entando.

the class AbstractResource method getResourceDOM.

/**
 * Restituisce la classe dom (necessaria per la generazione dell'xml della risorsa)
 * preparata con gli attributi base della risorsa.
 * @return La classe dom preparata con gli attributi base della risorsa.
 */
protected ResourceDOM getResourceDOM() {
    ResourceDOM resourceDom = this.getNewResourceDOM();
    resourceDom.setTypeCode(this.getType());
    resourceDom.setId(this.getId());
    resourceDom.setDescription(this.getDescription());
    resourceDom.setMainGroup(this.getMainGroup());
    resourceDom.setMasterFileName(this.getMasterFileName());
    if (null != this.getCategories()) {
        for (int i = 0; i < this.getCategories().size(); i++) {
            Category cat = (Category) this.getCategories().get(i);
            resourceDom.addCategory(cat.getCode());
        }
    }
    return resourceDom;
}
Also used : Category(com.agiletec.aps.system.services.category.Category) ResourceDOM(com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM)

Aggregations

ResourceDOM (com.agiletec.plugins.jacms.aps.system.services.resource.parse.ResourceDOM)3 Category (com.agiletec.aps.system.services.category.Category)1 ArrayList (java.util.ArrayList)1