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));
}
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);
}
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);
}
}
}
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;
}
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;
}
}
Aggregations