Search in sources :

Example 6 with ITreeNode

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);
}
Also used : ITreeNode(com.agiletec.aps.system.common.tree.ITreeNode) PageTreeAction(com.agiletec.apsadmin.portal.PageTreeAction)

Example 7 with ITreeNode

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);
}
Also used : ITreeNode(com.agiletec.aps.system.common.tree.ITreeNode) PageTreeAction(com.agiletec.apsadmin.portal.PageTreeAction)

Example 8 with ITreeNode

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);
}
Also used : ITreeNode(com.agiletec.aps.system.common.tree.ITreeNode) PageTreeAction(com.agiletec.apsadmin.portal.PageTreeAction)

Example 9 with ITreeNode

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;
}
Also used : ITreeNode(com.agiletec.aps.system.common.tree.ITreeNode)

Example 10 with ITreeNode

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);
        }
    }
}
Also used : ITreeNode(com.agiletec.aps.system.common.tree.ITreeNode)

Aggregations

ITreeNode (com.agiletec.aps.system.common.tree.ITreeNode)36 Category (com.agiletec.aps.system.services.category.Category)9 ArrayList (java.util.ArrayList)9 PageTreeAction (com.agiletec.apsadmin.portal.PageTreeAction)7 IDataObjectSearchEngineManager (org.entando.entando.aps.system.services.dataobjectsearchengine.IDataObjectSearchEngineManager)4 SearchEngineManager (org.entando.entando.aps.system.services.dataobjectsearchengine.SearchEngineManager)4 SearchEngineFilter (org.entando.entando.aps.system.services.searchengine.SearchEngineFilter)4 TreeNodeWrapper (com.agiletec.apsadmin.system.TreeNodeWrapper)2 Term (org.apache.lucene.index.Term)2 BooleanQuery (org.apache.lucene.search.BooleanQuery)2 MatchAllDocsQuery (org.apache.lucene.search.MatchAllDocsQuery)2 PhraseQuery (org.apache.lucene.search.PhraseQuery)2 Query (org.apache.lucene.search.Query)2 TermQuery (org.apache.lucene.search.TermQuery)2 TermRangeQuery (org.apache.lucene.search.TermRangeQuery)2 FacetedContentsResult (org.entando.entando.aps.system.services.searchengine.FacetedContentsResult)2 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)1 IPage (com.agiletec.aps.system.services.page.IPage)1 IPageActionHelper (com.agiletec.apsadmin.portal.helper.IPageActionHelper)1 ValueStack (com.opensymphony.xwork2.util.ValueStack)1