Search in sources :

Example 91 with Category

use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.

the class TestDataObjectManager method testGetXML.

public void testGetXML() throws Throwable {
    DataObject dataObject = this._dataObjectManager.createDataObject("ART");
    dataObject.setId("ART1");
    dataObject.setTypeCode("Articolo");
    dataObject.setTypeDescription("Articolo");
    dataObject.setDescription("descrizione");
    dataObject.setStatus(DataObject.STATUS_DRAFT);
    dataObject.setMainGroup("free");
    Category cat13 = new Category();
    cat13.setCode("13");
    dataObject.addCategory(cat13);
    Category cat19 = new Category();
    cat19.setCode("19");
    dataObject.addCategory(cat19);
    String xml = dataObject.getXML();
    assertNotNull(xml);
    assertTrue(xml.indexOf("<dataObject id=\"ART1\" typecode=\"Articolo\" typedescr=\"Articolo\">") != -1);
    assertTrue(xml.indexOf("<descr>descrizione</descr>") != -1);
    assertTrue(xml.indexOf("<status>" + DataObject.STATUS_DRAFT + "</status>") != -1);
    assertTrue(xml.indexOf("<category id=\"13\" />") != -1);
    assertTrue(xml.indexOf("<category id=\"19\" />") != -1);
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) Category(com.agiletec.aps.system.services.category.Category)

Aggregations

Category (com.agiletec.aps.system.services.category.Category)91 ArrayList (java.util.ArrayList)23 ITreeNode (com.agiletec.aps.system.common.tree.ITreeNode)9 ResourceNotFoundException (org.entando.entando.aps.system.exception.ResourceNotFoundException)7 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)6 TextAttribute (com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)6 List (java.util.List)6 ValidationGenericException (org.entando.entando.web.common.exceptions.ValidationGenericException)6 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)5 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)5 RestServerError (org.entando.entando.aps.system.exception.RestServerError)5 ICategoryManager (com.agiletec.aps.system.services.category.ICategoryManager)4 Lang (com.agiletec.aps.system.services.lang.Lang)4 ResourceInterface (com.agiletec.plugins.jacms.aps.system.services.resource.model.ResourceInterface)4 CategoryDto (org.entando.entando.aps.system.services.category.model.CategoryDto)4 IDataObjectSearchEngineManager (org.entando.entando.aps.system.services.dataobjectsearchengine.IDataObjectSearchEngineManager)4 SearchEngineManager (org.entando.entando.aps.system.services.dataobjectsearchengine.SearchEngineManager)4 Cache (org.springframework.cache.Cache)4 CategoryUtilizer (com.agiletec.aps.system.services.category.CategoryUtilizer)3 HashSet (java.util.HashSet)3