|
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.v2.lifecycle.Phases oracle.adf.controller.v2.lifecycle.PageLifecycle oracle.adf.controller.v2.lifecycle.PageLifecycleImpl oracle.adf.controller.v2.struts.lifecycle.StrutsPageLifecycle
public class StrutsPageLifecycle
Base class for any Lifecycle running with the Struts controller.
This is an adapted PageLifecycleImpl
to work with specific Struts feature like error reporting,
named forward and form bean.
Field Summary | |
---|---|
static java.lang.String |
formFileInputHandlerName
A custom input handler used by bindings dealing with FormFile type |
Fields inherited from class oracle.adf.controller.v2.lifecycle.PageLifecycleImpl |
---|
DISABLE_VALIDATE_TOKENS, ordDomainInputHandlerName |
Fields inherited from class oracle.adf.controller.v2.lifecycle.PageLifecycle |
---|
clazz, eventParam, events |
Constructor Summary | |
---|---|
StrutsPageLifecycle()
|
Method Summary | |
---|---|
protected void |
buildInputValues(PageLifecycleContext plcContext)
A Struts specific implementation that only deals with values coming from the ADFStrutsForm. |
void |
findForward(PageLifecycleContext plcContext)
Determine the ActionForward that will be returned by the Struts action executing the Lifecycle. |
java.lang.Class |
getLifecycleContextClass()
Returns the LifecycleContext class used by this PageLifecycle. |
protected boolean |
handleEvent(PageLifecycleContext plcContext,
java.lang.String event)
Handle an event. |
void |
prepareModel(LifecycleContext context)
Give the opportunity for the data model to prepare and initialize. |
void |
prepareRender(LifecycleContext lfContext)
Last phase before rendering a page. |
void |
processUpdateModel(LifecycleContext context)
Update the data model with new and validated input values. |
protected void |
registerCustomInputHandler(PageLifecycleContext context)
Register formFileInputHandlerName custom input handler to the binding context. |
void |
reportErrors(PageLifecycleContext plcContext)
Provide the opportunity to build an error list in a format appropriate to the view layer. |
boolean |
shouldAllowModelUpdate(PageLifecycleContext plcContext)
This method is called during the processUpdateModel phase. |
Methods inherited from class oracle.adf.controller.v2.lifecycle.PageLifecycleImpl |
---|
applyInputValues, buildEventList, disableTokenValidationForRequest, executeEvent, findCtrlBinding, getEventMethod, getToken, handleError, hasErrors, initContext, initializeMethodParameters, initializeParameterValuesUsingRequestObject, invokeActionBinding, invokeEventMethod, isRecoverableException, metadataCommit, processComponentEvents, processEvent, shouldValidateToken, validateInputValues, validateModelUpdates |
Methods inherited from class oracle.adf.controller.v2.lifecycle.PageLifecycle |
---|
getEventMethodFromCache |
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 java.lang.Class getLifecycleContextClass()
StrutsPageLifecycleContext
getLifecycleContextClass
in class PageLifecycle
protected void registerCustomInputHandler(PageLifecycleContext context)
registerCustomInputHandler
in class PageLifecycleImpl
public void prepareModel(LifecycleContext context)
PageLifecycleImpl
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.
prepareModel
in class PageLifecycleImpl
public boolean shouldAllowModelUpdate(PageLifecycleContext plcContext)
PageLifecycle
shouldAllowModelUpdate
in class PageLifecycleImpl
JUCtrlActionBinding.ignoreUpdates()
public void processUpdateModel(LifecycleContext context)
PageLifecycleImpl
This phase is executed only if the
shouldAllowModelUpdate
method returns
true.
In case of error when setting the value to the model the errors will not be thrown but collected in the binding container.
processUpdateModel
in class PageLifecycleImpl
public void prepareRender(LifecycleContext lfContext)
Phases
During this phase the model is refreshed.
prepareRender
in class PageLifecycleImpl
public void reportErrors(PageLifecycleContext plcContext)
reportErrors
in class PageLifecycleImpl
protected boolean handleEvent(PageLifecycleContext plcContext, java.lang.String event) throws java.lang.Exception
public void onEvent(LifecycleContext ctx) { // Use the following method to execute the possible // action binding associated with this event ctx.getEventActionBinding().invoke(); }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 PageLifecycleImpl
plcContext
- the PageLifecycle contextevent
- the name of the event to handle
true
if the event was mapped to an action binding
java.lang.Exception
getEventActionBinding
public void findForward(PageLifecycleContext plcContext) 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 ( ! hasErrors() ) { context.setActionForward(myActionForward); } else { super.findForward(context); }
findForward
in class PageLifecycleImpl
java.lang.Exception
protected void buildInputValues(PageLifecycleContext plcContext)
buildInputValues
in class PageLifecycleImpl
plcContext
- the Pagelifecycle context
|
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 |