Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.servlet.url
Class BasePageEncoder

java.lang.Object
  |
  +--oracle.cabo.share.url.ServletURLEncoder
        |
        +--oracle.cabo.servlet.url.BasePageEncoder
All Implemented Interfaces:
PageDecoder, PageEncoder, URLEncoder
Direct Known Subclasses:
DefaultPageEncoder

public abstract class BasePageEncoder
extends ServletURLEncoder
implements PageEncoder, PageDecoder

Root implementation of PageEncoder and PageDecoder.


Constructor Summary
BasePageEncoder(BajaContext context, java.lang.String baseURL)
          Creates a BasePageEncoder.
 
Method Summary
protected  java.lang.String assembleQueryString(java.lang.String eventName, java.util.Dictionary parameters)
          Encodes event parameters into a partial URL
protected  java.lang.String assembleURL(java.lang.String baseURL, java.lang.String pageName, java.lang.String pageProperties, java.lang.String parametersURL)
          Assembles the four parts of a Baja URL into a full URL.
abstract  Page decodePage(java.lang.String page)
          Returns the Page object for an string-encoded page name.
 PageEvent decodePageEvent(java.util.Dictionary parameters)
          Returns the PageEvent object for a list of requested parameters.
 PageEvent decodePageEvent(java.lang.String queryString)
          Returns the PageEvent object for a query string.
protected  PageEvent decodePageEventImpl(java.util.Dictionary parameters)
          Given a Dictionary of parameters (with decoded keys), returns PageEvent (with properly character-set-converted values).
static java.util.Dictionary decodeParameterDictionary(java.util.Dictionary parameters, java.lang.String encoding)
          Modify a Dictionary of parameters to be correctly encoded.
protected  java.util.Dictionary decodeParameters(java.util.Dictionary parameters, java.lang.String encoding)
          Modify a Dictionary of parameters to be correctly encoded.
abstract  Page decodeRequestedPage()
          Returns the Page object for the current servlet request.
 PageEvent decodeRequestedPageEvent()
          Returns the PageEvent object for the current servlet request, or null if there is no event.
 java.lang.String encodeEventURL(java.lang.String eventName, java.util.Dictionary parameters)
          Encodes an event into a full URL.
abstract  java.lang.String encodePage(Page page)
          Encodes a page into part of an URL
 java.lang.String encodePageAndEvent(boolean includeBase, Page page, java.lang.String eventName, java.util.Dictionary parameters)
          Encodes a page and event parameters into an URL
 java.lang.String encodePageAndEvent(java.lang.String baseURL, Page page, java.lang.String eventName, java.util.Dictionary parameters)
          Encodes a page and event parameters into an URL
protected abstract  java.lang.String encodePageProperties(Page page)
          Encodes the properties of a page into part of an URL
 java.lang.String encodePageURL(Page page)
          Encodes a page into a full URL.
 java.lang.String encodeResponsePage()
          Encodes a page into part of an URL
protected  java.lang.String getBaseURL()
          Returns the current context's base URL.
protected  BajaContext getContext()
          Returns the BajaContext used for this encoder.
protected  java.lang.String getDefaultCharacterEncoding(BajaContext context)
           
 java.lang.String getDefaultURL()
           
protected  ErrorLog getErrorLog()
          Returns the ErrorLog used for this encoder.
 java.lang.String getRequestCharacterEncoding()
          Gets the request character encoding, to be used to decode parameters.
 void setRequestCharacterEncoding(java.lang.String encoding)
          Sets the request character encoding, to be used to decode parameters.
 void setResponsePage(Page page)
          Sets the response page; this page will be used to properly implement getDefaultURL().
 
Methods inherited from class oracle.cabo.share.url.ServletURLEncoder
encodeParameter, encodeURL, isURLEncodingEnabled, setURLEncodingEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.cabo.share.url.URLEncoder
encodeParameter, encodeURL
 
Methods inherited from interface oracle.cabo.servlet.url.PageDecoder
encodeParameter
 

Constructor Detail

BasePageEncoder

public BasePageEncoder(BajaContext context,
                       java.lang.String baseURL)
Creates a BasePageEncoder.

Parameters:
context - the current BajaContext.
baseURL - a base URL to use in place of the servlet request. Generally only used if BajaContext is null.
Method Detail

getDefaultURL

public java.lang.String getDefaultURL()
Specified by:
getDefaultURL in interface URLEncoder
Overrides:
getDefaultURL in class ServletURLEncoder
Returns:
this is an URL to the current page. This is useful, for example, in a form submission; if the destination of a form has not been set, this default URL can be used to submit the form back to the page it originated from.

encodePageURL

public final java.lang.String encodePageURL(Page page)
Encodes a page into a full URL. Equivalent to encodePageAndEvent(true, page, null, null).
Specified by:
encodePageURL in interface PageEncoder
Parameters:
page - the Page object to encode

encodePageAndEvent

public final java.lang.String encodePageAndEvent(boolean includeBase,
                                                 Page page,
                                                 java.lang.String eventName,
                                                 java.util.Dictionary parameters)
Encodes a page and event parameters into an URL
Specified by:
encodePageAndEvent in interface PageEncoder
Parameters:
includeBase - if true, prepend the servlet's base URL
page - the Page object to encode
eventName - the name of the event
parameters - a dictionary of keys and values

encodePageAndEvent

public java.lang.String encodePageAndEvent(java.lang.String baseURL,
                                           Page page,
                                           java.lang.String eventName,
                                           java.util.Dictionary parameters)
Encodes a page and event parameters into an URL
Specified by:
encodePageAndEvent in interface PageEncoder
Parameters:
baseURL - the base URL to use; if null, don't prepend anything
page - the Page object to encode
eventName - the name of the event
parameters - a dictionary of keys and values

encodeEventURL

public java.lang.String encodeEventURL(java.lang.String eventName,
                                       java.util.Dictionary parameters)
Encodes an event into a full URL. The URL will be delivered back to the requesting page (perhaps via a controller servlet).
Specified by:
encodeEventURL in interface PageEncoder

encodePage

public abstract java.lang.String encodePage(Page page)
Encodes a page into part of an URL
Specified by:
encodePage in interface PageEncoder
Parameters:
page - the Page object to encode

encodeResponsePage

public java.lang.String encodeResponsePage()
Encodes a page into part of an URL
Specified by:
encodeResponsePage in interface PageEncoder
Parameters:
page - the Page object to encode

setResponsePage

public void setResponsePage(Page page)
Sets the response page; this page will be used to properly implement getDefaultURL().

Specified by:
setResponsePage in interface PageEncoder
See Also:
URLEncoder.getDefaultURL()

decodeRequestedPage

public abstract Page decodeRequestedPage()
Returns the Page object for the current servlet request.
Specified by:
decodeRequestedPage in interface PageDecoder

decodePage

public abstract Page decodePage(java.lang.String page)
Returns the Page object for an string-encoded page name.
Specified by:
decodePage in interface PageDecoder
Parameters:
fullPageName - the encoded page name

decodeRequestedPageEvent

public final PageEvent decodeRequestedPageEvent()
Returns the PageEvent object for the current servlet request, or null if there is no event.
Specified by:
decodeRequestedPageEvent in interface PageDecoder

decodePageEvent

public final PageEvent decodePageEvent(java.util.Dictionary parameters)
Returns the PageEvent object for a list of requested parameters.
Specified by:
decodePageEvent in interface PageDecoder

decodePageEvent

public final PageEvent decodePageEvent(java.lang.String queryString)
Returns the PageEvent object for a query string.
Specified by:
decodePageEvent in interface PageDecoder

getRequestCharacterEncoding

public java.lang.String getRequestCharacterEncoding()
Gets the request character encoding, to be used to decode parameters.
Specified by:
getRequestCharacterEncoding in interface PageDecoder

setRequestCharacterEncoding

public void setRequestCharacterEncoding(java.lang.String encoding)
                                 throws java.io.UnsupportedEncodingException
Sets the request character encoding, to be used to decode parameters.

If set to null, the decoder will not attempt to convert the character set. As a consequence, do not set the encoding away from "null" when using a servlet engine that implements this automatically. (For example, Servlet 2.3 API when ServletRequest.setCharacterEncoding() is called).

Specified by:
setRequestCharacterEncoding in interface PageDecoder

decodeParameterDictionary

public static java.util.Dictionary decodeParameterDictionary(java.util.Dictionary parameters,
                                                             java.lang.String encoding)
                                                      throws java.io.UnsupportedEncodingException
Modify a Dictionary of parameters to be correctly encoded.

encodePageProperties

protected abstract java.lang.String encodePageProperties(Page page)
Encodes the properties of a page into part of an URL
Parameters:
page - the Page object to encode

assembleQueryString

protected java.lang.String assembleQueryString(java.lang.String eventName,
                                               java.util.Dictionary parameters)
Encodes event parameters into a partial URL
Parameters:
parameters - a dictionary of keys and values

decodePageEventImpl

protected PageEvent decodePageEventImpl(java.util.Dictionary parameters)
Given a Dictionary of parameters (with decoded keys), returns PageEvent (with properly character-set-converted values).

assembleURL

protected java.lang.String assembleURL(java.lang.String baseURL,
                                       java.lang.String pageName,
                                       java.lang.String pageProperties,
                                       java.lang.String parametersURL)
Assembles the four parts of a Baja URL into a full URL.
Parameters:
baseURL - the base of the URL, or null to omit. This should include the context and servlet paths.
pageName - the name of the page (or null)
pageProperties - the properties of the page, encoded as a single string (or null)
parametersURL - the event parameters

getBaseURL

protected java.lang.String getBaseURL()
Returns the current context's base URL.

getContext

protected BajaContext getContext()
Returns the BajaContext used for this encoder.

getErrorLog

protected ErrorLog getErrorLog()
Returns the ErrorLog used for this encoder.

getDefaultCharacterEncoding

protected java.lang.String getDefaultCharacterEncoding(BajaContext context)

decodeParameters

protected java.util.Dictionary decodeParameters(java.util.Dictionary parameters,
                                                java.lang.String encoding)
Modify a Dictionary of parameters to be correctly encoded.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.