org.apache.lenya.cms.publication
Interface DocumentBuilder

All Known Implementing Classes:
DefaultDocumentBuilder

public interface DocumentBuilder

A document builder builds a document from a URL.


Method Summary
 java.lang.String buildCanonicalUrl(Publication publication, java.lang.String area, java.lang.String documentid)
          Builds an URL corresponding to a cms document from the publication, the area and the document id
 java.lang.String buildCanonicalUrl(Publication publication, java.lang.String area, java.lang.String documentid, java.lang.String language)
          Builds an URL corresponding to a cms document from the publication, the area, the document id and the language
 Document buildDocument(Publication publication, java.lang.String url)
          Builds a document.
 Document buildLanguageVersion(Document document, java.lang.String language)
          Builds a clone of a document for another language.
 boolean isDocument(Publication publication, java.lang.String url)
          Checks if an URL corresponds to a CMS document.
 

Method Detail

buildDocument

Document buildDocument(Publication publication,
                       java.lang.String url)
                       throws DocumentBuildException
Builds a document.

Parameters:
publication - The publication the document belongs to.
url - The URL of the form /{publication-id}/{area}/{document-id}{language-suffix}.{extension}.
Returns:
A document.
Throws:
DocumentBuildException - when something went wrong.

isDocument

boolean isDocument(Publication publication,
                   java.lang.String url)
                   throws DocumentBuildException
Checks if an URL corresponds to a CMS document.

Parameters:
publication - The publication the document belongs to.
url - The URL of the form /{publication-id}/...
Returns:
A boolean value.
Throws:
DocumentBuildException - when something went wrong.

buildCanonicalUrl

java.lang.String buildCanonicalUrl(Publication publication,
                                   java.lang.String area,
                                   java.lang.String documentid,
                                   java.lang.String language)
Builds an URL corresponding to a cms document from the publication, the area, the document id and the language

Parameters:
publication - The publication the document belongs to.
area - The area the document belongs to.
documentid - The document id of the document.
language - The language of the document.
Returns:
a String The builded url

buildCanonicalUrl

java.lang.String buildCanonicalUrl(Publication publication,
                                   java.lang.String area,
                                   java.lang.String documentid)
Builds an URL corresponding to a cms document from the publication, the area and the document id

Parameters:
publication - The publication the document belongs to.
area - The area the document belongs to.
documentid - The document id of the document.
Returns:
a String The builded url

buildLanguageVersion

Document buildLanguageVersion(Document document,
                              java.lang.String language)
Builds a clone of a document for another language.

Parameters:
document - The document to clone.
language - The language of the target document.
Returns:
A document.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.