forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <>
Subject Re: Producing one pdf-file out of selected sites
Date Wed, 29 Oct 2003 10:46:33 GMT
On Tue, Oct 28, 2003 at 09:07:43AM +0100, Stephan E. Schlierf wrote:
> Hi there,
> what I would like to do is the following:
> I defined some menue entries in site.xml:
> ---snip---
> <methods_gl label="Methods" href="methods/" tab="methods_gl">
>    <methods_gl_index label="What's up?" href="index.html"/>
>       <gl_design label="Design">
>          <d_precondition label="Preconditions" href="design_prec.html"/>
>          <d_model label="Models" href="design_models.html"/>
>             <d_action label="Activities" href="design_activities.html"/>
>       </gl_design>
>       <gl_impl label="Developers GL">
>          <i_precondition label="Preconditions" href="impl_prec.html"/>
>          <java_cc label="JAVA coding conventions" href="java_cc.html"/>
>          <dbs label="Databases" href="impl_database.html"/>
>          <cvs label="CVS" href="impl_cvs.html"/>
>          <i_tests label="Developer Tests" href="impl_tests.html"/>
>          <dokus label="Documentation" href="impl_dokus.html"/>
>          <code_insp label="Code inspections" href="code_insp.html"/>
>          <bugreport label="Bugreporting" href="impl_bugreport.html"/>
>         </gl_impl>
>        [...]
> </methods_gl>
> ---snip ---
> Now I would like to generate one pdf-site for the <gl_impl>...</gl_impl>
> element. As far as I understood Jeffs posting
> (
> I have to define an entry in xml-forrest/src/resources/conf/sitemap.xmap.
> My question is: how can I do this ? How should this entry look like for 
> my example ? Is there a way besides modifying sitemap.xmap to get at it 
> ? (I think it's a bit cumbersomely - no offence! ;-) )

This is the fun part where you learn Cocoon ;) Modifying sitemaps is
currently the only way.  Here are the steps:

 - Run 'forrest run', and go to edit stuff in build/webapp/
 - Copying aggregate.xmap to gl_impl.xmap (or whatever name you want)
 - Editing sitemap.xmap, and where it defines the site.xml pipeline,
   define a similar delegation to gl_impl.xmap:

   <map:match pattern="gl_impl.xml">
     <map:mount uri-prefix="" src="gl_impl.xmap" check-reload="yes" />
   <map:match pattern="site.xml">
     <map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />

 - Edit gl_impl.xmap, and start playing with the *.xml pipeline until it
   returns XML for just the section you need.  Eg., start with a simple

   <map:match pattern="*.xml">
     <map:generate src="cocoon://abs-linkmap"/>
     <map:serialize type="xml"/>

   And look at http://localhost:8888/gl_impl.xml in the browser.  Then
   add an XPathTransformer to cut the XML down to just what you need:

   <map:match pattern="*.xml">
     <map:generate src="cocoon://abs-linkmap"/>
     <map:transform type="xpath">
       <map:parameter name="include" value="/*[name()='site']/*[name()='methods_gl']" />
     <map:serialize type="xml"/>

   (the strange XPath is to avoid the use of namespaces, which
   XPathTransformer can't yet handle)

   If that XML looks like a correct subset of the menu, include all the
   other components between the xpath transformer and serializer, and
   then request http://localhost:8888/gl_impl.xml (gives you all the XML
   source) and http://localhost:8888/gl_impl.html (rendered HTML).

   - Once you're happy, copy these modified xmap files to


> TIA,
> Stephan

View raw message