|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ibisph.mvc.model.QueryModule
public class QueryModule
Handles Query System's module requests. This controller first needs to get/build/process the xincludes for the module XML. The document is then set into the session for further requests and the document is returned for the view operation.
| Field Summary | |
|---|---|
protected java.lang.String |
columnGroupByParameterName
|
protected org.dom4j.Document |
document
|
protected java.io.File |
file
|
protected java.lang.String |
otherGroupByParameterName
|
protected java.util.Map<java.lang.String,java.lang.String> |
parametersMap
|
protected java.lang.String |
rowGroupByParameterName
|
| Constructor Summary | |
|---|---|
QueryModule(org.dom4j.Document document,
java.lang.String configurationPath,
java.lang.String configurationName,
long serialNumber)
Constructor that sets the XML document. |
|
| Method Summary | |
|---|---|
protected void |
addQueryURLParameter(java.lang.String name,
java.lang.String value,
java.lang.String urlCharacterEncoding,
java.lang.String controlParameterPrefix,
java.lang.StringBuffer queryURLParameters)
Helper that localizes encoding the PARAMETER elements. |
protected void |
addQueryURLParameters(java.lang.String urlCharacterEncoding,
java.lang.String rootRelativeParametersXpath,
java.lang.String controlParameterPrefix,
java.lang.StringBuffer queryURLParameters)
Helper that localizes looping the PARAMETER elements. |
void |
deleteQueryResult()
|
void |
deleteRequestError()
Deletes any existing REQUEST/ERROR element. |
java.lang.String |
getBaseQueryApplicationURL()
Simple access to the CONFIGURATION/BASE_QUERY_APPLICATION_URL element. |
java.lang.String |
getConfigurationPath()
Simple access to the REQUEST/CONFIGURATION_PATH element. |
org.dom4j.Document |
getDocument()
Basic getter used to access the query module XML document. |
java.io.File |
getFile()
Gets the query module's XML file (base/core file in the case of xinclude). |
java.lang.String |
getGraphicName()
|
java.lang.String |
getQueryURLParameters(java.lang.String urlCharacterEncoding,
java.lang.String controlParameterPrefix)
Localizes appending of encoded NAME and VALUE elements to StringBuffer. |
java.lang.String |
getRequestStartedDateTimeStamp()
Gets the formatted date time stamp string for when the request was started. |
protected java.lang.String |
getResultGroupByDimensionName(java.util.HashSet resultDimensionNames,
java.lang.String dimensionElementNameToMatch)
Helper that sets the actual dimension name element into the document based on the dimensionElementNameToMatch string passed in. |
boolean |
hasQueryResponse()
Performs a simple existence test of the REQUEST/IBISQ_QUERY_RESULT element or the the REQUEST/ERROR element. |
void |
setCompleteQueryURL(java.lang.String url)
Sets the URL used to query the data. |
void |
setFile(java.io.File queryModuleFile)
Sets the module's XML file. |
void |
setGraphicName(java.lang.String graphicName)
|
void |
setHiddenInputParameters(javax.servlet.http.HttpServletRequest request)
Sets any PARAMETER elements which have a HIDDEN_INPUT_FLAG which has a name that matches a request's parameter name. |
void |
setMeasureName(java.lang.String measureName)
|
void |
setQueryResult(java.lang.String queryResult)
Parses the query result string and puts into the query module XML document object. |
void |
setRequestError(java.lang.String title,
java.lang.String description)
|
void |
setRequestError(java.lang.String title,
java.lang.String description,
java.lang.String response)
Creates a new REQUEST/ERROR element and adds the appropriate elements and sets those elements with the supplied values. |
void |
setRequestFinishedDateTimeStamp(java.lang.String formattedDateTimeStamp)
Sets the formatted date time stamp string which the view can show on the result page. |
void |
setRequestStartedDateTimeStamp(java.lang.String formattedDateTimeStamp)
Sets the formatted date time stamp string for when the request was started. |
void |
setRequestSubmittedDateTimeStamp(java.lang.String formattedDateTimeStamp)
Sets the formatted date time stamp string which the view can show on the result page. |
void |
setResultGroupByDimensionNames()
Parses the query result string and puts into the query module XML document object. |
void |
setSelectedControls(javax.servlet.http.HttpServletRequest request)
Sets the request selected groupby dim names, graphic, and measure elements. |
void |
setSelectedDimensions(javax.servlet.http.HttpServletRequest request)
Main worker method that loads the request parameters into the approp Query Module XML document SELECTED_DIMENSION element structure. |
protected void |
setSelectedGroupByDimensionName(javax.servlet.http.HttpServletRequest request,
java.lang.String groupByParameterName,
java.lang.String groupByElementName)
Helper that localizes getting the GroupByDimensionName type request parameters and setting the associated REQUEST/GROUP_BY element. |
protected void |
setSelectedGroupByDimensionNames(javax.servlet.http.HttpServletRequest request)
Helper that sets the REQUEST/SELECTED_GROUP_BY elements. |
protected void |
updateHiddenInputParameters(java.lang.String rootRelativeParametersXpath,
javax.servlet.http.HttpServletRequest request)
Helper that localizes setting PARAMETER HIDDEN_INPUT_FLAG elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String rowGroupByParameterName
protected java.lang.String columnGroupByParameterName
protected java.lang.String otherGroupByParameterName
protected org.dom4j.Document document
protected java.io.File file
protected java.util.Map<java.lang.String,java.lang.String> parametersMap
| Constructor Detail |
|---|
public QueryModule(org.dom4j.Document document,
java.lang.String configurationPath,
java.lang.String configurationName,
long serialNumber)
document - Core XML Document which contains the Query Module XML elements.configurationPath - Path of the module configuration (module path,
core filename, configuration name sans extension like ".html".
This value is used by the XSLT as the basis for the result and
builder URLs.configurationName - Name of the selected configuration.serialNumber - unique value that is not required but may be useful
for debugging system problems as this value is simply the count of
loaded modules.| Method Detail |
|---|
public org.dom4j.Document getDocument()
public java.io.File getFile()
public java.lang.String getConfigurationPath()
public java.lang.String getBaseQueryApplicationURL()
public java.lang.String getGraphicName()
public boolean hasQueryResponse()
public void setFile(java.io.File queryModuleFile)
queryModuleFile - base Query Module XML file.public void setMeasureName(java.lang.String measureName)
public void setGraphicName(java.lang.String graphicName)
public void setSelectedDimensions(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
request - contains the submitted parameters to be added.
java.lang.Exceptionpublic void setHiddenInputParameters(javax.servlet.http.HttpServletRequest request)
request - contains the submitted parameter values.
protected void updateHiddenInputParameters(java.lang.String rootRelativeParametersXpath,
javax.servlet.http.HttpServletRequest request)
rootRelativeParametersXpath - xpath statement for the PARAMTERS
element to process.request - contains the submitted parameter values.public void setSelectedControls(javax.servlet.http.HttpServletRequest request)
request - optional HTTP request. If not supplied then gets default
values from the CONFIGURATION and root elements.protected void setSelectedGroupByDimensionNames(javax.servlet.http.HttpServletRequest request)
request - optional HTTP request. If not supplied then gets default
values from the CONFIGURATION and root elements.
protected void setSelectedGroupByDimensionName(javax.servlet.http.HttpServletRequest request,
java.lang.String groupByParameterName,
java.lang.String groupByElementName)
request - optional HTTP request to get submitted parameter values from.groupByParameterName - HTTP request parameter name and PARAMETER/NAME
value to be used to search for.groupByElementName - Element name used to store the found groupby value.
public java.lang.String getQueryURLParameters(java.lang.String urlCharacterEncoding,
java.lang.String controlParameterPrefix)
urlCharacterEncoding - encoding to use for the query url parameters.
If null, then no encoding is performed.controlParameterPrefix - Prefix that defines which parameters are to
NOT be included.
protected void addQueryURLParameters(java.lang.String urlCharacterEncoding,
java.lang.String rootRelativeParametersXpath,
java.lang.String controlParameterPrefix,
java.lang.StringBuffer queryURLParameters)
urlCharacterEncoding - encoding to use for the query url parameters.
If null, then no encoding is performed.rootRelativeParametersXpath - xpath statement for the PARAMTERS
element to process.queryURLParameters - StringBuffer to append the paramters to.controlParameterPrefix - Prefix that defines which parameters are to
NOT be included.
protected void addQueryURLParameter(java.lang.String name,
java.lang.String value,
java.lang.String urlCharacterEncoding,
java.lang.String controlParameterPrefix,
java.lang.StringBuffer queryURLParameters)
name - parameter name.value - parameter value.urlCharacterEncoding - encoding to use for the query url parameters.
If null, then no encoding is performed.controlParameterPrefix - Prefix that defines which parameters are to
NOT be included.queryURLParameters - StringBuffer to append the paramters to.public void setCompleteQueryURL(java.lang.String url)
url - complete, optionally encoded, URL that contains all parameters.public java.lang.String getRequestStartedDateTimeStamp()
public void setRequestStartedDateTimeStamp(java.lang.String formattedDateTimeStamp)
formattedDateTimeStamp - Date time stamp when the request was started.public void setRequestSubmittedDateTimeStamp(java.lang.String formattedDateTimeStamp)
formattedDateTimeStamp - Date time stamp when the query was submitted
to the backend query app.public void setRequestFinishedDateTimeStamp(java.lang.String formattedDateTimeStamp)
formattedDateTimeStamp - Date time stamp when the query result was
received from the backend query app.
public void setRequestError(java.lang.String title,
java.lang.String description,
java.lang.String response)
title - Short description of the problem.description - Long detailed description of the error. May include the
exception message etc.response - result text/XML streamed back. Typically set by the
controller when invalid XML is returned from query request.
public void setRequestError(java.lang.String title,
java.lang.String description)
public void deleteRequestError()
public void setQueryResult(java.lang.String queryResult)
throws org.dom4j.DocumentException
queryResult - String of XML to be added to the query result document.
org.dom4j.DocumentException - according to XML being parsed.public void deleteQueryResult()
public void setResultGroupByDimensionNames()
throws java.lang.Exception
java.lang.Exception
protected java.lang.String getResultGroupByDimensionName(java.util.HashSet resultDimensionNames,
java.lang.String dimensionElementNameToMatch)
throws java.lang.Exception
resultDimensionNames - actual query result dimensions.dimensionElementNameToMatch - dimension element name to be added to
the parent xpath and looked up.
java.lang.Exception - if a dimension element name is found and nothing matches.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||