Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.view.servlet.xml
Class XSLPage  view XSLPage download XSLPage.java

java.lang.Object
  extended byorg.scopemvc.view.servlet.Page
      extended byorg.scopemvc.view.servlet.xml.AbstractXSLPage
          extended byorg.scopemvc.view.servlet.xml.XSLPage
All Implemented Interfaces:
org.scopemvc.core.View

public class XSLPage
extends AbstractXSLPage

A concrete AbstractXSLPage that uses Scope's ModelManager implementations to serialise its entire bound model object to an XML document. A better strategy would be to use a more intelligent view that selectively serialises relevant parts of the model object.

Handles circular references using the "ID" and "IDREF" pattern.

Version:
$Revision: 1.5 $ $Date: 2002/01/26 09:46:20 $

Field Summary
private static org.apache.commons.logging.Log LOG
           
(package private) static char PROPERTY_ID_PREFIX
          The prefix on form parameters to identify a property/value pair used to repopulate the View's bound model.
protected  boolean requiresPropertyDescriptions
          Optional setting for whether the SAX convertor should write all the property "paths" out when this view is streamed.
protected  ModelToXML xmlGenerator
           
 
Fields inherited from class org.scopemvc.view.servlet.xml.AbstractXSLPage
debugXMLDirectory, shouldCacheTemplates, templateCache, xslURI
 
Fields inherited from class org.scopemvc.view.servlet.Page
 
Constructor Summary
XSLPage(java.lang.String inViewID, java.lang.String inXslURI)
           
XSLPage(java.lang.String inViewID, java.lang.String inXslURI, boolean inRequiresModelIds)
           
 
Method Summary
protected  void generateXMLDocument(org.xml.sax.ContentHandler inContentHandler)
          Override to implement model to SAX conversion into the passed ContentHandler.
protected  void init()
          Do it like this so that we can pick up application-specific ScopeConfig...
protected  void populateBoundModelProperty(java.lang.String inPropertyDescription, java.lang.String inValue)
          Use the property_description, property_value pair passed to set a property in the bound model to a new value.
 java.util.List populateModel(java.util.HashMap ioParameters)
           Interprets any form parameters like <PROPERTY_ID_PREFIX>SelectorDescription as [property_description, property_value] pairs
 
Methods inherited from class org.scopemvc.view.servlet.xml.AbstractXSLPage
getContentType, getHTMLOutputProperties, getSystemID, getTransformerHandler, getXMLOutputProperties, getXslURI, makeSerializer, setSystemID, setXslURI, streamView, toString
 
Methods inherited from class org.scopemvc.view.servlet.Page
equalsID, getBoundModel, getController, getID, getParent, issueControl, setBoundModel, setController, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.commons.logging.Log LOG

PROPERTY_ID_PREFIX

static char PROPERTY_ID_PREFIX
The prefix on form parameters to identify a property/value pair used to repopulate the View's bound model. A property/value pair looks like: <PROPERTY_ID_PREFIX>ViewID<VIEW_ID_SUFFIX>SelectorDescription

See Also:
populateModel(java.util.HashMap) 55

requiresPropertyDescriptions

protected boolean requiresPropertyDescriptions
Optional setting for whether the SAX convertor should write all the property "paths" out when this view is streamed. Some views might want this if they send back form parameters like {path}=newValue for automatic repopulation back into the bound model object.


xmlGenerator

protected ModelToXML xmlGenerator
Constructor Detail

XSLPage

public XSLPage(java.lang.String inViewID,
               java.lang.String inXslURI)

XSLPage

public XSLPage(java.lang.String inViewID,
               java.lang.String inXslURI,
               boolean inRequiresModelIds)
Method Detail

init

protected void init()
Do it like this so that we can pick up application-specific ScopeConfig... static initializers would happen before user got a chance to setup the custom config properties.


generateXMLDocument

protected void generateXMLDocument(org.xml.sax.ContentHandler inContentHandler)
                            throws java.lang.Exception
Description copied from class: AbstractXSLPage
Override to implement model to SAX conversion into the passed ContentHandler.

Specified by:
generateXMLDocument in class AbstractXSLPage

populateModel

public java.util.List populateModel(java.util.HashMap ioParameters)

Interprets any form parameters like <PROPERTY_ID_PREFIX>SelectorDescription as [property_description, property_value] pairs

Extracts the property_description from the form parameter key, then populates its model object using the String value. Any parameters treated this way are removed from the HashMap.


populateBoundModelProperty

protected void populateBoundModelProperty(java.lang.String inPropertyDescription,
                                          java.lang.String inValue)
                                   throws java.lang.Exception
Use the property_description, property_value pair passed to set a property in the bound model to a new value. Use StringConvertor if available to convert from String to the property's native datatype.