public class FlowHandlerImpl
extends javax.faces.flow.FlowHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
ABANDONED_FLOW |
static String |
FLOW_RETURN_DEPTH_PARAM_NAME |
| Constructor and Description |
|---|
FlowHandlerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFlow(javax.faces.context.FacesContext context,
javax.faces.flow.Flow toAdd)
Add the argument |
void |
clientWindowTransition(javax.faces.context.FacesContext context)
Allow for flow transitions in the
case of components rendered by the renderers from
component-family |
int |
getAndClearReturnModeDepth(javax.faces.context.FacesContext context) |
javax.faces.flow.Flow |
getCurrentFlow(javax.faces.context.FacesContext context)
Return the currently active |
Map<Object,Object> |
getCurrentFlowScope()
Return the |
javax.faces.flow.Flow |
getFlow(javax.faces.context.FacesContext context,
String definingDocumentId,
String id)
Return the |
String |
getLastDisplayedViewId(javax.faces.context.FacesContext context)
Return the last displayed viewId for the
current flow, as returned by |
boolean |
isActive(javax.faces.context.FacesContext context,
String definingDocumentId,
String id)
Return |
void |
popReturnMode(javax.faces.context.FacesContext context)
Enable the correct handling of navigation when processing a return node. |
void |
pushReturnMode(javax.faces.context.FacesContext context)
Enable the correct handling of navigation when processing a return node. |
void |
transition(javax.faces.context.FacesContext context,
javax.faces.flow.Flow sourceFlow,
javax.faces.flow.Flow targetFlow,
javax.faces.flow.FlowCallNode outboundCallNode,
String toViewId)
Perform a transition in the flow
graph for the current user's |
public static final String ABANDONED_FLOW
public static final String FLOW_RETURN_DEPTH_PARAM_NAME
public Map<Object,Object> getCurrentFlowScope()
javax.faces.flow.FlowHandlerReturn the Map that backs
the #{flowScope} Jakarta Expression Language implicit object or null
if no flow is currently active.
getCurrentFlowScope in class javax.faces.flow.FlowHandlerMap for this flow scope.public javax.faces.flow.Flow getFlow(javax.faces.context.FacesContext context,
String definingDocumentId,
String id)
javax.faces.flow.FlowHandlerReturn the Flow whose id is equivalent to the argument id, within the scope of
the argument definingDocument.
getFlow in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.definingDocumentId - An application unique identifier
for the document in which the returned flow is defined.id - the id of a Flow, unique within the
scope of the definingDocument.Flow for the argument identifiers.public void addFlow(javax.faces.context.FacesContext context,
javax.faces.flow.Flow toAdd)
javax.faces.flow.FlowHandlerAdd the argument Flow to the
collection of Flows known to the current
application. The implementation must be thread safe.
addFlow in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.toAdd - the Flow to add.public boolean isActive(javax.faces.context.FacesContext context,
String definingDocumentId,
String id)
javax.faces.flow.FlowHandlerReturn true if and only if
the flow referenced by the argument definingDocument and
id is currently active.
isActive in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.definingDocumentId - An application unique identifier
for the document in which the returned flow is defined.id - the id of a Flow, unique within the
scope of the definingDocument.public javax.faces.flow.Flow getCurrentFlow(javax.faces.context.FacesContext context)
javax.faces.flow.FlowHandlerReturn the currently active Flow for the argument FacesContext, or null if
no flow is active. A Flow must always be associated with
exactly one ClientWindow, but a
ClientWindow may have multiple Flows.
If FlowHandler.pushReturnMode(javax.faces.context.FacesContext) had been called with true as the
argument before invoking this method, return the preceding flow on
the stack instead of the actual current flow, or null if there
is no preceding flow. Otherwise, return the current flow.
getCurrentFlow in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.Flow or null if no flow is activepublic String getLastDisplayedViewId(javax.faces.context.FacesContext context)
javax.faces.flow.FlowHandlerReturn the last displayed viewId for the
current flow, as returned by FlowHandler.getCurrentFlow(javax.faces.context.FacesContext),
or null if there is no current flow.
getLastDisplayedViewId in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.public int getAndClearReturnModeDepth(javax.faces.context.FacesContext context)
public void pushReturnMode(javax.faces.context.FacesContext context)
javax.faces.flow.FlowHandlerEnable the correct handling of navigation
when processing a return node. The default NavigationHandler
specification requires calling this method before processing
the navigation rules for the flow return, and calling FlowHandler.popReturnMode(javax.faces.context.FacesContext),
from a finally block, immediately afterward.
pushReturnMode in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.public void popReturnMode(javax.faces.context.FacesContext context)
javax.faces.flow.FlowHandlerEnable the correct handling of navigation
when processing a return node. The default NavigationHandler
specification requires calling this method from a finally block,
immediately attempting to process the navigation rules in the context
of a flow return.
popReturnMode in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.public void transition(javax.faces.context.FacesContext context,
javax.faces.flow.Flow sourceFlow,
javax.faces.flow.Flow targetFlow,
javax.faces.flow.FlowCallNode outboundCallNode,
String toViewId)
javax.faces.flow.FlowHandlerPerform a transition in the flow
graph for the current user's ClientWindow. Obtain references to the
Flow instances corresponding to the origin and
destination arguments. If the origin Flow is
equal to the destination Flow, take no action and return
null. Otherwise, if the outboundCallNode
argument is non-null save aside the outbound parameters.
For discussion evaluatedParams is a data
structure that stores the evaluated values of any outbound
parameters. It is necessary to evaluate these values before
popping any flow scopes because the values may refer to scoped
instances that need to be passed to the target flow, but will not
be available once the new scope is activated. Save aside the
outbound parameters using the following algorithm.
If the
outboundParametersproperty ofoutboundCallNodeis non-nulland not empty, and theinboundParametersproperty of the target flow is non-nulland not empty, for each entry in the outbound parameters whose name matches an entry in the inbound parameters, evaluate the value of the parameter, and put the evaluated value into evaluatedParams under the corresponding name. Otherwise, consider evaluatedParams to be empty.
If the destination Flow is a sub-flow of the origin Flow push the destination Flow onto the flow data
structure and return the destination Flow. Otherwise, pop
the current Flow from the flow data structure. If the
destination Flow is non-null, make the destination Flow the current flow, pushing it onto the data
structure. If evaluatedParams is not empty, for
each entry, find the corresponding parameter in the target flow's
inbound parameters and call its setValue method, passing
the value from evaluatedParams.
transition in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.sourceFlow - the current Flow, or null if
there is no source flow.targetFlow - the destination Flow, or null
if there is no destination flow.outboundCallNode - the flow call node causing this
transition, or null if this transition is not caused by a
flow call.toViewId - the viewId of the view being displayed as a result of
this transition. This parameter makes it possible to implement FlowHandler.getLastDisplayedViewId(javax.faces.context.FacesContext).public void clientWindowTransition(javax.faces.context.FacesContext context)
javax.faces.flow.FlowHandlerAllow for flow transitions in the
case of components rendered by the renderers from
component-family javax.faces.OutcomeTarget. These
transitions must happen at the front of the request processing
lifecycle due to the HTTP GET based nature of such components.
Therefore, this method is called from the restore view phase of
the lifecycle.
Let flowId be the value in the request parameter map
for the parameter whose name is given by the value of FlowHandler.FLOW_ID_REQUEST_PARAM_NAME. Let toFlowDocumentId be
the value in the request parameter map for the paramater whose
name is given by the value of FlowHandler.TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME. If
toFlowDocumentId is null, take no action
and return. Otherwise, let sourceFlow be the return
from FlowHandler.getCurrentFlow(javax.faces.context.FacesContext). A
null value indicates there is no current flow, which
will be the case if this navigation is trying to enter a flow. If
flowId is not null and
toFlowDocumentId is not equal to the
value of FlowHandler.NULL_FLOW, let targetFlow be the
result of calling FlowHandler.getFlow(javax.faces.context.FacesContext, java.lang.String,
java.lang.String), passing toFlowDocumentId and
flowId as the last two arguments, respectively. If the
result is non-null, let flowCallNode be the
return from calling Flow.getFlowCall(javax.faces.flow.Flow) on the
sourceFlow, passing targetFlow as the argument.
Otherwise, targetFlow and flowCallNode must
remain null, indicating that this is a flow
return. Call FacesContext.getViewRoot() and let toViewId
be the the return from calling UIViewRoot.getViewId()
on it.
Call, FlowHandler.transition(javax.faces.context.FacesContext, javax.faces.flow.Flow, javax.faces.flow.Flow, javax.faces.flow.FlowCallNode, java.lang.String), passing the arguments gathered in
the preceding algorithm.
clientWindowTransition in class javax.faces.flow.FlowHandlercontext - the FacesContext for the current request.Copyright © 2010–2024 JBoss by Red Hat. All rights reserved.