You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2004/07/18 12:36:26 UTC
svn commit: rev 23022 - forrest/trunk/src/documentation/content/xdocs/howto
Author: thorsten
Date: Sun Jul 18 03:36:25 2004
New Revision: 23022
Added:
forrest/trunk/src/documentation/content/xdocs/howto/pdf-howto.xml
Log:
Added: forrest/trunk/src/documentation/content/xdocs/howto/pdf-howto.xml
==============================================================================
--- (empty file)
+++ forrest/trunk/src/documentation/content/xdocs/howto/pdf-howto.xml Sun Jul 18 03:36:25 2004
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.2//EN" "document-v12.dtd">
+<document>
+ <header>
+ <title>Howto for generating user-specific pdf-sites</title>
+ </header>
+ <body>
+ <section>
+ <title>Who should read this?</title>
+ <p>
+ By default Forrest generates a pdf-file for each site of your project. As well you can create a pdf of the whole site. But sometimes it may be necessary to
+ generate a pdf-file out of selected tab. Trying to say only parts of the site. This howto describes how you can get at it.
+ </p>
+ </section>
+ <section>
+ <title>The way it works...</title>
+ <p>
+ Now let us go into it...
+ </p>
+ <ol>
+ <li>
+ Change to the <code>[project]/src/documentation</code> directory.
+ </li>
+ <li>
+ You have to define your own aggregate.xmap.
+ Simply copy the relevant sitemaps that you wish to over-ride, from Forrest sitemaps at forrest/src/core/context/*.xmap into your src/documentation directory (or wherever ${project.sitemap-dir} points to).
+ Copy aggregate.xmap to e.g. foo.xmap.
+ </li>
+ <li>
+ Edit the file <code>sitemap.xmap</code> and insert the following lines after the <map:match pattern="site.xml">
+ pipeline (around line 194):
+ <source xml:space="preserve">
+ <![CDATA[
+...
+<map:match pattern="foo.xml">
+ <map:mount uri-prefix="" src="foo.xmap" check-reload="yes" />
+</map:match>
+...
+]]>
+ </source>
+ </li>
+ <li>
+ Edit the file <code>foo.xmap</code>; the <![CDATA[<map:match pattern="*.xml"> ]]>element should look like the
+ following:
+ <source xml:space="preserve">
+ <![CDATA[
+<map:match pattern="*.xml">
+ <map:generate src="cocoon://abs-linkmap"/>
+ <map:transform type="xpath">
+ <map:parameter name="include" value="/*[name()='site']/*[name()='MyFooSite']"/>
+ </map:transform>
+ <map:transform src="resources/stylesheets/site2book.xsl" />
+ <map:transform src="resources/stylesheets/aggregates/book2cinclude.xsl">
+ <map:parameter name="title" value="{conf:project-name}: Still My Foo Site"/>
+ </map:transform>
+ <map:transform type="cinclude"/>
+ <map:transform src="resources/stylesheets/aggregates/doc2doc-uniqueids.xsl"/>
+ <map:transform src="resources/stylesheets/aggregates/docs2document.xsl"/>
+ <map:serialize type="xml"/>
+</map:match>
+]]>
+ </source>
+ </li>
+ <li>
+ What happens there?
+ <ul>
+ <li>
+ Line 4 of our example
+ <br/>
+ <code><![CDATA[<map:parameter name="include" value="/*[name()='site']/*[name()='MyFooSite']"/>]]></code>
+ looks at your site.xml and finds something like:
+ <source xml:space="preserve">
+ <![CDATA[
+...
+<MyFooSite label="Your foo site">
+ <firstchapter label="Introduction" href="first.html"/>
+ <sec_chapter label="Conclusion" href="second.html/>
+</MyFooSite>
+...
+]]>
+ </source>
+ So it takes all the elements of <code><![CDATA[<MyFooSite>]]></code> - that means <code><![CDATA[<MyFootSite>]]></code>
+ and its "children" - for the content of the pdf-file to generate.
+ </li>
+ <li>
+ Line 8 defines the title of the pdf-file by taking the content of the project-name variable in
+ <code>skinconf.xml</code> and adding some funny text:
+ <br/>
+ <code><![CDATA[<map:parameter name="title" value="{conf:project-name}: Still My Foo Site"/>]]></code>
+ </li>
+ </ul>
+ <note>
+ In the original <code>aggregate.xmap</code> there is the line
+ <br/>
+ <code><![CDATA[<map:parameter name="ignore" value="{1}"/>]]></code>
+ <br/>
+ just before the title definition (<code><![CDATA[<map:parameter name="title" value=".../>]]></code>). Be sure to
+ delete it or comment it out if you like to generate a pdf-file for specific sites. You only need it for
+ the generation of one pdf-file for the whole project (this is what <code>aggregate.xmap</code> usually does).
+ </note>
+ </li>
+ <li>
+ In site.xml, add something like
+ <source xml:space="preserve">
+ <![CDATA[
+<all>
+ <whole_foosite href="FooSite.pdf"/>
+</all>
+]]>
+ </source>
+ This allows you to link to it via a <code><![CDATA[<link href="site:whole_foosite">]]></code> reference. If you need
+ it in the menue entries add the label attribute to the <code><![CDATA[<whole_foosite>]]></code> element:
+ <code><![CDATA[<whole_foosite label="My first PDF-file" href="FooSite.pdf"/>]]></code>
+ </li>
+ </ol>
+ <p>
+ Enjoy it!
+ </p>
+ </section>
+ </body>
+</document>
\ No newline at end of file