|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.executor.support.FlowExecutorArgumentHandler
public abstract class FlowExecutorArgumentHandler
Abstract base class for objects handling FlowExecutor
arguments. This
class combines the two argument handling responsabilities of (extraction
and
exposing
) and makes sure they are consistent, i.e. that exposed arguments can
later be extracted again.
All argument names are configurable. Common convenience functionality is also provided, e.g. a
default flow id
, URL encoding
and dealing with
relative URLs
. Subclasses are
responsible for taking these settings into account when implementing actual argument extraction and exposing
behavior.
FlowExecutorArgumentExtractor
,
FlowExecutorArgumentExposer
Constructor Summary | |
---|---|
FlowExecutorArgumentHandler()
|
Method Summary | |
---|---|
protected java.lang.String |
applyDefaultFlowId(java.lang.String extractedFlowId)
Apply the configured default flow id to given extracted flow id. |
abstract 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. |
abstract 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). |
abstract 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. |
protected java.lang.String |
encodeValue(java.lang.Object value)
URL-encode the given input object with the configured encoding scheme. |
void |
exposeFlowExecutionContext(java.lang.String flowExecutionKey,
FlowExecutionContext context,
java.util.Map model)
Expose the flow execution context and it's key in given model map. |
abstract java.lang.String |
extractEventId(ExternalContext context)
Extract the flow execution event id from the external context. |
abstract java.lang.String |
extractFlowExecutionKey(ExternalContext context)
Extract the flow execution key from the external context. |
abstract java.lang.String |
extractFlowId(ExternalContext context)
Extracts the flow id from the external context. |
java.lang.String |
getDefaultFlowId()
Returns the default flowId argument value. |
java.lang.String |
getEventIdArgumentName()
Returns the event id argument name, used to signal what user action happened within a paused flow execution. |
java.lang.String |
getFlowExecutionContextAttributeName()
Returns the flow execution context attribute name. |
java.lang.String |
getFlowExecutionKeyArgumentName()
Returns the flow execution key argument name, used to request that an executing conversation resumes. |
java.lang.String |
getFlowExecutionKeyAttributeName()
Returns the flow execution key attribute name, used as a model attribute for identifying the executing flow being participated in. |
java.lang.String |
getFlowIdArgumentName()
Returns the flow id argument name, used to request a flow to launch. |
java.lang.String |
getUrlEncodingScheme()
Returns the url encoding scheme to be used to encode URLs built by this argument handler. |
abstract boolean |
isEventIdPresent(ExternalContext context)
Returns true if the event id is extractable from the context. |
abstract boolean |
isFlowExecutionKeyPresent(ExternalContext context)
Returns true if the flow execution key is extractable from the context. |
abstract boolean |
isFlowIdPresent(ExternalContext context)
Returns true if the flow id is extractable from the context. |
boolean |
isRedirectContextRelative()
Return whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. |
protected java.lang.String |
makeRedirectUrlContextRelativeIfNecessary(java.lang.String url,
ExternalContext context)
Make given redirect URL context relative if necessary. |
void |
setDefaultFlowId(java.lang.String defaultFlowId)
Sets the default flowId argument value. |
void |
setEventIdArgumentName(java.lang.String eventIdArgumentName)
Sets the event id argument name, used to signal what user action happened within a paused flow execution. |
void |
setFlowExecutionContextAttributeName(java.lang.String flowExecutionContextAttributeName)
Sets the flow execution context attribute name. |
void |
setFlowExecutionKeyArgumentName(java.lang.String flowExecutionKeyArgumentName)
Sets the flow execution key argument name, used to request that an executing conversation resumes. |
void |
setFlowExecutionKeyAttributeName(java.lang.String flowExecutionKeyAttributeName)
Sets the flow execution key attribute name, used as a model attribute for identifying the current state of the executing flow being participated in (typically used by view templates during rendering). |
void |
setFlowIdArgumentName(java.lang.String flowIdArgumentName)
Sets the flow id argument name, used to request a flow to launch. |
void |
setRedirectContextRelative(boolean redirectContextRelative)
Set whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. |
void |
setUrlEncodingScheme(java.lang.String urlEncodingScheme)
Set the url encoding scheme to be used to encode URLs built by this argument handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FlowExecutorArgumentHandler()
Method Detail |
---|
public java.lang.String getFlowIdArgumentName()
public void setFlowIdArgumentName(java.lang.String flowIdArgumentName)
public java.lang.String getFlowExecutionKeyArgumentName()
public void setFlowExecutionKeyArgumentName(java.lang.String flowExecutionKeyArgumentName)
public java.lang.String getEventIdArgumentName()
public void setEventIdArgumentName(java.lang.String eventIdArgumentName)
public java.lang.String getDefaultFlowId()
null
.
public void setDefaultFlowId(java.lang.String defaultFlowId)
This value will be used if no flowId argument value can be extracted from the request by the
extractFlowId(ExternalContext)
operation.
public java.lang.String getFlowExecutionKeyAttributeName()
public void setFlowExecutionKeyAttributeName(java.lang.String flowExecutionKeyAttributeName)
public java.lang.String getFlowExecutionContextAttributeName()
public void setFlowExecutionContextAttributeName(java.lang.String flowExecutionContextAttributeName)
public java.lang.String getUrlEncodingScheme()
public void setUrlEncodingScheme(java.lang.String urlEncodingScheme)
public void setRedirectContextRelative(boolean redirectContextRelative)
Default is "true": A redirect URL that starts with a slash will be interpreted as relative to the web application root, i.e. the context path will be prepended to the URL.
public boolean isRedirectContextRelative()
public abstract boolean isFlowIdPresent(ExternalContext context)
FlowExecutorArgumentExtractor
isFlowIdPresent
in interface FlowExecutorArgumentExtractor
context
- the context in which a external user event occured
public abstract java.lang.String extractFlowId(ExternalContext context) throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
extractFlowId
in interface FlowExecutorArgumentExtractor
context
- the context in which a external user event occured
FlowExecutorArgumentExtractionException
- if the flow id could not be extractedpublic abstract boolean isFlowExecutionKeyPresent(ExternalContext context)
FlowExecutorArgumentExtractor
isFlowExecutionKeyPresent
in interface FlowExecutorArgumentExtractor
context
- the context in which a external user event occured
public abstract java.lang.String extractFlowExecutionKey(ExternalContext context) throws FlowExecutorArgumentExtractionException
FlowExecutorArgumentExtractor
extractFlowExecutionKey
in interface FlowExecutorArgumentExtractor
context
- the context in which the external user event occured
FlowExecutorArgumentExtractionException
- if the flow execution key could not be extractedpublic abstract boolean isEventIdPresent(ExternalContext context)
FlowExecutorArgumentExtractor
isEventIdPresent
in interface FlowExecutorArgumentExtractor
context
- the context in which a external user event occured
public abstract 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
context
- the context in which a external user event occured
FlowExecutorArgumentExtractionException
- if the event id could not be extractedpublic void exposeFlowExecutionContext(java.lang.String flowExecutionKey, FlowExecutionContext context, java.util.Map model)
FlowExecutorArgumentExposer
exposeFlowExecutionContext
in interface FlowExecutorArgumentExposer
flowExecutionKey
- the flow execution key (may be null if the conversation has ended)context
- the flow execution contextmodel
- the model mappublic abstract java.lang.String createFlowDefinitionUrl(FlowDefinitionRedirect flowDefinitionRedirect, ExternalContext context)
FlowExecutorArgumentExposer
createFlowDefinitionUrl
in interface FlowExecutorArgumentExposer
flowDefinitionRedirect
- the flow definition redirect view selectioncontext
- the external context
public abstract java.lang.String createFlowExecutionUrl(java.lang.String flowExecutionKey, FlowExecutionContext flowExecution, ExternalContext context)
FlowExecutorArgumentExposer
createFlowExecutionUrl
in interface FlowExecutorArgumentExposer
flowExecutionKey
- the flow execution keyflowExecution
- the flow executioncontext
- the external context
FlowExecutionRedirect
public abstract java.lang.String createExternalUrl(ExternalRedirect redirect, java.lang.String flowExecutionKey, ExternalContext context)
FlowExecutorArgumentExposer
createExternalUrl
in interface FlowExecutorArgumentExposer
redirect
- the external redirect requestflowExecutionKey
- the flow execution key to send through the redirect (optional)context
- the external context
protected java.lang.String applyDefaultFlowId(java.lang.String extractedFlowId)
extractedFlowId
- the extracted flow id, could be null if non was available in the external context
getDefaultFlowId()
protected java.lang.String encodeValue(java.lang.Object value)
value
- the unencoded value
getUrlEncodingScheme()
protected java.lang.String makeRedirectUrlContextRelativeIfNecessary(java.lang.String url, ExternalContext context)
url
- the original URLcontext
- the external context
isRedirectContextRelative()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |