shannon     2002/07/10 12:19:26

  Modified:    src/documentation/xdocs/faq Tag: cocoon_2_0_3_branch
                        faq-configure-environment.xml faq-generators.xml
                        faq-sitemap.xml
               src/documentation/xdocs/tutorial Tag: cocoon_2_0_3_branch
                        index.xml
               src/documentation/xdocs/userdocs/concepts Tag:
                        cocoon_2_0_3_branch catalog.xml persistence.xml
               src/documentation/xdocs/userdocs/generators Tag:
                        cocoon_2_0_3_branch linkstatus-generator.xml
               src/documentation/xdocs/userdocs/selectors Tag:
                        cocoon_2_0_3_branch book.xml selectors.xml
               src/documentation/xdocs/userdocs/transformers Tag:
                        cocoon_2_0_3_branch book.xml transformers.xml
  Added:       src/documentation/xdocs/userdocs/selectors Tag:
                        cocoon_2_0_3_branch parameter-selector.xml
               src/documentation/xdocs/userdocs/transformers Tag:
                        cocoon_2_0_3_branch sourcewriting-transformer.xml
  Log:
  sync with HEAD doc updates
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +26 -0     
xml-cocoon2/src/documentation/xdocs/faq/faq-configure-environment.xml
  
  Index: faq-configure-environment.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/faq/faq-configure-environment.xml,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- faq-configure-environment.xml     27 Jun 2002 19:43:03 -0000      1.1.2.2
  +++ faq-configure-environment.xml     10 Jul 2002 19:19:25 -0000      1.1.2.3
  @@ -135,6 +135,9 @@
         RewriteRule ^/Foo /cocoon/Foo/ [R]
         RewriteRule ^/Foo(.*) /cocoon/Foo$1 [R]
      </note>
  +   <note>
  +Another user adds: In my experience, session support is lost when you use 
mod_rewrite because the cookie path for the Cocoon session is "/cocoon". Because the 
browser sees the path differently, the session cookie is not granted access, and 
sessions don't work. I got around this by renaming Cocoon to ROOT, I imagine setting 
the default docBase would have the same effect.   
  +  </note>
    </answer>
   </faq>
   
  @@ -261,6 +264,29 @@
        section in the <link href="../installing/index.html">Cocoon installation 
guide</link>.
      </p>
     </answer>
  +</faq>
  +
  +<faq>
  +  <question>
  +    How can I access Cocoon's status page in a mixed servlet environment
  +    where "/" is not mapped to Cocoon (only *.xml, *.xsp)?
  +  </question>
  +  <answer>
  +  <p>
  +Just change the status pipeline so it matches a request with a ".xml" extension:
  +  </p>
  +  
  +   <source><![CDATA[
  +   <map:match pattern="status.xml">
  +    <map:generate src="status" type="status"/>
  +    <map:transform src="welcome/status2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +]]></source>
  +  <p>
  +Then you can access the status page with "status.xml".
  +  </p>
  +</answer>
   </faq>
   
   </faqs>
  
  
  
  1.1.2.2   +50 -0     xml-cocoon2/src/documentation/xdocs/faq/faq-generators.xml
  
  Index: faq-generators.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/faq/faq-generators.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- faq-generators.xml        7 Jun 2002 19:45:13 -0000       1.1.2.1
  +++ faq-generators.xml        10 Jul 2002 19:19:25 -0000      1.1.2.2
  @@ -31,10 +31,60 @@
   </answer>
   </faq>
   
  +<faq>
  + <question>
  +  How can I dynamically specify the source for my generator?
  + </question>
   
  + <answer>
  +  <p>For example, I want the &lt;generate&gt;'s src attribute to be defined based 
on a request.
  +  </p>
  +  <p>
  +Here are two solutions (depending on your version of Cocoon):
  +  </p>
   
  +  <p>
  +(1) RequestParamAction (2.0.x + 2.1)
  +  </p>
   
  +<source><![CDATA[
  + <map:match pattern="tba/*">
  +    <map:act type="request">
  +       <map:parameter name="parameters" value="true"/>
  +       <map:generate src="{page}"/>
  +       <map:transform src="docs/samples/tba/redirect.xsl"/>
  +       <map:serialize type="html"/>
  +    </map:act>
  +    <!-- else ? -->
  + </map:match>
  +]]></source>
   
  +  <p>     
  +Adding &lt;map:act type="request"&gt; and 
  +&lt;map:parameter name="parameters" value="true"/&gt; makes it
  +possible to get the page request attribute.
  +Then, you can define the src attribute by using the value of the page attribute
  +like this: &lt;map:generate src="{page}"/&gt;.
  +  </p>
  +
  +  <p>
  +(2) InputModules (2.1)
  +  </p>
  +  
  +<source><![CDATA[
  + <map:match pattern="tba/*">
  +     <map:generate src="{request:page}"/>
  +     <map:transform src="docs/samples/tba/redirect.xsl"/>
  +     <map:serialize type="html"/>
  + </map:match>
  +]]></source>
  +
  +  <p>
  +In addition, you may want to use ResourceExistsAction to check whether 
  +the provided page exists.  
  +  </p>
  +</answer>
  +</faq>
   </faqs>
   
    
  
  
  
  1.4.2.3   +32 -2     xml-cocoon2/src/documentation/xdocs/faq/faq-sitemap.xml
  
  Index: faq-sitemap.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/faq/faq-sitemap.xml,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- faq-sitemap.xml   3 Jul 2002 22:47:50 -0000       1.4.2.2
  +++ faq-sitemap.xml   10 Jul 2002 19:19:25 -0000      1.4.2.3
  @@ -232,6 +232,36 @@
     </answer>
   </faq>
   
  -
  -
  +<faq>
  +  <question>
  +What's the difference between having two pipelines with one matcher 
  +each, and one pipeline with two matchers?
  +  </question>
  +  <answer>
  +   <p>
  +If there is no other difference in pipeline declarations, then none, really. Note 
that pipelines can differ by:
  +  </p>
  +<ul>
  +     <li>
  +visibility: internal-only="true" (not accessible for external requests) or not.
  +   </li>
  +   <li>
  +error handling: using different &lt;handle-errors&gt;s.
  +   </li>
  +   <li>
  +cachability (since 2.1): some requests can use cached responses
  +from caching pipeline. Others, which should not be cached, can be
  +handled by the non-caching pipeline implementation.
  +  </li>
  +  <li>
  +logical grouping: logically-related components can be grouped into
  +separate pipelines to improve readability and ease administrative concerns.
  +  </li>
  +  <li>
  +ids: used to identify pipeline and other elements. See the "sitebuilder" sitemap 
editor
  +in scratchpad samples for an example.
  +  </li>
  +</ul>
  + </answer>
  + </faq>
   </faqs>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +4 -4      xml-cocoon2/src/documentation/xdocs/tutorial/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/tutorial/index.xml,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- index.xml 7 Jun 2002 19:52:38 -0000       1.3.2.1
  +++ index.xml 10 Jul 2002 19:19:25 -0000      1.3.2.2
  @@ -33,10 +33,10 @@
     <s2 title="Third-Party Tutorials">
   
        <ul>
  -<li>Andreas Hartmann's <link 
href="http://www.cocooncenter.de/cc/documents/resources/request-params/index.html/";>Request
 Parameters</link> Tutorial at cocooncenter.de.</li>
  -<li>Andreas Hartmann's <link 
href="http://www.cocooncenter.de/cc/documents/resources/navigation/index.html/";>Navigation
 Menus</link> Tutorial at cocooncenter.de.</li>
  -<li> Michal Durdina's <link 
href="http://www.cocooncenter.de/cc/documents/resources/db-app/index.html/";>Database 
Web Application</link> Tutorial at cocooncenter.de.</li>
  -<li>Konstantin Piroumian's <link 
href="http://www.cocooncenter.de/cc/documents/resources/logicsheet/index.html/";>Logicsheet
 Development</link> Tutorial at cocooncenter.de.</li>
  +<li>Andreas Hartmann's <link 
href="http://www.cocooncenter.de/cc/documents/resources/request-params/index.html";>Request
 Parameters</link> Tutorial at cocooncenter.de.</li>
  +<li>Andreas Hartmann's <link 
href="http://www.cocooncenter.de/cc/documents/resources/navigation/index.html";>Navigation
 Menus</link> Tutorial at cocooncenter.de.</li>
  +<li> Michal Durdina's <link 
href="http://www.cocooncenter.de/cc/documents/resources/db-app/index.html";>Database 
Web Application</link> Tutorial at cocooncenter.de.</li>
  +<li>Konstantin Piroumian's <link 
href="http://www.cocooncenter.de/cc/documents/resources/logicsheet/index.html";>Logicsheet
 Development</link> Tutorial at cocooncenter.de.</li>
   <li><link href="http://www.galatea.com/flashguides/index.html";>Galatea 
FlashGuides(TM)</link></li>
   <li><link href="http://durdo.miesto.sk/Cocoon2HowTo/index.html";>Cocoon 2 How-To 
Pages</link></li>
   <li>Leigh Dodds's <link 
href="http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle/83F66813F7FFD61486256B74006EB648?open&amp;l=472,t=gr";>Introduction
 to Cocoon 2</link> at the IBM developerWorks web site. Covers how to install and 
configure Cocoon,
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.5   +5 -6      
xml-cocoon2/src/documentation/xdocs/userdocs/concepts/catalog.xml
  
  Index: catalog.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/concepts/catalog.xml,v
  retrieving revision 1.2.2.4
  retrieving revision 1.2.2.5
  diff -u -r1.2.2.4 -r1.2.2.5
  --- catalog.xml       4 Jul 2002 19:58:09 -0000       1.2.2.4
  +++ catalog.xml       10 Jul 2002 19:19:25 -0000      1.2.2.5
  @@ -390,7 +390,7 @@
     <p>
      A default catalog and some base entities (e.g. ISO*.pen character
      entity sets) are included in the Cocoon distribution at 
  -   <code>webapps/cocoon/resources/entities/</code>
  +   <code>WEB-INF/entities/</code>
      - the default catalog is automatically loaded when Cocoon starts.
     </p>
   
  @@ -438,11 +438,10 @@
      </p>
   
      <p>
  -    The build process will automatically copy the properties file from
  -<code>$COCOON_HOME/webapp/resources/entities/CatalogManager.properties</code>
  -    to
  -<code>$TOMCAT_HOME/webapps/cocoon/WEB-INF/classes/CatalogManager.properties</code>
  -    thereby making it available to the Java classpath.
  +    The file is at 
  +<code>webapp/WEB-INF/classes/CatalogManager.properties</code>
  +    thereby making it available to the Java classpath during startup of the
  +    servlet engine.
      </p>
   
      <p>
  
  
  
  1.1.2.1   +1 -1      
xml-cocoon2/src/documentation/xdocs/userdocs/concepts/persistence.xml
  
  Index: persistence.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/concepts/persistence.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- persistence.xml   14 Mar 2002 21:43:00 -0000      1.1
  +++ persistence.xml   10 Jul 2002 19:19:25 -0000      1.1.2.1
  @@ -23,7 +23,7 @@
     have problems when the filenames are very long.</p>
     </s1>  
     <s1 title="Jisp based persistence:">
  -  <p>The aim of the <link href="http://www.coyotegulch.com/jisp/index.html";>Jisp
  +  <p>The aim of the <link 
href="http://www.coyotegulch.com/algorithm/jisp/index.html";>Jisp
     based</link> persistence is to provide a more scalable persistence. The objects 
     are stored in an indexed file, which uses a B-Tree alghorithm to store the 
objects. 
     This is a more elegant and fast solution, especially when you have to handle many
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-cocoon2/src/documentation/xdocs/userdocs/generators/linkstatus-generator.xml
  
  Index: linkstatus-generator.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/generators/linkstatus-generator.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- linkstatus-generator.xml  4 Jul 2002 02:34:59 -0000       1.1.2.1
  +++ linkstatus-generator.xml  10 Jul 2002 19:19:25 -0000      1.1.2.2
  @@ -15,7 +15,7 @@
    <body>
     <s1 title="LinkStatus Generator">
      <p>
  -    The LinkStatus Generator emits a list of links that are reachable.
  +    The LinkStatus Generator emits a list of links that are reachable. Please note 
that it is available only in Cocoon 2.1.
      </p>
      <p>
       The LinkStatusGenerator has serveral configuration options.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +3 -1      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.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- book.xml  3 Jan 2002 12:31:05 -0000       1.1
  +++ book.xml  10 Jul 2002 19:19:25 -0000      1.1.2.1
  @@ -10,15 +10,17 @@
       <menu-item label="User Documentation" href="../index.html"/>
     </menu>
   
  -  <menu label="Matchers">
  +  <menu label="Selectors">
       <menu-item label="Overview" href="selectors.html"/>
     </menu>
     <menu label="Default">
     </menu>
     <menu label="Core">
  +    <menu-item label="Parameter" href="parameter-selector.html"/>
     </menu>
     <menu label="Optional">
     </menu>
  +
   
   </book>
   
  
  
  
  1.1.2.2   +1 -1      
xml-cocoon2/src/documentation/xdocs/userdocs/selectors/selectors.xml
  
  Index: selectors.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/selectors/selectors.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- selectors.xml     7 Jun 2002 20:00:57 -0000       1.1.2.1
  +++ selectors.xml     10 Jul 2002 19:19:25 -0000      1.1.2.2
  @@ -94,7 +94,7 @@
                                <li><strong>HostSelector</strong>: matches the 
&quot;test&quot; parameter value
           against the Host request header</li>
   
  -                             <li><strong>ParameterSelector</strong>: matches the 
string specified
  +                             <li><link 
href="parameter-selector.html">ParameterSelector</link>: matches the string specified
           in the &quot;test&quot; parameter against a specified Cocoon internal
           (e.g. sitemap) parameter;</li>
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +158 -158  
xml-cocoon2/src/documentation/xdocs/userdocs/selectors/parameter-selector.xml
  
  Index: parameter-selector.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/selectors/parameter-selector.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- parameter-selector.xml    10 Jul 2002 19:14:51 -0000      1.2
  +++ parameter-selector.xml    10 Jul 2002 19:19:25 -0000      1.2.2.1
  @@ -1,158 +1,158 @@
  -<?xml version="1.0" encoding="UTF-8"?>
  -<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" 
"../../dtd/document-v10.dtd">
  -
  -<document>
  - <header>
  -  <title>Parameter Selector</title>
  -  <subtitle>in @doctitle@</subtitle>
  -  <version>0.9</version>
  -  <type>Technical document</type>
  -  <authors>
  -   <person name="Beth Naquin" email="[EMAIL PROTECTED]"/>
  -  </authors>
  -  <abstract>This document describes the Parameter Selector.</abstract>
  - </header>
  - <body>
  -  <s1 title="Parameter Selector">
  -   
  -   <ul>
  -    <li>Name : ParameterSelector</li>
  -    <li>Class: org.apache.cocoon.selection.ParameterSelector</li>
  -    <li>Cacheable: not applicable</li>
  -   </ul>
  -   
  -   <p>
  -    This Selector matches a string, in the Parameters object passed to the 
  -    selector, against a specified Cocoon internal parameter.  It performs a 
  -    case-sensitive string comparison between the value of the 
  -    'parameter-selector-test' parameter and the value of the 'test' 
  -    attribute of the <code><![CDATA[<map:when ...>]]></code> element.
  -   </p>
  -   
  -   <p>
  -   This internal parameter could be:
  -   </p>
  -   <ul>
  -    <li>A sitemap parameter from the <code><![CDATA[<map:match ...>]]></code> 
portion of the pipeline</li>
  -    <li>A sitemap parameter set by an action</li>
  -   </ul>
  -   </s1>
  -   
  -   
  -   <s1 title="Reasons to use ParameterSelector">
  -   <p>
  -   One purpose of this selector is to choose between different components 
  -   of a pipeline based on sitemap parameters set by an action.  This would 
  -   allow the action to control the logic required to set one or more parameters, 
  -   which can then be used by this selector to control pipeline processing.  
  -   Thus, complex decision-making logic can be contained in actions, while the 
  -   sitemap simply uses the results of the actions (the parameters) to determine 
  -   pipeline processing.
  -   </p>
  -   <p>
  -   Parameter Selector can also be used to select on the value of 'keys' 
  -   (such as {1} or {../2} ) from the wildcard matcher.  Information in the 
  -   URI, such as part of a filename, can then be used to determine pipeline 
  -   processing.   
  -   </p>
  -   </s1>
  -   
  -   <s1 title="Examples">
  -   <p>
  -   Add the component to your sitemap.xmap:
  -   </p>
  -   <source><![CDATA[
  -   <map:components>
  -    ...
  -    <map:selectors>
  -     ...
  -     <map:selector
  -         name="parameter"
  -             logger="sitemap.selector.parameter"
  -             src="org.apache.cocoon.selection.ParameterSelector"/>
  -     ...]]></source>
  -   
  -   <p>
  -   Use a parameter set by an action:
  -   </p>
  -   <p>
  -    Assume there is an action (named MyAction) that sets a parameter 
  -    (named MyRegion) to several possible values.  For more information on actions, 
  -    including a simple example of an action that creates a sitemap parameter, see
  -    <link href="../concepts/actions.html">Creating and Using Actions</link>.
  -   </p>
  -   <source><![CDATA[
  -   <map:match pattern="*.xml">
  -    <map:act type="MyAction">
  -      <map:generate src="{../1}.xml"/>
  -
  -      <map:select type="parameter">
  -        <map:parameter name="parameter-selector-test" value="{MyRegion}"/>
  -      
  -        <!-- executes iff the value of MyRegion equals 
  -             "United States" (without quotes) -->
  -        <map:when test="United States">
  -          <map:transform src="stylesheets/us.xsl"/>
  -        </map:when>
  -      
  -        <map:when test="South_America">
  -          <map:transform src="stylesheets/southamerica.xsl"/>
  -        </map:when>
  -
  -        <map:when test="Europe">
  -          <map:transform src="stylesheets/europe.xsl"/>
  -        </map:when>
  -
  -        <map:otherwise>
  -          <map:transform src="all_others.xsl"
  -        </map:otherwise>
  -
  -      </map:select>
  -    </map:act>
  -    <map:serialize/>
  -  </map:match>]]></source>
  -   
  -   <p>
  -   Use values from the URI:
  -   </p>
  -   <source><![CDATA[
  -   <map:pipeline>
  -     <!-- {1}/{2}/myfile.xml -->
  -     <map:match pattern="**/*/myfile.xml"> 
  -   
  -       <!-- Use ParameterSelector -->
  -       <map:select type="parameter">
  -        <map:parameter name="parameter-selector-test" value="{2}"/>
  -
  -        <!-- executes iff the value of {2} equals 
  -             "basic" (without quotes); the requested URI
  -              could be **/basic/myfile.xml -->
  -        <map:when test="basic">
  -            <map:generate src="{1}/myfile.xml"/>
  -            <map:transform src="stylesheets/basic.xsl">
  -                <map:parameter name="use-request-parameters" value="true"/>
  -                <map:parameter name="resource" value="{2}.html"/>
  -            </map:transform>
  -            <map:serialize/>
  -        </map:when>
  -
  -        <map:when test="aggregate">
  -            <map:aggregate element="site">
  -             <map:part src="cocoon:/{1}/sidebar-{1}/{2}.xml"/>
  -             <map:part src="cocoon:/body-{1}/{2}.xsp"/>
  -            </map:aggregate>
  -            <map:transform src="stylesheets/aggregate2xhtml.xsl"/>
  -            <map:serialize/>
  -        </map:when>
  -
  -        <map:otherwise>
  -            <map:redirect-to uri="other_URI"/>
  -        </map:otherwise>
  -
  -      </map:select>
  -    </map:match> 
  -    ...]]></source>
  -   </s1>
  -   
  - </body>
  -</document>
  +<?xml version="1.0" encoding="UTF-8"?>
  +<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" 
"../../dtd/document-v10.dtd">
  +
  +<document>
  + <header>
  +  <title>Parameter Selector</title>
  +  <subtitle>in @doctitle@</subtitle>
  +  <version>0.9</version>
  +  <type>Technical document</type>
  +  <authors>
  +   <person name="Beth Naquin" email="[EMAIL PROTECTED]"/>
  +  </authors>
  +  <abstract>This document describes the Parameter Selector.</abstract>
  + </header>
  + <body>
  +  <s1 title="Parameter Selector">
  +   
  +   <ul>
  +    <li>Name : ParameterSelector</li>
  +    <li>Class: org.apache.cocoon.selection.ParameterSelector</li>
  +    <li>Cacheable: not applicable</li>
  +   </ul>
  +   
  +   <p>
  +    This Selector matches a string, in the Parameters object passed to the 
  +    selector, against a specified Cocoon internal parameter.  It performs a 
  +    case-sensitive string comparison between the value of the 
  +    'parameter-selector-test' parameter and the value of the 'test' 
  +    attribute of the <code><![CDATA[<map:when ...>]]></code> element.
  +   </p>
  +   
  +   <p>
  +   This internal parameter could be:
  +   </p>
  +   <ul>
  +    <li>A sitemap parameter from the <code><![CDATA[<map:match ...>]]></code> 
portion of the pipeline</li>
  +    <li>A sitemap parameter set by an action</li>
  +   </ul>
  +   </s1>
  +   
  +   
  +   <s1 title="Reasons to use ParameterSelector">
  +   <p>
  +   One purpose of this selector is to choose between different components 
  +   of a pipeline based on sitemap parameters set by an action.  This would 
  +   allow the action to control the logic required to set one or more parameters, 
  +   which can then be used by this selector to control pipeline processing.  
  +   Thus, complex decision-making logic can be contained in actions, while the 
  +   sitemap simply uses the results of the actions (the parameters) to determine 
  +   pipeline processing.
  +   </p>
  +   <p>
  +   Parameter Selector can also be used to select on the value of 'keys' 
  +   (such as {1} or {../2} ) from the wildcard matcher.  Information in the 
  +   URI, such as part of a filename, can then be used to determine pipeline 
  +   processing.   
  +   </p>
  +   </s1>
  +   
  +   <s1 title="Examples">
  +   <p>
  +   Add the component to your sitemap.xmap:
  +   </p>
  +   <source><![CDATA[
  +   <map:components>
  +    ...
  +    <map:selectors>
  +     ...
  +     <map:selector
  +         name="parameter"
  +             logger="sitemap.selector.parameter"
  +             src="org.apache.cocoon.selection.ParameterSelector"/>
  +     ...]]></source>
  +   
  +   <p>
  +   Use a parameter set by an action:
  +   </p>
  +   <p>
  +    Assume there is an action (named MyAction) that sets a parameter 
  +    (named MyRegion) to several possible values.  For more information on actions, 
  +    including a simple example of an action that creates a sitemap parameter, see
  +    <link href="../concepts/actions.html">Creating and Using Actions</link>.
  +   </p>
  +   <source><![CDATA[
  +   <map:match pattern="*.xml">
  +    <map:act type="MyAction">
  +      <map:generate src="{../1}.xml"/>
  +
  +      <map:select type="parameter">
  +        <map:parameter name="parameter-selector-test" value="{MyRegion}"/>
  +      
  +        <!-- executes iff the value of MyRegion equals 
  +             "United States" (without quotes) -->
  +        <map:when test="United States">
  +          <map:transform src="stylesheets/us.xsl"/>
  +        </map:when>
  +      
  +        <map:when test="South_America">
  +          <map:transform src="stylesheets/southamerica.xsl"/>
  +        </map:when>
  +
  +        <map:when test="Europe">
  +          <map:transform src="stylesheets/europe.xsl"/>
  +        </map:when>
  +
  +        <map:otherwise>
  +          <map:transform src="all_others.xsl"
  +        </map:otherwise>
  +
  +      </map:select>
  +    </map:act>
  +    <map:serialize/>
  +  </map:match>]]></source>
  +   
  +   <p>
  +   Use values from the URI:
  +   </p>
  +   <source><![CDATA[
  +   <map:pipeline>
  +     <!-- {1}/{2}/myfile.xml -->
  +     <map:match pattern="**/*/myfile.xml"> 
  +   
  +       <!-- Use ParameterSelector -->
  +       <map:select type="parameter">
  +        <map:parameter name="parameter-selector-test" value="{2}"/>
  +
  +        <!-- executes iff the value of {2} equals 
  +             "basic" (without quotes); the requested URI
  +              could be **/basic/myfile.xml -->
  +        <map:when test="basic">
  +            <map:generate src="{1}/myfile.xml"/>
  +            <map:transform src="stylesheets/basic.xsl">
  +                <map:parameter name="use-request-parameters" value="true"/>
  +                <map:parameter name="resource" value="{2}.html"/>
  +            </map:transform>
  +            <map:serialize/>
  +        </map:when>
  +
  +        <map:when test="aggregate">
  +            <map:aggregate element="site">
  +             <map:part src="cocoon:/{1}/sidebar-{1}/{2}.xml"/>
  +             <map:part src="cocoon:/body-{1}/{2}.xsp"/>
  +            </map:aggregate>
  +            <map:transform src="stylesheets/aggregate2xhtml.xsl"/>
  +            <map:serialize/>
  +        </map:when>
  +
  +        <map:otherwise>
  +            <map:redirect-to uri="other_URI"/>
  +        </map:otherwise>
  +
  +      </map:select>
  +    </map:match> 
  +    ...]]></source>
  +   </s1>
  +   
  + </body>
  +</document>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -0      
xml-cocoon2/src/documentation/xdocs/userdocs/transformers/book.xml
  
  Index: book.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/transformers/book.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- book.xml  4 Jul 2002 02:39:45 -0000       1.1.2.1
  +++ book.xml  10 Jul 2002 19:19:25 -0000      1.1.2.2
  @@ -27,6 +27,7 @@
       <menu-item label="XInclude Transformer" href="xinclude-transformer.html"/>
       <menu-item label="CInclude Transformer" href="cinclude-transformer.html"/>
       <menu-item label="EncodeURL Transformer" href="encodeurl-transformer.html"/>
  +    <menu-item label="SourceWriting Transformer" 
href="sourcewriting-transformer.html"/>
     </menu>
     <menu label="Optional">
       <menu-item label="XT Transformer" href="xt-transformer.html"/>
  
  
  
  1.1.2.3   +1 -0      
xml-cocoon2/src/documentation/xdocs/userdocs/transformers/transformers.xml
  
  Index: transformers.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/transformers/transformers.xml,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- transformers.xml  4 Jul 2002 02:39:45 -0000       1.1.2.2
  +++ transformers.xml  10 Jul 2002 19:19:25 -0000      1.1.2.3
  @@ -40,6 +40,7 @@
                                <li><link href="xinclude-transformer.html">XInclude 
Transformer</link></li>
                                <li><link href="cinclude-transformer.html">CInclude 
Transformer</link></li>
                                <li><link href="encodeurl-transformer.html">EncodeURL 
Transformer</link></li>
  +                             <li><link 
href="sourcewriting-transformer.html">SourceWriting Transformer</link></li>
                                <li><link href="xt-transformer.html">XT 
Transformer</link> (optional)</li>
                                <li><link href="ldap-transformer.html">LDAP 
Transformer</link> (optional)</li>
                        </ul>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +0 -0      
xml-cocoon2/src/documentation/xdocs/userdocs/transformers/sourcewriting-transformer.xml
  
  Index: sourcewriting-transformer.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/transformers/sourcewriting-transformer.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  

----------------------------------------------------------------------
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