uk.co.lakesidetech.springxmldb.spring.web.tiles
Class AbstractXMLDBTilesComponent

java.lang.Object
  extended byorg.apache.struts.tiles.ControllerSupport
      extended byorg.springframework.web.servlet.view.tiles.ComponentControllerSupport
          extended byuk.co.lakesidetech.springxmldb.spring.web.tiles.AbstractXMLDBTilesComponent
All Implemented Interfaces:
org.apache.struts.tiles.Controller
Direct Known Subclasses:
FileXQueryTilesComponent, SimpleXPathXMLDBTilesComponent, SimpleXQueryXMLDBTilesComponent, XMLResourceRequestParamXMLDBTilesComponent, XMLResourceXMLDBTilesComponent, XPathAttributesSubTilesComponent, XPathRequestParamSubTilesComponent, XQueryAttributesTilesComponent, XQueryRequestParametersTilesComponent

public abstract class AbstractXMLDBTilesComponent
extends org.springframework.web.servlet.view.tiles.ComponentControllerSupport

The AbstractXMLDBTilesComponent is used as a base class for all the XML database accessing tiles components. Essentially it resolves the XML database facade from the application context the relies on the concrete class to use this to return XML results.

Author:
Stuart Eccles

Field Summary
protected  IXMLDBFacade facade
           
protected static java.lang.String TILES_ATTRIBUTE_COLLECTION
           
protected static java.lang.String TILES_ATTRIBUTE_NORESULTS
           
protected static java.lang.String TILES_ATTRIBUTE_XPATH
           
protected static java.lang.String TILES_ATTRIBUTE_XQUERY
           
static java.lang.String XMLQUERY_RESULTS_REQUEST_ATTRIBUTE
           
 
Constructor Summary
AbstractXMLDBTilesComponent()
           
 
Method Summary
protected  void doPerform(org.apache.struts.tiles.ComponentContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          perform the tiles action
 IXMLDBFacade getFacade()
           
protected abstract  org.w3c.dom.Node performForXML(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.Map attributes)
          implementing method for a tiles component to retrive XML from the xml database
 
Methods inherited from class org.springframework.web.servlet.view.tiles.ComponentControllerSupport
execute, getApplicationContext, getMessageSourceAccessor, getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, perform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TILES_ATTRIBUTE_NORESULTS

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

TILES_ATTRIBUTE_COLLECTION

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

TILES_ATTRIBUTE_XQUERY

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

TILES_ATTRIBUTE_XPATH

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

XMLQUERY_RESULTS_REQUEST_ATTRIBUTE

public static final java.lang.String XMLQUERY_RESULTS_REQUEST_ATTRIBUTE
See Also:
Constant Field Values

facade

protected IXMLDBFacade facade
Constructor Detail

AbstractXMLDBTilesComponent

public AbstractXMLDBTilesComponent()
Method Detail

getFacade

public IXMLDBFacade getFacade()
Returns:
Returns the facade.

doPerform

protected void doPerform(org.apache.struts.tiles.ComponentContext context,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.lang.Exception
perform the tiles action

Throws:
java.lang.Exception

performForXML

protected abstract org.w3c.dom.Node performForXML(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  java.util.Map attributes)
                                           throws java.lang.Exception
implementing method for a tiles component to retrive XML from the xml database

Parameters:
request - The HttpServletRequest
response - The HttpServletResponse
attributes - a map of attributes set by the tiles context
Returns:
A map result of xml results with resource id and result of query
Throws:
java.lang.Exception - on anything going wrong