You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2003/11/18 02:11:49 UTC

cvs commit: cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens displayResult.gt getNumberA.gt getNumberB.gt getOperator.gt

crossley    2003/11/17 17:11:49

  Modified:    src/blocks/scratchpad/samples/garbage sitemap.xmap
               src/blocks/scratchpad/samples/garbage/calc calc.js
               src/blocks/scratchpad/samples/garbage/calc/screens
                        displayResult.gt getNumberA.gt getNumberB.gt
                        getOperator.gt
  Log:
  dos2unix again.
  
  Revision  Changes    Path
  1.3       +45 -45    cocoon-2.1/src/blocks/scratchpad/samples/garbage/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/garbage/sitemap.xmap,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemap.xmap	22 Oct 2003 16:56:20 -0000	1.2
  +++ sitemap.xmap	18 Nov 2003 01:11:48 -0000	1.3
  @@ -1,45 +1,45 @@
  -<?xml version="1.0"?>
  -
  -<!-- CVS $Id$ -->
  -
  -<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  -
  -<!-- =========================== Views =================================== -->
  -
  -  <map:views>
  -    <map:view from-label="content" name="content">
  -      <map:serialize type="xml"/>
  -    </map:view>
  -
  -    <map:view from-label="content" name="pretty-content">
  -      <map:transform src="context://stylesheets/system/xml2html.xslt"/>
  -      <map:serialize type="html"/>
  -    </map:view>
  -
  -    <map:view from-position="last" name="links">
  -      <map:serialize type="links"/>
  -    </map:view>
  -  </map:views>
  -
  -  <map:pipelines>
  -    <map:pipeline>
  -
  -      <map:match pattern="">
  -        <map:generate src="samples.xml"/>
  -        <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
  -           <map:parameter name="contextPath" value="{request:contextPath}"/>
  -        </map:transform>
  -        <map:serialize/>
  -      </map:match>
  -
  -      <map:match pattern="*">
  -        <map:redirect-to uri="{1}/"/>
  -      </map:match>
  -
  -      <map:match pattern="*/**">
  -        <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
  -      </map:match>
  -
  -    </map:pipeline>
  -  </map:pipelines>
  -</map:sitemap>
  +<?xml version="1.0"?>
  +
  +<!-- CVS $Id$ -->
  +
  +<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  +
  +<!-- =========================== Views =================================== -->
  +
  +  <map:views>
  +    <map:view from-label="content" name="content">
  +      <map:serialize type="xml"/>
  +    </map:view>
  +
  +    <map:view from-label="content" name="pretty-content">
  +      <map:transform src="context://stylesheets/system/xml2html.xslt"/>
  +      <map:serialize type="html"/>
  +    </map:view>
  +
  +    <map:view from-position="last" name="links">
  +      <map:serialize type="links"/>
  +    </map:view>
  +  </map:views>
  +
  +  <map:pipelines>
  +    <map:pipeline>
  +
  +      <map:match pattern="">
  +        <map:generate src="samples.xml"/>
  +        <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
  +           <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        </map:transform>
  +        <map:serialize/>
  +      </map:match>
  +
  +      <map:match pattern="*">
  +        <map:redirect-to uri="{1}/"/>
  +      </map:match>
  +
  +      <map:match pattern="*/**">
  +        <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
  +      </map:match>
  +
  +    </map:pipeline>
  +  </map:pipelines>
  +</map:sitemap>
  
  
  
  1.2       +43 -42    cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/calc.js
  
  Index: calc.js
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/calc.js,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- calc.js	4 Sep 2003 12:42:42 -0000	1.1
  +++ calc.js	18 Nov 2003 01:11:48 -0000	1.2
  @@ -1,42 +1,43 @@
  -var a, b, op;
  -
  -function calculator()
  -{
  -  a = getNumber("a");
  -  b = getNumber("b", a);
  -  op = getOperator(a, b);
  -
  -  if (op == "plus")
  -    sendResult(a, b, op, a + b);
  -  else if (op == "minus")
  -    sendResult(a, b, op, a - b);
  -  else if (op == "multiply")
  -    sendResult(a, b, op, a * b);
  -  else if (op == "divide")
  -    sendResult(a, b, op, a / b);
  -  else
  -    sendResult("Error: Unkown operator!");
  -}
  -
  -function getNumber(name, a, b)
  -{
  -  var uri = "page/getNumber" + name.toUpperCase();
  -  cocoon.sendPageAndWait(uri, { "a" : a, "b" : b });
  -  print(cocoon.request);
  -  for (i in cocoon.request) {
  -    print(i + " = " + cocoon.request[i]);
  -  }
  -  return parseFloat(cocoon.request.getParameter(name));
  -}
  -
  -function getOperator(a, b)
  -{
  -  cocoon.sendPageAndWait("page/getOperator", { "a" : a, "b" : b });
  -  return cocoon.request.getParameter("operator");
  -}
  -
  -function sendResult(a, b, op, result)
  -{
  -  cocoon.sendPage("page/displayResult",
  -           { "a" : a, "b" : b, "operator" : op, "result" : result });
  -}
  +var a, b, op;
  +
  +function calculator()
  +{
  +  a = getNumber("a");
  +  b = getNumber("b", a);
  +  op = getOperator(a, b);
  +
  +  if (op == "plus")
  +    sendResult(a, b, op, a + b);
  +  else if (op == "minus")
  +    sendResult(a, b, op, a - b);
  +  else if (op == "multiply")
  +    sendResult(a, b, op, a * b);
  +  else if (op == "divide")
  +    sendResult(a, b, op, a / b);
  +  else
  +    sendResult("Error: Unkown operator!");
  +}
  +
  +function getNumber(name, a, b)
  +{
  +  var uri = "page/getNumber" + name.toUpperCase();
  +  cocoon.sendPageAndWait(uri, { "a" : a, "b" : b });
  +  print(cocoon.request);
  +  for (i in cocoon.request) {
  +    print(i + " = " + cocoon.request[i]);
  +  }
  +  return parseFloat(cocoon.request.getParameter(name));
  +}
  +
  +function getOperator(a, b)
  +{
  +  cocoon.sendPageAndWait("page/getOperator", { "a" : a, "b" : b });
  +  return cocoon.request.getParameter("operator");
  +}
  +
  +function sendResult(a, b, op, result)
  +{
  +  cocoon.sendPage("page/displayResult",
  +           { "a" : a, "b" : b, "operator" : op, "result" : result });
  +}
  +
  
  
  
  1.3       +23 -23    cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/displayResult.gt
  
  Index: displayResult.gt
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/displayResult.gt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- displayResult.gt	22 Oct 2003 16:56:21 -0000	1.2
  +++ displayResult.gt	18 Nov 2003 01:11:48 -0000	1.3
  @@ -1,23 +1,23 @@
  -<?xml version="1.0"?>
  -
  -<!--+
  -    | CVS: $Id$
  -    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  -    | Date: March 23, 2002
  -    +-->
  -
  -<page>
  -  <resources>
  -    <resource type="file" href="calc.js">Flowscript</resource>
  -  </resources>
  -  <title>Calculator</title>
  -  <content>
  -    <form action="./" method="post">
  -      <para>a = <strong>#{a}</strong></para>
  -      <para>b = <strong>#{b}</strong></para>
  -      <para>Operator = <strong>#{operator}</strong></para>
  -      <para>Result = <strong>#{result}</strong></para>
  -      <input type="submit" name="submit" value="Start over"/>
  -    </form>
  -  </content>
  -</page>
  +<?xml version="1.0"?>
  +
  +<!--+
  +    | CVS: $Id$
  +    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  +    | Date: March 23, 2002
  +    +-->
  +
  +<page>
  +  <resources>
  +    <resource type="file" href="calc.js">Flowscript</resource>
  +  </resources>
  +  <title>Calculator</title>
  +  <content>
  +    <form action="./" method="post">
  +      <para>a = <strong>#{a}</strong></para>
  +      <para>b = <strong>#{b}</strong></para>
  +      <para>Operator = <strong>#{operator}</strong></para>
  +      <para>Result = <strong>#{result}</strong></para>
  +      <input type="submit" name="submit" value="Start over"/>
  +    </form>
  +  </content>
  +</page>
  
  
  
  1.3       +20 -20    cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/getNumberA.gt
  
  Index: getNumberA.gt
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/getNumberA.gt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- getNumberA.gt	22 Oct 2003 16:56:21 -0000	1.2
  +++ getNumberA.gt	18 Nov 2003 01:11:48 -0000	1.3
  @@ -1,20 +1,20 @@
  -<?xml version="1.0"?>
  -
  -<!--+
  -    | CVS: $Id$
  -    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  -    | Date: March 23, 2002
  -    +-->
  -
  -<page>
  -  <resources>
  -    <resource type="file" href="calc.js">Flowscript</resource>
  -  </resources>
  -  <title>Calculator</title>
  -  <content>
  -    <form method="post" action="continue.{$continuation/id}">
  -      <para>Enter value of <strong>a</strong>: <input type="text" name="a"/></para>
  -      <input type="submit" name="submit" value="Enter"/>
  -    </form>
  -  </content>
  -</page>
  +<?xml version="1.0"?>
  +
  +<!--+
  +    | CVS: $Id$
  +    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  +    | Date: March 23, 2002
  +    +-->
  +
  +<page>
  +  <resources>
  +    <resource type="file" href="calc.js">Flowscript</resource>
  +  </resources>
  +  <title>Calculator</title>
  +  <content>
  +    <form method="post" action="continue.{$continuation/id}">
  +      <para>Enter value of <strong>a</strong>: <input type="text" name="a"/></para>
  +      <input type="submit" name="submit" value="Enter"/>
  +    </form>
  +  </content>
  +</page>
  
  
  
  1.3       +21 -21    cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/getNumberB.gt
  
  Index: getNumberB.gt
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/getNumberB.gt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- getNumberB.gt	22 Oct 2003 16:56:21 -0000	1.2
  +++ getNumberB.gt	18 Nov 2003 01:11:48 -0000	1.3
  @@ -1,21 +1,21 @@
  -<?xml version="1.0"?>
  -
  -<!--+
  -    | CVS: $Id$
  -    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  -    | Date: March 23, 2002
  -    +-->
  -
  -<page>
  -  <resources>
  -    <resource type="file" href="calc.js">Flowscript</resource>
  -  </resources>
  -  <title>Calculator</title>
  -  <content>
  -    <form method="post" action="continue.{$continuation/id}">
  -      <para>a = <strong>#{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>
  +<?xml version="1.0"?>
  +
  +<!--+
  +    | CVS: $Id$
  +    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  +    | Date: March 23, 2002
  +    +-->
  +
  +<page>
  +  <resources>
  +    <resource type="file" href="calc.js">Flowscript</resource>
  +  </resources>
  +  <title>Calculator</title>
  +  <content>
  +    <form method="post" action="continue.{$continuation/id}">
  +      <para>a = <strong>#{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>
  
  
  
  1.3       +29 -29    cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/getOperator.gt
  
  Index: getOperator.gt
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/garbage/calc/screens/getOperator.gt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- getOperator.gt	22 Oct 2003 16:56:21 -0000	1.2
  +++ getOperator.gt	18 Nov 2003 01:11:48 -0000	1.3
  @@ -1,29 +1,29 @@
  -<?xml version="1.0"?>
  -
  -<!--+
  -    | CVS: $Id$
  -    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  -    | Date: March 23, 2002
  -    +-->
  -
  -<page>
  -  <resources>
  -    <resource type="file" href="calc.js">Flowscript</resource>
  -  </resources>
  -  <title>Calculator</title>
  -  <content>
  -    <form  method="post" action="continue.{$continuation/id}">
  -      <para>a = <strong>#{a}</strong></para>
  -      <para>b = <strong>#{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>
  +<?xml version="1.0"?>
  +
  +<!--+
  +    | CVS: $Id$
  +    | Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  +    | Date: March 23, 2002
  +    +-->
  +
  +<page>
  +  <resources>
  +    <resource type="file" href="calc.js">Flowscript</resource>
  +  </resources>
  +  <title>Calculator</title>
  +  <content>
  +    <form  method="post" action="continue.{$continuation/id}">
  +      <para>a = <strong>#{a}</strong></para>
  +      <para>b = <strong>#{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>