use of com.agiletec.aps.system.common.tree.ITreeNode in project entando-core by entando.
the class TestHypertextAttributeAction method testConfigPageLink_2.
public void testConfigPageLink_2() throws Throwable {
this.initIntroPageLink("admin", "ART102");
ITreeNode root = ((PageTreeAction) this.getAction()).getAllowedTreeRootNode();
assertNotNull(root);
assertEquals("homepage", root.getCode());
assertEquals(4, root.getChildrenCodes().length);
}
use of com.agiletec.aps.system.common.tree.ITreeNode in project entando-core by entando.
the class TestPageLinkAction method testConfigPageLink_2.
public void testConfigPageLink_2() throws Throwable {
String contentOnSessionMarker = this.initJoinLinkTest("admin", "ART102", "VediAnche", "it");
this.initContentAction("/do/jacms/Content/Link", "configPageLink", contentOnSessionMarker);
String result = this.executeAction();
assertEquals(Action.SUCCESS, result);
ITreeNode root = ((PageTreeAction) this.getAction()).getAllowedTreeRootNode();
assertNotNull(root);
assertEquals("homepage", root.getCode());
assertEquals(4, root.getChildrenCodes().length);
ITreeNode showableRoot = ((PageTreeAction) this.getAction()).getShowableTree();
assertEquals("homepage", showableRoot.getCode());
assertEquals(0, showableRoot.getChildrenCodes().length);
}
use of com.agiletec.aps.system.common.tree.ITreeNode in project entando-core by entando.
the class TestPageLinkAction method checkTestOpenPageTree_ART102.
private void checkTestOpenPageTree_ART102() throws Throwable {
ITreeNode root = ((PageTreeAction) this.getAction()).getAllowedTreeRootNode();
assertNotNull(root);
assertEquals("homepage", root.getCode());
assertEquals(4, root.getChildrenCodes().length);
ITreeNode showableRoot = ((PageTreeAction) this.getAction()).getShowableTree();
assertEquals("homepage", showableRoot.getCode());
assertEquals(4, showableRoot.getChildrenCodes().length);
}
use of com.agiletec.aps.system.common.tree.ITreeNode in project entando-core by entando.
the class Page method getFullTitle.
@Override
protected String getFullTitle(String langCode, String separator, boolean shortTitle) {
String title = this.getTitles().getProperty(langCode);
if (null == title) {
title = this.getCode();
}
if (this.isRoot()) {
return title;
}
ITreeNode parent = this.getParent();
while (parent != null && parent.getParent() != null) {
String parentTitle = "..";
if (!shortTitle) {
parentTitle = parent.getTitles().getProperty(langCode);
if (null == parentTitle) {
parentTitle = parent.getCode();
}
}
title = parentTitle + separator + title;
if (parent.isRoot()) {
return title;
}
parent = parent.getParent();
}
return title;
}
use of com.agiletec.aps.system.common.tree.ITreeNode in project entando-core by entando.
the class TreeNodeBaseActionHelper method builShowableTree.
private void builShowableTree(TreeNodeWrapper currentNode, ITreeNode currentTreeNode, Set<String> checkNodes) {
if (checkNodes.contains(currentNode.getCode())) {
currentNode.setOpen(true);
String[] children = currentTreeNode.getChildrenCodes();
for (int i = 0; i < children.length; i++) {
ITreeNode newCurrentTreeNode = this.getTreeNode(children[i]);
TreeNodeWrapper newNode = this.buildWrapper(newCurrentTreeNode);
newNode.setParent(currentNode);
currentNode.addChildCode(newNode.getCode());
currentNode.addChild(newNode);
this.builShowableTree(newNode, newCurrentTreeNode, checkNodes);
}
}
}
Aggregations