public class NavigationHandlerImpl extends ConfigurableNavigationHandler
NavigationHandlerImpl is the class that implements default navigation handling. Refer to section 7.4.2 of the specification for more details. PENDING: Make independent of ApplicationAssociate.
Constructor and Description |
---|
NavigationHandlerImpl()
This constructor uses the current
ApplicationAssociate instance to obtain the
navigation mappings used to make navigational decisions. |
Modifier and Type | Method and Description |
---|---|
NavigationCase |
getNavigationCase(FacesContext context,
String fromAction,
String outcome)
Return the |
NavigationCase |
getNavigationCase(FacesContext context,
String fromAction,
String outcome,
String toFlowDocumentId)
Return the |
Map<String,Set<NavigationCase>> |
getNavigationCases()
Return a |
void |
handleNavigation(FacesContext context,
String fromAction,
String outcome)
Perform navigation processing based on the state
information in the specified
FacesContext , plus the outcome string returned by an
executed application action. |
void |
handleNavigation(FacesContext context,
String fromAction,
String outcome,
String toFlowDocumentId)
Overloaded variant of
|
void |
inspectFlow(FacesContext context,
Flow flow)
Called by the flow system to cause the flow to be inspected for navigation rules. |
static boolean |
isResetFlowHandlerState(FacesContext facesContext) |
static void |
setResetFlowHandlerStateIfUnset(FacesContext facesContext,
boolean resetFlowHandlerState) |
static void |
unsetResetFlowHandlerState(FacesContext facesContext) |
performNavigation
public NavigationHandlerImpl()
ApplicationAssociate
instance to obtain the
navigation mappings used to make navigational decisions.public static boolean isResetFlowHandlerState(FacesContext facesContext)
public static void setResetFlowHandlerStateIfUnset(FacesContext facesContext, boolean resetFlowHandlerState)
public static void unsetResetFlowHandlerState(FacesContext facesContext)
public NavigationCase getNavigationCase(FacesContext context, String fromAction, String outcome)
ConfigurableNavigationHandler
Return the NavigationCase
representing the navigation that would be taken had
NavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
been called with the same arguments or
null
if there is no such case.
getNavigationCase
in class ConfigurableNavigationHandler
context
- The FacesContext
for the current requestfromAction
- The action binding expression that was evaluated to retrieve the specified
outcome, or null
if the outcome was acquired by some other meansoutcome
- The logical outcome returned by a previous invoked application action (which
may be null
)null
.ConfigurableNavigationHandler.getNavigationCase(javax.faces.context.FacesContext,
String, String)
public NavigationCase getNavigationCase(FacesContext context, String fromAction, String outcome, String toFlowDocumentId)
ConfigurableNavigationHandler
Return the NavigationCase
representing the navigation that would be taken had
NavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
been called with the same arguments or
null
if there is no such case. Implementations that comply the version of the
specification in which this method was introduced must override this method. For
compatibility with decorated implementations that comply with an earlier version of the
specification, an implementation is provided that simply calls through to
ConfigurableNavigationHandler.getNavigationCase(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
,
ignoring the toFlowDocumentId
parameter.
getNavigationCase
in class ConfigurableNavigationHandler
context
- The FacesContext
for the current requestfromAction
- The action binding expression that was evaluated to retrieve the specified
outcome, or null
if the outcome was acquired by some other meansoutcome
- The logical outcome returned by a previous invoked application action (which
may be null
)toFlowDocumentId
- The value of the toFlowDocumentId
property for the
navigation case (which may be null
)null
.public Map<String,Set<NavigationCase>> getNavigationCases()
ConfigurableNavigationHandler
Return a Map<String,
Set<NavigationCase>>
where the keys are <from-view-id>
values and the values are Set<NavigationCase>
where each element in the
Set is a NavigationCase
that applies to that <from-view-id>
.
The implementation must support live modifications to this Map
.
getNavigationCases
in class ConfigurableNavigationHandler
ConfigurableNavigationHandler.getNavigationCases()
public void inspectFlow(FacesContext context, Flow flow)
ConfigurableNavigationHandler
Called by the flow system to cause the flow to be inspected for navigation rules. For backward compatibility with earlier implementations, an empty method is provided.
inspectFlow
in class ConfigurableNavigationHandler
context
- the Faces context.flow
- the flow.public void handleNavigation(FacesContext context, String fromAction, String outcome)
NavigationHandler
Perform navigation processing based on the state
information in the specified FacesContext
, plus the outcome string returned by an
executed application action.
If the implementation class also extends ConfigurableNavigationHandler
, the
implementation must guarantee that the logic used in a call to
ConfigurableNavigationHandler.getNavigationCase(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
is used in this method to determine
the correct navigation.
This method must set the render targets (used in partial rendering) to
render all
invoking
PartialViewContext.setRenderAll(boolean)
) if the view identifier has
changed as the result of an application action (to take into account
Ajax requests
).
handleNavigation
in class NavigationHandler
context
- The FacesContext
for the current requestfromAction
- The action binding expression that was evaluated to retrieve the specified
outcome, or null
if the outcome was acquired by some other meansoutcome
- The logical outcome returned by a previous invoked application action (which
may be null
)public void handleNavigation(FacesContext context, String fromAction, String outcome, String toFlowDocumentId)
NavigationHandler
Overloaded variant of
NavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
that allows the caller to provide the defining document id for a flow to be entered by this
navigation. For backward compatibility with decorated NavigationHandler
implementations that conform to an earlier version of the specification, an implementation is
provided that calls through to
NavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
,
ignoring the toFlowDocumentId
parameter.
handleNavigation
in class NavigationHandler
context
- The FacesContext
for the current requestfromAction
- The action binding expression that was evaluated to retrieve the specified
outcome, or null
if the outcome was acquired by some other meansoutcome
- The logical outcome returned by a previous invoked application action (which
may be null
)toFlowDocumentId
- The defining document id of the flow into which this navigation will
cause entry.Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.