org.apache.lenya.cms.publication
Interface DocumentBuilder

All Known Implementing Classes:
DefaultDocumentBuilder

public interface DocumentBuilder

A document builder builds a document from a URL.


Field Summary
static java.lang.String ROLE
          The Avalon role.
 
Method Summary
 java.lang.String buildCanonicalUrl(DocumentFactory factory, DocumentLocator locator)
          Builds an URL corresponding to a CMS document.
 DocumentLocator getLocator(DocumentFactory factory, java.lang.String webappUrl)
          Returns a document for a web application URL.
 boolean isDocument(DocumentFactory factory, java.lang.String url)
          Checks if an URL corresponds to a CMS document.
 boolean isValidDocumentName(java.lang.String documentName)
          Checks if a document name is valid.
 

Field Detail

ROLE

static final java.lang.String ROLE
The Avalon role.

Method Detail

getLocator

DocumentLocator getLocator(DocumentFactory factory,
                           java.lang.String webappUrl)
                           throws DocumentBuildException
Returns a document for a web application URL.

Parameters:
factory - The factory.
webappUrl - The web application URL.
Returns:
A document identifier.
Throws:
DocumentBuildException - if an error occurs.

isDocument

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

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

buildCanonicalUrl

java.lang.String buildCanonicalUrl(DocumentFactory factory,
                                   DocumentLocator locator)
Builds an URL corresponding to a CMS document.

Parameters:
factory - The document factory.
locator - The locator.
Returns:
a String The corresponding URL.

isValidDocumentName

boolean isValidDocumentName(java.lang.String documentName)
Checks if a document name is valid.

Parameters:
documentName - The document name.
Returns:
A boolean value.


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.