Package org.apache.lenya.cms.publication

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


        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) {
                log.error("Cannot execute task: live parent node does not exist.");
                OK = false;
            }
        }
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

                    // trim the leading '_'
                    language = internalLinksLanguages[i].substring(1);
                }

                log.debug("language: " + language);
                SiteTreeNode documentNode = sitetree.getNode(docId);

                if (language == null) {
                    String url =
                        "/"
                            + publication.getId()
                            + "/"
                            + pageEnvelope.getDocument().getArea()
                            + docId
                            + ".html";
                    language =
                        builder.buildDocument(publication, url).getLanguage();
                }
                log.debug("language: " + language);
                if (documentNode == null
                    || documentNode.getLabel(language) == null) {
                    // the docId has not been published for the given language
                    String url = null;
                    if (language != null) {
                        url =
                            builder.buildCanonicalUrl(
View Full Code Here

                value = archiveTree.getNode(envelope.getDocument().getId());
            }
           
            if (name.equals(FIRST_CHILD_ID)) {
                SiteTree siteTree = publication.getTree(envelope.getDocument().getArea());
                SiteTreeNode node = siteTree.getNode(envelope.getDocument().getId());
                SiteTreeNode[] children = node.getChildren(envelope.getDocument().getLanguage());
                if (children.length > 0){
                    value = children[0].getId();
                } else {
                    value = null;  
                }
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

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

    SiteTreeNode node = firsttree.getNode(firstdocumentid);
    if (node != null) {
        SiteTreeNode parentNode = sectree.getNode(parentid);
      if (parentNode != null) {
                sectree.move(node, parentNode, newid, this.getRefdocumentid());
      } else {
        throw new SiteTreeException(
          "The parent node "
View Full Code Here

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

        SiteTreeNode node = firsttree.getNode(firstdocumentid);

        if (node != null) {
            SiteTreeNode parentNode = sectree.getNode(parentid);
            if (parentNode != null) {
                sectree.copy(node, parentNode, newid, null);
            } else {
                throw new SiteTreeException("The parent node " + parentNode
                        + " where the copied node shall be inserted not found");
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.getTree(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.getTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);

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

        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

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.