vgritsenko 2003/05/19 17:54:13
Modified: src/webapp/samples/flow sitemap.xmap
src/webapp/samples/flow/calc calc.js sitemap.xmap
src/webapp/samples/flow/calc/screens displayResult.xsp
getNumberA.xsp getNumberB.xsp getOperator.xsp
src/webapp/samples/flow/prefs prefs.js sitemap.xmap
src/webapp/samples/flow/prefs/screens login.xsp
registrationSuccessful.xsp userInfo.xsp welcome.xsp
src/webapp/samples/flow/test sendpage.js sitemap.xmap
src/webapp/samples/flow/test/screens showString.xsp
src/webapp/samples/hello-world sitemap.xmap
src/webapp/samples/xsp sitemap.xmap
src/test/anteater all-tests.xml calc.xml
flowscriptReload.xml
Log:
rework flow samples:
* convert pages: document dtd -> simple dtd
* change uri space: kont/* -> continue.*
* use corporate style
Revision Changes Path
1.8 +1 -2 cocoon-2.1/src/webapp/samples/flow/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/sitemap.xmap,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sitemap.xmap 8 May 2003 00:05:05 -0000 1.7
+++ sitemap.xmap 20 May 2003 00:54:11 -0000 1.8
@@ -25,5 +25,4 @@
</map:pipeline>
</map:pipelines>
-
</map:sitemap>
1.2 +3 -3 cocoon-2.1/src/webapp/samples/flow/calc/calc.js
Index: calc.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/calc/calc.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- calc.js 25 Mar 2003 15:11:31 -0000 1.1
+++ calc.js 20 May 2003 00:54:12 -0000 1.2
@@ -20,19 +20,19 @@
function getNumber(name, a, b)
{
- var uri = "getNumber" + name.toUpperCase();
+ var uri = "page/getNumber" + name.toUpperCase();
sendPageAndWait(uri, { "a" : a, "b" : b });
return parseFloat(cocoon.request.getParameter(name));
}
function getOperator(a, b)
{
- sendPageAndWait("getOperator", { "a" : a, "b" : b });
+ sendPageAndWait("page/getOperator", { "a" : a, "b" : b });
return cocoon.request.getParameter("operator");
}
function sendResult(a, b, op, result)
{
- sendPage("displayResult",
+ sendPage("page/displayResult",
{ "a" : a, "b" : b, "operator" : op, "result" : result });
}
1.3 +17 -25 cocoon-2.1/src/webapp/samples/flow/calc/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/calc/sitemap.xmap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sitemap.xmap 26 Mar 2003 21:21:48 -0000 1.2
+++ sitemap.xmap 20 May 2003 00:54:12 -0000 1.3
@@ -8,9 +8,24 @@
</map:flow>
<map:pipelines>
+ <map:pipeline>
+ <!--+
+ | produces the screens called by the flowscript
+ +-->
+ <map:match pattern="page/*">
+ <map:generate type="serverpages" src="screens/{1}.xsp"/>
+ <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl">
+ <map:parameter name="servletPath" value="{request:servletPath}"/>
+ <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
+ <map:parameter name="contextPath" value="{request:contextPath}"/>
+ <map:parameter name="file"
value="/samples/flow/calc/screens/{1}.xsp"/>
+ <map:parameter name="remove" value="{0}"/>
+ </map:transform>
+ <map:serialize/>
+ </map:match>
+ </map:pipeline>
<map:pipeline>
-
<!--+
| matches the page with the continuation ID and calls the
flowscript
| associated to this sitemap with the given continuation ID. The
flow
@@ -20,22 +35,11 @@
| resumption between requests without the need for anything else
| (cookies or URL-encoded session IDs)
+-->
- <map:match pattern="kont/*">
+ <map:match pattern="continue.*">
<map:call continuation="{1}"/>
</map:match>
<!--+
- | this call is transparently triggered by the flow engine if
- | the requested continuation is invalid (either not available
- | or expired).
- +-->
- <map:match pattern="invalidContinuation">
- <map:generate src="../invalidContinuation.xml"/>
- <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
- <map:serialize/>
- </map:match>
-
- <!--+
| matches the call to the beginning of the flow and calls the flow
| from its entry point which, in this case is the 'calculator()'
| javascript function.
@@ -43,18 +47,6 @@
<map:match pattern="">
<map:call function="calculator"/>
</map:match>
-
- <!--+
- | produces the screens called by the flowscript
- +-->
- <map:match pattern="*">
- <map:generate type="serverpages" src="screens/{1}.xsp"/>
- <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
- <map:serialize/>
- </map:match>
-
</map:pipeline>
-
</map:pipelines>
-
</map:sitemap>
1.3 +23 -27
cocoon-2.1/src/webapp/samples/flow/calc/screens/displayResult.xsp
Index: displayResult.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/calc/screens/displayResult.xsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- displayResult.xsp 26 Mar 2003 21:21:39 -0000 1.2
+++ displayResult.xsp 20 May 2003 00:54:12 -0000 1.3
@@ -1,31 +1,27 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: March 23, 2002
+ +-->
- Date: March 23, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Calculator</title>
- </header>
- <body>
- <s1 title="Calculator">
- <form action="../../calc/" method="post">
- <p>a = <strong><jpath:value-of select="a"/></strong></p>
- <p>b = <strong><jpath:value-of select="b"/></strong></p>
- <p>Operator = <strong><jpath:value-of
select="operator"/></strong></p>
- <p>Result = <strong><jpath:value-of select="result"/></strong></p>
- <input type="submit" name="submit" value="Start over"/>
- </form>
- </s1>
- </body>
- </document>
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/calc/calc.js">Flowscript</resource>
+ </resources>
+ <title>Calculator</title>
+ <content>
+ <form action="./" method="post">
+ <para>a = <strong><jpath:value-of select="a"/></strong></para>
+ <para>b = <strong><jpath:value-of select="b"/></strong></para>
+ <para>Operator = <strong><jpath:value-of
select="operator"/></strong></para>
+ <para>Result = <strong><jpath:value-of
select="result"/></strong></para>
+ <input type="submit" name="submit" value="Start over"/>
+ </form>
+ </content>
+ </page>
</xsp:page>
1.3 +21 -25
cocoon-2.1/src/webapp/samples/flow/calc/screens/getNumberA.xsp
Index: getNumberA.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/calc/screens/getNumberA.xsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- getNumberA.xsp 26 Mar 2003 21:21:39 -0000 1.2
+++ getNumberA.xsp 20 May 2003 00:54:12 -0000 1.3
@@ -1,29 +1,25 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: March 23, 2002
+ +-->
- Date: March 23, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Calculator</title>
- </header>
- <body>
- <s1 title="Calculator">
- <form method="post"><xsp:attribute name="action"><xsp:expr>"kont/" +
<jpath:continuation/></xsp:expr></xsp:attribute>
- <p>Enter value of <strong>a</strong>: <input type="text"
name="a"/></p>
- <input type="submit" name="submit" value="Enter"/>
- </form>
- </s1>
- </body>
- </document>
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/calc/calc.js">Flowscript</resource>
+ </resources>
+ <title>Calculator</title>
+ <content>
+ <form method="post">
+ <xsp:attribute name="action"><xsp:expr>"continue." +
<jpath:continuation/></xsp:expr></xsp:attribute>
+ <para>Enter value of <strong>a</strong>: <input type="text"
name="a"/></para>
+ <input type="submit" name="submit" value="Enter"/>
+ </form>
+ </content>
+ </page>
</xsp:page>
-
1.3 +22 -26
cocoon-2.1/src/webapp/samples/flow/calc/screens/getNumberB.xsp
Index: getNumberB.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/calc/screens/getNumberB.xsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- getNumberB.xsp 26 Mar 2003 21:21:39 -0000 1.2
+++ getNumberB.xsp 20 May 2003 00:54:12 -0000 1.3
@@ -1,30 +1,26 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: March 23, 2002
+ +-->
- Date: March 23, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Calculator</title>
- </header>
- <body>
- <s1 title="Calculator">
- <form method="post"><xsp:attribute
name="action"><xsp:expr><jpath:continuation/></xsp:expr></xsp:attribute>
- <p>a = <strong><jpath:value-of select="a"/></strong></p>
- <p>Enter value of <strong>b</strong>: <input type="text"
name="b"/></p>
- <input type="submit" name="submit" value="Enter"/>
- </form>
- </s1>
- </body>
- </document>
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/calc/calc.js">Flowscript</resource>
+ </resources>
+ <title>Calculator</title>
+ <content>
+ <form method="post">
+ <xsp:attribute name="action"><xsp:expr>"continue." +
<jpath:continuation/></xsp:expr></xsp:attribute>
+ <para>a = <strong><jpath:value-of select="a"/></strong></para>
+ <para>Enter value of <strong>b</strong>: <input type="text"
name="b"/></para>
+ <input type="submit" name="submit" value="Enter"/>
+ </form>
+ </content>
+ </page>
</xsp:page>
-
1.3 +30 -33
cocoon-2.1/src/webapp/samples/flow/calc/screens/getOperator.xsp
Index: getOperator.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/calc/screens/getOperator.xsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- getOperator.xsp 26 Mar 2003 21:21:39 -0000 1.2
+++ getOperator.xsp 20 May 2003 00:54:12 -0000 1.3
@@ -1,37 +1,34 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: March 23, 2002
+ +-->
- Date: March 23, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Calculator</title>
- </header>
- <body>
- <s1 title="Calculator">
- <form method="post"><xsp:attribute
name="action"><xsp:expr><jpath:continuation/></xsp:expr></xsp:attribute>
- <p>a = <strong><jpath:value-of select="a"/></strong></p>
- <p>b = <strong><jpath:value-of select="b"/></strong></p>
- <p>Enter operator
- <select name="operator">
- <option>plus</option>
- <option>minus</option>
- <option>multiply</option>
- <option>divide</option>
- </select>
- </p>
- <input type="submit" name="submit" value="Do it!"/>
- </form>
- </s1>
- </body>
- </document>
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/calc/calc.js">Flowscript</resource>
+ </resources>
+ <title>Calculator</title>
+ <content>
+ <form method="post">
+ <xsp:attribute name="action"><xsp:expr>"continue." +
<jpath:continuation/></xsp:expr></xsp:attribute>
+ <para>a = <strong><jpath:value-of select="a"/></strong></para>
+ <para>b = <strong><jpath:value-of select="b"/></strong></para>
+ <para>Enter operator
+ <select name="operator">
+ <option>plus</option>
+ <option>minus</option>
+ <option>multiply</option>
+ <option>divide</option>
+ </select>
+ </para>
+ <input type="submit" name="submit" value="Do it!"/>
+ </form>
+ </content>
+ </page>
</xsp:page>
1.3 +9 -12 cocoon-2.1/src/webapp/samples/flow/prefs/prefs.js
Index: prefs.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/prefs/prefs.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- prefs.js 26 Mar 2003 21:21:46 -0000 1.2
+++ prefs.js 20 May 2003 00:54:12 -0000 1.3
@@ -1,5 +1,5 @@
/*
- prefs.js
+ CVS: $Id$
This file is the central controller piece in the preferences
application. It receives the requests from the client browser (the
@@ -8,7 +8,6 @@
Author: Ovidiu Predescu <[EMAIL PROTECTED]>
Date: August 30, 2002
-
*/
// The global user registry, through which we add new users or access
@@ -46,7 +45,7 @@
// and print an indicator close to where the errors
// are. `errorMsg' if not null is printed at the top of the page
// as an error message.
- sendPageAndWait("userInfo",
+ sendPageAndWait("page/userInfo",
{ "check" : check, "errorMsg" : errorMsg,
"title": "New User Registration",
"button" : "Register",
@@ -64,8 +63,7 @@
email = cocoon.request.get("email");
if (login == "" || password == ""
- || firstName == "" || lastName == ""
- || email == "") {
+ || firstName == "" || lastName == "" || email == "") {
check = true;
errorMsg = "Please correct the marked errors before continuing";
continue;
@@ -106,7 +104,7 @@
//
// In the case of this particular function, this is the only exit
// point.
- sendPage("registrationSuccessful", {"user" : user});
+ sendPage("page/registrationSuccessful", {"user" : user});
}
@@ -117,7 +115,7 @@
var password = "";
while (true) {
- sendPageAndWait("login",
+ sendPageAndWait("page/login",
{"errorMsg" : errorMsg, "login" : login, "password" :
password});
errorMsg = null;
@@ -144,7 +142,7 @@
// We send to the user a welcome page which contains links back to
// what (s)he can do. These links essentially point to other top
// level functions in this script.
- sendPage("welcome", {"user" : user});
+ sendPage("page/welcome", {"user" : user});
}
// This function is called to edit the preferences of an already
@@ -170,7 +168,7 @@
// and print an indicator close to where the errors
// are. `errorMsg' if not null is printed at the top of the page
// as an error message.
- sendPageAndWait("userInfo",
+ sendPageAndWait("page/userInfo",
{ "check" : check, "errorMsg" : errorMsg,
"title": "Edit account",
"button" : "Change", "cancel" : true,
@@ -191,8 +189,7 @@
email = cocoon.request.get("email");
if (login == "" || password == ""
- || firstName == "" || lastName == ""
- || email == "") {
+ || firstName == "" || lastName == "" || email == "") {
check = true;
errorMsg = "Please correct the marked errors before continuing";
continue;
@@ -207,7 +204,7 @@
}
}
- sendPage("welcome", {"user" : user});
+ sendPage("page/welcome", {"user" : user});
}
function logout()
1.3 +26 -34 cocoon-2.1/src/webapp/samples/flow/prefs/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/prefs/sitemap.xmap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sitemap.xmap 26 Mar 2003 21:21:46 -0000 1.2
+++ sitemap.xmap 20 May 2003 00:54:12 -0000 1.3
@@ -10,35 +10,26 @@
</map:flow>
<map:pipelines>
-
<map:pipeline>
-
- <!--+
- | matches the page with the continuation ID and calls the
flowscript
- | associated to this sitemap with the given continuation ID. The
flow
- | engine will then look into the continuation store, retrieve
- | the correct continuation and resume execution of the flowscript
- | with that continuation. This guarantees transparent state
- | resumption between requests without the need for anything else
- | (cookies or URL-encoded session IDs)
- +-->
- <map:match pattern="kont/*">
- <map:call continuation="{1}"/>
- </map:match>
-
<!--+
- | this call is transparently triggered by the flow engine if
- | the requested continuation is invalid (either not available
- | or expired).
- +-->
- <map:match pattern="invalidContinuation">
- <map:generate src="../invalidContinuation.xml"/>
- <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
+ | Produces the views called by the flowscript
+ +-->
+ <map:match pattern="page/*">
+ <map:generate type="serverpages" src="screens/{1}.xsp"/>
+ <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl">
+ <map:parameter name="servletPath" value="{request:servletPath}"/>
+ <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
+ <map:parameter name="contextPath" value="{request:contextPath}"/>
+ <map:parameter name="file"
value="/samples/flow/prefs/screens/{1}.xsp"/>
+ <map:parameter name="remove" value="{0}"/>
+ </map:transform>
<map:serialize/>
</map:match>
-
+ </map:pipeline>
+
+ <map:pipeline>
<!--+
- | unlike the calculator example, this flow has many different
+ | Unlike the calculator example, this flow has many different
| entry points, each indicated by its own matcher
+-->
<map:match pattern="">
@@ -55,16 +46,17 @@
</map:match>
<!--+
- | produces the views called by the flowscript
- +-->
- <map:match pattern="*">
- <map:generate type="serverpages" src="screens/{1}.xsp"/>
- <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
- <map:serialize/>
+ | Matches the page with the continuation ID and calls the
flowscript
+ | associated to this sitemap with the given continuation ID. The
flow
+ | engine will then look into the continuation store, retrieve
+ | the correct continuation and resume execution of the flowscript
+ | with that continuation. This guarantees transparent state
+ | resumption between requests without the need for anything else
+ | (cookies or URL-encoded session IDs)
+ +-->
+ <map:match pattern="continue.*">
+ <map:call continuation="{1}"/>
</map:match>
-
</map:pipeline>
-
</map:pipelines>
-
</map:sitemap>
1.3 +31 -34
cocoon-2.1/src/webapp/samples/flow/prefs/screens/login.xsp
Index: login.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/prefs/screens/login.xsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- login.xsp 26 Mar 2003 21:21:38 -0000 1.2
+++ login.xsp 20 May 2003 00:54:12 -0000 1.3
@@ -1,38 +1,35 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: August 30, 2002
+ +-->
- Date: August 30, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Login</title>
- </header>
- <body>
- <s1 title="Login">
- <jpath:if test="errorMsg">
- <strong><jpath:value-of select="errorMsg"/></strong>
- </jpath:if>
- <form><xsp:attribute name="action"><xsp:expr>"kont/" +
<jpath:continuation/></xsp:expr></xsp:attribute>
- <p>Login name:
- <input type="text" name="login">
- <xsp:attribute name="value"><jpath:value-of
select="login"/></xsp:attribute>
- </input>
- </p>
- <p>Password: <input type="password" name="password"/></p>
- <input type="submit" name="submit" value="Login"/>
- <p>Not yet registered? <link href="register">Register
now!</link></p>
- </form>
- </s1>
- </body>
- </document>
-
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/prefs/prefs.js">Flowscript</resource>
+ </resources>
+ <title>Login</title>
+ <content>
+ <jpath:if test="errorMsg">
+ <strong><jpath:value-of select="errorMsg"/></strong>
+ </jpath:if>
+ <form>
+ <xsp:attribute name="action"><xsp:expr>"continue." +
<jpath:continuation/></xsp:expr></xsp:attribute>
+ <para>
+ Login name:
+ <input type="text" name="login">
+ <xsp:attribute name="value"><jpath:value-of
select="login"/></xsp:attribute>
+ </input>
+ </para>
+ <para>Password: <input type="password" name="password"/></para>
+ <input type="submit" name="submit" value="Login"/>
+ <para>Not yet registered? <link href="register">Register
now!</link></para>
+ </form>
+ </content>
+ </page>
</xsp:page>
1.2 +22 -23
cocoon-2.1/src/webapp/samples/flow/prefs/screens/registrationSuccessful.xsp
Index: registrationSuccessful.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/prefs/screens/registrationSuccessful.xsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- registrationSuccessful.xsp 25 Mar 2003 15:11:28 -0000 1.1
+++ registrationSuccessful.xsp 20 May 2003 00:54:12 -0000 1.2
@@ -1,27 +1,26 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
-
- Date: August 30, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>New User Registration</title>
- </header>
- <body>
- <s1 title="Registration successful!">
- <p>Congratulations <strong><jpath:value-of select="user/firstName"/>
<jpath:value-of select="user/lastName"/></strong>! You've successfully
registered as a new user.</p>
- <p>| <link href="../edit">Edit my preferences</link> | <link
href="../logout">Logout</link> |</p>
- </s1>
- </body>
- </document>
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: August 30, 2002
+ +-->
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/prefs/prefs.js">Flowscript</resource>
+ </resources>
+ <title>Registration successful!</title>
+ <content>
+ <para>
+ Congratulations
+ <strong><jpath:value-of select="user/firstName"/> <jpath:value-of
select="user/lastName"/></strong>!
+ You've successfully registered as a new user.
+ </para>
+ <para>| <link href="edit">Edit my preferences</link> | <link
href="logout">Logout</link> |</para>
+ </content>
+ </page>
</xsp:page>
1.3 +104 -115
cocoon-2.1/src/webapp/samples/flow/prefs/screens/userInfo.xsp
Index: userInfo.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/prefs/screens/userInfo.xsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- userInfo.xsp 26 Mar 2003 21:21:38 -0000 1.2
+++ userInfo.xsp 20 May 2003 00:54:12 -0000 1.3
@@ -1,124 +1,113 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
-
- Page to show the user information.
-
- This page is used for both user registration and editing the user
- information, depending on the information passed down in the page.
-
- Date: August 30, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title><jpath:value-of select="title"/></title>
- </header>
- <body>
- <s1>
- <xsp:attribute name="title"><jpath:value-of
select="title"/></xsp:attribute>
- <jpath:choose>
- <jpath:when test="errorMsg">
- <p><strong><jpath:value-of select="errorMsg"/></strong></p>
- </jpath:when>
- <jpath:otherwise>
- <p>Please enter the following data</p>
- </jpath:otherwise>
- </jpath:choose>
-
- <form method="post"><xsp:attribute name="action"><xsp:expr>"kont/" +
<jpath:continuation/></xsp:expr></xsp:attribute>
-
- <p>
- <jpath:choose>
- <jpath:when test="check and firstName = ''">
- <strong>First name cannot be empty</strong>
- </jpath:when>
- <jpath:otherwise>
- First name:
- </jpath:otherwise>
- </jpath:choose>
- <input type="text" name="firstName">
- <xsp:attribute name="value"><jpath:value-of
select="firstName"/></xsp:attribute>
- </input>
- </p>
-
- <p>
- <jpath:choose>
- <jpath:when test="check and lastName = ''">
- <strong>Last name cannot be empty</strong>
- </jpath:when>
- <jpath:otherwise>
- Last name:
- </jpath:otherwise>
- </jpath:choose>
- <input type="text" name="lastName">
- <xsp:attribute name="value"><jpath:value-of
select="lastName"/></xsp:attribute>
- </input>
- </p>
-
- <p>
- <jpath:choose>
- <jpath:when test="check and email = ''">
- <strong>Email address cannot be empty</strong>
- </jpath:when>
- <jpath:otherwise>
- Email address:
- </jpath:otherwise>
- </jpath:choose>
- <input type="text" name="email">
- <xsp:attribute name="value"><jpath:value-of
select="email"/></xsp:attribute>
- </input>
- </p>
-
- <p>
- <jpath:choose>
- <jpath:when test="check and login = ''">
- <strong>Login name cannot be empty</strong>
- </jpath:when>
- <jpath:otherwise>
- Login name:
- </jpath:otherwise>
- </jpath:choose>
- <input type="text" name="login">
- <xsp:attribute name="value"><jpath:value-of
select="login"/></xsp:attribute>
- </input>
- </p>
-
-
- <p>
- <jpath:choose>
- <jpath:when test="check and password = ''">
- <strong>Password cannot be empty</strong>
- </jpath:when>
- <jpath:otherwise>
- Password:
- </jpath:otherwise>
- </jpath:choose>
- <input type="password" name="password">
- <xsp:attribute name="value"><jpath:value-of
select="password"/></xsp:attribute>
- </input>
- </p>
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: August 30, 2002
+ |
+ | Page to show the user information.
+ |
+ | This page is used for both user registration and editing the user
+ | information, depending on the information passed down in the page.
+ +-->
+
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/prefs/prefs.js">Flowscript</resource>
+ </resources>
+ <title><jpath:value-of select="title"/></title>
+ <content>
+ <jpath:choose>
+ <jpath:when test="errorMsg">
+ <para><strong><jpath:value-of select="errorMsg"/></strong></para>
+ </jpath:when>
+ <jpath:otherwise>
+ <para>Please enter the following data</para>
+ </jpath:otherwise>
+ </jpath:choose>
+
+ <form method="post"><xsp:attribute name="action"><xsp:expr>"continue."
+ <jpath:continuation/></xsp:expr></xsp:attribute>
+ <para>
+ <jpath:choose>
+ <jpath:when test="check and firstName = ''">
+ <strong>First name cannot be empty</strong>
+ </jpath:when>
+ <jpath:otherwise>
+ First name:
+ </jpath:otherwise>
+ </jpath:choose>
+ <input type="text" name="firstName">
+ <xsp:attribute name="value"><jpath:value-of
select="firstName"/></xsp:attribute>
+ </input>
+ </para>
+ <para>
+ <jpath:choose>
+ <jpath:when test="check and lastName = ''">
+ <strong>Last name cannot be empty</strong>
+ </jpath:when>
+ <jpath:otherwise>
+ Last name:
+ </jpath:otherwise>
+ </jpath:choose>
+ <input type="text" name="lastName">
+ <xsp:attribute name="value"><jpath:value-of
select="lastName"/></xsp:attribute>
+ </input>
+ </para>
- <input type="submit" name="submit">
- <xsp:attribute name="value"><jpath:value-of
select="button"/></xsp:attribute>
+ <para>
+ <jpath:choose>
+ <jpath:when test="check and email = ''">
+ <strong>Email address cannot be empty</strong>
+ </jpath:when>
+ <jpath:otherwise>
+ Email address:
+ </jpath:otherwise>
+ </jpath:choose>
+ <input type="text" name="email">
+ <xsp:attribute name="value"><jpath:value-of
select="email"/></xsp:attribute>
</input>
+ </para>
- <jpath:if test="cancel">
- <input type="submit" name="cancel" value="Cancel"/>
- </jpath:if>
-
- </form>
- </s1>
- </body>
+ <para>
+ <jpath:choose>
+ <jpath:when test="check and login = ''">
+ <strong>Login name cannot be empty</strong>
+ </jpath:when>
+ <jpath:otherwise>
+ Login name:
+ </jpath:otherwise>
+ </jpath:choose>
+ <input type="text" name="login">
+ <xsp:attribute name="value"><jpath:value-of
select="login"/></xsp:attribute>
+ </input>
+ </para>
- </document>
+ <para>
+ <jpath:choose>
+ <jpath:when test="check and password = ''">
+ <strong>Password cannot be empty</strong>
+ </jpath:when>
+ <jpath:otherwise>
+ Password:
+ </jpath:otherwise>
+ </jpath:choose>
+ <input type="password" name="password">
+ <xsp:attribute name="value"><jpath:value-of
select="password"/></xsp:attribute>
+ </input>
+ </para>
+ <input type="submit" name="submit">
+ <xsp:attribute name="value"><jpath:value-of
select="button"/></xsp:attribute>
+ </input>
+
+ <jpath:if test="cancel">
+ <input type="submit" name="cancel" value="Cancel"/>
+ </jpath:if>
+ </form>
+ </content>
+ </page>
</xsp:page>
1.2 +22 -23
cocoon-2.1/src/webapp/samples/flow/prefs/screens/welcome.xsp
Index: welcome.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/prefs/screens/welcome.xsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- welcome.xsp 25 Mar 2003 15:11:28 -0000 1.1
+++ welcome.xsp 20 May 2003 00:54:12 -0000 1.2
@@ -1,27 +1,26 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: August 30, 2002
+ +-->
- Date: August 30, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Welcome!</title>
- </header>
- <body>
- <s1 title="Welcome back!">
- <p>Welcome back, <strong><jpath:value-of select="user/firstName"/>
<jpath:value-of select="user/lastName"/></strong>!</p>
- <p>| <link href="../edit">Edit my preferences</link> | <link
href="../logout">Logout</link> |</p>
- </s1>
- </body>
- </document>
-
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/prefs/prefs.js">Flowscript</resource>
+ </resources>
+ <title>Welcome!</title>
+ <content>
+ <para>Welcome back,
+ <strong>
+ <jpath:value-of select="user/firstName"/> <jpath:value-of
select="user/lastName"/>
+ </strong>!
+ </para>
+ <para>| <link href="edit">Edit my preferences</link> | <link
href="logout">Logout</link> |</para>
+ </content>
+ </page>
</xsp:page>
1.2 +1 -1 cocoon-2.1/src/webapp/samples/flow/test/sendpage.js
Index: sendpage.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/test/sendpage.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sendpage.js 25 Mar 2003 15:11:28 -0000 1.1
+++ sendpage.js 20 May 2003 00:54:12 -0000 1.2
@@ -1,5 +1,5 @@
function showString(parameter)
{
print ("parameter = " + parameter);
- sendPageAndContinue("showString", { "parameter" : parameter, "replaceme" :
"@REPLACEME@" });
+ sendPage("page/showString", { "parameter" : parameter, "replaceme" :
"@REPLACEME@" });
}
1.3 +12 -16 cocoon-2.1/src/webapp/samples/flow/test/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/flow/test/sitemap.xmap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sitemap.xmap 26 Mar 2003 21:21:48 -0000 1.2
+++ sitemap.xmap 20 May 2003 00:54:12 -0000 1.3
@@ -7,32 +7,28 @@
</map:flow>
<map:pipelines>
-
<map:pipeline>
- <map:match pattern="kont/*">
- <map:call continuation="{1}"/>
- </map:match>
-
- <map:match pattern="invalidContinuation">
- <map:generate src="../invalidContinuation.xml"/>
- <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
- <map:serialize/>
+ <map:match pattern="">
+ <map:redirect-to uri="showString"/>
</map:match>
-
+
<map:match pattern="showString">
<map:call function="showString">
<map:parameter name="parameter" value="@PARAMETER@"/>
- </map:call>
+ </map:call>
</map:match>
- <map:match pattern="*">
+ <map:match pattern="page/*">
<map:generate type="serverpages" src="screens/{1}.xsp"/>
- <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl"/>
+ <map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl">
+ <map:parameter name="servletPath" value="{request:servletPath}"/>
+ <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
+ <map:parameter name="contextPath" value="{request:contextPath}"/>
+ <map:parameter name="file"
value="/samples/flow/test/screens/{1}.xsp"/>
+ <map:parameter name="remove" value="{0}"/>
+ </map:transform>
<map:serialize/>
</map:match>
-
</map:pipeline>
-
</map:pipelines>
-
</map:sitemap>
1.2 +20 -23
cocoon-2.1/src/webapp/samples/flow/test/screens/showString.xsp
Index: showString.xsp
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/webapp/samples/flow/test/screens/showString.xsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- showString.xsp 25 Mar 2003 15:11:31 -0000 1.1
+++ showString.xsp 20 May 2003 00:54:12 -0000 1.2
@@ -1,27 +1,24 @@
<?xml version="1.0"?>
-<!--
- Author: Ovidiu Predescu "[EMAIL PROTECTED]"
-
- Date: October 1, 2002
- -->
-
-<xsp:page
- language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:jpath="http://apache.org/xsp/jpath/1.0"
- >
-
- <document>
- <header>
- <title>Show String</title>
- </header>
- <body>
- <s1 title="String">
- <p><jpath:value-of select="replaceme"/></p>
- <p><jpath:value-of select="parameter"/></p>
- </s1>
- </body>
- </document>
+<!--+
+ | CVS: $Id$
+ | Author: Ovidiu Predescu "[EMAIL PROTECTED]"
+ | Date: October 1, 2002
+ |
+ | This page is used by anteater test. Please see
src/test/anteater/flowscriptReload.xml
+ +-->
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:jpath="http://apache.org/xsp/jpath/1.0">
+ <page>
+ <resources>
+ <resource type="file"
href="/samples/flow/test/sendpage.js">Flowscript</resource>
+ </resources>
+ <title>Show String</title>
+ <content>
+ <para><jpath:value-of select="replaceme"/></para>
+ <para><jpath:value-of select="parameter"/></para>
+ </content>
+ </page>
</xsp:page>
1.9 +1 -3 cocoon-2.1/src/webapp/samples/hello-world/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/hello-world/sitemap.xmap,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- sitemap.xmap 8 May 2003 20:42:17 -0000 1.8
+++ sitemap.xmap 20 May 2003 00:54:12 -0000 1.9
@@ -3,7 +3,6 @@
<!-- CVS $Id$ -->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
-
<map:pipelines>
<map:pipeline>
@@ -99,5 +98,4 @@
</map:pipeline>
</map:pipelines>
-
</map:sitemap>
1.2 +0 -4 cocoon-2.1/src/webapp/samples/xsp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/xsp/sitemap.xmap,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sitemap.xmap 27 Mar 2003 17:55:47 -0000 1.1
+++ sitemap.xmap 20 May 2003 00:54:12 -0000 1.2
@@ -1,9 +1,7 @@
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
-
<map:pipelines>
-
<map:pipeline>
<map:match pattern="">
@@ -39,7 +37,5 @@
</map:match>
</map:pipeline>
-
</map:pipelines>
-
</map:sitemap>
1.2 +3 -4 cocoon-2.1/src/test/anteater/all-tests.xml
Index: all-tests.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/test/anteater/all-tests.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- all-tests.xml 9 Mar 2003 00:10:36 -0000 1.1
+++ all-tests.xml 20 May 2003 00:54:12 -0000 1.2
@@ -51,9 +51,8 @@
</target>
<target name="runtest" depends="init">
- <basename property="target" file="${name}" suffix=".xml"/>
- <echo message="running test ${target} in dir ${basedir}"/>
- <ant antfile="${target}.xml" dir="${basedir}" target="${target}"
inheritAll="yes"/>
+ <basename property="target" file="${name}" suffix=".xml"/>
+ <echo message="running test ${target} in dir ${basedir}"/>
+ <ant antfile="${target}.xml" dir="${basedir}" target="${target}"
inheritAll="yes"/>
</target>
-
</project>
1.4 +5 -7 cocoon-2.1/src/test/anteater/calc.xml
Index: calc.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/test/anteater/calc.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- calc.xml 25 Mar 2003 15:12:09 -0000 1.3
+++ calc.xml 20 May 2003 00:54:12 -0000 1.4
@@ -24,13 +24,13 @@
<xpath select="html/body//form/@action" assign="cont2"/>
</match>
</httpRequest>
- <httpRequest href="${calc}/kont/${cont2}">
+ <httpRequest href="${calc}/${cont2}">
<parameter name="b" value="2"/>
<match>
<xpath select="html/body//form/@action" assign="cont3"/>
</match>
</httpRequest>
- <httpRequest href="${calc}/kont/${cont3}">
+ <httpRequest href="${calc}/${cont3}">
<parameter name="operator" value="plus"/>
<match>
<xpath select="html/body//form/p/font[contains(text(),'Result')]/b"
@@ -40,14 +40,14 @@
</httpRequest>
<echo>result = ${result}</echo>
- <httpRequest href="${calc}/kont/${cont2}"
+ <httpRequest href="${calc}/${cont2}"
description="Simulate going back in the browser">
<parameter name="b" value="4"/>
<match>
<xpath select="html/body//form/@action" assign="cont4"/>
</match>
</httpRequest>
- <httpRequest href="${calc}/kont/${cont4}">
+ <httpRequest href="${calc}/${cont4}">
<parameter name="operator" value="minus"/>
<match>
<xpath select="html/body//form/p/font[contains(text(),'Result')]/b"
@@ -57,7 +57,7 @@
</httpRequest>
<echo>result = ${result}</echo>
- <httpRequest href="${calc}/kont/${cont4}"
+ <httpRequest href="${calc}/${cont4}"
description="Simulate going back again in the browser">
<parameter name="operator" value="divide"/>
<match>
@@ -67,7 +67,5 @@
</match>
</httpRequest>
<echo>result = ${result}</echo>
-
</target>
-
</project>
1.3 +3 -4 cocoon-2.1/src/test/anteater/flowscriptReload.xml
Index: flowscriptReload.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/test/anteater/flowscriptReload.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- flowscriptReload.xml 25 Mar 2003 15:12:09 -0000 1.2
+++ flowscriptReload.xml 20 May 2003 00:54:12 -0000 1.3
@@ -20,13 +20,13 @@
tofile="${deploy-dir}${test-dir}/sendpage.js"
overwrite="yes">
<filterset>
- <filter token="REPLACEME" value="replaceme-abc"/>
+ <filter token="REPLACEME" value="replaceme-abc"/>
</filterset>
</copy>
<httpRequest href="${url}" description="Send original request">
<match>
- <xpath select="html/body//p[1]" pattern=".*replaceme-abc.*"/>
+ <xpath select="html/body/p[1]" pattern=".*replaceme-abc.*"/>
</match>
</httpRequest>
@@ -45,10 +45,9 @@
<httpRequest href="${url}" description="Send next request after
flowscript was modified">
<match>
- <xpath select="html/body//p[1]" pattern=".*replaceme-123.*"/>
+ <xpath select="html/body/p[1]" pattern=".*replaceme-123.*"/>
</match>
</httpRequest>
</target>
-
</project>