cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From coli...@apache.org
Subject cvs commit: cocoon-2.1/src/documentation/xdocs/userdocs/flow api.xml jpath.xml jxtemplate.xml sitemap.xml using.xml views.xml
Date Sun, 25 May 2003 00:48:47 GMT
coliver     2003/05/24 17:48:47

  Modified:    src/documentation/xdocs/userdocs/flow api.xml jpath.xml
                        jxtemplate.xml sitemap.xml using.xml views.xml
  Log:
  made some corrections and started adding links
  
  Revision  Changes    Path
  1.4       +45 -22    cocoon-2.1/src/documentation/xdocs/userdocs/flow/api.xml
  
  Index: api.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/api.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- api.xml	24 May 2003 20:18:02 -0000	1.3
  +++ api.xml	25 May 2003 00:48:47 -0000	1.4
  @@ -15,9 +15,9 @@
   	<p>Cocoon provides a JavaScript API to manage control flow based on an <link
href="http://cvs.cocoondev.org/cgi-bin/viewcvs.cgi/?cvsroot=rhino">extended</link>
version of <link href="http://www.mozilla.org/rhino">Mozilla Rhino</link> that
supports continuations.</p>
       </s1>
       <s1 title="Functions">
  -    <s2 title = "sendPage">
  +    <s2 title = "sendPage"><anchor id="sendPage"/>
         <p>
  -      <code>void sendPage([String] uri, [Object] bean)</code>
  +      <em>Function</em> <code>sendPage([String] uri, [Object] bean)</code>
         </p>
         <p>
         Passes control to the Cocoon sitemap to generate the output page.
  @@ -29,9 +29,9 @@
          <code>bean</code> is a context object which can be accessed inside this
page to extract various values and place them in the generated page.
         </p>
       </s2>
  -    <s2 title = "sendPageAndWait">
  +    <s2 title = "sendPageAndWait"><anchor id="sendPageAndWait"/>
       <p>
  -    <code>WebContinuation sendPageAndWait([String] uri, [Object] bean, [Number] timeToLive)</code>
  +    <em>Function</em> <code>[WebContinuation] sendPageAndWait([String]
uri, [Object] bean, [Number] timeToLive)</code>
       </p>
        <p>
        Passes control to the Cocoon sitemap to generate the output page.
  @@ -39,75 +39,94 @@
         <p>The flow script is suspended after the page is generated and the whole execution
stack saved in the WebContinuation object returned from this function. </p>
        <p> <code>uri</code> is the relative URL of the page to be sent
back to the client. <code>bean</code> is a context object which can be accessed
inside this page to extract various values and place them in the generated page.</p>
        <p><code>timeToLive</code> is the time to live for the continuation
created.</p>
  -     <p>The return value is the continuation object.</p>
  +     <p>The return value is the <link href="#WebContinuation">continuation</link>
object.</p>
       </s2>
     </s1>
       <s1 title="Objects">
       <s2 title = "cocoon">
  -    </s2>
       <p>The <code>cocoon</code> object represents the current Cocoon sitemap
and provides the following readonly properties:</p> 
  +    <s4 title="request">
       <p>The current Cocoon request:</p>
       <p>
  -    Property <code>[org.apache.cocoon.environment.Request] request</code>
  +    <em>Property</em> <code>[org.apache.cocoon.environment.Request] request</code>
       </p>
  +    </s4>
  +    <s4 title="response">
       <p>The current Cocoon response:</p>
       <p>
  -    Property <code>[org.apache.cocoon.environment.Response] response</code>
  +    <em>Property</em> <code>[org.apache.cocoon.environment.Response]
response</code>
       </p>
  +    </s4>
  +    <s4 title="session">
       <p>The current Cocoon session:</p>
       <p>
  -    Property <code>[org.apache.cocoon.environment.Session] session</code>
  +    <em>Property</em> <code>[org.apache.cocoon.environment.Session] session</code>
       </p>
  +    </s4>
  +    <s4 title="context">
       <p>The current Cocoon application context:</p>
       <p>
  -    Property <code>[org.apache.cocoon.environment.Context] context</code>
  +    <em>Property</em> <code>[org.apache.cocoon.environment.Context] context</code>
       </p>
  +    </s4>
  +    <s4 title="environment">
       <p>The current Cocoon environment:</p>
       <p>
  -    Property <code>[org.apache.cocoon.environment.Environment] environment</code>
  +    <em>Property</em> <code>[org.apache.cocoon.environment.Environment]
environment</code>
       </p>
  +    </s4>
  +    <s4 title="componentManager">
       <p>The current Sitemap's component manager:</p>
       <p>
  -    Property <code>[org.apache.avalon.framework.component.ComponentManager] componentManager</code>
  +    <em>Property</em> <code>[org.apache.avalon.framework.component.ComponentManager]
componentManager</code>
       </p>
  +    </s4>
  +    <s4 title="parameters">
       <p>Any parameters passed to the script by the Sitemap:</p>
       <p>
  -    Property <code>[Array] parameters</code>
  +    <em>Property</em> <code>[Array] parameters</code>
       </p>
       <p>The <code>cocoon</code> object also provides the following functions:</p>
  +    </s4>
  +    <s4 title="process">
       <p>
  -    Function <code>[Boolean] process([String] uri, [Object] bizData, [java.io.OutputStream]
stream)</code></p>
  +    <em>Function</em> <code>[Boolean] process([String] uri, [Object]
bizData, [java.io.OutputStream] stream)</code></p>
       <p>
        Call the Cocoon sitemap for the given URI, sending the output of the
  -     eventually matched pipeline to the specified outputstream.</p>
  +     eventually matched pipeline to the specified <code>OutputStream</code>.</p>
       <p><code>uri</code> is the URI for which the request should be generated.</p>
       <p><code>bizData</code> is the business data object
        to be made available to the forwarded pipeline</p>
        <p><code>stream</code> is an <code>OutputStream</code>
where the output should be written to.</p>
        <p>Returns the result from the Cocoon processor.
        </p>
  +    </s4>
  +    <s4 title="createSession"><anchor id="createSession"/>
       
  -    <p> Function <code>createSession()</code></p>
  +    <p> <em>Function</em> <code>createSession()</code></p>
       <p>  
          Associate the current set of JavaScript global variables with the user's session.
This means that all invocations from the
          sitemap of a JavaScript function (using the &lt;map:call
          function="..."&gt;), will share global JavaScript variables.
       </p> 
   
  +    </s4>
  +    <s4 title="removeSession">
       <p>
  -    Function <code>removeSession()</code>
  +    <em>Function</em> <code>removeSession()</code>
       </p>
       <p>
          Dissociate global JavaScript variables from the user's session.
       </p>
   
  -    <p>Function <code>load([String] uri)</code></p>
  +    <p><em>Function</em> <code>load([String] uri)</code></p>
       <p>
         Load the JavaScript script specified by <code>uri</code>. The Cocoon
        source resolver is used to resolve <code>uri</code>. 
       </p>
  -
  -    <s2 title="WebContinuation">
  +    </s4>
  +    </s2>
  +    <s2 title="WebContinuation"><anchor id="WebContinuation"/>
       <p>A <code>WebContinuation</code> represents a continuation of a
Flowscript. Because a user may click on the back button in the browser and restart a saved
computation in a continuation, each <code>WebContinuation</code> becomes the parent
of a subtree of continuations.
       </p>
       <p>
  @@ -116,8 +135,9 @@
       <p>
          <code>WebContinuation</code> objects support the following functions
and properties:
       </p>
  +    <s4 title="invalidate">
       <p>
  -        Function <code>invalidate()</code>
  +        <em>Function</em> <code>invalidate()</code>
       </p>
       <p>
         Invalidates a <code>WebContinuation</code>. This effectively
  @@ -126,12 +146,15 @@
         <code>WebContinuation</code> invalidates all the
         <code>WebContinuation</code>s which are children of it.    
       </p>
  +    </s4>
  +    <s4 title="id">
       <p>
  -        Property <code>[String] id</code>
  +        <em>Property</em> <code>[String] id</code>
       </p>
       <p>
          Returns this object's unique identifier as a String
       </p>
  +    </s4>
       </s2>
       </s1>
     </body>
  
  
  
  1.3       +1 -1      cocoon-2.1/src/documentation/xdocs/userdocs/flow/jpath.xml
  
  Index: jpath.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/jpath.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jpath.xml	24 May 2003 20:24:49 -0000	1.2
  +++ jpath.xml	25 May 2003 00:48:47 -0000	1.3
  @@ -12,7 +12,7 @@
   <body>
   	<s1 title="JPath Logic Sheet">
     <p>
  -The JPath Logic Sheet is an XSP logic sheet that allows you to access data from a Cocoon
Flowscript in an XSP page and inject it into a Cocoon pipeline. It provides a set of tags
(similar to the those defined by <link href="http://www.w3.org/TR/xslt">XSLT</link>)
that allow you to iterate over Java collections (and Java or JavaScript arrays) and to test
for the presence of optional or alternate bean properties. It is based on <link href="http://jakarta.apache.org/commons/jxpath">Apache
JXPath</link>.
  +The JPath Logic Sheet is an <link href="../xsp/index.html">XSP</link> logic
sheet that allows you to access data from a Cocoon Flowscript in an XSP page and inject it
into a Cocoon pipeline. It provides a set of tags (similar to the those defined by <link
href="http://www.w3.org/TR/xslt">XSLT</link>) that allow you to iterate over Java
collections (and Java or JavaScript arrays) and to test for the presence of optional or alternate
bean properties. It is based on <link href="http://jakarta.apache.org/commons/jxpath">Apache
JXPath</link>.
     </p>
   </s1>
   <s1 title ="Tags">
  
  
  
  1.3       +1 -1      cocoon-2.1/src/documentation/xdocs/userdocs/flow/jxtemplate.xml
  
  Index: jxtemplate.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/jxtemplate.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jxtemplate.xml	24 May 2003 19:22:38 -0000	1.2
  +++ jxtemplate.xml	25 May 2003 00:48:47 -0000	1.3
  @@ -32,7 +32,7 @@
   <p>
   <dl>
   <dt><code>request</code></dt>
  -<dd>The Cocoon current request</dd>
  +<dd>The current Cocoon request</dd>
    
   <dt><code>response</code></dt>
   <dd>The Cocoon response associated with the current request</dd>
  
  
  
  1.2       +42 -1     cocoon-2.1/src/documentation/xdocs/userdocs/flow/sitemap.xml
  
  Index: sitemap.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/sitemap.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sitemap.xml	24 May 2003 18:51:26 -0000	1.1
  +++ sitemap.xml	25 May 2003 00:48:47 -0000	1.2
  @@ -21,23 +21,64 @@
           </map:flow>
         ]]></source>
       </p>
  +<p>
  +  Example:
  +      <source><![CDATA[
  +        <map:flow language="JavaScript">
  +           <map:script src="myApplication.js"/>
  +        </map:flow>
  +      ]]></source>
  +</p>
         </s2>
         <s2 title="call">
        <p>The <code>call</code> element allows you to call a top-level
function in your Flowscript or to invoke an existing continuation.</p>
  +      <s3 title="function"><anchor id="callFunction"/>
         <p>If the <code>function</code> attribute is present, then the
Sitemap will invoke a top-level function defined in your Flowscript. The <code>function</code>
attribute specifies the name of the function. Zero or more nested <code>parameter</code>
elements may be provided to pass arguments to the function.</p>
  -      <p>
         <source><![CDATA[
           <map:call function="FunctionName">
              <map:parameter name="Name" value="Value"/>*
           </map:call>
         ]]></source>
  +      <p>
  +Example:
  +      <source><![CDATA[
  +        <map:flow language="JavaScript">
  +           <map:script src="myApplication.js"/>
  +        </map:flow>
  +        <map:pipelines>
  +           <map:pipeline>
  +              <map:match pattern="index.html">
  +                 <map:call function="showIndexPage"/>
  +              </map:match>
  +           </map:pipeline>
  +        </map:pipelines>
  +      ]]></source>
         </p>
  +      <p>Then in <code>myApplication.js</code> you would define a JavaScript
function called <code>showIndexPage()</code> such as:</p>
  +      <source><![CDATA[
  +        function showIndexPage() { 
  +            var param = cocoon.request.get("paramName");
  +            sendPage("private/index.html", {param: param});
  +        }
  +      ]]></source>
  +      <p></p>
  +      </s3>
  +      <s3 title="continuation"><anchor id="callContinuation"/>
         <p>If the <code>continuation</code> attribute is present, then
the Sitemap will invoke an existing continuation of your Flowscript. The <code>continuation</code>
attribute specifies the unique id of the continuation.</p>
         <p>
         <source><![CDATA[
           <map:call continuation="Id"/>
         ]]></source>
         </p>
  +      <p>
  +Example:
  +      <source><![CDATA[
  +        <map:match pattern="*.form"/>
  +          <map:call continuation="{1}"/>
  +        </map:match>
  +      ]]></source>
  +      </p>
  +      </s3>
         </s2>
       </s1>
   
  
  
  
  1.3       +7 -7      cocoon-2.1/src/documentation/xdocs/userdocs/flow/using.xml
  
  Index: using.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/using.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- using.xml	24 May 2003 19:22:38 -0000	1.2
  +++ using.xml	25 May 2003 00:48:47 -0000	1.3
  @@ -34,12 +34,12 @@
         </li>
         <li>
           To invoke a top level JavaScript function in the Control Flow, you use
  -        the <code>&lt;map:call&nbsp;function="function-name"/&gt;</code>
  +        the <code><link href="sitemap.html#callFunction">&lt;map:call&nbsp;function="function-name"/&gt;</link></code>
           construction.
         </li>
         <li>
           To restart the computation of a previously stopped function, you use
  -        the <code>&lt;map:call&nbsp;continuation="..."/&gt;</code>
construction.
  +        the <code><link href="sitemap.html#callContinuation">&lt;map:call&nbsp;continuation="..."/&gt;</link></code>
construction.
           This restarts the computation saved in a continuation object
           identified by the string value of the <code>continuation</code> attribute.
           This value could be extracted in the sitemap from the requested URL,
  @@ -69,7 +69,7 @@
     <p>
       Once here, the Control Flow has to decide which page needs to be sent back
       to the client browser. To do this, the script can invoke either the
  -    <code>sendPageAndWait</code> or the <code>sendPage</code> functions.
  +    <code><link href="api.html#sendPageAndWait">sendPageAndWait</link></code>
or the <code><link href="api.html#sendPage">sendPage</link></code>
functions.
       These functions take two parameters, the relative URL of the page to be
       sent back to the client, and a context object which can be accessed
       inside this page to extract various values and place them in the
  @@ -86,10 +86,10 @@
    
     <p>
       The page specified by the URL is processed by the sitemap, using the
  -    normal sitemap rules. The simplest case is an XSP generator followed by
  +    normal sitemap rules. The simplest case is a <link href="views.html">generator</link>
followed by
       an XSLT transformation and a serializer. This page generation is part of
  -    the View layer. If an XSP page is processed, you can make use of several
  -    Cocoon generators to retrieve values from the context objects passed by the
  +    the View layer. To process a page you can make use of several
  +    Cocoon <link href="views.html">generators</link> to retrieve values from
the context objects passed by the
       Control Flow.
     </p>
    
  @@ -179,7 +179,7 @@
     <p>
       To solve the problem, the <code>login</code> and
       <code>registerUser</code> functions have to call the
  -    <code>cocoon.createSession()</code> method, which creates a servlet
  +    <code><link href="api.html#createSession">cocoon.createSession()</link></code>
method, which creates a servlet
       session and saves the global scope containing the global variables' value
       in it. Next time the user invokes one of the four top-level functions,
       the values of the global variables is restored, making sharing very easy.
  
  
  
  1.2       +1 -1      cocoon-2.1/src/documentation/xdocs/userdocs/flow/views.xml
  
  Index: views.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/views.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- views.xml	24 May 2003 18:51:26 -0000	1.1
  +++ views.xml	25 May 2003 00:48:47 -0000	1.2
  @@ -19,7 +19,7 @@
   The page specified by the URL is processed by the sitemap, using the normal sitemap rules.
   </p>
   <p>
  -Several generators are provided that allow you to access the context object and inject
its values into a pipeline.
  +Several Cocoon generators are provided that allow you to access the context object and
inject its values into a pipeline. Currently, these are the <link href="jxtemplate.html">JXTemplate
Generator</link>, <link href="jpath.html">JPath XSP Logic Sheet</link>,
and <link href="velocity.html">Velocity Generator</link>.
   </p>
       </s1>
   
  
  
  

Mime
View raw message