Search in sources :

Example 6 with Content

use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.

the class TestContentDOM method testGetXMLDocument.

public void testGetXMLDocument() throws ApsSystemException {
    Content contentTest = this._contentManager.createContentType("ART");
    assertNotNull(contentTest);
    contentTest.addGroup("tempGroupName");
    String xml = contentTest.getXML();
    int index = xml.indexOf("tempGroupName");
    assertTrue((index != -1));
}
Also used : Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content)

Example 7 with Content

use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.

the class TestContentAttributeIterator method testIterator.

public void testIterator() throws ApsSystemException {
    Content content = new Content();
    AttributeInterface attribute = new MonoTextAttribute();
    attribute.setName("temp");
    attribute.setDefaultLangCode("it");
    attribute.setRenderingLang("it");
    attribute.setSearchable(true);
    attribute.setType("Monotext");
    content.addAttribute(attribute);
    EntityAttributeIterator attributeIterator = new EntityAttributeIterator(content);
    boolean contains = false;
    while (attributeIterator.hasNext()) {
        attribute = (AttributeInterface) attributeIterator.next();
        contains = attribute.getName().equals("temp");
    }
    assertTrue(contains);
}
Also used : Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) AttributeInterface(com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface) MonoTextAttribute(com.agiletec.aps.system.common.entity.model.attribute.MonoTextAttribute) EntityAttributeIterator(com.agiletec.aps.system.common.util.EntityAttributeIterator)

Example 8 with Content

use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.

the class TestContentDispenser method testGetRenderedContent_3.

public void testGetRenderedContent_3() throws Throwable {
    Content content = this._contentManager.loadContent("ART120", true);
    content.setId(null);
    try {
        RequestContext reqCtx = this.getRequestContext();
        this.setUserOnSession("admin");
        this._contentManager.insertOnLineContent(content);
        ContentRenderizationInfo outputInfo = this._contentDispenser.getRenderizationInfo(content.getId(), 2, "it", reqCtx);
        assertNotNull(outputInfo);
        assertNotNull(this._cacheInfoManager.getFromCache(ICacheInfoManager.DEFAULT_CACHE_NAME, JacmsSystemConstants.CONTENT_AUTH_INFO_CACHE_PREFIX + content.getId()));
        this._contentManager.insertOnLineContent(content);
        this.waitNotifyingThread();
        assertNull(this._cacheInfoManager.getFromCache(ICacheInfoManager.DEFAULT_CACHE_NAME, JacmsSystemConstants.CONTENT_AUTH_INFO_CACHE_PREFIX + content.getId()));
    } catch (Throwable t) {
        throw t;
    } finally {
        if (null != content.getId()) {
            this._contentManager.deleteContent(content);
        }
    }
}
Also used : Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) RequestContext(com.agiletec.aps.system.RequestContext)

Example 9 with Content

use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.

the class TestSearchEngineManager method createContent_3.

private Content createContent_3() {
    Content content = new Content();
    content.setId("103");
    content.setMainGroup(Group.FREE_GROUP_NAME);
    content.setTypeCode("ART");
    TextAttribute text = new TextAttribute();
    text.setName("Articolo");
    text.setType("Text");
    text.setIndexingType(IndexableAttributeInterface.INDEXING_TYPE_TEXT);
    text.setText("La vita รจ una cosa meravigliosa", "it");
    text.setText("Life is a wonderful thing", "en");
    content.addAttribute(text);
    Category category = this._categoryManager.getCategory("general_cat1");
    content.addCategory(category);
    return content;
}
Also used : Category(com.agiletec.aps.system.services.category.Category) Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) TextAttribute(com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)

Example 10 with Content

use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.

the class TestSearchEngineManager method testSearchContentsId_3.

public void testSearchContentsId_3() throws Throwable {
    try {
        Content content_1 = this.createContent_1();
        content_1.setMainGroup(Group.ADMINS_GROUP_NAME);
        this._searchEngineManager.deleteIndexedEntity(content_1.getId());
        this._searchEngineManager.addEntityToIndex(content_1);
        Content content_2 = this.createContent_2();
        this._searchEngineManager.deleteIndexedEntity(content_2.getId());
        this._searchEngineManager.addEntityToIndex(content_2);
        List<String> allowedGroup = new ArrayList<String>();
        allowedGroup.add(Group.FREE_GROUP_NAME);
        List<String> contentsId = this._searchEngineManager.searchEntityId("it", "San meravigliosa", allowedGroup);
        assertNotNull(contentsId);
        assertFalse(contentsId.contains(content_1.getId()));
        allowedGroup.add("secondaryGroup");
        contentsId = this._searchEngineManager.searchEntityId("it", "San meravigliosa", allowedGroup);
        assertNotNull(contentsId);
        assertTrue(contentsId.contains(content_1.getId()));
    } catch (Throwable t) {
        throw t;
    }
}
Also used : Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) ArrayList(java.util.ArrayList)

Aggregations

Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)227 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)55 AttributeTracer (com.agiletec.aps.system.common.entity.model.AttributeTracer)35 MonoListAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoListAttribute)29 ArrayList (java.util.ArrayList)26 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)17 ActionSupport (com.opensymphony.xwork2.ActionSupport)14 List (java.util.List)14 CompositeAttribute (com.agiletec.aps.system.common.entity.model.attribute.CompositeAttribute)13 HttpSession (javax.servlet.http.HttpSession)13 UserDetails (com.agiletec.aps.system.services.user.UserDetails)12 IPage (com.agiletec.aps.system.services.page.IPage)10 Date (java.util.Date)8 EntitySearchFilter (com.agiletec.aps.system.common.entity.model.EntitySearchFilter)7 ITextAttribute (com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute)7 LinkAttribute (com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.LinkAttribute)7 ResourceInterface (com.agiletec.plugins.jacms.aps.system.services.resource.model.ResourceInterface)7 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)7 ListAttribute (com.agiletec.aps.system.common.entity.model.attribute.ListAttribute)6 TextAttribute (com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)6