org.ibisph.mvc.controller.query
Class Result

java.lang.Object
  extended by org.ibisph.mvc.controller.AbstractModelAndView
      extended by org.ibisph.mvc.controller.XMLModelAndDate
          extended by org.ibisph.mvc.controller.query.AbstractQueryModule
              extended by org.ibisph.mvc.controller.query.Result
All Implemented Interfaces:
org.springframework.web.servlet.mvc.Controller

public class Result
extends AbstractQueryModule

Controller that handles the Query System's result requests. This controller handles:

  1. Processing a submiited/posted builder page (criteria).
  2. Processing a query result using the defaults.
  3. Building a query URL and processing the result.
  4. Adjusting the result parameters like measure, graphic, etc.

Author:
Garth Braithwaite, STG

Field Summary
protected  java.lang.String controlParameterPrefix
           
protected  java.lang.String password
           
protected  java.lang.String queryApplicationURL
           
protected  java.text.DateFormat queryDateFormat
           
protected  java.lang.String urlCharacterEncoding
           
protected  java.lang.String username
           
 
Fields inherited from class org.ibisph.mvc.controller.query.AbstractQueryModule
configurationNameParameterName, documentDAO, pathPrefixToRemove, queryModuleSessionName, reloadRequestParameterName, xmlPath
 
Fields inherited from class org.ibisph.mvc.controller.XMLModelAndDate
defaultXMLModelAndDate, defaultXMLSystemID, errorView, extraParameters, includeRequestParameters, parametersMapModelName, webAppURLContextPrefixParameterName, xmlDateFormat, xmlDateParameterName, xmlModelName
 
Fields inherited from class org.ibisph.mvc.controller.AbstractModelAndView
defaultResponseContentType, expiresGMTDateString, forceNoCacheHTTPHeader, view
 
Constructor Summary
Result()
           
 
Method Summary
protected  XMLModelAndDate getXMLModelAndDate(javax.servlet.http.HttpServletRequest request)
          Required method which gets the existing Query Module object from the user's session or loads a new one if doesn't exist or is not the current selection.
 void setControlParameterPrefix(java.lang.String controlParameterPrefix)
          Sets the character prefix for PARAMETER elements and submitted request parameters which are local to the view system and which are not/should not be submitted to the backend query app.
 void setPassword(java.lang.String password)
           
 void setQueryApplicationURL(java.lang.String queryApplicationURL)
           
 void setQueryDateFormat(java.text.DateFormat dateFormat)
          Used when setting the date values.
 void setURLCharacterEncoding(java.lang.String urlCharacterEncoding)
          Sets the character encoding type to be used when building the query app URL.
 void setUsername(java.lang.String username)
           
 
Methods inherited from class org.ibisph.mvc.controller.query.AbstractQueryModule
getQueryModule, setConfigurationNameParameterName, setDocumentDAO, setPathPrefixToRemove, setQueryModuleSessionName, setReloadRequestParameterName, setXMLPath
 
Methods inherited from class org.ibisph.mvc.controller.XMLModelAndDate
getModelMap, setDefaultXMLSystemID, setErrorView, setExtraParameters, setIncludeRequestParameters, setParametersMapModelName, setWebAppURLContextPrefixParameterName, setXMLDateFormat, setXMLDateParameterName, setXMLModelName
 
Methods inherited from class org.ibisph.mvc.controller.AbstractModelAndView
getView, 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

queryApplicationURL

protected java.lang.String queryApplicationURL

username

protected java.lang.String username

password

protected java.lang.String password

urlCharacterEncoding

protected java.lang.String urlCharacterEncoding

controlParameterPrefix

protected java.lang.String controlParameterPrefix

queryDateFormat

protected java.text.DateFormat queryDateFormat
Constructor Detail

Result

public Result()
Method Detail

setURLCharacterEncoding

public void setURLCharacterEncoding(java.lang.String urlCharacterEncoding)
Sets the character encoding type to be used when building the query app URL.

Parameters:
urlCharacterEncoding - standard ISO/UTF type string (default=UTF-8).

setQueryApplicationURL

public void setQueryApplicationURL(java.lang.String queryApplicationURL)

setUsername

public void setUsername(java.lang.String username)

setPassword

public void setPassword(java.lang.String password)

setQueryDateFormat

public void setQueryDateFormat(java.text.DateFormat dateFormat)
Used when setting the date values. XSLT can't deal with date type values so formatting has to be done within the Java code.

Parameters:
dateFormat - DateFormat object that contains the formatting rules.

setControlParameterPrefix

public void setControlParameterPrefix(java.lang.String controlParameterPrefix)
Sets the character prefix for PARAMETER elements and submitted request parameters which are local to the view system and which are not/should not be submitted to the backend query app.

Parameters:
controlParameterPrefix - Prefix character string signature of the View application specific control parameters (default="_").

getXMLModelAndDate

protected XMLModelAndDate getXMLModelAndDate(javax.servlet.http.HttpServletRequest request)
                                      throws java.lang.Exception
Required method which gets the existing Query Module object from the user's session or loads a new one if doesn't exist or is not the current selection. Once a query module object is obtained, this method handles parsing submitted/posted query builder page requests, direct result requests, submitting the query, and changing control values like the measure and chart name values. The view is responsible for recognizing what to display and if the page needs a redirect. Both of these items are determined by whether a QUERY_RESULT element is present. If present then display the data. If not then display the please wait and do a Result get. The controller will then inspect the user's query module object from their session and will invoke the approp business rules.

Overrides:
getXMLModelAndDate in class AbstractQueryModule
Parameters:
request - Provides access to the HTTP request which the XML System ID is typically retrieved from.
Returns:
XMLModelAndDate structure which contains the Query Module document and the file's modified date.
Throws:
java.lang.Exception