org.infohazard.maverick.view
Class DocumentViewFactory

java.lang.Object
  |
  +--org.infohazard.maverick.view.DocumentViewFactory
All Implemented Interfaces:
ViewFactory

public class DocumentViewFactory
extends java.lang.Object
implements ViewFactory

Factory for building JSP, Velocity, and other views which place the model bean in one of the servlet attribute collections and use the RequestDispatcher to forward to the actual content. This is also used for static documents.

This factory has certain options which can be defined when declaring the factory. The defaults are shown here:

 <view-factory type="document" provider="org.infohazard.maverick.view.DocumentViewFactory">
   <default-bean-name value="model"/>
 </view-factory>
 

The options for an individual view are like this:

 <view type="document" path="blah.jsp" scope="request" bean="model"/>
 

Scope can be one of request, session, application. The default is request.

The default model name is specified on the factory, or "model" if nothing is defined.

Document views can have transforms by specifying a "transform" child element.


Field Summary
protected static java.lang.String ATTR_BEAN_NAME
          For the actual view nodes
protected static java.lang.String ATTR_DEFAULT_BEAN_NAME
          For the factory configuration
protected static java.lang.String ATTR_SCOPE
           
protected static java.lang.String DEFAULT_DEFAULT_BEAN_NAME
           
protected  java.lang.String defaultBeanName
           
protected  DispatchedViewFactory dispatchedViewFact
           
protected static java.lang.String SCOPE_APP
           
protected static java.lang.String SCOPE_REQUEST
           
protected static java.lang.String SCOPE_SESSION
           
 
Constructor Summary
DocumentViewFactory()
           
 
Method Summary
 View createView(org.jdom.Element viewNode)
          Creates a specific instance of the View from the XML element in the maverick configuration file.
 void init(org.jdom.Element factoryNode, javax.servlet.ServletConfig servletCfg)
          The factory will be initialized with the XML element from from the maverick configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DEFAULT_BEAN_NAME

protected static final java.lang.String DEFAULT_DEFAULT_BEAN_NAME
See Also:
Constant Field Values

ATTR_DEFAULT_BEAN_NAME

protected static final java.lang.String ATTR_DEFAULT_BEAN_NAME
For the factory configuration

See Also:
Constant Field Values

ATTR_BEAN_NAME

protected static final java.lang.String ATTR_BEAN_NAME
For the actual view nodes

See Also:
Constant Field Values

ATTR_SCOPE

protected static final java.lang.String ATTR_SCOPE
See Also:
Constant Field Values

SCOPE_APP

protected static final java.lang.String SCOPE_APP
See Also:
Constant Field Values

SCOPE_SESSION

protected static final java.lang.String SCOPE_SESSION
See Also:
Constant Field Values

SCOPE_REQUEST

protected static final java.lang.String SCOPE_REQUEST
See Also:
Constant Field Values

dispatchedViewFact

protected DispatchedViewFactory dispatchedViewFact

defaultBeanName

protected java.lang.String defaultBeanName
Constructor Detail

DocumentViewFactory

public DocumentViewFactory()
Method Detail

init

public void init(org.jdom.Element factoryNode,
                 javax.servlet.ServletConfig servletCfg)
          throws ConfigException
Description copied from interface: ViewFactory
The factory will be initialized with the XML element from from the maverick configuration file.

Specified by:
init in interface ViewFactory
ConfigException

createView

public View createView(org.jdom.Element viewNode)
                throws ConfigException
Description copied from interface: ViewFactory
Creates a specific instance of the View from the XML element in the maverick configuration file.

Specified by:
createView in interface ViewFactory
ConfigException