|
Oracle Fusion Middleware Java API Reference for Oracle ADF Lifecycle 11g Release 1 (11.1.1.4.0) E10652-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.adf.controller.lifecycle.PageLifecycle oracle.adf.controller.struts.actions.StrutsPageLifecycle
public class StrutsPageLifecycle
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.
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 |
---|
public static final java.lang.String formFileInputHandlerName
Constructor Detail |
---|
public StrutsPageLifecycle()
Method Detail |
---|
public void processActionConfig(DataActionMapping mapping)
mapping
- the action mappingDataActionMapping.freeze()
public void prepareModel(LifecycleContext lcContext) throws java.lang.Exception
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.
prepareModel
in interface Lifecycle
prepareModel
in class PageLifecycle
lcContext
- the lifecycle context
java.lang.Exception
public boolean shouldAllowModelUpdate(LifecycleContext lcContext)
Disable data model updates in two cases:
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.
shouldAllowModelUpdate
in interface Lifecycle
shouldAllowModelUpdate
in class PageLifecycle
lcContext
- the lifecycle context.
true
, if the model should be updated
during this lifecycleJUCtrlActionBinding.ignoreUpdates()
public void processUpdateModel(LifecycleContext lcContext)
processUpdateModel
in interface Lifecycle
processUpdateModel
in class PageLifecycle
lcContext
- the lifecycle contextprotected void updateModel(LifecycleContext lcContext, java.util.Map updatedValues)
PageLifecycle
updateModel
in class PageLifecycle
lcContext
- the lifecycle contextupdatedValues
- the map of values keyed by property namePageLifecycle.getRequestValues(oracle.adf.controller.lifecycle.LifecycleContext)
protected boolean handleEvent(LifecycleContext lcContext, java.lang.String event) throws java.lang.Exception
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.
handleEvent
in class PageLifecycle
lcContext
- the lifecycle contextevent
- the name of the event to handle
true
if the event was mapped to an action binding
java.lang.Exception
getEventActionBinding
protected void initializeParameterValuesUsingExpressions(LifecycleContext lcContext, oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
lcContext
- the lifecycle contextactionBinding
- the action bindings to be initializedpublic void initializeMethodParameters(LifecycleContext lcContext, oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
Lifecycle
initializeMethodParameters
in interface Lifecycle
initializeMethodParameters
in class PageLifecycle
lcContext
- the lifecycle contextactionBinding
- the action binding object to initializepublic void invokeCustomMethod(LifecycleContext lcContext)
mapping
of the DataAction.
invokeCustomMethod
in interface Lifecycle
invokeCustomMethod
in class PageLifecycle
lcContext
- the lifecycle contextDataActionMapping
public void refreshModel(LifecycleContext lcContext)
Lifecycle
refreshModel
in interface Lifecycle
refreshModel
in class PageLifecycle
lcContext
- the lifecycle contextpublic 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.
reportErrors
in interface Lifecycle
reportErrors
in class PageLifecycle
lcContext
- the lifecycle contextpublic void findForward(LifecycleContext lcContext) throws java.lang.Exception
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); }
findForward
in interface Lifecycle
findForward
in class PageLifecycle
lcContext
- the lifecycle context
java.lang.Exception
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Lifecycle 11g Release 1 (11.1.1.4.0) E10652-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |