You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by "Stephan E. Schlierf" <st...@vsa.de> on 2003/10/28 09:07:43 UTC

Producing one pdf-file out of selected sites

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
(http://marc.theaimsgroup.com/?l=forrest-dev&m=106508959025708&w=2)
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! ;-) )

TIA,
Stephan


Re: Producing one pdf-file out of selected sites

Posted by Jeff Turner <je...@apache.org>.
On Thu, Oct 30, 2003 at 12:24:41PM +0100, Stephan E. Schlierf wrote:
> Jeff Turner schrieb:
...
> Thank you very much for your help, Jeff.
> I copied aggreate.xmap to gl_design.xmap (to change my example ;-) and 
> edited sitemap.xmap as you wrote.
> If I leave the gl_design.xmap unchanged a request of 
> http://localhost:8888/gl_design.xml gives the complete content of my site.
> The only problem I still have is to select the xml-files I'd like to 
> have: The respective files are named something like "design_*.xml" and 
> they are located in a subdirecory named "methods" (= content/xdocs/methods)
> I added the <map:match pattern=...> </map:match> element as you told and 
> changed the value of the pattern attribute from "*.xml" to 
> "methods/design*.xml" but the only thing I get is a "ressource not 
> found"-error in my webbrowser.

That's why it's better to start with a simple pipeline that works, and
progressively add components.  Try starting with:

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

And then add a component to eliminate nodes you don't want.

> So my question is how the gl_design.xmap has to look like for this ? 
> Which elements of aggregate.xmap that still occur in gl_design.xmap are 
> unnecessary ?

They're all necessary, you need to add the additional xpath transformer
to narrow down the XML.

> And in the XPath definition:
> <map:transform type="xpath">
>    <map:parameter name="include"
>                   value="/*[name()='site']/*[name()='methods_gl']" />
> </map:transform>
> Why do you use 'methods_gl' ? It's (just) the name of the tab.

It's the name of the XML element in site.xml:

<methods_gl label="Methods" href="methods/" tab="methods_gl">

So you're saying "give me just elements beneath <methods_gl>".


--Jeff

> Tank you again,
> Stephan
> 
> BTW: I use Forrest 0.5
> 

Re: Producing one pdf-file out of selected sites

Posted by "Stephan E. Schlierf" <st...@vsa.de>.
Jeff Turner schrieb:
> 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
>>(http://marc.theaimsgroup.com/?l=forrest-dev&m=106508959025708&w=2)
>>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>
>           
>    <map:match pattern="site.xml">
>      <map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />
>    </map:match>
>    ...
> 
>  - 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
>    pipeline:
> 
>    <map:match pattern="*.xml">
>      <map:generate src="cocoon://abs-linkmap"/>
>      <map:serialize type="xml"/>
>    </map:match>
> 
>    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:transform>
>      <map:serialize type="xml"/>
>    </map:match>
> 
>    (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
>      src/documentation/conf/
> 
> 
> --Jeff
> 
> 
> 
>>TIA,
>>Stephan
>>
> 
> 
Thank you very much for your help, Jeff.
I copied aggreate.xmap to gl_design.xmap (to change my example ;-) and 
edited sitemap.xmap as you wrote.
If I leave the gl_design.xmap unchanged a request of 
http://localhost:8888/gl_design.xml gives the complete content of my site.
The only problem I still have is to select the xml-files I'd like to 
have: The respective files are named something like "design_*.xml" and 
they are located in a subdirecory named "methods" (= content/xdocs/methods)
I added the <map:match pattern=...> </map:match> element as you told and 
changed the value of the pattern attribute from "*.xml" to 
"methods/design*.xml" but the only thing I get is a "ressource not 
found"-error in my webbrowser.

So my question is how the gl_design.xmap has to look like for this ? 
Which elements of aggregate.xmap that still occur in gl_design.xmap are 
unnecessary ?
And in the XPath definition:
<map:transform type="xpath">
    <map:parameter name="include"
                   value="/*[name()='site']/*[name()='methods_gl']" />
</map:transform>
Why do you use 'methods_gl' ? It's (just) the name of the tab.

Tank you again,
Stephan

BTW: I use Forrest 0.5


Re: Producing one pdf-file out of selected sites

Posted by Jeff Turner <je...@apache.org>.
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
> (http://marc.theaimsgroup.com/?l=forrest-dev&m=106508959025708&w=2)
> 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>
          
   <map:match pattern="site.xml">
     <map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />
   </map:match>
   ...

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

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

   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:transform>
     <map:serialize type="xml"/>
   </map:match>

   (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
     src/documentation/conf/


--Jeff


> TIA,
> Stephan
>