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.getTree(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 source" + this.getFirstdocumentid());
      log("area for the source" + this.getFirstarea());

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

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

        String area = pageEnvelope.getDocument().getArea();
        String language = pageEnvelope.getDocument().getLanguage();
        String id = pageEnvelope.getDocument().getId();

        SiteTree siteTree = publication.getTree(area);
        SiteTreeNode node = siteTree.getNode(id);

        if (node == null) {
            throw new DocumentDoesNotExistException("The document " + pageEnvelope.getDocument().getId() + " does not exist. Check sitetree, it might need to be reloaded.");
        }
       
        SiteTreeNode[] children = node.getChildren(language);
        if (children.length > 0) {

            String childNodeId = children[0].getId();
            String childId = id + "/" + childNodeId;
            DocumentBuilder builder = publication.getDocumentBuilder();
View Full Code Here

        String area)
        throws SiteTreeException, DocumentException {

        SiteTree tree = null;
        tree = getPublication().getTree(area);
        SiteTreeNode node = tree.getNode(documentid);

        if (node == null) {
            throw new DocumentException(
                "Document-id " + documentid + " not found.");
        }
        //if node is visible change to fale and vice versa
        String visibility = "false";
        if (!node.visibleInNav()) visibility = "true";
        node.setNodeAttribute(SiteTreeNodeImpl.VISIBLEINNAV_ATTRIBUTE_NAME, visibility);       

        tree.save();
    }
View Full Code Here

    try {
      tree = publication.getTree(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 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("document id for the destination" + this.getSecdocumentid());
      log("area for the destination" + this.getSecarea());

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

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

        SiteTree tree = null;
        Label label = null;
        try {
            tree = getPublication().getTree(area);
            SiteTreeNode node = tree.getNode(documentid);
            // if there is only one label left do not delete it.
            if (node.getLabels().length > 1) {
                // if there are more than one labels in this node
                // try to delete the label specified by the labelName.
                label = new Label(labelName, language);
                tree.removeLabel(documentid, label);
                tree.save();
View Full Code Here

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

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

            node.acceptSubtree(this);
        } catch (Exception e) {
            throw new BuildException(e);
        }
    }
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

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.