com.sapportals.htmlb.rendering

Class PageContext

java.lang.Object
  extended bycom.sapportals.htmlb.rendering.PageContext
All Implemented Interfaces:
IPageContext

public class PageContext
extends Object
implements IPageContext

Copyright 2004 SAP AG


Nested Class Summary
protected  class PageContext.UnbufferedWriter
          Set the has content padding of the tray
 
Field Summary
protected  Document document
           
protected  MobileWmlCard hiddenCard
           
protected  HashMap newParamList
           
protected  HashMap oldParamList
           
protected  Hashtable parametersMultiPart
           
 
Fields inherited from interface com.sapportals.htmlb.rendering.IPageContext
HTMLB_ACTIONURL, HTMLB_HASCONTENTPADDING, HTMLB_JSPATH, HTMLB_LOCALE, HTMLB_MIMEPATH, HTMLB_RELAXDOMAIN, HTMLB_SEC508, HTMLB_STYLEPATH, HTMLB_TRAYDESIGN
 
Constructor Summary
PageContext(Object request, Object response)
           
 
Method Summary
 void addPerfCounter(String line)
          adds performance counters written a comments in the HTML source
protected  String attemptUTF8Encoding(String value)
          add the java script
protected  void checkForCurrentEvent()
           
protected  void checkFormElements()
           
 void cleanUp()
          deletes temporary file of mime multipart postings.
 Document createDocument(String title)
          create a new document.
 Form createForm()
          create a new form.
 Form createFormDocument(String title)
          create a new document and automatically create a form.
protected  void detectUserAgent(HttpServletRequest httpServletRequest)
           
 void endDocument()
          end the generated output.
 void endDocumentBody()
          end the body section of the generated output.
 void endDocumentHead()
          close the head section of the produced HTML.
 void flush()
           
 String getActionUrl()
          get the local or absolute URL path where the form should be posted if not already set
 Object getAttribute(String key)
          get an attribute from the current session
 BrowserType getBrowserId()
          get the BrowserType for the recognized browser/user agent
 ClassLoader getClassLoader()
          Get the class loader assigned to this context.
 ClientInfo getClientInfo()
           
 Component getComponentForId(String elementId)
          returns a reconstructed component for a given id.
 String getComponentIdForLabel(String id)
           
 Component[] getComponents()
          returns all the components that were rebuild
 Event getCurrentEvent()
          return the event from the current request.
 Form getCurrentForm()
          get the current form
 String getCurrentFormId()
          get the ID of the current form (HTML!!!)
 AbstractDataType getDataForComponentId(String elementId)
          get the user input for a given id.
 AbstractDataType getDataForComponentId(String tableId, String elementId, int row)
          get the user input for a given id.
 String getDevice()
           
 Document getDocument()
          gets the current document
 boolean getDomainRelaxation()
          Get the flag for domain relaxation.
 IFileParam getFileParam(String name)
           
 boolean getHasAdvancedAlignment()
           
 MobileWmlCard getHiddenCard()
           
 HttpServletRequest getHttpServletRequest()
           
 HttpServletResponse getHttpServletResponse()
           
 boolean getIs508()
           
 boolean getIsRTL()
           
 String getJavascriptPath()
          get the URL path where the Javascript library files can be found.
 String getJavascriptUrl()
          get the full URL for the JavaScript library file for the current user agent.
 Locale getLocale()
          Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.
 Enumeration getLocales()
          Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.
 com.sap.tc.logging.Location getLogLocation()
          returns the Location object used for logging and tracing
 String getMimePath()
          get the local or absolute URL path where the mimes for the current theme can be found.
 Form getOldForm()
          get the reconstructed form from a request
 String getParameter(String name)
          Returns the value of a request parameter as a String, or null if the parameter does not exist.
 String getParameterForId(String elementId)
          gets the raw parameter value for the component with the specified id.
 Enumeration getParameterNames()
          Returns an Enumeration of String objects containing the names of the parameters contained in this request.
protected  Hashtable getParametersMultiPart()
           
 String[] getParameterValues(String name)
          Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
 String[] getParameterValuesForId(String elementId)
          gets the raw parameter values for the component with the specified id.
 String getParamIdForComponent(Component c)
          get a generated unique ID for a component.
 String getParamIdForComponent(String componentId)
          get the generated unique ID for a component.
 HashMap getParamList()
          Session: Session based storage for HTMLB context information only needed if isUsingSession will return true
 Object getParent()
          Get the pagecontext's parent e.g.
 Object getRequest()
          get the request object for the current context, e.g.
 ResourceBundle getResourceBundle(String baseName, Locale locale)
          get a ResourceBundle for locale specific texts.
 Object getResponse()
          get the response object for the current context, e.g.
 String getSpaceGif()
           
 String getStylePath()
          get the local or absolute URL path where the styles for the current theme can be found.
 HashSet getStylesheets()
          returns the required stylesheets
 String getStylesheetUrl()
          get the full URL for the CSS file for the current user agent.
 Component getTableComponentForId(String tableId, String elementId, int row)
          get a reconstructed component for a given id.
 TrayDesign getTrayDesign()
          returns a object describing the traytype the page is contained
 String getUrMapiJavascriptUrl()
           
 String getUrMessageBundleUrl()
           
 String getUrPopupJavascriptUrl()
           
protected  boolean getUTF8Encoding()
           
 Writer getWriter()
          get the java.io.Writer for output operations
protected  void init(Object request, Object response)
           
protected  void initMultiPartMime()
           
 boolean isFileParam(String name)
           
 boolean isHasContentPadding()
           
protected  boolean isMultiPartMime()
           
 boolean isSingleValueParameter(String name)
          Returns if a parameter has only a single value
 boolean isUsingSession()
          Session: used by the control renderers (Form & Inputfield) to find out where to put their data
 void pop()
          temporary solution for mixed-mode, i.e. creation of component/container structures and raw output.
 void push(Container container)
          temporary solution for mixed-mode, i.e. creation of component/container structures and raw output.
protected  boolean queryRTL()
           
protected  void readOldParamList(String formId)
           
 void rebuildComponents()
          rebuilds all the components that were registered at rendering time
 void registerStylesheet(String key)
          register the required style sheets
 void render()
          render the complete document
 void render(Component component)
          render a single component.
 void render(Component component, int selector)
          render an aspect of a single component.
 void renderJavascriptInterface(Component component, String generatedId)
          render Javascript interface of component.
 boolean requiresSection508Rendering()
          checks if additional information according to Section 508 should be rendered in the output stream.
 void setActionUrl(String actionUrl)
          set the URL path where form should be poset
 void setAdvancedAlignment(boolean advancedAlignment)
          aligment compatibility mode default value:false
 void setAttribute(String key, Object value)
          set an attribute in the current session
 void setBrowserId(BrowserType browserId)
           
 void setClassLoader(ClassLoader classLoader)
          Set the class loader for this context.
 void setCurrentEvent(Event currentEvent)
           
 void setCurrentForm(Form form)
          set the current form.
 void setDocumentId(String documentId)
          set the ID of the current document
 void setDomainRelaxation(boolean relaxDomain)
          Set the domain relaxation for the portal.
 void setFormDefaults(Form form)
          sets the defaults values for the form within the current context.
 void setHasContentPadding(boolean b)
           
protected  void setHttpServletRequest(HttpServletRequest httpServletRequest)
           
protected  void setHttpServletResponse(HttpServletResponse httpServletResponse)
           
 void setJavascriptPath(String javascriptPath)
          set the URL path where the JavaScript libraries can be found
 void setLocale(Locale locale)
          sets the locale
 void setMessageBarAtBodyEnd(boolean messageBarAtBodyEnd)
          sets whether messageBar should be renderted at body start or end.
 void setMimePath(String mimePath)
          set the URL path where the mimes can be found
protected  void setMultiPartMime(boolean multiPartMime)
           
 void setParent(Object parent)
          Set the pagecontext's parent e.g.
 void setRequest(Object request)
          set the request object.
 void setResponse(Object response)
          set the response object.
 void setRTL(boolean rtl)
           
 void setSection508Rendering(boolean requires508)
          sets if additional information according to Section 508 should be rendered in the output stream.
 void setStylePath(String stylePath)
          set the URL path where the mimes can be found
 void setTrayDesign(TrayDesign trayDesign)
          Set the traytype for the right background style of the body
 void setUsingSession(boolean useSession)
          Session: if an application want to use session state instead of persisting all HTMLB context in the HTML page
protected  void setUTF8Encoding(boolean encode)
           
 void setWriter(Writer writer)
          set the Writer to which output will be send.
 void startDocument()
          start a new document.
 void startDocumentBody()
          begin the body section of the generated output.
 void startDocumentHead(String title)
          begin the header of the document
 void storeParametersInSession(String formId)
          Session: called by the form renderer when it has finished rendering it's content Now you can be sure that all needed context info is in the ParamList
 void write(int i)
          write the integer value to the designated writer for the response
 void write(String text)
          write a String to the designated writer for the response
 void writeEncoded(String text)
          write a String to the designated writer for the response but encode critical characters, e.g. '<' as '<'
 void writeHeadBegin(String text)
           
 void writeHeadIncludes()
          write the required head includes to the output This will insert JavaScript and Stylesheet references.
 void writeHeadIncludes(String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected Document document

parametersMultiPart

protected Hashtable parametersMultiPart

hiddenCard

protected MobileWmlCard hiddenCard

newParamList

protected HashMap newParamList

oldParamList

protected HashMap oldParamList
Constructor Detail

PageContext

public PageContext(Object request,
                   Object response)
Method Detail

init

protected void init(Object request,
                    Object response)

getComponentForId

public Component getComponentForId(String elementId)
Description copied from interface: IPageContext
returns a reconstructed component for a given id. You can use this method to retrieve user input or basic state information from a component. If you are only interested in the data you can use getDataForComponentId

Specified by:
getComponentForId in interface IPageContext
Parameters:
elementId - the Id for the component
Returns:
a partially reconstructed component
See Also:
IPageContext.getDataForComponentId(String)

getTableComponentForId

public Component getTableComponentForId(String tableId,
                                        String elementId,
                                        int row)
Description copied from interface: IPageContext
get a reconstructed component for a given id. You can use this method to retrieve user input. This is a specialised getter for fields within a table.

Specified by:
getTableComponentForId in interface IPageContext
Parameters:
elementId - the name given to the component by the user
row - table row
Returns:
the partially reconstructed Component for the given cell location, or null if none exists.

getParameterForId

public String getParameterForId(String elementId)
Description copied from interface: IPageContext
gets the raw parameter value for the component with the specified id. This is a low level access. If you are working with typed data you should use getDataForComponentId.

Specified by:
getParameterForId in interface IPageContext
Parameters:
elementId - the Id for the component
Returns:
the raw parameter value or null if no such parameter exists
See Also:
IPageContext.getDataForComponentId(String)

getParameterValuesForId

public String[] getParameterValuesForId(String elementId)
Description copied from interface: IPageContext
gets the raw parameter values for the component with the specified id. This is a low level access. If you are working with typed data you should use getDataForComponentId. As of release 1.0 the only component that can return values is the ListBox.

Specified by:
getParameterValuesForId in interface IPageContext
Parameters:
elementId - the Id for the component
Returns:
the raw parameter values or null if no such parameter exists
See Also:
IPageContext.getDataForComponentId(String)

getDataForComponentId

public AbstractDataType getDataForComponentId(String elementId)
Description copied from interface: IPageContext
get the user input for a given id. You can use this method to retrieve user input.

Specified by:
getDataForComponentId in interface IPageContext
Parameters:
elementId - the Id for the component
Returns:
a DataType containing the specific data.

getDataForComponentId

public AbstractDataType getDataForComponentId(String tableId,
                                              String elementId,
                                              int row)
Description copied from interface: IPageContext
get the user input for a given id. You can use this method to retrieve user input from a table. Note: row is the visible row, i.e. you can use values from 1 to the visibleRowCount of the TableView

Specified by:
getDataForComponentId in interface IPageContext
Parameters:
elementId - the Id for the component

cleanUp

public void cleanUp()
Description copied from interface: IPageContext
deletes temporary file of mime multipart postings. This method is automatically called if you're using the DynPage model. If you're writing a simple Servlet or a PortalComponent you should call this method at the end of the request cycle. You must call this method if you're handling file uploads!

Specified by:
cleanUp in interface IPageContext

checkForCurrentEvent

protected void checkForCurrentEvent()

checkFormElements

protected void checkFormElements()

detectUserAgent

protected void detectUserAgent(HttpServletRequest httpServletRequest)

setCurrentEvent

public void setCurrentEvent(Event currentEvent)

getCurrentEvent

public Event getCurrentEvent()
Description copied from interface: IPageContext
return the event from the current request.

Specified by:
getCurrentEvent in interface IPageContext
Returns:
Event theEvent the user caused.

isMultiPartMime

protected boolean isMultiPartMime()

setMultiPartMime

protected void setMultiPartMime(boolean multiPartMime)

getParametersMultiPart

protected Hashtable getParametersMultiPart()

getParameterNames

public Enumeration getParameterNames()
Description copied from interface: IPageContext
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.

Specified by:
getParameterNames in interface IPageContext
Returns:
an Enumeration of String objects, each String containing the name of a request parameter; or an empty Enumeration if the request has no parameters

getParameter

public String getParameter(String name)
Description copied from interface: IPageContext
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).

This method does not return values for Components since component ids are encoded. Use getComponentForId or getDataForComponentId for that case.

Specified by:
getParameter in interface IPageContext
Returns:
String a String representing the single value of the parameter

getParameterValues

public String[] getParameterValues(String name)
Description copied from interface: IPageContext
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

Specified by:
getParameterValues in interface IPageContext
Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
an array of String objects containing the parameter's values

isFileParam

public boolean isFileParam(String name)
Specified by:
isFileParam in interface IPageContext
Returns:
boolean true if parameter is IFileParam

getFileParam

public IFileParam getFileParam(String name)
Specified by:
getFileParam in interface IPageContext
Returns:
IFileParam the IFileParam object

initMultiPartMime

protected void initMultiPartMime()

isSingleValueParameter

public boolean isSingleValueParameter(String name)
Returns if a parameter has only a single value

Specified by:
isSingleValueParameter in interface IPageContext
Returns:
boolean true if a single value exists for this parameter

getActionUrl

public String getActionUrl()
Description copied from interface: IPageContext
get the local or absolute URL path where the form should be posted if not already set

Specified by:
getActionUrl in interface IPageContext
Returns:
String a URL to the mimes, e.g. "/irj/servlet/..."

setActionUrl

public void setActionUrl(String actionUrl)
Description copied from interface: IPageContext
set the URL path where form should be poset

Specified by:
setActionUrl in interface IPageContext
Parameters:
actionUrl - the Url for tha action

getMimePath

public String getMimePath()
Description copied from interface: IPageContext
get the local or absolute URL path where the mimes for the current theme can be found.

Specified by:
getMimePath in interface IPageContext
Returns:
String a URL to the mimes, e.g. "/htmlb/mimes/common/"

setMimePath

public void setMimePath(String mimePath)
Description copied from interface: IPageContext
set the URL path where the mimes can be found

Specified by:
setMimePath in interface IPageContext
Parameters:
mimePath - the path for the mimes

setStylePath

public void setStylePath(String stylePath)
Description copied from interface: IPageContext
set the URL path where the mimes can be found

Specified by:
setStylePath in interface IPageContext

getStylePath

public String getStylePath()
Description copied from interface: IPageContext
get the local or absolute URL path where the styles for the current theme can be found.

Specified by:
getStylePath in interface IPageContext
Returns:
String a URL to the mimes, e.g. "/htmlb/mimes/ur/"

getJavascriptPath

public String getJavascriptPath()
Description copied from interface: IPageContext
get the URL path where the Javascript library files can be found.

Specified by:
getJavascriptPath in interface IPageContext
Returns:
a URL for the JavaScript files.

setJavascriptPath

public void setJavascriptPath(String javascriptPath)
Description copied from interface: IPageContext
set the URL path where the JavaScript libraries can be found

Specified by:
setJavascriptPath in interface IPageContext
Parameters:
javascriptPath - URL path

getSpaceGif

public String getSpaceGif()

getHttpServletRequest

public HttpServletRequest getHttpServletRequest()

setHttpServletRequest

protected void setHttpServletRequest(HttpServletRequest httpServletRequest)

getRequest

public Object getRequest()
Description copied from interface: IPageContext
get the request object for the current context, e.g. the HttpServletRequest for a servlet

Specified by:
getRequest in interface IPageContext
Returns:
the request object

setRequest

public void setRequest(Object request)
Description copied from interface: IPageContext
set the request object. This method should only be used internally.

Specified by:
setRequest in interface IPageContext
Parameters:
request - the request Object

getHttpServletResponse

public HttpServletResponse getHttpServletResponse()

setHttpServletResponse

protected void setHttpServletResponse(HttpServletResponse httpServletResponse)

getResponse

public Object getResponse()
Description copied from interface: IPageContext
get the response object for the current context, e.g. the HttpServletResponse for a servlet

Specified by:
getResponse in interface IPageContext
Returns:
the request object

setResponse

public void setResponse(Object response)
Description copied from interface: IPageContext
set the response object. This method should only be used internally.

Implementations for this method should always test if the passed parameter is null since IPageContext may be instantiated without a response object.

Specified by:
setResponse in interface IPageContext
Parameters:
response - the response Object

getBrowserId

public BrowserType getBrowserId()
Description copied from interface: IPageContext
get the BrowserType for the recognized browser/user agent

Specified by:
getBrowserId in interface IPageContext
Returns:
the BrowserType enumeration value for the browser

setBrowserId

public void setBrowserId(BrowserType browserId)

getLocale

public Locale getLocale()
Description copied from interface: IPageContext
Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.

Specified by:
getLocale in interface IPageContext
Returns:
the preferred Locale for the client

setLocale

public void setLocale(Locale locale)
sets the locale


getLocales

public Enumeration getLocales()
Description copied from interface: IPageContext
Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns an Enumeration containing one Locale, the default locale for the server.

Specified by:
getLocales in interface IPageContext
Returns:
an Enumeration of preferred Locale objects for the client

getWriter

public Writer getWriter()
Description copied from interface: IPageContext
get the java.io.Writer for output operations

Specified by:
getWriter in interface IPageContext
Returns:
a Writer for output operations

setWriter

public void setWriter(Writer writer)
Description copied from interface: IPageContext
set the Writer to which output will be send. Usually this is set up in the init method.

Specified by:
setWriter in interface IPageContext
Parameters:
writer - the Writer used for output

write

public void write(String text)
Description copied from interface: IPageContext
write a String to the designated writer for the response

Specified by:
write in interface IPageContext
Parameters:
text - a String to write

writeEncoded

public void writeEncoded(String text)
Description copied from interface: IPageContext
write a String to the designated writer for the response but encode critical characters, e.g. '<' as '<'

Specified by:
writeEncoded in interface IPageContext
Parameters:
text - a String to write

writeHeadBegin

public void writeHeadBegin(String text)
Specified by:
writeHeadBegin in interface IPageContext

writeHeadIncludes

public void writeHeadIncludes(String text)
Specified by:
writeHeadIncludes in interface IPageContext

write

public void write(int i)
Description copied from interface: IPageContext
write the integer value to the designated writer for the response

Specified by:
write in interface IPageContext
Parameters:
i - a int whose value should be written

push

public void push(Container container)
Description copied from interface: IPageContext
temporary solution for mixed-mode, i.e. creation of component/container structures and raw output. push a container, i.e. make the container recipient for temporary content.

Specified by:
push in interface IPageContext
Parameters:
container - Container that should receive what's written.

pop

public void pop()
Description copied from interface: IPageContext
temporary solution for mixed-mode, i.e. creation of component/container structures and raw output. pop a container, i.e. the container is no longer receiving direct output.

Specified by:
pop in interface IPageContext

render

public void render()
render the complete document

Specified by:
render in interface IPageContext

render

public void render(Component component)
Description copied from interface: IPageContext
render a single component. This method is only useful for components that produce atomic HTML code.

Specified by:
render in interface IPageContext
Parameters:
component - the Component that should be rendered.

render

public void render(Component component,
                   int selector)
Description copied from interface: IPageContext
render an aspect of a single component. This method is intended for components that need to produce more than one piece of HTML code, e.g. a Tray that needs to render some begin information and requires some end tags.

Specified by:
render in interface IPageContext
Parameters:
component - the Component that should be rendered.
selector - a String indicating which part of the Component should be rendered.

renderJavascriptInterface

public void renderJavascriptInterface(Component component,
                                      String generatedId)
Description copied from interface: IPageContext
render Javascript interface of component.

Specified by:
renderJavascriptInterface in interface IPageContext
Parameters:
component - the Component that should be rendered.

getJavascriptUrl

public String getJavascriptUrl()
Description copied from interface: IPageContext
get the full URL for the JavaScript library file for the current user agent.

Specified by:
getJavascriptUrl in interface IPageContext
Returns:
a URL like "/htmlb/jslib/htmlbie5.js"

getStylesheetUrl

public String getStylesheetUrl()
Description copied from interface: IPageContext
get the full URL for the CSS file for the current user agent.

Specified by:
getStylesheetUrl in interface IPageContext
Returns:
a URL like "/htmlb/jslib/htmlbie5.css"

createDocument

public Document createDocument(String title)
create a new document.

Specified by:
createDocument in interface IPageContext
Parameters:
title - the title for the new document

createFormDocument

public Form createFormDocument(String title)
create a new document and automatically create a form.

Specified by:
createFormDocument in interface IPageContext
Parameters:
title - the title for the new document

createForm

public Form createForm()
create a new form.

Specified by:
createForm in interface IPageContext
Returns:
a newly created form

setFormDefaults

public void setFormDefaults(Form form)
Description copied from interface: IPageContext
sets the defaults values for the form within the current context.

Specified by:
setFormDefaults in interface IPageContext
Parameters:
form - the form

requiresSection508Rendering

public boolean requiresSection508Rendering()
Description copied from interface: IPageContext
checks if additional information according to Section 508 should be rendered in the output stream.

Section 508 requires specific rendering functions that might not be sensible for non-disabled persons.

Basically if anything is to be rendered section 508 conform this means, that

Specified by:
requiresSection508Rendering in interface IPageContext

setSection508Rendering

public void setSection508Rendering(boolean requires508)
Description copied from interface: IPageContext
sets if additional information according to Section 508 should be rendered in the output stream.

Specified by:
setSection508Rendering in interface IPageContext

getParamIdForComponent

public String getParamIdForComponent(Component c)
get a generated unique ID for a component. Note that some components require to be placed within a form.

Specified by:
getParamIdForComponent in interface IPageContext
Parameters:
c - the component for which a unique ID is required
Returns:
a unique ID as String

getParamIdForComponent

public String getParamIdForComponent(String componentId)
get the generated unique ID for a component. This refers to the previous document information.

Specified by:
getParamIdForComponent in interface IPageContext
Returns:
a unique ID as String

startDocument

public void startDocument()
Description copied from interface: IPageContext
start a new document. This might e.g. write a simple "" to the output. There would of course be different implementations for WAP rendering, etc.

Specified by:
startDocument in interface IPageContext

startDocumentHead

public void startDocumentHead(String title)
Description copied from interface: IPageContext
begin the header of the document

Specified by:
startDocumentHead in interface IPageContext
Parameters:
title - the Title for the page

writeHeadIncludes

public void writeHeadIncludes()
Description copied from interface: IPageContext
write the required head includes to the output This will insert JavaScript and Stylesheet references.

Specified by:
writeHeadIncludes in interface IPageContext

endDocumentHead

public void endDocumentHead()
Description copied from interface: IPageContext
close the head section of the produced HTML.

Specified by:
endDocumentHead in interface IPageContext

setMessageBarAtBodyEnd

public void setMessageBarAtBodyEnd(boolean messageBarAtBodyEnd)
Description copied from interface: IPageContext
sets whether messageBar should be renderted at body start or end. a page context is free to place restrictions depending upon browser or integration

Specified by:
setMessageBarAtBodyEnd in interface IPageContext

startDocumentBody

public void startDocumentBody()
Description copied from interface: IPageContext
begin the body section of the generated output. ""

Specified by:
startDocumentBody in interface IPageContext

endDocumentBody

public void endDocumentBody()
Description copied from interface: IPageContext
end the body section of the generated output.

Specified by:
endDocumentBody in interface IPageContext

endDocument

public void endDocument()
Description copied from interface: IPageContext
end the generated output.

Specified by:
endDocument in interface IPageContext

getDocument

public Document getDocument()
gets the current document

Specified by:
getDocument in interface IPageContext
Returns:
the current document

setDocumentId

public void setDocumentId(String documentId)
set the ID of the current document

Parameters:
documentId - the id of the current document

getCurrentFormId

public String getCurrentFormId()
get the ID of the current form (HTML!!!)

Specified by:
getCurrentFormId in interface IPageContext
Returns:
the id of the current form

getCurrentForm

public Form getCurrentForm()
get the current form

Specified by:
getCurrentForm in interface IPageContext
Returns:
the current form

getOldForm

public Form getOldForm()
get the reconstructed form from a request

Specified by:
getOldForm in interface IPageContext
Returns:
the old form that was submitted

setCurrentForm

public void setCurrentForm(Form form)
set the current form. This should only be called by the form renderer!

Specified by:
setCurrentForm in interface IPageContext
Parameters:
form - the current form

setAttribute

public void setAttribute(String key,
                         Object value)
set an attribute in the current session

Specified by:
setAttribute in interface IPageContext
Parameters:
key - the key
value - the value associated with this key

getAttribute

public Object getAttribute(String key)
get an attribute from the current session

Specified by:
getAttribute in interface IPageContext
Parameters:
key - the key
Returns:
the value associated with this key or null

getResourceBundle

public ResourceBundle getResourceBundle(String baseName,
                                        Locale locale)
get a ResourceBundle for locale specific texts.

Specified by:
getResourceBundle in interface IPageContext
Parameters:
baseName - the baseName for the bundle
locale - the locale for the bundle or null if the default locale from the request should be used.
Returns:
the ResourceBundle
See Also:
ResourceBundle

attemptUTF8Encoding

protected String attemptUTF8Encoding(String value)
add the java script


setUTF8Encoding

protected void setUTF8Encoding(boolean encode)

getUTF8Encoding

protected boolean getUTF8Encoding()

getComponentIdForLabel

public String getComponentIdForLabel(String id)
Specified by:
getComponentIdForLabel in interface IPageContext

getClientInfo

public ClientInfo getClientInfo()
Specified by:
getClientInfo in interface IPageContext

getHiddenCard

public MobileWmlCard getHiddenCard()
Specified by:
getHiddenCard in interface IPageContext

getUrMapiJavascriptUrl

public String getUrMapiJavascriptUrl()

getUrPopupJavascriptUrl

public String getUrPopupJavascriptUrl()

getUrMessageBundleUrl

public String getUrMessageBundleUrl()

getIs508

public boolean getIs508()

getClassLoader

public ClassLoader getClassLoader()
Get the class loader assigned to this context.

Specified by:
getClassLoader in interface IPageContext
Returns:
the assigned class loader

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Set the class loader for this context.

Specified by:
setClassLoader in interface IPageContext

getDomainRelaxation

public boolean getDomainRelaxation()
Description copied from interface: IPageContext
Get the flag for domain relaxation.

Specified by:
getDomainRelaxation in interface IPageContext
Returns:
the flag for domain relaxation

setDomainRelaxation

public void setDomainRelaxation(boolean relaxDomain)
Description copied from interface: IPageContext
Set the domain relaxation for the portal.

Specified by:
setDomainRelaxation in interface IPageContext

getParamList

public HashMap getParamList()
Description copied from interface: IPageContext
Session: Session based storage for HTMLB context information only needed if isUsingSession will return true

Specified by:
getParamList in interface IPageContext

setUsingSession

public void setUsingSession(boolean useSession)
Description copied from interface: IPageContext
Session: if an application want to use session state instead of persisting all HTMLB context in the HTML page

Specified by:
setUsingSession in interface IPageContext

isUsingSession

public boolean isUsingSession()
Description copied from interface: IPageContext
Session: used by the control renderers (Form & Inputfield) to find out where to put their data

Specified by:
isUsingSession in interface IPageContext

readOldParamList

protected void readOldParamList(String formId)

storeParametersInSession

public void storeParametersInSession(String formId)
Description copied from interface: IPageContext
Session: called by the form renderer when it has finished rendering it's content Now you can be sure that all needed context info is in the ParamList

Specified by:
storeParametersInSession in interface IPageContext

getParent

public Object getParent()
Get the pagecontext's parent e.g. Servlet or Dynpage

Specified by:
getParent in interface IPageContext

setParent

public void setParent(Object parent)
Set the pagecontext's parent e.g. Servlet or Dynpage

Specified by:
setParent in interface IPageContext

rebuildComponents

public void rebuildComponents()
Description copied from interface: IPageContext
rebuilds all the components that were registered at rendering time

Specified by:
rebuildComponents in interface IPageContext

getComponents

public Component[] getComponents()
Description copied from interface: IPageContext
returns all the components that were rebuild

Specified by:
getComponents in interface IPageContext

getTrayDesign

public TrayDesign getTrayDesign()
returns a object describing the traytype the page is contained

Specified by:
getTrayDesign in interface IPageContext

setTrayDesign

public void setTrayDesign(TrayDesign trayDesign)
Set the traytype for the right background style of the body

Specified by:
setTrayDesign in interface IPageContext
Parameters:
trayDesign - TrayDesign the traydesign

flush

public void flush()
Specified by:
flush in interface IPageContext

registerStylesheet

public void registerStylesheet(String key)
register the required style sheets

Specified by:
registerStylesheet in interface IPageContext

getStylesheets

public HashSet getStylesheets()
returns the required stylesheets

Specified by:
getStylesheets in interface IPageContext

getIsRTL

public boolean getIsRTL()

setRTL

public void setRTL(boolean rtl)
Specified by:
setRTL in interface IPageContext

queryRTL

protected boolean queryRTL()

getLogLocation

public com.sap.tc.logging.Location getLogLocation()
Description copied from interface: IPageContext
returns the Location object used for logging and tracing

Specified by:
getLogLocation in interface IPageContext

getDevice

public String getDevice()

getHasAdvancedAlignment

public boolean getHasAdvancedAlignment()

setAdvancedAlignment

public void setAdvancedAlignment(boolean advancedAlignment)
Description copied from interface: IPageContext
aligment compatibility mode default value:false

Specified by:
setAdvancedAlignment in interface IPageContext
Parameters:
advancedAlignment -

addPerfCounter

public void addPerfCounter(String line)
Description copied from interface: IPageContext
adds performance counters written a comments in the HTML source

Specified by:
addPerfCounter in interface IPageContext

isHasContentPadding

public boolean isHasContentPadding()
Specified by:
isHasContentPadding in interface IPageContext
Returns:
if the tray should have content padding

setHasContentPadding

public void setHasContentPadding(boolean b)
Specified by:
setHasContentPadding in interface IPageContext


Copyright 2006 SAP AG Complete Copyright Notice