You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ha...@apache.org on 2001/07/18 17:06:01 UTC

cvs commit: xml-cocoon2/xdocs views.xml docs-book.xml site-book.xml

haul        01/07/18 08:06:01

  Modified:    xdocs    docs-book.xml site-book.xml
  Added:       xdocs    views.xml
  Log:
  added docs for sitemap views
  
  Revision  Changes    Path
  1.17      +1 -0      xml-cocoon2/xdocs/docs-book.xml
  
  Index: docs-book.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/docs-book.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- docs-book.xml	2001/07/18 07:43:02	1.16
  +++ docs-book.xml	2001/07/18 15:06:01	1.17
  @@ -11,6 +11,7 @@
     <page id="overview" label="Overview" source="overview.xml"/>
     <page id="uc2" label="Concepts" source="uc2.xml"/>
     <page id="sitemap" label="Sitemap" source="sitemap.xml"/>
  +  <page id="views" label="Views" source="views.xml"/>
     <page id="actions" label="Actions" source="actions.xml"/>
     <page id="matchers-selectors" label="Matchers and Selectors" source="matchers_selectors.xml"/>
   
  
  
  
  1.20      +1 -0      xml-cocoon2/xdocs/site-book.xml
  
  Index: site-book.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/site-book.xml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- site-book.xml	2001/07/18 07:43:02	1.19
  +++ site-book.xml	2001/07/18 15:06:01	1.20
  @@ -15,6 +15,7 @@
     <page id="overview" label="Overview" source="overview.xml"/>
     <page id="uc2" label="Concepts" source="uc2.xml"/>
     <page id="sitemap" label="Sitemap" source="sitemap.xml"/>
  +  <page id="views" label="Views" source="views.xml"/>
     <page id="actions" label="Actions" source="actions.xml"/>
     <page id="matchers-selectors" label="Matchers and Selectors" source="matchers_selectors.xml"/>
     <!-- The Generators -->
  
  
  
  1.1                  xml-cocoon2/xdocs/views.xml
  
  Index: views.xml
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE document SYSTEM "dtd/document-v10.dtd">
  <document> 
    <header> 
  	 <title>Views</title>
  	 <version>0.1</version> 
  	 <type>Overview document</type> 
  	 <authors>
             <person name="Christian Haul" email="haul@apache.org"/> 
  	 </authors> 
    </header> 
    <body>
    <s1 title="Itroduction">
    <p> Views are yet another sitemap component. Unlike the rest, they
    are othogonal to the resource and pipeline definitions. In the
    following I will not distinguish between resources and pipelines
    because their differences are not relevant here. So, when I talk
    about pipelines the said is valid for resources as well.
    </p>
  
    <p>Basically, views let you specify exit points of your pipelines
    that are taken whenever a particular view is requested. The
    processing continues with the definitions in the requested view. The
    advantage over selectors that could achieve the same is, that these
    exit points are not necessarily declared for each pipeline
    individually, but once per sitemap.</p>
  
    <p>Views are very useful while debugging your web application but
    they can as well be used to render different views to the same
    document.</p>
  
    <p><em>Since views are orthogonal to pipelines, keep in mind to
    remove any unwanted view from a deployed application.</em></p>
  
    <s2 title="Define a view">
    <s3 title="View Processing"> 
    <p>The samples sitemap contains two view definitions. One of them
    looks like the excerpt below.</p>
  
  <source>
  <![CDATA[
    <map:views>
       <map:view name="content" from-label="content">
       <map:serialize type="xml"/>
    </map:view>
  ]]>
  </source>
  
    <p>It only defines what processing steps should be taken, after some
    exit point labelled "content" is reached. In all this case just a 
    serializer is used to further process the document.</p>
    </s3>
  
    <s3 title="Exit Points">
    <p>A look at the pipelines reveals no label "content". But a closer
    look at the defined components show this:</p>
  <source>
  <![CDATA[
   <map:components>
  
    <map:generators default="file">
     <map:generator  name="file"        src="org.apache.cocoon.generation.FileGenerator" label="content"/>
     <map:generator  name="directory"   src="org.apache.cocoon.generation.DirectoryGenerator" label="content"/>
     <map:generator  name="serverpages" src="org.apache.cocoon.generation.ServerPagesGenerator" label="content"/
     [...]
  ]]>
  </source>
    <p>Here a number of generators are declared, each one has a label
    attribute. Now, everytime one of these generators is used in a
    pipeline, an exit point "content" is generated, just after the
    generator has been executed.</p>
  
    <p>This is not limited to generators but every sitemap component can
    be augmented with a view label.</p>
    
    <p>Two special labels exist: "first" and "last". These are
    automatically declared for every pipeline, after the first component
    and after the last respectively. This is used by the second view in
    the samples sitemap.</p>
  
  <source>
  <![CDATA[
    <map:view name="links" from-position="last">
     <map:serialize type="links"/>
    </map:view>
  ]]>
  </source>
  
    <p>There is also another way to specify these exit points:
    <code>&lt;map:label name="mylabel"&gt;</code>. Such a tag can be
    embedded in a pipeline at any place.</p>
    </s3>
  
    <s3 title="How a view is requested">
    <p>Currently, the applicable view is chosen by the engine based on
    the value of a request parameter named "cocoon-view".</p>
  
    <p><em>Since views are orthogonal to pipelines, keep in mind to
    remove any unwanted view from a deployed application.</em></p>
  
    </s3>
    </s2>
  
    </s1>
  </body>
  </document>
  
  

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