documentation for SWF-909

This commit is contained in:
Scott Andrews
2008-10-17 19:20:38 +00:00
parent 587c3c061e
commit ae6b1c0253

View File

@@ -139,11 +139,42 @@
</webflow:flow-registry>]]>
</programlisting>
</sect2>
<sect2 id="flow-registry-base-path">
<title>Flow location base path</title>
<para>
Use the <code>base-path</code> attribute to define the base location of all flow definitions for the application.
All flow locations, for the registry, are loaded relative to the base path.
The base path can be a file path such as '/WEB-INF' or a location on the classpath like 'classpath:org/springframework/webflow/samples'.
</para>
<programlisting language="xml"><![CDATA[
<webflow:flow-registry id="flowRegistry" base-path="/WEB-INF">
...
</webflow:flow-registry>]]>
</programlisting>
<para>
When a base path is defined, the convention is different to determine the default flow identifier.
The default identifier is determined from the path to the flow definition between the base path and the file name.
For example, if a flow definition is located at '/WEB-INF/hotels/booking/booking-flow.xml' and the base path is '/WEB-INF' the remaining path to the flow definition file is 'hotels/booking' which becomes the flow identifier.
</para>
<tip>
<title>Directory per flow definition</title>
<para>
It is a best practice to package each flow definition in a unique directory.
This allows flow specific resources to be packaged with the flow definition.
It also prevents two flows from obtaining the same identifier by convention.
</para>
</tip>
<para>
If the base path is not specified or if the flow definition is directly on the base path, the filename (without the extension) is used.
For example, if a flow definition file is 'booking.xml', the flow identifier is 'booking'.
</para>
</sect2>
<sect2 id="flow-registry-location">
<title>Specifying flow locations</title>
<para>
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.
By default, flows will be assigned registry identifiers equal to their filenames minus the file extension, unless a registry bath path is defined.
See <link linkend="flow-registry-base-path">Flow location base path</link> for more information.
</para>
<programlisting language="xml"><![CDATA[
<webflow:flow-location path="/WEB-INF/flows/booking/booking.xml" />]]>
@@ -180,6 +211,16 @@
<programlisting language="xml"><![CDATA[
<webflow:flow-location-pattern value="/WEB-INF/flows/**/*-flow.xml" />]]>
</programlisting>
<para>
Location patterns are particularly powerful when combined with a registry base path.
Instead of the flow identifiers becoming '*-flow', they will be based on the path represented by '**'.
For example:
</para>
<programlisting language="xml"><![CDATA[
<webflow:flow-registry base-path="/WEB-INF">
<webflow:flow-location-pattern value="**/*-flow.xml" />
</webflow:flow-registry>]]>
</programlisting>
</sect2>
</sect1>
<sect1 id="flow-executor">