This commit is contained in:
Keith Donald
2008-04-13 07:16:44 +00:00
parent 1a8e2678d4
commit ec96e9bb51
8 changed files with 221 additions and 224 deletions

View File

@@ -13,19 +13,19 @@
Web Flow provides a Spring schema that allows you to configure the system.
To use this schema, include it in one of your infrastructure-layer beans files:
</para>
<programlisting type="xml">
&lt;beans xmlns="http://www.springframework.org/schema/beans"
<programlisting type="xml"><![CDATA[
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd"&gt;
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
&lt;!-- Setup Web Flow here --&gt;
<!-- Setup Web Flow here -->
&lt;/beans&gt;
</beans>]]>
</programlisting>
</sect1>
<sect1 id="system-config-basic">
@@ -38,10 +38,10 @@
<para>
Register your flows in a <code>FlowRegistry</code>:
</para>
<programlisting type="xml">
&lt;webflow:flow-registry id="flowRegistry"&gt;
&lt;webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" /&gt;
&lt;/webflow:flow-registry&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-registry id="flowRegistry">
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
</webflow:flow-registry>]]>
</programlisting>
</sect2>
<sect2 id="basic-setup-flow-executor">
@@ -49,8 +49,8 @@
<para>
Deploy a FlowExecutor, the central service for executing flows:
</para>
<programlisting type="xml">
&lt;webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry" /&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry" />]]>
</programlisting>
</sect2>
<para>
@@ -66,28 +66,28 @@
If no flow-builder-services tag is specified, the default service implementations are used.
When the tag is defined, you only need to reference the services you want to customize.
</para>
<programlisting type="xml">
&lt;webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices"&gt;
&lt;webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" /&gt;
&lt;/webflow:flow-registry&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
</webflow:flow-registry>
&lt;webflow:flow-builder-services id="flowBuilderServices" /&gt;
<webflow:flow-builder-services id="flowBuilderServices" />]]>
</programlisting>
<para>
The configurable services are the <code>conversion-service</code>, <code>formatter-registry</code>, <code>expression-parser</code>, and <code>view-factory-creator</code>.
These services are configured by referencing custom beans you define. For example:
</para>
<programlisting type="xml">
&lt;webflow:flow-builder-services id="flowBuilderServices"
conversion-service="conversionService"
formatter-registry="formatterRegistry"
expression-parser="expressionParser"
view-factory-creator="viewFactoryCreator"/&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-builder-services id="flowBuilderServices"
conversion-service="conversionService"
formatter-registry="formatterRegistry"
expression-parser="expressionParser"
view-factory-creator="viewFactoryCreator" />
&lt;bean id="conversionService" class="..." /&gt;
&lt;bean id="formatterRegistry" class="..." /&gt;
&lt;bean id="expressionParser" class="..." /&gt;
&lt;bean id="viewFactoryCreator" class="..." /&gt;
<bean id="conversionService" class="..." />
<bean id="formatterRegistry" class="..." />
<bean id="expressionParser" class="..." />
<bean id="viewFactoryCreator" class="..." />]]>
</programlisting>
<sect3 id="builder-service-conversion">
<title>conversion-service</title>
@@ -126,16 +126,16 @@
Use the <code>parent</code> attribute to link two flow registries together in a hierarchy.
When the child registry is queried, if it cannot find the requested flow it will delegate to its parent.
</para>
<programlisting type="xml">
&lt;!-- my-system-config.xml --&gt;
&lt;webflow:flow-registry id="flowRegistry" parent="sharedFlowRegistry"&gt;
&lt;webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" /&gt;
&lt;/webflow:flow-registry&gt;
<programlisting type="xml"><![CDATA[
<!-- my-system-config.xml -->
<webflow:flow-registry id="flowRegistry" parent="sharedFlowRegistry">
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />
</webflow:flow-registry>
&lt;!-- shared-config.xml --&gt;
&lt;webflow:flow-registry id="sharedFlowRegistry"&gt;
&lt;-- Global flows shared by several applications --&lt;
&lt;/webflow:flow-registry&gt;
<!-- shared-config.xml -->
<webflow:flow-registry id="sharedFlowRegistry">
<-- Global flows shared by several applications -->
</webflow:flow-registry>]]>
</programlisting>
</sect2>
<sect2 id="flow-registry-location">
@@ -144,8 +144,8 @@
Use the <code>location</code> element to specify paths to flow definitions to register.
By default, flows will be assigned registry identifiers equal to their filenames minus the file extension.
</para>
<programlisting type="xml">
&lt;webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" /&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />]]>
</programlisting>
</sect2>
<sect2 id="flow-registry-location-id">
@@ -153,8 +153,8 @@
<para>
Specify an id to assign a custom registry identifier to a flow:
</para>
<programlisting type="xml">
&lt;webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" id="bookHotel" /&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" id="bookHotel" />]]>
</programlisting>
</sect2>
<sect2 id="flow-registry-location-attributes">
@@ -162,13 +162,13 @@
<para>
Use the <code>flow-definition-attributes</code> element to assign custom meta-attributes to a registered flow:
</para>
<programlisting type="xml">
&lt;webflow:flow-location path="/WEB-INF/flows/booking/booking.xml"&gt;
&lt;flow-definition-attributes&gt;
&lt;attribute name="caption" value="Books a hotel" /&gt;
&lt;attribute name="persistence-context" value="true" type="boolean" /&gt;
&lt;/flow-definition-attributes&gt;
&lt;/webflow:flow-location&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml">
<flow-definition-attributes>
<attribute name="caption" value="Books a hotel" />
<attribute name="persistence-context" value="true" type="boolean" />
</flow-definition-attributes>
</webflow:flow-location>]]>
</programlisting>
</sect2>
<sect2 id="flow-registry-patterns">
@@ -176,8 +176,8 @@
<para>
Use the <code>flow-location-patterns</code> element to register flows that match a specific resource location pattern:
</para>
<programlisting type="xml">
&lt;webflow:flow-location-pattern value="/WEB-INF/flows/**/*-flow.xml" /&gt;
<programlisting type="xml"><![CDATA[
<webflow:flow-location-pattern value="/WEB-INF/flows/**/*-flow.xml" />]]>
</programlisting>
</sect2>
</sect1>
@@ -188,17 +188,17 @@
<para>
Use the <code>flow-execution-listeners</code> element to register listeners that observe the lifecycle of flow executions:
</para>
<programlisting type="xml">
&lt;flow-execution-listeners&gt;
&lt;listener ref="securityListener"/&gt;
&lt;listener ref="persistenceListener"/&gt;
&lt;/flow-execution-listeners&gt;
<programlisting type="xml"><![CDATA[
<flow-execution-listeners>
<listener ref="securityListener"/>
<listener ref="persistenceListener"/>
</flow-execution-listeners>]]>
</programlisting>
<para>
You may also configure a listener to observe only certain flows:
</para>
<programlisting type="xml">
&lt;listener ref="securityListener" criteria="securedFlow1,securedFlow2"/&gt;
<programlisting type="xml"><![CDATA[
<listener ref="securityListener" criteria="securedFlow1,securedFlow2"/>]]>
</programlisting>
</sect2>
<sect2 id="tuning-flow-execution-repository">
@@ -206,8 +206,8 @@
<para>
Use the <code>flow-execution-repository</code> element to tune flow execution persistence settings:
</para>
<programlisting type="xml">
&lt;flow-execution-repository max-conversations="5" max-snapshots="30" /&gt;
<programlisting type="xml"><![CDATA[
<flow-execution-repository max-conversations="5" max-snapshots="30" />]]>
</programlisting>
<sect3 id="repository-max-conversations">
<title>max-conversations</title>