ADF Controller v9.0.5

oracle.adf.controller.struts.actions
Class StrutsUixLifecycle

java.lang.Object
  extended byoracle.adf.controller.lifecycle.PageLifecycle
      extended byoracle.adf.controller.struts.actions.StrutsPageLifecycle
          extended byoracle.adf.controller.struts.actions.StrutsUixLifecycle
All Implemented Interfaces:
Lifecycle

public class StrutsUixLifecycle
extends StrutsPageLifecycle

Customized Struts lifecycle to support UIX.

Since:
9.0.5

Field Summary
 
Fields inherited from class oracle.adf.controller.lifecycle.PageLifecycle
clazz, eventParam, events
 
Constructor Summary
StrutsUixLifecycle()
           
 
Method Summary
protected  boolean handleEvent(LifecycleContext lcContext, java.lang.String event)
          Handle an event.
 void handleLifecycle(LifecycleContext lcContext)
          Define all the phases of the lifecycle and the order they are executed.. This is the entry point to execute the all the phases of the lifecycle.
Overide this method to add logic before or after the lifecycle execution.

Define the steps of the PageLifecycle processing:

  • prepares the context and build the event list
  • prepare the model for updates
  • process model updates
  • performs validation
  • process component event
  • process custom method
  • handles errors
.
 void processActionConfig(DataActionMapping mapping)
          Give the opportunity to the lifecyle to handle and possibly modify the config of the mapping.
 void processComponentEvents(LifecycleContext lcContext)
          Handle any events in the action binding list previously built in processUpdateModel using the buildEventList method.
 void reportErrors(LifecycleContext lcContext)
          

This method retrieve the list of error from the dataControl and treat them as fit for the PageLifeCycle implementation. Retrieves the errors from the data control and reports then to the user. This method retrieve the list of error from the dataControl and treat them as fit for the PageLifeCycle implementation.

 boolean shouldAllowModelUpdate(LifecycleContext lcContext)
          Allows clients to determine whether the model should be updated..

Disable data model updates in two cases:

  • When specific action like 'rollback' will be executed during the lifecycle. This is done by calling the ignoreUpdates method or each action in the event list. The custom method ignoreUpdates is also called.
  • When the binding container of the previous page does not match. This is to get around the case where updates from the previous page in the forward chain are applied.
Bypassing update might be necessary for operations such as rollback or custom methods that want to veto the change.
Overide this method if you need to add logic to skip data model updates.

This is the stuff needed to bypass update on some method like rollback. Also give a chance to the custom method to veto the change. This is the stuff needed to bypass update on some method like rollback.

 
Methods inherited from class oracle.adf.controller.struts.actions.StrutsPageLifecycle
findForward, initializeMethodParameters, initializeParameterValuesUsingExpressions, invokeCustomMethod, isNewValueForBinding, prepareModel, processUpdateModel, setInputValue
 
Methods inherited from class oracle.adf.controller.lifecycle.PageLifecycle
buildEventList, findCtrlBinding, getEventMethod, getEventMethodFromCache, getRequestValues, handleError, hasErrors, initializeParameterValuesUsingRequestObject, invokeActionBinding, processEvent, refreshModel, updateModel, validateModelUpdates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrutsUixLifecycle

public StrutsUixLifecycle()
Method Detail

processActionConfig

public void processActionConfig(DataActionMapping mapping)
Description copied from class: StrutsPageLifecycle
Give the opportunity to the lifecyle to handle and possibly modify the config of the mapping.

Overrides:
processActionConfig in class StrutsPageLifecycle
Parameters:
mapping - the action mapping
See Also:
DataActionMapping.freeze()

handleLifecycle

public void handleLifecycle(LifecycleContext lcContext)
                     throws java.lang.Exception
Description copied from class: PageLifecycle
Define all the phases of the lifecycle and the order they are executed.. This is the entry point to execute the all the phases of the lifecycle.
Overide this method to add logic before or after the lifecycle execution.

Define the steps of the PageLifecycle processing:

Specified by:
handleLifecycle in interface Lifecycle
Overrides:
handleLifecycle in class PageLifecycle
Throws:
java.lang.Exception

shouldAllowModelUpdate

public boolean shouldAllowModelUpdate(LifecycleContext lcContext)
Description copied from class: StrutsPageLifecycle
Allows clients to determine whether the model should be updated..

Disable data model updates in two cases:

Bypassing update might be necessary for operations such as rollback or custom methods that want to veto the change.
Overide this method if you need to add logic to skip data model updates.

This is the stuff needed to bypass update on some method like rollback. Also give a chance to the custom method to veto the change.

Specified by:
shouldAllowModelUpdate in interface Lifecycle
Overrides:
shouldAllowModelUpdate in class StrutsPageLifecycle

processComponentEvents

public void processComponentEvents(LifecycleContext lcContext)
                            throws java.lang.Exception
Description copied from interface: Lifecycle
Handle any events in the action binding list previously built in processUpdateModel using the buildEventList method.

Specified by:
processComponentEvents in interface Lifecycle
Overrides:
processComponentEvents in class PageLifecycle
Throws:
java.lang.Exception

reportErrors

public void reportErrors(LifecycleContext lcContext)
Description copied from class: StrutsPageLifecycle

This method retrieve the list of error from the dataControl and treat them as fit for the PageLifeCycle implementation. Retrieves the errors from the data control and reports then to the user.

Specified by:
reportErrors in interface Lifecycle
Overrides:
reportErrors in class StrutsPageLifecycle

handleEvent

protected boolean handleEvent(LifecycleContext lcContext,
                              java.lang.String event)
                       throws java.lang.Exception
Description copied from class: StrutsPageLifecycle
Handle an event. An event handler can be a method defined in a subclass of this PageLifecycle. To be recognized as an event handler the method signature need to be similar to:
 public void onEvent(DataActionContext ctx)
 {
    // Use the following method to execute the possible
    // action binding associated with this event
    ctx.getEventActionBinding().doit();
 }
 
Where Event is the name of the event.

An event can also be an action binding with the same name of the event present in the current binding container.

In addition to the super class behavior, the event name is used as a automatic forward mechanism. If it exist an action forward of the same name of the event, this action forward is set to the context to be the return value of the DataAction execute method.

Overrides:
handleEvent in class StrutsPageLifecycle
Throws:
java.lang.Exception
See Also:
getEventActionBinding

ADF Controller v9.0.5

 

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