Package org.apache.lenya.cms.publication

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


   */
  public void execute() throws BuildException {
    log("document-id " + this.getDocumentid());
    log("area " + this.getArea());

    Publication publication = getPublication();

    String language = null;
    String url = null;
    SiteTree tree;

    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);
View Full Code Here


   * Delete the resources of the documents corresponding to this node
   * 
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();
    DocumentBuilder builder = publication.getDocumentBuilder();

    String destDocumentid = node.getAbsoluteId();
    String srcDocumentid =
      destDocumentid.replaceFirst(
        getSecdocumentid(),
View Full Code Here

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

   * move the workflow files
   *
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();

    Label[] labels = node.getLabels();
    for (int i = 0; i < labels.length; i++) {
      String language = labels[i].getLanguage();

      String srcDocumentid = node.getAbsoluteId();
      String destDocumentid = srcDocumentid.replaceFirst(firstdocumentid, secdocumentid);

      // TODO: content(fix the build file)
      // TODO: resources (fix the build file)
      // TODO: rcml (fix the build file)
      // TODO: rcbak (fix the build file)

      //move workflow
      DocumentBuilder builder = publication.getDocumentBuilder();
      String url = builder.buildCanonicalUrl(publication, firstarea, srcDocumentid, language);
      String newurl =
        builder.buildCanonicalUrl(publication, secarea, destDocumentid, language);

      Document document;
View Full Code Here

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

        Object value = null;

        try {
            PageEnvelope envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
            Publication publication = envelope.getPublication();

            if (name.equals(AUTHORING_NODE)) {
                SiteTree authoringTree = publication.getTree(Publication.AUTHORING_AREA);
                value = authoringTree.getNode(envelope.getDocument().getId());
            }

            if (name.equals(LIVE_NODE)) {
                SiteTree liveTree = publication.getTree(Publication.LIVE_AREA);
                value = liveTree.getNode(envelope.getDocument().getId());
            }

            if (name.equals(TRASH_NODE)) {
                SiteTree trashTree = publication.getTree(Publication.TRASH_AREA);
                value = trashTree.getNode(envelope.getDocument().getId());
            }
           
            if (name.equals(ARCHIVE_NODE)) {
                SiteTree archiveTree = publication.getTree(Publication.ARCHIVE_AREA);
                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;  
                }
            }
           
            if (name.equals(LABEL_HREF)) {
                Document document = envelope.getDocument();
                SiteTree siteTree = publication.getTree(document.getArea());
                value = siteTree.getNode(document.getId()).getLabel(document.getLanguage()).getHref();
                if (value == null) value = "";
            }

        } catch (Exception e) {
View Full Code Here

    public void execute() throws BuildException {
        try {
            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

    /**
     * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
     */
    public void visitSiteTreeNode(SiteTreeNode node) throws DocumentException {
        Publication publication = getPublication();

        Label[] labels = node.getLabels();
        for (int i = 0; i < labels.length; i++) {

            String language = labels[i].getLanguage();
            DocumentBuilder builder = publication.getDocumentBuilder();

            try {
                String url = builder.buildCanonicalUrl(publication, area, documentId, language);
                Document document = builder.buildDocument(publication, url);

View Full Code Here

   * @see org.apache.tools.ant.Task#execute()
   */
  public void execute() throws BuildException {
    try {
      log("area : " + this.getArea());
      Publication publication= getPublication();
      SiteTree tree = publication.getTree(getArea());
          
      SiteTreeNode node = tree.getNode("/");
            node.deleteChildren();      
      tree.save();
      } catch (
View Full Code Here

  /** (non-Javadoc)
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    Publication publication = getPublication();
    DocumentBuilder builder = publication.getDocumentBuilder();

    String srcDocumentid = node.getAbsoluteId();
    String destDocumentid =
      srcDocumentid.replaceFirst(
        getFirstdocumentid(),
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.Publication

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.