Package org.apache.lenya.cms.publication

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


      log("document-id for the destination :" + this.getSecdocumentid());
      log("area for the destination :" + this.getSecarea());

      Publication publication = getPublication();
      SiteTree tree = publication.getSiteTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
    }
  }
View Full Code Here


      log("document-id for the destination :" + this.getSecdocumentid());
      log("area for the destination :" + this.getSecarea());

      Publication publication = getPublication();
      SiteTree tree = publication.getSiteTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
    }
  }
View Full Code Here

      log("src area dir" + this.getSrcareadir());

      //visit the destination tree
      Publication publication = getPublication();
      SiteTree tree = publication.getSiteTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);

    } catch (Exception e) {
      throw new BuildException(e);
    }
  }
View Full Code Here

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

        String area)
        throws SiteTreeException, DocumentException {

        DefaultSiteTree tree = null;
        tree = getPublication().getSiteTree(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

    assertFalse(liveDocumentFile.exists());

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

        //TODO evaluation of meta, workflow
        File sitetreeFile = new File(authoringDirectory, TREE_FILE);

        SiteTree sitetree = PublicationHelper.getPublication().getSiteTree(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

        try {
            authoringTree =
                getPublication().getSiteTree(Publication.AUTHORING_AREA);
            liveTree = getPublication().getSiteTree(Publication.LIVE_AREA);

            SiteTreeNode authoringNode = authoringTree.getNode(documentId);
      SiteTreeNode[] siblings = authoringNode.getNextSiblings();
            String parentId = authoringNode.getAbsoluteParentId();
      SiteTreeNode sibling = null;
      String siblingDocId = null;
      for (int i = 0; i < siblings.length; i++){
        String docId=parentId+"/"+siblings[i].getId();
        sibling =liveTree.getNode(docId);
        if (sibling != null) {
          siblingDocId = docId;
                  break
        }
      }

            if (authoringNode != null) {
                if (language == null) {
                    // no language was specified. Simply publish the
                    // node including all languages.
                    try {
                        liveTree.addNode(authoringNode,siblingDocId);
                    } catch (SiteTreeException e1) {
                        throw new ParentNodeNotFoundException(
                            "Couldn't add document: "
                                + documentId
                                + " to live tree.",
                            e1);
                    }
                } else {
                    // a language was specified. Let's see if this
                    // node even has an entry for the specified
                    // language.
                    Label label = authoringNode.getLabel(language);
                    if (label != null) {
                        // check if this node has already been
                        // published
                        SiteTreeNode liveNode = liveTree.getNode(documentId);
                        if (liveNode != null) {
                            // if the node already exists in the live
                            // tree simply insert the label in the
                            // live tree
                            liveTree.setLabel(documentId, label);
View Full Code Here

    Publication publication = getPublication();
    DefaultSiteTree tree = null;

    try {
      tree = publication.getSiteTree(area);
      SiteTreeNode node = tree.getNode(documentid);
      Label[] labels = null;
      if (node != null) {
        labels = node.getLabels();
      }
      if (node == null | (labels != null && labels.length < 1)) {

        DocumentBuilder builder = publication.getDocumentBuilder();
        String url = builder.buildCanonicalUrl(publication, area, documentid, language);
View Full Code Here

    for (int i = 0; i < (length - 1); i++) {
      parentid = parentid + "/" + st.nextToken();
    }
    String newid = st.nextToken();

    SiteTreeNode node = firsttree.removeNode(firstdocumentid);
    if (node != null) {
      SiteTreeNode parentNode = sectree.getNode(parentid);
      if (parentNode != null) {
        sectree.importSubtree(parentNode, node, newid, this.getRefdocumentid());
      } else {
        throw new SiteTreeException(
          "The parent node "
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.