Author: bdube
Date: Tue Apr 21 02:55:38 2009
New Revision: 766959
URL: http://svn.apache.org/viewvc?rev=766959&view=rev
Log:
Apply wholesite_pdftab_patch3.txt, due to Andreas Lehmkuehler
Issue: FOR-211
Added:
forrest/trunk/main/webapp/aggregate-pdf-tab.xmap
Modified:
forrest/trunk/main/webapp/aggregate.xmap
forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl
forrest/trunk/main/webapp/sitemap.xmap
forrest/trunk/site-author/content/xdocs/docs_0_90/faq.xml
forrest/trunk/site-author/content/xdocs/docs_0_90/howto/howto-pdf-tab.xml
forrest/trunk/site-author/content/xdocs/site.xml
Added: forrest/trunk/main/webapp/aggregate-pdf-tab.xmap
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/webapp/aggregate-pdf-tab.xmap?rev=766959&view=auto
==============================================================================
--- forrest/trunk/main/webapp/aggregate-pdf-tab.xmap (added)
+++ forrest/trunk/main/webapp/aggregate-pdf-tab.xmap Tue Apr 21 02:55:38 2009
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- ===============================================
+Pipeline to generate an aggregated view of all the site's docs.
+
+This subsitemap defines both a source (*.xml) matcher, and a
+linkmap (linkmap-*) matcher to redefine the internal links.
+
+It works by taking site.xml, transforming each page node into a
+CInclude command, and using the CInclude transformer to create
+the aggregated XML. Some cleverness required to prevent
+duplicate 'id' attributes.
+
+Generates : Source XML, Linkmap
+Example URL: Typically http://localhost:8888/wholesite.pdf
+Used by : sitemap.xmap, which binds the URL to this pipeline
+Uses : cocoon://abs-linkmap, in linkmap.xmap
+
+$Revision: 1.2 $
+==================================================== -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:generators default="file"/>
+ <map:serializers default="html"/>
+ <map:transformers default="xslt">
+ <map:transformer name="cinclude"
src="org.apache.cocoon.transformation.CIncludeTransformer"/>
+ </map:transformers>
+ <map:matchers default="wildcard"/>
+ </map:components>
+ <map:pipelines>
+ <map:pipeline>
+<!-- Aggregation of all XML in the site -->
+ <map:match pattern="*.xml">
+ <map:generate src="cocoon://abs-linkmap"/>
+ <map:transform type="xpath">
+ <map:parameter name="include"
value="//*...@wholesite='true']"/>
+ <map:parameter name="exclude"
value="//*...@wholesite='false']"/>
+ </map:transform>
+ <map:transform src="{lm:transform.site.book}" />
+ <map:transform src="{lm:transform-aggregate.book.cinclude}">
+ <map:parameter name="ignore" value="{1}"/>
+ <map:parameter name="title"
value="{conf:project-name}: Online-Hilfe"/>
+ </map:transform>
+ <map:transform type="cinclude"/>
+ <map:transform src="{lm:transform-aggregate.doc.doc-uniqueids}"/>
+ <map:transform src="{lm:transform-aggregate.docs.document}"/>
+ <map:transform type="linkrewriter" src="cocoon://linkmap-{1}.html"/>
+ <map:transform
src="resources/stylesheets/declare-broken-site-links.xsl" />
+ <map:serialize type="xml"/>
+ </map:match>
+<!-- Special linkmap for pages containing aggregated content. Links to
aggregated content should be internal
+ (fragment identifiers), and other links should be regular hrefs. The
'split' between these two types is decided
+ by the stylesheet. -->
+ <map:match pattern="linkmap-*.*">
+ <map:generate src="cocoon://abs-linkmap" />
+ <map:transform type="xpath">
+ <map:parameter name="include"
value="//*...@wholesite='true']"/>
+ <map:parameter name="exclude"
value="//*...@wholesite='false']"/>
+ </map:transform>
+ <map:transform
src="{lm:transform-aggregate.linkmap.relativized-linkmap}">
+ <map:parameter name="path" value="{1}.{2}" />
+ </map:transform>
+ <map:serialize type="xml"/>
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
Modified: forrest/trunk/main/webapp/aggregate.xmap
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/webapp/aggregate.xmap?rev=766959&r1=766958&r2=766959&view=diff
==============================================================================
--- forrest/trunk/main/webapp/aggregate.xmap (original)
+++ forrest/trunk/main/webapp/aggregate.xmap Tue Apr 21 02:55:38 2009
@@ -55,6 +55,8 @@
<map:transform type="cinclude"/>
<map:transform src="{lm:transform-aggregate.doc.doc-uniqueids}"/>
<map:transform src="{lm:transform-aggregate.docs.document}"/>
+ <map:transform type="linkrewriter" src="cocoon://linkmap-{1}.html"/>
+ <map:transform
src="resources/stylesheets/declare-broken-site-links.xsl" />
<map:serialize type="xml"/>
</map:match>
<!-- Special linkmap for pages containing aggregated content. Links to
aggregated content should be internal
Modified:
forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl?rev=766959&r1=766958&r2=766959&view=diff
==============================================================================
---
forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl
(original)
+++
forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl
Tue Apr 21 02:55:38 2009
@@ -35,11 +35,16 @@
<xsl:value-of select="concat('#', ancestor::section/@id, .)"/>
</xsl:attribute>
</xsl:template>
-<!-- Translate relative links to '#link' -->
- <xsl:template match="section/document//link/@href[not(starts-with(.,
'http:') or starts-with(., 'https:'))]">
+<!-- Translate relative links to 'dir/link' -->
+ <xsl:template match="section/document//link/@href[not(starts-with(., '#') or
starts-with(., 'http:') or starts-with(., 'https:') or starts-with(., 'site:')
or starts-with(., 'ext:') or starts-with(., 'lm:'))]">
+ <xsl:variable name="page-root">
+ <xsl:call-template name="str:substring-before-last">
+ <xsl:with-param name="input" select="ancestor::section/@id"/>
+ <xsl:with-param name="substr" select="'/'"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:attribute name="href">
-<xsl:text>#</xsl:text>
- <xsl:value-of select="."/>
+ <xsl:value-of select="concat($page-root,'/', .)"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="section/document//figure|img[starts-with(@src,
'my-images')]">
Modified: forrest/trunk/main/webapp/sitemap.xmap
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/webapp/sitemap.xmap?rev=766959&r1=766958&r2=766959&view=diff
==============================================================================
--- forrest/trunk/main/webapp/sitemap.xmap (original)
+++ forrest/trunk/main/webapp/sitemap.xmap Tue Apr 21 02:55:38 2009
@@ -436,6 +436,9 @@
<map:match pattern="wholesite.xml">
<map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />
</map:match>
+ <map:match pattern="pdf-tab.xml">
+ <map:mount uri-prefix="" src="aggregate-pdf-tab.xmap"
check-reload="yes" />
+ </map:match>
<map:match pattern="site.xml">
<map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />
</map:match>
@@ -464,6 +467,9 @@
<map:match pattern="linkmap-site.*">
<map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />
</map:match>
+ <map:match pattern="linkmap-pdf-tab.*">
+ <map:mount uri-prefix="" src="aggregate-pdf-tab.xmap"
check-reload="yes" />
+ </map:match>
<map:mount uri-prefix="" src="linkmap.xmap" check-reload="yes" />
</map:match>
</map:pipeline>
Modified: forrest/trunk/site-author/content/xdocs/docs_0_90/faq.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/site-author/content/xdocs/docs_0_90/faq.xml?rev=766959&r1=766958&r2=766959&view=diff
==============================================================================
--- forrest/trunk/site-author/content/xdocs/docs_0_90/faq.xml (original)
+++ forrest/trunk/site-author/content/xdocs/docs_0_90/faq.xml Tue Apr 21
02:55:38 2009
@@ -365,10 +365,6 @@
<link href="site:linking">site.xml</link> method for your site
structure and navigation, rather than the old book.xml method.
</p>
- <warning>
- There are many issues with the "wholesite" aggregation. Search the
- issue tracker and mail lists.
- </warning>
</answer>
</faq>
<faq id="pageBreaks">
Modified:
forrest/trunk/site-author/content/xdocs/docs_0_90/howto/howto-pdf-tab.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/site-author/content/xdocs/docs_0_90/howto/howto-pdf-tab.xml?rev=766959&r1=766958&r2=766959&view=diff
==============================================================================
--- forrest/trunk/site-author/content/xdocs/docs_0_90/howto/howto-pdf-tab.xml
(original)
+++ forrest/trunk/site-author/content/xdocs/docs_0_90/howto/howto-pdf-tab.xml
Tue Apr 21 02:55:38 2009
@@ -23,7 +23,7 @@
This How-To describes the generation of a PDF document for each group of
documents that is defined by a tab.
</abstract>
- <last-modified-content-date date="2005-07-19"/>
+ <last-modified-content-date date="2008-08-04"/>
</header>
<audience title="Intended Audience">
<p>
@@ -39,87 +39,11 @@
certain parts of the site.
</p>
</purpose>
- <prerequisites title="Prerequisites">
- <ul>
- <li>Understand how to create project-specific sitemaps by following the
- <link href="site:your-project">Using Forrest</link> document.</li>
- </ul>
- </prerequisites>
<steps title="Steps">
<p>
- The procedure outlined below will define a project
- <code>sitemap.xmap</code> and create a new <code>pdf-tab.xmap</code>.
+ The procedure outlined below will define a new link similar to the
wholesite-feature,
+ which generates a document containing only the selected parts of your
site.
</p>
- <section id="sitemap">
- <title>Create your project's main sitemap.xmap</title>
- <p>
- If you do not have already a sitemap then create a new empty one in
your
- <code>src/documentation</code> directory (or wherever
- ${project.sitemap-dir} points to).
- </p>
- </section>
- <section id="aggregator">
- <title>Create another sitemap: pdf-tab.xmap</title>
- <p>
- Like before create an empty sitemap and name it pdf-tab.xmap.
- </p>
- </section>
- <section id="mount">
- <title>Edit project sitemap.xmap to mount pdf-tab.xmap</title>
- <p>
- Your sitemap should look something like this.
- </p>
- <source>
-<![CDATA[
-<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
- <map:pipelines>
- <map:pipeline internal-only="false">
- <map:match pattern="**.xml">
- <!-- pdf-tab definitions -->
- <map:match pattern="pdf-tab.xml">
- <map:mount uri-prefix="" src="pdf-tab.xmap"
- check-reload="yes" />
- </map:match>
- <!-- end of pdf-tab definitions -->
- </map:match>
- </map:pipeline>
- </map:pipelines>
-</map:sitemap>]]>
- </source>
- </section>
- <section id="edit-aggregator">
- <title>Edit the file <code>pdf-tab.xmap</code></title>
- <p>
- The <code>
-<![CDATA[<map:match pattern="*.xml">]]>
- </code> element should look like the following:
- </p>
- <source>
-<![CDATA[
-<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
- <map:pipelines>
- <map:pipeline internal-only="false">
- <map:match pattern="*.xml">
- <map:generate src="cocoon://abs-linkmap"/>
- <map:transform type="xpath">
- <map:parameter name="include" value="//*...@wholesite='true']"/>
- <map:parameter name="exclude"
value="//*...@wholesite='false']"/>
- </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>
- </map:pipeline>
- </map:pipelines>
-</map:sitemap>]]>
- </source>
- </section>
<section id="edit-site">
<title>Edit your site.xml</title>
<note>
@@ -174,13 +98,17 @@
<section id="explain">
<title>Explanation of the operation</title>
<p>
- Line 4 of our example
+ The aggregation of all relavant documents is done by the submap
"aggregate-pdf-tab.xmap".
+ It works similar to the submap "aggregate.xmap", which is used to
generate the whosite-documents,
+ with only one difference. There is a additional rule in line 50 and 69
for a transformation
+ to filter the linkmap using the parameter <em>wholesite</em>
<br/>
- <code>
-<![CDATA[<map:parameter name="include" value="//*...@wholesite='true']"/>]]>
- </code> looks at your site.xml and will match every element containing
- the <code>wholesite="true"</code> attribute. For example, to use the
- "samples" tab ...
+ <source>
+<![CDATA[<map:transform type="xpath">
+ <map:parameter name="include" value="//*...@wholesite='true']"/>
+ <map:parameter name="exclude" value="//*...@wholesite='false']"/>
+</map:transform>]]></source>
+ For example, to use the "samples" tab ...
</p>
<source>
<![CDATA[
@@ -214,13 +142,13 @@
attribute will be as well inherited by all children of the element.
</p>
<p>
- 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:
+ Line 57 of the submap "aggregate-pdf-tab.xmap" 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>
+ <source>
<![CDATA[<map:parameter name="title" value="{conf:project-name}: Still My Foo
Site"/>]]>
- </code>
+ </source>
</p>
</section>
</steps>
@@ -229,9 +157,5 @@
Please provide feedback about this document via the
<link href="site:mail-lists">mailing lists</link>.
</p>
- <p>
- In the future, this ability will probably be incorporated into the main
- Forrest process.
- </p>
</feedback>
</howto>
Modified: forrest/trunk/site-author/content/xdocs/site.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/site-author/content/xdocs/site.xml?rev=766959&r1=766958&r2=766959&view=diff
==============================================================================
--- forrest/trunk/site-author/content/xdocs/site.xml (original)
+++ forrest/trunk/site-author/content/xdocs/site.xml Tue Apr 21 02:55:38 2009
@@ -135,12 +135,14 @@
<xml label="Apache XML" href="http://xml.apache.org/"/>
<pao label="projects.apache.org" href="http://projects.apache.org/"/>
</references>
-<!-- Uncomment this if we want aggregate HTML/PDFs for this site
+
<pdfs label="PDFs">
<whole_site_html label="Whole site HTML" href="wholesite.html"/>
<whole_site_pdf label="Whole site PDF" href="wholesite.pdf"/>
+ <docs_09_html label="Forrest 0.90-dev documentation HTML"
href="pdf-tab.html"/>
+ <docs_09_pdf label="Forrest 0.90-dev documentation PDF"
href="pdf-tab.pdf"/>
</pdfs>
- -->
+
<external-refs>
<asf href="http://www.apache.org/">
<asf-legal href="dev/#licenses"/>
@@ -248,7 +250,7 @@
To create a new release see f.a.o/procedures/release/How_to_release.html
-->
<v0.90 label="Documentation in development" description="Set of documents
for the in-development version, i.e. SVN head">
- <documentation label="0.90-dev" href="docs_0_90/" tab="v0_90">
+ <documentation label="0.90-dev" href="docs_0_90/" tab="v0_90"
wholesite="true">
<index label="Overview" href="index.html"/>
<!-- FIXME: Needed to avoid moving files -->
<catalog href="catalog.html"/>