use of com.agiletec.aps.system.services.category.Category 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.aps.system.services.category.Category in project entando-core by entando.
the class TestSearchEngineManager method testSearchFacetedContents_1.
public void testSearchFacetedContents_1() throws Throwable {
try {
Thread thread = this._searchEngineManager.startReloadContentsReferences();
thread.join();
SearchEngineManager sem = (SearchEngineManager) this._searchEngineManager;
Category general = this._categoryManager.getCategory("general");
List<ITreeNode> categories = new ArrayList<ITreeNode>();
categories.add(general);
List<String> allowedGroup = new ArrayList<String>();
allowedGroup.add(Group.FREE_GROUP_NAME);
allowedGroup.add(Group.ADMINS_GROUP_NAME);
FacetedContentsResult result = sem.searchFacetedEntities(null, categories, allowedGroup);
assertNotNull(result);
String[] expected1 = { "ART122", "ART102", "ART111", "ART120" };
this.verify(result.getContentsId(), expected1);
assertEquals(4, result.getOccurrences().size());
} catch (Throwable t) {
throw t;
}
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class TestSearchEngineManager method testSearchContentsId_6.
public void testSearchContentsId_6() throws Throwable {
try {
Thread thread = this._searchEngineManager.startReloadContentsReferences();
thread.join();
SearchEngineManager sem = (SearchEngineManager) this._searchEngineManager;
Category general = this._categoryManager.getCategory("general");
List<ITreeNode> categories = new ArrayList<ITreeNode>();
categories.add(general);
List<String> allowedGroup = new ArrayList<String>();
allowedGroup.add(Group.ADMINS_GROUP_NAME);
List<String> contentsId = sem.searchEntityId(null, categories, allowedGroup);
assertNotNull(contentsId);
String[] expected1 = { "ART122", "ART102", "ART111", "ART120" };
this.verify(contentsId, expected1);
} catch (Throwable t) {
throw t;
}
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class TestSearchEngineManager method createContent_1.
private Content createContent_1() {
Content content = new Content();
content.setId("100");
content.setMainGroup(Group.FREE_GROUP_NAME);
content.addGroup("secondaryGroup");
content.setTypeCode("ART");
TextAttribute text = new TextAttribute();
text.setName("Articolo");
text.setType("Text");
text.setIndexingType(IndexableAttributeInterface.INDEXING_TYPE_TEXT);
text.setText("San Pietroburgo è una città meravigliosa W3C-WAI", "it");
text.setText("St. Petersburg is a wonderful city", "en");
content.addAttribute(text);
Category category1 = this._categoryManager.getCategory("resCat2");
Category category2 = this._categoryManager.getCategory("general_cat3");
content.addCategory(category1);
content.addCategory(category2);
return content;
}
use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class TestSearchEngineManager method createContent_2.
private Content createContent_2() {
Content content = new Content();
content.setId("101");
content.setMainGroup(Group.FREE_GROUP_NAME);
content.addGroup("thirdGroup");
content.setTypeCode("ART");
TextAttribute text = new TextAttribute();
text.setName("Articolo");
text.setType("Text");
text.setIndexingType(IndexableAttributeInterface.INDEXING_TYPE_TEXT);
text.setText("Il turismo ha incrementato più del 20 per cento nel 2011-2013, quando la Croazia ha aderito all'Unione europea. Consegienda di questo aumento è una serie di modernizzazione di alloggi di recente costruzione, tra cui circa tre dozzine di ostelli.", "it");
text.setText("Tourism had shot up more than 20 percent from 2011 to 2013, when Croatia joined the European Union. Accompanying that rise is a raft of modernized and recently built lodgings, including some three dozen hostels.", "en");
content.addAttribute(text);
Category category1 = this._categoryManager.getCategory("resCat1");
Category category2 = this._categoryManager.getCategory("general_cat2");
content.addCategory(category1);
content.addCategory(category2);
return content;
}
Aggregations