com.ibm.xsp.context
Class FacesContextEx

java.lang.Object
  extended by javax.faces.context.FacesContext
      extended by com.ibm.xsp.context.FacesContextEx

public abstract class FacesContextEx
extends javax.faces.context.FacesContext

Extended version of FacesContext which adds support for notification of when the FacesContext is being released, and various other XPage extensions on top of JSF, not intended to be subclassed by 3rd parties at present.


Field Summary
static int CLOSE_COMPONENTMODE_CANCEL
          Used in closeProcess(int, Object)
static int CLOSE_COMPONENTMODE_OK
          Used in closeProcess(int, Object)
static int CLOSE_VALIDATION_RESULT
          Used in closeProcess(int, Object)
static int DATASOURCE_BEINGLOADED
          Used in setDataSourceMode(int)
static int DATASOURCE_BEINGSAVED
          Used in setDataSourceMode(int)
static int DATASOURCE_NORMAL
          Used in setDataSourceMode(int)
 
Constructor Summary
FacesContextEx()
           
 
Method Summary
abstract  void addMessage(java.lang.String clientId, javax.faces.application.FacesMessage message)
           
abstract  void addRequestListener(FacesContextListener listener)
          Add a listener for notification when the request has ended.
abstract  void closeProcess(int closeMode, java.lang.Object closeValue)
          Close the current process.
abstract  void endCustomRendering()
          Throws an exception to stop the rendering process.
abstract  java.lang.String filterHtml(java.lang.String filterName, java.lang.String value)
          Filters the HTML input value using the named filtering engine.
abstract  FacesAjaxComponent getAjaxComponent()
          Get the current component actually processing an Ajax request
abstract  javax.faces.application.Application getApplication()
           
abstract  ApplicationEx getApplicationEx()
           
abstract  java.util.Map<java.lang.Object,java.lang.Object> getAttributes()
          Get the attribute Map associated to this context.
abstract  java.util.Iterator<java.lang.String> getClientIdsWithMessages()
           
abstract  int getCloseMode()
           
abstract  java.lang.Object getCloseValue()
           
abstract  ComponentData getComponentData()
           
abstract  java.lang.ClassLoader getContextClassLoader()
          Get the context class loader.
static FacesContextEx getCurrentInstance()
           
abstract  DataPublisher getDataPublisher()
           
abstract  int getDataSourceMode()
          Get the current datasource mode (normal, data being loaded, data being saved)
abstract  javax.faces.context.ExternalContext getExternalContext()
           
abstract  javax.faces.application.FacesMessage.Severity getMaximumSeverity()
           
abstract  java.util.Iterator<javax.faces.application.FacesMessage> getMessages()
           
abstract  java.util.Iterator<javax.faces.application.FacesMessage> getMessages(java.lang.String clientId)
           
abstract  java.lang.String getPartialExecId()
           
abstract  java.lang.String getPartialRefreshId()
           
abstract  java.lang.String getProperty(java.lang.String name)
          Get request based properties.
abstract  int getRenderingSequence()
          Return the current view root rendering sequence.
abstract  javax.faces.render.RenderKit getRenderKit()
           
abstract  boolean getRenderResponse()
           
abstract  RequestParameters getRequestParameters()
          Get the request parameters for this particular request.
abstract  boolean getResponseComplete()
           
abstract  javax.faces.context.ResponseStream getResponseStream()
           
abstract  javax.faces.context.ResponseWriter getResponseWriter()
           
abstract  SessionData getSessionData()
           
abstract  java.lang.String getSessionProperty(java.lang.String propName)
           
abstract  StyleKit getStyleKit()
           
abstract  java.lang.String getStyleKitId()
          Get the theme id used by this request
abstract  javax.faces.component.UIComponent getSubTreeComponent()
           
abstract  java.lang.String getTempRequestUrl()
           
abstract  javax.faces.component.UIViewRoot getViewRoot()
           
abstract  boolean isAjaxPartialRefresh()
           
abstract  boolean isAjaxRendered(javax.faces.component.UIComponent component)
           
abstract  boolean isAjaxRendering()
           
abstract  boolean isAjaxWholeTreeRendered()
           
abstract  boolean isDisableValidators()
           
abstract  boolean isErrorDisplayed()
          Check if the error messages had been reported to the user.
abstract  boolean isNotes()
           
abstract  boolean isPartialExec()
           
abstract  boolean isRenderingPhase()
          Check if we are currently rendering.
abstract  boolean isRestoringState()
           
abstract  boolean isRunningContext(java.lang.String context)
          Check if the application is running in a particular context.
abstract  boolean isUserAgentABot()
           
abstract  void release()
           
abstract  void removeRequestListener(FacesContextListener listener)
          Remove a listener for notification when the request has ended.
abstract  void renderResponse()
           
abstract  void responseComplete()
           
abstract  void setAjaxRendering(boolean ajaxRendeing)
           
abstract  void setDataSourceMode(int dataSourceMode)
          Set the current datasource mode (normal, data being loaded, data being saved)
abstract  void setDisableValidators(boolean preventValidators)
          Enable/disable validators
abstract  void setErrorDisplayed(boolean errorDisplayed)
          Set the error displayed flag.
abstract  void setPartialExecId(java.lang.String partialExecId)
          Set the Partial Execution id
abstract  void setPartialRefreshId(java.lang.String ajaxCompId)
          Set the Partial Refresh id
abstract  void setResponseStream(javax.faces.context.ResponseStream responseStream)
           
abstract  void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
           
abstract  void setSessionProperty(java.lang.String propName, java.lang.String value)
           
abstract  void setSubTreeComponent(javax.faces.component.UIComponent subTree)
           
abstract  void setTempRequestUrl(java.lang.String s)
           
abstract  void setViewRoot(javax.faces.component.UIViewRoot viewRoot)
           
abstract  void startCustomRendering()
          Reset the response content.
 
Methods inherited from class javax.faces.context.FacesContext
setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLOSE_COMPONENTMODE_OK

public static final int CLOSE_COMPONENTMODE_OK
Used in closeProcess(int, Object)

See Also:
Constant Field Values

CLOSE_COMPONENTMODE_CANCEL

public static final int CLOSE_COMPONENTMODE_CANCEL
Used in closeProcess(int, Object)

See Also:
Constant Field Values

CLOSE_VALIDATION_RESULT

public static final int CLOSE_VALIDATION_RESULT
Used in closeProcess(int, Object)

See Also:
Constant Field Values

DATASOURCE_NORMAL

public static final int DATASOURCE_NORMAL
Used in setDataSourceMode(int)

See Also:
Constant Field Values

DATASOURCE_BEINGLOADED

public static final int DATASOURCE_BEINGLOADED
Used in setDataSourceMode(int)

See Also:
Constant Field Values

DATASOURCE_BEINGSAVED

public static final int DATASOURCE_BEINGSAVED
Used in setDataSourceMode(int)

See Also:
Constant Field Values
Constructor Detail

FacesContextEx

public FacesContextEx()
Method Detail

getCurrentInstance

public static FacesContextEx getCurrentInstance()

getContextClassLoader

public abstract java.lang.ClassLoader getContextClassLoader()
Get the context class loader. The class loader is cached, which avoids calls to getContextClassLoader() and thus extra access to the security manager.

Overrides:
getContextClassLoader in class javax.faces.context.FacesContext
Returns:

getProperty

public abstract java.lang.String getProperty(java.lang.String name)
Get request based properties. This include the properties defined at the request level through the request customizer, as well as the properties defined at the Application level.

Parameters:
name -
defaultValue -
Returns:

getSessionProperty

public abstract java.lang.String getSessionProperty(java.lang.String propName)

setSessionProperty

public abstract void setSessionProperty(java.lang.String propName,
                                        java.lang.String value)

getSessionData

public abstract SessionData getSessionData()

getComponentData

public abstract ComponentData getComponentData()

getDataSourceMode

public abstract int getDataSourceMode()
Get the current datasource mode (normal, data being loaded, data being saved)

Returns:
the data source mode

setDataSourceMode

public abstract void setDataSourceMode(int dataSourceMode)
Set the current datasource mode (normal, data being loaded, data being saved)

Parameters:
dataSourceMode - the new data source mode

getRequestParameters

public abstract RequestParameters getRequestParameters()
Get the request parameters for this particular request.

Returns:
the request customizer

isRunningContext

public abstract boolean isRunningContext(java.lang.String context)
Check if the application is running in a particular context.

Returns:
true if the current context is valid

getSubTreeComponent

public abstract javax.faces.component.UIComponent getSubTreeComponent()

setSubTreeComponent

public abstract void setSubTreeComponent(javax.faces.component.UIComponent subTree)

isErrorDisplayed

public abstract boolean isErrorDisplayed()
Check if the error messages had been reported to the user.


setErrorDisplayed

public abstract void setErrorDisplayed(boolean errorDisplayed)
Set the error displayed flag. This flag is set by UIMessage/UIMessages after a error message is displayed. This allows the UIViewRootEx to warn that error occurred but were never reported to the user.


addRequestListener

public abstract void addRequestListener(FacesContextListener listener)
Add a listener for notification when the request has ended.

Parameters:
listener -

removeRequestListener

public abstract void removeRequestListener(FacesContextListener listener)
Remove a listener for notification when the request has ended.

Parameters:
listener -

isRenderingPhase

public abstract boolean isRenderingPhase()
Check if we are currently rendering.


getRenderingSequence

public abstract int getRenderingSequence()
Return the current view root rendering sequence.


getAttributes

public abstract java.util.Map<java.lang.Object,java.lang.Object> getAttributes()
Get the attribute Map associated to this context. Note that this is similar to a new function added to JSF 2.0

Returns:
the attribute Map

startCustomRendering

public abstract void startCustomRendering()
                                   throws java.io.IOException
Reset the response content.

Throws:
java.io.IOException

endCustomRendering

public abstract void endCustomRendering()
                                 throws java.io.IOException
Throws an exception to stop the rendering process. Note that this funtion must apply during the rendering phase.

Throws:
java.io.IOException

closeProcess

public abstract void closeProcess(int closeMode,
                                  java.lang.Object closeValue)
Close the current process.


getCloseMode

public abstract int getCloseMode()

getCloseValue

public abstract java.lang.Object getCloseValue()

addMessage

public abstract void addMessage(java.lang.String clientId,
                                javax.faces.application.FacesMessage message)
Specified by:
addMessage in class javax.faces.context.FacesContext

getApplicationEx

public abstract ApplicationEx getApplicationEx()

getApplication

public abstract javax.faces.application.Application getApplication()
Specified by:
getApplication in class javax.faces.context.FacesContext

getClientIdsWithMessages

public abstract java.util.Iterator<java.lang.String> getClientIdsWithMessages()
Specified by:
getClientIdsWithMessages in class javax.faces.context.FacesContext

getExternalContext

public abstract javax.faces.context.ExternalContext getExternalContext()
Specified by:
getExternalContext in class javax.faces.context.FacesContext

getMaximumSeverity

public abstract javax.faces.application.FacesMessage.Severity getMaximumSeverity()
Specified by:
getMaximumSeverity in class javax.faces.context.FacesContext

getMessages

public abstract java.util.Iterator<javax.faces.application.FacesMessage> getMessages()
Specified by:
getMessages in class javax.faces.context.FacesContext

getMessages

public abstract java.util.Iterator<javax.faces.application.FacesMessage> getMessages(java.lang.String clientId)
Specified by:
getMessages in class javax.faces.context.FacesContext

getRenderKit

public abstract javax.faces.render.RenderKit getRenderKit()
Specified by:
getRenderKit in class javax.faces.context.FacesContext

getStyleKitId

public abstract java.lang.String getStyleKitId()
Get the theme id used by this request

Returns:
the theme id

isNotes

public abstract boolean isNotes()
Returns:
Return true if running on Notes Client

getStyleKit

public abstract StyleKit getStyleKit()
Returns:
the current Style Kit. If it is not set then first look for default specified by xsp.theme.web or xsp.theme.notes. If not set then get Style Kit based on webstandard or notes style kit ids.

filterHtml

public abstract java.lang.String filterHtml(java.lang.String filterName,
                                            java.lang.String value)
Filters the HTML input value using the named filtering engine.

Parameters:
filterName -
value -
Returns:

isDisableValidators

public abstract boolean isDisableValidators()
Returns:
true is validators have been disabled

setDisableValidators

public abstract void setDisableValidators(boolean preventValidators)
Enable/disable validators

Parameters:
preventValidators -

isPartialExec

public abstract boolean isPartialExec()
Returns:
Return true if Partial Execution has been set for this Event - XPages will go through the execution lifecycle phase for this component only (and its children)

getPartialExecId

public abstract java.lang.String getPartialExecId()
Returns:
Return the Partial Execution id

setPartialExecId

public abstract void setPartialExecId(java.lang.String partialExecId)
Set the Partial Execution id

Parameters:
partialExecId -

isAjaxPartialRefresh

public abstract boolean isAjaxPartialRefresh()
Returns:
Return true if the event is a Partial Update

getPartialRefreshId

public abstract java.lang.String getPartialRefreshId()
Returns:
Return the Id of the component that is to be Partially Updated

setPartialRefreshId

public abstract void setPartialRefreshId(java.lang.String ajaxCompId)
Set the Partial Refresh id

Parameters:
ajaxCompId -

isAjaxWholeTreeRendered

public abstract boolean isAjaxWholeTreeRendered()
Returns:

isAjaxRendered

public abstract boolean isAjaxRendered(javax.faces.component.UIComponent component)
Parameters:
component -
Returns:
Return trus if this component is the target id on a Partial Refresh event

isAjaxRendering

public abstract boolean isAjaxRendering()
Returns:

setAjaxRendering

public abstract void setAjaxRendering(boolean ajaxRendeing)
Parameters:
ajaxRendeing -

getAjaxComponent

public abstract FacesAjaxComponent getAjaxComponent()
Get the current component actually processing an Ajax request


getTempRequestUrl

public abstract java.lang.String getTempRequestUrl()
Returns:

setTempRequestUrl

public abstract void setTempRequestUrl(java.lang.String s)
Parameters:
s -

getDataPublisher

public abstract DataPublisher getDataPublisher()
Returns:
Return the DataPublisher that published the value of var attributes to the reuquest parameters. Creates a DataPublisher if none already exist.

isRestoringState

public abstract boolean isRestoringState()
Returns:
Returns true if FacesContecxt is in the Restore State phase of the JSF lifecycle

getRenderResponse

public abstract boolean getRenderResponse()
Specified by:
getRenderResponse in class javax.faces.context.FacesContext

getResponseComplete

public abstract boolean getResponseComplete()
Specified by:
getResponseComplete in class javax.faces.context.FacesContext

getResponseStream

public abstract javax.faces.context.ResponseStream getResponseStream()
Specified by:
getResponseStream in class javax.faces.context.FacesContext

getResponseWriter

public abstract javax.faces.context.ResponseWriter getResponseWriter()
Specified by:
getResponseWriter in class javax.faces.context.FacesContext

setResponseWriter

public abstract void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
Specified by:
setResponseWriter in class javax.faces.context.FacesContext
Since:
1.0
See Also:
FacesContext.setResponseWriter(javax.faces.context.ResponseWriter)

getViewRoot

public abstract javax.faces.component.UIViewRoot getViewRoot()
Specified by:
getViewRoot in class javax.faces.context.FacesContext

release

public abstract void release()
Specified by:
release in class javax.faces.context.FacesContext

renderResponse

public abstract void renderResponse()
Specified by:
renderResponse in class javax.faces.context.FacesContext

responseComplete

public abstract void responseComplete()
Specified by:
responseComplete in class javax.faces.context.FacesContext

setResponseStream

public abstract void setResponseStream(javax.faces.context.ResponseStream responseStream)
Specified by:
setResponseStream in class javax.faces.context.FacesContext

setViewRoot

public abstract void setViewRoot(javax.faces.component.UIViewRoot viewRoot)
Specified by:
setViewRoot in class javax.faces.context.FacesContext

isUserAgentABot

public abstract boolean isUserAgentABot()