Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
12c Release 1 (12.1.2.0.0)
E23185-01


oracle.adf.view.rich.context
Class AdfFacesContext

java.lang.Object
  extended by oracle.adf.view.rich.context.AdfFacesContext


public abstract class AdfFacesContext
extends Object

A context object that largely exists as a mirror for the Apache Trinidad RequestContext, but also provides ADF Faces-specific APIs. ADF Faces provides the only concrete implementations of this abstract class. As such, we reserve the right to add new abstract methods to AdfFacesContext as the need arises.


Nested Class Summary
static class AdfFacesContext.OutputMode
          Enumeration representing OutputModes
static class AdfFacesContext.PayloadType
          Enumeration of the types of postback payloads supported by ADF.

 

Field Summary
static String VARIABLE_NAME
          Name of the EL implicit variable ("adfFacesContext") that is used to expose this context object.

 

Constructor Summary
AdfFacesContext()
           

 

Method Summary
abstract  void addPartialTarget(javax.faces.component.UIComponent newTarget)
          Add a component as a partial target.
abstract  void addPartialTriggerListeners(javax.faces.component.UIComponent listener, String[] trigger)
          Adds a listener on a set of particular triggering components.
abstract  UnassociatedPage createPage()
          Creates a new instance of the UnassociatedPage object that could be used to pass data to a different URL The UnassociatedPage object returned by this method should only be used during the current request.
abstract  String getAccessibilityMode()
          Returns the name of the current accessibility mode.
 Agent getAgent()
          Returns the Agent information for the current context
abstract  ApplicationContextManager getApplicationContextManager()
          Deprecated. use RequestContext.getComponentContextManager() instead of this method.
abstract  BackingBeanScopeProvider getBackingBeanScopeProvider()
          Returns a BackingBeanScopeProvider instance and is shared across the entire application.
 ChangeManager getChangeManager()
          Gets the ChangeManager for the current application.
abstract  List<Color> getColorPalette(String name)
          Returns a List that takes color palette name as key, and returns the color palette as a result.
abstract  String getCurrencyCode()
          Return the ISO 4217 currency code used by default for formatting currency fields when those fields do not specify an explicit currency field via their converter.
static AdfFacesContext getCurrentInstance()
          Retrieves the AdfFacesContext active for the current thread.
abstract  Page getCurrentPage()
          Retrieves a current instance of the Page object for storing data specific to this page within the current window The Page object returned by this method should only be used during the current request.
abstract  DataUpdateManager getDataUpdateManager()
          Returns the DataUpdateManager to use for registering and unregistering components for use with eitehr automatic PPR or active Datata
abstract  char getDecimalSeparator()
          Return the separator used as the decimal point.
abstract  DialogService getDialogService()
          Returns an DialogService, which exposes a number of APIs needed by component and framework developers.
abstract  DirtyPageHandler getDirtyPageHandler()
          Returns DirtyPageHandler service registered under meta-inf/services or a default implementation if none was found
abstract  EndUserMonitoringService getEndUserMonitoringService()
          Deprecated. use getEndUserMonitoringServices() instead.
abstract  List<EndUserMonitoringService> getEndUserMonitoringServices()
          Returns a list of EndUserMonitoringService providers.
abstract  ExecutionContextProvider getExecutionContextProvider()
          Returns an ExecutionContextDataProvider to use for retrieving context information pertaining to the current request.
abstract  Map getFormatter()
          Returns a Map that performs message formatting with a recursive Map structure.
abstract  HelpProvider getHelpProvider()
          Gets the HelpProvider that is registered in META-INF/adf-settings.xml.
 Map getHelpSystem()
          Deprecated. on 24-jan-2007, for 11.1.1.0.JI2. Use the new HelpProvider framework.
 Map getHelpTopic()
          Deprecated. on 24-jan-2007, for 11.1.1.0.JI2. Use the new HelpProvider framework.
abstract  NewSessionURLProvider getNewSessionURLProvider()
          Returns the NewSessionURLProvider instance
abstract  char getNumberGroupingSeparator()
          Return the separator used for groups of numbers.
 String getOracleHelpServletUrl()
          Deprecated. on 24-jan-2007, for 11.1.1.0.JI2. Use the new HelpProvider framework.
 String getOutputMode()
           
 AdfFacesContext.OutputMode getOutputModeEnum()
          Returns the OutputMode enumeration
abstract  Map<String,Object> getPageFlowScope()
          Returns a Map of objects at "pageFlow" scope.
 PageFlowScopeProvider getPageFlowScopeProvider()
          Gets the PageFlowScopeProvider for the current application.
 PageResolver getPageResolver()
          Gets the PageResolver for the current application.
abstract  org.apache.myfaces.trinidad.change.ChangeManager getPersistentChangeManager()
          Returns the persistent change manager registered through web.xml for the current application
 AdfFacesContext.PayloadType getPostbackPayloadType()
          Returns the type of postback payload that has been submitted for this request.
 Map getProcessScope()
          Deprecated. since 11.0; use getPageFlowScope()
 RegionManager getRegionManager()
          Gets the RegionManager for the current application.
abstract  String getSkinFamily()
          Returns the name of the preferred skin family.
abstract  TimeZone getTimeZone()
          Returns the default TimeZone used for interpreting and formatting date values.
abstract  int getTwoDigitYearStart()
          Returns the year offset for parsing years with only two digits.
abstract  UriManager getUriManager()
          Retrieves an instance of UriManager for manipulation browser URIs
abstract  Map<String,Object> getViewScope()
          Returns a Map of objects at "view" scope.
abstract  WindowIdProvider getWindowIdProvider()
          Deprecated. Use WindowManagerFactory.getWindowManager(javax.faces.context.ExternalContext).
abstract  WindowIdProvider getWindowIdProvider(javax.faces.context.ExternalContext externalContext)
          Deprecated. Use WindowManagerFactory.getWindowManager(javax.faces.context.ExternalContext).
abstract  boolean isClientValidationDisabled()
          Returns true if client-side validation should be disabled.
abstract  boolean isDebugOutput()
          Returns true if output should contain debugging information.
abstract  boolean isFurtherValidationNeeded()
          Returns true if a framework providing additional validation on top of the faces lifecycle should run that validation.
abstract  boolean isInitialRender()
          Returns true if this request is the first request to render the page.
abstract  boolean isPartialRequest(javax.faces.context.FacesContext context)
          Method to indicate if this current HTTP request is a partial page rendering request.
abstract  boolean isPostback()
          Returns true if JSF is currently processing a postback request.
abstract  boolean isRightToLeft()
          Returns true if the user should be shown output in right-to-left.
abstract  void launchDialog(javax.faces.component.UIViewRoot dialogRoot, Map dialogParameters, javax.faces.component.UIComponent source, boolean useWindow, Map windowProperties)
          Launch a dialog, optionally raising it in a new dialog window.
abstract  void partialUpdateNotify(javax.faces.component.UIComponent updated)
          Called when any component gets updated.
abstract  void queueTaskForAfterPhase(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId, Runnable task)
          Queue a task that will be run after a phase.
abstract  void queueTaskForBeforePhase(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId, Runnable task)
          Queue a task that will be run before a phase.
abstract  javax.faces.component.UIComponent restoreComponent(Object state)
          Restores the state of a component.
abstract  void returnFromDialog(Object returnValue, Map returnParameters)
          Returns from a dialog raised by a UIXCommand component, or any component implementing DialogSource, or any direct calls to launchDialog().
abstract  Object saveComponent(javax.faces.component.UIComponent component)
          Saves the state of a UIComponent tree into an Object.
abstract  void scrollComponentIntoView(javax.faces.component.UIComponent component, boolean focus)
          Scrolls the view to the given component.
abstract  void setFurtherValidationNeeded(boolean validationNeeded)
          Used by internal ADF Faces code.

 

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

 

Field Detail

VARIABLE_NAME

public static final String VARIABLE_NAME
Name of the EL implicit variable ("adfFacesContext") that is used to expose this context object.
See Also:
Constant Field Values

Constructor Detail

AdfFacesContext

public AdfFacesContext()

Method Detail

getCurrentInstance

public static AdfFacesContext getCurrentInstance()
Retrieves the AdfFacesContext active for the current thread.

queueTaskForAfterPhase

public abstract void queueTaskForAfterPhase(javax.faces.context.FacesContext context,
                                            javax.faces.event.PhaseId phaseId,
                                            Runnable task)
Queue a task that will be run after a phase.
Parameters:
context - the FacesContext
phaseId - the phase after which it must be run; ANY_PHASE is not supported
task - a Runnable that implements the task

queueTaskForBeforePhase

public abstract void queueTaskForBeforePhase(javax.faces.context.FacesContext context,
                                             javax.faces.event.PhaseId phaseId,
                                             Runnable task)
Queue a task that will be run before a phase.
Parameters:
context - the FacesContext
phaseId - the phase after which it must be run; ANY_PHASE is not supported
task - a Runnable that implements the task

getWindowIdProvider

@Deprecated
public abstract WindowIdProvider getWindowIdProvider()
Deprecated. Use WindowManagerFactory.getWindowManager(javax.faces.context.ExternalContext).
Returns the WindowIdProvider object

getWindowIdProvider

@Deprecated
public abstract WindowIdProvider getWindowIdProvider(javax.faces.context.ExternalContext externalContext)
Deprecated. Use WindowManagerFactory.getWindowManager(javax.faces.context.ExternalContext).
Returns the WindowIdProvider object from the ExternalContext

getNewSessionURLProvider

public abstract NewSessionURLProvider getNewSessionURLProvider()
Returns the NewSessionURLProvider instance

getDataUpdateManager

public abstract DataUpdateManager getDataUpdateManager()
Returns the DataUpdateManager to use for registering and unregistering components for use with eitehr automatic PPR or active Datata

getDirtyPageHandler

public abstract DirtyPageHandler getDirtyPageHandler()
Returns DirtyPageHandler service registered under meta-inf/services or a default implementation if none was found
Returns:
DirtyPageHandler

getEndUserMonitoringService

public abstract EndUserMonitoringService getEndUserMonitoringService()
Deprecated. use getEndUserMonitoringServices() instead.
Returns the EndUserMonitoringService that provides the ability to log key performance data for every user initiated action on a page. EndUserMonitoringService instance is shared across the entire application. If no service is registered, this method will return a stub implementation that disables monitoring. If FacesContext has not been initialized, this method returns null.
Returns:
the instance of EndUserMonitoringService or null if FacesContext has not been initialized

getEndUserMonitoringServices

public abstract List<EndUserMonitoringService> getEndUserMonitoringServices()
Returns a list of EndUserMonitoringService providers. EndUserMonitoringService instances are shared across the entire application. If no services are registered, this method will return a stub implementation that disables monitoring. If FacesContext has not been initialized, this method returns an empty list.
Returns:
a List of EndUserMonitoringService providers or an empty List if FacesContext has not been initialized.

getExecutionContextProvider

public abstract ExecutionContextProvider getExecutionContextProvider()
Returns an ExecutionContextDataProvider to use for retrieving context information pertaining to the current request. ExecutionContextDataProvider instance is shared across the entire application. If no context provider is registered, this method will return a stub provider object that returns a null ExecutionContext.
Returns:
the instance of ExecutionContextProvider

getBackingBeanScopeProvider

public abstract BackingBeanScopeProvider getBackingBeanScopeProvider()
Returns a BackingBeanScopeProvider instance and is shared across the entire application. If no context provider is registered, this method will return a stub provider instance that has noop implementations its methods.
Returns:
the instance of BackingBeanScopeProvider

getViewScope

public abstract Map<String,Object> getViewScope()
Returns a Map of objects at "view" scope. The lifetime of "view" scope is the period that the user interacts with this page instance in a particular view window. Thus, two windows on the same view id will have different "view" scopes.

The viewScope will not be available if there is no FacesContext


getPageFlowScope

public abstract Map<String,Object> getPageFlowScope()
Returns a Map of objects at "pageFlow" scope.

getProcessScope

@Deprecated
public final Map getProcessScope()
Deprecated. since 11.0; use getPageFlowScope()

returnFromDialog

public abstract void returnFromDialog(Object returnValue,
                                      Map returnParameters)
Returns from a dialog raised by a UIXCommand component, or any component implementing DialogSource, or any direct calls to launchDialog().
Parameters:
returnValue - the value to be delivered in the the ReturnEvent
See Also:
ReturnEvent

getDialogService

public abstract DialogService getDialogService()
Returns an DialogService, which exposes a number of APIs needed by component and framework developers. This will only rarely be needed by page authors.

launchDialog

public abstract void launchDialog(javax.faces.component.UIViewRoot dialogRoot,
                                  Map dialogParameters,
                                  javax.faces.component.UIComponent source,
                                  boolean useWindow,
                                  Map windowProperties)
Launch a dialog, optionally raising it in a new dialog window.

The dialog will receive a new pageFlowScope map, which includes all the values of the currently available pageFlowScope as well as a set of properties passed to this function in the dialogParameters map. Changes to this newly created scope will not be visible once the dialog returns.

Parameters:
dialogRoot - the UIViewRoot for the page being launched
dialogParameters - a set of parameters to populate the newly created pageFlowScope
source - the UIComponent that launched the dialog and should receive the ReturnEvent when the dialog is complete.
useWindow - if true, use a popup window for the dialog if available on the current user agent device
windowProperties - the set of UI parameters used to modify the window, if one is used. The set of properties that\ are supported will depend on the RenderKit, but common examples include "width", "height", "top" and "left".

isPostback

public abstract boolean isPostback()
Returns true if JSF is currently processing a postback request. isPostback() will return false if this is a request for an initial render of a page (that is, if Apply Request Values never executes), or if during the request the user is navigated to a different page (because of a navigation rule, etc). For example, during a request that results in a navigation to a new page, isPostback() will return true from Apply Request Values to Invoke Application, then false afterwards; whereas if there was no navigation, it would return true

The value of this method is undefined during (or before) the Restore View phase, but can be used in the afterPhase() method of a PhaseListener for Restore View.

In general, use of this method and its exposed EL variable is discouraged. In practice, callers of this method have attempted to use isPostback as a proxy for some piece of application state. It is always better to model these cases in terms of the actual application state, as using isPostback is often neither an exact proxy for the application state, or as the application and view technology change, the validity of the isPostback proxy can drift from the application state that it is acting as a proxy for.

See Also:
isInitialRender()

isInitialRender

public abstract boolean isInitialRender()
Returns true if this request is the first request to render the page.

Use of this method (and its exposed EL variable) is discouraged. In practice, callers attempt to use the initial render of a page to represent a state better modeled in the application itself. In other cases, view scoped managed beans with @PostConstruct annotations might be more appropriate. In general, the only valid use case is as part of a minimal effort (but probably still incorrect) migration from uses of isPostback in 10.1.3 code to isInitialRender in version 11 code.

See Also:
isPostback()

isPartialRequest

public abstract boolean isPartialRequest(javax.faces.context.FacesContext context)
Method to indicate if this current HTTP request is a partial page rendering request.
Parameters:
context - the FacesContext object for the request we are processing
Returns:
is this request a PPR request?

isFurtherValidationNeeded

public abstract boolean isFurtherValidationNeeded()
Returns true if a framework providing additional validation on top of the faces lifecycle should run that validation. This value is currently only guaranteed to be meaningful at the end of the Update Model phase.

setFurtherValidationNeeded

public abstract void setFurtherValidationNeeded(boolean validationNeeded)
Used by internal ADF Faces code. Do not call.

isDebugOutput

public abstract boolean isDebugOutput()
Returns true if output should contain debugging information.

isClientValidationDisabled

public abstract boolean isClientValidationDisabled()
Returns true if client-side validation should be disabled.

getOutputMode

public String getOutputMode()

getOutputModeEnum

public AdfFacesContext.OutputMode getOutputModeEnum()
Returns the OutputMode enumeration
Returns:

getSkinFamily

public abstract String getSkinFamily()
Returns the name of the preferred skin family.

getAccessibilityMode

public abstract String getAccessibilityMode()
Returns the name of the current accessibility mode.

isRightToLeft

public abstract boolean isRightToLeft()
Returns true if the user should be shown output in right-to-left.

getNumberGroupingSeparator

public abstract char getNumberGroupingSeparator()
Return the separator used for groups of numbers. If NUL (zero), use the default separator for the current language.

getDecimalSeparator

public abstract char getDecimalSeparator()
Return the separator used as the decimal point. If NUL (zero), use the default separator for the current language.

getCurrencyCode

public abstract String getCurrencyCode()
Return the ISO 4217 currency code used by default for formatting currency fields when those fields do not specify an explicit currency field via their converter. If this returns null, the default code for the current locale will be used.

getTwoDigitYearStart

public abstract int getTwoDigitYearStart()
Returns the year offset for parsing years with only two digits. If not set this is defaulted to 1950 This is used by @link{oracle.adf.faces.view.converter.DateTimeConverter} while converting strings to Date object.

getOracleHelpServletUrl

@Deprecated
public String getOracleHelpServletUrl()
Deprecated. on 24-jan-2007, for 11.1.1.0.JI2. Use the new HelpProvider framework.
Return the URL to an Oracle Help for the Web servlet.

getHelpProvider

public abstract HelpProvider getHelpProvider()
Gets the HelpProvider that is registered in META-INF/adf-settings.xml.
See Also:
adf-settings.xml example

getHelpTopic

@Deprecated
public Map getHelpTopic()
Deprecated. on 24-jan-2007, for 11.1.1.0.JI2. Use the new HelpProvider framework.
Returns a Map that will accept topic names as keys, and return an URL as a result.

getHelpSystem

@Deprecated
public Map getHelpSystem()
Deprecated. on 24-jan-2007, for 11.1.1.0.JI2. Use the new HelpProvider framework.
Returns a Map that will accept help system properties as keys, and return an URL as a result.

getTimeZone

public abstract TimeZone getTimeZone()
Returns the default TimeZone used for interpreting and formatting date values.

getChangeManager

public ChangeManager getChangeManager()
Gets the ChangeManager for the current application.

getPersistentChangeManager

public abstract org.apache.myfaces.trinidad.change.ChangeManager getPersistentChangeManager()
Returns the persistent change manager registered through web.xml for the current application
Returns:
ChangeManager instance

getApplicationContextManager

@Deprecated
public abstract ApplicationContextManager getApplicationContextManager()
Deprecated. use RequestContext.getComponentContextManager() instead of this method.
Returns the ApplicationContextManager instance used to manage re-entrant application context invocation. This could occur if UIComponent.invokeOnComponent(FacesContext,String,ContextCallback) is called recursively, or in response to in-context event delivery. Any component or application artifact that modifies the application context (by for example setting request attributes or modifying a custom ELResolver) must use the ApplicationContextManager to register their changes to the application context during non-component traversals. For UIComponents, this is modifications that the components make during invokeOnComponent() and during in-context event delivery.
See Also:
ApplicationContextManager, ComponentContextManager

getPageFlowScopeProvider

public PageFlowScopeProvider getPageFlowScopeProvider()
Gets the PageFlowScopeProvider for the current application.

getPageResolver

public PageResolver getPageResolver()
Gets the PageResolver for the current application.

getRegionManager

public RegionManager getRegionManager()
Gets the RegionManager for the current application.

addPartialTarget

public abstract void addPartialTarget(javax.faces.component.UIComponent newTarget)
Add a component as a partial target. In response to a partial event, only components registered as partial targets are re-rendered. For a component to be successfully re-rendered when it is manually added with this API, it should have the "clientComponent" attribute set to true. If not, partial re-rendering may or may not work depending on the component.

addPartialTriggerListeners

public abstract void addPartialTriggerListeners(javax.faces.component.UIComponent listener,
                                                String[] trigger)
Adds a listener on a set of particular triggering components. If one of the named components gets updated in response to a partial event, then this listener component will be rerendered during the render phase (i.e. it will be added as a partialTarget). The list should consist of names suitable for use with the findComponent method on UIComponent.

partialUpdateNotify

public abstract void partialUpdateNotify(javax.faces.component.UIComponent updated)
Called when any component gets updated. Any partial target components listening on this component will be added to the partialTargets list in the render phase.

scrollComponentIntoView

public abstract void scrollComponentIntoView(javax.faces.component.UIComponent component,
                                             boolean focus)
Scrolls the view to the given component.
Parameters:
component - to scroll to in the view. This component must be in a valid context or the scrolling will fail.
focus - true if the component scrolled to has focus as well

getColorPalette

public abstract List<Color> getColorPalette(String name)
Returns a List that takes color palette name as key, and returns the color palette as a result.

getFormatter

public abstract Map getFormatter()
Returns a Map that performs message formatting with a recursive Map structure. The first key must be the message formatting mask, and the second the first parameter into the message. (The formatter Map supports only a single parameter at this time.)

getAgent

public Agent getAgent()
Returns the Agent information for the current context

saveComponent

public abstract Object saveComponent(javax.faces.component.UIComponent component)
Saves the state of a UIComponent tree into an Object. The Object will be serializable, unless a UIComponent in this tree contains a non-serializable property. This method does not check that condition.
Parameters:
component - the component
Returns:
an Object that can be passed to restoreComponent() to reinstantiate the state

restoreComponent

public abstract javax.faces.component.UIComponent restoreComponent(Object state)
                                                            throws ClassNotFoundException,
                                                                   InstantiationException,
                                                                   IllegalAccessException
Restores the state of a component.
Parameters:
state - an Object created by a prior call to saveComponent().
Returns:
the component
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getUriManager

public abstract UriManager getUriManager()
Retrieves an instance of UriManager for manipulation browser URIs
Returns:
UriManager instance

getCurrentPage

public abstract Page getCurrentPage()
Retrieves a current instance of the Page object for storing data specific to this page within the current window The Page object returned by this method should only be used during the current request. Subsequent requests should call getCurrentPage()
Returns:
current Page object

createPage

public abstract UnassociatedPage createPage()
Creates a new instance of the UnassociatedPage object that could be used to pass data to a different URL The UnassociatedPage object returned by this method should only be used during the current request. Subsequent requests should call getCurrentPage()
Returns:
UnassociatedPage object
See Also:
UnassociatedPage.encodeURL(String url)

getPostbackPayloadType

public AdfFacesContext.PayloadType getPostbackPayloadType()
Returns the type of postback payload that has been submitted for this request. By default, this will be PayloadType.FULL. Setting the "oracle.adf.view.rich.POSTBACK_PAYLOAD_TYPE" context parameter to "dirty" enables an optimization by which request paylaod sizes are filtered such that unmodified input component values may be omitted. This optimization helps reduce the size of request payloads and can also reduce the amount of EditableValueHolder lifecycle processing that occurs during postbacks.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
12c Release 1 (12.1.2.0.0)
E23185-01


Copyright © 2013 Oracle Corporation. All Rights Reserved.