org.apache.lenya.cms.publication
Interface DocumentFactory

All Superinterfaces:
RepositoryItemFactory

public interface DocumentFactory
extends RepositoryItemFactory

A DocumentIdentityMap avoids the multiple instanciation of a document object.

Version:
$Id: DocumentFactory.java 569341 2007-08-24 10:47:38Z andreas $

Method Summary
 boolean existsPublication(java.lang.String id)
           
 Document get(DocumentIdentifier identifier)
          Returns a document.
 Document get(DocumentLocator locator)
           
 Document get(Publication publication, java.lang.String area, java.lang.String uuid)
          Builds a document for the default language.
 Document get(Publication publication, java.lang.String area, java.lang.String uuid, java.lang.String language)
          Returns a document.
 Document get(Publication publication, java.lang.String area, java.lang.String uuid, java.lang.String language, int revision)
          Returns a revision of a document.
 Document getAreaVersion(Document document, java.lang.String area)
          Deprecated. use DocumentLocator.getAreaVersion(String) instead.
 Document getFromURL(java.lang.String webappUrl)
          Returns the document identified by a certain web application URL.
 Document getLanguageVersion(Document document, java.lang.String language)
          Deprecated. use DocumentLocator.getLanguageVersion(String) instead.
 Publication getPublication(java.lang.String id)
           
 Publication[] getPublications()
           
 Session getSession()
           
 boolean isDocument(java.lang.String webappUrl)
          Checks if a webapp URL represents a document.
 
Methods inherited from interface org.apache.lenya.cms.repository.RepositoryItemFactory
buildItem, getItemType
 

Method Detail

get

Document get(DocumentIdentifier identifier)
             throws DocumentBuildException
Returns a document.

Parameters:
identifier - The identifier of the document.
Returns:
A document.
Throws:
DocumentBuildException - if the document does not exist.

get

Document get(Publication publication,
             java.lang.String area,
             java.lang.String uuid,
             java.lang.String language)
             throws DocumentBuildException
Returns a document.

Parameters:
publication - The publication.
area - The area.
uuid - The document ID.
language - The language.
Returns:
A document.
Throws:
DocumentBuildException - if the document does not exist.

get

Document get(Publication publication,
             java.lang.String area,
             java.lang.String uuid,
             java.lang.String language,
             int revision)
             throws DocumentBuildException
Returns a revision of a document.

Parameters:
publication - The publication.
area - The area.
uuid - The document ID.
language - The language.
revision - The revision..
Returns:
A document.
Throws:
DocumentBuildException - if the document does not exist.

getFromURL

Document getFromURL(java.lang.String webappUrl)
                    throws DocumentBuildException
Returns the document identified by a certain web application URL.

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

getLanguageVersion

Document getLanguageVersion(Document document,
                            java.lang.String language)
                            throws DocumentBuildException
Deprecated. use DocumentLocator.getLanguageVersion(String) instead.

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.
Throws:
DocumentBuildException - if an error occurs.

getAreaVersion

Document getAreaVersion(Document document,
                        java.lang.String area)
                        throws DocumentBuildException
Deprecated. use DocumentLocator.getAreaVersion(String) instead.

Builds a clone of a document for another area.

Parameters:
document - The document to clone.
area - The area of the target document.
Returns:
A document.
Throws:
DocumentBuildException - if an error occurs.

get

Document get(Publication publication,
             java.lang.String area,
             java.lang.String uuid)
             throws DocumentBuildException
Builds a document for the default language.

Parameters:
publication - The publication.
area - The area.
uuid - The document UUID.
Returns:
A document.
Throws:
DocumentBuildException - if an error occurs.

isDocument

boolean isDocument(java.lang.String webappUrl)
                   throws DocumentBuildException
Checks if a webapp URL represents a document.

Parameters:
webappUrl - A web application URL.
Returns:
A boolean value.
Throws:
DocumentBuildException - if an error occurs.

getSession

Session getSession()
Returns:
The session.

get

Document get(DocumentLocator locator)
             throws DocumentBuildException
Parameters:
locator - The locator.
Returns:
A document.
Throws:
DocumentBuildException - if an error occurs.

getPublication

Publication getPublication(java.lang.String id)
                           throws PublicationException
Parameters:
id - The publication ID.
Returns:
A publication.
Throws:
PublicationException - if the publication does not exist.

getPublications

Publication[] getPublications()
Returns:
All publications.

existsPublication

boolean existsPublication(java.lang.String id)
Parameters:
id - The publication ID.
Returns:
If a publication with this ID exists.


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