huber       2003/01/01 03:52:00

  Modified:    src/documentation/xdocs/userdocs/selectors book.xml
  Added:       src/documentation/xdocs/userdocs/selectors
                        requestattribute-selector.xml
                        requestparameter-selector.xml
  Log:
  add doc for requestparameter, and requestattribute selectors
  
  Revision  Changes    Path
  1.4       +2 -0      xml-cocoon2/src/documentation/xdocs/userdocs/selectors/book.xml
  
  Index: book.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/selectors/book.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- book.xml  28 Dec 2002 22:29:24 -0000      1.3
  +++ book.xml  1 Jan 2003 11:52:00 -0000       1.4
  @@ -18,6 +18,8 @@
     </menu>
     <menu label="Core">
       <menu-item label="Host Selector" href="host-selector.html"/>
  +    <menu-item label="Request Parameter Selector" 
href="requestparameter-selector.html"/>
  +    <menu-item label="Request Attribute Selector" 
href="requestattribute-selector.html"/>
       <menu-item label="Parameter" href="parameter-selector.html"/>
     </menu>
     <menu label="Optional">
  
  
  
  1.1                  
xml-cocoon2/src/documentation/xdocs/userdocs/selectors/requestattribute-selector.xml
  
  Index: requestattribute-selector.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" 
"../../dtd/document-v10.dtd">
  
  <!--
    <![CDATA[ CVS Version: $Id: requestattribute-selector.xml,v 1.1 2003/01/01 
11:52:00 huber Exp $ 
    ]]>
  -->
  
  <document>
    <header>
      <title>RequestAttribute-Selector in Cocoon</title>
      <version>0.9</version>
      <type>Technical document</type>
      <authors>
        <person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
      </authors>
      <abstract>This document describes the RequestAttributeSelector of 
Cocoon.</abstract>
    </header>
    <body>
      <s1 title="RequestAttributeSelector">
        <table>
          <tr>
            <td>NAME</td><td>host</td>
          </tr>
          <tr>
            <td>WHAT</td><td>The <code>RequestAttributeSelector</code> component is 
used to
              select appropriate sitemap processing depending on a request attribute
              value.
            </td>
          </tr>
          <tr>
            <td>TYPE</td><td>Selector, Sitemap Component</td>
          </tr>
          <tr>
            <!-- choose Core, the block name, or Scratchpad 
              depending on where RequestAttributeSelector sources live
            -->
            <td>BLOCK</td><td>Core</td>
          </tr>
          <tr>
            <td>CLASS</td><td>org.apache.cocoon.selection.RequestAttributeSelector</td>
          </tr>
          <!-- uncomment folling tr iff RequestAttributeSelector is deprecated -->
          <!--tr>
            <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
          </tr-->
          <tr>
            <td>SINCE</td><td>Cocoon 2.0</td>
          </tr>
          <tr>
            <td>CACHEABLE</td><td>not applicable</td>
          </tr>
        </table>
      </s1>
      <s1 title="Description">
        <p>
          The <code>RequestAttributeSelector</code> tests the value of request 
attribute
          against the test attribute of the selector's when clause.
        </p>
      </s1>
      <s1 title="Usage">
        <p>
          The <code>RequestAttributeSelector</code> allows to control the 
          sitemap processing depending on a request attribute.
        </p>
        <s2 title="Sitemap pipeline examples">
          <p>
            The snippet below uses a <code>RequestAttributeSelector</code> named 
<code>request-attribute</code>.
            It tests the value of request attribute named <code>command</code> against
            <code>list</code>, <code>create</code>; finally it has a 
<code>otherwise</code> clause.
          </p>
          <source><![CDATA[
  <map:select type="request-attribute">
    <map:parameter name="attribute-name" value="command"/>
    <map:when test="list">
    ....
    </map:when>
    <map:when test="create">
    ...
    </map:when>
    ...
    <map:otherwise>
    ...
    </map:otherwise>
  </map:select>
          ]]></source>
        </s2>
        
        <s2 title="Sitemap component configuration example">
          <p>
            The snippet below declares a <code>RequestAttributeSelector</code>
            defining to use the request attribute <code>cmd</code>.
          </p>
          <source><![CDATA[
  <map:selectors...
    <map:selector name="request-attribute" 
      src="org.apache.cocoon.selection.RequestAttributeSelector"
      logger="sitemap.selector.requestattribute">
      
      <attribute-name>command</attribute-name>
    </map:selectors>
  ...
  ]]></source>
        </s2>
        <s2 title="Configuration">
          <p>
            <!-- Explain the sitemap selector configuration, options when declaring 
host selector -->
            The configuration section of <code>RequestAttributeSelector</code> 
specifies
            the default name of the request attribute, used for testing.
          </p>
        </s2>
        <s2 title="Setup">
          <p>
            <!-- Explain the sitemap selector setup, ie options when using host 
selector -->
            Setting up a <code>RequestAttributeSelector</code> includes
          </p>
          <ul>
            <li>Defining an optional sitemap paramter named <code>request-name</code>, 
it overrides
              the attribute-name setting in the configuration section.
            </li>
            <li>choosing the <code>&lt;map:when&gt;</code> test expressions, and a 
            optional <code>&lt;map:otherwise&gt;</code> clause.
            </li>
          </ul>
          <p>
            The test attribute of the <code>&lt;map:when&gt;</code> clause shall match
            the value of the request attribute.
            If no test value matches, or the request attribute is not defined at all,
            the <code>&lt;map:otherwise</code> clause is selected.
          </p>
        </s2>
        <s2 title="Effect on Object Model and Sitemap Parameters">
          <p>
            The <code>RequestAttributeSelector</code> has no side effects on the 
object model, or 
            any sitemap attributes. 
          </p>
        </s2>
      </s1>
      <s1 title="Bugs/Caveats">
        <p>
        </p>
      </s1>
      <s1 title="History">
        <p>
          28-12-02: initial creation
        </p>
      </s1>
      <s1 title="Copyright">
        <p>
          Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
        </p>
      </s1>
      <s1 title="See also">
        <p>
          <!-- Links to related components pages. -->
          A general documentation about selectors is available at
          <link href="../concepts/matchers_selectors.html">Matchers and 
Selectors</link>.
        </p>
      </s1>
    </body>
  </document>
  
  
  
  
  1.1                  
xml-cocoon2/src/documentation/xdocs/userdocs/selectors/requestparameter-selector.xml
  
  Index: requestparameter-selector.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" 
"../../dtd/document-v10.dtd">
  
  <!--
    <![CDATA[ CVS Version: $Id: requestparameter-selector.xml,v 1.1 2003/01/01 
11:52:00 huber Exp $ 
    ]]>
  -->
  
  <document>
    <header>
      <title>RequestParameter-Selector in Cocoon</title>
      <version>0.9</version>
      <type>Technical document</type>
      <authors>
        <person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
      </authors>
      <abstract>This document describes the RequestParameterSelector of 
Cocoon.</abstract>
    </header>
    <body>
      <s1 title="RequestParameterSelector">
        <table>
          <tr>
            <td>NAME</td><td>host</td>
          </tr>
          <tr>
            <td>WHAT</td><td>The <code>RequestParameterSelector</code> component is 
used to
              select appropriate sitemap processing depending on a request parameter
              value.
            </td>
          </tr>
          <tr>
            <td>TYPE</td><td>Selector, Sitemap Component</td>
          </tr>
          <tr>
            <!-- choose Core, the block name, or Scratchpad 
              depending on where RequestParameterSelector sources live
            -->
            <td>BLOCK</td><td>Core</td>
          </tr>
          <tr>
            <td>CLASS</td><td>org.apache.cocoon.selection.RequestParameterSelector</td>
          </tr>
          <!-- uncomment folling tr iff RequestParameterSelector is deprecated -->
          <!--tr>
            <td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
          </tr-->
          <tr>
            <td>SINCE</td><td>Cocoon 2.0</td>
          </tr>
          <tr>
            <td>CACHEABLE</td><td>not applicable</td>
          </tr>
        </table>
      </s1>
      <s1 title="Description">
        <p>
          The <code>RequestParameterSelector</code> tests the value of request 
parameter
          against the test attribute of the selector's when clause.
        </p>
      </s1>
      <s1 title="Usage">
        <p>
          The <code>RequestParameterSelector</code> allows to control the 
          sitemap processing depending on a request parameter.
        </p>
        <s2 title="Sitemap pipeline examples">
          <p>
            The snippet below uses a <code>RequestParameterSelector</code> named 
<code>request-parameter</code>.
            It tests the value of request parameter named <code>command</code> against
            <code>list</code>, <code>create</code>; finally it has a 
<code>otherwise</code> clause.
          </p>
          <source><![CDATA[
  <map:select type="request-parameter">
    <map:parameter name="parameter-name" value="command"/>
    <map:when test="list">
    ....
    </map:when>
    <map:when test="create">
    ...
    </map:when>
    ...
    <map:otherwise>
    ...
    </map:otherwise>
  </map:select>
          ]]></source>
        </s2>
        
        <s2 title="Sitemap component configuration example">
          <p>
            The snippet below declares a <code>RequestParameterSelector</code>
            defining to use the request parameter <code>cmd</code>.
          </p>
          <source><![CDATA[
  <map:selectors...
    <map:selector name="request-parameter" 
      src="org.apache.cocoon.selection.RequestParameterSelector"
      logger="sitemap.selector.requestparameter">
      
      <parameter-name>command</parameter-name>
    </map:selectors>
  ...
  ]]></source>
        </s2>
        <s2 title="Configuration">
          <p>
            <!-- Explain the sitemap selector configuration, options when declaring 
host selector -->
            The configuration section of <code>RequestParameterSelector</code> 
specifies
            the default name of the request parameter, used for testing.
          </p>
        </s2>
        <s2 title="Setup">
          <p>
            <!-- Explain the sitemap selector setup, ie options when using host 
selector -->
            Setting up a <code>RequestParameterSelector</code> includes
          </p>
          <ul>
            <li>Defining an optional sitemap paramter named <code>request-name</code>, 
it overrides
              the parameter-name setting in the configuration section.
            </li>
            <li>choosing the <code>&lt;map:when&gt;</code> test expressions, and a 
            optional <code>&lt;map:otherwise&gt;</code> clause.
            </li>
          </ul>
          <p>
            The test attribute of the <code>&lt;map:when&gt;</code> clause shall match
            the value of the request parameter.
            If no test value matches, or the request parameter is not defined at all,
            the <code>&lt;map:otherwise</code> clause is selected.
          </p>
        </s2>
        <s2 title="Effect on Object Model and Sitemap Parameters">
          <p>
            The <code>RequestParameterSelector</code> has no side effects on the 
object model, or 
            any sitemap parameters. 
          </p>
        </s2>
      </s1>
      <s1 title="Bugs/Caveats">
        <p>
        </p>
      </s1>
      <s1 title="History">
        <p>
          28-12-02: initial creation
        </p>
      </s1>
      <s1 title="Copyright">
        <p>
          Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
        </p>
      </s1>
      <s1 title="See also">
        <p>
          <!-- Links to related components pages. -->
          A general documentation about selectors is available at
          <link href="../concepts/matchers_selectors.html">Matchers and 
Selectors</link>.
        </p>
      </s1>
    </body>
  </document>
  
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to