You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2001/07/28 03:50:25 UTC

cvs commit: xml-cocoon2/xdocs sitemap.xml

vgritsenko    01/07/27 18:50:25

  Modified:    xdocs    sitemap.xml
  Log:
  Updated documentation,
  Views and Actions added
  
  Revision  Changes    Path
  1.6       +486 -363  xml-cocoon2/xdocs/sitemap.xml
  
  Index: sitemap.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/sitemap.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sitemap.xml	2001/07/19 14:20:23	1.5
  +++ sitemap.xml	2001/07/28 01:50:25	1.6
  @@ -15,71 +15,73 @@
    <body>
   
     <s1 title="The Sitemap">
  -   <p>
  -    This document is used as a working draft for 
  -    @docname@ architects to understand the issues associated with 
  -    sitemaps and XML publishing in general. It must be considered as a working 
  -    draft and may be updated at any time.
  -   </p>
  -
  -   <p>
  -    This document is based on ideas and design patterns inspired by Stefano 
  -    Mazzocchi (stefano@apache.org) and Pierpaolo Fumagalli (pier@apache.org)
  -    but grew as a collaborative effort to provide a solid foundation of
  -    design patterns and usability guidelines to create a solid foundation
  -    of sitemap programmability and usability to the @docname@ Publishing 
  -    Framework.
  -   </p>
  -
  -   <p>
  -    This is one of the few examples where open source is transformed into
  -    "open development" leading both the implementation and the pure research
  -    around software development and usability.
  -   </p>
  -
  -   <p>
  -    The goal of the sitemap is to allow non-programmers to create web sites
  -    and web applications built from logic components and XML documents.
  -   </p>
  -
  -   <p>
  -    It finds inspiration from both Apache's httpd.conf/.htaccess files as well
  -    as from Servlet API 2.2 WAR archives. It uses concepts such as Cascading
  -    from W3C CSS, as well as declarative approaches integrated into the W3C 
  -    XSLT language. It also uses some element/attribute equivalence patterns 
  -    used in W3C RDF.
  -   </p>
  -
  -   <p>
  -    The following goals were identified as engineering constraints:
  -   </p>
  -
  -   <ol>
  -    <li>minimal verbosity is of maximum importance.</li>
  -    <li>the schema should be sufficiently expressive to allow learning by
  -     examples.</li>
  -    <li>sitemap authoring should not require assistive tools, but be
  -     sufficiently future-compatible to allow them.</li>
  -    <li>sitemaps must scale along with the site and should not impose growth
  -     limitation to the site as a whole nor limit its administration with size
  -     increase.</li>
  -    <li>sitemaps should contain all the information required to @docname@ to
  -     generate all the requests it receives.</li>
  -    <li>sitemaps should contain information for both dynamic operation as
  -     well as offline generation.</li>
  -    <li>uri mapping should be powerful enough to allow every possible mapping
  -     need.</li>
  -    <li>basic web-serving functionalities (redirection, error pages,
  -     resource authorisation) should be provided.</li>
  -    <li>sitemaps should not limit @docname@'s intrinsic modular extensibility.</li>
  -    <li>resources must be matched with all possible state variables, not
  -     only with URI (http parameters, environment variables, server
  -     parameters, time, etc...).</li>
  -    <li>sitemaps should embed the notion of "semantic resources" to be
  -     future-compatible with semantic crawling and indexing.</li>
  -    <li>sitemaps should be flexible enough to allow a complete web site to
  -     be built with @docname@.</li>
  -   </ol>
  +   <s2 title="Introduction">
  +    <p>
  +     This document is used as a working draft for 
  +     @docname@ architects to understand the issues associated with 
  +     sitemaps and XML publishing in general. It must be considered as a working 
  +     draft and may be updated at any time.
  +    </p>
  + 
  +    <p>
  +     This document is based on ideas and design patterns inspired by Stefano 
  +     Mazzocchi (stefano@apache.org) and Pierpaolo Fumagalli (pier@apache.org)
  +     but grew as a collaborative effort to provide a solid foundation of
  +     design patterns and usability guidelines to create a solid foundation
  +     of sitemap programmability and usability to the @docname@ Publishing 
  +     Framework.
  +    </p>
  + 
  +    <p>
  +     This is one of the few examples where open source is transformed into
  +     "open development" leading both the implementation and the pure research
  +     around software development and usability.
  +    </p>
  + 
  +    <p>
  +     The goal of the sitemap is to allow non-programmers to create web sites
  +     and web applications built from logic components and XML documents.
  +    </p>
  + 
  +    <p>
  +     It finds inspiration from both Apache's httpd.conf/.htaccess files as well
  +     as from Servlet API 2.2 WAR archives. It uses concepts such as Cascading
  +     from W3C CSS, as well as declarative approaches integrated into the W3C 
  +     XSLT language. It also uses some element/attribute equivalence patterns 
  +     used in W3C RDF.
  +    </p>
  + 
  +    <p>
  +     The following goals were identified as engineering constraints:
  +    </p>
  + 
  +    <ol>
  +     <li>minimal verbosity is of maximum importance.</li>
  +     <li>the schema should be sufficiently expressive to allow learning by
  +      examples.</li>
  +     <li>sitemap authoring should not require assistive tools, but be
  +      sufficiently future-compatible to allow them.</li>
  +     <li>sitemaps must scale along with the site and should not impose growth
  +      limitation to the site as a whole nor limit its administration with size
  +      increase.</li>
  +     <li>sitemaps should contain all the information required to @docname@ to
  +      generate all the requests it receives.</li>
  +     <li>sitemaps should contain information for both dynamic operation as
  +      well as offline generation.</li>
  +     <li>uri mapping should be powerful enough to allow every possible mapping
  +      need.</li>
  +     <li>basic web-serving functionalities (redirection, error pages,
  +      resource authorisation) should be provided.</li>
  +     <li>sitemaps should not limit @docname@'s intrinsic modular extensibility.</li>
  +     <li>resources must be matched with all possible state variables, not
  +      only with URI (http parameters, environment variables, server
  +      parameters, time, etc...).</li>
  +     <li>sitemaps should embed the notion of "semantic resources" to be
  +      future-compatible with semantic crawling and indexing.</li>
  +     <li>sitemaps should be flexible enough to allow a complete web site to
  +      be built with @docname@.</li>
  +    </ol>
  +   </s2>
   
      <s2 title="The Structure">
       <p>
  @@ -87,24 +89,25 @@
       </p>
     
       <source>
  -     <![CDATA[
  -      <map:sitemap xmlns:map="http://xml.apache.org/cocoon/sitemap/1.0">
  -       <map:components/>
  -       <map:resources/>
  -       <map:match/>
  -       <map:match/>
  -        ...
  -       <map:match/>
  -      </map:sitemap>
  -     ]]>
  +<![CDATA[
  +  <?xml version="1.0"?>
  +
  +  <map:sitemap xmlns:map="http://xml.apache.org/cocoon/sitemap/1.0">
  +    <map:components/>
  +    <map:views/>
  +    <map:resources/>
  +    <map:action-sets/>
  +    <map:pipelines/>
  +  </map:sitemap>
  +]]>
       </source>
      </s2>
   
      <s2 title="The &lt;map:sitemap&gt;">
       <source>
  -     <![CDATA[
  -      <map:sitemap xmlns:map="http://xml.apache.org/cocoon/sitemap/1.0">
  -     ]]>
  +<![CDATA[
  +  <map:sitemap xmlns:map="http://xml.apache.org/cocoon/sitemap/1.0">
  +]]>
       </source>
   
       <p>
  @@ -124,17 +127,17 @@
   
      <s2 title="The &lt;map:components&gt;">
       <source>
  -     <![CDATA[
  -      <map:components">
  -       <map:generators/>
  -       <map:transformers/>
  -       <map:serializers/>
  -       <map:selectors/>
  -       <map:matchers/>
  -       <map:readers/>
  -       <map:actions/>
  -      </map:components">
  -     ]]>
  +<![CDATA[
  +<map:components>
  +  <map:generators/>
  +  <map:transformers/>
  +  <map:serializers/>
  +  <map:readers/>
  +  <map:selectors/>
  +  <map:matchers/>
  +  <map:actions/>
  +</map:components>
  +]]>
       </source>
   
       <s3 title="Common Attributes of Components">
  @@ -143,42 +146,30 @@
        </p>
   
        <dl>
  -      <dt>type</dt>
  -      <dd>The type attribute gives the component a reference which can be used to point to them in the pipeline section.</dd>
  +      <dt>name</dt>
  +      <dd>The name attribute gives the component a reference which can be used to point to them in the pipeline section.</dd>
         <dt>src</dt>
  -      <dd>Specifies where @docname@ finds the class representing this component. Note that the content of 
  -       the src attribute must be specified as an URI. 
  -      </dd>
  +      <dd>Specifies class representing this component.</dd>
        </dl>
  -
  -     <p>
  -      The following protocols can be specified for all URI aware attributes:
  -     </p>
  -     <ul>
  -      <li>file:</li>
  -      <li>class:</li>
  -      <li>jar:</li>
  -      <li>http:</li>
  -     </ul>
       </s3>
   
       <s3 title="Component Parameters">
        <p>
         All components will be configured with parameters specified from their child elements at component instantiation time. 
         The name of the parameters is dependant of the component. The following example shows how to specify a
  -      <code>&lt;compile-stylesheet&gt;</code> parameters to a component:
  +      <code>&lt;use-store&gt;</code> parameter to a component:
        </p>
     
        <source>
  -      <![CDATA[
  -       <map:components>
  -        <map:transformer type="xslt"
  -           src="class:///org.apache.cocoon.transformation.XSLTTransformer">
  -         <!-- This is a parameter to the transformer component -->
  -         <compile-stylesheets value="true"/>  
  -        </map:transformer>
  -       </map:components>
  -      ]]>
  +<![CDATA[
  +<map:components>
  +  <map:transformer name="xslt"
  +     src="org.apache.cocoon.transformation.XSLTTransformer">
  +    <!-- This is a parameter to the transformer component -->
  +    <use-store>true</use-store>
  +  </map:transformer>
  +</map:components>
  +]]>
        </source>
    
        <p>
  @@ -193,22 +184,21 @@
        </p>
   
        <source>
  -      <![CDATA[
  -       <map:generators default="parser">
  -        <map:generator type="parser" src="class:///org.apache.cocoon.generator.FileGenerator"/>
  -        <map:generator type="dir"    src="file:///home/mystuff/java/MyDirGenerator.class"/>
  -        <map:generator type="xsp"    src="class:///org.apache.cocoon.generators.XSPGenerator">
  -         ...
  -        </map:generator>
  -       </map:generators>
  -      ]]>
  +<![CDATA[
  +<map:generators default="parser">
  +  <map:generator name="parser" src="org.apache.cocoon.generator.FileGenerator"/>
  +  <map:generator name="dir"    src="MyDirGenerator"/>
  +  <map:generator name="xsp"    src="org.apache.cocoon.generators.XSPGenerator">
  +   ...
  +  </map:generator>
  +</map:generators>
  +]]>
        </source>
   
        <p>
         The <code>default</code> attribute on <code>&lt;map:generators&gt;</code> specifies the type 
         of generator to use if none is specified in a pipeline.
        </p>
  -   
       </s3>
   
       <s3 title="Transformers">
  @@ -217,19 +207,18 @@
        </p>
   
        <source>
  -      <![CDATA[
  -       <map:transformers default="xslt">
  -        <map:transformer type="xslt" 
  -                         src="class:///org.apache.cocoon.transformation.XSLTTransformer">
  -         <compile-stylesheets value="true"/>
  -        </map:transformer>
  -        <map:transformer type="xinclude" 
  -                         src="class:///org.apache.cocoon.transformation.XIncludeTransformer"/>
  -       </map:transformers>
  -      ]]>
  +<![CDATA[
  +<map:transformers default="xslt">
  +  <map:transformer name="xslt" 
  +                   src="org.apache.cocoon.transformation.XSLTTransformer">
  +    <use-store>true</use-store>
  +  </map:transformer>
  +  <map:transformer name="xinclude" 
  +                   src="org.apache.cocoon.transformation.XIncludeTransformer"/>
  +</map:transformers>
  +]]>
        </source>
   
  -
        <p>
         The <code>default</code> attribute on <code>&lt;map:transformers&gt;</code> specifies the type 
         of transformer to use if none is specified in a pipeline.
  @@ -243,34 +232,34 @@
        </p>
   
        <source>
  -      <![CDATA[
  -       <map:serializers default="html">
  -        <map:serializer type="html" mime-type="text/html" 
  -          src="class:///org.apache.cocoon.serializer.HTMLSerializer">
  -         <doctype-public>-//W3C//DTD HTML 4.0 Transitional//EN</doctype-public>
  -         <doctype-system>http://www.w3.org/TR/REC-html40/loose.dtd</doctype-system>
  -         <preserve-space>true</preserve-space>
  -         <encoding>UTF-8</encoding>
  -         <indent>1</indent>
  -         <line-width>120</line-width>
  -        </map:serializer>
  -
  -        <map:serializer type="wap" mime-type="text/vnd.wap.wml" 
  -          src="class:///org.apache.cocoon.serializer.XMLSerializer">
  -         <doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
  -         <doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
  -         <encoding>UTF-8</encoding>
  -        </map:serializer>
  -
  -        <map:serializer type="svg2jpeg" mime-type="image/jpeg" 
  -          src="class:///org.apache.cocoon.serializer.SVGSerializer">
  -        </map:serializer>
  -
  -        <map:serializer type="svg2png" mime-type="image/png" 
  -          src="class:///org.apache.cocoon.serializer.SVGSerializer">
  -        </map:serializer>
  -       </map:serializers>
  -      ]]>
  +<![CDATA[
  +<map:serializers default="html">
  +  <map:serializer name="html" mime-type="text/html" 
  +                  src="org.apache.cocoon.serializer.HTMLSerializer">
  +    <doctype-public>-//W3C//DTD HTML 4.0 Transitional//EN</doctype-public>
  +    <doctype-system>http://www.w3.org/TR/REC-html40/loose.dtd</doctype-system>
  +    <omit-xml-declaration>true</omit-xml-declaration>
  +    <encoding>UTF-8</encoding>
  +    <indent>1</indent>
  +  </map:serializer>
  +
  +  <map:serializer name="wap" mime-type="text/vnd.wap.wml" 
  +     src="org.apache.cocoon.serializer.XMLSerializer">
  +    <doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
  +    <doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
  +    <encoding>UTF-8</encoding>
  +  </map:serializer>
  +
  +  <map:serializer name="svg2jpeg" mime-type="image/jpeg" 
  +                  src="org.apache.cocoon.serializer.SVGSerializer">
  +    <parameter name="background_color" type="color" value="#00FF00"/>
  +  </map:serializer>
  +
  +  <map:serializer name="svg2png" mime-type="image/png" 
  +                  src="org.apache.cocoon.serializer.SVGSerializer">
  +  </map:serializer>
  +</map:serializers>
  +]]>
        </source>
   
        <p>
  @@ -284,24 +273,24 @@
         A <link href="#interface-selector"><code>Selector</code></link> evaluate a boolean expression.
        </p>
        <source>
  -      <![CDATA[
  -       <map:selectors default="browser">
  -        <map:selector type="load"
  -                      src="class:///org.apache.cocoon.selection.MachineLoadSelector">
  -         ...
  -        </map:selector>
  -
  -        <map:selector type="user"
  -                      src="class:///org.apache.cocoon.selection.AuthenticationSelector">
  -         ...
  -        </map:selector>
  -
  -        <map:selector type="browser" 
  -                      factory="class:///org.apache.cocoon.selection.BrowserSelectorFactory">
  -         ...
  -        </map:selection>
  -       </map:selection>
  -      ]]>
  +<![CDATA[
  +<map:selectors default="browser">
  +  <map:selector name="load"
  +                src="org.apache.cocoon.selection.MachineLoadSelector">
  +   ...
  +  </map:selector>
  +
  +  <map:selector name="user"
  +                src="org.apache.cocoon.selection.AuthenticationSelector">
  +   ...
  +  </map:selector>
  +
  +  <map:selector name="browser" 
  +                src="org.apache.cocoon.selection.BrowserSelectorFactory">
  +   ...
  +  </map:selection>
  +</map:selection>
  +]]>
        </source>
   
        <p>
  @@ -311,9 +300,10 @@
   
        <p> 
         Because the sitemap will be translated and compiled into a java class at runtime a 
  -      <link href="#interface-selector"><code>Selector</code></link> can specify a attribute <code>factory</code>
  -      instead of a <code>src</code>. This <link href="#interface-code-factory"><code>CodeFactory</code></link>
  -      class must be capable to return a java source code fragment that can be embedded into a method corresponding 
  +      <link href="#interface-selector"><code>Selector</code></link> can specify a class 
  +      implementing <link href="#interface-code-factory"><code>CodeFactory</code></link>
  +      instead of <link href="#interface-selector"><code>Selector</code></link> interface.
  +      This class must be capable to return a java source code fragment that can be embedded into a method corresponding 
         to the <link href="#interface-selector"><code>Selector</code></link>s evaluate method.
        </p>
       </s3>
  @@ -323,19 +313,19 @@
         A <link href="#interface-matcher"><code>Matcher</code></link> maps a pattern to a resource.
        </p>
        <source>
  -      <![CDATA[
  -       <map:matchers default="uri-wildcard">
  -        <map:matcher type="uri-wildcard" 
  -                     factory="class:///org.apache.cocoon.matcher.WildcardURIMatcherFactory">
  -         ...
  -        </map:matcher>
  -
  -        <map:matcher type="uri-regexp" 
  -                     src="class:///org.apache.cocoon.matcher.RegexpURIMatcher">
  -         ...
  -        </map:matcher>
  -       </map:matchers>
  -      ]]>
  +<![CDATA[
  +<map:matchers default="uri-wildcard">
  +  <map:matcher name="uri-wildcard" 
  +               src="org.apache.cocoon.matcher.WildcardURIMatcherFactory">
  +   ...
  +  </map:matcher>
  +
  +  <map:matcher name="uri-regexp" 
  +               src="org.apache.cocoon.matcher.RegexpURIMatcher">
  +   ...
  +  </map:matcher>
  +</map:matchers>
  +]]>
        </source>
   
        <p>
  @@ -345,17 +335,65 @@
   
        <p> 
         Because the sitemap will be translated and compiled into a java class at runtime a 
  -      <link href="#interface-matcher"><code>Matcher</code></link> can specify a attribute <code>factory</code>
  -      instead of a <code>src</code>. This <link href="#interface-matcher-factory"><code>MatcherFactory</code></link>
  -      class must be capable to return a java source code fragment that can be embedded into a method corresponding 
  +      <link href="#interface-matcher"><code>Matcher</code></link> can specify a class
  +      implementing <link href="#interface-code-factory"><code>CodeFactory</code></link>
  +      instead of <link href="#interface-matcher"><code>Matcher</code></link> interface.
  +      This class must be capable to return a java source code fragment that can be embedded into a method corresponding 
         to the <link href="#interface-matcher"><code>Matcher</code></link>s match method.
        </p>
       </s3>
  +
  +    <s3 title="Actions">
  +     <p>
  +      An <link href="#interface-action"><code>Action</code></link> is a sitemap component
  +      that manipulates runtime parameters based on request and application state.
  +      Action's result is available in the sitemap as map of name/value pairs.
  +      Detailed information on actions is <link href="actions.html">here</link>.
  +     </p>
  +     <source>
  +<![CDATA[
  +<map:actions>
  +  <map:action name="add-employee"
  +              src="org.apache.cocoon.acting.DatabaseAddAction"/>
  +  <map:action name="locale"
  +              src="org.apache.cocoon.acting.LocaleAction"/>
  +  <map:action name="request"
  +              src="org.apache.cocoon.acting.RequestParamAction"/>
  +  <map:action name="form-validator"
  +              src="org.apache.cocoon.acting.FormValidatorAction"/>
  +</map:actions>
  +]]>
  +     </source>
  +
  +    </s3>
      </s2>
   
  +   <s2 title="The &lt;map:views&gt;">
  +    <p>
  +     The <code>&lt;map:view&gt;</code> element defines different view
  +     of the site. Views are defined independent of pipelines and might
  +     be used with any pipeline defined in the sitemap. More on views 
  +     read "<link href="views.html">Views</link>".
  +    </p>
  +   
  +    <source>
  +<![CDATA[
  +<map:views>
  +  <map:view name="content" from-label="content">
  +    <map:serialize type="xml"/>
  +  </map:view>
  +
  +  <map:view name="links" from-position="last">
  +    <map:serialize type="links"/>
  +  </map:view>
  +</map:views>
  +]]>
  +    </source>
  +   </s2>
  +
      <s2 title="The &lt;map:resources&gt;">
       <p>
  -     The <code>&lt;resource&gt;</code> element is used as a placeholder for pipelines
  +     The <code>&lt;map:resource&gt;</code> element is used as a placeholder for pipelines
        that are used several times inside the document. This element
        is redundant and its functionality is not directly related
        to the sitemap, but could be cloned by the use of internal
  @@ -371,16 +409,36 @@
        it is much easier to include such an element instead of forcing
        the use of xinclude/xpointer.
       </p>
  +    <source>
  +<![CDATA[
  +<map:resources>
  +  <map:resource name="Access refused">
  +    <map:generate src="./error-pages/restricted.xml"/>
  +    <map:transform src="./stylesheets/general-browser.xsl"/>
  +    <map:serialize status-code="401"/>
  +  </map:resource>
  +</map:resources>
  +]]>
  +    </source>
  +   </s2>
  +
  +   <s2 title="The &lt;map:action-set&gt;">
  +    <p>
  +     The <code>&lt;map:action-set&gt;</code> element is used to arrange actions in
  +     a groups (See "<link href="actions.html">Actions</link>" for details).
  +    </p>
  +
       <source>
  -     <![CDATA[
  -      <map:resources>
  -       <map:resource name="Access refused">
  -        <map:generate src="./error-pages/restricted.xml"/>
  -        <map:transform src="./stylesheets/general-browser.xsl"/>
  -        <map:serialize status-code="401"/>
  -       </map:resource>
  -      </map:resources>
  -     ]]>
  +<![CDATA[
  +<map:action-sets>
  +  <map:action-set name="employee">
  +   <map:act type="add-employee" action="Add"/>
  +   <map:act type="del-employee" action="Delete"/>
  +   <map:act type="upd-employee" action="Update"/>
  +   <map:act type="sel-employee" action="Select"/>
  +  </map:action-set>
  +</map:action-sets>
  +]]>
       </source>
   
      </s2>
  @@ -401,9 +459,9 @@
       </p>
        <source>
   <![CDATA[
  -   <map:match pattern="faq/*"> 
  -    <map:mount uri-prefix="faq/" check-reload="no" src="faq/sitemap.xmap"/> 
  -   </map:match> 
  +<map:match pattern="faq/*"> 
  +  <map:mount uri-prefix="faq" check-reload="no" src="faq/sitemap.xmap"/> 
  +</map:match> 
   ]]>
       </source>
       <p>
  @@ -427,7 +485,7 @@
        </p>
       </s3>
       <s3 title="Use Cases">
  -    <p>
  +     <p>
        Usually you use the same SitemapComponents over and over again in your sub-sitemaps. 
        And because you have a contract between the parent and sub sitemaps (the uri-prefix) you 
        can deliver common SitemapComponents from the parent sitemap to your sub-sitemaps as well.
  @@ -455,56 +513,56 @@
        matches on host name of the request, but any matcher or selector would work
        at this point. Both sub-sitemaps are mounted at the root level.
        </p>
  -<source>
  +     <source>
   <![CDATA[
  -     <?xml version="1.0"?> 
  -      <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  -      <!-- =========================== Components
  -       ================================ -->
  -    <map:components>
  -     <map:matchers default="wildcard">
  +<?xml version="1.0"?> 
  +
  +<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  +  <!-- ========================== Components =============================== -->
  +  <map:components>
  +    <map:matchers default="wildcard">
         <map:matcher name="wildcard"
  -                   factory="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  -     </map:matchers>
  - 
  +                   src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
  +    </map:matchers>
  +
       <map:selectors default="host">
  -     <map:selector name="host" factory="org.apache.cocoon.selection.HostSelectorFactory">
  +      <map:selector name="host"
  +                    src="org.apache.cocoon.selection.HostSelectorFactory">
           <host name="fee" value="www.foo.com"/>
  -     </map:selector>
  -   </map:selectors>
  - 
  -   </map:components>
  -   <!-- =========================== Pipelines
  -    ================================= -->
  -    <map:pipelines>
  -     <map:pipeline>
  - 
  +      </map:selector>
  +    </map:selectors>
  +
  +  </map:components>
  +  <!-- ========================== Pipelines ================================ -->
  +  <map:pipelines>
  +    <map:pipeline>
  +
         <map:select type="host">
  -         <map:when test="fee">
  -            <map:mount uri-prefix="" src="fee.xmap"/>
  +        <map:when test="fee">
  +          <map:mount uri-prefix="" src="fee.xmap"/>
           </map:when>
           <map:otherwise>
  -            <map:mount uri-prefix="" src="foo.xmap"/>
  +          <map:mount uri-prefix="" src="foo.xmap"/>
           </map:otherwise>
  -     </map:select>
  - 
  -     </map:pipeline>
  -   </map:pipelines>
  - </map:sitemap>
  +      </map:select>
  +
  +    </map:pipeline>
  +  </map:pipelines>
  +</map:sitemap>
   ]]>
  -    </source>
  -     </s3>
  -     <s3 title="Reloading">
  +     </source>
  +    </s3>
  +    <s3 title="Reloading">
        <p>The reloading of the subsitemaps can be configured by two attributes.    </p>
        <source>
   <![CDATA[
  -   <map:match pattern="faq/*"> 
  +  <map:match pattern="faq/*"> 
       <map:mount uri-prefix="faq/" check-reload="no" 
                  src="faq/sitemap.xmap" reload-method="asynchron"/> 
  -   </map:match> 
  +  </map:match> 
   ]]>
  -    </source>
  -    <p>
  +</source>
  +     <p>
        The "check-reload" attribute specifies if the sitemap is reloaded, this means regenerated, if
        it changes. If it set to "no", the sitemap is only generated on the first request for this
        sitemap.
  @@ -530,13 +588,14 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface XMLProducer {
  -          /** Set the <code>XMLConsumer</code> that will receive XML data. */
  -          public void setConsumer(XMLConsumer consumer);
  +<![CDATA[
  +public interface XMLProducer {
  +
  +    /** Set the <code>XMLConsumer</code> that will receive XML data. */
  +    public void setConsumer(XMLConsumer consumer);
   
  -      }
  -     ]]>
  +}
  +]]>
       </source>
      </s2>
   
  @@ -550,10 +609,11 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface XMLConsumer extends ContentHandler, LexicalHandler {
  -      }
  -     ]]>
  +<![CDATA[
  +public interface XMLConsumer extends ContentHandler, LexicalHandler {
  +
  +}
  +]]>
       </source>
      </s2>
   
  @@ -568,10 +628,11 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface XMLPipe extends XMLConsumer , XMLProducer {
  -      }
  -     ]]>
  +<![CDATA[
  +public interface XMLPipe extends XMLConsumer , XMLProducer {
  +
  +}
  +]]>
       </source>
      </s2>
   
  @@ -582,17 +643,18 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface SitemapModelComponent extends Component {
  -      
  -          /**
  -           * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
  -           * the source and sitemap <code>Parameters</code> used to process the request.
  -           */
  -          void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) 
  -          throws ProcessingException, SAXException, IOException;
  -      }
  -     ]]>
  +<![CDATA[
  +public interface SitemapModelComponent extends Component {
  +
  +    /**
  +     * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
  +     * the source and sitemap <code>Parameters</code> used to process the request.
  +     */
  +    void setup(SourceResolver resolver, Map objectModel, String src,
  +               Parameters par)
  +    throws ProcessingException, SAXException, IOException;
  +}
  +]]>
       </source>
      </s2>
   
  @@ -603,26 +665,26 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface SitemapOutputComponent extends Component {
  -      
  -          /**
  -           * Set the <code>OutputStream</code> where the requested resource should
  -           * be serialized.
  -           */
  -          void setOutputStream(OutputStream out) throws IOException;
  -
  -          /**
  -           * Get the mime-type of the output of this <code>Component</code>.
  -           */
  -          String getMimeType();
  -
  -          /**
  -           * Test if the component wants to set the content length
  -           */
  -          boolean shouldSetContentLength();
  -      }
  -     ]]>
  +<![CDATA[
  +public interface SitemapOutputComponent extends Component {
  +
  +    /**
  +     * Set the <code>OutputStream</code> where the requested resource should
  +     * be serialized.
  +     */
  +    void setOutputStream(OutputStream out) throws IOException;
  +
  +    /**
  +     * Get the mime-type of the output of this <code>Component</code>.
  +     */
  +    String getMimeType();
  +
  +    /**
  +     * Test if the component wants to set the content length
  +     */
  +    boolean shouldSetContentLength();
  +}
  +]]>
       </source>
      </s2>
      <anchor id="interface-generator"/>
  @@ -632,12 +694,16 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface Generator extends XMLProducer, SitemapModelComponent {
  -          public void generate()
  -                  throws IOException, SAXException, ProcessingException;
  -      }
  -     ]]>
  +<![CDATA[
  +public interface Generator extends XMLProducer, SitemapModelComponent {
  +
  +    String ROLE = "org.apache.cocoon.generation.Generator";
  +
  +    public void generate()
  +    throws IOException, SAXException, ProcessingException;
  +
  +}
  +]]>
       </source>
      </s2>
   
  @@ -648,11 +714,14 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface Transformer 
  -      extends   XMLPipe, SitemapModelComponent {
  -      }
  -     ]]>
  +<![CDATA[
  +public interface Transformer 
  +extends   XMLPipe, SitemapModelComponent {
  +
  +    String ROLE = "org.apache.cocoon.transformation.Transformer";
  +
  +}
  +]]>
       </source>
      </s2>
   
  @@ -664,11 +733,13 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface Serializer extends XMLConsumer, SitemapOutputComponent {
  +<![CDATA[
  +public interface Serializer extends XMLConsumer, SitemapOutputComponent {
   
  -      }
  -     ]]>
  +    String ROLE = "org.apache.cocoon.serialization.Serializer";
  +
  +}
  +]]>
       </source>
      </s2>
   
  @@ -680,24 +751,61 @@
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface Selector extends Component {
  -         /**
  -          * Selectors test pattern against some objects in a <code>Map</code>
  -          * model and signals success with the returned boolean value
  -          * @param expression  The expression to test.
  -          * @param objectModel The <code>Map</code> containing object of the
  -          *                    calling environment which may be used
  -          *                    to select values to test the expression.
  -          * @param parameters  The sitemap parameters, as specified by &lt;parameter/&gt; tags.
  -          * @return boolean    Signals successful test.
  -          */
  -         boolean select (String expression, Map objectModel, Parameters parameters);      
  -      }
  -     ]]>
  +<![CDATA[
  +public interface Selector extends Component {
  +
  +    String ROLE = "org.apache.cocoon.selection.Selector";
  +
  +    /**
  +     * Selectors test pattern against some objects in a <code>Map</code>
  +     * model and signals success with the returned boolean value
  +     * @param expression  The expression to test.
  +     * @param objectModel The <code>Map</code> containing object of the
  +     *                    calling environment which may be used
  +     *                    to select values to test the expression.
  +     * @param parameters  The sitemap parameters, as specified by
  +     *                    &lt;parameter/&gt; tags.
  +     * @return boolean    Signals successfull test.
  +     */
  +    boolean select (String expression, Map objectModel, Parameters parameters);      
  +}
  +]]>
       </source>
      </s2>
   
  +   <anchor id="interface-matcher"/>
  +   <s2 title="Matcher">
  +    <p>
  +     A <code>Matcher</code> matches a pattern against any value:
  +    </p>
  +
  +    <source>
  +<![CDATA[
  +public interface Matcher extends Component {
  +
  +    String ROLE = "org.apache.cocoon.matching.Matcher";
  +
  +    /**
  +     * Matches the pattern against some <code>Request</code> values
  +     * and returns a <code>Map</code> object with replacements
  +     * for wildcards contained in the pattern.
  +     * @param pattern     The pattern to match against. Depending on the
  +     *                    implementation the pattern can contain wildcards
  +     *                    or regular expressions.
  +     * @param objectModel The <code>Map</code> with object of the
  +     *                    calling environment which can be used
  +     *                    to select values this matchers matches against.
  +     * @return Map        The returned <code>Map</code> object with
  +     *                    replacements for wildcards/regular-expressions
  +     *                    contained in the pattern.
  +     *                    If the return value is null there was no match.
  +     */
  +    Map match (String pattern, Map objectModel, Parameters parameters);      
  +}
  +]]>
  +    </source>
  +   </s2>
  +
      <anchor id="interface-code-factory"/>
      <s2 title="CodeFactory">
       <p>
  @@ -705,59 +813,74 @@
         representing logic for class methods. The
         returned source code will be directly integrated into a method of the
         generated sitemap code.
  -      This <code>CodeFactory</code>s generate method will be called during
  +      This <code>CodeFactory</code>'s generate method will be called during
         sitemap code generation.
         A <code>CodeFactory</code> is capable to return the java source code of the evaluate method of a
  -     <link href="#interface-selector"><code>Selector</code></link> or <link href="#interface-matcher"><code>Matcher</code></link>object. 
  -     It gets the value of the test attribute from the sitemap.
  +     <link href="#interface-selector"><code>Selector</code></link> or <link href="#interface-matcher"><code>Matcher</code></link>
  +     object. It gets the value of the test attribute from the sitemap.
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface CodeFactory {
  -          String generateParameterSource (NodeList conf)
  -          throws ConfigurationException;
  -
  -          String generateClassSource (String prefix, String test, NodeList conf)
  -          throws ConfigurationException;
  -
  -          String generateMethodSource (NodeList conf)
  -          throws ConfigurationException;      
  -      }
  -     ]]>
  +<![CDATA[
  +public interface CodeFactory {
  +    String generateParameterSource (NodeList conf)
  +    throws ConfigurationException;
  +
  +    String generateClassSource (String prefix, String test, NodeList conf)
  +    throws ConfigurationException;
  +
  +    String generateMethodSource (NodeList conf)
  +    throws ConfigurationException;      
  +}
  +]]>
       </source>
      </s2>
   
  -   <anchor id="interface-matcher"/>
  -   <s2 title="Matcher">
  +   <anchor id="interface-action"/>
  +   <s2 title="Action">
       <p>
  -     A <code>Matcher</code> matches a pattern against any value:
  +     An <code>Action</code> processes input <code>objectModel</code> and returns results
  +     in a <code>Map</code>:
       </p>
   
       <source>
  -     <![CDATA[
  -      public interface Matcher extends Component {
  -          /**
  -           * Matches the pattern against some <code>Request</code> values
  -           * and returns a <code>Map</code> object with replacements
  -           * for wildcards contained in the pattern.
  -           * @param pattern     The pattern to match against. Depending on the
  -           *                    implementation the pattern can contain wildcards
  -           *                    or regular expressions.
  -           * @param objectModel The <code>Map</code> with object of the
  -           *                    calling environment which can be used
  -           *                    to select values this matchers matches against.
  -           * @return Map        The returned <code>Map</code> object with
  -           *                    replacements for wildcards/regular-expressions
  -           *                    contained in the pattern.
  -           *                    If the return value is null there was no match.
  -           */
  -          Map match (String pattern, Map objectModel, Parameters parameters);      
  -      }
  -     ]]>
  +<![CDATA[
  +public interface Action extends Component, ThreadSafe {
  +
  +    String ROLE = "org.apache.cocoon.acting.Action";
  +
  +    /**
  +     * Controls the processing against some values of the
  +     * <code>Dictionary</code> objectModel and returns a
  +     * <code>Map</code> object with values used in subsequent
  +     * sitemap substitution patterns.
  +     *
  +     * NOTE: It is important that <code>Action<code> classes are
  +     * written in a thread safe manner.
  +     *
  +     * @param resolver    The <code>SourceResolver</code> in charge
  +     * @param objectModel The <code>Map</code> with object of the
  +     *                    calling environment which can be used
  +     *                    to select values this controller may need
  +     *                    (ie Request, Response).
  +     * @param source      A source <code>String</code> to the Action
  +     * @param parameters  The <code>Parameters</code> for this invocation
  +     * @return Map        The returned <code>Map</code> object with
  +     *                    sitemap substitution values which can be used
  +     *                    in subsequent elements attributes like src=
  +     *                    using a xpath like expression: src="mydir/{myval}/foo"
  +     *                    If the return value is null the processing inside
  +     *                    the <map:act> element of the sitemap will
  +     *                    be skipped.
  +     * @exception Exception Indicates something is totally wrong
  +     */
  +    Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
  +            String source, Parameters par)
  +    throws Exception;
  +}
  +]]>
       </source>
      </s2>
  -
     </s1>
    
    </body>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org