use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.
the class TestListAttributeAction method testAddListElement.
public void testAddListElement() throws Throwable {
String contentOnSessionMarker = this.initEditContent();
this.initContentAction("/do/jacms/Content", "addListElement", contentOnSessionMarker);
this.addParameter("attributeName", "Autori");
this.addParameter("listLangCode", "it");
String result = this.executeAction();
assertEquals(Action.SUCCESS, result);
Content currentContent = this.getContentOnEdit(contentOnSessionMarker);
MonoListAttribute monoListAttribute = (MonoListAttribute) currentContent.getAttribute("Autori");
List<AttributeInterface> attributes = monoListAttribute.getAttributes();
String[] expected = { "Pippo", "Paperino", "Pluto", "" };
this.verifyText(attributes, expected);
}
use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.
the class TestPageLinkAction method testJoinPageLink_1.
public void testJoinPageLink_1() throws Throwable {
String contentOnSessionMarker = this.initJoinLinkTest("admin", "ART1", "VediAnche", "it");
this.initContentAction("/do/jacms/Content/Link", "joinPageLink", contentOnSessionMarker);
this.addParameter("linkType", String.valueOf(SymbolicLink.PAGE_TYPE));
this.addParameter("selectedNode", "pagina_11");
String result = this.executeAction();
assertEquals(Action.SUCCESS, result);
Content content = this.getContentOnEdit(contentOnSessionMarker);
LinkAttribute attribute = (LinkAttribute) content.getAttribute("VediAnche");
SymbolicLink symbolicLink = attribute.getSymbolicLink();
assertNotNull(symbolicLink);
assertEquals("pagina_11", symbolicLink.getPageDest());
}
use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.
the class TestResourceAttributeAction method testRemoveImageResource_1.
public void testRemoveImageResource_1() throws Throwable {
String contentOnSessionMarker = this.initForImageRemovingTest();
this.initContentAction("/do/jacms/Content", "removeResource", contentOnSessionMarker);
this.addParameter("attributeName", "Foto");
this.addParameter("resourceTypeCode", "Image");
this.addParameter("resourceLangCode", "it");
assertEquals(Action.SUCCESS, this.executeAction());
Content contentOnEdit = this.getContentOnEdit(contentOnSessionMarker);
ImageAttribute imageAttribute = (ImageAttribute) contentOnEdit.getAttribute("Foto");
assertNull(imageAttribute.getResource("it"));
assertNull(imageAttribute.getResource("en"));
}
use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.
the class TestResourceAttributeAction method testRemoveImageResource_2.
public void testRemoveImageResource_2() throws Throwable {
String contentOnSessionMarker = this.initForImageRemovingTest();
this.initContentAction("/do/jacms/Content", "removeResource", contentOnSessionMarker);
this.addParameter("attributeName", "Foto");
this.addParameter("resourceTypeCode", "Image");
this.addParameter("resourceLangCode", "en");
assertEquals(Action.SUCCESS, this.executeAction());
Content contentOnEdit = this.getContentOnEdit(contentOnSessionMarker);
ImageAttribute imageAttribute = (ImageAttribute) contentOnEdit.getAttribute("Foto");
assertNotNull(imageAttribute.getResource("it"));
assertEquals("44", imageAttribute.getResource("it").getId());
assertNull(imageAttribute.getResource("en"));
}
use of com.agiletec.plugins.jacms.aps.system.services.content.model.Content in project entando-core by entando.
the class TestUrlLinkAction method initJoinLinkTest.
private String initJoinLinkTest(String contentId, String simpleLinkAttributeName, String langCode) throws Throwable {
Content content = this.getContentManager().loadContent(contentId, false);
this.executeEdit(contentId, "admin");
String contentOnSessionMarker = AbstractContentAction.buildContentOnSessionMarker(content, ApsAdminSystemConstants.EDIT);
// iniziazione parametri sessione
HttpSession session = this.getRequest().getSession();
session.setAttribute(ILinkAttributeActionHelper.ATTRIBUTE_NAME_SESSION_PARAM, simpleLinkAttributeName);
session.setAttribute(ILinkAttributeActionHelper.LINK_LANG_CODE_SESSION_PARAM, langCode);
return contentOnSessionMarker;
}
Aggregations