Author: mrdon
Date: Sun Apr 17 22:38:46 2005
New Revision: 161734
URL: http://svn.apache.org/viewcvs?view=rev&rev=161734
Log:
* Adding new generated documentation
* Improving front page to be more clear and useful
* More clearly separating documentation from rest of content
Added:
struts/core/trunk/doc/flow/extensions.xml (with props)
struts/core/trunk/doc/flow/system.xml (with props)
Removed:
struts/core/trunk/doc/flow/extensions.html
Modified:
struts/core/trunk/doc/flow/index.xml
struts/core/trunk/doc/flow/project.xml
Added: struts/core/trunk/doc/flow/extensions.xml
URL:
http://svn.apache.org/viewcvs/struts/core/trunk/doc/flow/extensions.xml?view=auto&rev=161734
==============================================================================
--- struts/core/trunk/doc/flow/extensions.xml (added)
+++ struts/core/trunk/doc/flow/extensions.xml Sun Apr 17 22:38:46 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document url="extensions.html"><!--
+ WARNING: This file is automatically generated from an xdoclet extension
that
+ turns javadoc tags in the extensions Java source code into an xml file,
+ which is then processed by an xsl file to create this document. Do not
+ modify this file, but rather either modify the comments or xsl file.
+ --><properties><title>Java API Extensions</title></properties><body><section
href="summary" name="Java API Extensions"><p>
+ Struts Flow adds properties and methods to Java API classes to make
using the Java API easier in the flow scripts. Each documented extension
listed here includes a description and example of its use.
+
</p><strong>java.io.InputStream</strong><blockquote><table><tr><td>String</td><td><a
href="#java.io.InputStream_getText">getText</a>() -
+ Gets the contents of the stream as a
String.</td></tr></table></blockquote><strong>java.util.Collection</strong><blockquote><table><tr><td>void</td><td><a
href="#java.util.Collection_each">each</a>(Function func) -
+ Iterates through the collection and for each element, calls
the passed function with the element as the
parameter.</td></tr><tr><td>Object</td><td><a
href="#java.util.Collection_find">find</a>(Function func) -
+ Finds the first item selected by the passed
function.</td></tr><tr><td>java.util.List</td><td><a
href="#java.util.Collection_findAll">findAll</a>(Function func) -
+ Finds all items selected by the passed
function.</td></tr></table></blockquote><strong>java.util.List</strong><blockquote><table><tr><td>java.util.List</td><td><a
href="#java.util.List_asImmutable">asImmutable</a>() -
+ Returns an immutable version of this
list.</td></tr><tr><td>java.util.List</td><td><a
href="#java.util.List_asSynchronized">asSynchronized</a>() -
+ Returns a synchronized version of this
list.</td></tr><tr><td>Object</td><td><a href="#java.util.List_pop">pop</a>() -
+ Pops the last item off the
list.</td></tr><tr><td>java.util.List</td><td><a
href="#java.util.List_sort">sort</a>() -
+ Sorts the list according to the natural
order.</td></tr><tr><td>java.util.List</td><td><a
href="#java.util.List_sortEach">sortEach</a>(Function func) -
+ Sorts the list using the passed function to determine
order.</td></tr></table></blockquote><strong>java.io.File</strong><blockquote><table><tr><td>java.io.File</td><td><a
href="#java.io.File_append">append</a>(String text) -
+ Appends text to the file.</td></tr><tr><td>String</td><td><a
href="#java.io.File_getText">getText</a>() -
+ Gets the contents of the file as a
String.</td></tr><tr><td>void</td><td><a
href="#java.io.File_eachLine">eachLine</a>(Function func) -
+ Passes each line to the provided
function.</td></tr><tr><td>String[]</td><td><a
href="#java.io.File_getLines">getLines</a>() -
+ Collects the contents of the file as an array of
lines.</td></tr><tr><td>boolean</td><td><a
href="#java.io.File_remove">remove</a>() -
+ Removes a
file.</td></tr></table></blockquote></section><section
href="cls_java.io.InputStream" name="java.io.InputStream"><section
href="java.io.InputStream_getText" name="getText"><pre>String
getText()</pre><blockquote><p>Gets the contents of the stream as a
String.</p><dl><dt><strong>Example:</strong></dt><dd><code>text =
inStream.getText()</code></dd></dl></blockquote></section></section><section
href="cls_java.util.Collection" name="java.util.Collection"><section
href="java.util.Collection_each" name="each"><pre>void each(Function
func)</pre><blockquote><p>Iterates through the collection and for each element,
calls the passed function with the element as the
parameter.</p><dl><dt><strong>Example:</strong></dt><dd><code>list.each(function(item)
{ print(item) })</code></dd></dl></blockquote></section><section
href="java.util.Collection_find" name="find"><pre>Object find(Function
func)</pre><blockquote><p>Finds the first item selected by the passed function.
The function will receive the item and should return true or false for the
result.</p><dl><dt><strong>Example:</strong></dt><dd><code>item =
list.find(function(item) { return item.matches(/foo[0-9]/)
})</code></dd></dl></blockquote></section><section
href="java.util.Collection_findAll" name="findAll"><pre>java.util.List
findAll(Function func)</pre><blockquote><p>Finds all items selected by the
passed function. The function will receive the item and should return true or
false for the result. A list of all matches will be
returned.</p><dl><dt><strong>Example:</strong></dt><dd><code>matches =
list.findAll(function(item) { return item.matches(/foo[0-9]/)
})</code></dd></dl></blockquote></section></section><section
href="cls_java.util.List" name="java.util.List"><section
href="java.util.List_asImmutable" name="asImmutable"><pre>java.util.List
asImmutable()</pre><blockquote><p>Returns an immutable version of this
list.</p><dl><dt><strong>Example:</strong></dt><dd><code>frozenList =
list.asImmutable()</code></dd></dl></blockquote></section><section
href="java.util.List_asSynchronized" name="asSynchronized"><pre>java.util.List
asSynchronized()</pre><blockquote><p>Returns a synchronized version of this
list.</p><dl><dt><strong>Example:</strong></dt><dd><code>multiThreadList =
list.asSynchronized()</code></dd></dl></blockquote></section><section
href="java.util.List_pop" name="pop"><pre>Object pop()</pre><blockquote><p>Pops
the last item off the list. The last item will be returned and removed from the
list.</p><dl><dt><strong>Example:</strong></dt><dd><code>lastItem =
list.pop()</code></dd></dl></blockquote></section><section
href="java.util.List_sort" name="sort"><pre>java.util.List
sort()</pre><blockquote><p>Sorts the list according to the natural
order.</p><dl><dt><strong>Example:</strong></dt><dd><code>sortedList =
list.sort()</code></dd></dl></blockquote></section><section
href="java.util.List_sortEach" name="sortEach"><pre>java.util.List
sortEach(Function func)</pre><blockquote><p>Sorts the list using the passed
function to determine order. The function will receive two parameters, and
should return > 0 if the first is greater, < 0 if the first is less, and
0 if equal.</p><dl><dt><strong>Example:</strong></dt><dd><code>sortedList =
list.sort(function(val1, val2) { return val1.compareTo(val2)
})</code></dd></dl></blockquote></section></section><section
href="cls_java.io.File" name="java.io.File"><section href="java.io.File_append"
name="append"><pre>java.io.File append(String text)</pre><blockquote><p>Appends
text to the
file.</p><dl><dt><strong>Example:</strong></dt><dd><code>file.append("added
text")</code></dd></dl></blockquote></section><section
href="java.io.File_getText" name="getText"><pre>String
getText()</pre><blockquote><p>Gets the contents of the file as a
String.</p><dl><dt><strong>Example:</strong></dt><dd><code>text =
file.getText()</code></dd></dl></blockquote></section><section
href="java.io.File_eachLine" name="eachLine"><pre>void eachLine(Function
func)</pre><blockquote><p>Passes each line to the provided function. The file
is opened, and interpreted as a text file using the default encoding. Each line
is read and passed to the provided
function.</p><dl><dt><strong>Example:</strong></dt><dd><code>file.eachLine(function(line)
{ print(line) })</code></dd></dl></blockquote></section><section
href="java.io.File_getLines" name="getLines"><pre>String[]
getLines()</pre><blockquote><p>Collects the contents of the file as an array of
lines. The file is opened, and interpreted as a text file using the default
encoding.</p><dl><dt><strong>Example:</strong></dt><dd><code>linesArray =
file.getLines()</code></dd></dl></blockquote></section><section
href="java.io.File_remove" name="remove"><pre>boolean
remove()</pre><blockquote><p>Removes a file. Used to get around the problem of
the reserved word
'delete'.</p><dl><dt><strong>Example:</strong></dt><dd><code>isRemoved =
file.remove()</code></dd></dl></blockquote></section></section></body></document>
\ No newline at end of file
Propchange: struts/core/trunk/doc/flow/extensions.xml
------------------------------------------------------------------------------
svn:executable = *
Modified: struts/core/trunk/doc/flow/index.xml
URL:
http://svn.apache.org/viewcvs/struts/core/trunk/doc/flow/index.xml?view=diff&r1=161733&r2=161734
==============================================================================
--- struts/core/trunk/doc/flow/index.xml (original)
+++ struts/core/trunk/doc/flow/index.xml Sun Apr 17 22:38:46 2005
@@ -9,13 +9,30 @@
<section name="Struts Flow" href="overview">
<p>
-Struts Flow is a port of <a href="http://cocoon.apache.org">Cocoon's</a> <a
href="http://cocoon.apache.org/2.1/userdocs/flow/index.html">Control Flow</a>
to <a href="http://struts.apache.org">Struts</a> to allow
+Struts Flow is a port of <a href="http://cocoon.apache.org">Cocoon's</a> <a
href="http://cocoon.apache.org/2.1/userdocs/flow/index.html">Control Flow</a>
to Struts to allow
complex workflow, like multi-form wizards, to be easily implemented using
continuations-capable
-JavaScript. It provides the ability to describe the order of Web pages that
have to be sent to the client, at any given point in time in an application.
-Struts Flow uses a low-impact integration method that allows an existing
Struts application to use Struts Flow along side traditional Struts
-components like Actions and ActionForms.
+JavaScript. It provides the ability to describe the order of Web pages that
have to be sent to the client, at any given point in time in an application.
The flow scripts fulfill the role of Struts Actions, however, they can be used
along side traditional Java-based Struts Actions.
</p>
+ <p>This is an example of a Struts Flow server-side script which logs
the user on to an application:
+ <pre>
+function login() {
+ userManager = struts.applicationScope["userManager"];
+ error = "";
+ while (struts.sessionScope["curUser"] == null) {
+ forwardAndWait("loginForm", {"error" : error});
+ user = struts.param["user"];
+ passwd = struts.param["passwd"];
+ if (userManager.login(user, passwd)) {
+ struts.sessionScope["curUser"] = user;
+ } else {
+ error = "Invalid login, please try again";
+ }
+ }
+}
+ </pre>
+ The <code>forwardAndWait()</code> method sends an HTML page to the
user and waits for a response. When the form is submitted, Struts Flow
restores the variable values and restarts the script where it left off. There
are more detailed examples in the <a href="#examples">Examples</a> section.
+ </p>
<p>
Since continuations are best implemented in Javascript, Struts Flow
also focuses on making Javascript
easier to use and better integrated into the Java environment
borrowing several ideas from <a
@@ -97,7 +114,7 @@
</section>
<section name="Reqirements" href="requirements">
<p>
- Struts integration requres Struts 1.1 or greater.
+ Struts-specific features of Struts Flow requires Struts 1.1 or
greater.
</p>
</section>
<section name="Examples" href="examples">
Modified: struts/core/trunk/doc/flow/project.xml
URL:
http://svn.apache.org/viewcvs/struts/core/trunk/doc/flow/project.xml?view=diff&r1=161733&r2=161734
==============================================================================
--- struts/core/trunk/doc/flow/project.xml (original)
+++ struts/core/trunk/doc/flow/project.xml Sun Apr 17 22:38:46 2005
@@ -9,9 +9,13 @@
<item name="Welcome" href="index.html"/>
<item name="What's New" href="index.html#new"/>
<item name="Requirements" href="index.html#requirements"/>
- <item name="Java Enhancements" href="extensions.html"/>
- <item name="Examples" href="index.html#examples"/>
<item name="Download (Sourceforge)"
href="http://sourceforge.net/project/showfiles.php?group_id=49385&package_id=120079"/>
+ </menu>
+
+ <menu name="Documentation">
+ <item name="Examples" href="index.html#examples"/>
+ <item name="Java Enhancements" href="extensions.html"/>
+ <item name="Flow Methods" href="system.html"/>
</menu>
<menu name="Quick Links">
Added: struts/core/trunk/doc/flow/system.xml
URL:
http://svn.apache.org/viewcvs/struts/core/trunk/doc/flow/system.xml?view=auto&rev=161734
==============================================================================
--- struts/core/trunk/doc/flow/system.xml (added)
+++ struts/core/trunk/doc/flow/system.xml Sun Apr 17 22:38:46 2005
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document url="syste.html"><!--
+ WARNING: This file is automatically generated from a jsdoc processor that
+ turns javadoc-type comments of Javascript files into an xml file, which is
+ then processed by an xsl file to create this document. Do not modify this
+ file, but rather either modify the comments or xsl file.
+ --><properties><title>File system.js</title></properties><body><section
href="summary" name="Core Flow Methods "><p> <p> These methods are available to
every flow script automatically to simplify interactions with the flow engine.
They can be overridden as necessary for advanced customizations like
intercepting every function call to perform some common logic like security
checks. </p> <p>The only method that should be called from an application's
flow scripts is <a href="#fn_forwardAndWait">forwardAndWait()</a> as the
others are mainly just used by the framework. They are exposed to allow the
user to easily customize functionality. </p>
</p><dl/><hr/><strong>Functions</strong><blockquote><a
href="#fn_startContinuation">startContinuation</a>(lastWebCont)<br/><a
href="#fn_callFunction">callFunction</a>(func, args)<br/><a
href="#fn_forwardAndWait">forwardAndWait</a>(name, atts,
allowedRemoteFuncs)<br/><a href="#fn__forwardAndWait">_forwardAndWait</a>(name,
atts)<br/><a
href="#fn_handleContinuation">handleContinuation</a>(kont)<br/></blockquote></section><section
href="fn_startContinuation"
name="startContinuation"><pre>startContinuation(lastWebCont)</pre><p> Starts a
continuation, linking it with the last continuation.
</p><table><tr><th>Parameter</th><th>Description</th></tr><tr><td>lastWebCont</td><td>The
last web continuation to link this continuation to
</td></tr></table><dl><dt><strong>Returns: </strong></dt><dd>The created
continuation </dd></dl></section><section href="fn_callFunction"
name="callFunction"><pre>callFunction(func, args)</pre><p> Calls the specified
function, creating a suicide continuation first.
</p><table><tr><th>Parameter</th><th>Description</th></tr><tr><td>func</td><td>The
function object to call </td></tr><tr><td>args</td><td>The argument list to
pass to the function </td></tr></table><dl><dt><strong>Returns:
</strong></dt><dd>The result of the function </dd></dl></section><section
href="fn_forwardAndWait" name="forwardAndWait"><pre>forwardAndWait(name, atts,
allowedRemoteFuncs)</pre><p> Forwards to a page and creates a continuation.
Contains special support for client FlowCall's (calling flow functions through
asynchrous javascript calls from the client). The forward name will be used to
find the appropriate Struts ActionForward to return from the Action.
</p><table><tr><th>Parameter</th><th>Description</th></tr><tr><td>name</td><td>The
Struts forward name to call </td></tr><tr><td>atts</td><td>Map of business
objects to place in the request scope
</td></tr><tr><td>allowedRemoteFuncs</td><td>A list of remote function names
that are allowed to be called from asynchronously from the client. An
empty array allows any function call, a null or not specified array
allows none. </td></tr></table><dl><dt><strong>Returns: </strong></dt><dd>The
continuation created used in the call </dd></dl></section><section
href="fn__forwardAndWait" name="_forwardAndWait"><pre>_forwardAndWait(name,
atts)</pre><p> Does the actual work to forward to a page and create a
continuation. The forward name, continuation id, and business object map are
passed through <code>flow</code> context values. This method shouldn't be
called from flow scripts but the method forwardAndWait() should be called
instead.
</p><table><tr><th>Parameter</th><th>Description</th></tr><tr><td>name</td><td>The
Struts forward to call </td></tr><tr><td>atts</td><td>The business object map
to make available to the page </td></tr></table><dl><dt><strong>Returns:
</strong></dt><dd>The continuation created </dd></dl></section><section
href="fn_handleContinuation"
name="handleContinuation"><pre>handleContinuation(kont)</pre><p> This function
is called by Struts Flow to restart a previously saved continuation passed as
argument. Override this method to have control over how continuations are
instantiated.
</p><table><tr><th>Parameter</th><th>Description</th></tr><tr><td>kont</td><td>The
continuation to reload </td></tr></table><dl/></section></body></document>
\ No newline at end of file
Propchange: struts/core/trunk/doc/flow/system.xml
------------------------------------------------------------------------------
svn:executable = *
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]