|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.executor.support.FlowExecutorArgumentHandler
org.springframework.webflow.executor.support.FlowIdMappingArgumentHandlerWrapper
public class FlowIdMappingArgumentHandlerWrapper
Flow executor argument handler that wraps another argument handler and applies a public to private flow id mapping. This can be used to avoid literal flow ids in URLs that launch flows.
For example, when used in combination with RequestPathFlowExecutorArgumentHandler
the url
http://localhost/springair/reservation/booking.html
would launch a new execution of the
booking-flow
flow, assuming a context path of /springair
, a servlet mapping of
/reservation/*
and a flow id mapping of booking->booking-flow
(the .html suffix
would be removed by RequestPathFlowExecutorArgumentHandler.extractFlowId(ExternalContext)
.
RequestParameterFlowExecutorArgumentHandler
,
RequestPathFlowExecutorArgumentHandler
Constructor Summary | |
---|---|
FlowIdMappingArgumentHandlerWrapper()
Default constructor for bean style usage. |
Method Summary | |
---|---|
void |
addMapping(java.lang.String publicFlowId,
java.lang.String privateFlowId)
Add a flow id mapping, overwriting any previous mapping for the same flow ids. |
java.lang.String |
createExternalUrl(ExternalRedirect redirect,
java.lang.String flowExecutionKey,
ExternalContext context)
Create a URL path that when redirected to communicates with an external system outside of Spring Web Flow. |
java.lang.String |
createFlowDefinitionUrl(FlowDefinitionRedirect flowDefinitionRedirect,
ExternalContext context)
Create a URL that when redirected to launches a entirely new execution of a flow definition (starts a new conversation). |
java.lang.String |
createFlowExecutionUrl(java.lang.String flowExecutionKey,
FlowExecutionContext flowExecution,
ExternalContext context)
Create a URL path that when redirected to renders the current (or last) view selection made by the flow execution identified by the flow execution key. |
java.lang.String |
extractEventId(ExternalContext context)
Extract the flow execution event id from the external context. |
java.lang.String |
extractFlowExecutionKey(ExternalContext context)
Extract the flow execution key from the external context. |
java.lang.String |
extractFlowId(ExternalContext context)
Extracts the flow id from the external context. |
FlowExecutorArgumentHandler |
getArgumentHandler()
Returns the wrapped argument handler. |
protected java.util.Properties |
getMappings()
Returns the public-to-private flow id mappings in use. |
boolean |
isEventIdPresent(ExternalContext context)
Returns true if the event id is extractable from the context. |
boolean |
isFallback()
Should we fall back to the flow id extracted by the wrapped argument handler if no mapping is defined for a flow id? Default is true. |
boolean |
isFlowExecutionKeyPresent(ExternalContext context)
Returns true if the flow execution key is extractable from the context. |
boolean |
isFlowIdPresent(ExternalContext context)
Returns true if the flow id is extractable from the context. |
void |
setArgumentHandler(FlowExecutorArgumentHandler argumentHandler)
Set the wrapped argument handler. |
void |
setFallback(boolean fallback)
Set whether or not to fall back on the flow id extracted by the wrapped argument handler if no mapping is defined for a flow id. |
void |
setMappings(java.util.Properties mappings)
Set the mappings between client-submitted flow identifiers and internal flow identifiers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FlowIdMappingArgumentHandlerWrapper()
setArgumentHandler(FlowExecutorArgumentHandler)
,
setMappings(Properties)
,
setFallback(boolean)
Method Detail |
---|
public FlowExecutorArgumentHandler getArgumentHandler()
public void setArgumentHandler(FlowExecutorArgumentHandler argumentHandler)
protected java.util.Properties getMappings()
public void setMappings(java.util.Properties mappings)
mappings
- the public to private flow id mappingspublic void addMapping(java.lang.String publicFlowId, java.lang.String privateFlowId)
publicFlowId
- how the flow will be identified publically (to web clients)privateFlowId
- how the flow is identified internally (in the flow definition registry)public boolean isFallback()
public void setFallback(boolean fallback)
public boolean isFlowIdPresent(ExternalContext context)
FlowExecutorArgumentExtractor
isFlowIdPresent
in interface FlowExecutorArgumentExtractor
isFlowIdPresent
in class FlowExecutorArgumentHandler
context
- the context in which a external user event occured
public java.lang.String extractFlowId(ExternalContext context) throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
extractFlowId
in interface FlowExecutorArgumentExtractor
extractFlowId
in class FlowExecutorArgumentHandler
context
- the context in which a external user event occured
FlowExecutorArgumentExtractionException
- if the flow id could not be extractedpublic boolean isFlowExecutionKeyPresent(ExternalContext context)
FlowExecutorArgumentExtractor
isFlowExecutionKeyPresent
in interface FlowExecutorArgumentExtractor
isFlowExecutionKeyPresent
in class FlowExecutorArgumentHandler
context
- the context in which a external user event occured
public java.lang.String extractFlowExecutionKey(ExternalContext context) throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
extractFlowExecutionKey
in interface FlowExecutorArgumentExtractor
extractFlowExecutionKey
in class FlowExecutorArgumentHandler
context
- the context in which the external user event occured
FlowExecutorArgumentExtractionException
- if the flow execution key could not be extractedpublic boolean isEventIdPresent(ExternalContext context)
FlowExecutorArgumentExtractor
isEventIdPresent
in interface FlowExecutorArgumentExtractor
isEventIdPresent
in class FlowExecutorArgumentHandler
context
- the context in which a external user event occured
public java.lang.String extractEventId(ExternalContext context) throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
This method should only be called if a FlowExecutionKey
was successfully extracted, indicating a request
to resume a flow execution.
extractEventId
in interface FlowExecutorArgumentExtractor
extractEventId
in class FlowExecutorArgumentHandler
context
- the context in which a external user event occured
FlowExecutorArgumentExtractionException
- if the event id could not be extractedpublic java.lang.String createFlowDefinitionUrl(FlowDefinitionRedirect flowDefinitionRedirect, ExternalContext context)
FlowExecutorArgumentExposer
createFlowDefinitionUrl
in interface FlowExecutorArgumentExposer
createFlowDefinitionUrl
in class FlowExecutorArgumentHandler
flowDefinitionRedirect
- the flow definition redirect view selectioncontext
- the external context
public java.lang.String createFlowExecutionUrl(java.lang.String flowExecutionKey, FlowExecutionContext flowExecution, ExternalContext context)
FlowExecutorArgumentExposer
createFlowExecutionUrl
in interface FlowExecutorArgumentExposer
createFlowExecutionUrl
in class FlowExecutorArgumentHandler
flowExecutionKey
- the flow execution keyflowExecution
- the flow executioncontext
- the external context
FlowExecutionRedirect
public java.lang.String createExternalUrl(ExternalRedirect redirect, java.lang.String flowExecutionKey, ExternalContext context)
FlowExecutorArgumentExposer
createExternalUrl
in interface FlowExecutorArgumentExposer
createExternalUrl
in class FlowExecutorArgumentHandler
redirect
- the external redirect requestflowExecutionKey
- the flow execution key to send through the redirect (optional)context
- the external context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |