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

E10652-05

oracle.adf.controller.struts.actions
Class StrutsPageLifecycle

java.lang.Object
  extended by oracle.adf.controller.lifecycle.PageLifecycle
      extended by oracle.adf.controller.struts.actions.StrutsPageLifecycle
All Implemented Interfaces:
Lifecycle
Direct Known Subclasses:
StrutsJspLifecycle

Deprecated. Use equivalent classes in oracle.adf.controller.v2

public class StrutsPageLifecycle
extends PageLifecycle

Base class for any Lifecycle running with the Struts controller. This is an adapted PageLifecycle to work with specific Struts feature like error reporting, named forward and form bean.

Since:
9.0.5

Field Summary
static java.lang.String formFileInputHandlerName
          Deprecated. A custom input handler used by bindings dealing with FormFile type
 
Fields inherited from class oracle.adf.controller.lifecycle.PageLifecycle
clazz, DISABLE_VALIDATE_TOKENS, eventParam, events, ordDomainInputHandlerName
 
Constructor Summary
StrutsPageLifecycle()
          Deprecated.  
 
Method Summary
 void findForward(LifecycleContext lcContext)
          Deprecated. Determine the ActionForward that will be returned by the Struts action executing the Lifecycle.
protected  boolean handleEvent(LifecycleContext lcContext, java.lang.String event)
          Deprecated. Handle an event.
 void initializeMethodParameters(LifecycleContext lcContext, oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
          Deprecated. This method is invoked before any ControlBinding or custom method is being executed.
protected  void initializeParameterValuesUsingExpressions(LifecycleContext lcContext, oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
          Deprecated. This method allows for initialization of the action binding's parameters by evaluating the expression values stored in the action definition.
 void invokeCustomMethod(LifecycleContext lcContext)
          Deprecated. Invoke custom method if one is defined in the mapping of the DataAction.
 void prepareModel(LifecycleContext lcContext)
          Deprecated. Give the opportunity for the data model to prepare and initialize.
 void processActionConfig(DataActionMapping mapping)
          Deprecated. Give the opportunity to the lifecyle to handle and possibly modify the config of the mapping.
 void processUpdateModel(LifecycleContext lcContext)
          Deprecated. Handle update using a Struts formbean In case of error the method setInputValue will not throw but instead the errors will be collected in the binding container.
 void refreshModel(LifecycleContext lcContext)
          Deprecated. Used to notify the model when updates are over with.
 void reportErrors(LifecycleContext lcContext)
          Deprecated. Report the error list to the view layer.
 boolean shouldAllowModelUpdate(LifecycleContext lcContext)
          Deprecated. Allows clients to determine whether the model should be updated.
protected  void updateModel(LifecycleContext lcContext, java.util.Map updatedValues)
          Deprecated. Apply each new values to the binding.
 
Methods inherited from class oracle.adf.controller.lifecycle.PageLifecycle
buildEventList, disableTokenValidationForRequest, findCtrlBinding, getEventMethod, getEventMethodFromCache, getRequestValues, handleError, handleLifecycle, hasErrors, initializeParameterValuesUsingRequestObject, invokeActionBinding, isNewValueForBinding, processComponentEvents, processEvent, setInputValue, shouldValidateToken, validateModelUpdates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formFileInputHandlerName

public static final java.lang.String formFileInputHandlerName
Deprecated. 
A custom input handler used by bindings dealing with FormFile type

See Also:
Constant Field Values
Constructor Detail

StrutsPageLifecycle

public StrutsPageLifecycle()
Deprecated. 
Method Detail

processActionConfig

public void processActionConfig(DataActionMapping mapping)
Deprecated. 
Give the opportunity to the lifecyle to handle and possibly modify the config of the mapping.

Parameters:
mapping - the action mapping
See Also:
DataActionMapping.freeze()

prepareModel

public void prepareModel(LifecycleContext lcContext)
                  throws java.lang.Exception
Deprecated. 
Give the opportunity for the data model to prepare and initialize. This method will throw if the data model cannot be prepared.

If you need to set bind variable values on query objects in the business services layer in order to properly prepare the model, then you can set them by overriding this method and doing it before calling the superclass.

If you need to reference prepared model values and/or update the values of any bindings in the binding container, then you can do it by overriding this method and doing it after calling the superclass. In the Struts case, prepare the ADF formBean (ADFStrutsForm) with the current binding container. Also if the token validation fails, clean the pending values in the formbean because they belongs to the wrong iterator.

Specified by:
prepareModel in interface Lifecycle
Overrides:
prepareModel in class PageLifecycle
Parameters:
lcContext - the lifecycle context
Throws:
java.lang.Exception

shouldAllowModelUpdate

public boolean shouldAllowModelUpdate(LifecycleContext lcContext)
Deprecated. 
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 PageLifecycle
Parameters:
lcContext - the lifecycle context.
Returns:
true, if the model should be updated during this lifecycle
See Also:
JUCtrlActionBinding.ignoreUpdates()

processUpdateModel

public void processUpdateModel(LifecycleContext lcContext)
Deprecated. 
Handle update using a Struts formbean In case of error the method setInputValue will not throw but instead the errors will be collected in the binding container.

Specified by:
processUpdateModel in interface Lifecycle
Overrides:
processUpdateModel in class PageLifecycle
Parameters:
lcContext - the lifecycle context

updateModel

protected void updateModel(LifecycleContext lcContext,
                           java.util.Map updatedValues)
Deprecated. 
Description copied from class: PageLifecycle
Apply each new values to the binding. The values are coming from a Map of values keyed by property name. In case of error the method setInputValue will not throw but instead the errors will be collected in the binding container.

Overrides:
updateModel in class PageLifecycle
Parameters:
lcContext - the lifecycle context
updatedValues - the map of values keyed by property name
See Also:
PageLifecycle.getRequestValues(oracle.adf.controller.lifecycle.LifecycleContext)

handleEvent

protected boolean handleEvent(LifecycleContext lcContext,
                              java.lang.String event)
                       throws java.lang.Exception
Deprecated. 
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 PageLifecycle
Parameters:
lcContext - the lifecycle context
event - the name of the event to handle
Returns:
true if the event was mapped to an action binding
Throws:
java.lang.Exception
See Also:
getEventActionBinding

initializeParameterValuesUsingExpressions

protected void initializeParameterValuesUsingExpressions(LifecycleContext lcContext,
                                                         oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
Deprecated. 
This method allows for initialization of the action binding's parameters by evaluating the expression values stored in the action definition. This will only be invoked for the action binding that represents the default method dropped on the action via the data control palette.

Parameters:
lcContext - the lifecycle context
actionBinding - the action bindings to be initialized

initializeMethodParameters

public void initializeMethodParameters(LifecycleContext lcContext,
                                       oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
Deprecated. 
Description copied from interface: Lifecycle
This method is invoked before any ControlBinding or custom method is being executed. Overriding this method gives an opportunity to set the parameters.

Specified by:
initializeMethodParameters in interface Lifecycle
Overrides:
initializeMethodParameters in class PageLifecycle
Parameters:
lcContext - the lifecycle context
actionBinding - the action binding object to initialize

invokeCustomMethod

public void invokeCustomMethod(LifecycleContext lcContext)
Deprecated. 
Invoke custom method if one is defined in the mapping of the DataAction.

Specified by:
invokeCustomMethod in interface Lifecycle
Overrides:
invokeCustomMethod in class PageLifecycle
Parameters:
lcContext - the lifecycle context
See Also:
DataActionMapping

refreshModel

public void refreshModel(LifecycleContext lcContext)
Deprecated. 
Description copied from interface: Lifecycle
Used to notify the model when updates are over with.

Specified by:
refreshModel in interface Lifecycle
Overrides:
refreshModel in class PageLifecycle
Parameters:
lcContext - the lifecycle context

reportErrors

public void reportErrors(LifecycleContext lcContext)
Deprecated. 
Report the error list to the view layer.

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 PageLifecycle
Parameters:
lcContext - the lifecycle context

findForward

public void findForward(LifecycleContext lcContext)
                 throws java.lang.Exception
Deprecated. 
Determine the ActionForward that will be returned by the Struts action executing the Lifecycle. This method only set the ActionForward object in the actionForward property of the DataActionContext. The DataAction executing the Lifecycle will return this value from the execute method.

If the actionForward property has already being set during a previous step of the Lifecycle, it respect this value and return. If there was errors during the Lifecycle, it uses the inputForward property of the action. The normal behavior for a DataForwardAction is to use the parameter property. For a DataAction it is to use the forward called "success".

Clients should override this method to select a forward based on the result of a custom method invocation. Since this method is called when the Lifecycle successfully executed or when an error was encountered, the user has to pay extra attention to always check for the error case using the hasError property.

    // Set my custom Action only when no error occured
    if ( ! actionContext.hasErrors())
    {
       actionContext.setActionForward(myActionForward);
    }
    else
    {
       super.findForward(actionContext);
    }
 

Specified by:
findForward in interface Lifecycle
Overrides:
findForward in class PageLifecycle
Parameters:
lcContext - the lifecycle context
Throws:
java.lang.Exception

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

E10652-05

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