Package org.apache.lenya.cms.site.tree

Examples of org.apache.lenya.cms.site.tree.SiteTreeNode


            siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());
            SiteStructure structure = siteManager.getSiteStructure(doc.getFactory(), publication,
                    doc.getArea());
            if (structure instanceof SiteTree) {

                SiteTreeNode node = (SiteTreeNode) doc.getLink().getNode();
                SiteTreeNode[] siblings = null;

                String direction = getParameterAsString(DIRECTION);
                if (direction.equals(UP)) {
                    siblings = node.getPrecedingSiblings();
                } else if (direction.equals(DOWN)) {
                    siblings = node.getNextSiblings();
                } else {
                    addErrorMessage(MESSAGE_DIRECTION_UNKNOWN, new String[] { direction });
                }

                if (siblings != null && siblings.length == 0) {
View Full Code Here


                true,
                null,
                null,
                false);
        newSiteTree.addLabel("/root/subtree/child", "en", "child");
        SiteTreeNode node = (SiteTreeNode) newSiteTree.getNode("/root/subtree");
        assertNotNull(node);
        SiteTreeNode parentNode = (SiteTreeNode) this.siteTree.getNode("/foo/lala");
        assertNotNull(parentNode);

        newSiteTree.getRepositoryNode().unlock();
    }
View Full Code Here

        assertTrue(destinationDocument.exists());

        TreeSiteManager manager = (TreeSiteManager) publication.getSiteManager(map);
        SiteTree destinationTree = manager.getTree(destinationArea);
        SiteTreeNode destinationNode = destinationTree.getNode(_destinationDocumentId);
        assertNotNull(destinationNode);
        Label destinationLabel = destinationNode.getLabel(_destinationLanguage);
        assertNotNull(destinationLabel);

        SiteTreeNode sourceNode = destinationTree.getNode(_sourceDocumentId);
        Label sourceLabel = sourceNode.getLabel(_sourceLanguage);

        assertTrue(destinationLabel.getLabel().equals(sourceLabel.getLabel()));

    }
View Full Code Here

        //evaluate the node
        Publication pub = PublicationHelper.getPublication();
        DocumentIdentityMap map = new DocumentIdentityMap(pub);
        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
    SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
    SiteTreeNode node = sitetree.getNode(secdocumentid);
    assertNotNull(node);
        System.out.println(
            "Sitetree node with id "
                + node.getId()
                + " was created as child of node with id: "
                + node.getParent().getAbsoluteId());
    SiteTreeNode firstnode = sitetree.getNode(FIRST_DOCUMENT_ID);
    assertNull(firstnode);
    System.out.println("Sitetree node for document id "+FIRST_DOCUMENT_ID+" was deleted");

    }
View Full Code Here

    final public void testAddNodeStringStringLabelArray() throws SiteException {
    Label label = new Label("Tutorial", null);
    Label[] labels = { label };

    this.siteTree.addNode("/foo", "tutorial", labels);
    SiteTreeNode node =  this.siteTree.getNode("/foo/tutorial");
    assertNotNull(node);
    assertEquals(node.getId(), "tutorial");
    }
View Full Code Here

    Label[] subtreeLabels = { label };
    newSiteTree.addNode("/root/subtree", subtreeLabels, "http://exact.biz", "suffix", true);
    label = new Label("child", "en");
    Label[] childLabels = { label };
    newSiteTree.addNode("/root/subtree/child", childLabels, null, null, false);
    SiteTreeNode node=newSiteTree.getNode("/root/subtree");
    assertNotNull(node);
    SiteTreeNode parentNode=this.siteTree.getNode("/foo/lala");
    assertNotNull(parentNode);
        this.siteTree.importSubtree(parentNode,node, "subtree", null);
    this.siteTree.save();
    assertNotNull(this.siteTree.getNode("/foo/lala/subtree"));
    assertNotNull(this.siteTree.getNode("/foo/lala/subtree/child"));
View Full Code Here

        Publication pub = PublicationHelper.getPublication();
        DocumentIdentityMap map = new DocumentIdentityMap(pub);
        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
        SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
        SiteTreeNode node = sitetree.getNode(secdocumentid);
        assertNotNull(node);
        System.out.println("Sitetree node with id " + node.getId()
                + " was created as child of node with id: " + node.getParent().getAbsoluteId());
        SiteTreeNode firstnode = sitetree.getNode(FIRST_DOCUMENT_ID);
        assertNull(firstnode);
        System.out.println("Sitetree node for document id " + FIRST_DOCUMENT_ID + " was deleted");
    }
View Full Code Here

        Publication pub = PublicationHelper.getPublication();
        DocumentIdentityMap map = new DocumentIdentityMap(pub);
        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
        SiteTree authoringSitetree = manager.getTree(Publication.AUTHORING_AREA);
        SiteTreeNode node = authoringSitetree.getNode(DOCUMENT_ID);
        assertNotNull(node);
        System.out.println("Sitetree node with id [" + node.getId() + "] is always in authoring");
        SiteTree liveSitetree = manager.getTree(Publication.LIVE_AREA);
        SiteTreeNode livenode = liveSitetree.getNode(DOCUMENT_ID);
        assertNull(livenode);
        System.out.println("Sitetree node for document id [" + DOCUMENT_ID
                + "] was deleted from the live tree");
    }
View Full Code Here

        Publication pub = PublicationHelper.getPublication();
        DocumentIdentityMap map = new DocumentIdentityMap(pub);
        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);

        SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
        SiteTreeNode node = sitetree.getNode(secdocumentid);
        assertNotNull(node);
        System.out.println("Sitetree node with id " + node.getId()
                + " was created as child of node with id: " + node.getParent().getAbsoluteId());
    }
View Full Code Here

            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (TreeSiteManager) selector.select(this.publication.getSiteManagerHint());

            SiteTree siteTree = siteManager.getTree(this.identityMap, this.publication, this.area);

            SiteTreeNode node = siteTree.getNode(this.documentid);
            if (this.getLogger().isDebugEnabled()) {
                this.getLogger().debug("Node with documentid " + this.documentid + " found.");
            }
            if (node == null)
                throw new SiteException("Node with documentid " + this.documentid + " not found.");

            SiteTreeNode[] children = node.getChildren();

            for (int i = 0; i < children.length; i++) {
                startNode(NODE_NODE, children[i]);
                addLabels(children[i]);
                endNode(NODE_NODE);
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.site.tree.SiteTreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.