forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r407156 - /forrest/trunk/site-author/content/xdocs/docs_0_80/faq.xml
Date Wed, 17 May 2006 05:02:22 GMT
Author: crossley
Date: Tue May 16 22:02:22 2006
New Revision: 407156

Enhance the explanation of integrating DocBook sources to also explain
how to use Content Aware Pipelines (SourceTypeAction).
Thanks to: Brian Dube


Modified: forrest/trunk/site-author/content/xdocs/docs_0_80/faq.xml
--- forrest/trunk/site-author/content/xdocs/docs_0_80/faq.xml (original)
+++ forrest/trunk/site-author/content/xdocs/docs_0_80/faq.xml Tue May 16 22:02:22 2006
@@ -926,8 +926,58 @@
         in the components section of the sitemap. See the 
         <link href="">Cocoon
         docs</link> for the elements you need to add to define this component. You
can see examples 
-        of other components being added in the <code>FORREST_HOME/main/webapp/sitemap.xmap</code>
-        <p> You can also use a mixture of the two methods, some handled automatically
by Forrest and
+        of other components being added in the <code>FORREST_HOME/main/webapp/sitemap.xmap</code>
+        Alternatively use the "html" DocBook stylesheets and the default Cocoon serializer,
+        i.e. &lt;map:serialize type="html"/&gt;
+        </p>
+        <p>
+          The output of the above sitemap will be plain html not adorned with
+          a Forrest theme and navigation. If instead you need the latter, then
+          use the following technique instead. This transforms DocBook xml to
+          html, then uses a Forrest core stylesheet to transform and serialize
+          to the internal xml format, then the normal machinery takes over and
+          does the output transformation. This use the Content Aware Pipelines
+          (<link href="site:v0.80//cap">SourceTypeAction</link>)
+          to peek at the source xml. If it is DocBook-4.2
+          then this sitemap match is triggered, if not then it falls through to the core
of Forrest.
+        </p>
+        <source><![CDATA[<?xml version="1.0"?>
+<map:sitemap xmlns:map="">
+ <map:components>
+  <map:actions>
+   <map:action logger="sitemap.action.sourcetype"
+      name="sourcetype"src="org.apache.forrest.sourcetype.SourceTypeAction">
+    <sourcetype name="docbook-v4.2">
+     <document-declaration public-id="-//OASIS//DTD DocBook XML V4.2//EN"/>
+    </sourcetype>
+   </map:action>
+  </map:actions>
+  <map:selectors default="parameter">
+   <map:selector logger="sitemap.selector.parameter"
+      name="parameter" src="org.apache.cocoon.selection.ParameterSelector"/>
+  </map:selectors>
+ </map:components>
+ <map:pipelines>
+  <map:pipeline>
+   <map:match pattern="**.xml">
+    <map:act type="sourcetype" src="{project:content.xdocs}{1}.xml">
+     <map:select type="parameter">
+      <map:parameter name="parameter-selector-test" value="{sourcetype}"/>
+      <map:when test="docbook-v4.2">
+       <map:generate src="{project:content.xdocs}{../1}.xml"/>
+       <map:transform
+          src="file:///usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl"/>
+       <map:transform src="{forrest:stylesheets}/html-to-document.xsl"/>
+       <map:transform type="idgen"/>
+       <map:serialize type="xml-document"/>
+      </map:when>
+     </map:select>
+    </map:act>
+   </map:match>
+  </map:pipeline>
+ </map:pipelines>
+        <p> You can also use a mixture of the methods, some handled automatically by
Forrest and
           some directly using DocBook stylesheets. You can also have a mixture of source
files as
           "document-v*" DTD and DocBook. </p>
         <p> Ensure that the document type declaration in your XML instance is well
specified. Use a

View raw message