Search in sources :

Example 11 with TextAttribute

use of com.agiletec.aps.system.common.entity.model.attribute.TextAttribute in project entando-core by entando.

the class TestContentManager method testLoadContent.

public void testLoadContent() throws Throwable {
    Content content = this._contentManager.loadContent("ART111", false);
    assertEquals(Content.STATUS_PUBLIC, content.getStatus());
    assertEquals("coach", content.getMainGroup());
    assertEquals(2, content.getGroups().size());
    assertTrue(content.getGroups().contains("customers"));
    assertTrue(content.getGroups().contains("helpdesk"));
    Map<String, AttributeInterface> attributes = content.getAttributeMap();
    assertEquals(7, attributes.size());
    TextAttribute title = (TextAttribute) attributes.get("Titolo");
    assertEquals("Titolo Contenuto 3 Coach", title.getTextForLang("it"));
    assertNull(title.getTextForLang("en"));
    MonoListAttribute authors = (MonoListAttribute) attributes.get("Autori");
    assertEquals(4, authors.getAttributes().size());
    LinkAttribute link = (LinkAttribute) attributes.get("VediAnche");
    assertNull(link.getSymbolicLink());
    HypertextAttribute hypertext = (HypertextAttribute) attributes.get("CorpoTesto");
    assertEquals("<p>Corpo Testo Contenuto 3 Coach</p>", hypertext.getTextForLang("it").trim());
    assertNull(hypertext.getTextForLang("en"));
    ResourceAttributeInterface image = (ResourceAttributeInterface) attributes.get("Foto");
    assertNull(image.getResource());
    DateAttribute date = (DateAttribute) attributes.get("Data");
    assertEquals("13/12/2006", DateConverter.getFormattedDate(date.getDate(), "dd/MM/yyyy"));
}
Also used : LinkAttribute(com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.LinkAttribute) MonoListAttribute(com.agiletec.aps.system.common.entity.model.attribute.MonoListAttribute) HypertextAttribute(com.agiletec.aps.system.common.entity.model.attribute.HypertextAttribute) Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) TextAttribute(com.agiletec.aps.system.common.entity.model.attribute.TextAttribute) MonoTextAttribute(com.agiletec.aps.system.common.entity.model.attribute.MonoTextAttribute) ResourceAttributeInterface(com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.ResourceAttributeInterface) ResourceAttributeInterface(com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.ResourceAttributeInterface) AttributeInterface(com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface) DateAttribute(com.agiletec.aps.system.common.entity.model.attribute.DateAttribute)

Example 12 with TextAttribute

use of com.agiletec.aps.system.common.entity.model.attribute.TextAttribute in project entando-core by entando.

the class TestSearchEngineManager method createDataObject_3.

private DataObject createDataObject_3() {
    DataObject content = new DataObject();
    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 : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) Category(com.agiletec.aps.system.services.category.Category) TextAttribute(com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)

Example 13 with TextAttribute

use of com.agiletec.aps.system.common.entity.model.attribute.TextAttribute in project entando-core by entando.

the class TestSearchEngineManager method createDataObject_2.

private DataObject createDataObject_2() {
    DataObject content = new DataObject();
    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;
}
Also used : DataObject(org.entando.entando.aps.system.services.dataobject.model.DataObject) Category(com.agiletec.aps.system.services.category.Category) TextAttribute(com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)

Aggregations

TextAttribute (com.agiletec.aps.system.common.entity.model.attribute.TextAttribute)13 MonoTextAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoTextAttribute)6 Category (com.agiletec.aps.system.services.category.Category)6 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)6 DataObject (org.entando.entando.aps.system.services.dataobject.model.DataObject)6 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)5 DateAttribute (com.agiletec.aps.system.common.entity.model.attribute.DateAttribute)5 MonoListAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoListAttribute)5 HypertextAttribute (com.agiletec.aps.system.common.entity.model.attribute.HypertextAttribute)4 CompositeAttribute (com.agiletec.aps.system.common.entity.model.attribute.CompositeAttribute)3 ListAttribute (com.agiletec.aps.system.common.entity.model.attribute.ListAttribute)3 NumberAttribute (com.agiletec.aps.system.common.entity.model.attribute.NumberAttribute)3 ArrayList (java.util.ArrayList)3 EntitySearchFilter (com.agiletec.aps.system.common.entity.model.EntitySearchFilter)2 CheckBoxAttribute (com.agiletec.aps.system.common.entity.model.attribute.CheckBoxAttribute)2 EnumeratorAttribute (com.agiletec.aps.system.common.entity.model.attribute.EnumeratorAttribute)2 ThreeStateAttribute (com.agiletec.aps.system.common.entity.model.attribute.ThreeStateAttribute)2 ResourceAttributeInterface (com.agiletec.plugins.jacms.aps.system.services.content.model.extraAttribute.ResourceAttributeInterface)2 EnumeratorMapAttribute (org.entando.entando.aps.system.common.entity.model.attribute.EnumeratorMapAttribute)2 SystemConstants (com.agiletec.aps.system.SystemConstants)1