|
|||||||||
| 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 mappings
public 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 FlowExecutorArgumentExtractorisFlowIdPresent in class FlowExecutorArgumentHandlercontext - the context in which a external user event occured
public java.lang.String extractFlowId(ExternalContext context)
throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
extractFlowId in interface FlowExecutorArgumentExtractorextractFlowId in class FlowExecutorArgumentHandlercontext - 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 FlowExecutorArgumentExtractorisFlowExecutionKeyPresent in class FlowExecutorArgumentHandlercontext - the context in which a external user event occured
public java.lang.String extractFlowExecutionKey(ExternalContext context)
throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
extractFlowExecutionKey in interface FlowExecutorArgumentExtractorextractFlowExecutionKey in class FlowExecutorArgumentHandlercontext - 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 FlowExecutorArgumentExtractorisEventIdPresent in class FlowExecutorArgumentHandlercontext - 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 FlowExecutorArgumentExtractorextractEventId in class FlowExecutorArgumentHandlercontext - the context in which a external user event occured
FlowExecutorArgumentExtractionException - if the event id could not be extracted
public java.lang.String createFlowDefinitionUrl(FlowDefinitionRedirect flowDefinitionRedirect,
ExternalContext context)
FlowExecutorArgumentExposer
createFlowDefinitionUrl in interface FlowExecutorArgumentExposercreateFlowDefinitionUrl in class FlowExecutorArgumentHandlerflowDefinitionRedirect - 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 FlowExecutorArgumentExposercreateFlowExecutionUrl in class FlowExecutorArgumentHandlerflowExecutionKey - 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 FlowExecutorArgumentExposercreateExternalUrl in class FlowExecutorArgumentHandlerredirect - 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 | ||||||||