org.apache.lenya.cms.publication
Class DocumentUtil

java.lang.Object
  extended by org.apache.lenya.cms.publication.DocumentUtil

public final class DocumentUtil
extends java.lang.Object

Document utility class.


Constructor Summary
DocumentUtil()
           
 
Method Summary
static DocumentFactory createDocumentFactory(org.apache.avalon.framework.service.ServiceManager manager, Session session)
          Creates a document factory.
protected static DocumentFactoryBuilder getBuilder(org.apache.avalon.framework.service.ServiceManager manager)
           
static Document getCurrentDocument(org.apache.avalon.framework.service.ServiceManager manager, org.apache.cocoon.environment.Request request)
          Returns the currently requested document or null if no document is requested.
static DocumentFactory getDocumentFactory(org.apache.avalon.framework.service.ServiceManager manager, org.apache.cocoon.environment.Request request)
          Returns a document factory for the session which is attached to the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentUtil

public DocumentUtil()
Method Detail

createDocumentFactory

public static final DocumentFactory createDocumentFactory(org.apache.avalon.framework.service.ServiceManager manager,
                                                          Session session)
Creates a document factory.

Parameters:
manager - The service manager.
session - The session.
Returns:
a document factory.

getBuilder

protected static DocumentFactoryBuilder getBuilder(org.apache.avalon.framework.service.ServiceManager manager)

getDocumentFactory

public static DocumentFactory getDocumentFactory(org.apache.avalon.framework.service.ServiceManager manager,
                                                 org.apache.cocoon.environment.Request request)
Returns a document factory for the session which is attached to the request. If no session exists, it is created.

Parameters:
manager - The service manager.
request - The request.
Returns:
A document factory.

getCurrentDocument

public static Document getCurrentDocument(org.apache.avalon.framework.service.ServiceManager manager,
                                          org.apache.cocoon.environment.Request request)
                                   throws RepositoryException,
                                          DocumentBuildException
Returns the currently requested document or null if no document is requested.

Parameters:
manager - The service manager.
request - The request.
Returns:
A document.
Throws:
RepositoryException - if an error occurs.
DocumentBuildException - if an error occurs.


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