Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.thin.servlet
Class ServletQueryParameterProvider

java.lang.Object
  |
  +--oracle.dss.thin.servlet.ServletQueryParameterProvider
All Implemented Interfaces:
ErrorHandlerCallback, QueryParameterProvider

public class ServletQueryParameterProvider
extends java.lang.Object
implements QueryParameterProvider, ErrorHandlerCallback

Default implementation of a QueryParameterProvider.


Constructor Summary
ServletQueryParameterProvider(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Constructor that creates a ServletQueryParameterProvider that uses the Servlet API's default character encoding ( ISO-8859-1 ).
ServletQueryParameterProvider(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, oracle.cabo.share.url.URLEncoder encoder, java.lang.String characterEncoding)
          Constructor that creates a ServletQueryParameterProvider that uses a custom character encoding.

 

Method Summary
 void addErrorHandler(ErrorHandler eh)
          Adds a single error handler to the bean.
 java.lang.String getApplicationQueryParameter(java.lang.String name)
           Returns an application query parameter value from the current request's URL.
 java.lang.String[] getApplicationQueryParameterValues(java.lang.String name)
           Returns an application query parameter's values from the current request's URL.
 java.lang.Object getAttributeValue(java.lang.String name)
          Retrieve an attribute by name.
 java.lang.String getCharacterEncoding()
          Retrieve the character encoding
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Retrieve the current HttpServletRequest.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          Retrieve the current HttpServletResponse
 java.lang.String getQueryParameter(java.lang.String name)
           Returns a query parameter value from the current request's URL.
 java.lang.String[] getQueryParameterValues(java.lang.String name)
           Returns a query parameter's values from the current request's URL.
 oracle.cabo.share.url.URLEncoder getURLEncoder()
          Retrieve the URLEncoder for this QueryParameterProvider
 void removeErrorHandler()
          Removes the error handler from the bean.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ServletQueryParameterProvider

public ServletQueryParameterProvider(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
Constructor that creates a ServletQueryParameterProvider that uses the Servlet API's default character encoding ( ISO-8859-1 ). The Servlet API builds Strings for all submitted data as if they were ISO-8859-1 encoded, which supports latin-based character sets.

In addition, since no URLEncoder is used, query parameter names are not transformed to alternate names.

Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse

ServletQueryParameterProvider

public ServletQueryParameterProvider(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     oracle.cabo.share.url.URLEncoder encoder,
                                     java.lang.String characterEncoding)
Constructor that creates a ServletQueryParameterProvider that uses a custom character encoding. The character encoding that is specified needs to match the character encoding of the HTML page that generated this request.

If a URLEncoder is passed in, then it is used to transform query parameter names. The URLEncoder that is passed in should match the URLEncoder that is set on the RenderingContext that was used to generate the HTML page that generated this request.

Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse
characterEncoding - the character encoding that is used to decode request parameter values. A null value specifies no character encoding.
encoder - the URLEncoder that is used to transform query parameter names. A null value specifies no URLEncoder
Method Detail

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
Retrieve an attribute by name. Thin bean event handlers use this method to fetch application supplied attributes. One example of an application supplied attribute is BIConstants.BICONTEXT_ATTR, which is used to pass the BI Beans Catalog context to a dataview's BIConstants.SAVE_EVENT event handler.

The base implementation of this method retrieves values from an existing HttpSession that is accessed via the HttpServletRequest. If an application does not have access to a HttpServletRequest or if an application does not have an HttpSession, then this method should be overridden to fetch application attributes from an application defined attribute store.

Specified by:
getAttributeValue in interface QueryParameterProvider
Returns:
the requested attribute

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Retrieve the current HttpServletRequest. The HttpServletRequest is not used by thin bean event handlers, but it can be used by an application event handler if so desired. Therefore, this method can return null, if an application does not have access to or require an HttpServletRequest in their event handlers.
Specified by:
getHttpServletRequest in interface QueryParameterProvider
Returns:
the current HttpServletRequest

getHttpServletResponse

public javax.servlet.http.HttpServletResponse getHttpServletResponse()
Retrieve the current HttpServletResponse
Specified by:
getHttpServletResponse in interface QueryParameterProvider
Returns:
the current HttpServletResponse

getURLEncoder

public oracle.cabo.share.url.URLEncoder getURLEncoder()
Retrieve the URLEncoder for this QueryParameterProvider
Returns:
the URLEncoder

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Retrieve the character encoding
Specified by:
getCharacterEncoding in interface QueryParameterProvider
Returns:
the character encoding

getQueryParameter

public java.lang.String getQueryParameter(java.lang.String name)

Returns a query parameter value from the current request's URL. If the implementation of QueryParameterProvider has an HTTPServletRequest, then the query parameters can be fetched from the request using the getQueryParameter() method on the HTTPServletRequest.

It is the responsibility of the QueryParameterProvider to "encode"/transform the query parameter name using UIX's oracle.cabo.share.url.URLEncoder class before trying to fetch the query parameter from the HTTPServletRequest. The URLEncoder is used to isolate ThinBeanUI event parameter names from application query parameter names.

Note : Applications should use the getApplicationQueryParameter() method to retrieve application query parameters that were added to events via hidden form fields or EventTargets. This is due to the fact that application query parameters do not have their names encoded using a URLEncoder.

It is also the responsibility of the QueryParameterProvider to decode all query parameter values using the correct character set encoding. We recommend using the static oracle.cabo.share.util.CaboHttpUtils.decodeRequestParameter() method provided by to decode values.

Specified by:
getQueryParameter in interface QueryParameterProvider
Parameters:
name - the query parameter name
Returns:
if found, the query parameter value, if not found, then null

getQueryParameterValues

public java.lang.String[] getQueryParameterValues(java.lang.String name)

Returns a query parameter's values from the current request's URL. If the implementation of QueryParameterProvider has an HTTPServletRequest, then the query parameters can be fetched from the request using the getQueryParameterValues() method on the HTTPServletRequest.

It is the responsibility of the QueryParameterProvider to "encode"/transform the query parameter name using UIX's oracle.cabo.share.url.URLEncoder class before trying to fetch the query parameter from the HTTPServletRequest. The URLEncoder is used to isolate ThinBeanUI event parameter names from application query parameter names.

Note : Applications should use the getApplicationQueryParameter() method to retrieve application query parameters that were added to events via hidden form fields or EventTargets. This is due to the fact that application query parameters do not have their names encoded using a URLEncoder.

It is also the responsibility of the QueryParameterProvider to decode all query parameter values using the correct character set encoding. We recommend using the static oracle.cabo.share.util.CaboHttpUtils.decodeRequestParameter() method provided by to decode values.

Specified by:
getQueryParameterValues in interface QueryParameterProvider
Parameters:
name - the query parameter name
Returns:
if found, the query parameter values, if not found, then null

getApplicationQueryParameter

public java.lang.String getApplicationQueryParameter(java.lang.String name)

Returns an application query parameter value from the current request's URL. If the implementation of QueryParameterProvider has an HTTPServletRequest, then the query parameters can be fetched from the request using the getQueryParameter() method on the HTTPServletRequest.

Note : Applications should use this method to retrieve application query parameters that were added to events via hidden form fields or EventTargets.

It is also the responsibility of the QueryParameterProvider to decode all query parameter values using the correct character set encoding. We recommend using the static oracle.cabo.share.util.CaboHttpUtils.decodeRequestParameter() method provided by to decode values.

Specified by:
getApplicationQueryParameter in interface QueryParameterProvider
Parameters:
name - the query parameter name
Returns:
if found, the query parameter value, if not found, then null

getApplicationQueryParameterValues

public java.lang.String[] getApplicationQueryParameterValues(java.lang.String name)

Returns an application query parameter's values from the current request's URL. If the implementation of QueryParameterProvider has an HTTPServletRequest, then the query parameters can be fetched from the request using the getQueryParameter() method on the HTTPServletRequest.

Note : Applications should use this method to retrieve application query parameters that were added to events via hidden form fields or EventTargets.

It is also the responsibility of the QueryParameterProvider to decode all query parameter values using the correct character set encoding. We recommend using the static oracle.cabo.share.util.CaboHttpUtils.decodeRequestParameter() method provided by to decode values.

Specified by:
getApplicationQueryParameterValues in interface QueryParameterProvider
Parameters:
name - the query parameter name
Returns:
if found, the query parameter values, if not found, then null

addErrorHandler

public void addErrorHandler(ErrorHandler eh)
Adds a single error handler to the bean. The bean then calls the error handler with error messages, messages about abnormal situations, and trace messages.
Specified by:
addErrorHandler in interface ErrorHandlerCallback
Parameters:
eh - The error handler to add.

removeErrorHandler

public void removeErrorHandler()
Removes the error handler from the bean.
Specified by:
removeErrorHandler in interface ErrorHandlerCallback

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.