Examples of Publication


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

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

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

   * @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

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

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

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

        final String language = attributes[2];

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

            DocumentBuilder builder = publication.getDocumentBuilder();

            // Create canonical URL
            String canonicalUrl = builder
                    .buildCanonicalUrl(publication, area, documentId, language);
View Full Code Here

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

            allParameters.put(sessionAttributeName, session.getAttribute(sessionAttributeName));
        }

        try {
            Publication publication = PublicationFactory.getPublication(objectModel);
            creator.create(publication, new File(absoluteDoctypesPath + "samples"),
                new File(sitemapParentPath + docsPath + parentid), parentid, childid, childType, childname, language,
                allParameters);
        } catch (Exception e) {
            getLogger().error("Creator threw exception: " + e);
View Full Code Here

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

     * @param documentid  The document id.
     * @param propertyname The name of the property
     */
    public void compute(String area, String documentid, String propertyname) {

        Publication publication = getPublication();
        DocumentIdToPathMapper pathMapper = publication.getPathMapper();
        String path = pathMapper.getPath(documentid, "");
        log("path " + path);

        int index = path.lastIndexOf("/");
        String dir = path.substring(0, index);
View Full Code Here

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

   * @throws SiteTreeException
   *             if an error occurs
   */
  public void deactivateResources(String language, String documentid, String area)
    throws SiteTreeException {
    Publication publication = getPublication();
    SiteTree tree = null;

    try {
      tree = publication.getTree(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);
        Document doc;
        try {
          doc = builder.buildDocument(publication, url);
        } catch (DocumentBuildException e) {
View Full Code Here

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

     * @throws SiteTreeException if there are problems with creating or saving the site tree.
     */
    public void manipulateTree(String firstDocumentId, String secDocumentId, String firstArea,
            String secArea) throws SiteTreeException {

        Publication publication = getPublication();
        SiteTree firsttree = publication.getTree(firstArea);
        SiteTree sectree = publication.getTree(secArea);
       
        StringTokenizer st = new StringTokenizer(secDocumentId, "/");
        int length = st.countTokens() - 1;
        StringBuffer parentId = new StringBuffer(secDocumentId.length());
        for (int i = 0; i < length; i++) {
View Full Code Here

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

  /**
   * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
   */
  public void visitSiteTreeNode(SiteTreeNode node) {
    try {
      Publication publication = getPublication();
      String publicationPath =
        this.getPublicationDirectory().getCanonicalPath();
      DocumentBuilder builder = publication.getDocumentBuilder();

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

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

  /** (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();

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

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.