Package org.apache.lenya.cms.publication

Examples of org.apache.lenya.cms.publication.SiteTreeNode


        String language,
        String area)
        throws SiteTreeException, DocumentException {

        SiteTree tree = getPublication().getTree(area);
        SiteTreeNode node = tree.getNode(documentid);
        if (node == null) {
            throw new DocumentException(
                "Document-id " + documentid + " not found.");
        }
        Label label = node.getLabel(language);
        if (label == null) {
            throw new DocumentException(
                "Label for language " + language + " not found.");
        }
  // FIXME: This is somewhat of a hack. The change of the label
View Full Code Here


        publication.copyDocument(sourceDocument, destinationDocument);
       
        assertTrue(destinationDocument.exists());
       
        SiteTree destinationTree = publication.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

        File documentFile = new File(authoringDirectory, CREATED_FILE);
        assertTrue(documentFile.exists());
        System.out.println("File was created: " + documentFile.getAbsolutePath());

        SiteTree sitetree = publication.getTree(AREA);
        SiteTreeNode node = sitetree.getNode(PARENT_ID + "/" + CHILD_ID);
        assertNotNull(node);
        System.out.println("Sitetree node was created: " + node.getId() + " (label: " +
            node.getLabel(DOCUMENT_LANGUAGE) + ")");
    }
View Full Code Here

    //TODO evaluation of meta, workflow
       
        //evaluate the node
    SiteTree sitetree = PublicationHelper.getPublication().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.getAbsoluteParentId());
    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

    System.out.println("Backup was deleted: " + firstRcbakFile.getAbsolutePath());
       
        //TODO evaluation of meta, workflow
       
    SiteTree sitetree = PublicationHelper.getPublication().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.getAbsoluteParentId());
    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

    assertFalse(liveDocumentFile.exists());

        //TODO evaluation of resources, meta, workflow
       
    SiteTree authoringSitetree = PublicationHelper.getPublication().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 = PublicationHelper.getPublication().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

                && !this.area.equals(Publication.LIVE_AREA)) {
            throw new ProcessingException("Invalid area: " + this.area);
        }
        siteTree = publication.getTree(this.area);

        SiteTreeNode node = siteTree.getNode(this.documentid);
        if (this.getLogger().isDebugEnabled()) {
            this.getLogger().debug(
                    "Node with documentid " + documentid + " found.");
        }
        if (node == null)
            throw new SiteTreeException("Node with documentid " + 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

    File documentFile = new File(authoringDirectory, filepath);
        assertTrue(documentFile.exists());
    System.out.println("Document was copied: " + documentFile.getAbsolutePath());

        SiteTree sitetree = PublicationHelper.getPublication().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.getAbsoluteParentId());
    }
View Full Code Here

        Document liveDocument = getPublication().getAreaVersion(document, Publication.LIVE_AREA);
        Document liveParent = DocumentHelper.getParentDocument(liveDocument);
        if (liveParent != null) {
            SiteTree liveTree = getPublication().getSiteTree(Publication.LIVE_AREA);
            SiteTreeNode liveParentNode = liveTree.getNode(liveParent.getId());
            if (liveParentNode == null) {
                if (log.isDebugEnabled()) {
                    log.debug("Cannot execute task: live parent node does not exist.");
                }
                OK = false;
View Full Code Here

        Document authoringDocument = getPublication().getAreaVersion(liveDocument, Publication.AUTHORING_AREA);
        OK = OK && canWorkflowFire(authoringDocument);

        SiteTree tree = getPublication().getSiteTree(liveDocument.getArea());
        SiteTreeNode node = tree.getNode(liveDocument.getId());

        if (node == null) {
            throw new ExecutionException(
                "Sitetree node for document [" + liveDocument + "] does not exist!");
        }

        Label label = node.getLabel(liveDocument.getLanguage());

        if (label == null) {
            throw new ExecutionException(
                "Sitetree label for document [" + liveDocument + "] does not exist!");
        }

        if (node.getLabels().length == 1 && node.getChildren().length > 0) {
            if (log.isDebugEnabled()) {
                log.debug(
                    "Cannot delete last language version of document ["
                        + liveDocument
                        + "] because this node has children.");
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.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.