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

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


    public RepositoryItem buildItem(Session session, String key) throws RepositoryException {
        String[] snippets = key.split(":");
        String publicationId = snippets[0];
        String areaName = snippets[1];
        SiteTree tree;
        try {
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = factory.getPublication(publicationId);
            Area  area = publication.getArea(areaName);
           
View Full Code Here


    public RepositoryItem buildItem(Session session, String key) throws RepositoryException {
        String[] snippets = key.split(":");
        String publicationId = snippets[0];
        String areaName = snippets[1];
        SiteTree tree;
        try {
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = factory.getPublication(publicationId);
            Area  area = publication.getArea(areaName);
           
View Full Code Here

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

                SiteTree tree = (SiteTree) structure;
                String direction = getParameterAsString(DIRECTION);
                if (direction.equals(UP)) {
                    tree.moveUp(getSourceDocument().getPath());
                } else if (direction.equals(DOWN)) {
                    tree.moveDown(getSourceDocument().getPath());
                } else {
                    throw new IllegalArgumentException("The direction [" + direction
                            + "] is not supported.");
                }
            } else {
View Full Code Here

        publication.copyDocument(sourceDocument, destinationDocument);

        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

        //TODO evaluation of meta, workflow

        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

        //TODO evaluation of resources, meta, workflow

        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

        TreeSiteManager siteManager = null;
        try {
            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.");
View Full Code Here

        ServiceSelector selector = null;
        TreeSiteManager siteManager = null;
        try {
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (TreeSiteManager) selector.select(this.publication.getSiteManagerHint());
            SiteTree siteTree = siteManager.getTree(this.identityMap, this.publication, siteArea);

            String label = "";
            String isFolder = "";

            // FIXME: don't hardcode area label
            if (siteArea.equals(Publication.AUTHORING_AREA))
                label = "Authoring";
            if (siteArea.equals(Publication.ARCHIVE_AREA))
                label = "Archive";
            if (siteArea.equals(Publication.TRASH_AREA))
                label = "Trash";
            if (siteArea.equals(Publication.LIVE_AREA))
                label = "Live";
            if (siteArea.equals(Publication.STAGING_AREA))
                label = "Staging";

            if (siteTree.getTopNodes().length > 0)
                isFolder = "true";
            else
                isFolder = "false";

            this.attributes.clear();
            this.attributes.addAttribute("", ATTR_AREA, ATTR_AREA, "CDATA", siteArea);
            this.attributes.addAttribute("", ATTR_FOLDER, ATTR_FOLDER, "CDATA", isFolder);
            this.attributes.addAttribute("", ATTR_LABEL, ATTR_LABEL, "CDATA", label);

            startNode(NODE_SITE);

            if (this.area.equals(siteArea)) {
                generateFragmentRecursive(siteTree.getTopNodes(), this.documentid);
            }

            endNode(NODE_SITE);
        } catch (ServiceException e) {
            throw new ProcessingException(e);
View Full Code Here

TOP

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

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.