You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2005/03/24 23:12:44 UTC

svn commit: r158953 - in lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication: ImportSiteTree.xsl JCRDocument.java JCRDocumentBuilder.java JCRSiteTreeNodeImpl.java SiteTreeFactory.java SiteTreeFactoryException.java

Author: michi
Date: Thu Mar 24 14:12:43 2005
New Revision: 158953

URL: http://svn.apache.org/viewcvs?view=rev&rev=158953
Log:
helper classes added

Added:
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/ImportSiteTree.xsl
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocument.java
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocumentBuilder.java
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTreeNodeImpl.java
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactory.java
    lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactoryException.java

Added: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/ImportSiteTree.xsl
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/ImportSiteTree.xsl?view=auto&rev=158953
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/ImportSiteTree.xsl (added)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/ImportSiteTree.xsl Thu Mar 24 14:12:43 2005
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id:$ -->
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:sitetree="http://apache.org/cocoon/lenya/sitetree/1.0"
+    xmlns:sitetree-system="http://apache.org/cocoon/lenya/sitetree/system/1.0"
+    xmlns:xalan="http://xml.apache.org/xslt"
+    >
+    
+  <xsl:output encoding="UTF-8" indent="yes"
+	xalan:indent-amount="4"/>
+
+  <xsl:template match="sitetree:site">
+    <sitetree-system:site>
+      <xsl:apply-templates select="sitetree:node/@id"/>
+    </sitetree-system:site>
+  </xsl:template>
+  
+  <xsl:template match="sitetree:node/@id">
+    <xsl:variable name="nodeId"><xsl:value-of select="."/></xsl:variable>
+    <xsl:element name="sitetree:{$nodeId}">
+      <xsl:apply-templates select="../sitetree:label"/>
+      <xsl:apply-templates select="../sitetree:node/@id"/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="sitetree:label">
+    <sitetree-system:document>
+      <xsl:attribute name="lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
+      <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
+    </sitetree-system:document>
+  </xsl:template>
+  
+
+  <xsl:template match="*">
+    <xsl:element name="{name()}" namespace="{namespace-uri()}">
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+</xsl:stylesheet>

Added: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocument.java
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocument.java?view=auto&rev=158953
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocument.java (added)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocument.java Thu Mar 24 14:12:43 2005
@@ -0,0 +1,391 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+/* $Id$  */
+
+package org.apache.lenya.cms.publication;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+
+/**
+ * A typical CMS document.
+ */
+public class JCRDocument implements Document {
+    private String extension = "html";
+    private String documentURL;
+    
+    private String id;
+    private Publication publication;
+    private DublinCore dublincore;
+
+    /**
+     * Creates a new instance of JCRtDocument.
+     * @param publication The publication the document belongs to.
+     * @param id The document ID (starting with a slash).
+     * @deprecated Use {@link JCRDocumentBuilder} instead.
+     */
+    public JCRDocument(Publication publication, String id) {
+        
+        if (id == null) {
+            throw new IllegalArgumentException("The document ID must not be null!");
+        }
+        if (!id.startsWith("/")) {
+            throw new IllegalArgumentException("The document ID must start with a slash!");
+        }
+        this.id = id;
+
+        assert(publication != null) && !"".equals(publication.getId());
+        this.publication = publication;
+        this.dublincore = new DublinCoreProxy(this);
+    }
+
+    /**
+     * Creates a new instance of DefaultDocument.
+     * The language of the document is the default language of
+     * the publication.
+     * @param publication The publication the document belongs to.
+     * @param id The document ID (starting with a slash).
+     * @param area The area.
+     */
+    protected JCRDocument(Publication publication, String id, String area) {
+        if (id == null) {
+            throw new IllegalArgumentException("The document ID must not be null!");
+        }
+        if (!id.startsWith("/")) {
+            throw new IllegalArgumentException("The document ID must start with a slash!");
+        }
+        this.id = id;
+
+        assert(publication != null) && !"".equals(publication.getId());
+        this.publication = publication;
+
+        setArea(area);
+        setLanguage(publication.getDefaultLanguage());
+
+        this.dublincore = new DublinCoreProxy(this);
+
+    }
+
+    /**
+     * Creates a new instance of JCRDocument.
+     * 
+     * @param publication The publication the document belongs to.
+     * @param id The document ID (starting with a slash).
+     * @param area The area.
+     * @param language the language
+     */
+    protected JCRDocument(Publication publication, String id, String area, String language) {
+        if (id == null) {
+            throw new IllegalArgumentException("The document ID must not be null!");
+        }
+        if (!id.startsWith("/")) {
+            throw new IllegalArgumentException("The document ID must start with a slash!");
+        }
+        this.id = id;
+
+        assert(publication != null) && !"".equals(publication.getId());
+        this.publication = publication;
+        this.language = language;
+        setArea(area);
+
+        this.dublincore = new DublinCoreProxy(this);
+
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getId()
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getName()
+     */
+    public String getName() {
+        String[] ids = id.split("/");
+        String nodeId = ids[ids.length - 1];
+
+        return nodeId;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getNodeId()
+     * @deprecated replaced by getName()
+     */
+    public String getNodeId() {
+        return getName();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getPublication()
+     */
+    public Publication getPublication() {
+        return publication;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getLastModified()
+     */
+    public Date getLastModified() {
+        return new Date(getFile().lastModified());
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getDublinCore()
+     */
+    public DublinCore getDublinCore() {
+        return dublincore;
+    }
+
+    /**
+     * Returns the file for this document.
+     * @return A file object.
+     */
+    public File getFile() {
+        // TODO: Remove dependency on File because of jackrabbit
+        return getPublication().getPathMapper().getFile(
+            getPublication(),
+            getArea(),
+            getId(),
+            getLanguage());
+    }
+
+    private String language = "";
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getLanguage()
+     */
+    public String getLanguage() {
+        return language;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getLanguage()
+     */
+    public String[] getLanguages() throws DocumentException {
+        ArrayList languages = new ArrayList();
+        SiteTree sitetree;
+        try {
+            sitetree = getPublication().getSiteTree(getArea());
+            if (sitetree != null) {
+                SiteTreeNode node = sitetree.getNode(getId());
+                if (node != null) {
+                    Label[] labels = node.getLabels();
+                    for (int i = 0; i < labels.length; i++) {
+                        languages.add(labels[i].getLanguage());
+                    }
+                }
+            } else {
+                languages.add(getLanguage());
+            }
+        } catch (SiteTreeException e) {
+            throw new DocumentException(e);
+        }
+
+        return (String[]) languages.toArray(new String[languages.size()]);
+    }
+
+    /**
+     * Sets the language of this document.
+     * @param language The language.
+     */
+    public void setLanguage(String language) {
+        assert language != null;
+        this.language = language;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getLabel()
+     */
+    public String getLabel() throws DocumentException {
+        String label = "";
+        try {
+            SiteTree siteTree = getPublication().getSiteTree(getArea());
+            if (siteTree != null) {
+                label = siteTree.getNode(getId()).getLabel(getLanguage()).getLabel();
+            }
+        } catch (SiteTreeException e) {
+            throw new DocumentException(e);
+        }
+        return label;
+    }
+
+    private String area;
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getArea()
+     */
+    public String getArea() {
+        return area;
+    }
+
+    /**
+     * @see Document#getCompleteURL(String)
+     */
+    public String getCompleteURL() {
+        return "/" + getPublication().getId() + "/" + getArea() + getDocumentURL();
+    }
+
+    /**
+     * @see Document#getCompleteInfoURL(String)
+     */
+    public String getCompleteInfoURL() {
+        return "/"
+            + getPublication().getId()
+            + "/"
+            + Publication.INFO_AREA_PREFIX
+            + getArea()
+            + getDocumentURL();
+    }
+
+    /**
+     * @see Document#getCompleteURL(String)
+     */
+    public String getCompleteURLWithoutLanguage() {
+        String extensionSuffix = "".equals(getExtension()) ? "" : ("." + getExtension());
+
+        return "/" + getPublication().getId() + "/" + getArea() + getId() + extensionSuffix;
+    }
+
+    /**
+     * Sets the area.
+     * @param area A string.
+     */
+    protected void setArea(String area) {
+        if (!AbstractPublication.isValidArea(area)) {
+            throw new IllegalArgumentException("The area [" + area + "] is not valid!");
+        }
+        this.area = area;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getExtension()
+     */
+    public String getExtension() {
+        return extension;
+    }
+
+    /**
+     * Sets the extension of the file in the URL.
+     * @param extension A string.
+     */
+    protected void setExtension(String extension) {
+        assert extension != null;
+        this.extension = extension;
+    }
+
+    /**
+     * Sets the document URL.
+     * @param url The document URL (without publication ID and area).
+     */
+    public void setDocumentURL(String url) {
+        assert url != null;
+        this.documentURL = url;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.Document#getDocumentURL()
+     */
+    public String getDocumentURL() {
+        return documentURL;
+    }
+
+    /** (non-Javadoc)
+     * @see org.apache.lenya.cms.publication.Document#exists()
+     */
+    public boolean exists() throws DocumentException {
+        boolean exists;
+        try {
+            SiteTree sitetree = getPublication().getSiteTree(getArea());
+            if (sitetree != null) {
+                SiteTreeNode node = sitetree.getNode(getId());
+                exists = (node != null) && (node.getLabel(getLanguage()) != null);
+            } else {
+                exists = false;
+            }
+        } catch (SiteTreeException e) {
+            throw new DocumentException(e);
+        }
+        return exists;
+    }
+
+    /** (non-Javadoc)
+     * @see org.apache.lenya.cms.publication.Document#existsInAnyLanguage()
+     */
+    public boolean existsInAnyLanguage() throws DocumentException {
+        boolean exists = false;
+        try {
+            SiteTree sitetree = getPublication().getSiteTree(getArea());
+            if (sitetree != null) {
+                SiteTreeNode node = sitetree.getNode(getId());
+                exists = node != null;
+            } else {
+                exists = false;
+            }
+        } catch (SiteTreeException e) {
+            throw new DocumentException(e);
+        }
+        return exists;
+    }
+
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object object) {
+        boolean equals = false;
+        if (getClass().isInstance(object)) {
+            Document document = (Document) object;
+            equals =
+                getPublication().equals(document.getPublication())
+                    && getId().equals(document.getId())
+                    && getArea().equals(document.getArea())
+                    && getLanguage().equals(document.getLanguage());
+        }
+        return equals;
+
+    }
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode() {
+
+        String key =
+            getPublication().getId()
+                + ":"
+                + getPublication().getServletContext()
+                + ":"
+                + getArea()
+                + ":"
+                + getId()
+                + ":"
+                + getLanguage();
+
+        return key.hashCode();
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return getPublication().getId() + ":" + getArea() + ":" + getId() + ":" + getLanguage();
+    }
+
+}

Added: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocumentBuilder.java
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocumentBuilder.java?view=auto&rev=158953
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocumentBuilder.java (added)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRDocumentBuilder.java Thu Mar 24 14:12:43 2005
@@ -0,0 +1,243 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+/* $Id$  */
+
+package org.apache.lenya.cms.publication;
+
+public class JCRDocumentBuilder implements DocumentBuilder {
+    /**
+     * Non-public constructor.
+     */
+    protected JCRDocumentBuilder() {
+    }
+
+    private static JCRDocumentBuilder instance;
+
+    /**
+     * Returns the singleton instance.
+     * 
+     * @return A document builder.
+     */
+    public static JCRDocumentBuilder getInstance() {
+        if (instance == null) {
+            instance = new JCRDocumentBuilder();
+        }
+
+        return instance;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.DocumentBuilder#buildDocument(org.apache.lenya.cms.publication.Publication,
+     *      java.lang.String)
+     */
+    public Document buildDocument(Publication publication, String url)
+        throws DocumentBuildException {
+
+        URLInformation info = new URLInformation(url);
+
+        String documentURL = info.getDocumentUrl();
+        String originalURL = documentURL;
+
+        String extension = getExtension(documentURL);
+        documentURL = removeExtensions(documentURL);
+
+        String language = getLanguage(documentURL);
+        String fullLanguage = "".equals(language) ? "" : ("_" + language);
+        documentURL = documentURL.substring(0, documentURL.length() - fullLanguage.length());
+
+        if ("".equals(language)) {
+            language = publication.getDefaultLanguage();
+        }
+
+        String documentId = documentURL;
+
+        if (!documentId.startsWith("/")) {
+            throw new DocumentBuildException(
+                "Document ID [" + documentId + "] does not start with '/'!");
+        }
+
+        JCRDocument document =
+            createDocument(publication, info.getArea(), documentId, language);
+        document.setExtension(extension);
+        document.setDocumentURL(originalURL);
+
+        return document;
+    }
+
+    /**
+     * Creates a new document object.
+     * Override this method to create specific document objects,
+     * e.g., for different document IDs.
+     * @param publication The publication.
+     * @param area The area. 
+     * @param documentId The document ID.
+     * @param language The language.
+     * @return A document.
+     * @throws DocumentException when something went wrong.
+     */
+    protected JCRDocument createDocument(Publication publication, String area,
+            String documentId, String language)
+    throws DocumentBuildException
+    {
+        JCRDocument document = new JCRDocument(publication, documentId, area, language);
+        return document;
+    }
+
+    /**
+     * Removes all "."-separated extensions from a URL (e.g., <code>/foo.print.html</code> is
+     * transformed to <code>/foo</code>).
+     * 
+     * @param url The URL to trim.
+     * @return A URL string.
+     */
+    protected String removeExtensions(String url) {
+        int dotIndex = url.indexOf(".");
+        if (dotIndex > -1) {
+            url = url.substring(0, dotIndex);
+        }
+        return url;
+    }
+
+    /**
+     * Returns the language of a URL.
+     * 
+     * @param urlWithoutSuffix The URL without the suffix.
+     * @return A string.
+     */
+    protected String getLanguage(String urlWithoutSuffix) {
+
+        String language = "";
+        String url = urlWithoutSuffix;
+        
+        int languageSeparatorIndex = url.lastIndexOf("_");
+        if (languageSeparatorIndex > -1) {
+            String suffix = url.substring(languageSeparatorIndex + 1);
+            if (suffix.length() <= 5) {
+                language = suffix;
+            }
+        }
+        return language;
+    }
+
+    /**
+     * Returns the extension of a URL.
+     * 
+     * @param url The URL.
+     * @return The extension.
+     */
+    protected String getExtension(String url) {
+        int startOfSuffix = url.lastIndexOf('.');
+        String suffix = "";
+
+        if ((startOfSuffix > -1) && !url.endsWith(".")) {
+            suffix = url.substring(startOfSuffix + 1);
+        }
+
+        return suffix;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.DocumentBuilder#isDocument(org.apache.lenya.cms.publication.Publication,
+     *      java.lang.String)
+     */
+    public boolean isDocument(Publication publication, String url) throws DocumentBuildException {
+        boolean isDocument = false;
+
+        String publicationURI = url.substring(("/" + publication.getId()).length());
+        if (publicationURI.startsWith("/")) {
+            publicationURI = publicationURI.substring(1);
+
+            int slashIndex = publicationURI.indexOf("/");
+            if (slashIndex > -1) {
+                String area = publicationURI.substring(0, slashIndex);
+                String documentUri = publicationURI.substring(slashIndex);
+                if (AbstractPublication.isValidArea(area) && documentUri.startsWith("/")) {
+                    isDocument = true;
+                }
+            }
+        }
+
+        return isDocument;
+    }
+
+    /**
+     * Builds the canonical document URL.
+     * 
+     * @param publication The publication.
+     * @param documentid The document ID.
+     * @param language The language of the document.
+     * @return A string.
+     */
+    protected String buildCanonicalDocumentUrl(
+        Publication publication,
+        String documentid,
+        String language) {
+
+        String languageSuffix = "";
+        if (!language.equals(publication.getDefaultLanguage())) {
+            languageSuffix = "_" + language;
+        }
+
+        String url = documentid + languageSuffix + ".html";
+        return url;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.DocumentBuilder#buildCanonicalUrl(org.apache.lenya.cms.publication.Publication,
+     *      java.lang.String, java.lang.String, java.lang.String)
+     */
+    public String buildCanonicalUrl(
+        Publication publication,
+        String area,
+        String documentid,
+        String language) {
+
+        String documentUrl = buildCanonicalDocumentUrl(publication, documentid, language);
+        String url = "/" + publication.getId() + "/" + area + documentUrl;
+
+        return url;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.DocumentBuilder#buildCanonicalUrl(org.apache.lenya.cms.publication.Publication,
+     *      java.lang.String, java.lang.String)
+     */
+    public String buildCanonicalUrl(Publication publication, String area, String documentId) {
+        return buildCanonicalUrl(publication, area, documentId, publication.getDefaultLanguage());
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.DocumentBuilder#buildLanguageVersion(org.apache.lenya.cms.publication.Document,
+     *      java.lang.String)
+     */
+    public Document buildLanguageVersion(Document document, String language) {
+        JCRDocument newDocument =
+            new JCRDocument(
+                document.getPublication(),
+                document.getId(),
+                document.getArea(),
+                language);
+        newDocument.setExtension(document.getExtension());
+        String url =
+            buildCanonicalDocumentUrl(document.getPublication(), document.getId(), language);
+        newDocument.setDocumentURL(url);
+
+        return newDocument;
+    }
+
+}

Added: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTreeNodeImpl.java
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTreeNodeImpl.java?view=auto&rev=158953
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTreeNodeImpl.java (added)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/JCRSiteTreeNodeImpl.java Thu Mar 24 14:12:43 2005
@@ -0,0 +1,496 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+/* $Id: SiteTreeNodeImpl.java 158039 2005-03-18 09:02:06Z michi $  */
+
+package org.apache.lenya.cms.publication;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.ValueFormatException;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.version.VersionException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Category;
+
+/**
+ * Concrete implementation of the <code>SiteTreeNode</code> interface.
+ * 
+ * @see org.apache.lenya.cms.publication.SiteTreeNode
+ */
+public class JCRSiteTreeNodeImpl implements SiteTreeNode {
+    private static Category log = Category.getInstance(JCRSiteTreeNodeImpl.class);
+    public static final String VISIBLEINNAV_ATTRIBUTE_NAME="visibleinnav";
+    public static final String HREF_ATTRIBUTE_NAME = "href";
+    public static final String SUFFIX_ATTRIBUTE_NAME = "suffix";
+    public static final String LINK_ATTRIBUTE_NAME = "link";
+    public static final String LANGUAGE_ATTRIBUTE_NAME = "lang";
+    public static final String LABEL_NAME = "label";
+
+    private Node node = null;
+    private JCRSiteTree sitetree = null;
+
+    /**
+     * Creates a new SiteTreeNodeImpl object.
+     *
+     * @param node the node which is to be wrapped by this SiteTreeNode 
+     */
+    public JCRSiteTreeNodeImpl(Node node, JCRSiteTree sitetree) {
+        this.node = node;
+        this.sitetree = sitetree;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getParentId()
+     * @deprecated use getParent().getId() instead
+     */
+    public String getParentId() {
+        String parentId = null;;
+        try {
+            parentId = sitetree.mapJCRToDocumentId(node.getParent().getName());
+        } catch (ItemNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.getParentId() failed: item not found.", e);
+        } catch (AccessDeniedException e) {
+            log.error("JCRSiteTreeNodeImpl.getParentId() failed: access denied exception.", e);
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getParentId() failed: repository exception.", e);
+        }
+        return parentId;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getId()
+     */
+    public String getId() {
+        String id = null;
+        try {
+            id = sitetree.mapJCRToDocumentId(node.getName());
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getId() failed: repository exception.", e);
+        }
+        return id;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getAbsoluteParentId()
+     * @deprecated use getParent().getAbsoluteId() instead
+     */
+    public String getAbsoluteParentId() {
+        SiteTreeNode parent = this.getParent();
+        return (parent == null) ? "" : parent.getAbsoluteId();
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getAbsoluteId()
+     */
+    public String getAbsoluteId() {
+        String absoluteId = null;
+        try {
+            absoluteId = sitetree.mapJCRToDocumentId(node.getPath());
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getAbsoluteId() failed: repository exception.", e);
+        }
+        return absoluteId;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getLabels()
+     */
+    public Label[] getLabels() {
+        ArrayList labels = new ArrayList();
+        try {
+            NodeIterator iter = node.getNodes(sitetree.getSystemPrefix() + ":" + JCRSiteTree.DOCUMENT_NAME);
+            while (iter.hasNext()) {
+                Node labelNode = iter.nextNode();
+                String labelName = labelNode.getProperty(LABEL_NAME).getString();
+                String labelLang = labelNode.getProperty(LANGUAGE_ATTRIBUTE_NAME).getString();
+                labels.add(new Label(labelName, labelLang));
+            }
+        } catch (PathNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.getLabels() failed: path not found exception.");
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getLabels() failed: repository exception.");
+        }
+        return (Label[])labels.toArray(new Label[labels.size()]);
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getLabel(java.lang.String)
+     */
+    public Label getLabel(String xmlLanguage) {
+        assert xmlLanguage != null;
+        assert xmlLanguage != "";
+        
+        Label label = null;
+        Label[] labels = getLabels();
+        String language = null;
+
+        for (int i = 0; i < labels.length; i++) {
+            language = labels[i].getLanguage();
+
+            if (language.equals(xmlLanguage)) {
+                label = labels[i];
+                break;
+            }
+        }
+
+        return label;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#addLabel(org.apache.lenya.cms.publication.Label)
+     */
+    public void addLabel(Label label) {
+        assert label.getLabel() != null;
+        assert label.getLanguage() != null;
+        
+        if (getLabel(label.getLanguage()) == null) {
+            Node labelNode = null;
+            // only add the label if there is no label with the same language yet.
+            try {
+                labelNode = node.addNode(sitetree.getSystemPrefix() + ":" + JCRSiteTree.DOCUMENT_NAME);
+                labelNode.addMixin("mix:versionable");
+                labelNode.setProperty(LABEL_NAME, label.getLabel());
+                labelNode.setProperty(LANGUAGE_ATTRIBUTE_NAME, label.getLanguage());
+            } catch (ItemExistsException e) {
+                log.error("JCRSiteTreeNodeImpl.addLabel() failed: item exists exception", e);
+            } catch (PathNotFoundException e) {
+                log.error("JCRSiteTreeNodeImpl.addLabel() failed: path not found exception", e);
+            } catch (VersionException e) {
+                log.error("JCRSiteTreeNodeImpl.addLabel() failed: version exception", e);
+            } catch (ConstraintViolationException e) {
+                log.error("JCRSiteTreeNodeImpl.addLabel() failed: constraint violation exception", e);
+            } catch (LockException e) {
+                log.error("JCRSiteTreeNodeImpl.addLabel() failed: lock exception", e);
+            } catch (RepositoryException e) {
+                log.error("JCRSiteTreeNodeImpl.addLabel() failed: repository exception", e);
+            }
+        }
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#removeLabel(org.apache.lenya.cms.publication.Label)
+     */
+    public void removeLabel(Label label) {
+        try {
+            NodeIterator iter = node.getNodes();
+            while (iter.hasNext()) {
+                Node node = iter.nextNode();
+                if (label.getLabel().equals(node.getProperty(LABEL_NAME).getString()) &&
+                        label.getLanguage().equals(node.getProperty(LANGUAGE_ATTRIBUTE_NAME).getString()))
+                {
+                    node.remove();
+                    break;
+                }
+            }
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.removeLabel() failed: repository exception");
+        }
+    }
+ 
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#hasLink()
+     */
+    public boolean visibleInNav() {
+        boolean visibleInNav = false;
+        try {
+            visibleInNav = node.getProperty(VISIBLEINNAV_ATTRIBUTE_NAME).getBoolean();
+        } catch (ValueFormatException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: value format exception", e);
+        } catch (PathNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: path not found exception", e);
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: repository exception", e);
+        }
+        return visibleInNav;
+    }
+ 
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getHref()
+     */
+    public String getHref() {
+        String href = null;
+        try {
+            href = node.getProperty(HREF_ATTRIBUTE_NAME).getString();
+        } catch (ValueFormatException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: value format exception", e);
+        } catch (PathNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: path not found exception", e);
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: repository exception", e);
+        }
+        return href;
+    }
+   
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getSuffix()
+     */
+    public String getSuffix() {
+        String suffix = null;
+        try {
+            suffix = node.getProperty(SUFFIX_ATTRIBUTE_NAME).getString();
+        } catch (ValueFormatException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: value format exception", e);
+        } catch (PathNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: path not found exception", e);
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: repository exception", e);
+        }
+        return suffix;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#hasLink()
+     */
+    public boolean hasLink() {
+        boolean hasLink = false;
+        try {
+            hasLink = node.getProperty(LINK_ATTRIBUTE_NAME).getBoolean();
+        } catch (ValueFormatException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: value format exception", e);
+        } catch (PathNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: path not found exception", e);
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.visibleInNav() failed: repository exception", e);
+        }
+        return hasLink;
+    }
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getChildren()
+     */
+    public SiteTreeNode[] getChildren() {
+        List childElements = new ArrayList();
+        try {
+            NodeIterator iter = node.getNodes(sitetree.getUserPrefix() + ":*");
+            while (iter.hasNext()) {
+                childElements.add(new JCRSiteTreeNodeImpl(iter.nextNode(), sitetree));
+            }
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getChildren() failed: repository exception", e);
+        }
+        return (SiteTreeNode[]) childElements.toArray(new SiteTreeNode[childElements.size()]);
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#removeChildren()
+     */
+    public SiteTreeNode[] removeChildren() {
+        List childElements = new ArrayList();
+        try {
+            NodeIterator iter;
+            iter = node.getNodes(sitetree.getUserPrefix() + ":*");
+            while (iter.hasNext()) {
+                childElements.add(new JCRSiteTreeNodeImpl(iter.nextNode(), sitetree));
+                iter.nextNode().remove();
+            }
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.removeChildren() failed: repository exception");
+        }
+        return (SiteTreeNode[]) childElements.toArray(new SiteTreeNode[childElements.size()]);
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getChildren()
+     */
+    public SiteTreeNode[] getNextSiblings() {
+        List siblingElements = new ArrayList();
+        try {
+            Node parent = node.getParent();
+            NodeIterator iter = parent.getNodes(sitetree.getUserPrefix() + ":*");
+            while (iter.hasNext()) {
+                if (iter.nextNode().equals(node)) {
+                    while (iter.hasNext()) {
+                        siblingElements.add(new JCRSiteTreeNodeImpl(iter.nextNode(), sitetree));
+                    }
+                }
+            }
+        } catch (ItemNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.getNextSiblings() failed: item not found exception");
+        } catch (AccessDeniedException e) {
+            log.error("JCRSiteTreeNodeImpl.getNextSiblings() failed: access denied exception");
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getNextSiblings() failed: repository exception");
+        }
+        
+        return (SiteTreeNode[]) siblingElements.toArray(new SiteTreeNode[siblingElements.size()]);
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getNextSiblingDocumentId()
+     */
+    public String getNextSiblingDocumentId() {
+        SiteTreeNode[] siblings = getNextSiblings();
+        if (siblings != null && siblings.length > 0) {
+            return siblings[0].getAbsoluteId();
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#accept(org.apache.lenya.cms.publication.SiteTreeNodeVisitor)
+     */
+    public void accept(SiteTreeNodeVisitor visitor) throws DocumentException {
+        visitor.visitSiteTreeNode(this);
+    }
+
+    /**
+     * (non-Javadoc)
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#acceptSubtree(org.apache.lenya.cms.publication.SiteTreeNodeVisitor)
+     */
+    public void acceptSubtree(SiteTreeNodeVisitor visitor) throws DocumentException {
+        this.accept(visitor);
+        SiteTreeNode[] children = this.getChildren();
+        if (children == null) {
+            log.info("The node " + this.getId() + " has no children");
+            return;
+        } else {
+            for (int i = 0; i < children.length; i++) {
+                children[i].acceptSubtree(visitor);
+            }
+        }
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#acceptSubtree(org.apache.lenya.cms.publication.SiteTreeNodeVisitor)
+     */
+    public void acceptReverseSubtree(SiteTreeNodeVisitor visitor) throws DocumentException {
+        List orderedNodes = this.postOrder();
+        for (int i = 0; i < orderedNodes.size(); i++) {
+            SiteTreeNode node = (SiteTreeNode) orderedNodes.get(i);
+            node.accept(visitor);
+        }
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#postOrder()
+     */
+    public List postOrder() {
+        List list = new ArrayList();
+        SiteTreeNode[] children = this.getChildren();
+        for (int i = 0; i < children.length; i++) {
+            List orderedChildren = children[i].postOrder();
+            list.addAll(orderedChildren);
+        }
+        list.add(this);
+        return list;
+    }
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#setLabel(org.apache.lenya.cms.publication.Label)
+     */
+    public void setLabel(Label label) {
+        Label existingLabel = getLabel(label.getLanguage());
+        if (existingLabel != null) {
+            removeLabel(existingLabel);
+        }
+        addLabel(label);
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#setLabel(org.apache.lenya.cms.publication.Label)
+     */
+    public void setNodeAttribute (String attributeName, String attributeValue) {
+        try {
+            node.setProperty(attributeName, attributeValue);
+        } catch (ValueFormatException e) {
+            log.error("JCRSiteTreeImpl.setNodeAttribute() for attribute " + attributeName + " with " +
+                    attributeValue + " failed: value format exception", e);
+        } catch (VersionException e) {
+            log.error("JCRSiteTreeImpl.setNodeAttribute() for attribute " + attributeName + " with " +
+                    attributeValue + " failed: version exception", e);
+        } catch (LockException e) {
+            log.error("JCRSiteTreeImpl.setNodeAttribute() for attribute " + attributeName + " with " +
+                    attributeValue + " failed: lock exception", e);
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeImpl.setNodeAttribute() for attribute " + attributeName + " with " +
+                    attributeValue + " failed: repository exception", e);
+        }
+    }
+    
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getChildren(java.lang.String)
+     */
+    public SiteTreeNode[] getChildren(String language) {
+        SiteTreeNode[] children = getChildren();
+        List languageChildren = new ArrayList();
+
+        for (int i = 0; i < children.length; i++) {
+            if (children[i].getLabel(language) != null) {
+                languageChildren.add(children[i]);
+            }
+        }
+
+        return (SiteTreeNode[]) languageChildren.toArray(new SiteTreeNode[languageChildren.size()]);
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getParent()
+     */
+    public SiteTreeNode getParent() {
+        SiteTreeNode parent = null;
+        
+        try {
+            Node jcrParent = node.getParent();
+            parent = new JCRSiteTreeNodeImpl(jcrParent, sitetree);
+        } catch (ItemNotFoundException e) {
+            log.error("JCRSiteTreeNodeImpl.getNextSiblings() failed: item not found exception");
+        } catch (AccessDeniedException e) {
+            log.error("JCRSiteTreeNodeImpl.getNextSiblings() failed: access denied exception");
+        } catch (RepositoryException e) {
+            log.error("JCRSiteTreeNodeImpl.getNextSiblings() failed: repository exception");
+        }
+        return parent;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#getParent(java.lang.String)
+     */
+    public SiteTreeNode getParent(String language) {
+        SiteTreeNode parent = getParent();
+
+        Label label = parent.getLabel(language);
+        if (label == null) {
+            parent = null;
+        }
+
+        return parent;
+    }
+
+    /**
+     * @see org.apache.lenya.cms.publication.SiteTreeNode#preOrder()
+     */
+    public List preOrder() {
+        List list = new ArrayList();
+        list.add(this);
+        SiteTreeNode[] children = this.getChildren();
+        for (int i = 0; i < children.length; i++) {
+            List orderedChildren = children[i].preOrder();
+            list.addAll(orderedChildren);
+        }
+        return list;
+    }
+    
+}

Added: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactory.java
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactory.java?view=auto&rev=158953
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactory.java (added)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactory.java Thu Mar 24 14:12:43 2005
@@ -0,0 +1,91 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+/* $Id$  */
+
+package org.apache.lenya.cms.publication;
+
+import java.io.File;
+
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.log4j.Logger;
+
+/**
+ * Factory class for instantiating a SiteTree.
+ */
+public final class SiteTreeFactory {
+    private static Logger log = Logger.getLogger(SiteTreeFactory.class);
+
+    static final String ELEMENT_SITE_TREE = "site-tree";
+    static final String JCR_SITETREE = "org.apache.lenya.cms.publication.JCRSiteTree";
+    static final String DEFAULT_SITETREE = "org.apache.lenya.cms.publication.DefaultSiteTree";
+    static final String DEFAULT_SITETREE_CLASSNAME = DEFAULT_SITETREE;
+
+    /**
+     * Get sitetree specified in config.
+     * @param config Configuration to read parameter from
+     * @param pubDir Publication directory
+     * @param area Area the sitetree is created for.
+     * @return SiteTree object
+     * @throws SiteTreeFactoryException
+     */
+    public static SiteTree getSiteTree(Configuration config, File pubDir, String area)
+    throws SiteTreeFactoryException
+    {
+        assert config != null;
+        assert area != null;
+        
+        String siteTreeClassName = null;
+        Class siteTreeClass = null;
+
+        Configuration sitetreeConfig = config.getChild(ELEMENT_SITE_TREE, false);
+        if (sitetreeConfig == null) {
+            // Default value if no site-tree directive is present.
+            siteTreeClassName = DEFAULT_SITETREE_CLASSNAME;
+        } else {
+            try {
+                siteTreeClassName = sitetreeConfig.getValue();
+            } catch (ConfigurationException ce) {
+                throw new SiteTreeFactoryException(ce);
+            }
+        }
+        try {
+            siteTreeClass = Class.forName(siteTreeClassName);
+        } catch (ClassNotFoundException e) {
+            throw new SiteTreeFactoryException("Cannot find sitetree class: ["
+                    + siteTreeClassName + "]", e);
+        }
+        
+        SiteTree sitetree = null;
+        try {
+            // TODO: look for an improved implementation for admin area
+            if (area.equals(Publication.ADMIN_AREA)) {
+                sitetree = new DefaultSiteTree(pubDir, area);
+            } else if (siteTreeClass.getName().equals(DEFAULT_SITETREE)) {
+                sitetree = new DefaultSiteTree(pubDir, area);
+            } else if (siteTreeClass.getName().equals(JCR_SITETREE)) {
+                sitetree = new JCRSiteTree(pubDir, area);
+            }
+        } catch (SiteTreeException e) {
+            throw new SiteTreeFactoryException("Unable to instantiate sitetree class.", e);
+        }
+        log.info("Using sitetree class: " + siteTreeClass.getName());
+
+        return sitetree;
+    }
+}

Added: lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactoryException.java
URL: http://svn.apache.org/viewcvs/lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactoryException.java?view=auto&rev=158953
==============================================================================
--- lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactoryException.java (added)
+++ lenya/sandbox/jcrsitetree/src/java/org/apache/lenya/cms/publication/SiteTreeFactoryException.java Thu Mar 24 14:12:43 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+/* $Id$  */
+
+package org.apache.lenya.cms.publication;
+
+public class SiteTreeFactoryException extends Exception {
+
+    /**
+     * Constructor.
+     * @param message
+     */
+    public SiteTreeFactoryException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructor.
+     * @param cause
+     */
+    public SiteTreeFactoryException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructor.
+     * @param message
+     * @param cause
+     */
+    public SiteTreeFactoryException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org