You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2003/06/09 12:27:42 UTC
cvs commit: xml-forrest/src/resources/stylesheets/aggregates book2cinclude.xsl doc2doc-uniqueids.xsl docs2document.xsl relativize-split-linkmap.xsl
jefft 2003/06/09 03:27:42
Modified: src/documentation/content/xdocs site.xml tabs.xml
src/resources/conf forrest.xmap linkmap-tabs.xmap
linkmap.xmap navigation.xmap sitemap.xmap
src/resources/skins/common/xslt/html document2html.xsl
tab2menu.xsl
src/resources/stylesheets relativize-linkmap.xsl
site2site-selectnode.xsl
Added: src/resources/conf aggregate.xmap
src/resources/stylesheets/aggregates book2cinclude.xsl
doc2doc-uniqueids.xsl docs2document.xsl
relativize-split-linkmap.xsl
Log:
- Add aggregated view (site.html, site.pdf) of the whole site
- Fix in-PDF links, so links pointing outside the PDF get an absolute URL
prefix.
- Sitemap modifications: pass filetype into down to 'body' matcher
(body-index.xml -> body-index.html) and linkmap. The linkmap matchers are
now broken into:
- **linkmap-*: Vanilla link map
- **menulinks-*: Links that would form the left-hand menu of the current
page.
- Made @tab menu selection the default in the sitemap.
- Use @tab linking in the Forrest documentation
Revision Changes Path
1.12 +10 -5 xml-forrest/src/documentation/content/xdocs/site.xml
Index: site.xml
===================================================================
RCS file: /home/cvs/xml-forrest/src/documentation/content/xdocs/site.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- site.xml 26 Apr 2003 12:23:14 -0000 1.11
+++ site.xml 9 Jun 2003 10:27:38 -0000 1.12
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<site label="Forrest" href="" xmlns="http://apache.org/forrest/linkmap/1.0">
+<site label="Forrest" href="" xmlns="http://apache.org/forrest/linkmap/1.0" tab="home">
<about label="About">
<index label="Index" href="index.html"/>
@@ -21,7 +21,9 @@
</mail-lists>
<mail-archives label="Mail Archives" href="mail-archives.html"/>
<bugs label="Bugs and Issues" href="http://issues.cocoondev.org/jira/secure/BrowseProject.jspa?id=10000"/>
+ <!--
<forrest-issues label="Open Issues" href="forrest-issues.html"/>
+ -->
</getting-involved>
<documentation label="Documentation">
@@ -48,13 +50,12 @@
<document-v11 label="document-v11" href="document-v11.html"/>
<document-v12 label="document-v12" href="document-v12.html"/>
- <how-tos label="How-Tos" href="community/howto/index.html"/>
<wiki label="Wiki Reference" href="wiki-sample.html"/>
</samples>
- <community label="Community" href="community/">
+ <community label="Community" href="community/" tab="community">
<index label="About" href="index.html"/>
- <howto-samples label="How-To Samples" href="howto/">
+ <howto-samples label="How-To Samples" href="howto/" tab="howto">
<overview label="Overview" href="index.html"/>
<single-page label="Single Page" href="v10/howto-v10.html"/>
<xmlform label="Multi-Page" href="xmlform/">
@@ -67,7 +68,7 @@
</xmlform>
<with-images label="With Images" href="bugzilla-patch/howto-bugzilla-patch.html"/>
</howto-samples>
- <howto-committers label="Committers" href="howto/">
+ <howto-committers label="Committers" href="howto/" tab="howto">
<cvs-ssh label="CVS through SSH" href="cvs-ssh/howto-cvs-ssh.html"/>
</howto-committers>
</community>
@@ -77,6 +78,10 @@
<cocoon label="Apache Cocoon" href="http://xml.apache.org/cocoon/"/>
<centipede label="Krysalis Centipede" href="http://www.krysalis.org/"/>
</references>
+ <pdfs label="PDFs">
+ <whole_site_html label="Whole site HTML" href="site.html" tab=""/>
+ <whole_site_pdf label="Whole site PDF" href="site.pdf" tab=""/>
+ </pdfs>
<external-refs>
<xml.apache.org href="http://xml.apache.org/">
1.9 +8 -0 xml-forrest/src/documentation/content/xdocs/tabs.xml
Index: tabs.xml
===================================================================
RCS file: /home/cvs/xml-forrest/src/documentation/content/xdocs/tabs.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- tabs.xml 9 Nov 2002 09:54:06 -0000 1.8
+++ tabs.xml 9 Jun 2003 10:27:38 -0000 1.9
@@ -10,10 +10,18 @@
@dir will always have /index.html added.
@href is not modified unless it is root-relative and obviously specifies a
directory (ends in '/'), in which case /index.html will be added
+
+ If tabs are nested, then the parent tab will contain all elements of its
+ children.
-->
<tab label="Home" dir=""/>
<tab label="Community" dir="community"/>
<tab label="How-Tos" dir="community/howto"/>
+ <!--
+ <tab id="home" label="Home" dir=""/>
+ <tab id="community" label="Community" dir="community"/>
+ <tab id="howto" label="How-Tos" dir="community/howto"/>
+ -->
</tabs>
1.18 +1 -1 xml-forrest/src/resources/conf/forrest.xmap
Index: forrest.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/forrest.xmap,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- forrest.xmap 2 Jun 2003 22:55:18 -0000 1.17
+++ forrest.xmap 9 Jun 2003 10:27:39 -0000 1.18
@@ -141,7 +141,7 @@
<!-- INTERMEDIATE FORMATS -->
<!-- ============================================================ -->
- <map:match pattern="**body-*.xml">
+ <map:match pattern="**body-*.html">
<map:act type="resource-exists">
<map:parameter name="url" value="content/xdocs/{1}{2}.ehtml" />
<map:generate src="content/xdocs/{../1}{../2}.ehtml" />
1.2 +27 -11 xml-forrest/src/resources/conf/linkmap-tabs.xmap
Index: linkmap-tabs.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/linkmap-tabs.xmap,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linkmap-tabs.xmap 3 Jun 2003 10:09:03 -0000 1.1
+++ linkmap-tabs.xmap 9 Jun 2003 10:27:39 -0000 1.2
@@ -17,6 +17,7 @@
<map:pipelines>
<map:pipeline>
+ <!-- Used by **/linkmap-* -->
<map:match pattern="abs-linkmap">
<map:generate src="content/xdocs/site.xml" />
<map:transform src="resources/stylesheets/absolutize-linkmap.xsl" />
@@ -24,32 +25,47 @@
<map:serialize type="xml" />
</map:match>
- <map:match pattern="abs-linkmap/**">
- <map:generate src="cocoon:/abs-linkmap" />
- <map:transform src="resources/stylesheets/site2site-selectnode.xsl">
- <map:parameter name="path" value="{1}"/>
+
+ <map:match pattern="**linkmap-site.*">
+ <map:generate src="cocoon://abs-linkmap" />
+ <map:transform src="resources/stylesheets/relativize-split-linkmap.xsl">
+ <map:parameter name="path" value="site.html" />
</map:transform>
<map:serialize type="xml" />
</map:match>
- <map:match pattern="**linkmap">
+ <!-- A linkmap (map from abstract to physical links) for the current page -->
+ <!-- Used by the linkrewriter transformer -->
+ <map:match pattern="**linkmap-*">
<map:generate src="cocoon://abs-linkmap" />
<map:transform src="resources/stylesheets/relativize-linkmap.xsl">
- <map:parameter name="path" value="{0}" />
+ <map:parameter name="path" value="{1}{2}" />
+ </map:transform>
+ <map:serialize type="xml" />
+ </map:match>
+
+ <!-- A list of absolute links for the current page's menu -->
+ <!-- Used by menulinks/** -->
+ <map:match pattern="**abs-menulinks-*">
+ <map:generate src="cocoon://abs-linkmap" />
+ <map:transform src="resources/stylesheets/site2site-selectnode.xsl">
+ <map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml" />
</map:match>
- <!-- This derivation of '**linkmap' is used when generating book.xml from a
- site.xml. The /** suffix identifies a @href prefix which all nodes in the
+ <!-- A list of relative links for the current page's menu -->
+ <!-- Used when generating book.xml from a site.xml. The /** suffix
+ identifies a @href prefix which all nodes in the
returned subtree must have. -->
- <map:match pattern="**linkmap/**">
- <map:generate src="cocoon://abs-linkmap/{2}" />
+ <map:match pattern="**menulinks-*">
+ <map:generate src="cocoon://{1}abs-menulinks-{2}" />
<map:transform src="resources/stylesheets/relativize-linkmap.xsl">
- <map:parameter name="path" value="{1}" />
+ <map:parameter name="path" value="{1}{2}" />
</map:transform>
<map:serialize type="xml" />
</map:match>
+
</map:pipeline>
</map:pipelines>
1.7 +19 -11 xml-forrest/src/resources/conf/linkmap.xmap
Index: linkmap.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/linkmap.xmap,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- linkmap.xmap 3 Jun 2003 10:09:03 -0000 1.6
+++ linkmap.xmap 9 Jun 2003 10:27:39 -0000 1.7
@@ -15,38 +15,46 @@
<map:pipelines>
<map:pipeline>
+
+ <!-- Used by **/linkmap-* -->
<map:match pattern="abs-linkmap">
<map:generate src="content/xdocs/site.xml" />
<map:transform src="resources/stylesheets/absolutize-linkmap.xsl" />
<map:serialize type="xml" />
</map:match>
- <map:match type="regexp" pattern="^abs-linkmap/(.*?)([^/]*)$">
+ <!-- A linkmap (map from abstract to physical links) for the current page -->
+ <!-- Used by the linkrewriter transformer -->
+ <map:match pattern="**linkmap-*">
<map:generate src="cocoon://abs-linkmap" />
- <map:transform type="xpath">
- <map:parameter name="include" value="//*[@href='{1}']" />
+ <map:transform src="resources/stylesheets/relativize-linkmap.xsl">
+ <map:parameter name="path" value="{1}{2}" />
</map:transform>
<map:serialize type="xml" />
</map:match>
- <map:match pattern="**linkmap">
+ <!-- A list of absolute links for the current page's menu -->
+ <!-- Used by menulinks/** -->
+ <map:match pattern="**abs-menulinks-*">
<map:generate src="cocoon://abs-linkmap" />
- <map:transform src="resources/stylesheets/relativize-linkmap.xsl">
- <map:parameter name="path" value="{0}" />
+ <map:transform type="xpath">
+ <map:parameter name="include" value="//*[@href='{1}']" />
</map:transform>
<map:serialize type="xml" />
</map:match>
- <!-- This derivation of '**linkmap' is used when generating book.xml from a
- site.xml. The /** suffix identifies a @href prefix which all nodes in the
+ <!-- A list of relative links for the current page's menu -->
+ <!-- Used when generating book.xml from a site.xml. The /** suffix
+ identifies a @href prefix which all nodes in the
returned subtree must have. -->
- <map:match pattern="**linkmap/**">
- <map:generate src="cocoon://abs-linkmap/{2}" />
+ <map:match pattern="**menulinks-*">
+ <map:generate src="cocoon://{1}abs-menulinks-{2}" />
<map:transform src="resources/stylesheets/relativize-linkmap.xsl">
- <map:parameter name="path" value="{1}linkmap" />
+ <map:parameter name="path" value="{1}{2}" />
</map:transform>
<map:serialize type="xml" />
</map:match>
+
</map:pipeline>
</map:pipelines>
1.8 +12 -37 xml-forrest/src/resources/conf/navigation.xmap
Index: navigation.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/navigation.xmap,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- navigation.xmap 3 Jun 2003 10:09:03 -0000 1.7
+++ navigation.xmap 9 Jun 2003 10:27:39 -0000 1.8
@@ -10,49 +10,24 @@
<map:selectors default="browser"/>
</map:components>
- <map:resources>
-
- <map:resource name="book">
- <map:act type="resource-exists">
- <!-- If a hand-created book.xml exists, use it -->
- <map:parameter name="url" value="content/xdocs/{dir}book.xml" />
- <map:generate src="content/xdocs/{../dir}book.xml" />
- <map:serialize type="xml"/>
- </map:act>
-
- <!-- If no book.xml, generate it from the linkmap. -->
- <map:generate src="cocoon://{dir}linkmap/{path}" />
- <!-- The above generates the subset of the linkmap relevant to our directory. -->
- <map:transform src="resources/stylesheets/site2book.xsl" />
- <map:serialize type="xml"/>
- </map:resource>
- </map:resources>
-
<map:pipelines>
<map:pipeline>
- <map:match pattern="**/book-*.xml">
- <map:call resource="book">
- <map:parameter name="dir" value="{1}/" />
- <map:parameter name="path" value="{1}/{2}" />
- </map:call>
- </map:match>
-
- <map:match pattern="book-*.xml">
- <map:call resource="book">
- <map:parameter name="dir" value="" />
- <map:parameter name="path" value="{1}" />
- </map:call>
- </map:match>
+ <map:match pattern="**book-*">
- <map:match pattern="**/tab.xml">
- <map:generate src="content/xdocs/tabs.xml" />
+ <map:act type="resource-exists">
+ <!-- If a hand-created book.xml exists, use it -->
+ <map:parameter name="url" value="content/xdocs/{1}book.xml" />
+ <map:generate src="content/xdocs/{../1}book.xml" />
+ <map:serialize type="xml"/>
+ </map:act>
+
+ <!-- If no book.xml, generate it from the linkmap. -->
+ <map:generate src="cocoon://{1}menulinks-{2}" />
+ <!-- The above generates the subset of the linkmap relevant to our directory. -->
+ <map:transform src="resources/stylesheets/site2book.xsl" />
<map:serialize type="xml"/>
- </map:match>
- <map:match pattern="tab.xml">
- <map:generate src="content/xdocs/tabs.xml" />
- <map:serialize type="xml"/>
</map:match>
</map:pipeline>
1.101 +124 -103 xml-forrest/src/resources/conf/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/conf/sitemap.xmap,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- sitemap.xmap 3 Jun 2003 10:09:03 -0000 1.100
+++ sitemap.xmap 9 Jun 2003 10:27:39 -0000 1.101
@@ -126,82 +126,54 @@
<map:pipeline internal-only="false">
<!-- ============================================================ -->
- <!-- OUTPUT FORMATS -->
- <!-- Serves content directly to the user -->
- <!-- +==========================================================+ -->
+ <!-- SOURCE FORMATS -->
+ <!-- Raw XML sources, typically doc-v11 format -->
+ <!-- ============================================================ -->
- <map:match type="regexp" pattern="^.+$">
- <map:act type="resource-exists">
- <map:parameter name="url" value="content/{0}" />
- <map:mount uri-prefix="" src="raw.xmap" check-reload="yes" />
- </map:act>
+ <map:match pattern="changes.xml">
+ <map:mount uri-prefix="" src="status.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="*.html">
- <map:aggregate element="site">
- <map:part src="cocoon:/tab-{1}.xml"/>
- <map:part src="cocoon:/menu-{1}.xml"/>
- <map:part src="cocoon:/body-{1}.xml"/>
- </map:aggregate>
- <map:call resource="skinit">
- <map:parameter name="type" value="site2xhtml"/>
- <map:parameter name="path" value="{0}"/>
- </map:call>
- </map:match>
-
- <map:match pattern="**/*.html">
- <map:aggregate element="site">
- <map:part src="cocoon:/{1}/tab-{2}.xml"/>
- <map:part src="cocoon:/{1}/menu-{2}.xml"/>
- <map:part src="cocoon:/{1}/body-{2}.xml"/>
- </map:aggregate>
- <map:call resource="skinit">
- <map:parameter name="type" value="site2xhtml"/>
- <map:parameter name="path" value="{0}"/>
- </map:call>
+ <map:match pattern="todo.xml">
+ <map:mount uri-prefix="" src="status.xmap" check-reload="yes" />
</map:match>
+ <map:match pattern="**dtdx.xml">
+ <map:mount uri-prefix="" src="dtd.xmap" check-reload="yes" />
+ </map:match>
- <!-- Special matcher for FAQ PDFs, so we can pass an extra
- 'numbersections' param into document2fo.xsl -->
- <map:match pattern="**faq.pdf">
- <map:generate src="cocoon:/{1}faq.xml"/>
- <map:transform src="skins/{forrest:skin}/xslt/fo/document2fo.xsl">
- <map:parameter name="numbersections" value="false"/>
- <map:parameter name="ctxbasedir" value="{realpath:.}/"/>
- <map:parameter name="xmlbasedir" value="content/xdocs/{1}"/>
- </map:transform>
- <map:serialize type="fo2pdf"/>
+ <map:match pattern="**linkmap*">
+ <map:mount uri-prefix="" src="linkmap.xmap" check-reload="yes" />
</map:match>
- <map:match type="regexp" pattern="^(.*?)([^/]*).pdf$">
- <map:generate src="cocoon:/{1}{2}.xml"/>
- <map:transform src="skins/{forrest:skin}/xslt/fo/document2fo.xsl">
- <map:parameter name="ctxbasedir" value="{realpath:.}/"/>
- <map:parameter name="xmlbasedir" value="content/xdocs/{1}"/>
- </map:transform>
- <map:serialize type="fo2pdf"/>
+ <map:match pattern="**menulinks*">
+ <map:mount uri-prefix="" src="linkmap.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**changes.rss">
- <map:mount uri-prefix="" src="status.xmap" check-reload="yes" />
+ <map:match pattern="**issues.xml">
+ <map:mount uri-prefix="" src="issues.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="profiler">
- <map:mount uri-prefix="" src="profiler.xmap" check-reload="yes" />
+ <map:match pattern="**faq.xml">
+ <map:mount uri-prefix="" src="faq.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**.js">
- <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+
+ <map:match pattern="community/**index.xml">
+ <map:mount uri-prefix="" src="forrest.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**.css">
- <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+
+ <map:match pattern="community/*/**.xml">
+ <map:mount uri-prefix="" src="revisions.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**images**">
- <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+
+ <map:match pattern="site.xml">
+ <map:mount uri-prefix="" src="aggregate.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**favicon.ico">
- <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+
+ <map:match pattern="**.xml">
+ <map:mount uri-prefix="" src="forrest.xmap" check-reload="yes" />
</map:match>
+
</map:pipeline>
@@ -214,16 +186,16 @@
<!-- External matches -->
<!-- (HTML rendered directly from special formats) -->
- <map:match pattern="**body-faq.xml">
+ <map:match pattern="**body-faq.html">
<map:mount uri-prefix="" src="faq.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**body-*.xml">
+ <map:match pattern="**body-*.html">
<map:act type="resource-exists">
<map:parameter name="url" value="content/xdocs/{1}{2}.ehtml" />
<map:generate src="content/xdocs/{../1}{../2}.ehtml" />
<map:transform src="resources/stylesheets/html2htmlbody.xsl" />
- <map:transform type="linkrewriter" src="cocoon:/{1}linkmap">
+ <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html">
<map:parameter name="link-attrs" value="href src"/>
<map:parameter name="schemes" value="site ext"/>
</map:transform>
@@ -233,11 +205,11 @@
<!-- Default matches -->
<!-- (HTML rendered from doc-v11 intermediate format -->
- <map:match pattern="**body-*.xml">
+ <map:match pattern="**body-*.html">
<map:generate src="cocoon:/{1}{2}.xml"/>
<map:transform type="idgen"/>
<map:transform type="xinclude"/>
- <map:transform type="linkrewriter" src="cocoon:/{1}linkmap">
+ <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html">
<map:parameter name="link-attrs" value="href src"/>
<map:parameter name="schemes" value="site ext"/>
</map:transform>
@@ -248,9 +220,9 @@
</map:call>
</map:match>
- <map:match pattern="**menu-*.xml">
- <map:generate src="cocoon:/{1}book-{2}.xml"/>
- <map:transform type="linkrewriter" src="cocoon:/{1}linkmap">
+ <map:match pattern="**menu-*.html">
+ <map:generate src="cocoon:/{1}book-{2}.html"/>
+ <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html">
<map:parameter name="schemes" value="site ext"/>
</map:transform>
<map:call resource="skinit">
@@ -259,9 +231,9 @@
</map:call>
</map:match>
- <map:match pattern="**tab-*.xml">
- <map:generate src="cocoon:/{1}tab.xml" />
- <map:transform type="linkrewriter" src="cocoon:/{1}linkmap">
+ <map:match pattern="**tab-*.html">
+ <map:generate src="content/xdocs/tabs.xml" />
+ <map:transform type="linkrewriter" src="cocoon:/{1}linkmap-{2}.html">
<map:parameter name="schemes" value="site ext"/>
</map:transform>
<map:call resource="skinit">
@@ -269,59 +241,108 @@
<map:parameter name="path" value="{1}{2}"/>
</map:call>
</map:match>
- </map:pipeline>
- <!-- ============================================================ -->
- <!-- SOURCE FORMATS -->
- <!-- Raw XML sources, typically doc-v11 format -->
- <!-- ============================================================ -->
- <map:pipeline internal-only="false">
-
- <map:match pattern="**book-*.xml">
+ <map:match pattern="**book-*.html">
<map:mount uri-prefix="" src="navigation.xmap" check-reload="yes" />
</map:match>
- <map:match pattern="**tab.xml">
- <map:mount uri-prefix="" src="navigation.xmap" check-reload="yes" />
- </map:match>
- <map:match pattern="changes.xml">
- <map:mount uri-prefix="" src="status.xmap" check-reload="yes" />
- </map:match>
- <map:match pattern="todo.xml">
- <map:mount uri-prefix="" src="status.xmap" check-reload="yes" />
- </map:match>
- <map:match pattern="**dtdx.xml">
- <map:mount uri-prefix="" src="dtd.xmap" check-reload="yes" />
- </map:match>
+ </map:pipeline>
- <map:match pattern="**linkmap**">
- <map:mount uri-prefix="" src="linkmap.xmap" check-reload="yes" />
- </map:match>
- <map:match pattern="**issues.xml">
- <map:mount uri-prefix="" src="issues.xmap" check-reload="yes" />
+ <map:pipeline internal-only="false">
+
+ <!-- ============================================================ -->
+ <!-- OUTPUT FORMATS -->
+ <!-- Serves content directly to the user -->
+ <!-- +==========================================================+ -->
+
+ <map:match type="regexp" pattern="^.+$">
+ <map:act type="resource-exists">
+ <map:parameter name="url" value="content/{0}" />
+ <map:mount uri-prefix="" src="raw.xmap" check-reload="yes" />
+ </map:act>
</map:match>
- <map:match pattern="**faq.xml">
- <map:mount uri-prefix="" src="faq.xmap" check-reload="yes" />
+ <map:match pattern="*.html">
+ <map:aggregate element="site">
+ <map:part src="cocoon:/tab-{0}"/>
+ <map:part src="cocoon:/menu-{0}"/>
+ <map:part src="cocoon:/body-{0}"/>
+ </map:aggregate>
+ <map:call resource="skinit">
+ <map:parameter name="type" value="site2xhtml"/>
+ <map:parameter name="path" value="{0}"/>
+ </map:call>
+ </map:match>
+
+ <map:match pattern="**/*.html">
+ <map:aggregate element="site">
+ <map:part src="cocoon:/{1}/tab-{2}.html"/>
+ <map:part src="cocoon:/{1}/menu-{2}.html"/>
+ <map:part src="cocoon:/{1}/body-{2}.html"/>
+ </map:aggregate>
+ <map:call resource="skinit">
+ <map:parameter name="type" value="site2xhtml"/>
+ <map:parameter name="path" value="{0}"/>
+ </map:call>
</map:match>
- <map:match pattern="community/**index.xml">
- <map:mount uri-prefix="" src="forrest.xmap" check-reload="yes" />
+
+ <!-- Special matcher for FAQ PDFs, so we can pass an extra
+ 'numbersections' param into document2fo.xsl -->
+ <map:match pattern="**faq.pdf">
+ <map:generate src="cocoon:/{1}faq.xml"/>
+ <map:transform src="skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+ <map:parameter name="numbersections" value="false"/>
+ <map:parameter name="ctxbasedir" value="{realpath:.}/"/>
+ <map:parameter name="xmlbasedir" value="content/xdocs/{1}"/>
+ </map:transform>
+ <map:serialize type="fo2pdf"/>
</map:match>
- <map:match pattern="community/*/**">
- <map:mount uri-prefix="" src="revisions.xmap" check-reload="yes" />
+ <map:match type="regexp" pattern="^(.*?)([^/]*).pdf$">
+ <map:generate src="cocoon:/{1}{2}.xml"/>
+ <!--
+ <map:transform type="idgen"/>
+ -->
+ <map:transform type="xinclude"/>
+ <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.pdf">
+ <map:parameter name="link-attrs" value="href src"/>
+ <map:parameter name="schemes" value="site ext"/>
+ </map:transform>
+
+ <map:transform src="skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+ <map:parameter name="ctxbasedir" value="{realpath:.}/"/>
+ <map:parameter name="xmlbasedir" value="content/xdocs/{1}"/>
+ </map:transform>
+ <map:serialize type="fo2pdf"/>
</map:match>
- <map:match pattern="**.xml">
- <map:mount uri-prefix="" src="forrest.xmap" check-reload="yes" />
+ <map:match pattern="**changes.rss">
+ <map:mount uri-prefix="" src="status.xmap" check-reload="yes" />
</map:match>
+ <map:match pattern="profiler">
+ <map:mount uri-prefix="" src="profiler.xmap" check-reload="yes" />
+ </map:match>
+ <map:match pattern="**.js">
+ <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+ </map:match>
+ <map:match pattern="**.css">
+ <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+ </map:match>
+ <map:match pattern="**images**">
+ <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+ </map:match>
+ <map:match pattern="**favicon.ico">
+ <map:mount uri-prefix="" src="static.xmap" check-reload="yes" />
+ </map:match>
</map:pipeline>
+
+
<!-- ============================================================ -->
<!-- REDIRECTS -->
1.1 xml-forrest/src/resources/conf/aggregate.xmap
Index: aggregate.xmap
===================================================================
<?xml version="1.0"?>
<!-- Subsitemap generating aggregated views of multiple XML docs -->
<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:readers default="resource"/>
<map:matchers default="wildcard"/>
<map:selectors default="browser"/>
</map:components>
<map:pipelines>
<map:pipeline>
<!-- Aggregation of all XML in the site -->
<map:match pattern="site.xml">
<!--
<map:generate src="cocoon://book-index.html"/>
<map:generate src="cocoon://community/howto/abs-menulinks-index.html"/>
<map:generate src="cocoon://abs-menulinks-faq.html"/>
-->
<map:generate src="cocoon://abs-linkmap"/>
<map:transform src="resources/stylesheets/site2book.xsl" />
<map:transform src="resources/stylesheets/aggregates/book2cinclude.xsl">
<map:parameter name="ignore" value="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>
1.18 +12 -12 xml-forrest/src/resources/skins/common/xslt/html/document2html.xsl
Index: document2html.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/document2html.xsl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- document2html.xsl 22 May 2003 02:33:32 -0000 1.17
+++ document2html.xsl 9 Jun 2003 10:27:40 -0000 1.18
@@ -52,20 +52,20 @@
<xsl:template match="document">
<div class="content">
- <xsl:if test="normalize-space(header/title)!=''">
- <table summary="" class="title">
- <tr>
- <td valign="middle">
+ <table summary="" class="title">
+ <tr>
+ <td valign="middle">
+ <xsl:if test="normalize-space(header/title)!=''">
<h1>
<xsl:value-of select="header/title"/>
</h1>
- </td>
- <xsl:call-template name="printlink"/>
- <xsl:call-template name="pdflink"/>
- <xsl:call-template name="xmllink"/>
- </tr>
- </table>
- </xsl:if>
+ </xsl:if>
+ </td>
+ <xsl:call-template name="printlink"/>
+ <xsl:call-template name="pdflink"/>
+ <xsl:call-template name="xmllink"/>
+ </tr>
+ </table>
<xsl:if test="normalize-space(header/subtitle)!=''">
<h3>
<xsl:value-of select="header/subtitle"/>
1.8 +3 -3 xml-forrest/src/resources/skins/common/xslt/html/tab2menu.xsl
Index: tab2menu.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/tab2menu.xsl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- tab2menu.xsl 3 Jun 2003 22:31:10 -0000 1.7
+++ tab2menu.xsl 9 Jun 2003 10:27:40 -0000 1.8
@@ -108,7 +108,7 @@
any other HTML -->
<xsl:template name="base-tabs">
<xsl:call-template name="pre-separator"/>
- <xsl:for-each select="tab">
+ <xsl:for-each select="//tab">
<xsl:if test="position()!=1"><xsl:call-template name="separator"/></xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
@@ -120,7 +120,7 @@
<xsl:choose>
<xsl:when test="@id and @id = $matching-id">
<xsl:call-template name="selected"/>
- </xsl:when>
+ </xsl:when>
<xsl:when test="not(@id) and @dir = $longest-dir or @href = $longest-dir">
<xsl:call-template name="selected"/>
</xsl:when>
1.3 +33 -9 xml-forrest/src/resources/stylesheets/relativize-linkmap.xsl
Index: relativize-linkmap.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/relativize-linkmap.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- relativize-linkmap.xsl 8 Jan 2003 05:44:34 -0000 1.2
+++ relativize-linkmap.xsl 9 Jun 2003 10:27:40 -0000 1.3
@@ -1,7 +1,10 @@
<?xml version="1.0"?>
<!--
-Stylesheet which adds ..'s to @href attributes, to make the URIs relative to
-some root. Eg, given an 'absolutized' file (from absolutize-linkmap.xsl):
+Stylesheet which makes site.xml links relative to the site root.
+
+If the current path ($path) is HTML, links with have ..'s added, to make the
+URIs relative to some root. Eg, given an 'absolutized' file (from
+absolutize-linkmap.xsl):
<site href="">
<community href="community/">
@@ -15,12 +18,24 @@
<site href="../">
<community href="../community/">
- <faq href="../community/">
+ <faq href="../community/faq.html">
<how_can_I_help href="../community/faq.html#help"/>
</faq>
</community>
</site>
+If the current path is PDF, then an absolute URL to a site root ($site-root) is
+prepended. In our example above, if $site-root were http://www.mysite.com/,
+the result would be:
+
+<site href="http://www.mysite.com/">
+ <community href="http://www.mysite.com/community/">
+ <faq href="http://www.mysite.com/community/faq.html">
+ <how_can_I_help href="http://www.mysite.com/community/faq.html#help"/>
+ </faq>
+ </community>
+</site>
+
Jeff Turner <je...@apache.org>
-->
@@ -29,6 +44,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="path"/>
+ <xsl:param name="site-root" select="'http://localhost:8787/forrest/'"/>
<xsl:include href="dotdots.xsl"/>
@@ -40,21 +56,29 @@
</xsl:variable>
<xsl:template match="@href">
+
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="starts-with(., 'http:') or starts-with(., 'https:')">
<xsl:value-of select="."/>
</xsl:when>
+
+ <xsl:when test="contains($path, '.pdf')">
+
+ <!-- Links to outside a PDF are all absolute -->
+ <xsl:value-of select="concat($site-root, .)"/>
+
+ </xsl:when>
<xsl:otherwise>
+
+ <!-- Links outside a HTML are relative -->
<xsl:value-of select="$root"/><xsl:value-of select="."/>
+
</xsl:otherwise>
</xsl:choose>
- </xsl:attribute>
+ </xsl:attribute>
</xsl:template>
- <xsl:template match="@*|node()" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
+ <xsl:include href="copyover.xsl"/>
+
</xsl:stylesheet>
1.3 +5 -1 xml-forrest/src/resources/stylesheets/site2site-selectnode.xsl
Index: site2site-selectnode.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/site2site-selectnode.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- site2site-selectnode.xsl 3 Jun 2003 22:36:11 -0000 1.2
+++ site2site-selectnode.xsl 9 Jun 2003 10:27:40 -0000 1.3
@@ -17,7 +17,7 @@
</xsl:variable>
<xsl:template match="/*">
- <!--
+ <!--
<xsl:message>## path is <xsl:value-of select="$path"/></xsl:message>
<xsl:message>## tab is <xsl:value-of select="$tab"/></xsl:message>
-->
@@ -25,6 +25,10 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
+
+ <!-- Ignore external references, as they are only useful for link mapping, not
+ creating menus -->
+ <xsl:template match="l:external-refs"/>
<xsl:template match="*">
<xsl:choose>
1.1 xml-forrest/src/resources/stylesheets/aggregates/book2cinclude.xsl
Index: book2cinclude.xsl
===================================================================
<?xml version="1.0"?>
<!--
Generates a skeleton doc-v20 file for the whole site with CInclude elements where content should be pulled in.
Input is expected to be in standard book.xml format. @hrefs should be normalized, although unnormalized hrefs can be
handled by uncommenting the relevant section.
jefft@apache.org
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cinclude="http://apache.org/cocoon/include/1.0">
<xsl:param name="title" select="''"/>
<xsl:param name="ignore" select="'jira-manual'"/>
<xsl:template match="book">
<document>
<header>
<title><xsl:value-of select="$title"/></title>
</header>
<body>
<xsl:apply-templates select="menu|menu-item"/>
</body>
</document>
</xsl:template>
<xsl:template match="menu">
<section>
<title><xsl:value-of select="@label"/></title>
<xsl:apply-templates/>
</section>
</xsl:template>
<xsl:template match="menu-item[@type='hidden']"/> <!-- Ignore hidden items -->
<xsl:template match="menu-item[contains(@href, '#')]"/> <!-- Ignore #frag-id items -->
<xsl:template match="menu-item[starts-with(@href, 'http:')]"/> <!-- Ignore absolute http urls -->
<xsl:template match="menu-item[starts-with(@href, 'https:')]"/> <!-- Ignore absolute https urls -->
<xsl:template match="menu-item[starts-with(@href, $ignore)]"/> <!-- Ignore the aggregated pages -->
<!-- Recursive template to collate @href's -->
<xsl:template name="absolute-href">
<xsl:param name="node"/>
<!-- Only append ancestor hrefs if we're not a http(s): URL -->
<xsl:if test="not(starts-with($node/@href, 'http:') or starts-with($node/@href, 'https:'))">
<xsl:if test="$node/../@href">
<xsl:call-template name="absolute-href">
<xsl:with-param name="node" select="$node/.."/>
</xsl:call-template>
</xsl:if>
</xsl:if>
<xsl:value-of select="$node/@href"/>
</xsl:template>
<xsl:template match="menu-item">
<section>
<xsl:attribute name="id">
<xsl:text></xsl:text><xsl:value-of select="@href"/>
</xsl:attribute>
<cinclude:include>
<xsl:attribute name="src">
<xsl:text>cocoon://</xsl:text>
<!-- This isn't necessary if reading source from cocoon://book-*.xml
<xsl:call-template name="absolute-href">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
-->
<xsl:value-of select="concat(substring-before(@href, '.'), '.xml')"/>
</xsl:attribute>
</cinclude:include>
</section>
</xsl:template>
</xsl:stylesheet>
1.1 xml-forrest/src/resources/stylesheets/aggregates/doc2doc-uniqueids.xsl
Index: doc2doc-uniqueids.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cinclude="http://apache.org/cocoon/include/1.0"
exclude-result-prefixes="cinclude">
<xsl:key name="node-id" match="*" use="@id"/>
<!-- If we encounter a section with an @id, make that @id globally unique by
prefixing the id of the current document -->
<xsl:template match="section/document//@id">
<xsl:attribute name="id"><xsl:value-of select="concat(ancestor::section/@id, '#', .)"/></xsl:attribute>
</xsl:template>
<!-- Make #fragment-id references inside each page globally unique -->
<xsl:template match="section/document//link/@href[starts-with(., '#')]">
<xsl:attribute name="href"><xsl:value-of select="concat('#', ancestor::section/@id, .)"/></xsl:attribute>
</xsl:template>
<!-- Translate relative links like 'index.html' to '#index.html' -->
<xsl:template match="section/document//link/@href[contains(., '.html')]">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:include href="copyover.xsl"/>
</xsl:stylesheet>
1.1 xml-forrest/src/resources/stylesheets/aggregates/docs2document.xsl
Index: docs2document.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="section/document">
<title><xsl:value-of select="header/title"/></title>
<xsl:copy-of select="body/node()" />
</xsl:template>
<xsl:include href="copyover.xsl"/>
</xsl:stylesheet>
1.1 xml-forrest/src/resources/stylesheets/aggregates/relativize-split-linkmap.xsl
Index: relativize-split-linkmap.xsl
===================================================================
<?xml version="1.0"?>
<!--
This stylesheet is a variant of relativize-linkmap.xsl that handles the case
where a set of nodes have been aggregated into the content for the current page
($path). Any node may be inside or outside the aggregation set.
For nodes inside the aggregation set, links are prepended with '#' (to form an
internal anchor).
For nodes outside the aggregation set, links are made relative to the context
root (either absolute or relative).
For instance, if we have:
<about label="About">
<index label="Index" href="index.html"/>
<who label="Who we are" href="who.html"/>
<dreams label="Dream list" href="dreams.html" tab="mytab"/>
<faq label="FAQs" href="faq.html" tab="mytab"/>
<changes label="Changes" href="changes.html"/>
<todo label="Todo" href="todo.html" tab="mytab"/>
</about>
Nodes 'dreams', 'faq' and 'todo' are inside the 'mytab' aggregation. If $path
was 'faq.html', then the generated linkmap would be:
<about label="About">
<index label="Index" href="index.html"/>
<who label="Who we are" href="who.html"/>
<dreams label="Dream list" href="#dreams.html" tab="mytab"/>
<faq label="FAQs" href="#faq.html" tab="mytab"/>
<changes label="Changes" href="changes.html"/>
<todo label="Todo" href="#todo.html" tab="mytab"/>
</about>
Where links like '#dreams.html' are assumed to be anchors in the aggregated
document.
Jeff Turner <je...@apache.org>
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="path"/>
<xsl:param name="site-root" select="'http://localhost:8787/forrest/'"/>
<xsl:variable name="tab">
<xsl:value-of select="string(//*[starts-with(@href, $path)]/@tab)"/>
</xsl:variable>
<xsl:include href="dotdots.xsl"/>
<!-- Path to site root, eg '../../' -->
<xsl:variable name="root">
<xsl:call-template name="dotdots">
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:variable>
<xsl:template match="@href">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="starts-with(., 'http:') or starts-with(., 'https:')">
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="$tab='' or ../@tab=$tab">
<xsl:value-of select="concat('#', .)"/>
</xsl:when>
<xsl:when test="contains($path, '.pdf')">
<!-- Links to outside a PDF are all absolute -->
<xsl:value-of select="concat($site-root, .)"/>
</xsl:when>
<xsl:otherwise>
<!-- Links outside a HTML are relative -->
<xsl:value-of select="$root"/><xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:include href="copyover.xsl"/>
</xsl:stylesheet>