Package org.apache.lenya.cms.publication

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


                    // 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


    try {
      tree = publication.getSiteTree(area);
    } catch (SiteTreeException e) {
      throw new BuildException(e);
    }
    SiteTreeNode node = tree.getNode(documentid);
    Label[] labels = node.getLabels();

    DocumentBuilder builder = publication.getDocumentBuilder();

    try {
      if (labels.length < 1) {
        log("no languages found for the node with id : " + node.getId());
        url = builder.buildCanonicalUrl(publication, area, documentid);
        writeDCIdentifier(publication, url);
      } else {
        for (int i = 0; i < labels.length; i++) {
          language = labels[i].getLanguage();
View Full Code Here

            log("Document ID: [" + documentId + "]");
            log("Area:        [" + area + "]");

            Publication publication = getPublication();
            SiteTree tree = publication.getSiteTree(area);
            SiteTreeNode node = tree.getNode(documentId);

            node.acceptSubtree(this);
        } catch (Exception e) {
            throw new BuildException(e);
        }
    }
View Full Code Here

    try {
      log("area : " + this.getArea());
      Publication publication= getPublication();
      SiteTree tree = publication.getSiteTree(getArea());
          
      SiteTreeNode node = tree.getNode("/");
            node.removeChildren();      
      tree.save();
      } catch (
        Exception e) {
      throw new BuildException(e);
    }
View Full Code Here

        throws SiteTreeException {
        DefaultSiteTree tree = null;

        try {
            tree = getPublication().getSiteTree(area);
            SiteTreeNode node = tree.getNode(documentid);
            node.removeLabel(node.getLabel(language));
            Label[] labels = node.getLabels();
            if (labels.length < 1 ){
                deleteNode(documentid,area);  
            } else {
                tree.save();
            }
View Full Code Here

      log("document-id for the source" + this.getFirstdocumentid());
      log("area for the source" + this.getFirstarea());

      Publication publication= getPublication();
      SiteTree tree = publication.getSiteTree(getFirstarea());
      SiteTreeNode node = tree.getNode(getFirstdocumentid());

      node.acceptSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
    }
}
View Full Code Here

        Document liveDocument = getPublication().getAreaVersion(document, Publication.LIVE_AREA);
        Document liveParent = DocumentHelper.getParentDocument(liveDocument);
        if (liveParent != null) {
            SiteTree liveTree = getPublication().getTree(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

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

        SiteTree tree = getPublication().getTree(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

        try {
            authoringTree = new DefaultSiteTree(absolutetreeauthoringpath);
            liveTree = new DefaultSiteTree(absolutetreelivepath);

            SiteTreeNode documentNode = authoringTree.getNode(documentid);

            if (documentNode != null) {
                liveTree.addNode(documentNode);
            } else {
                throw new PublishingException("No node found for the document " +
View Full Code Here

                value = archiveTree.getNode(envelope.getDocument().getId());
            }
           
            if (name.equals(FIRST_CHILD_ID)) {
                SiteTree siteTree = publication.getSiteTree(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

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.