Oracle Fusion Middleware Java API Reference for Oracle ADF Lifecycle
11g Release 1 (11.1.1.7.0)

E10652-08

oracle.adf.controller.v2.context
Class PageLifecycleContext

java.lang.Object
  extended by oracle.adf.controller.v2.context.LifecycleContext
      extended by oracle.adf.controller.v2.context.PageLifecycleContext
Direct Known Subclasses:
StrutsPageLifecycleContext

public class PageLifecycleContext
extends LifecycleContext

PageLifecycleContext contains all the state information that will be kept during the PageLifecycle. It is passed as a parameter of each phase execution.

Since it extends the HashMap class it can be use to append additional user data.

This context object lives for the duration of the current Lifecycle.

Since:
10.1.3

Field Summary
protected static java.lang.String ACTION_BINDING_KEY
           
protected static java.lang.String ALLOW_MODEL_UPDATE_KEY
           
protected static java.lang.String CONTROL_ACTION_BINDINGS_KEY
           
static java.lang.String EVENT_METHOD_PREFIX
          Prefix used for each event method.
static java.lang.String EVENT_PREFIX
          The default value to be used by the lifecycle to reconize an event in a parameter name.
protected static java.lang.String EVENT_PREFIX_KEY
           
protected static java.lang.String EVENTS_KEY
           
protected static java.lang.String FORWARD_PATH_BINDINGS_KEY
           
protected static java.lang.String REDIRECT_BINDINGS_KEY
           
protected static java.lang.String UPDATED_VALUES_KEY
           
protected static java.lang.String VALIDATE_ERROR_KEY
           
 
Fields inherited from class oracle.adf.controller.v2.context.LifecycleContext
envMap, PAGE_LIFECYCLE_KEY, PATH_KEY
 
Constructor Summary
  PageLifecycleContext(java.util.Map envMap)
           
protected PageLifecycleContext(java.util.Map envMap, boolean initController)
           
 
Method Summary
 void addControlActionBinding(java.lang.String event, oracle.adf.model.OperationBinding actionBinding)
          This method add an action binding to the collection of action being executed.
 void addEvent(java.lang.String event)
          Add an event name to the list of event to be handled during this lifecycle.
 java.util.Map getControlActionBindings()
          Retrieve a list of all action binding keyed by event name.
 oracle.adf.model.OperationBinding getEventActionBinding()
          Retrieve the ActionBinding associated with the current event.
 java.lang.String getEventPrefix()
          Retrieve the event prefix from the context.
 java.util.List getEvents()
          Retrieve the list of event names to be handled during this lifecycle.
 java.lang.String getForwardPath()
          Retrieve the path of the page that the Lifecycle will forward to.
 java.util.Map getInputValidationErrors()
          Retrieve errors that occured during validateInputValues phase
 java.util.Map getParameterMap()
          Retrieve a map of the parameters for the current request.
 boolean getRedirect()
          Retrieve the redirect setting from the context.
 java.util.Map getUpdatedValues()
           
 void setEventActionBinding(oracle.adf.model.OperationBinding action)
          Set the ActionBinding for the current event.
 void setEventPrefix(java.lang.String prefix)
          Set the prefix that will be used to reconize event request parameters.
 void setForwardPath(java.lang.String path)
          Set the path of the page to which the Lifecycle should forward.
 void setInputValidationErrors(java.util.Map errors)
          Cache errors occuring during validateInputValues phase
 void setRedirect(boolean redirect)
          Specify if the page path information defined using the setForwardPath should be use to forward the request or redirect the response.
 void setUpdatedValues(java.util.Map updatedValues)
           
 
Methods inherited from class oracle.adf.controller.v2.context.LifecycleContext
getBindingContainer, getBindingContext, getCurrentInstance, getEnvironment, getInstance, getInstance, getPageController, getPageLifecycle, getPagePhaseListener, getPath, getPrepareRender, initControllerClass, prepareRender, resetControllerClass, setPageController, setPageLifecycle, setPagePhaseListener, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_PREFIX

public static final java.lang.String EVENT_PREFIX
The default value to be used by the lifecycle to reconize an event in a parameter name.

See Also:
Constant Field Values

EVENT_METHOD_PREFIX

public static final java.lang.String EVENT_METHOD_PREFIX
Prefix used for each event method.

See Also:
Constant Field Values

UPDATED_VALUES_KEY

protected static final java.lang.String UPDATED_VALUES_KEY
See Also:
Constant Field Values

VALIDATE_ERROR_KEY

protected static final java.lang.String VALIDATE_ERROR_KEY
See Also:
Constant Field Values

CONTROL_ACTION_BINDINGS_KEY

protected static final java.lang.String CONTROL_ACTION_BINDINGS_KEY
See Also:
Constant Field Values

EVENT_PREFIX_KEY

protected static final java.lang.String EVENT_PREFIX_KEY
See Also:
Constant Field Values

EVENTS_KEY

protected static final java.lang.String EVENTS_KEY
See Also:
Constant Field Values

ACTION_BINDING_KEY

protected static final java.lang.String ACTION_BINDING_KEY
See Also:
Constant Field Values

ALLOW_MODEL_UPDATE_KEY

protected static final java.lang.String ALLOW_MODEL_UPDATE_KEY
See Also:
Constant Field Values

FORWARD_PATH_BINDINGS_KEY

protected static final java.lang.String FORWARD_PATH_BINDINGS_KEY
See Also:
Constant Field Values

REDIRECT_BINDINGS_KEY

protected static final java.lang.String REDIRECT_BINDINGS_KEY
See Also:
Constant Field Values
Constructor Detail

PageLifecycleContext

public PageLifecycleContext(java.util.Map envMap)

PageLifecycleContext

protected PageLifecycleContext(java.util.Map envMap,
                               boolean initController)
Method Detail

getParameterMap

public java.util.Map getParameterMap()
Retrieve a map of the parameters for the current request.

Returns:
the map

setUpdatedValues

public void setUpdatedValues(java.util.Map updatedValues)

getUpdatedValues

public java.util.Map getUpdatedValues()

setInputValidationErrors

public void setInputValidationErrors(java.util.Map errors)
Cache errors occuring during validateInputValues phase


getInputValidationErrors

public java.util.Map getInputValidationErrors()
Retrieve errors that occured during validateInputValues phase


addControlActionBinding

public void addControlActionBinding(java.lang.String event,
                                    oracle.adf.model.OperationBinding actionBinding)
This method add an action binding to the collection of action being executed. Each action binding is keyed by an event name.

Parameters:
event - an event name
actionBinding - the action binding to be associated with the event

getControlActionBindings

public java.util.Map getControlActionBindings()
Retrieve a list of all action binding keyed by event name.

Returns:
Map of control action bindings

addEvent

public void addEvent(java.lang.String event)
Add an event name to the list of event to be handled during this lifecycle.

Parameters:
event - an event name

getEvents

public java.util.List getEvents()
Retrieve the list of event names to be handled during this lifecycle.

Returns:
List of event names to be handled.
See Also:
Phases.applyInputValues(oracle.adf.controller.v2.context.LifecycleContext)

setEventActionBinding

public void setEventActionBinding(oracle.adf.model.OperationBinding action)
Set the ActionBinding for the current event. This is used internally to prepare the context before calling the event handler.

Parameters:
action - Action binding to invoke as the event's default action.

getEventActionBinding

public oracle.adf.model.OperationBinding getEventActionBinding()
Retrieve the ActionBinding associated with the current event. This is usefull when you overide the handler for a specific event because it allows you to execute the associated ActionBinding. The default handler always execute the ActionBinding.

Here is an example for an event named Commit:

 public void onCommit(PageLifecycleContext ctx)
 {
    // write pre-execution logic here
    
    ctx.getEventActionBinding().invoke();
    
    // write post-execution logic here
 }
 

Return null is no ActionBinding is associated with this event.

Returns:
an OperationBinding

setEventPrefix

public void setEventPrefix(java.lang.String prefix)

Set the prefix that will be used to reconize event request parameters. To change the default prefix "event", call this method with a different prefix every time the lifecycle context is initialized.

?event=xxx

name="event_xxx"

Parameters:
prefix - the new prefix string
See Also:
EVENT_PREFIX

getEventPrefix

public java.lang.String getEventPrefix()
Retrieve the event prefix from the context.

Returns:
the prefix string
See Also:
EVENT_PREFIX

setForwardPath

public void setForwardPath(java.lang.String path)
Set the path of the page to which the Lifecycle should forward.

Parameters:
path - Relative path of next page.
See Also:
PageLifecycle.findForward(oracle.adf.controller.v2.context.PageLifecycleContext), setRedirect(boolean)

getForwardPath

public java.lang.String getForwardPath()
Retrieve the path of the page that the Lifecycle will forward to.

Returns:
Path of next page
See Also:
PageLifecycle.findForward(oracle.adf.controller.v2.context.PageLifecycleContext)

setRedirect

public void setRedirect(boolean redirect)
Specify if the page path information defined using the setForwardPath should be use to forward the request or redirect the response.

Parameters:
redirect - a boolean
See Also:
setForwardPath(java.lang.String), PageLifecycle.findForward(oracle.adf.controller.v2.context.PageLifecycleContext)

getRedirect

public boolean getRedirect()
Retrieve the redirect setting from the context.

Returns:
the value of the redirect flag.
See Also:
setRedirect(boolean)

Oracle Fusion Middleware Java API Reference for Oracle ADF Lifecycle
11g Release 1 (11.1.1.7.0)

E10652-08

Copyright © 1997, 2013, Oracle. All rights reserved.