org.ibisph.mvc.controller.indicator
Class ChartGraphic

java.lang.Object
  extended by org.ibisph.mvc.controller.AbstractModelAndView
      extended by org.ibisph.mvc.controller.indicator.ChartGraphic
All Implemented Interfaces:
org.springframework.web.servlet.mvc.Controller

public class ChartGraphic
extends AbstractModelAndView

Handles Indicator Profile chart requests. Relies on the base XML data file path, an Indicator Profile XML to Chart Data DAO, and a view name prefix and suffix. The chart view name is built using the chart name specified as part of the request's URI. A property for the chart view name prefix and suffix are used to complete the view name.

Author:
Garth Braithwaite, STG

Field Summary
protected  DAO chartDataDAO
           
protected  java.lang.String viewNamePrefix
           
protected  java.lang.String viewNameSuffix
           
protected  java.lang.String xmlPath
           
 
Fields inherited from class org.ibisph.mvc.controller.AbstractModelAndView
defaultResponseContentType, expiresGMTDateString, forceNoCacheHTTPHeader, view
 
Constructor Summary
ChartGraphic()
           
ChartGraphic(java.lang.String xmlPath, DAO chartDataDAO, java.lang.String viewNamePrefix, java.lang.String viewNameSuffix)
          Constructor which sets the core required properties.
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object> getModelMap(javax.servlet.http.HttpServletRequest request)
          Core method that sets up the IP chart model and returns the view name based on the chart name and the chart prefix and suffix properties.
protected  java.lang.Object getView(javax.servlet.http.HttpServletRequest request)
          Basic getter that returns this object's view object.
 void setChartDataDAO(DAO chartDataDAO)
          Sets the indicator profile Chart XML Data DAO.
 void setViewNamePrefix(java.lang.String viewNamePrefix)
          Sets the chart view name prefix.
 void setViewNameSuffix(java.lang.String viewNameSuffix)
          Sets the chart view name suffix.
 void setXMLPath(java.lang.String xmlPath)
          Sets the indicator profile XML base file path.
 
Methods inherited from class org.ibisph.mvc.controller.AbstractModelAndView
handleRequest, setDefaultResponseContentType, setExpiresHTTPHeader, setHTTPHeaders, setNoCacheHTTPHeader, setNoCacheHTTPHeader, setResponseContentType, setView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlPath

protected java.lang.String xmlPath

chartDataDAO

protected DAO chartDataDAO

viewNamePrefix

protected java.lang.String viewNamePrefix

viewNameSuffix

protected java.lang.String viewNameSuffix
Constructor Detail

ChartGraphic

public ChartGraphic()

ChartGraphic

public ChartGraphic(java.lang.String xmlPath,
                    DAO chartDataDAO,
                    java.lang.String viewNamePrefix,
                    java.lang.String viewNameSuffix)
Constructor which sets the core required properties.

Parameters:
xmlPath - Base XML file path prefix.
chartDataDAO - Standard chart data DAO which understands the Indicator profile XML data and the Chart Data interface.
viewNamePrefix - Prefix for the chart view name. This value is added as a prefix to the chart name to build the actual view name that this controller uses.
viewNameSuffix - Suffix for the chart view name. This value is added to the end of the chart name to build the actual view name that this controller uses.
Method Detail

setXMLPath

public void setXMLPath(java.lang.String xmlPath)
Sets the indicator profile XML base file path.

Parameters:
xmlPath - Base XML file path prefix.

setChartDataDAO

public void setChartDataDAO(DAO chartDataDAO)
Sets the indicator profile Chart XML Data DAO.

Parameters:
chartDataDAO - DAO interface for indicator profile XML data to the Chart Data object.

setViewNamePrefix

public void setViewNamePrefix(java.lang.String viewNamePrefix)
Sets the chart view name prefix. This value is used along with the chart name to build the "View Name" returned to the Spring MVC framework.

Parameters:
viewNamePrefix - Chart view name prefix. Needs to include any "." separation characters and is case sensitive.

setViewNameSuffix

public void setViewNameSuffix(java.lang.String viewNameSuffix)
Sets the chart view name suffix. This value is used along with the chart name to build the "View Name" returned to the Spring MVC framework.

Parameters:
viewNameSuffix - Chart view name suffix. Needs to include any "." separation characters and is case sensitive.

getModelMap

protected java.util.Map<java.lang.String,java.lang.Object> getModelMap(javax.servlet.http.HttpServletRequest request)
                                                                throws java.lang.Exception
Core method that sets up the IP chart model and returns the view name based on the chart name and the chart prefix and suffix properties. This method determines which XML data file to use, loads the data file using the DAO, determines the chart name, and loads any chart HTTP request parameters, then puts it all into the model.

Specified by:
getModelMap in class AbstractModelAndView
Parameters:
request - HTTP Servlet Request passed from the requestHandler.
Returns:
Spring ModelAndView object which contains the chart data as the model and the view name based on the chart name.
Throws:
java.lang.Exception

getView

protected java.lang.Object getView(javax.servlet.http.HttpServletRequest request)
                            throws java.lang.Exception
Basic getter that returns this object's view object.

Overrides:
getView in class AbstractModelAndView
Parameters:
request - HTTP Servlet Request passed from the requestHandler.
Returns:
This objects Spring view object.
Throws:
java.lang.Exception