added initial plugins
git-svn-id: https://svn.apache.org/repos/asf/forrest/branches/dispatcher@367809 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/build.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/build.xml
new file mode 100644
index 0000000..4505cbc
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/build.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<project default="docs" basedir="." name="Forrest plugin build file">
+
+ <property name="plugin-name" value="org.apache.forrest.plugin.internal.structurer"/>
+ <property name="forrest.version" value="0.7"/>
+ <property name="type" value="internal"/>
+ <property name="plugin-version" value="0.1-dev"/>
+ <property name="description" value="Second generation skinning."/>
+ <property name="author" value="Apache Forrest Project"/>
+ <property name="websiteURL" value="http://forrest.apache.org/docs/plugins/org.apache.forrest.plugin.internal.vstructurer/"/>
+ <property name="downloadURL" value="http://forrest.apache.org/plugins/"/>
+
+ <import file="../build.xml"/>
+
+ <!-- Add any additional installation work here in the build target, for example:
+ <target name="build"
+ description="Extract the tools">
+ <unzip dest="${plugins.localDeploy-dir}/${plugin-name}/resources">
+ <fileset dir="tools">
+ <include name="pluginBionaryTools.zip"/>
+ </fileset>
+ </unzip>
+ </target>
+ -->
+</project>
+
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap b/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap
new file mode 100644
index 0000000..e168c54
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap
@@ -0,0 +1,127 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:pipes default="caching"/>
+ <map:generators default="file" />
+ <map:transformers default="xslt" />
+ <map:serializers default="xml" />
+ </map:components>
+ <map:pipelines>
+
+ <!--
+ businessHelper
+ This is the model producing factory.
+ -->
+ <map:pipeline>
+ <!-- intermediate format link rewritten-->
+ <map:match pattern="**.source.rewritten.xml">
+ <map:generate src="cocoon://{1}.xml" />
+ <map:transform type="idgen" />
+ <map:transform type="xinclude" />
+ <map:transform type="linkrewriter"
+ src="cocoon://structurer-linkmap.{1}" />
+ <map:transform src="{lm:transform.html.broken-links}"/>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <!-- HTML rendered from intermediate format -->
+ <map:match pattern="**.body.xml">
+ <map:generate src="cocoon:/{1}.source.rewritten.xml" />
+ <map:transform src="{lm:dataModel-html-document-to-html.xsl}">
+ <map:parameter name="path" value="{1}.html" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <!-- TOC from source.rewritten-->
+ <map:match pattern="**.toc.xml">
+ <map:generate src="cocoon:/{1}.source.rewritten.xml" />
+ <map:transform src="{lm:dataModel-xml-document-to-toc.xsl}" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <map:match pattern="**.abstract.xml">
+ <map:generate src="cocoon://{1}.xml" />
+ <map:transform
+ src="{lm:dataModel-xml-document-to-abstract.xsl}" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <map:match pattern="**.authors.xml">
+ <map:generate src="cocoon://{1}.xml" />
+ <map:transform src="{lm:dataModel-xml-document-to-authors.xsl}" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <map:match pattern="**.title.xml">
+ <map:generate src="cocoon://{1}.xml" />
+ <map:transform src="{lm:dataModel-xml-document-to-title.xsl}" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <!-- navigation for the current request -->
+ <map:match pattern="*.navigation.xml">
+ <map:aggregate element="navigation">
+ <map:part src="cocoon:/tab-{1}.html" element="tab" />
+ <map:part src="cocoon:/menu-{1}.html" element="menu" />
+ </map:aggregate>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <map:match pattern="**/*.navigation.xml">
+ <map:aggregate element="navigation">
+ <map:part src="cocoon:/{1}/tab-{2}.html" element="tab" />
+ <map:part src="cocoon:/{1}/menu-{2}.html" element="menu" />
+ </map:aggregate>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <!-- navigation for the current request PART menu-->
+ <map:match pattern="**book-*.html">
+ <map:mount uri-prefix="" src="menu.xmap" check-reload="yes" />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <map:match pattern="**menu-*.html">
+ <map:generate src="cocoon:/{1}book-{2}.html" />
+ <map:transform type="linkrewriter"
+ src="cocoon://{1}linkmap-{2}.html" />
+ <map:transform src="{lm:transform.html.broken-links}"/>
+ <map:transform src="{lm:dataModel-html-book-to-menu.xsl}">
+ <map:parameter name="path" value="{1}{2}.html" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <!-- navigation for the current request PART tab-->
+ <map:match pattern="**tab-*.html">
+ <map:mount uri-prefix="" src="tabs.xmap" check-reload="yes" />
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/forrest.properties b/plugins/org.apache.forrest.plugin.internal.dispatcher/forrest.properties
new file mode 100644
index 0000000..ca46730
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/forrest.properties
@@ -0,0 +1,28 @@
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed 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.
+
+##############
+# This is a minimal properties file.
+# These are defaults, un-comment them only if you need to change them.
+# See the full set of default properties in a 'forrest seed-sample' site.
+# Copy properties from there as needed.
+##############
+
+project.skin=leather-dev
+
+project.theme-extension=.fv
+project.theme=leather-dev
+
+project.required.plugins=org.apache.forrest.plugin.internal.structurer,org.apache.forrest.plugin.output.themer,org.apache.forrest.plugin.input.projectInfo
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap b/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
new file mode 100644
index 0000000..5b49057
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
@@ -0,0 +1,231 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!-- forrest:structurer
+ ***********************
+ The structuring of the assembled page where all content is in place
+ and structured with forrest:hooks to provide hooks for theming.
+
+ It is the job of a forrest:structurer to define this structure. The
+ structurer uses for this a couple of helper classes forrest:contracts,
+ forrest:hooks and forrest:properties. But there is more to a
+ forrest:structurer than just structure.
+
+ The structurer is not limited to a document but can request and
+ structure the content from multiple input sources. Far more actually
+ because it provides as well logical conditions for presentation formatting logic
+-->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:pipes default="caching">
+ <map:pipe name="caching"
+ src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline" />
+ <map:pipe name="noncaching"
+ src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline" />
+ </map:pipes>
+ <map:selectors>
+ <map:selector logger="sitemap.selector.exists" name="exists"
+ src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+ </map:selectors>
+ <map:generators default="file">
+ <map:generator name="traverse"
+ src="org.apache.cocoon.generation.TraversableGenerator"
+ logger="sitemap.generator.traverse" label="content"
+ pool-max="16" />
+<map:generator label="content" logger="sitemap.generator.xpathdirectory" name="xpathdirectory" src="org.apache.cocoon.generation.XPathDirectoryGenerator"/>
+ <map:generator name="directory"
+ src="org.apache.cocoon.generation.DirectoryGenerator" />
+ <!--map:generator name="jx" logger="sitemap.generator.jx"
+ src="org.apache.cocoon.template.JXTemplateGenerator"
+ label="content,data" pool-max="16"-->
+ <map:generator name="jx" logger="sitemap.generator.jx"
+ src="org.apache.cocoon.generation.JXTemplateGenerator"
+ label="content,data" pool-max="16" />
+
+ </map:generators>
+ <map:transformers default="xslt">
+ <map:transformer logger="sitemap.transformer.jx" name="jx"
+ pool-max="16"
+ src="org.apache.cocoon.transformation.JXTemplateTransformer" />
+ <map:transformer logger="sitemap.transformer.jpath" name="jpath"
+ src="org.apache.cocoon.transformation.JPathTransformer" />
+ <map:transformer name="cinclude"
+ src="org.apache.cocoon.transformation.CIncludeTransformer" />
+ <map:transformer name="xinclude"
+ src="org.apache.cocoon.transformation.XIncludeTransformer" />
+ <!-- Rewrites links, e.g. transforming href="site:index" to href="../index.html" -->
+ <!-- See http://forrest.apache.org/docs/sitemap-ref.html#linkrewriting_impl -->
+ <map:transformer name="linkrewriter"
+ logger="sitemap.transformer.linkrewriter"
+ src="org.apache.cocoon.transformation.LinkRewriterTransformer">
+ <link-attrs>href src</link-attrs>
+ <schemes>site ext lm</schemes>
+ <input-module name="lm" />
+ <input-module name="site">
+ <input-module name="linkmap">
+ <file src="{src}" reloadable="true" />
+ </input-module>
+ <prefix>/site//</prefix>
+ <suffix>/@href</suffix>
+ </input-module>
+ <input-module name="ext">
+ <input-module name="linkmap">
+ <file src="{src}" reloadable="true" />
+ </input-module>
+ <prefix>/site/external-refs//</prefix>
+ <suffix>/@href</suffix>
+ </input-module>
+ </map:transformer>
+ </map:transformers>
+ <map:serializers default="xml">
+ <map:serializer logger="sitemap.serializer.xhtml"
+ mime-type="text/html" name="xhtml" pool-grow="2" pool-max="64"
+ pool-min="2"
+ src="org.apache.cocoon.serialization.XMLSerializer">
+ <doctype-public>
+ -//W3C//DTD XHTML 1.0 Strict//EN
+ </doctype-public>
+ <doctype-system>
+ http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
+ </doctype-system>
+ <encoding>UTF-8</encoding>
+ </map:serializer>
+ <map:serializer name="text"
+ src="org.apache.cocoon.serialization.TextSerializer"
+ mime-type="text/plain" logger="sitemap.serializer.text" />
+ </map:serializers>
+ </map:components>
+ <map:pipelines>
+ <map:pipeline>
+ <!-- businessHelper -->
+ <map:mount uri-prefix="" src="dataModel.xmap" check-reload="yes"
+ pass-through="true" />
+ </map:pipeline>
+ <!-- linkmap -->
+ <map:pipeline>
+ <map:mount uri-prefix="" src="linkmap.xmap" check-reload="yes"
+ pass-through="true" />
+ </map:pipeline>
+ <map:pipeline>
+ <map:mount uri-prefix="" src="themer.xmap" check-reload="yes"
+ pass-through="true" />
+ </map:pipeline>
+ <!--
+ structurer
+ prepares and transforms the requested contracts (themes) and populate them with the content (businessHelper).
+ -->
+ <!-- Structurer population
+ a. Resolve request specific strucuturer template.
+ b. Add businessHelper and tiles to the presentation model
+ that the content can be used later on.
+ {1} - requested url (striped from extension) -->
+ <map:pipeline>
+ <map:match pattern="prepare.structurer.*.**">
+ <map:generate src="{lm:resolve.structurer.{2}}" />
+ <map:transform src="{lm:get.structurer.by.requested.format.xsl}">
+ <map:parameter name="format" value="{1}" />
+ </map:transform>
+ <!-- FIXME: jxpath -->
+ <!-- When jxpath problem is solved rewrite tiles and uncomment -->
+ <map:transform type="linkrewriter" />
+ <map:transform type="jx">
+ <map:parameter name="lenient-xpath" value="true" />
+ <map:parameter name="getRequest" value="{2}" />
+ <map:parameter name="getRequestExstension" value="{1}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <!-- You can group elements to a template and call it from any view.
+ <jx:import uri="cocoon://prepare.tiles.export-link"/>
+ -->
+ <map:pipeline>
+ <map:match pattern="prepare.tiles.**">
+ <map:generate src="{lm:resolve.tiles.{1}}" />
+ <!-- FIXME: jxpath -->
+ <!-- When jxpath problem is solved rewrite tiles and uncomment -->
+ <!-- <map:transform type="linkrewriter" /> -->
+ <map:transform type="jx">
+ <map:parameter name="lenient-xpath" value="true" />
+ <map:parameter name="getRequest" value="{1}" />
+ </map:transform>
+ <map:transform src="{lm:root-strip.xsl}" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+
+ <map:pipeline>
+ <!--
+ Aggregate the forrest:properties requested by the *.fv.
+ The result is an aggregation of properties which defines the templates to be call.
+ {1} - format
+ {2} - requested url
+ -->
+ <map:match pattern="prepare.structurer-properties.*.**">
+ <map:generate src="{lm:structurer.{1}.{2}}" />
+ <map:transform src="{lm:structurer-properties-includes.xsl}">
+ <map:parameter name="format" value="{1}" />
+ </map:transform>
+ <map:transform type="cinclude" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <map:pipeline>
+ <!--
+ Aggregate all contracts-templates requested by the view.
+ The result is a stylesheet with all needed xsl:templates.
+ Creates all xsl that can be used for the last step of the transformation.
+ {1} - format
+ {2} - requested url
+ -->
+ <map:match pattern="structurer-xsl.*.**">
+ <map:aggregate element="filter">
+ <map:part src="{lm:structurer.{1}.{2}}" />
+ <map:part src="{lm:structurer-properties.{1}.{2}}" />
+ </map:aggregate>
+ <map:transform src="{lm:structurer-final-xsl-{1}.xsl}">
+ <map:parameter name="request" value="{2}" />
+ <map:parameter name="forrestContext"
+ value="{forrest:context}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+<map:pipeline>
+ <!--
+ Last processing step.
+ Here we are overriding the default skin generation.
+ -->
+ <map:match pattern="**.html">
+ <map:generate src="{lm:structurer.html.{1}}" />
+ <map:transform src="{lm:structurer-xsl.html.{1}.xsl}">
+ <map:parameter name="path" value="{0}" />
+ </map:transform>
+ <!-- WORKAROUND The following transfomer are responsible for generating links for inline css It produces non valid css!!!-->
+ <!-- FIXME make contracts self containing and open them for css-->
+ <map:transform type="pattern"
+ src="{forrest:context}/resources/chaperon/grammars/link.xlex" />
+ <map:transform
+ src="{forrest:context}/resources/chaperon/stylesheets/pattern2link.xsl" />
+ <map:transform src="{lm:transform.xml.xml-namespace-stripped}" />
+ <map:serialize type="xhtml" />
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/databases-block.jar b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/databases-block.jar
new file mode 100644
index 0000000..a1a11e4
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/databases-block.jar
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/eventcache-block.jar b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/eventcache-block.jar
new file mode 100644
index 0000000..855d7d8
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/eventcache-block.jar
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/jms-block.jar b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/jms-block.jar
new file mode 100644
index 0000000..38caac6
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/jms-block.jar
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/readme.txt b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/readme.txt
new file mode 100644
index 0000000..9379f31
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/readme.txt
@@ -0,0 +1 @@
+Place any libraries required by your plugin in this directory.
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/repository-block.jar b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/repository-block.jar
new file mode 100644
index 0000000..c220dc9
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/lib/repository-block.jar
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/linkmap.xmap b/plugins/org.apache.forrest.plugin.internal.dispatcher/linkmap.xmap
new file mode 100644
index 0000000..94f3717
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/linkmap.xmap
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!-- =================================================
+'linkmap' pipeline. A linkmap is a map from abstract ('site:index') to
+physical ('../index.html') links for the current page.
+
+Generates : Variant of site.xml with each @href being the link to that page from the current page.
+Example URL: http://localhost:8888/docs/community/linkmap-index.html (links for community/index.html)
+Used by : The linkrewriter transformer
+Uses : content/xdocs/site.xml
+
+See http://forrest.apache.org/docs/sitemap-ref.html#menu_xml_generation
+
+$Revision: 1.2 $
+==================================================== -->
+
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:generators default="file"/>
+ <map:serializers default="xml"/>
+ <map:transformers default="xslt"/>
+ <map:matchers default="wildcard"/>
+ </map:components>
+
+ <map:pipelines>
+ <map:pipeline>
+ <!-- Linkmap for regular pages -->
+ <map:match pattern="structurer-linkmap.**">
+ <map:generate src="cocoon://abs-linkmap" />
+ <map:transform src="{lm:transform.linkmap.linkmap-relativized}">
+ <map:parameter name="path" value="{1}" />
+ <map:parameter name="site-root" value="{conf:project-url}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ <!-- site.xml with @href's appended to be context-relative. -->
+ <map:match pattern="abs-linkmap">
+ <map:generate src="cocoon://site.navigation.links.xml"/>
+ <map:transform type="xinclude"/>
+ <map:transform src="{lm:transform.xml.xml-namespace-stripped}" />
+ <map:transform src="{lm:transform.linkmap.linkmap-absolutized}" />
+ <map:serialize type="xml" />
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+
+</map:sitemap>
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
new file mode 100644
index 0000000..05f1217
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!-- Default Forrest locationmap for the structurer/themer -->
+
+<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
+
+ <components>
+ <matchers default="lm">
+ <matcher
+ name="lm"
+ src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
+ </matchers>
+ <actions default="RecursiveDirectoryTraversalAction">
+ <action name="RecursiveDirectoryTraversalAction"
+ src="org.apache.forrest.structurer.acting.RecursiveDirectoryTraversalAction"/>
+ </actions>
+ <selectors default="exists">
+ <selector name="exists" logger="sitemap.selector.exists"
+ src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+ </selectors>
+ </components>
+
+ <locator>
+ <!-- xhtml2 to html core transformation -->
+ <match pattern="transform.xhtml2.html.structurer">
+ <select>
+ <location src="{project:structurer}/resources/stylesheets/html/xhtml2_to_html.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/html/xhtml2_to_html.xsl" />
+ </select>
+ </match>
+ <!-- File specific strucuturer templates have priority before default ones. If no strucuturer template
+ can be found in the project, we use either the theme or the default one of the themes plugin. -->
+ <match pattern="resolve.structurer.**">
+ <select type="exists">
+ <!-- project-based file-based -->
+ <location src="{project:content.xdocs}{1}{project:theme-ext}" />
+ <!-- @src="" workaround for action bug in the locationmap! -->
+ <act type="RecursiveDirectoryTraversalAction" src="">
+ <parameter value="{1}" name="request"/>
+ <parameter value="{project:theme}" name="projectFallback"/>
+ <parameter value="{project:theme-ext}" name="projectExtension"/>
+ <parameter value="{project:content.xdocs}" name="projectDir"/>
+ <!-- project-based theme-based = directory-based / parent-directory based (recursively) -->
+ <location src="{uri}" />
+ </act>
+ <!-- themes-dir: project-application-based theme-dir-based -->
+ <location
+ src="{lm:themer.project.dir}/{project:theme}{project:theme-ext}"
+ />
+ <!-- themer: project-application-based theme-based -->
+ <location
+ src="{project:themer}/resources/themes/{project:theme}{project:theme-ext}"
+ />
+ <!-- themes-dir: project-application-based default -->
+ <location
+ src="{lm:themer.project.dir}/{defaults:theme}{defaults:theme-ext}"
+ />
+ <!-- themer: project-application-based default -->
+ <location
+ src="{project:themer}/resources/themes/{defaults:theme}{defaults:theme-ext}"
+ />
+ <!-- themer: forrest-application-based theme-based -->
+ <location
+ src="{defaults:themer}/resources/themes/{project:theme}{project:theme-ext}"
+ />
+ <!-- themer: forrest-application-based default -->
+ <location
+ src="{defaults:themer}/resources/themes/{defaults:theme}{defaults:theme-ext}"
+ />
+ </select>
+ </match>
+ <match pattern="get.structurer.by.requested.format.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/get.structurer.by.requested.format.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/get.structurer.by.requested.format.xsl" />
+ </select>
+ </match>
+ <!--
+ {1} format (e.g. html)
+ {2} path (e.g. samples/index)
+ -->
+ <match pattern="structurer.*.**">
+ <select type="exists">
+ <location src="cocoon://prepare.structurer.{1}.{2}" />
+ </select>
+ </match>
+ <!-- Structurer tiles - You can group elements to a template and call it from any view. -->
+ <match pattern="resolve.tiles.**">
+ <select type="exists">
+ <location
+ src="{project:resources}/themes/{project:theme}/html/{1}.vt.xml" />
+ <location
+ src="{project:resources}/themes/{defaults:theme}/html/{1}.vt.xml" />
+ <location
+ src="{project:themer}/resources/themes/{project:theme}/html/{1}.vt.xml"
+ />
+ <location
+ src="{project:themer}/resources/themes/{defaults:theme}/html/{1}.vt.xml"
+ />
+ <location
+ src="{defaults:themer}/resources/themes/{project:theme}/html/{1}.vt.xml"
+ />
+ <location
+ src="{defaults:themer}/resources/themes/{defaults:theme}/html/{1}.vt.xml"
+ />
+ </select>
+ </match>
+ <!-- FIXME: jxpath locationmap-->
+ <!-- Structurer tiles should be requested by (when jxpath bug is solved!): -->
+ <match pattern="tiles.**">
+ <select type="exists">
+ <location src="cocoon://prepare.tiles.{1}" />
+ </select>
+ </match>
+ <!-- Aggregate the forrest:properties requested by the *.fv. -->
+ <!--
+ {1} format (e.g. html)
+ {2} path (e.g. samples/index)
+ -->
+ <match pattern="structurer-properties.*.**">
+ <select type="exists">
+ <location src="cocoon://prepare.structurer-properties.{1}.{2}" />
+ </select>
+ </match>
+ <!-- Some input need to be striped by their root element. -->
+ <match pattern="root-strip.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/root-strip.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/root-strip.xsl" />
+ </select>
+ </match>
+ <!-- Aggregate the forrest:properties requested by the *.fv with cinclude. -->
+ <match pattern="structurer-properties-includes.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/prepare.properties.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/prepare.properties.xsl" />
+ </select>
+ </match>
+ <!-- Doing the transformation of all contracts-templates requested by the view. -->
+ <match pattern="structurer-final-xsl-*.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/themer.{1}.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/themer.{1}.xsl" />
+ </select>
+ </match>
+ <!-- Doing the transformation of all contracts-templates requested by the view. -->
+ <match pattern="structurer-xsl.html.**.xsl">
+ <select type="exists">
+ <location src="cocoon://structurer-xsl.html.{1}" />
+ </select>
+ </match>
+ </locator>
+</locationmap>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/menu.xmap b/plugins/org.apache.forrest.plugin.internal.dispatcher/menu.xmap
new file mode 100644
index 0000000..de97ccb
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/menu.xmap
@@ -0,0 +1,133 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!-- ===============================================
+'book.xml' pipeline, which generates XML that becomes the menu.
+
+Generates : Menulinks XML: Variant of site.xml that will become the menu for the current page.
+Generates : Book HTML: A HTML menu for the current page.
+Example URL: http://localhost:8888/community/menulinks-index.html (menu links for community/index.html)
+Example URL: http://localhost:8888/community/book-index.html (menu for community/index.html)
+Used by : **/menu-*.html in sitemap.xmap,
+Uses : content/xdocs/site.xml, or book.xml file if present.
+
+See http://forrest.apache.org/docs/sitemap-ref.html#menu_xml_generation
+
+$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="i18n"
+ src="org.apache.cocoon.transformation.I18nTransformer">
+ <catalogues default="menu">
+ <catalogue id="menu" name="menu" location="{project:translations}"/>
+ </catalogues>
+ <!-- Commented out to verify your translations
+ <untranslated-text>untranslated</untranslated-text> -->
+ <cache-at-startup>true</cache-at-startup>
+ </map:transformer>
+ </map:transformers>
+ <map:matchers default="wildcard"/>
+ <map:selectors>
+ <map:selector logger="sitemap.selector.config" name="config"
+ src="org.apache.cocoon.selection.SimpleSelector" />
+ </map:selectors>
+ <map:actions>
+ <map:action name="locale" src="org.apache.cocoon.acting.LocaleAction" />
+ </map:actions>
+ </map:components>
+ <map:pipelines>
+ <!-- ============================================================ -->
+ <!-- SOURCE FORMATS -->
+ <!-- ============================================================ -->
+ <map:pipeline internal-only="false">
+ <map:match pattern="abs-menulinks">
+ <map:generate src="cocoon://site.navigation.links.xml"/>
+ <map:transform type="xinclude"/>
+ <map:transform src="{forrest:stylesheets}/absolutize-linkmap.xsl" />
+ <map:transform src="{forrest:stylesheets}/site-to-site-normalizetabs.xsl"
+ />
+ <map:transform src="{forrest:stylesheets}/normalizehrefs.xsl"/>
+ <map:serialize type="xml"/>
+ </map:match>
+ <map:match pattern="**menulinks-*">
+ <map:generate src="cocoon://site.navigation.links.xml"/>
+ <map:transform type="xinclude"/>
+ <map:transform src="{forrest:stylesheets}/absolutize-linkmap.xsl" />
+ <map:select type="config">
+ <map:parameter name="value" value="{defaults:menu-scheme}"/>
+ <map:when test="tab_attributes">
+ <map:transform
+ src="{forrest:stylesheets}/site-to-site-normalizetabs.xsl" />
+ <map:transform src="{forrest:stylesheets}/normalizehrefs.xsl"/>
+ <map:transform src="{forrest:stylesheets}/site-to-site-selectnode.xsl">
+ <map:parameter name="path" value="{1}{2}"/>
+ </map:transform>
+ </map:when>
+ <map:when test="directories">
+ <map:transform type="xpath">
+ <map:parameter name="include" value="//*[@href='{1}']" />
+ </map:transform>
+ </map:when>
+ </map:select>
+ <map:transform src="{forrest:stylesheets}/relativize-linkmap.xsl">
+ <map:parameter name="path" value="{1}{2}" />
+ </map:transform>
+ <map:serialize type="xml" />
+ </map:match>
+ </map:pipeline>
+ <!-- ============================================================ -->
+ <!-- INTERMEDIATE FORMATS -->
+ <!-- ============================================================ -->
+ <map:pipeline>
+ <map:match pattern="**book-*">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}{1}book.xml">
+ <!-- If a hand-created book.xml exists, use it -->
+ <map:parameter name="url"
+ value="{project:content.xdocs}{1}book.xml" />
+ <map:generate src="{project:content.xdocs}{1}book.xml" />
+ </map:when>
+ <map:otherwise>
+ <!-- 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="{forrest:stylesheets}/site-to-book.xsl" />
+ </map:otherwise>
+ </map:select>
+ <map:select type="config">
+ <map:parameter name="value" value="{defaults:i18n}"/>
+ <map:when test="true">
+ <map:act type="locale">
+ <map:transform src="{forrest:stylesheets}/i18n.xsl"/>
+ <map:transform type="i18n">
+ <!-- We can use a default locale attribute or Request Parameter
+ <map:parameter name="locale" value="{defaults:locale}"/>
+ <map:parameter name="locale" value="{lang}{country}{variant}"-->
+ <map:parameter name="locale" value="{request:locale}"/>
+ </map:transform>
+ </map:act>
+ </map:when>
+ </map:select>
+ <map:serialize type="xml"/>
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/screenshots/index.html.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/screenshots/index.html.png
new file mode 100644
index 0000000..7e963ea
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/screenshots/index.html.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/css/forrest.css.xslt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/css/forrest.css.xslt
new file mode 100644
index 0000000..7fce391
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/css/forrest.css.xslt
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- This is not used by Forrest but makes it possible to debug the
+ stylesheet in standalone editors -->
+ <xsl:output method = "text" omit-xml-declaration="yes" />
+
+<!--
+ If the skin doesn't override this, at least aural styles
+ and extra-css are present
+-->
+ <xsl:template match="skinconfig">
+
+ <xsl:call-template name="aural"/>
+ <xsl:call-template name="a-external"/>
+ <xsl:apply-templates/>
+ <xsl:call-template name="add-extra-css"/>
+ </xsl:template>
+
+ <xsl:template match="colors">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template name="aural">
+
+/* ==================== aural ============================ */
+
+@media aural {
+ h1, h2, h3, h4, h5, h6 { voice-family: paul, male; stress: 20; richness: 90 }
+ h1 { pitch: x-low; pitch-range: 90 }
+ h2 { pitch: x-low; pitch-range: 80 }
+ h3 { pitch: low; pitch-range: 70 }
+ h4 { pitch: medium; pitch-range: 60 }
+ h5 { pitch: medium; pitch-range: 50 }
+ h6 { pitch: medium; pitch-range: 40 }
+ li, dt, dd { pitch: medium; richness: 60 }
+ dt { stress: 80 }
+ pre, code, tt { pitch: medium; pitch-range: 0; stress: 0; richness: 80 }
+ em { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
+ strong { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
+ dfn { pitch: high; pitch-range: 60; stress: 60 }
+ s, strike { richness: 0 }
+ i { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
+ b { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
+ u { richness: 0 }
+
+ :link { voice-family: harry, male }
+ :visited { voice-family: betty, female }
+ :active { voice-family: betty, female; pitch-range: 80; pitch: x-high }
+}
+ </xsl:template>
+
+ <xsl:template name="a-external">
+a.external {
+ padding: 0 20px 0px 0px;
+ display:inline;
+ background-repeat: no-repeat;
+ background-position: center right;
+ background-image: url(images/external-link.gif);
+}
+ </xsl:template>
+
+ <xsl:template name="add-extra-css">
+ <xsl:text>/* extra-css */</xsl:text>
+ <xsl:value-of select="extra-css"/>
+ </xsl:template>
+
+ <xsl:template match="*"></xsl:template>
+ <xsl:template match="text()"></xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/README.txt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/README.txt
new file mode 100644
index 0000000..e0932f4
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/README.txt
@@ -0,0 +1 @@
+The images in this directory are used if the current skin lacks them.
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/add.jpg b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/add.jpg
new file mode 100644
index 0000000..06831ee
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/add.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/built-with-forrest-button.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/built-with-forrest-button.png
new file mode 100644
index 0000000..4a787ab
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/built-with-forrest-button.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/corner-imports.svg.xslt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/corner-imports.svg.xslt
new file mode 100644
index 0000000..3c335b4
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/corner-imports.svg.xslt
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="orientation-tb"/>
+ <xsl:param name="orientation-lr"/>
+ <xsl:param name="size"/>
+ <xsl:param name="bg-color-name"/>
+ <xsl:param name="stroke-color-name"/>
+ <xsl:param name="fg-color-name"/>
+
+ <!-- if not all colors are present, don't even try to render the corners -->
+ <xsl:variable name="isize"><xsl:choose>
+ <xsl:when test="$bg-color-name and $stroke-color-name and $fg-color-name"><xsl:value-of select="$size"/></xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose></xsl:variable>
+ <xsl:variable name="smallersize" select="number($isize)-1"/>
+ <xsl:variable name="biggersize" select="number($isize)+1"/>
+ <xsl:variable name="bg"><xsl:if test="skinconfig/colors/color[@name=$bg-color-name]">fill:<xsl:value-of select="skinconfig/colors/color[@name=$bg-color-name]/@value"/>;</xsl:if></xsl:variable>
+ <xsl:variable name="fill"><xsl:if test="skinconfig/colors/color[@name=$stroke-color-name]">fill:<xsl:value-of select="skinconfig/colors/color[@name=$stroke-color-name]/@value"/>;</xsl:if></xsl:variable>
+ <xsl:variable name="stroke"><xsl:if test="skinconfig/colors/color[@name=$fg-color-name]">stroke:<xsl:value-of select="skinconfig/colors/color[@name=$fg-color-name]/@value"/>;</xsl:if></xsl:variable>
+
+ <xsl:template match="skinconfig">
+
+
+
+<svg width="{$isize}" height="{$isize}">
+ <!-- background-->
+ <rect x="-1" y="-1" width="{$biggersize}" height="{$biggersize}" style="{$bg}stroke-width:0"/>
+<!-- 0,0 0,-4 4,0 4,-4-->
+
+ <xsl:variable name="flip-tb-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-lr-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-tb-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-lr-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- flip transform -->
+ <g transform="scale({$flip-lr-scale},{$flip-tb-scale}) translate({$flip-lr-translate}, {$flip-tb-translate})">
+ <xsl:call-template name="figure" />
+ </g>
+</svg>
+</xsl:template>
+
+
+ <xsl:template name="figure">
+ <!-- Just change shape here -->
+ <g transform="translate(0.5 0.5)">
+ <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ <!-- end -->
+ </xsl:template>
+
+
+ <xsl:template match="*"></xsl:template>
+ <xsl:template match="text()"></xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/dc.svg.xslt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/dc.svg.xslt
new file mode 100644
index 0000000..fb8cfb0
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/dc.svg.xslt
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:import href="corner-imports.svg.xslt" />
+
+ <!-- Diagonal 45 degrees corner -->
+ <xsl:template name="figure">
+ <xsl:variable name="biggersize" select="number($size)+number($size)"/>
+ <g transform="translate(0 0.5)">
+ <polygon points="0,{$size} {$size},0 {$biggersize},0 {$biggersize},{$biggersize} 0,{$biggersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/external-link.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/external-link.gif
new file mode 100644
index 0000000..ff2f7b2
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/external-link.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/fix.jpg b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/fix.jpg
new file mode 100644
index 0000000..1d6820b
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/fix.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/forrest-credit-logo.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/forrest-credit-logo.png
new file mode 100644
index 0000000..8a63e42
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/forrest-credit-logo.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/hack.jpg b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/hack.jpg
new file mode 100644
index 0000000..f38d50f
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/hack.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/pdfdoc.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/pdfdoc.gif
new file mode 100644
index 0000000..00dee28
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/pdfdoc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/poddoc.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/poddoc.png
new file mode 100644
index 0000000..a393df7
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/poddoc.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/poddoc.svg.xslt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/poddoc.svg.xslt
new file mode 100644
index 0000000..160d3da
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/poddoc.svg.xslt
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<svg width="20pt" height="20pt"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs
+ id="defs550">
+ <linearGradient id="gray2white">
+ <stop style="stop-color:#7f7f7f;stop-opacity:1;" offset="0.000000"/>
+ <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1.000000"/>
+ </linearGradient>
+ <linearGradient id="pageshade" xlink:href="#gray2white"
+ x1="0.95" y1="0.95"
+ x2="0.40" y2="0.20"
+ gradientUnits="objectBoundingBox" spreadMethod="pad" />
+ <path d="M 0 0 L 200 0" style="stroke:#000000;stroke-width:1pt;" id="hr"/>
+ </defs>
+
+ <g transform="scale(0.08)">
+ <g transform="translate(40, 0)">
+ <rect width="230" height="300" x="0" y="0"
+ style="fill:url(#pageshade);fill-rule:evenodd;
+ stroke:#000000;stroke-width:1.25;"/>
+
+ <g transform="translate(15, 60)">
+ <use xlink:href="#hr" x="0" y="0"/>
+ <use xlink:href="#hr" x="0" y="60"/>
+ <use xlink:href="#hr" x="0" y="120"/>
+ <use xlink:href="#hr" x="0" y="180"/>
+ </g>
+ </g>
+
+ <g transform="translate(0,70),scale(1.1,1.6)">
+ <rect width="200" height="100" x="0" y="0"
+ style="fill:#ff0000;fill-rule:evenodd;
+ stroke:#000000;stroke-width:2.33903;"/>
+ <text x="20" y="75"
+ style="stroke:#ffffff;stroke-width:1.0;
+ font-size:72;font-weight:normal;fill:#ffffff;
+ font-family:Arial;text-anchor:start;">POD</text>
+ </g>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/printer.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/printer.gif
new file mode 100644
index 0000000..5021187
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/printer.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/rc.svg.xslt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/rc.svg.xslt
new file mode 100644
index 0000000..fe097eb
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/rc.svg.xslt
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:import href="corner-imports.svg.xslt" />
+
+ <!-- Rounded corner -->
+ <xsl:template name="figure">
+ <g transform="translate(0.5 0.5)">
+ <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/remove.jpg b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/remove.jpg
new file mode 100644
index 0000000..8c9b9ef
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/remove.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/rss.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/rss.png
new file mode 100644
index 0000000..f0796ac
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/rss.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/spacer.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/spacer.gif
new file mode 100644
index 0000000..35d42e8
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/spacer.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/txtdoc.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/txtdoc.png
new file mode 100644
index 0000000..bf8b374
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/txtdoc.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/txtdoc.svg.xslt b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/txtdoc.svg.xslt
new file mode 100644
index 0000000..ebbdef5
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/txtdoc.svg.xslt
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<svg width="20pt" height="20pt"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs
+ id="defs550">
+ <linearGradient id="gray2white">
+ <stop style="stop-color:#7f7f7f;stop-opacity:1;" offset="0.000000"/>
+ <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1.000000"/>
+ </linearGradient>
+ <linearGradient id="pageshade" xlink:href="#gray2white"
+ x1="0.95" y1="0.95"
+ x2="0.40" y2="0.20"
+ gradientUnits="objectBoundingBox" spreadMethod="pad" />
+ <path d="M 0 0 L 200 0" style="stroke:#000000;stroke-width:1pt;" id="hr"/>
+ </defs>
+
+ <g transform="scale(0.08)">
+ <g transform="translate(40, 0)">
+ <rect width="230" height="300" x="0" y="0"
+ style="fill:url(#pageshade);fill-rule:evenodd;
+ stroke:#000000;stroke-width:1.25;"/>
+
+ <g transform="translate(15, 60)">
+ <use xlink:href="#hr" x="0" y="0"/>
+ <use xlink:href="#hr" x="0" y="60"/>
+ <use xlink:href="#hr" x="0" y="120"/>
+ <use xlink:href="#hr" x="0" y="180"/>
+ </g>
+ </g>
+
+ <g transform="translate(0,70),scale(1.1,1.6)">
+ <rect width="200" height="100" x="0" y="0"
+ style="fill:#ff0000;fill-rule:evenodd;
+ stroke:#000000;stroke-width:2.33903;"/>
+ <text x="20" y="75"
+ style="stroke:#ffffff;stroke-width:1.0;
+ font-size:72;font-weight:normal;fill:#ffffff;
+ font-family:Arial;text-anchor:start;">TXT</text>
+ </g>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/update.jpg b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/update.jpg
new file mode 100644
index 0000000..beb9207
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/update.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/valid-html401.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/valid-html401.png
new file mode 100644
index 0000000..3855210
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/valid-html401.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/vcss.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/vcss.png
new file mode 100644
index 0000000..9b2f596
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/vcss.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/xmldoc.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/xmldoc.gif
new file mode 100644
index 0000000..ca1224f
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/images/xmldoc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/breadcrumbs-optimized.js b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/breadcrumbs-optimized.js
new file mode 100644
index 0000000..dbef530
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/breadcrumbs-optimized.js
@@ -0,0 +1,90 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+var PREPREND_CRUMBS=new Array();
+var link1="@skinconfig.trail.link1.name@";
+var link2="@skinconfig.trail.link2.name@";
+var link3="@skinconfig.trail.link3.name@";
+if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link1, @skinconfig.trail.link1.href@ ) ); }
+if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link2, @skinconfig.trail.link2.href@ ) ); }
+if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link3, @skinconfig.trail.link3.href@ ) ); }
+var DISPLAY_SEPARATOR=" > ";
+var DISPLAY_PREPREND=" > ";
+var DISPLAY_POSTPREND=":";
+var CSS_CLASS_CRUMB="breadcrumb";
+var CSS_CLASS_TRAIL="breadcrumbTrail";
+var CSS_CLASS_SEPARATOR="crumbSeparator";
+var FILE_EXTENSIONS=new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
+var PATH_SEPARATOR="/";
+
+function sc(s) {
+ var l=s.toLowerCase();
+ return l.substr(0,1).toUpperCase()+l.substr(1);
+}
+function getdirs() {
+ var t=document.location.pathname.split(PATH_SEPARATOR);
+ var lc=t[t.length-1];
+ for(var i=0;i < FILE_EXTENSIONS.length;i++)
+ {
+ if(lc.indexOf(FILE_EXTENSIONS[i]))
+ return t.slice(1,t.length-1); }
+ return t.slice(1,t.length);
+}
+function getcrumbs( d )
+{
+ var pre = "/";
+ var post = "/";
+ var c = new Array();
+ if( d != null )
+ {
+ for(var i=0;i < d.length;i++) {
+ pre+=d[i]+postfix;
+ c.push(new Array(d[i],pre)); }
+ }
+ if(PREPREND_CRUMBS.length > 0 )
+ return PREPREND_CRUMBS.concat( c );
+ return c;
+}
+function gettrail( c )
+{
+ var h=DISPLAY_PREPREND;
+ for(var i=0;i < c.length;i++)
+ {
+ h+='<a href="'+c[i][1]+'" >'+sc(c[i][0])+'</a>';
+ if(i!=(c.length-1))
+ h+=DISPLAY_SEPARATOR; }
+ return h+DISPLAY_POSTPREND;
+}
+
+function gettrailXHTML( c )
+{
+ var h='<span class="'+CSS_CLASS_TRAIL+'">'+DISPLAY_PREPREND;
+ for(var i=0;i < c.length;i++)
+ {
+ h+='<a href="'+c[i][1]+'" class="'+CSS_CLASS_CRUMB+'">'+sc(c[i][0])+'</a>';
+ if(i!=(c.length-1))
+ h+='<span class="'+CSS_CLASS_SEPARATOR+'">'+DISPLAY_SEPARATOR+'</span>'; }
+ return h+DISPLAY_POSTPREND+'</span>';
+}
+
+if(document.location.href.toLowerCase().indexOf("http://")==-1)
+ document.write(gettrail(getcrumbs()));
+else
+ document.write(gettrail(getcrumbs(getdirs())));
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/breadcrumbs.js b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/breadcrumbs.js
new file mode 100644
index 0000000..52a7da7
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/breadcrumbs.js
@@ -0,0 +1,237 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * This script, when included in a html file, builds a neat breadcrumb trail
+ * based on its url. That is, if it doesn't contains bugs (I'm relatively
+ * sure it does).
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="breadcrumbs.js"></script>
+ */
+
+/**
+ * IE 5 on Mac doesn't know Array.push.
+ *
+ * Implement it - courtesy to fritz.
+ */
+var abc = new Array();
+if (!abc.push) {
+ Array.prototype.push = function(what){this[this.length]=what}
+}
+
+/* ========================================================================
+ CONSTANTS
+ ======================================================================== */
+
+/**
+ * Two-dimensional array containing extra crumbs to place at the front of
+ * the trail. Specify first the name of the crumb, then the URI that belongs
+ * to it. You'll need to modify this for every domain or subdomain where
+ * you use this script (you can leave it as an empty array if you wish)
+ */
+var PREPREND_CRUMBS = new Array();
+
+var link1 = "@skinconfig.trail.link1.name@";
+var link2 = "@skinconfig.trail.link2.name@";
+var link3 = "@skinconfig.trail.link3.name@";
+
+var href1 = "@skinconfig.trail.link1.href@";
+var href2 = "@skinconfig.trail.link2.href@";
+var href3 = "@skinconfig.trail.link3.href@";
+
+ if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link1, href1 ) );
+ }
+ if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link2, href2 ) );
+ }
+ if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link3, href3 ) );
+ }
+
+/**
+ * String to include between crumbs:
+ */
+var DISPLAY_SEPARATOR = " > ";
+/**
+ * String to include at the beginning of the trail
+ */
+var DISPLAY_PREPREND = " > ";
+/**
+ * String to include at the end of the trail
+ */
+var DISPLAY_POSTPREND = "";
+
+/**
+ * CSS Class to use for a single crumb:
+ */
+var CSS_CLASS_CRUMB = "breadcrumb";
+
+/**
+ * CSS Class to use for the complete trail:
+ */
+var CSS_CLASS_TRAIL = "breadcrumbTrail";
+
+/**
+ * CSS Class to use for crumb separator:
+ */
+var CSS_CLASS_SEPARATOR = "crumbSeparator";
+
+/**
+ * Array of strings containing common file extensions. We use this to
+ * determine what part of the url to ignore (if it contains one of the
+ * string specified here, we ignore it).
+ */
+var FILE_EXTENSIONS = new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
+
+/**
+ * String that separates parts of the breadcrumb trail from each other.
+ * When this is no longer a slash, I'm sure I'll be old and grey.
+ */
+var PATH_SEPARATOR = "/";
+
+/* ========================================================================
+ UTILITY FUNCTIONS
+ ======================================================================== */
+/**
+ * Capitalize first letter of the provided string and return the modified
+ * string.
+ */
+function sentenceCase( string )
+{ return string;
+ //var lower = string.toLowerCase();
+ //return lower.substr(0,1).toUpperCase() + lower.substr(1);
+}
+
+/**
+ * Returns an array containing the names of all the directories in the
+ * current document URL
+ */
+function getDirectoriesInURL()
+{
+ var trail = document.location.pathname.split( PATH_SEPARATOR );
+
+ // check whether last section is a file or a directory
+ var lastcrumb = trail[trail.length-1];
+ for( var i = 0; i < FILE_EXTENSIONS.length; i++ )
+ {
+ if( lastcrumb.indexOf( FILE_EXTENSIONS[i] ) )
+ {
+ // it is, remove it and send results
+ return trail.slice( 1, trail.length-1 );
+ }
+ }
+
+ // it's not; send the trail unmodified
+ return trail.slice( 1, trail.length );
+}
+
+/* ========================================================================
+ BREADCRUMB FUNCTIONALITY
+ ======================================================================== */
+/**
+ * Return a two-dimensional array describing the breadcrumbs based on the
+ * array of directories passed in.
+ */
+function getBreadcrumbs( dirs )
+{
+ var prefix = "/";
+ var postfix = "/";
+
+ // the array we will return
+ var crumbs = new Array();
+
+ if( dirs != null )
+ {
+ for( var i = 0; i < dirs.length; i++ )
+ {
+ prefix += dirs[i] + postfix;
+ crumbs.push( new Array( dirs[i], prefix ) );
+ }
+ }
+
+ // preprend the PREPREND_CRUMBS
+ if(PREPREND_CRUMBS.length > 0 )
+ {
+ return PREPREND_CRUMBS.concat( crumbs );
+ }
+
+ return crumbs;
+}
+
+/**
+ * Return a string containing a simple text breadcrumb trail based on the
+ * two-dimensional array passed in.
+ */
+function getCrumbTrail( crumbs )
+{
+ var xhtml = DISPLAY_PREPREND;
+
+ for( var i = 0; i < crumbs.length; i++ )
+ {
+ xhtml += '<a href="' + crumbs[i][1] + '" >';
+ xhtml += unescape( crumbs[i][0] ) + '</a>';
+ if( i != (crumbs.length-1) )
+ {
+ xhtml += DISPLAY_SEPARATOR;
+ }
+ }
+
+ xhtml += DISPLAY_POSTPREND;
+
+ return xhtml;
+}
+
+/**
+ * Return a string containing an XHTML breadcrumb trail based on the
+ * two-dimensional array passed in.
+ */
+function getCrumbTrailXHTML( crumbs )
+{
+ var xhtml = '<span class="' + CSS_CLASS_TRAIL + '">';
+ xhtml += DISPLAY_PREPREND;
+
+ for( var i = 0; i < crumbs.length; i++ )
+ {
+ xhtml += '<a href="' + crumbs[i][1] + '" class="' + CSS_CLASS_CRUMB + '">';
+ xhtml += unescape( crumbs[i][0] ) + '</a>';
+ if( i != (crumbs.length-1) )
+ {
+ xhtml += '<span class="' + CSS_CLASS_SEPARATOR + '">' + DISPLAY_SEPARATOR + '</span>';
+ }
+ }
+
+ xhtml += DISPLAY_POSTPREND;
+ xhtml += '</span>';
+
+ return xhtml;
+}
+
+/* ========================================================================
+ PRINT BREADCRUMB TRAIL
+ ======================================================================== */
+
+// check if we're local; if so, only print the PREPREND_CRUMBS
+if( document.location.href.toLowerCase().indexOf( "http://" ) == -1 )
+{
+ document.write( getCrumbTrail( getBreadcrumbs() ) );
+}
+else
+{
+ document.write( getCrumbTrail( getBreadcrumbs( getDirectoriesInURL() ) ) );
+}
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/fontsize.js b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/fontsize.js
new file mode 100644
index 0000000..44a2345
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/fontsize.js
@@ -0,0 +1,166 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+function init()
+{ //embedded in the doc
+ //ndeSetTextSize();
+}
+
+function checkBrowser(){
+ if (!document.getElementsByTagName){
+ return true;
+ }
+ else{
+ return false;
+ }
+}
+
+
+function ndeSetTextSize(chgsize,rs)
+{
+ var startSize;
+ var newSize;
+
+ if (!checkBrowser)
+ {
+ return;
+ }
+
+ startSize = parseInt(ndeGetDocTextSize());
+
+ if (!startSize)
+ {
+ startSize = 16;
+ }
+
+ switch (chgsize)
+ {
+ case 'incr':
+ newSize = startSize + 2;
+ break;
+
+ case 'decr':
+ newSize = startSize - 2;
+ break;
+
+ case 'reset':
+ if (rs) {newSize = rs;} else {newSize = 16;}
+ break;
+
+ default:
+ try{
+ newSize = parseInt(ndeReadCookie("nde-textsize"));
+ }
+ catch(e){
+ alert(e);
+ }
+
+ if (!newSize || newSize == 'NaN')
+ {
+ newSize = startSize;
+ }
+ break;
+
+ }
+
+ if (newSize < 10)
+ {
+ newSize = 10;
+ }
+
+ newSize += 'px';
+
+ document.getElementsByTagName('html')[0].style.fontSize = newSize;
+ document.getElementsByTagName('body')[0].style.fontSize = newSize;
+
+ ndeCreateCookie("nde-textsize", newSize, 365);
+}
+
+function ndeGetDocTextSize()
+{
+ if (!checkBrowser)
+ {
+ return 0;
+ }
+
+ var size = 0;
+ var body = document.getElementsByTagName('body')[0];
+
+ if (body.style && body.style.fontSize)
+ {
+ size = body.style.fontSize;
+ }
+ else if (typeof(getComputedStyle) != 'undefined')
+ {
+ size = getComputedStyle(body,'').getPropertyValue('font-size');
+ }
+ else if (body.currentStyle)
+ {
+ size = body.currentStyle.fontSize;
+ }
+
+ //fix IE bug
+ if( isNaN(size)){
+ if(size.substring(size.length-1)=="%"){
+ return
+ }
+
+ }
+
+ return size;
+
+}
+
+
+
+function ndeCreateCookie(name,value,days)
+{
+ var cookie = name + "=" + value + ";";
+
+ if (days)
+ {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ cookie += " expires=" + date.toGMTString() + ";";
+ }
+ cookie += " path=/";
+
+ document.cookie = cookie;
+
+}
+
+function ndeReadCookie(name)
+{
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+
+
+ for(var i = 0; i < ca.length; i++)
+ {
+ var c = ca[i];
+ while (c.charAt(0) == ' ')
+ {
+ c = c.substring(1, c.length);
+ }
+
+ ctest = c.substring(0,name.length);
+
+ if(ctest == name){
+ return c.substring(nameEQ.length,c.length);
+ }
+ }
+ return null;
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/getBlank.js b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/getBlank.js
new file mode 100644
index 0000000..acffe11
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/getBlank.js
@@ -0,0 +1,40 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * getBlank script - when included in a html file and called from a form text field, will set the value of this field to ""
+ * if the text value is still the standard value.
+ * getPrompt script - when included in a html file and called from a form text field, will set the value of this field to the prompt
+ * if the text value is empty.
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="getBlank.js"></script>
+ * <input type="text" id="query" value="Search the site:" onFocus="getBlank (this, 'Search the site:');" onBlur="getPrompt (this, 'Search the site:');"/>
+ */
+<!--
+function getBlank (form, stdValue){
+if (form.value == stdValue){
+ form.value = '';
+ }
+return true;
+}
+function getPrompt (form, stdValue){
+if (form.value == ''){
+ form.value = stdValue;
+ }
+return true;
+}
+//-->
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/getMenu.js b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/getMenu.js
new file mode 100644
index 0000000..1d9efc3
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/getMenu.js
@@ -0,0 +1,45 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * This script, when included in a html file, can be used to make collapsible menus
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="menu.js"></script>
+ */
+
+if (document.getElementById){
+ document.write('<style type="text/css">.menuitemgroup{display: none;}</style>')
+}
+
+
+function SwitchMenu(obj, thePath)
+{
+var open = 'url("'+thePath + 'images/chapter_open.gif")';
+var close = 'url("'+thePath + 'images/chapter.gif")';
+ if(document.getElementById) {
+ var el = document.getElementById(obj);
+ var title = document.getElementById(obj+'Title');
+
+ if(el.style.display != "block"){
+ title.style.backgroundImage = open;
+ el.style.display = "block";
+ }else{
+ title.style.backgroundImage = close;
+ el.style.display = "none";
+ }
+ }// end - if(document.getElementById)
+}//end - function SwitchMenu(obj)
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/menu.js b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/menu.js
new file mode 100644
index 0000000..1180b56
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/scripts/menu.js
@@ -0,0 +1,50 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * This script, when included in a html file, can be used to make collapsible menus
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="menu.js"></script>
+ */
+
+if (document.getElementById){
+ document.write('<style type="text/css">.menuitemgroup{display: none;}</style>')
+}
+
+function SwitchMenu(obj)
+{
+ if(document.getElementById) {
+ var el = document.getElementById(obj);
+ var title = document.getElementById(obj+'Title');
+
+ if(obj.indexOf("_selected_")==0&&el.style.display == ""){
+ //nicolaken: doesn't work :-(
+ //title.style.backgroundImage = "url('images/chapter_open.gif')";
+ el.style.display = "block";
+ }
+
+ if(el.style.display != "block"){
+ //nicolaken: doesn't work :-(
+ //title.style.backgroundImage = 'url([url]images/chapter_open.gif[/url])';
+ el.style.display = "block";
+ }else{
+ //nicolaken: doesn't work :-(
+ //title.style.backgroundImage = "url('images/chapter.gif')";
+ el.style.display = "none";
+ }
+ }// end - if(document.getElementById)
+}//end - function SwitchMenu(obj)
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/skinconf.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/skinconf.xsl
new file mode 100644
index 0000000..cab92ae
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/skinconf.xsl
@@ -0,0 +1,243 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="skinconfig">
+ <xsl:copy>
+ <xsl:if test="not(disable-print-link)">
+ <disable-print-link>true</disable-print-link>
+ </xsl:if>
+ <xsl:if test="not(disable-pdf-link)">
+ <disable-pdf-link>true</disable-pdf-link>
+ </xsl:if>
+ <xsl:if test="not(disable-txt-link)">
+ <disable-txt-link>true</disable-txt-link>
+ </xsl:if>
+ <xsl:if test="not(disable-pod-link)">
+ <disable-pod-link>true</disable-pod-link>
+ </xsl:if>
+ <xsl:if test="not(disable-xml-link)">
+ <disable-xml-link>true</disable-xml-link>
+ </xsl:if>
+ <xsl:if test="not(disable-external-link-image)">
+ <disable-external-link-image>false</disable-external-link-image>
+ </xsl:if>
+ <xsl:if test="not(disable-compliance-links)">
+ <disable-compliance-links>false</disable-compliance-links>
+ </xsl:if>
+ <xsl:if test="not(obfuscate-mail-links)">
+ <obfuscate-mail-links>true</obfuscate-mail-links>
+ </xsl:if>
+ <xsl:if test="not(obfuscate-mail-value)">
+ <obfuscate-mail-value>.at.</obfuscate-mail-value>
+ </xsl:if>
+ <xsl:if test="not(disable-font-script)">
+ <disable-font-script>true</disable-font-script>
+ </xsl:if>
+ <!--
+ <xsl:if test="not(project-name)">
+ <project-name>MyProject</project-name>
+ </xsl:if>
+ <xsl:if test="not(project-description)">
+ <project-description>MyProject Description</project-description>
+ </xsl:if>
+ <xsl:if test="not(project-url)">
+ <project-url>http://myproj.mygroup.org/</project-url>
+ </xsl:if>
+ <xsl:if test="not(project-logo)">
+ <project-logo>images/project.png</project-logo>
+ </xsl:if>
+ <xsl:if test="not(group-name)">
+ <group-name>MyGroup</group-name>
+ </xsl:if>
+ <xsl:if test="not(group-description)">
+ <group-description>MyGroup Description</group-description>
+ </xsl:if>
+ <xsl:if test="not(group-url)">
+ <group-url>http://mygroup.org</group-url>
+ </xsl:if>
+ <xsl:if test="not(group-logo)">
+ <group-logo>images/group.png</group-logo>
+ </xsl:if>
+ <xsl:if test="not(host-url)">
+ <host-url/>
+ </xsl:if>
+ <xsl:if test="not(host-logo)">
+ <host-logo/>
+ </xsl:if>
+ <xsl:if test="not(year)">
+ <year>2005</year>
+ </xsl:if>
+ <xsl:if test="not(vendor)">
+ <vendor>The Acme Software Foundation.</vendor>
+ </xsl:if>
+ -->
+ <xsl:if test="not(trail)">
+ <trail>
+ <link1 name="" href=""/>
+ <link2 name="" href=""/>
+ <link3 name="" href=""/>
+ </trail>
+ </xsl:if>
+
+ <xsl:if test="not(toc)">
+ <toc level="2" location="page"/>
+ </xsl:if>
+
+ <xsl:if test="not(pdf/page-numbering-format)">
+ <pdf><page-numbering-format>Page 1</page-numbering-format></pdf>
+ </xsl:if>
+
+ <xsl:if test="not(pdf/show-external-urls)">
+ <pdf><show-external-urls>true</show-external-urls></pdf>
+ </xsl:if>
+
+
+<!--
+ <xsl:if test="not(colors)">
+ <colors>
+ <color name="header" value="#294563"/>
+
+ <color name="tab-selected" value="#4a6d8c"/>
+ <color name="tab-unselected" value="#b5c7e7"/>
+ <color name="subtab-selected" value="#4a6d8c"/>
+ <color name="subtab-unselected" value="#4a6d8c"/>
+
+ <color name="heading" value="#294563"/>
+ <color name="subheading" value="#4a6d8c"/>
+
+ <color name="navstrip" value="#cedfef"/>
+ <color name="toolbox" value="#294563"/>
+
+ <color name="menu" value="#4a6d8c"/>
+ <color name="dialog" value="#4a6d8c"/>
+
+ <color name="body" value="#ffffff"/>
+
+ <color name="table" value="#7099C5"/>
+ <color name="table-cell" value="#f0f0ff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#c60"/>
+ <color name="note" value="#069"/>
+
+ <color name="warning" value="#900"/>
+ <color name="code" value="#CFDCED"/>
+
+ <color name="footer" value="#cedfef"/>
+ </colors>
+ </xsl:if>
+-->
+
+ <xsl:if test="not(extra-css)">
+ <extra-css/>
+ </xsl:if>
+ <xsl:if test="not(credits)">
+ <credits>
+ <credit>
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ <image>images/built-with-forrest-button.png</image>
+ <width>88</width>
+ <height>31</height>
+ </credit>
+ <!-- A credit with @role='pdf' will have its name and url displayed in the
+ PDF page's footer. -->
+ </credits>
+ </xsl:if>
+
+ <xsl:copy-of select="@*"/>
+ <xsl:copy-of select="node()"/>
+ <!--
+ <xsl:copy-of select="node()[not(name(.)='colors')]"/>
+ <xsl:apply-templates select="colors"/>-->
+ </xsl:copy>
+
+ </xsl:template>
+<!--
+ <xsl:template match="colors">
+ <colors>
+ <xsl:if test="not(color[@name='header'])">
+ <color name="header" value="#294563"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='tab-selected'])">
+ <color name="tab-selected" value="#4a6d8c"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='tab-unselected'])">
+ <color name="tab-unselected" value="#b5c7e7"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='subtab-selected'])">
+ <color name="subtab-selected" value="#4a6d8c"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='subtab-unselected'])">
+ <color name="subtab-unselected" value="#4a6d8c"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='heading'])">
+ <color name="heading" value="#294563"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='subheading'])">
+ <color name="subheading" value="#4a6d8c"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='navstrip'])">
+ <color name="navstrip" value="#cedfef"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='toolbox'])">
+ <color name="toolbox" value="#294563"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='menu'])">
+ <color name="menu" value="#4a6d8c"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='dialog'])">
+ <color name="dialog" value="#4a6d8c"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='body'])">
+ <color name="body" value="#ffffff"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='table'])">
+ <color name="table" value="#7099C5"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='table-cell'])">
+ <color name="table-cell" value="#f0f0ff"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='highlight'])">
+ <color name="highlight" value="#yellow"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='fixme'])">
+ <color name="fixme" value="#c60"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='note'])">
+ <color name="note" value="#069"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='warning'])">
+ <color name="warning" value="#900"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='code'])">
+ <color name="code" value="#CFDCED"/>
+ </xsl:if>
+ <xsl:if test="not(color[@name='footer'])">
+ <color name="footer" value="#cedfef"/>
+ </xsl:if>
+
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:copy-of select="node()[name(.)='color']"/>
+ </xsl:copy>
+
+ </colors>
+ </xsl:template>
+-->
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_de.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_de.xml
new file mode 100644
index 0000000..3fb1789
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_de.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Schriftgrösse:</message>
+ <message key="Last Published:">Zuletzt veröffentlicht:</message>
+ <message key="Search">Suche:</message>
+ <message key="Search the site with">Suche auf der Seite mit</message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_en_US.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_en_US.xml
new file mode 100644
index 0000000..bfe336c
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_en_US.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Font size:</message>
+ <message key="Last Published:">Last Published:</message>
+ <message key="Search">Search</message>
+ <message key="Search the site with">Search the site with</message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_es.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_es.xml
new file mode 100644
index 0000000..b3d42e8
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_es.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Tamaño del texto:</message>
+ <message key="Last Published:">Fecha de publicación:</message>
+ <message key="Search">Buscar</message>
+ <message key="Search the site with">Buscar en</message>
+</catalogue>
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_fr.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_fr.xml
new file mode 100644
index 0000000..7d950d3
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/translations/CommonMessages_fr.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Taille :</message>
+ <message key="Last Published:">Dernière publication :</message>
+ <message key="Search">Rechercher</message>
+ <message key="Search the site with">Rechercher sur le site avec</message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/document2fo.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/document2fo.xsl
new file mode 100644
index 0000000..09f037e
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/document2fo.xsl
@@ -0,0 +1,1053 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <!-- left, justify, right -->
+ <xsl:variable name="text-align" select="string(//skinconfig/pdf/page/@text-align)"/>
+
+ <!-- print URL of external links -->
+ <xsl:variable name="show-external-urls" select="//skinconfig/pdf/show-external-urls"/>
+
+ <!-- Get the section depth to use when generating the minitoc (default is 2) -->
+ <xsl:variable name="toc-max-depth" select="number(//skinconfig/toc/@max-depth)"/>
+
+ <!-- The page size to be used -->
+ <xsl:variable name="pagesize"
+ select="string(//skinconfig/pdf/page/@size)"/>
+
+ <!-- The page orientation ("portrait" or "landscape") -->
+ <xsl:variable name="pageorientation"
+ select="string(//skinconfig/pdf/page/@orientation)"/>
+
+ <!-- Double-sided printing toggle -->
+ <xsl:variable name="doublesided"
+ select="string(//skinconfig/pdf/margins/@double-sided)"/>
+
+ <!-- The top page margin -->
+ <xsl:variable name="topmargin"
+ select="string(//skinconfig/pdf/margins/top)"/>
+
+ <!-- The bottom page margin -->
+ <xsl:variable name="bottommargin"
+ select="string(//skinconfig/pdf/margins/bottom)"/>
+
+ <!-- The inner page margin (always the left margin if
+ double-sided printing is off, alternating between left and right if
+ it's on) -->
+ <xsl:variable name="innermargin"
+ select="string(//skinconfig/pdf/margins/inner)"/>
+
+ <!-- The outer page margin (always the right margin if
+ double-sided printing is off, alternating between right and left if
+ it's on)-->
+ <xsl:variable name="outermargin"
+ select="string(//skinconfig/pdf/margins/outer)"/>
+
+ <xsl:param name="numbersections" select="'true'"/>
+
+ <!-- page breaks after TOC and each page if an aggregate document -->
+ <xsl:variable name="page-break-top-sections" select="'true'"/>
+
+ <!-- page numbering format -->
+ <xsl:variable name="page-numbering-format" select="string(//skinconfig/pdf/page-numbering-format)"/>
+
+ <!-- Section depth at which we stop numbering and just indent -->
+ <xsl:param name="numbering-max-depth" select="'3'"/>
+ <xsl:param name="imagesdir" select="."/>
+ <xsl:param name="xmlbasedir"/>
+ <xsl:include href="pdfoutline.xsl"/>
+ <xsl:include href="footerinfo.xsl"/>
+
+
+ <!-- Determine page height for various page sizes (US Letter portrait
+ is the default) -->
+ <!-- FIXME: JJP:would this be better of a file? -->
+ <xsl:variable name="pageheight">
+ <xsl:choose>
+ <xsl:when test="$pageorientation = 'landscape'">
+ <xsl:choose>
+ <xsl:when test="$pagesize = 'a0'">841mm</xsl:when>
+ <xsl:when test="$pagesize = 'a1'">594mm</xsl:when>
+ <xsl:when test="$pagesize = 'a2'">420mm</xsl:when>
+ <xsl:when test="$pagesize = 'a3'">297mm</xsl:when>
+ <xsl:when test="$pagesize = 'a4'">210mm</xsl:when>
+ <xsl:when test="$pagesize = 'a5'">148mm</xsl:when>
+ <xsl:when test="$pagesize = 'executive'">7.25in</xsl:when>
+ <xsl:when test="$pagesize = 'folio'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'ledger'">11in</xsl:when>
+ <xsl:when test="$pagesize = 'legal'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'letter'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'quarto'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'tabloid'">11in</xsl:when>
+ <xsl:otherwise>8.5in</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$pagesize = 'a0'">1189mm</xsl:when>
+ <xsl:when test="$pagesize = 'a1'">841mm</xsl:when>
+ <xsl:when test="$pagesize = 'a2'">594mm</xsl:when>
+ <xsl:when test="$pagesize = 'a3'">420mm</xsl:when>
+ <xsl:when test="$pagesize = 'a4'">297mm</xsl:when>
+ <xsl:when test="$pagesize = 'a5'">210mm</xsl:when>
+ <xsl:when test="$pagesize = 'executive'">10.5in</xsl:when>
+ <xsl:when test="$pagesize = 'folio'">13in</xsl:when>
+ <xsl:when test="$pagesize = 'ledger'">17in</xsl:when>
+ <xsl:when test="$pagesize = 'legal'">14in</xsl:when>
+ <xsl:when test="$pagesize = 'quarto'">10.83in</xsl:when>
+ <xsl:when test="$pagesize = 'tabloid'">17in</xsl:when>
+ <xsl:otherwise>11in</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Determine page width for various page sizes (US Letter portrait
+ is the default) -->
+ <xsl:variable name="pagewidth">
+ <xsl:choose>
+ <xsl:when test="$pageorientation = 'landscape'">
+ <xsl:choose>
+ <xsl:when test="$pagesize = 'a0'">1189mm</xsl:when>
+ <xsl:when test="$pagesize = 'a1'">841mm</xsl:when>
+ <xsl:when test="$pagesize = 'a2'">594mm</xsl:when>
+ <xsl:when test="$pagesize = 'a3'">420mm</xsl:when>
+ <xsl:when test="$pagesize = 'a4'">297mm</xsl:when>
+ <xsl:when test="$pagesize = 'a5'">210mm</xsl:when>
+ <xsl:when test="$pagesize = 'executive'">10.5in</xsl:when>
+ <xsl:when test="$pagesize = 'folio'">13in</xsl:when>
+ <xsl:when test="$pagesize = 'ledger'">17in</xsl:when>
+ <xsl:when test="$pagesize = 'legal'">14in</xsl:when>
+ <xsl:when test="$pagesize = 'quarto'">10.83in</xsl:when>
+ <xsl:when test="$pagesize = 'tabloid'">17in</xsl:when>
+ <xsl:otherwise>11in</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$pagesize = 'a0'">841mm</xsl:when>
+ <xsl:when test="$pagesize = 'a1'">594mm</xsl:when>
+ <xsl:when test="$pagesize = 'a2'">420mm</xsl:when>
+ <xsl:when test="$pagesize = 'a3'">297mm</xsl:when>
+ <xsl:when test="$pagesize = 'a4'">210mm</xsl:when>
+ <xsl:when test="$pagesize = 'a5'">148mm</xsl:when>
+ <xsl:when test="$pagesize = 'executive'">7.25in</xsl:when>
+ <xsl:when test="$pagesize = 'folio'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'ledger'">11in</xsl:when>
+ <xsl:when test="$pagesize = 'legal'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'letter'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'quarto'">8.5in</xsl:when>
+ <xsl:when test="$pagesize = 'tabloid'">11in</xsl:when>
+ <xsl:otherwise>8.5in</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:template match="/">
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+
+ <fo:simple-page-master master-name="first-page"
+ page-height="{$pageheight}"
+ page-width="{$pagewidth}"
+ margin-top="{$topmargin}"
+ margin-bottom="{$bottommargin}"
+ margin-left="{$innermargin}"
+ margin-right="{$outermargin}">
+ <fo:region-body
+ margin-top="0.5in"
+ margin-bottom=".5in"/>
+ <fo:region-after
+ region-name="first-footer"
+ extent=".5in"
+ display-align="before"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="even-page"
+ page-height="{$pageheight}"
+ page-width="{$pagewidth}"
+ margin-top="{$topmargin}"
+ margin-bottom="{$bottommargin}">
+ <xsl:choose>
+ <xsl:when test="$doublesided = 'true'">
+ <xsl:attribute name="margin-left">
+ <xsl:value-of select="$outermargin"/>
+ </xsl:attribute>
+ <xsl:attribute name="margin-right">
+ <xsl:value-of select="$innermargin"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="margin-left">
+ <xsl:value-of select="$innermargin"/>
+ </xsl:attribute>
+ <xsl:attribute name="margin-right">
+ <xsl:value-of select="$outermargin"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <fo:region-before
+ region-name="even-header"
+ extent="0.5in"
+ border-bottom="0.5pt solid"/>
+ <fo:region-body
+ margin-top="0.5in"
+ margin-bottom=".5in"/>
+ <fo:region-after
+ region-name="even-footer"
+ extent=".5in"
+ display-align="before"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="odd-page"
+ page-height="{$pageheight}"
+ page-width="{$pagewidth}"
+ margin-top="{$topmargin}"
+ margin-bottom="{$bottommargin}"
+ margin-left="{$innermargin}"
+ margin-right="{$outermargin}">
+ <fo:region-before
+ region-name="odd-header"
+ extent="0.5in"
+ border-bottom="0.5pt solid"/>
+ <fo:region-body
+ margin-top="0.5in"
+ margin-bottom=".5in"/>
+ <fo:region-after
+ region-name="odd-footer"
+ extent=".5in"
+ display-align="before"/>
+ </fo:simple-page-master>
+
+ <fo:page-sequence-master master-name="book">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference
+ page-position="first"
+ master-reference="first-page"/>
+ <fo:conditional-page-master-reference
+ odd-or-even="odd"
+ master-reference="odd-page"/>
+ <fo:conditional-page-master-reference
+ odd-or-even="even"
+ master-reference="even-page"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+
+ <xsl:apply-templates select="/site/document" mode="outline"/>
+
+ <fo:page-sequence master-reference="book">
+ <xsl:apply-templates select="/site/document"/>
+ </fo:page-sequence>
+
+ </fo:root>
+ </xsl:template>
+
+ <xsl:template match="document">
+ <fo:title><xsl:value-of select="header/title"/></fo:title>
+
+ <fo:static-content flow-name="first-footer">
+ <fo:block
+ border-top="0.25pt solid"
+ padding-before="6pt"
+ text-align="center">
+ <xsl:apply-templates select="footer"/>
+ </fo:block>
+ <!-- don't list page number on first page if it's contents is just the TOC -->
+ <xsl:if test="not($toc-max-depth > 0 and $page-break-top-sections)">
+ <xsl:call-template name="insertPageNumber">
+ <xsl:with-param name="text-align">start</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template name="info"/>
+ </fo:static-content>
+
+ <fo:static-content flow-name="even-header">
+ <fo:block
+ font-size="70%"
+ text-align="end"
+ font-style="italic">
+ <xsl:value-of select="header/title"/>
+ </fo:block>
+ </fo:static-content>
+
+ <fo:static-content flow-name="even-footer">
+ <fo:block
+ border-top="0.25pt solid"
+ padding-before="6pt"
+ text-align="center">
+ <xsl:apply-templates select="footer"/>
+ </fo:block>
+ <xsl:call-template name="insertPageNumber">
+ <xsl:with-param name="text-align">end</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="info"/>
+ </fo:static-content>
+
+ <fo:static-content flow-name="odd-header">
+ <fo:block
+ font-size="70%"
+ text-align="start"
+ font-style="italic">
+ <xsl:value-of select="header/title"/>
+ </fo:block>
+ </fo:static-content>
+
+ <fo:static-content flow-name="odd-footer">
+ <fo:block
+ border-top="0.25pt solid"
+ padding-before="6pt"
+ text-align="center">
+ <xsl:apply-templates select="footer"/>
+ </fo:block>
+ <xsl:call-template name="insertPageNumber">
+ <xsl:with-param name="text-align">start</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="info"/>
+ </fo:static-content>
+
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block
+ padding-before="24pt"
+ padding-after="24pt"
+ font-size="24pt"
+ font-weight="bold"
+ id="{generate-id()}">
+
+ <xsl:value-of select="header/title"/>
+ </fo:block>
+
+ <fo:block
+ text-align="{$text-align}"
+ padding-before="18pt"
+ padding-after="18pt">
+ <xsl:apply-templates/>
+ </fo:block>
+
+ <!-- Total number of pages calculation... -->
+ <fo:block id="term"/>
+
+ </fo:flow>
+ </xsl:template>
+
+ <xsl:template match="abstract">
+ <fo:block
+ font-size="12pt"
+ text-align="center"
+ space-before="20pt"
+ space-after="25pt"
+ width="7.5in"
+ font-family="serif"
+ font-style="italic">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="notice">
+ <fo:block
+ font-size="10pt"
+ text-align="left"
+ space-before="20pt"
+ width="7.5in"
+ font-family="serif"
+ border-top="0.25pt solid"
+ border-bottom="0.25pt solid"
+ padding-before="6pt"
+ padding-after="6pt">
+ <xsl:call-template name="insertPageBreaks"/>
+ <!-- insert i18n stuff here -->
+ NOTICE: <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="anchor">
+ <fo:block id="{@id}"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="section">
+
+ <xsl:param name="level">0</xsl:param>
+
+ <xsl:variable name="size">
+ <!-- 14pt for level 1 12pt for level 2 -->
+ <xsl:value-of select="14-number($level)"/>
+ </xsl:variable>
+
+ <xsl:variable name="background-color" select="//skinconfig/colors/color[@name='body']/@value"/>
+ <xsl:variable name="heading-color" select="//skinconfig/colors/color[@name='subheading']/@value"/>
+ <xsl:variable name="heading-type" select="//skinconfig/headings/@type"/>
+
+ <fo:block
+ font-family="serif"
+ font-size="{$size}pt"
+ font-weight="bold"
+ space-before="12pt"
+ space-after="4pt">
+
+ <xsl:call-template name="insertPageBreaks"/>
+
+ <xsl:if test="$heading-type = 'boxed'">
+ <xsl:attribute name="background-color">
+ <xsl:value-of select="$heading-color"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="id">
+ <xsl:choose>
+ <xsl:when test="normalize-space(@id)!=''">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:if test="$numbersections = 'true' and number($level) < $numbering-max-depth+1">
+ <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
+ <xsl:text>. </xsl:text>
+ </xsl:if>
+
+ <!-- For sections 4 or more nestings deep, indent instead of number -->
+ <xsl:if test="number($level) > $numbering-max-depth+1">
+ <xsl:attribute name="start-indent">
+ <xsl:value-of select="4+number($level)"/><xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:value-of select="title"/>
+ </fo:block>
+ <xsl:if test="$heading-type = 'underlined'">
+ <!-- The non-breaking space in this block is required, otherwise
+ the block won't be rendered at all. -->
+ <fo:block
+ font-family="serif"
+ font-size="{10 div (number($level) +1 )}pt"
+ background-color="{$heading-color}"> </fo:block>
+ </xsl:if>
+ <fo:block
+ background-color="{$background-color}">
+ <xsl:apply-templates>
+ <xsl:with-param name="level" select="number($level)+1"/>
+ </xsl:apply-templates>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="title">
+ <!-- do nothing as titles are handled in their parent templates -->
+ </xsl:template>
+
+ <xsl:template match="subtitle">
+ <xsl:param name="level">0</xsl:param>
+ <xsl:variable name="size" select="16-(number($level)*1.5)"/>
+
+ <fo:block
+ font-weight="bold"
+ font-size="{$size}pt">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="authors">
+ <fo:block
+ space-before="20pt"
+ font-weight="bold"
+ font-size="9pt">
+ <xsl:call-template name="insertPageBreaks"/>
+ <!-- insert i18n stuff here -->
+ by
+ <xsl:for-each select="person">
+ <xsl:value-of select="@name"/>
+ <xsl:if test="not(position() = last())">, </xsl:if>
+ </xsl:for-each>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="p">
+ <xsl:choose>
+ <xsl:when test="ancestor::li and not(preceding-sibling::*)">
+ <fo:block
+ space-after="4pt"
+ font-family="serif">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:block
+ space-before="4pt"
+ space-after="4pt"
+ font-family="serif">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="source">
+ <xsl:variable name="color" select="//skinconfig/colors/color[@name='code']/@value"/>
+ <fo:block
+ font-family="monospace"
+ font-size="10pt"
+ background-color="{$color}"
+ white-space-collapse="false"
+ linefeed-treatment="preserve"
+ white-space-treatment="preserve"
+ wrap-option="wrap"
+ text-align="start">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+
+ <xsl:template match="ol|ul">
+ <fo:list-block
+ provisional-distance-between-starts="18pt"
+ provisional-label-separation="3pt"
+ text-align="start">
+ <xsl:apply-templates/>
+ </fo:list-block>
+ </xsl:template>
+
+ <xsl:template match="ol/li">
+ <fo:list-item>
+ <xsl:if test="not(following-sibling::li[1])">
+ <xsl:attribute name="space-after">6pt"</xsl:attribute>
+ </xsl:if>
+ <fo:list-item-label
+ end-indent="label-end()">
+ <fo:block>
+ <xsl:number format="1."/>
+ </fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body
+ start-indent="body-start()">
+ <fo:block
+ font-family="serif">
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </xsl:template>
+
+ <!-- Emulate browser handling of these invalid combinations that our DTD
+ unfortunately allows -->
+ <xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block></fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block font-family="serif">
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </xsl:template>
+
+ <xsl:template match="ul/li">
+ <fo:list-item>
+ <xsl:if test="not(following-sibling::li[1])">
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
+ </xsl:if>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block>•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block
+ font-family="serif">
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </xsl:template>
+
+ <xsl:template match="dl">
+ <fo:list-block
+ provisional-distance-between-starts="18pt"
+ provisional-label-separation="3pt"
+ text-align="start">
+ <xsl:apply-templates/>
+ </fo:list-block>
+ </xsl:template>
+
+ <xsl:template match="dt">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block></fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block
+ font-weight="bold">
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </xsl:template>
+
+ <xsl:template match="dd">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block></fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </xsl:template>
+
+ <xsl:template match="strong">
+ <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
+ </xsl:template>
+
+ <xsl:template match="em">
+ <fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
+ </xsl:template>
+
+ <xsl:template match="code">
+ <fo:inline font-family="monospace"><xsl:apply-templates/></fo:inline>
+ </xsl:template>
+
+ <xsl:template match="warning">
+ <xsl:variable name="color" select="//skinconfig/colors/color[@name='warning']/@value"/>
+ <fo:block
+ margin-left="0.25in"
+ margin-right="0.25in"
+ font-weight="bold"
+ font-size="10pt"
+ font-family="serif"
+ space-before="10pt"
+ border-before-style="solid"
+ border-start-style="solid"
+ border-end-style="solid"
+ border-color="{$color}"
+ background-color="{$color}"
+ color="#ffffff">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:choose>
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
+ <xsl:otherwise>Warning: </xsl:otherwise>
+ </xsl:choose><xsl:value-of select="title"/>
+ </fo:block>
+ <fo:block
+ margin-left="0.25in"
+ margin-right="0.25in"
+ font-family="serif"
+ font-size="8pt"
+ border-after-style="solid"
+ border-start-style="solid"
+ border-end-style="solid"
+ border-color="{$color}"
+ background-color="#fff0f0"
+ padding-start="3pt"
+ padding-end="3pt"
+ padding-before="3pt"
+ padding-after="3pt"
+ space-after="10pt">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="note">
+ <xsl:variable name="color" select="//skinconfig/colors/color[@name='note']/@value"/>
+ <fo:block
+ margin-left="0.25in"
+ margin-right="0.25in"
+ font-weight="bold"
+ font-size="10pt"
+ color="#ffffff"
+ font-family="serif"
+ space-before="10pt"
+ border-before-style="solid"
+ border-start-style="solid"
+ border-end-style="solid"
+ border-color="{$color}"
+ background-color="{$color}">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:choose>
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
+ <!-- insert i18n stuff here -->
+ <xsl:otherwise>Note: </xsl:otherwise>
+ </xsl:choose><xsl:value-of select="title"/>
+ </fo:block>
+ <fo:block
+ margin-left="0.25in"
+ margin-right="0.25in"
+ font-family="serif"
+ font-size="8pt"
+ space-after="10pt"
+ border-after-style="solid"
+ border-start-style="solid"
+ border-end-style="solid"
+ border-color="{$color}"
+ background-color="#F0F0FF"
+ padding-start="3pt"
+ padding-end="3pt"
+ padding-before="3pt"
+ padding-after="3pt">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="fixme">
+ <xsl:variable name="color" select="//skinconfig/colors/color[@name='fixme']/@value"/>
+ <fo:block
+ margin-left="0.25in"
+ margin-right="0.25in"
+ font-weight="bold"
+ font-size="10pt"
+ color="#FFFFFF"
+ font-family="serif"
+ space-before="10pt"
+ border-before-style="solid"
+ border-start-style="solid"
+ border-end-style="solid"
+ border-color="{$color}"
+ background-color="{$color}">
+ <xsl:call-template name="insertPageBreaks"/>
+ <!-- insert i18n stuff here -->
+ FIXME (<xsl:value-of select="@author"/>): <xsl:value-of select="title"/>
+ </fo:block>
+ <fo:block
+ margin-left="0.25in"
+ margin-right="0.25in"
+ font-family="serif"
+ font-size="8pt"
+ space-after="10pt"
+ border-after-style="solid"
+ border-start-style="solid"
+ border-end-style="solid"
+ border-color="{$color}"
+ background-color="#FFF0F0"
+ padding-start="3pt"
+ padding-end="3pt"
+ padding-before="3pt"
+ padding-after="3pt">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="link|fork|jump">
+ <xsl:variable name="color" select="//skinconfig/colors/color[@name = 'body']/@link"/>
+ <xsl:choose>
+ <xsl:when test="starts-with(@href, '#')">
+ <fo:basic-link color="{$color}" text-decoration="underline" internal-destination="{substring(@href,2)}">
+ <xsl:apply-templates/>
+ </fo:basic-link>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:basic-link color="{$color}" text-decoration="underline" external-destination="{@href}"><xsl:apply-templates/></fo:basic-link>
+ <xsl:if test="$show-external-urls = 'true' and @href != string(.)">
+ (<xsl:value-of select="@href"/>)
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="figure|img">
+ <fo:block text-align="center">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:if test="normalize-space(@id)!=''">
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
+ </xsl:if>
+
+ <!-- Make relative paths absolute -->
+ <xsl:variable name="imgpath">
+ <xsl:choose>
+ <!-- resources image dir -->
+ <xsl:when test="starts-with(string(@src),'images/')">
+ <xsl:value-of select="concat($imagesdir,substring-after(@src,'images'))"/>
+ </xsl:when>
+ <!-- already absolute -->
+ <xsl:when test="contains(string(@src),':') or starts-with(string(@src),'/')">
+ <xsl:value-of select="@src"/>
+ </xsl:when>
+ <!-- relative to document -->
+ <xsl:otherwise><xsl:value-of select="concat($xmlbasedir,@src)"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <fo:external-graphic src="{$imgpath}">
+ <xsl:if test="@height">
+ <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@width">
+ <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
+ </xsl:if>
+ </fo:external-graphic>
+ <!-- alt text -->
+ <xsl:if test="normalize-space(@alt)!=''">
+ <fo:block><xsl:value-of select="@alt"/></fo:block>
+ </xsl:if>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="table">
+ <!-- FIXME: Apache FOP must have column widths specified at present,
+ this section can be removed when this limitation is removed from Fop.
+ Unfortunately, this means that each column is a fixed width,
+ but at least the table displays! -->
+
+ <xsl:variable name="max-number-columns">
+ <xsl:for-each select="tr">
+ <xsl:sort select="count(td|th)" data-type="number" order="descending"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="count(td|th)"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+
+ <xsl:variable name="column-width">
+ <xsl:value-of select="6.25 div number($max-number-columns)"/>in
+ </xsl:variable>
+
+ <fo:table>
+
+ <fo:table-column>
+ <xsl:attribute name="column-width">
+ <xsl:value-of select="$column-width"/>
+ </xsl:attribute>
+
+ <xsl:attribute name="number-columns-repeated">
+ <xsl:value-of select="number($max-number-columns)"/>
+ </xsl:attribute>
+ </fo:table-column>
+
+ <!-- End of hack for Fop support (if removing this hack, remember
+ you need the <fo:table> element) -->
+
+ <fo:table-body
+ font-size="10pt"
+ font-family="sans-serif">
+ <xsl:apply-templates select="tr"/>
+ </fo:table-body>
+ </fo:table>
+
+ <!-- FIXME: Apache Fop does not support the caption element yet.
+ This hack will display the table caption accordingly. -->
+ <xsl:if test="caption">
+ <fo:block
+ text-align="center"
+ font-weight="bold">
+ <!-- insert i18n stuff here -->
+ Table
+ <xsl:text> </xsl:text>
+ <xsl:number count="table" level="multiple"/>
+ <xsl:text>: </xsl:text>
+ <xsl:value-of select="caption"/>
+ </fo:block>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="tr">
+ <fo:table-row>
+ <xsl:apply-templates/>
+ </fo:table-row>
+ </xsl:template>
+
+ <xsl:template match="th">
+ <xsl:variable name="border-color" select="//skinconfig/colors/color[@name = 'table']/@value"/>
+ <xsl:variable name="background-color" select="$border-color"/>
+ <fo:table-cell
+ padding-before="4pt"
+ padding-after="4pt"
+ padding-start="4pt"
+ padding-end="4pt"
+ color="#FFFFFF"
+ background-color="{$background-color}"
+ border="1pt solid {$border-color}">
+ <xsl:attribute name="number-columns-spanned">
+ <xsl:value-of select="@colspan"/>
+ </xsl:attribute>
+ <xsl:attribute name="number-rows-spanned">
+ <xsl:value-of select="@rowspan"/>
+ </xsl:attribute>
+ <fo:block
+ text-align="center">
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:table-cell>
+ </xsl:template>
+
+ <xsl:template match="td">
+ <xsl:variable name="border-color" select="//skinconfig/colors/color[@name = 'table']/@value"/>
+ <xsl:variable name="background-color" select="//skinconfig/colors/color[@name = 'table-cell']/@value"/>
+ <fo:table-cell
+ padding-before="4pt"
+ padding-after="4pt"
+ padding-start="4pt"
+ padding-end="4pt"
+ background-color="{$background-color}"
+ border="1pt solid {$border-color}">
+ <xsl:attribute name="number-columns-spanned">
+ <xsl:value-of select="@colspan"/>
+ </xsl:attribute>
+ <xsl:attribute name="number-rows-spanned">
+ <xsl:value-of select="@rowspan"/>
+ </xsl:attribute>
+ <fo:block>
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:table-cell>
+ </xsl:template>
+
+ <xsl:template match="br">
+ <fo:block></fo:block>
+ </xsl:template>
+
+ <xsl:template match="legal">
+ <fo:inline
+ font-size="8pt">
+ <xsl:apply-templates/>
+ </fo:inline>
+ </xsl:template>
+
+ <xsl:template match="body[count(//section) != 0]">
+ <xsl:if test="$toc-max-depth > 0">
+ <fo:block font-family="serif" font-size="14pt" font-weight="bold"
+ space-after="5pt" space-before="5pt" text-align="justify" width="7.5in">
+ <xsl:call-template name="insertPageBreaks"/>
+ <!-- insert i18n stuff here -->
+ <xsl:text>Table of contents</xsl:text>
+ </fo:block>
+ <fo:block font-family="sans" font-size="12pt" space-after="5pt"
+ space-before="0pt" text-align="justify" width="7.5in">
+ <xsl:if test="$page-break-top-sections">
+ <xsl:attribute name="break-after">page</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="section" mode="toc" />
+ </fo:block>
+ </xsl:if>
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="section" mode="toc">
+ <!-- FIXME: see bug FOR-640 -->
+ <xsl:param name="depth" select="'1'"/>
+ <fo:block space-before="5pt" text-align-last="justify" start-indent=".5em" text-indent=".5em">
+ <fo:inline>
+ <xsl:variable name="id">
+ <xsl:choose>
+ <xsl:when test="normalize-space(@id)!=''">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <fo:basic-link internal-destination="{$id}">
+ <xsl:value-of select="substring('          ', 0, 2 * $depth - 1)" />
+ <fo:inline font-size="10pt">
+ <xsl:number count="section" format="1.1.1.1.1.1.1" level="multiple" />
+ </fo:inline>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="title" />
+ <fo:leader leader-pattern="dots" />
+ <fo:page-number-citation ref-id="{$id}" />
+ </fo:basic-link>
+ </fo:inline>
+ <xsl:if test="$toc-max-depth > $depth">
+ <xsl:apply-templates select="section" mode="toc">
+ <xsl:with-param name="depth" select="$depth + 1"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </fo:block>
+ </xsl:template>
+
+
+<!-- ====================================================================== -->
+<!-- Local Extensions section -->
+<!-- ====================================================================== -->
+
+ <xsl:template match="citation">
+ <fo:inline>
+ [<xsl:value-of select="@def"/>]
+ </fo:inline>
+ </xsl:template>
+
+ <xsl:template match="p[@class='quote']">
+ <fo:block start-indent="1em"
+ space-before="4pt"
+ space-after="4pt"
+ background-color="#f0f0f0"
+ font-family="monospace">
+ <xsl:call-template name="insertPageBreaks"/>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template name="insertPageBreaks">
+ <!-- if marked as a 'pageBreakBefore', and we're breaking on pages, and were not the first node -->
+ <xsl:if test="contains(@class, 'pageBreakBefore') and preceding-sibling::node()">
+ <xsl:attribute name="break-before">page</xsl:attribute>
+ </xsl:if>
+ <!-- if marked as a 'pageBreakAfter', and we're breaking on pages, and were not the last node -->
+ <xsl:if test="contains(@class, 'pageBreakAfter') and following-sibling::node()">
+ <xsl:attribute name="break-after">page</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Display the document numerotation -->
+ <xsl:template name="insertPageNumber">
+ <xsl:param name="text-align" select="'start'"/>
+ <xsl:variable name="prefixe" select="substring-before($page-numbering-format,'1')"/>
+ <xsl:variable name="sep" select="substring-before(substring-after($page-numbering-format,'1'),'1')"/>
+ <xsl:variable name="postfixe">
+ <xsl:choose>
+ <xsl:when test="contains(substring-after($page-numbering-format,'1'),'1')">
+ <xsl:value-of select="substring-after(substring-after($page-numbering-format,'1'),'1')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($page-numbering-format,'1')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- if 'page-numbering-format' contains 1 digits, the page number is displayed in the footer -->
+ <xsl:if test="contains($page-numbering-format,'1')">
+ <fo:block font-size="70%" text-align="{$text-align}">
+ <!-- if the separator is not found, the total page number is skipped -->
+ <xsl:value-of select="$prefixe"/><fo:page-number/><xsl:if test="$sep != ''"><xsl:value-of select="$sep"/><fo:page-number-citation ref-id="term"/></xsl:if><xsl:value-of select="$postfixe"/>
+ </fo:block>
+ </xsl:if>
+ </xsl:template>
+
+<!-- ====================================================================== -->
+<!-- Temporary section - subject to change on short notice -->
+<!-- ====================================================================== -->
+
+ <xsl:template match="//style">
+ <!-- HACK: The OpenOffice.org input plugin currently produces
+ intermediate documents that contain a style element, invalid per
+ the Forrest Document DTD. This style element must be ignored
+ here. To find out why this is done this way, read the comments
+ attached to issue FOR-433. -->
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/footerinfo.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/footerinfo.xsl
new file mode 100644
index 0000000..3078708
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/footerinfo.xsl
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+<!--
+Named template to generate a short message in the PDF footer, from text in
+skinconf.xml. By default, the message is a copyright statement. If a credit
+with @role='pdf' is present, that is used instead. Eg:
+
+<credit role="pdf">
+ <name>Generated by Apache FOP 1.0-dev</name>
+ <url>http://xml.apache.org/fop/dev/</url>
+</credit>
+-->
+ <xsl:template name="info">
+ <xsl:variable name="disable-copyright-footer" select="//skinconfig/pdf/disable-copyright-footer"/>
+ <xsl:variable name="pdfcredit" select="//skinconfig/credits/credit[@role = 'pdf']"/>
+ <xsl:variable name="text">
+ <xsl:if test="$pdfcredit">
+ <xsl:value-of select="$pdfcredit/name"/>
+ </xsl:if>
+ <xsl:if test="not($pdfcredit) and not($disable-copyright-footer = 'true')">
+ <xsl:text>Copyright © </xsl:text><xsl:value-of select="//skinconfig/year"/> <xsl:value-of
+ select="//skinconfig/vendor"/><xsl:text> All rights reserved.</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="url" select="$pdfcredit/url"/>
+
+ <fo:block-container font-style="italic" absolute-position="absolute"
+ left="0pt" top="0pt" right="6.25in" bottom="150pt"
+ font-size="10pt">
+ <xsl:if test="not($url)">
+ <fo:block text-align="center" color="lightgrey">
+ <xsl:value-of select="$text"/>
+ </fo:block>
+ </xsl:if>
+ <xsl:if test="$url">
+ <fo:block text-align="center">
+ <fo:basic-link color="lightgrey"
+ external-destination="{$url}">
+ <xsl:value-of select="$text"/>
+ </fo:basic-link>
+ </fo:block>
+ <fo:block text-align="center">
+ <fo:basic-link color="lightgrey"
+ external-destination="{$url}">
+ <xsl:value-of select="$url"/>
+ </fo:basic-link>
+ </fo:block>
+ </xsl:if>
+ </fo:block-container>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/pdfoutline.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/pdfoutline.xsl
new file mode 100644
index 0000000..8c78fa4
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/fo/pdfoutline.xsl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:fox="http://xml.apache.org/fop/extensions"
+ version="1.0">
+
+<xsl:template match="document" mode="outline">
+ <xsl:apply-templates select="body/section" mode="outline"/>
+</xsl:template>
+
+<xsl:template match="section" mode="outline">
+ <fox:outline>
+ <xsl:attribute name="internal-destination">
+ <xsl:choose>
+ <xsl:when test="normalize-space(@id)!=''">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <fox:label>
+ <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="normalize-space(title)"/>
+
+ </fox:label>
+ <xsl:apply-templates select="section" mode="outline"/>
+ </fox:outline>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/book-to-menu.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/book-to-menu.xsl
new file mode 100644
index 0000000..c0fb183
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/book-to-menu.xsl
@@ -0,0 +1,186 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+book2menu.xsl generates the HTML menu. It outputs XML/HTML of the form:
+ <div class="menu">
+ ...
+ </div>
+which is then merged with other HTML by site2xhtml.xsl
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- ================================================================ -->
+ <!-- These templates SHOULD be overridden -->
+ <!-- ================================================================ -->
+
+ <xsl:template name="selected">
+ <xsl:value-of select="@label"/>
+ </xsl:template>
+
+ <xsl:template name="unselected">
+ <a href="{@href}">
+ <xsl:if test="@description">
+ <xsl:attribute name="title">
+ <xsl:value-of select="@description"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="@label"/>
+ </a>
+ </xsl:template>
+
+ <xsl:template name="print-external">
+ <!-- Use apply-imports when overriding -->
+ <xsl:value-of select="@label"/>
+ </xsl:template>
+
+
+ <!-- ================================================================ -->
+ <!-- These templates CAN be overridden -->
+ <!-- ================================================================ -->
+
+ <!-- Eg, if tab href is 'index.html#foo', this will be called when index.html
+ is selected -->
+ <xsl:template name="selected-anchor">
+ <!-- By default, render as unselected so that it is clickable (takes user
+ to the anchor) -->
+ <xsl:call-template name="unselected"/>
+ </xsl:template>
+
+ <xsl:template name="unselected-anchor">
+ <xsl:call-template name="unselected"/>
+ </xsl:template>
+
+
+ <xsl:template match="book">
+ <xsl:apply-templates select="menu"/>
+ </xsl:template>
+
+
+ <xsl:template match="menu">
+ <div class="menu">
+ <xsl:call-template name="base-menu"/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="menu-item">
+ <!-- Use apply-imports when overriding -->
+
+ <xsl:variable name="href-nofrag">
+ <xsl:call-template name="path-nofrag">
+ <xsl:with-param name="path" select="@href"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="node-path-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path">
+ <xsl:call-template name="normalize">
+ <xsl:with-param name="path" select="concat($dirname, $href-nofrag)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Compare with extensions stripped -->
+ <xsl:when test="$node-path-noext = $path-nofrag-noext">
+ <xsl:choose>
+ <xsl:when test="contains(@href, '#')">
+ <xsl:call-template name="selected-anchor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="selected"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="contains(@href, '#')">
+ <xsl:call-template name="unselected-anchor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="unselected"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ================================================================ -->
+ <!-- These templates SHOULD NOT be overridden -->
+ <!-- ================================================================ -->
+
+
+ <xsl:param name="path"/>
+
+ <xsl:include href="pathutils.xsl"/>
+
+ <xsl:variable name="filename">
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="path-nofrag">
+ <xsl:call-template name="path-nofrag">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="path-nofrag-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path">
+ <xsl:call-template name="path-nofrag">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="dirname">
+ <xsl:call-template name="dirname">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:template match="external">
+ <li>
+ <xsl:choose>
+ <xsl:when test="starts-with(@href, $path-nofrag)">
+ <span class="externalSelected">
+ <xsl:call-template name="print-external"/>
+ </span>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@href}" target="_blank"><xsl:value-of select="@label"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li>
+ </xsl:template>
+
+ <xsl:template match="menu-item[@type='hidden']"/>
+
+ <xsl:template match="external[@type='hidden']"/>
+
+ <xsl:template name="base-menu">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/document-to-html.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/document-to-html.xsl
new file mode 100644
index 0000000..1d90d14
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/document-to-html.xsl
@@ -0,0 +1,357 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains the majority of templates for converting documentv11
+to HTML. It renders XML as HTML in this form:
+
+ <div class="content">
+ ...
+ </div>
+
+..which site2xhtml.xsl then combines with HTML from the index (book2menu.xsl)
+and tabs (tab2menu.xsl) to generate the final HTML.
+
+Section handling
+ - <a name/> anchors are added if the id attribute is specified
+
+-->
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="dynamic-page" select="'false'"/>
+ <xsl:param name="notoc"/>
+ <xsl:param name="path"/>
+ <!-- <xsl:include href="split.xsl"/> -->
+ <xsl:include href="dotdots.xsl"/>
+ <xsl:include href="pathutils.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:variable name="skin-img-dir" select="concat(string($root), 'themes/images')"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates mode="toc"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="document">
+ <div class="content">
+ <table summary="" class="title">
+ <tr>
+ <td valign="middle">
+ <xsl:if test="normalize-space(header/title)!=''">
+ <h1>
+ <xsl:value-of select="header/title"/>
+ </h1>
+ </xsl:if>
+ </td>
+ <div id="skinconf-printlink"/>
+ <xsl:if test="$dynamic-page='false'">
+ <div id="skinconf-pdflink"/>
+ <div id="skinconf-xmllink"/>
+ </xsl:if>
+ </tr>
+ </table>
+ <xsl:if test="normalize-space(header/subtitle)!=''">
+ <h3>
+ <xsl:value-of select="header/subtitle"/>
+ </h3>
+ </xsl:if>
+ <xsl:apply-templates select="header/type"/>
+ <xsl:apply-templates select="header/notice"/>
+ <xsl:apply-templates select="header/abstract"/>
+ <xsl:apply-templates select="body"/>
+ <div class="attribution">
+ <xsl:apply-templates select="header/authors"/>
+ <xsl:if test="header/authors and header/version">
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates select="header/version"/>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="body">
+ <div id="skinconf-toc-page"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+
+ <!-- Generate a <a name="..."> tag for an @id -->
+ <xsl:template match="@id">
+ <xsl:if test="normalize-space(.)!=''">
+ <a name="{.}"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="section">
+ <!-- count the number of section in the ancestor-or-self axis to compute
+ the title element name later on -->
+ <xsl:variable name="sectiondepth" select="count(ancestor-or-self::section)"/>
+ <a name="{generate-id()}"/>
+ <xsl:apply-templates select="@id"/>
+ <!-- generate a title element, level 1 -> h3, level 2 -> h4 and so on... -->
+ <xsl:element name="{concat('h',$sectiondepth + 2)}">
+ <xsl:value-of select="title"/>
+ <xsl:if test="$notoc='true' and $sectiondepth = 3">
+ <span style="float: right"><a href="#{@id}-menu">^</a></span>
+ </xsl:if>
+ </xsl:element>
+
+ <!-- Indent FAQ entry text 15 pixels -->
+ <xsl:variable name="indent">
+ <xsl:choose>
+ <xsl:when test="$notoc='true' and $sectiondepth = 3">
+ <xsl:text>15</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div style="margin-left: {$indent} ; border: 2px">
+ <xsl:apply-templates select="*[not(self::title)]"/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="note | warning | fixme">
+ <xsl:apply-templates select="@id"/>
+ <div class="{local-name()}">
+ <div class="label">
+ <xsl:choose>
+ <!-- FIXME: i18n Transformer here -->
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
+ <xsl:when test="local-name() = 'note'">Note</xsl:when>
+ <xsl:when test="local-name() = 'warning'">Warning</xsl:when>
+ <xsl:otherwise>Fixme (<xsl:value-of select="@author"/>)</xsl:otherwise>
+ </xsl:choose>
+ </div>
+ <div class="content">
+ <xsl:apply-templates/>
+ </div>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="notice">
+ <div class="notice">
+ <!-- FIXME: i18n Transformer here -->
+ <xsl:text>Notice: </xsl:text>
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="link">
+ <xsl:apply-templates select="@id"/>
+ <a>
+ <xsl:if test="@class='jump'">
+ <xsl:attribute name="target">_top</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@class='fork'">
+ <xsl:attribute name="target">_blank</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </a>
+ </xsl:template>
+
+ <xsl:template match="jump">
+ <xsl:apply-templates select="@id"/>
+ <a href="{@href}" target="_top">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:template>
+
+ <xsl:template match="fork">
+ <xsl:apply-templates select="@id"/>
+ <a href="{@href}" target="_blank">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:template>
+
+ <xsl:template match="p[@xml:space='preserve']">
+ <xsl:apply-templates select="@id"/>
+ <div class="pre">
+ <xsl:copy-of select="@id"/>
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="source">
+ <xsl:apply-templates select="@id"/>
+ <pre class="code">
+<!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
+ <xsl:copy-of select="@id"/>
+ <xsl:apply-templates/>
+<!--
+ <xsl:call-template name="format">
+ <xsl:with-param select="." name="txt" />
+ <xsl:with-param name="width">80</xsl:with-param>
+ </xsl:call-template>
+-->
+ </pre>
+ </xsl:template>
+
+ <xsl:template match="anchor">
+ <a name="{@id}">
+ <xsl:copy-of select="@id"/>
+ </a>
+ </xsl:template>
+
+ <xsl:template match="icon">
+ <xsl:apply-templates select="@id"/>
+ <img class="icon">
+ <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
+ </img>
+ </xsl:template>
+
+ <xsl:template match="code">
+ <xsl:apply-templates select="@id"/>
+ <span class="codefrag">
+ <xsl:copy-of select="@id"/>
+ <xsl:value-of select="."/>
+ </span>
+ </xsl:template>
+
+ <xsl:template match="figure">
+ <xsl:apply-templates select="@id"/>
+
+ <div align="center">
+ <xsl:copy-of select="@id"/>
+ <img class="figure">
+ <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
+ </img>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="table">
+ <xsl:apply-templates select="@id"/>
+ <table cellpadding="4" cellspacing="1" class="ForrestTable">
+ <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor |@id"/>
+ <xsl:apply-templates/>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="acronym/@title">
+ <xsl:attribute name="title">
+ <xsl:value-of select="normalize-space(.)"/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="header/authors">
+ <xsl:if test="person">
+ <div id="content-authors">
+ <xsl:for-each select="person">
+ <div class="author">
+ <div class="name"><xsl:value-of select="@name"/></div>
+ <div class="email"><xsl:value-of select="@email"/></div>
+ </div>
+ </xsl:for-each>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="version">
+ <span class="version">
+ <xsl:apply-templates select="@major"/>
+ <xsl:apply-templates select="@minor"/>
+ <xsl:apply-templates select="@fix"/>
+ <xsl:apply-templates select="@tag"/>
+ <xsl:choose>
+ <xsl:when test="starts-with(., '$Revision: ')">
+ version <xsl:value-of select="substring(., 12, string-length(.) -11-2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </span>
+ </xsl:template>
+
+ <xsl:template match="@major">
+ v<xsl:value-of select="."/>
+ </xsl:template>
+
+ <xsl:template match="@minor | @fix">
+ <xsl:value-of select="concat('.',.)"/>
+ </xsl:template>
+
+ <xsl:template match="@tag">
+ <xsl:value-of select="concat('-',.)"/>
+ </xsl:template>
+
+ <xsl:template match="type">
+ <p class="type">
+ <!-- FIXME: i18n Transformer here -->
+ <xsl:text>Type: </xsl:text>
+ <xsl:value-of select="."/>
+ </p>
+ </xsl:template>
+
+ <xsl:template match="abstract">
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <xsl:template name="email">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('mailto:',@email)"/>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </xsl:template>
+
+ <xsl:template name="generate-id">
+ <xsl:choose>
+ <xsl:when test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:when test="@title">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" mode="toc"/>
+
+ <!-- End of "toc" mode templates -->
+
+ <xsl:template match="node()|@*" priority="-1">
+ <!-- id processing will create its own a-element so processing has to
+ happen outside the copied element
+ -->
+ <xsl:apply-templates select="@id"/>
+ <xsl:copy>
+ <xsl:apply-templates select="@*[name(.) != 'id']"/>
+ <xsl:copy-of select="@id"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/dotdots.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/dotdots.xsl
new file mode 100644
index 0000000..1be5b07
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/dotdots.xsl
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+Contains the 'dotdots' template, which, given a path, will output a set of
+directory traversals to get back to the source directory. Handles both '/' and
+'\' directory separators.
+
+Examples:
+ Input Output
+ index.html ""
+ dir/index.html "../"
+ dir/subdir/index.html "../../"
+ dir//index.html "../"
+ dir/ "../"
+ dir// "../"
+ \some\windows\path "../../"
+ \some\windows\path\ "../../../"
+ \Program Files\mydir "../"
+
+Cannot handle ..'s in the path, so don't expect 'dir/subdir/../index.html' to
+work.
+
+-->
+
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template name="dotdots">
+ <xsl:param name="path"/>
+ <xsl:variable name="dirs" select="normalize-space(translate(concat($path, 'x'), ' /\', '_ '))"/>
+ <!-- The above does the following:
+ o Adds a trailing character to the path. This prevents us having to deal
+ with the special case of ending with '/'
+ o Translates all directory separators to ' ', and normalize spaces,
+ cunningly eliminating duplicate '//'s. We also translate any real
+ spaces into _ to preserve them.
+ -->
+ <xsl:variable name="remainder" select="substring-after($dirs, ' ')"/>
+ <xsl:if test="$remainder">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="dotdots">
+ <xsl:with-param name="path" select="translate($remainder, ' ', '/')"/>
+ <!-- Translate back to /'s because that's what the template expects. -->
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+<!--
+ Uncomment to test.
+ Usage: saxon dotdots.xsl dotdots.xsl path='/my/test/path'
+
+ <xsl:param name="path"/>
+ <xsl:template match="/">
+ <xsl:message>Path: <xsl:value-of select="$path"/></xsl:message>
+ <xsl:call-template name="dotdots">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:template>
+ -->
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/pathutils.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/pathutils.xsl
new file mode 100644
index 0000000..9574e0f
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/pathutils.xsl
@@ -0,0 +1,239 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!--
+PathUtils.xsl
+
+A set of XSLT templates useful for parsing URI paths:
+
+dirname: return the directory part of a path
+filename: return the file part of a path
+ext: return the last extension of the filename in a path
+filename-noext: return the file part of a path without its last extension
+
+-->
+
+<!-- Returns the directory part of a path. Equivalent to Unix 'dirname'.
+Examples:
+'' -> ''
+'foo/index.html' -> 'foo/'
+-->
+<xsl:template name="dirname">
+ <xsl:param name="path" />
+ <xsl:if test="contains($path, '/')">
+ <xsl:value-of select="concat(substring-before($path, '/'), '/')" />
+ <xsl:call-template name="dirname">
+ <xsl:with-param name="path"
+ select="substring-after($path, '/')" />
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+<!-- Normalized (..'s eliminated) version of 'dirname' -->
+<xsl:template name="dirname-nz">
+ <xsl:param name="path" />
+ <xsl:call-template name="normalize">
+ <xsl:with-param name="path">
+ <xsl:call-template name="dirname">
+ <xsl:with-param name="path" select="$path" />
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+
+<!-- Returns the filename part of a path. Equivalent to Unix 'basename'
+Examples:
+'index.html' -> 'index.html'
+'foo/bar/' -> ''
+'foo/bar/index.html' -> 'index.html'
+-->
+<xsl:template name="filename">
+ <xsl:param name="path"/>
+ <xsl:choose>
+ <xsl:when test="contains($path, '/')">
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="substring-after($path, '/')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$path"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- Returns the last extension of a filename in a path.
+Examples:
+'index.html' -> '.html'
+'index.dtdx.html' -> '.html'
+'foo/bar/' -> ''
+'foo/bar/index.html' -> '.html'
+'foo/bar/index' -> ''
+-->
+<xsl:template name="ext">
+ <xsl:param name="path"/>
+ <xsl:param name="subflag"/> <!-- Outermost call? -->
+ <xsl:choose>
+ <xsl:when test="contains($path, '.')">
+ <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="substring-after($path, '.')"/>
+ <xsl:with-param name="subflag" select="'sub'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Handle extension-less filenames by returning '' -->
+ <xsl:when test="not($subflag) and not(contains($path, '.'))">
+ <xsl:text/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('.', $path)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- Returns a filename of a path stripped of its last extension.
+Examples:
+'foo/bar/index.dtdx.html' -> 'index.dtdx'
+-->
+<xsl:template name="filename-noext">
+ <xsl:param name="path"/>
+ <xsl:variable name="filename">
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="ext">
+ <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="$filename"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/>
+</xsl:template>
+
+<!-- Returns a path with the filename stripped of its last extension.
+Examples:
+'foo/bar/index.dtdx.html' -> 'foo/bar/index.dtdx'
+-->
+<xsl:template name="path-noext">
+ <xsl:param name="path"/>
+ <xsl:variable name="ext">
+ <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/>
+</xsl:template>
+
+<!-- Normalized (..'s eliminated) version of 'path-noext' -->
+<xsl:template name="path-noext-nz">
+ <xsl:param name="path" />
+ <xsl:call-template name="normalize">
+ <xsl:with-param name="path">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="$path" />
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- Returns a path with any fragment identifier ('#...') stripped off
+Examples:
+'foo/bar/index.dtdx.html#blah' -> 'foo/bar/index.dtdx.html'
+-->
+<xsl:template name="path-nofrag">
+ <xsl:param name="path"/>
+ <xsl:if test="not(contains($path, '#'))">
+ <xsl:value-of select="$path"/>
+ </xsl:if>
+ <xsl:if test="contains($path, '#')">
+ <xsl:value-of select="substring-before($path, '#')"/>
+ </xsl:if>
+</xsl:template>
+
+
+
+<!-- Normalizes a path, converting '/' to '\' and eliminating ..'s
+Examples:
+'foo/bar/../baz/index.html' -> foo/baz/index.html'
+-->
+<xsl:template name="normalize">
+ <xsl:param name="path"/>
+ <xsl:variable name="path-" select="translate($path, '\', '/')"/>
+ <xsl:choose>
+ <xsl:when test="contains($path-, '/../')">
+
+ <xsl:variable name="pa" select="substring-before($path-, '/../')"/>
+ <xsl:variable name="th" select="substring-after($path-, '/../')"/>
+ <xsl:variable name="pa-">
+ <xsl:call-template name="dirname">
+ <xsl:with-param name="path" select="$pa"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pa-th" select="concat($pa-, $th)"/>
+ <xsl:call-template name="normalize">
+ <xsl:with-param name="path" select="$pa-th"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:value-of select="$path-"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+</xsl:template>
+
+<!--
+Uncomment this to test.
+Usage: saxon pathutils.xsl pathutils.xsl path=foo/bar
+
+<xsl:param name="path" select="'/foo/bar/../baz/index.html'"/>
+<xsl:template match="/">
+ <xsl:message>
+ path = <xsl:value-of select="$path"/>
+ normalize = <xsl:call-template name="normalize">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ dirname = <xsl:call-template name="dirname">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ dirname-nz = <xsl:call-template name="dirname-nz">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ filename = <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ ext = <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ filename-noext = <xsl:call-template name="filename-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ path-noext = <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ path-noext-nz = <xsl:call-template name="path-noext-nz">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ path-nofrag = <xsl:call-template name="path-nofrag">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+
+ </xsl:message>
+</xsl:template>
+-->
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/renderlogo.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/renderlogo.xsl
new file mode 100644
index 0000000..0ff51a2
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/renderlogo.xsl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+A simple callable template that renders a logo for an entity. The logo will
+be a hyperlink and may include an image (with width and height if specified)
+or else it will just include the specified text.
+
+Note that text and image are mandatory parts of the template.
+-->
+
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template name="renderlogo">
+ <xsl:param name="name"/>
+ <xsl:param name="url"/>
+ <xsl:param name="logo"/>
+ <xsl:param name="width"/>
+ <xsl:param name="height"/>
+ <xsl:param name="root"/>
+ <xsl:param name="description"/>
+ <a href="{$url}">
+ <xsl:choose>
+ <xsl:when test="$logo and not($logo = '')">
+ <img alt="{$name}" class="logoImage">
+ <xsl:attribute name="src">
+ <xsl:if test="not(starts-with($logo, 'http://'))"><xsl:value-of select="$root"/></xsl:if>
+ <xsl:value-of select="$logo"/>
+ </xsl:attribute>
+ <xsl:if test="$width">
+ <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$height">
+ <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$description">
+ <xsl:attribute name="title"><xsl:value-of select="$description"/></xsl:attribute>
+ </xsl:if>
+ </img>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
+ </xsl:choose>
+ </a>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/site-to-xhtml.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/site-to-xhtml.xsl
new file mode 100644
index 0000000..4707f44
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/site-to-xhtml.xsl
@@ -0,0 +1,343 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+site2xhtml.xsl is the final stage in HTML page production. It merges HTML from
+document2html.xsl, tab2menu.xsl and book2menu.xsl, and adds the site header,
+footer, searchbar, css etc. As input, it takes XML of the form:
+
+<site>
+ <div class="menu">
+ ...
+ </div>
+ <div class="tab">
+ ...
+ </div>
+ <div class="content">
+ ...
+ </div>
+</site>
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="path"/>
+
+ <!-- Path (..'s) to the root directory -->
+ <xsl:variable name="root">
+ <xsl:call-template name="dotdots">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Source filename (eg 'foo.xml') of current page -->
+ <xsl:variable name="filename">
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Path of Lucene search results page (relative to $root) -->
+ <xsl:param name="lucene-search" select="'lucene-search.html'"/>
+
+ <xsl:variable name="filename-noext">
+ <xsl:call-template name="filename-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+<!-- <xsl:template match="site">
+ <html>
+ <head>
+ <title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
+ <xsl:if test="//skinconfig/favicon-url">
+ <link rel="shortcut icon">
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
+ </xsl:attribute>
+ </link>
+ </xsl:if>
+ </head>
+ <body>
+ <xsl:if test="//skinconfig/group-url">
+ <xsl:call-template name="renderlogo">
+ <xsl:with-param name="name" select="//skinconfig/group-name"/>
+ <xsl:with-param name="url" select="//skinconfig/group-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
+ <xsl:with-param name="root" select="$root"/>
+ <xsl:with-param name="description" select="//skinconfig/group-description"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template name="renderlogo">
+ <xsl:with-param name="name" select="//skinconfig/project-name"/>
+ <xsl:with-param name="url" select="//skinconfig/project-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
+ <xsl:with-param name="root" select="$root"/>
+ <xsl:with-param name="description" select="//skinconfig/project-description"/>
+ </xsl:call-template>
+ <xsl:comment>================= start Tabs ==================</xsl:comment>
+ <xsl:apply-templates select="div[@class='tab']"/>
+ <xsl:comment>================= end Tabs ==================</xsl:comment>
+ <xsl:comment>================= start Menu items ==================</xsl:comment>
+ <xsl:apply-templates select="div[@class='menu']"/>
+ <xsl:comment>================= end Menu items ==================</xsl:comment>
+ <xsl:comment>================= start Content==================</xsl:comment>
+ <xsl:apply-templates select="div[@class='content']"/>
+ <xsl:comment>================= end Content==================</xsl:comment>
+
+ <xsl:comment>================= start Footer ==================</xsl:comment>
+ <xsl:choose>
+ <xsl:when test="$config/copyright-link">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="$config/copyright-link"/>
+ </xsl:attribute>
+ Copyright © <xsl:value-of select="$config/year"/> 
+ <xsl:value-of select="$config/vendor"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ Copyright © <xsl:value-of select="$config/year"/> 
+ <xsl:value-of select="$config/vendor"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ All rights reserved.
+ <script language="JavaScript" type="text/javascript"><![CDATA[<!-#-
+ document.write(" - "+"Last Published: " + document.lastModified);
+ // -#->]]></script>
+ <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
+ <a href="{//skinconfig/host-url}">
+ <xsl:call-template name="renderlogo">
+ <xsl:with-param name="name" select="//skinconfig/host-name"/>
+ <xsl:with-param name="url" select="//skinconfig/host-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
+ <xsl:with-param name="root" select="$root"/>
+ </xsl:call-template>
+ </a>
+ </xsl:if>
+ <xsl:if test="$filename = 'index.html' and //skinconfig/credits">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
+ <xsl:call-template name="renderlogo">
+ <xsl:with-param name="name" select="name"/>
+ <xsl:with-param name="url" select="url"/>
+ <xsl:with-param name="logo" select="image"/>
+ <xsl:with-param name="root" select="$root"/>
+ <xsl:with-param name="width" select="width"/>
+ <xsl:with-param name="height" select="height"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <a href="http://validator.w3.org/check/referer"><img class="skin" border="0"
+ src="http://www.w3.org/Icons/valid-html401"
+ alt="Valid HTML 4.01!" height="31" width="88"/></a>
+ </body>
+ </html>
+ </xsl:template>
+
+ <!-#- Add links to any standards-compliance logos -#->
+ <xsl:template name="compliancy-logos">
+ <xsl:if test="$filename = 'index.html' and //skinconfig/disable-compliance-links = 'false'">
+ <a href="http://validator.w3.org/check/referer"><img class="logoImage"
+ src="{$skin-img-dir}/valid-html401.png"
+ alt="Valid HTML 4.01!" title="Valid HTML 4.01!" height="31" width="88" border="0"/></a>
+
+ <a href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logoImage"
+ src="{$skin-img-dir}/vcss.png"
+ alt="Valid CSS!" title="Valid CSS!" height="31" width="88" border="0"/></a>
+ </xsl:if>
+ </xsl:template>
+
+ <!-#- Generates the PDF link -#->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
+ <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
+ PDF</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-#- Generates the TXT link -#->
+ <xsl:template match="div[@id='skinconf-txtlink']">
+ <xsl:if test="$disable-txt-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.txt" class="dida">
+ <img class="skin" src="{$skin-img-dir}/txtdoc.png" alt="TXT"/><br/>
+ TXT</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-#- Generates the POD link -#->
+ <xsl:template match="div[@id='skinconf-podlink']">
+ <xsl:if test="$disable-pod-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pod" class="dida">
+ <img class="skin" src="{$skin-img-dir}/poddoc.png" alt="POD"/><br/>
+ POD</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-#- Generates the XML link -#->
+ <xsl:template match="div[@id='skinconf-xmllink']">
+ <xsl:if test="$disable-xml-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
+ <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="XML"/><br/>
+ XML</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-#- Generates the "printer friendly version" link -#->
+ <xsl:template match="div[@id='skinconf-printlink']">
+ <xsl:if test="$disable-print-link = 'false'">
+<script type="text/javascript" language="Javascript">
+function printit() {
+ if (window.print) {
+ window.focus();
+ window.print();
+ }
+}
+
+var NS = (navigator.appName == "Netscape");
+var VERSION = parseInt(navigator.appVersion);
+if (VERSION > 3) {
+ document.write('<td align="center" width="40" nowrap="nowrap">');
+ document.write(' <a href="javascript:printit()" class="dida">');
+ document.write(' <img class="skin" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/><br />');
+ document.write(' print</a>');
+ document.write('</td>');
+}
+</script>
+
+ </xsl:if>
+ </xsl:template>
+
+ <!-#- handle all obfuscating mail links and disabling external link images -#->
+ <xsl:template match="a">
+ <xsl:choose>
+ <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')">
+ <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
+ <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
+ <xsl:variable name="obfuscation" select="normalize-space(//skinconfig/obfuscate-mail-value)"/>
+ <a href="{$mailto-1}{$obfuscation}{$mailto-2}">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))">
+ <a href="{@href}" class="external">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-#- xsl:copy-of makes sure we copy <a href> as well as <a name>
+ or any other <a ...> forms -#->
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="div[@id='skinconf-toc-page']">
+ <xsl:if test="$config/toc">
+ <xsl:if test="contains($minitoc-location,'page')">
+ <xsl:if test="count(//tocitems/tocitem) >= $config/toc/@min-sections">
+ <xsl:call-template name="minitoc">
+ <xsl:with-param name="tocroot" select="//tocitems"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="minitoc">
+ <xsl:param name="tocroot"/>
+ <xsl:if test="count($tocroot/tocitem) >= $config/toc/@min-sections">
+ <xsl:if test="contains($config/toc/@location,'page')">
+ <ul class="minitoc">
+ <xsl:for-each select="$tocroot/tocitem">
+ <li>
+ <a href="{@href}">
+ <xsl:value-of select="@title"/>
+ </a>
+ <xsl:if test="@level<//skinconfig/toc/@max-depth+1">
+ <xsl:call-template name="minitoc">
+ <xsl:with-param name="tocroot" select="."/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="html-meta">
+ <meta name="Generator" content="Apache Forrest"/>
+ <meta name="Forrest-version">
+ <xsl:attribute name="content">
+ <xsl:value-of select="//info/forrest-version"/>
+ </xsl:attribute>
+ </meta>
+ <meta name="Forrest-skin-name">
+ <xsl:attribute name="content">
+ <xsl:value-of select="//info/project-skin"/>
+ </xsl:attribute>
+ </meta>
+ </xsl:template>
+
+ <!-#- meta information from v 2.0 documents
+ FIXME: the match is really inefficient -#->
+ <xsl:template name="meta-data">
+ <xsl:for-each select="//meta-data/meta">
+ <xsl:element name="meta">
+ <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+ <xsl:attribute name="content"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:if test="@xml:lang">
+ <xsl:attribute name="lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="feedback">
+ <div id="feedback">
+ <xsl:value-of select="$config/feedback"/>
+ <xsl:choose>
+ <xsl:when test="$config/feedback/@href and not($config/feedback/@href='')">
+ <a id="feedbackto">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$config/feedback/@href"/>
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ <xsl:value-of select="$config/feedback/@to"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$config/feedback/@to"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>-->
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/split.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/split.xsl
new file mode 100644
index 0000000..46b0292
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/split.xsl
@@ -0,0 +1,142 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!--
+ This stylesheet was taken from the XSLT FAQ http://www.dpawson.co.uk/xsl/
+
+ Comments and adaption to be used without normalize-space()
+ by forrest-dev@xml.apache.org
+-->
+
+<!--
+ Input:
+
+<doc>
+
+<para>
+ 123456 2345 343434 545454 43434 343
+ 12345 343434 545454 43434 343
+ 32345645 343434 545454 43434 343
+ 3422222225 343434 545454 43434 343
+ llllllllllllllllllllllooooooooooooooonnnnnnnnnnnggggggggg
+ 345 343434 545454 43434 343
+</para>
+
+</doc>
+
+Output:
+
+<HTML>
+<BODY>
+<PRE>123456 2345 343434 545454
+43434 343 12345 343434 545454
+43434 343 32345645 343434
+545454 43434 343 3422222225
+343434 545454 43434 343
+lllllllllllllllllllllloooooooo
+ooooooonnnnnnnnnnnggggggggg
+345 343434 545454 43434
+343
+</PRE>
+</BODY>
+</HTML>
+
+Fragment ised:
+
+ <xsl:template match="/doc">
+ <HTML><BODY><PRE>
+ <xsl:call-template name="format">
+ <xsl:with-param select="normalize-space(para)" name="txt" />
+ <xsl:with-param name="width">30</xsl:with-param>
+ </xsl:call-template>
+ </PRE></BODY></HTML>
+ </xsl:template>
+
+
+-->
+
+ <xsl:template match="/body">
+ <body>
+ <xsl:call-template name="format">
+ <xsl:with-param select="source" name="txt" />
+ <xsl:with-param name="width">40</xsl:with-param>
+ </xsl:call-template>
+ </body>
+ </xsl:template>
+
+ <xsl:template name="format">
+ <xsl:param name="txt" />
+ <xsl:param name="width" />
+
+ <!-- if there is still text left -->
+ <xsl:if test="$txt">
+
+ <xsl:variable name = "pretxt" select = "substring($txt,0, $width)" />
+
+ <xsl:choose>
+ <xsl:when test="contains($pretxt, '
')">
+ <xsl:value-of select="substring-before($pretxt, '
')"/>
+ <xsl:text>
</xsl:text>
+ <xsl:call-template name="format">
+ <xsl:with-param name="txt" select="substring-after($txt,'
')"/>
+ <xsl:with-param select="$width" name="width" />
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <!-- get the width at which to break-->
+ <xsl:variable name="real-width">
+ <xsl:call-template name="tune-width">
+ <xsl:with-param select="$txt" name="txt" />
+ <xsl:with-param select="$width" name="width" />
+ <xsl:with-param select="$width" name="def" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- output the first part of the broken string -->
+ <xsl:value-of select="substring($txt, 1, $real-width)" />
+
+ <!-- output a newline -->
+ <xsl:text>
</xsl:text>
+
+ <!-- call itself with the remaining part of the text -->
+ <xsl:call-template name="format">
+ <xsl:with-param select="substring($txt,$real-width + 1)" name="txt" />
+ <xsl:with-param select="$width" name="width" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!-- used by template "format", it calculates the width at the given def
+
+ It starts at def length and comes back till it finds a space -->
+ <xsl:template name="tune-width">
+ <xsl:param name="txt" />
+ <xsl:param name="width" />
+ <xsl:param name="def" />
+
+ <xsl:choose>
+ <xsl:when test="$width = 0">
+ <xsl:value-of select="$def" />
+ </xsl:when>
+
+ <xsl:when test="substring($txt, $width, 1 ) = ' '">
+ <xsl:value-of select="$width" />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <!-- otherwise need to tune again, trying with $width - 1 -->
+ <xsl:call-template name="tune-width">
+ <xsl:with-param select="$width - 1" name="width" />
+ <xsl:with-param select="$txt" name="txt" />
+ <xsl:with-param select="$def" name="def" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+ </xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/strip_namespaces.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/strip_namespaces.xsl
new file mode 100644
index 0000000..2b08c37
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/strip_namespaces.xsl
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Fixes FOR-555. This might not be the best solution though, but it sure works -->
+ <xsl:template match="comment()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|*|text()|processing-instruction()|comment()"/>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="*">
+ <!-- remove element prefix (if any) -->
+ <xsl:element name="{local-name()}">
+ <!-- process attributes -->
+ <xsl:for-each select="@*">
+ <!-- remove attribute prefix (if any) -->
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/tab-to-menu.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/tab-to-menu.xsl
new file mode 100644
index 0000000..0b5d6d5
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/tab-to-menu.xsl
@@ -0,0 +1,227 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet generates 'tabs' at the top left of the screen. Tabs are
+visual indicators that a certain subsection of the URI space is being browsed.
+For example, if we had tabs with paths:
+
+Tab1: ''
+Tab2: 'community'
+Tab3: 'community/howto'
+Tab4: 'community/howto/xmlform/index.html'
+
+Then if the current path was 'community/howto/foo', Tab3 would be highlighted.
+The rule is: the tab with the longest path that forms a prefix of the current
+path is enabled.
+
+The output of this stylesheet is HTML of the form:
+ <div class="tab">
+ ...
+ </div>
+
+which is then merged by site2xhtml.xsl
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!-- ================================================================ -->
+ <!-- These templates SHOULD be overridden -->
+ <!-- ================================================================ -->
+
+ <!-- Called before first level 1 tag -->
+ <xsl:template name="pre-separator">
+ </xsl:template>
+
+ <!-- Called after last level 1 tag -->
+ <xsl:template name="post-separator">
+ </xsl:template>
+
+ <!-- Called between level 1 tags -->
+ <xsl:template name="separator">
+ <xsl:text> | </xsl:text>
+ </xsl:template>
+
+ <!-- Called before first level 2 tag -->
+ <xsl:template name="level2-pre-separator">
+ </xsl:template>
+
+ <!-- Called after last level 2 tag -->
+ <xsl:template name="level2-post-separator">
+ </xsl:template>
+
+ <!-- Called between level 2 tags -->
+ <xsl:template name="level2-separator">
+ <xsl:text> | </xsl:text>
+ </xsl:template>
+
+ <!--
+ Note: sub-stylesheets can't do apply-imports here, because it would choose
+ the 'tags' template and infinitely recurse. Hence call-template used instead.
+ -->
+
+ <!-- Display a selected level 1 tab node -->
+ <xsl:template name="selected">
+ <xsl:call-template name="base-selected"/>
+ </xsl:template>
+
+ <!-- Display an unselected level 1 tab node -->
+ <xsl:template name="not-selected">
+ <xsl:call-template name="base-not-selected"/>
+ </xsl:template>
+
+ <!-- Display a selected second level tab node -->
+ <xsl:template name="level2-selected">
+ <xsl:call-template name="base-selected"/>
+ </xsl:template>
+
+ <!-- Display an unselected second level tab node -->
+ <xsl:template name="level2-not-selected">
+ <xsl:call-template name="base-not-selected"/>
+ </xsl:template>
+
+ <!-- ================================================================ -->
+ <!-- These templates CAN be overridden -->
+ <!-- ================================================================ -->
+
+ <xsl:template match="tabs">
+ <div class="tab">
+ <xsl:call-template name="base-tabs"/>
+ </div>
+ </xsl:template>
+
+
+ <!-- ================================================================ -->
+ <!-- These templates SHOULD NOT be overridden -->
+ <!-- ================================================================ -->
+
+ <xsl:param name="path"/>
+
+ <xsl:include href="dotdots.xsl"/>
+ <xsl:include href="tabutils.xsl"/>
+
+ <!-- NOTE: Xalan has a bug (race condition?) where sometimes $root is only half-evaluated -->
+ <xsl:variable name="root">
+ <xsl:call-template name="dotdots">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="skin-img-dir" select="concat(string($root), 'themes/images')"/>
+
+ <!--
+ The longest path of any level 1 tab, whose path is a subset of the current URL. Ie,
+ the path of the 'current' level 1 tab.
+ -->
+ <xsl:variable name="longest-dir">
+ <xsl:call-template name="longest-dir">
+ <xsl:with-param name="tabfile" select="/"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!--
+ The longest path of any level 2 tab, whose path is a subset of the current URL. Ie,
+ the path of the 'current' level 2 tab.
+ -->
+ <xsl:variable name="level2-longest-dir">
+ <xsl:call-template name="level2-longest-dir">
+ <xsl:with-param name="tabfile" select="/"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="matching-id">
+ <xsl:call-template name="matching-id"/>
+ </xsl:variable>
+
+ <!-- Called from tabs, after it has written the outer 'div class=tabs' and
+ any other HTML -->
+ <xsl:template name="base-tabs">
+ <xsl:call-template name="pre-separator"/>
+ <xsl:for-each select="tab">
+ <xsl:if test="position()!=1"><xsl:call-template name="separator"/></xsl:if>
+ <xsl:apply-templates select="." mode="level1"/>
+ </xsl:for-each>
+ <xsl:call-template name="post-separator"/>
+ </xsl:template>
+
+ <!-- Called from tabs, after it has written the outer 'div class=tabs' and
+ any other HTML -->
+ <xsl:template name="level2tabs">
+ <xsl:call-template name="level2-pre-separator"/>
+ <xsl:for-each select="tab[@dir=$longest-dir]/tab|tab[@href=$longest-dir]/tab">
+ <xsl:if test="position()!=1"><xsl:call-template name="level2-separator"/></xsl:if>
+ <xsl:apply-templates select="." mode="level2"/>
+ </xsl:for-each>
+ <xsl:call-template name="level2-post-separator"/>
+ </xsl:template>
+
+ <xsl:template match="tab" mode="level1">
+ <xsl:choose>
+ <xsl:when test="@id and @id = $matching-id">
+ <xsl:call-template name="selected"/>
+ </xsl:when>
+ <xsl:when test="not(@id) and @dir = $longest-dir or @href = $longest-dir">
+ <xsl:call-template name="selected"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="not-selected"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="tab" mode="level2">
+ <xsl:choose>
+ <xsl:when test="@id and @id = $matching-id">
+ <xsl:call-template name="level2-selected"/>
+ </xsl:when>
+ <xsl:when test="@dir = $level2-longest-dir">
+ <xsl:call-template name="level2-selected"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="level2-not-selected"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Called from 'selected' -->
+ <xsl:template name="base-selected">
+ <a class="base-selected">
+ <xsl:attribute name="href">
+ <xsl:call-template name="calculate-tab-href">
+ <xsl:with-param name="tab" select="."/>
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:value-of select="@label"/>
+ </a>
+ </xsl:template>
+
+ <!-- Called from 'not-selected' -->
+ <xsl:template name="base-not-selected">
+ <a class="base-not-selected">
+ <xsl:attribute name="href">
+ <xsl:call-template name="calculate-tab-href">
+ <xsl:with-param name="tab" select="."/>
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:value-of select="@label"/>
+ </a>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/tabutils.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/tabutils.xsl
new file mode 100644
index 0000000..9f35a97
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/html/tabutils.xsl
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+Some callable templates useful when dealing with tab paths. Mostly used in
+tab2menu.xsl
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:include href="pathutils.xsl"/>
+
+ <xsl:param name="site-file" select="'cocoon://abs-menulinks'"/>
+ <xsl:variable name="site" select="document($site-file)"/>
+
+ <!-- Given the current path and a tabs.xml entry, returns a relative path to
+ the specified tab's URL. When rendering a set of tabs, this template will be
+ called once per tab.
+ -->
+ <xsl:template name="calculate-tab-href">
+
+ <xsl:param name="dir_index" select="'index.html'"/>
+
+ <xsl:param name="tab"/> <!-- current 'tab' node -->
+ <xsl:param name="path" select="$path"/>
+
+ <xsl:if test="starts-with($tab/@href, 'http')"> <!-- Absolute URL -->
+ <xsl:value-of select="$tab/@href"/>
+ </xsl:if>
+ <xsl:if test="not(starts-with($tab/@href, 'http'))"> <!-- Root-relative path -->
+ <xsl:variable name="backpath">
+ <xsl:call-template name="dotdots">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="$tab/@dir | $tab/@href"/>
+ <!-- If we obviously have a directory, add /index.html -->
+ <xsl:if test="$tab/@dir or substring($tab/@href, string-length($tab/@href),
+ string-length($tab/@href)) = '/'">
+ <xsl:text>/</xsl:text>
+ <xsl:if test="$tab/@indexfile">
+ <xsl:value-of select="$tab/@indexfile"/>
+ </xsl:if>
+ <xsl:if test="not(@indexfile)">
+ <xsl:value-of select="$dir_index"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:value-of
+ select="translate(normalize-space(translate($backpath, ' /', '/ ')), ' /', '/ ')"/>
+ <!-- Link to backpath, normalizing slashes -->
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ The id of any tab, whose path is a subset of the current URL. Ie,
+ the path of the 'current' tab.
+ -->
+ <xsl:template name="matching-id" xmlns:l="http://apache.org/forrest/linkmap/1.0">
+ <xsl:variable name="path-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$site//*[starts-with(@href, $path-noext)]/@tab"/>
+ </xsl:template>
+
+ <!--
+ The longest path of any level 1 tab, whose path is a subset of the current URL. Ie,
+ the path of the 'current' tab.
+ -->
+ <xsl:template name="longest-dir">
+ <xsl:param name="tabfile"/>
+ <xsl:for-each select="$tabfile/tabs/tab[starts-with($path, @dir|@href)]">
+ <xsl:sort select="string-length(@dir|@href)"
+ data-type="number" order="descending"/>
+ <xsl:if test="position()=1">
+ <xsl:value-of select="@dir|@href"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!--
+ The longest path of any level 2 tab, whose path is a subset of the current URL. Ie,
+ the path of the 'current' tab.
+ -->
+ <xsl:template name="level2-longest-dir">
+ <xsl:param name="tabfile"/>
+ <xsl:for-each select="$tabfile/tabs/tab/tab[starts-with($path, @dir|@href)]">
+ <xsl:sort select="string-length(@dir|@href)"
+ data-type="number" order="descending"/>
+ <xsl:if test="position()=1">
+ <xsl:value-of select="@dir|@href"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+
+</xsl:stylesheet>
+
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/svg/document2svg.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/svg/document2svg.xsl
new file mode 100644
index 0000000..ddfa8ca
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/common/xslt/svg/document2svg.xsl
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
+ <xsl:output method="xml" media-type="image/svg" omit-xml-declaration="yes" indent="yes"/>
+
+ <!-- the skinconf file -->
+ <xsl:param name="config-file"/>
+ <xsl:variable name="config" select="document($config-file)/skinconfig"/>
+ <!-- Get the section depth to use when generating the minitoc (default is 2) -->
+ <xsl:variable name="toc-max-depth" select="number($config/toc/@max-depth)"/>
+
+ <xsl:param name="numbersections" select="'true'"/>
+
+ <!-- Section depth at which we stop numbering and just indent -->
+ <xsl:param name="numbering-max-depth" select="'3'"/>
+ <xsl:param name="ctxbasedir" select="."/>
+ <xsl:param name="xmlbasedir"/>
+
+ <xsl:template match="/">
+ <svg width="1305" height="1468" xmlns="http://www.w3.org/2000/svg">
+ <g transform="translate(0 0)">
+ <xsl:apply-templates/>
+ </g>
+ </svg>
+ </xsl:template>
+
+ <xsl:template match="document">
+ <text x="00px" y="30px" style="font-size:20;"><xsl:value-of select="header/title"/></text>
+ <text x="0px" y="50px" style="font-size:12;">
+ <xsl:apply-templates/>
+ </text>
+ </xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/contract-strip-xsl.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/contract-strip-xsl.xsl
new file mode 100644
index 0000000..2a0b6ca
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/contract-strip-xsl.xsl
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:param name="format"/>
+ <xsl:template match="/">
+ <xsl:copy-of select="forrest:contract/forrest:template[@format=$format]/xsl:stylesheet"/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/contract.property.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/contract.property.xsl
new file mode 100644
index 0000000..41efe4d
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/contract.property.xsl
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:param name="format"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="//forrest:template"/>
+ </xsl:template>
+
+ <xsl:template match="forrest:template[@format=$format]">
+ <forrest:property format="{@format}"
+ body="{@body}"
+ head="{@head}"
+ name="{@name}"/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/get.structurer.by.requested.format.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/get.structurer.by.requested.format.xsl
new file mode 100644
index 0000000..40fee54
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/get.structurer.by.requested.format.xsl
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:param name="format"/>
+
+ <xsl:template match="/">
+ <xsl:copy-of select="forrest:views/forrest:view[@type=$format]"/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/generateId.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/generateId.xsl
new file mode 100644
index 0000000..80cfe8f
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/generateId.xsl
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+
+ <xsl:template name="generate-id">
+ <xsl:choose>
+ <xsl:when test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:value-of select="title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher.xsl
new file mode 100644
index 0000000..b2123ca
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher.xsl
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!--This template will match the different combinations for forrest:hooks-->
+ <xsl:template match="forrest:hook[@name and (@type='div' or not(@type) and not(@class))]">
+ <div id="{@name}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </div>
+ </xsl:template>
+ <xsl:template match="forrest:hook[@class and (@type='div' or not(@type))]">
+ <div class="{@class}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </div>
+ </xsl:template>
+ <xsl:template match="forrest:hook[@class and @type='span']">
+ <span class="{@class}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </span>
+ </xsl:template>
+ <xsl:template match="forrest:hook[@name and @type='span']">
+ <span id="{@name}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </span>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/book-to-menu.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/book-to-menu.xsl
new file mode 100644
index 0000000..d8d9c99
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/book-to-menu.xsl
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+book2menu.xsl generates the HTML menu. See the imported book2menu.xsl for
+details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:import href="../common/xslt/html/book-to-menu.xsl"/>
+
+ <xsl:template match="book">
+ <div id="menu">
+ <ul>
+ <xsl:apply-templates select="menu"/>
+ </ul>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="menu">
+ <li>
+ <h1><xsl:value-of select="@label"/></h1>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </li>
+ </xsl:template>
+
+ <xsl:template match="menu-item[@type='hidden']"/>
+
+ <xsl:template match="menu-item">
+ <li>
+ <xsl:apply-imports/>
+ </li>
+ </xsl:template>
+
+ <xsl:template name="selected">
+ <div class="current"><xsl:value-of select="@label"/></div>
+ </xsl:template>
+
+ <xsl:template name="print-external">
+ <font color="#ffcc00">
+ <xsl:apply-imports/>
+ </font>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl
new file mode 100644
index 0000000..3131e85
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl
@@ -0,0 +1,164 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:import href="../common/xslt/html/document-to-html.xsl"/>
+ <xsl:include href="../helper/generateId.xsl"/>
+ <xsl:template match="document">
+ <div id="content">
+ <xsl:if test="normalize-space(header/title)!=''">
+ <h1>
+ <xsl:value-of select="header/title"/>
+ </h1>
+ </xsl:if>
+ <xsl:if test="normalize-space(header/subtitle)!=''">
+ <h3>
+ <xsl:value-of select="header/subtitle"/>
+ </h3>
+ </xsl:if>
+ <!--
+ <xsl:apply-templates select="header/type"/>
+ <xsl:apply-templates select="header/notice"/>
+ <xsl:apply-templates select="header/abstract"/>
+ <xsl:apply-templates select="body"/>
+
+ <div class="attribution">
+ <xsl:apply-templates select="header/authors"/>
+ <xsl:if test="header/authors and header/version">
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates select="header/version"/>
+ </div>
+ -->
+ <div id="content-main">
+ <xsl:apply-templates select="body"/>
+ </div>
+ </div>
+ </xsl:template>
+ <xsl:template match="body">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <xsl:template name="tocLinkGenerator">
+ <a>
+ <xsl:attribute name="name"><xsl:call-template
+ name="generate-id"/></xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="title"/>
+ </xsl:attribute><xsl:text> </xsl:text>
+ </a>
+ </xsl:template>
+ <!--<xsl:template match="@id">
+ <xsl:apply-imports/>
+ </xsl:template>-->
+ <!-- Generate a <a name="..."> tag for an @id -->
+ <!--<xsl:template match="@id">
+ <xsl:if test="normalize-space(.)!=''">
+ <a name="{.}"> </a>
+ </xsl:if>
+ </xsl:template>-->
+ <xsl:template match="section">
+ <xsl:call-template name="tocLinkGenerator"/>
+ <!-- <xsl:apply-templates select="@id"/>-->
+ <xsl:variable name = "level" select = "count(ancestor::section)+1" />
+ <xsl:choose>
+ <xsl:when test="$level=1">
+ <div class="skinconf-heading-{$level}">
+ <h1>
+ <xsl:value-of select="title"/>
+ </h1>
+ </div>
+ <div class="section">
+ <xsl:apply-templates select="*[not(self::title)]"/>
+ </div>
+ </xsl:when>
+ <xsl:when test="$level=2">
+ <div class="skinconf-heading-{$level}">
+ <h2>
+ <xsl:value-of select="title"/>
+ </h2>
+ </div>
+ <xsl:apply-templates select="*[not(self::title)]"/>
+ </xsl:when>
+ <!-- If a faq, answer sections will be level 3 (1=Q/A, 2=part) -->
+ <xsl:when test="$level=3 and $notoc='true'">
+ <h4 class="faq">
+ <xsl:value-of select="title"/>
+ </h4>
+ <div align="right">
+ <a href="#{@id}-menu">^</a>
+ </div>
+ <div style="margin-left: 15px">
+ <xsl:apply-templates select="*[not(self::title)]"/>
+ </div>
+ </xsl:when>
+ <xsl:when test="$level=3">
+ <h4>
+ <xsl:value-of select="title"/>
+ </h4>
+ <xsl:apply-templates select="*[not(self::title)]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <h5>
+ <xsl:value-of select="title"/>
+ </h5>
+ <xsl:apply-templates select="*[not(self::title)]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="figure">
+ <xsl:apply-templates select="@id"/>
+ <div style="text-align: center;">
+ <img src="{@src}" alt="{@alt}" class="figure">
+ <xsl:if test="@height">
+ <xsl:attribute name="height">
+ <xsl:value-of select="@height"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@width">
+ <xsl:attribute name="width">
+ <xsl:value-of select="@width"/>
+ </xsl:attribute>
+ </xsl:if>
+ </img>
+ </div>
+ </xsl:template>
+ <xsl:template match="note | warning | fixme">
+ <xsl:apply-templates select="@id"/>
+ <div class="{local-name()}">
+ <div class="label">
+ <xsl:choose>
+ <!-- FIXME: i18n Transformer here -->
+ <xsl:when test="@label">
+ <xsl:value-of select="@label"/>
+ </xsl:when>
+ <xsl:when test="local-name() = 'note'">Note</xsl:when>
+ <xsl:when test="local-name() = 'warning'">Warning</xsl:when>
+ <xsl:otherwise>Fixme (<xsl:value-of
+ select="@author"/>)</xsl:otherwise>
+ </xsl:choose>
+ </div>
+ <div class="content">
+ <xsl:apply-templates/>
+ </div>
+ </div>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/tab-to-menu.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/tab-to-menu.xsl
new file mode 100644
index 0000000..ee623ea
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/tab-to-menu.xsl
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+This stylesheet generates 'tabs' at the top left of the screen. Tabs are
+visual indicators that a certain subsection of the URI space is being browsed.
+For example, if we had tabs with paths:
+
+Tab1: ''
+Tab2: 'community'
+Tab3: 'community/howto'
+Tab4: 'community/howto/form/index.html'
+
+Then if the current path was 'community/howto/foo', Tab3 would be highlighted.
+The rule is: the tab with the longest path that forms a prefix of the current
+path is enabled.
+
+The output of this stylesheet is HTML of the form:
+ <div class="tab">
+ ...
+ </div>
+
+which is then merged by site2xhtml.xsl
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:import href="../common/xslt/html/tab-to-menu.xsl"/>
+
+ <xsl:template match="tabs">
+ <ul id="nav-main">
+ <xsl:call-template name="base-tabs"/>
+ </ul>
+ <xsl:if test="tab[@dir=$longest-dir]/tab">
+ <div id="nav-main-sub">
+ <xsl:call-template name="level2tabs"/>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="pre-separator">
+ </xsl:template>
+
+ <xsl:template name="post-separator">
+ </xsl:template>
+
+ <xsl:template name="separator">
+ </xsl:template>
+
+ <xsl:template name="selected">
+ <li class="current"><xsl:call-template name="base-selected"/></li>
+ </xsl:template>
+
+ <xsl:template name="not-selected">
+ <li><xsl:call-template name="base-not-selected"/></li>
+ </xsl:template>
+
+ <xsl:template name="level2-not-selected">
+ <xsl:call-template name="base-not-selected"/>
+ </xsl:template>
+
+ <xsl:template name="level2-selected">
+ <xsl:call-template name="base-selected"/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl
new file mode 100644
index 0000000..42e8c99
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl
@@ -0,0 +1,990 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ - Copyright (c) 2004, Jonathan McGee
+ - All rights reserved.
+ -
+ - Redistribution and use in source and binary forms, with or without
+ - modification, are permitted provided that the following conditions
+ - are met:
+ -
+ - * Redistributions of source code must retain the above copyright
+ - notice, this list of conditions and the following disclaimer.
+ - * Redistributions in binary form must reproduce the above copyright
+ - notice, this list of conditions and the following disclaimer in
+ - the documentation and/or other materials provided with the
+ - distribution.
+ - * Neither the name of the author nor the names of his contributors
+ - may be used to endorse or promote products derived from this
+ - software without specific prior written permission.
+ - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ - COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ -->
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/2002/06/xhtml2"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:html="http://www.w3.org/2002/06/xhtml2"
+ exclude-result-prefixes="html xsl"
+ >
+ <xsl:include href="lm://transform.xml.generateId"/>
+ <!-- If imported into another stylesheet, allow the first level heading
+ - depth to be configured -->
+ <xsl:param name="xhtml-heading" select="1"/>
+
+ <!-- Use XHTML 1.0 as the output schema -->
+ <xsl:output method="html" version="1.0" encoding="utf-8"
+ omit-xml-declaration="yes" media-type="text/html"
+ doctype-public="-//W3C//DTD HTML 4.01//EN"
+ doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
+
+ <!-- Copy elements by default -->
+ <xsl:template match="comment()">
+ <xsl:comment><xsl:value-of select="."/></xsl:comment>
+ </xsl:template>
+
+ <!-- Do not process elements and attributes by default -->
+ <xsl:template match="html:*"/>
+ <xsl:template match="html:*/@*" priority="0"/>
+ <xsl:template match="html:*/@*" mode="insdel" priority="0"/>
+ <xsl:template match="html:*/@*" mode="image" priority="0"/>
+ <xsl:template match="html:*/@*" mode="quote" priority="0"/>
+ <xsl:template match="html:*/@*" mode="link" priority="0"/>
+
+ <!--
+ - XHTML Attribute Collections
+ -->
+
+ <!-- Core Attribute Collection -->
+ <xsl:template match="@class">
+ <xsl:param name="class"/>
+ <xsl:attribute name="class">
+ <xsl:if test="$class">
+ <xsl:value-of select="$class"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+ <xsl:template match="@id|@title">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!-- I18N Attribute Collection -->
+ <xsl:template match="@xml:lang">
+ <xsl:attribute name="lang"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!-- Bi-directional Text Collection -->
+ <xsl:template match="@dir">
+ <!-- TODO: Need to handle lro and rlo. Not in HTML4 -->
+ <xsl:attribute name="dir"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!-- Edit Collection -->
+ <xsl:template match="@edit" mode="insdel"/>
+ <xsl:template match="@datetime" mode="insdel">
+ <xsl:attribute name="datetime"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!-- Hypertext Attribute Collection -->
+ <xsl:template match="@href|@rel|@rev|@accesskey|@target" mode="link">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+ <xsl:template match="@navindex" mode="link">
+ <xsl:attribute name="tabindex"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <!-- Make sure only one tag gets the cite attribute -->
+ <xsl:template match="@cite" mode="insdel">
+ <xsl:attribute name="cite"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="@cite" mode="quote">
+ <xsl:if test="count(@edit)=0">
+ <xsl:attribute name="cite"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Embedding Attribute Collection -->
+ <xsl:template match="@src" mode="image">
+ <xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="html:link/@type" mode="link">
+ <xsl:attribute name="type"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!-- Image Map Attribute Collection -->
+ <xsl:template match="@usemap|@ismap" mode="image">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!-- Style Attribute Collection -->
+ <xsl:template match="@style">
+ <xsl:attribute name="style"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!--
+ - Block rendering templates
+ -->
+ <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+ <xsl:template name="block">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="block-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+ <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ - element -->
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Create the element before any automatic inline children -->
+ <xsl:template name="block-element">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- The hr element is empty -->
+ <xsl:when test="$element='hr'">
+ <hr>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </hr>
+ </xsl:when>
+ <!-- Create element -->
+ <xsl:otherwise>
+ <xsl:element name="{$element}">
+ <xsl:if test="$class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ </xsl:attribute>
+ <xsl:if test="$class='section'">
+ <a>
+ <xsl:attribute name="name">
+ <xsl:if test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:if>
+ <xsl:if test="not(@id)">
+ <xsl:call-template name="generate-id"/>
+ </xsl:if>
+ </xsl:attribute> 
+ </a>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the cite attribute appears without edit, create a quote element -->
+ <xsl:template name="block-quote">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)
+ or ($element='blockquote')">
+ <xsl:call-template name="block-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Create the quote element -->
+ <xsl:otherwise>
+ <q>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </q>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the href attribute appears, make a hyperlink -->
+ <xsl:template name="block-link">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="block-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- href has been used, so create an anchor -->
+ <xsl:otherwise>
+ <a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the src attribute appears, make an image -->
+ <xsl:template name="block-image">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no src attribute appears, continue to next level -->
+ <xsl:when test="count(@src)=0">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <!-- src has been used, so replace with an image -->
+ <xsl:otherwise>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ - Inline rendering templates
+ -->
+ <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+ <xsl:template name="inline">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="inline-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+ <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ - element -->
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the cite attribute appears without edit, create a quote element -->
+ <xsl:template name="inline-quote">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
+ <xsl:call-template name="inline-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Create the quote element -->
+ <xsl:otherwise>
+ <q>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </q>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the href attribute appears, make a hyperlink -->
+ <xsl:template name="inline-link">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="inline-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- href has been used, so create an anchor -->
+ <xsl:otherwise>
+ <a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the src attribute appears, make an image -->
+ <xsl:template name="inline-image">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no src attribute appears, continue to next level -->
+ <xsl:when test="count(@src)=0">
+ <xsl:call-template name="inline-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- src has been used, so replace with an image -->
+ <xsl:otherwise>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Finally, create the element (assuming not quote) -->
+ <xsl:template name="inline-element">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If element is 'q' or 'a', it has already been made -->
+ <xsl:when test="($element='q') or ($element='a')">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <!-- If element is 'br', make a span and put br at end -->
+ <xsl:when test="$element='br'">
+ <span class="line">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/><br/>
+ </span>
+ </xsl:when>
+ <!-- Create element -->
+ <xsl:otherwise>
+ <xsl:element name="{$element}">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ - List rendering templates
+ -->
+ <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+ <xsl:template name="list">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="list-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+ <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ - element -->
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the cite attribute appears without edit, create a quote element -->
+ <xsl:template name="list-quote">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
+ <xsl:call-template name="list-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Create the quote element -->
+ <xsl:otherwise>
+ <blockquote>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </blockquote>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Create the element before any automatic inline children -->
+ <xsl:template name="list-element">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If going to be replaced with an image, create a para instead -->
+ <xsl:when test="count(@src)">
+ <p>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </p>
+ </xsl:when>
+ <!-- Create element and continue to children -->
+ <xsl:otherwise>
+ <xsl:element name="{$element}">
+ <xsl:if test="$class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="count(html:summary)">
+ <xsl:attribute name="summary">
+ <xsl:value-of select="html:summary"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the href and src are provided, make a linked image -->
+ <xsl:template name="list-link">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="list-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- href has been used, so create an anchor -->
+ <xsl:otherwise>
+ <a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the src attribute appears, make an image -->
+ <xsl:template name="list-image">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:template>
+
+ <!--
+ - List Item rendering templates
+ -->
+ <!-- Create the element before any automatic inline children -->
+ <xsl:template name="listitem">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:element name="{$element}">
+ <xsl:if test="$class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+ <xsl:template name="listitem-insdel">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="listitem-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+ <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ - element -->
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the cite attribute appears without edit, create a quote element -->
+ <xsl:template name="listitem-quote">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
+ <xsl:call-template name="listitem-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Create the quote element -->
+ <xsl:otherwise>
+ <q>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </q>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the href attribute appears, make a hyperlink -->
+ <xsl:template name="listitem-link">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="listitem-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- href has been used, so create an anchor -->
+ <xsl:otherwise>
+ <a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- If the src attribute appears, make an image -->
+ <xsl:template name="listitem-image">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+ <!-- If no src attribute appears, continue to next level -->
+ <xsl:when test="count(@src)=0">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <!-- src has been used, so replace with an image -->
+ <xsl:otherwise>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ - XHTML Structure Module
+ -->
+ <!-- Add our Subversion/CVS Id to the root element -->
+ <xsl:template match="html:html">
+ <xsl:comment> $Id: xhtml2html.xslt 127 2004-11-14 03:06:21Z etherealwake $ </xsl:comment>
+ <html>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </html>
+ </xsl:template>
+ <!-- Specify namespace for metadata (if not using schema.X links) -->
+ <xsl:template match="html:html/@profile">
+ <xsl:attribute name="profile"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <!-- Add a generator tag to the head section -->
+ <xsl:template match="html:head">
+ <head>
+ <xsl:apply-templates select="@*"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <xsl:apply-templates/>
+ <xsl:if test="count(html:meta[@name='generator'])=0">
+ <meta name="generator" content="Ethereal Wake XHTML2 to XHTML1 XSLT"/>
+ </xsl:if>
+ </head>
+ </xsl:template>
+ <!-- <title> and <body> are pretty much copied as is -->
+ <xsl:template match="html:title|html:body">
+ <xsl:element name="{local-name()}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <!--
+ - XHTML Block Text Module
+ -->
+ <!-- Handle the elements practically unchanged since XHTML 1.0 -->
+ <xsl:template match="html:address|html:blockquote|html:div|html:hr
+ |html:pre|html:hr">
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="local-name(.)"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!-- In XHTML 2.0, paragraphs are a bit more sophisticated than in 1.X -->
+ <xsl:template match="html:p">
+ <xsl:choose>
+ <!-- If we have XHTML 1.0 block children, make us a div -->
+ <xsl:when test="count(html:ul|html:ol|html:nl|html:dl|html:blockcode
+ |html:blockquote|html:pre|html:table)>0">
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="'div'"/>
+ <xsl:with-param name="class" select="'p'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- If no block children, be a traditional paragraph -->
+ <xsl:otherwise>
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="'p'"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- We will treat sections as simple <div>s of class section -->
+ <xsl:template match="html:section">
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="'div'"/>
+ <xsl:with-param name="class" select="'section'"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!-- <h> gets mapped to a h# based on how many parent sections -->
+ <xsl:template match="html:h">
+ <!-- Count the number of sections -->
+ <xsl:variable name="levelbase">
+ <xsl:value-of select="count(ancestor::html:section)+$xhtml-heading"/>
+ </xsl:variable>
+ <!-- Limit the heading element to h6 -->
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="$levelbase > 6">6</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$levelbase"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Create the appropriate element -->
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="concat('h',$level)"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ - XHTML Inline Text Module
+ -->
+ <!-- Handle the elements practically unchanged since XHTML 1.0 -->
+ <xsl:template match="html:abbr|html:cite|html:code|html:dfn|html:em
+ |html:kbd|html:samp|html:span|html:strong|html:sub|html:sup
+ |html:var">
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="local-name()"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!-- quote maps to the 'q' element from XHTML 1.0 -->
+ <xsl:template match="html:quote">
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="'q'"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!-- <l> is a more complex version of HTML's <br> -->
+ <xsl:template match="html:l">
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="'br'"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ - XHTML Hypertext Module
+ -->
+ <xsl:template match="html:a">
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="'a'"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template match="html:a/@id" mode="link">
+ <xsl:attribute name="id"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!--
+ - XHTML List Module
+ -->
+ <xsl:template match="html:ul|html:ol|html:dl">
+ <xsl:call-template name="list">
+ <xsl:with-param name="element" select="local-name(.)"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template match="html:li|html:dt|html:dd">
+ <xsl:call-template name="listitem">
+ <xsl:with-param name="element" select="local-name(.)"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ - XHTML Linking Module
+ -->
+ <xsl:template match="html:link">
+ <link><xsl:apply-templates select="@*" mode="link"/></link>
+ </xsl:template>
+ <xsl:template match="html:link/@media" mode="link">
+ <xsl:attribute name="media"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="html:link/@xml:lang" mode="link">
+ <xsl:attribute name="hreflang"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!--
+ - XHTML Metainformation Module
+ -->
+ <xsl:template match="html:meta">
+ <meta>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="content"><xsl:value-of select="."/></xsl:attribute>
+ </meta>
+ </xsl:template>
+ <xsl:template match="html:meta/@name">
+ <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!--
+ - XHTML Object Module
+ -->
+ <!--
+ - Ruby Module
+ -->
+ <!--
+ - XHTML Scripting Module
+ -->
+ <!--
+ - XHTML Style Sheet Module
+ -->
+ <xsl:template match="html:style">
+ <style>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </style>
+ </xsl:template>
+ <xsl:template match="html:style/@media">
+ <xsl:attribute name="media"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <!--
+ - XHTML Tables Module
+ -->
+ <!-- Some table elements are pretty much left unchanged -->
+ <xsl:template match="html:caption|html:col|html:colgroup|html:thead
+ |html:tfoot|html:tbody|html:tr">
+ <xsl:element name="{local-name()}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="html:col/@span|html:colspan/@span">
+ <xsl:attribute name="span"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <!-- td and th are pretty much as they were -->
+ <xsl:template match="html:td|html:th">
+ <xsl:call-template name="listitem">
+ <xsl:with-param name="element" select="local-name()"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template match="html:td/@abbr|html:td/@axis|html:td/@colspan
+ |html:td/@headers|html:td/@rowspan|html:td/@scope|html:th/@abbr
+ |html:th/@axis|html:th/@colspan|html:th/@headers|html:th/@rowspan
+ |html:th/@scope">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+ <!-- The table element acts a lot like a list -->
+ <xsl:template match="html:table">
+ <xsl:call-template name="list">
+ <xsl:with-param name="element" select="'table'"/>
+ </xsl:call-template>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl
new file mode 100644
index 0000000..567af3a
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:dir="http://apache.org/cocoon/directory/2.0"
+ xmlns:session="http://apache.org/cocoon/session/1.0"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0" >
+ <!--
+ Create row for each document. Information about the document is
+ extracted from the document itself using the document()
+ function.
+ -->
+ <xsl:param name="requestedContract" select="'false'"/>
+ <xsl:param name="less" select="'false'"/>
+ <xsl:template match="/">
+ <xsl:if test="$less='false'">
+ <document>
+ <header>
+ <title>ls.contract<xsl:if
+ test="$requestedContract='false'">s</xsl:if><xsl:if
+ test="$requestedContract!='false'"> <xsl:value-of
+ select="$requestedContract" /></xsl:if> </title>
+ </header>
+ <body>
+ <xsl:choose>
+ <xsl:when test="$requestedContract='false'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates
+ select=".//forrest:contract[@name=$requestedContract]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </body>
+ </document>
+ </xsl:if>
+ <xsl:if test="$less='true'">
+ <xsl:apply-templates
+ select=".//forrest:contract[@name=$requestedContract]"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="forrest:theme">
+ <xsl:variable select="@name" name="name"/>
+ <section id="{$name}">
+ <title> theme name: <xsl:value-of select="@name" /> </title>
+ <xsl:apply-templates select="./forrest:contract">
+ <xsl:with-param select="$name" name="theme"/>
+ </xsl:apply-templates>
+ </section>
+ </xsl:template>
+ <xsl:template match="forrest:contract">
+ <xsl:param name="theme" select="common"/>
+ <xsl:choose>
+ <xsl:when test="$requestedContract!='false'">
+ <section id="{@name}">
+ <xsl:call-template name="innerBodyLs"/>
+ </section>
+ </xsl:when>
+ <xsl:otherwise>
+ <section id="{$theme}-{@name}">
+ <xsl:call-template name="innerBodyLs"/>
+ </section>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="innerBodyLs">
+ <title>
+ <xsl:value-of select="@name" />
+ </title>
+ <p class="file">
+ <strong>file-name:</strong>
+ <br/>
+ <xsl:value-of select="@file-name" />
+ </p>
+ <p class="description">
+ <strong>description:</strong>
+ <br/>
+ <xsl:if test="./description/*">
+ <xsl:copy-of select="./description/*" />
+ </xsl:if>
+ <xsl:if test="not(./description/*)">
+ <xsl:value-of select="./description" />
+ </xsl:if>
+ </p>
+ <p class="usage">
+ <strong>usage:</strong>
+ </p>
+ <source>
+ <xsl:value-of select="./usage" />
+ </source>
+ <p class="template-definition">
+ <strong>forrest-template definition:</strong>
+ </p>
+ <source><forrest:template<xsl:apply-templates
+ select="./forrest:template/@*" />/> </source>
+ </xsl:template>
+ <xsl:template match="forrest:template/@*"> <xsl:value-of
+ select="name()"/>="<xsl:value-of select="."/>"</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl
new file mode 100644
index 0000000..39fad82
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dir="http://apache.org/cocoon/directory/2.0"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0" >
+ <xsl:template match="/">
+ <forrest:themes xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <xsl:apply-templates select="dir:directory/dir:directory"/>
+ </forrest:themes>
+ </xsl:template>
+ <xsl:template match="dir:directory">
+ <forrest:theme name="{@name}">
+ <xsl:apply-templates select="descendant::dir:file" />
+ </forrest:theme>
+ </xsl:template>
+ <xsl:template match="dir:file[./*/*/@name]">
+ <forrest:contract name="{./*/*/@name}" file-name="{@name}">
+ <xsl:copy-of select="./*/*/description"/>
+ <xsl:copy-of select="./*/*/usage"/>
+ <xsl:apply-templates select=".//forrest:template"/>
+ </forrest:contract>
+ </xsl:template>
+ <xsl:template match="forrest:template">
+ <forrest:template>
+ <xsl:copy-of select="@*"/>
+ </forrest:template>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/nugget.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/nugget.xsl
new file mode 100644
index 0000000..61c9d2a
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/nugget.xsl
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+site2xml.xsl is the final stage in XML page production. It merges HTML from
+document2html.xsl, tab2menu.xsl and book2menu.xsl, and adds the site header,
+footer, searchbar, css etc. As input, it takes XML of the form:
+
+<elements>
+ <branding/>
+ <search/>
+ <menu/>
+ <content/>
+ <siteinfo/>
+</elements>
+
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
+ <xsl:strip-space elements="forrest:properties"/>
+ <xsl:param name="contract"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="forrest:property[@name=$contract]">
+ <xsl:comment> properties <xsl:value-of select="$contract"/> </xsl:comment>
+ <xsl:copy-of select="*"/>
+ </xsl:template>
+
+ <xsl:template match="forrest:property"/>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/prepare.properties.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/prepare.properties.xsl
new file mode 100644
index 0000000..6669d9f
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/prepare.properties.xsl
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:c="http://apache.org/cocoon/include/1.0" >
+
+ <xsl:param name="format"/>
+ <xsl:key name="contracts" match="forrest:contract" use="@name" />
+
+ <xsl:template match="/">
+ <forrest:properties >
+ <xsl:for-each select="forrest:view[@type=$format]//forrest:contract[count(. | key('contracts', @name)[1]) = 1]">
+ <c:include>
+ <xsl:attribute name="src">
+ <xsl:value-of
+ select="concat('cocoon://prepare.contract-property.', $format,'.', @name)"/>
+ </xsl:attribute>
+ </c:include>
+ </xsl:for-each>
+ </forrest:properties>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/prepare.view.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/prepare.view.xsl
new file mode 100644
index 0000000..a2abe04
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/prepare.view.xsl
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias">
+
+ <xsl:namespace-alias stylesheet-prefix="alias" result-prefix="xsl"/>
+ <xsl:strip-space elements="forrest:property"/>
+
+ <xsl:param name="view"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="forrest:property[@nugget]">
+ <xsl:element name="forrest:property">
+ <xsl:attribute name="name">
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+ <xsl:element name="xi:include">
+ <xsl:attribute name="href">cocoon://<xsl:value-of
+ select="url/text()"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="@*|*|text()|processing-instruction()|comment()">
+ <xsl:copy>
+ <xsl:apply-templates
+ select="@*|*|text()|processing-instruction()|comment()"/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl
new file mode 100644
index 0000000..01ce2cd
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:template match="/">
+ <xsl:copy-of select="*/*"/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/themer.html.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/themer.html.xsl
new file mode 100644
index 0000000..8922a7b
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/themer.html.xsl
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias" xmlns:forrest="http://apache.org/forrest/templates/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:namespace-alias result-prefix="xsl" stylesheet-prefix="alias"/>
+ <!--Include forrest:hook matchers-->
+ <xsl:include href="hooksMatcher.xsl"/>
+ <xsl:param name="request"/>
+ <xsl:param name="forrestContext" select="'test'"/>
+ <xsl:key name="head-template" match="forrest:property[@format='xhtml']" use="@name" />
+ <xsl:key name="css-includes" match="forrest:css" use="@url" />
+ <xsl:key name="contract-name" match="forrest:contract" use="@name" />
+ <xsl:template match="/">
+ <!--Create the final stylesheet (alias:) resources/stylesheets/structurer-tiles-root-strip.xsl -->
+ <alias:stylesheet version="1.0">
+ <alias:import href="file:{$forrestContext}/skins/common/xslt/html/dotdots.xsl"/>
+ <alias:import href="file:{$forrestContext}/skins/common/xslt/html/pathutils.xsl"/>
+ <alias:import href="file:{$forrestContext}/skins/common/xslt/html/renderlogo.xsl"/>
+ <!--NOTE:
+ contracts are allowed only to be importet once! Thx to
+ http://www.jenitennison.com/xslt/grouping/muenchian.html-->
+ <xsl:for-each
+ select="/*/forrest:view[@type='html']//forrest:contract[count(. | key('contract-name', @name)[1]) = 1]">
+ <xsl:sort select="@name" />
+ <alias:include>
+ <xsl:attribute name="href">
+ <xsl:value-of
+ select="concat('cocoon://prepare.contract.html.', @name)"/>
+ </xsl:attribute>
+ </alias:include>
+ </xsl:for-each>
+ <alias:param name="path"/>
+<!-- FIXME: extract the following part to a stylesheet on its own START -->
+ <!-- Path (..'s) to the root directory -->
+ <alias:variable name="root">
+ <alias:call-template name="dotdots">
+ <alias:with-param name="path" select="$path"/>
+ </alias:call-template>
+ </alias:variable>
+ <alias:variable name="filename-noext">
+ <alias:call-template name="filename-noext">
+ <alias:with-param name="path" select="$path"/>
+ </alias:call-template>
+ </alias:variable>
+ <!-- Source filename (eg 'foo.xml') of current page -->
+ <alias:variable name="filename">
+ <alias:call-template name="filename">
+ <alias:with-param name="path" select="$path"/>
+ </alias:call-template>
+ </alias:variable>
+ <alias:variable name="skin-img-dir" select="concat(string($root), 'themes/images')"/>
+ <alias:variable name="spacer" select="concat($root, 'themer/images/spacer.gif')"/>
+<!-- FIXME: extract the following part to a stylesheet on its own END -->
+ <xsl:comment>All xhtml head elements requested by the forrest:template</xsl:comment>
+ <alias:template name="getHead">
+ <xsl:for-each
+ select="/*/forrest:properties/*[@head='true' and count(. | key('head-template', @name)[1]) = 1]">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:apply-templates mode="head"
+ select="//forrest:contract[@name=$name]"/>
+ </xsl:for-each>
+ </alias:template>
+ <xsl:comment>All xhtml body elements requested by the forrest:template</xsl:comment>
+ <alias:template name="getBody">
+ <xsl:apply-templates select="/*/forrest:view"/>
+ </alias:template>
+ <!--default entry point into the presentation model 'site'-->
+ <alias:template match="/">
+ <html>
+ <head>
+ <!--Test whether there is an own css implemention requested by the view-->
+ <!--*No* forrest:css found in the view-->
+ <xsl:if test="not(/*/forrest:view/forrest:css)">
+ <link rel="stylesheet" type="text/css">
+ <xsl:attribute name="href">{$root}themes/common.css</xsl:attribute>
+ </link>
+ </xsl:if>
+ <!-- forrest:css *found* in the view-->
+ <xsl:if test="/*/forrest:view/forrest:css">
+ <xsl:apply-templates select="/*/forrest:view/forrest:css"/>
+ </xsl:if>
+ <alias:call-template name="getHead"/>
+ </head>
+ <body>
+ <alias:call-template name="getBody"/>
+ </body>
+ </html>
+ </alias:template>
+ </alias:stylesheet>
+ </xsl:template>
+ <xsl:template match="forrest:view">
+ <xsl:apply-templates select="*[local-name()!='css']"/>
+ </xsl:template>
+ <xsl:template match="forrest:css[@url and count(. | key('css-includes', @url)[1]) = 1]">
+ <xsl:copy-of select="@rel"/>
+ <link type="text/css">
+ <xsl:choose>
+ <xsl:when test="@rel">
+ <xsl:attribute name="rel"><xsl:value-of select="@rel"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="rel">stylesheet</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@theme">
+ <xsl:attribute name="title"><xsl:value-of select="@theme"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="title"><xsl:value-of select="@url"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="href">{$root}themes/<xsl:value-of select="@url"/>
+ </xsl:attribute>
+ <xsl:if test="@media">
+ <xsl:attribute name="media"><xsl:value-of select="@media"/></xsl:attribute>
+ </xsl:if>
+ </link>
+ </xsl:template>
+ <xsl:template match="forrest:css[not(@url)]">
+ <style type="text/css">
+ <xsl:value-of select="."/>
+ </style>
+ </xsl:template>
+ <xsl:template match="forrest:contract" mode="head">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:if test="/*/forrest:properties/*[@head='true' and @name=$name]">
+ <!--If next son is not forrest:properties go on-->
+ <xsl:choose>
+ <xsl:when test="not(forrest:properties[@contract=$name])">
+ <alias:call-template name="{@name}-head"/>
+ </xsl:when>
+ <xsl:when test="forrest:properties[@contract=$name]">
+ <alias:call-template name="{@name}-head" xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <xsl:for-each select="forrest:properties[@contract=$name]/forrest:property">
+ <xsl:variable name="xpath">
+ <xsl:call-template name="generateXPath"/>
+ </xsl:variable>
+ <alias:with-param name="{@name}" select="{normalize-space($xpath)}"/>
+ </xsl:for-each>
+ </alias:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="forrest:contract">
+ <xsl:variable name="name" select="@name"/>
+ <!--Test whether there is a body template needed-->
+ <xsl:if test="/*/forrest:properties/*[@body='true' and @name=$name]">
+ <!--If next son is not forrest:properties go on-->
+ <xsl:choose>
+ <xsl:when test="not(forrest:properties[@contract=$name])">
+ <xsl:apply-templates/>
+ <alias:call-template name="{@name}-body"/>
+ </xsl:when>
+ <xsl:when test="forrest:properties[@contract=$name]">
+ <alias:call-template name="{@name}-body">
+ <xsl:for-each select="forrest:properties[@contract=$name]/forrest:property">
+ <xsl:variable name="xpath">
+ <xsl:call-template name="generateXPath"/>
+ </xsl:variable>
+ <alias:with-param name="{@name}" select="{normalize-space($xpath)}" />
+ </xsl:for-each>
+ </alias:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="generateXPath">
+ <xsl:for-each select="ancestor::*[name()!='filter']">
+ /<xsl:value-of select="name()"/>[<xsl:number/>]
+ </xsl:for-each>
+ /<xsl:value-of select="name()"/>[<xsl:number/>]
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2abstract.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2abstract.xsl
new file mode 100644
index 0000000..d81c269
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2abstract.xsl
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:if test="header/abstract">
+ <div class="abstract">
+ <xsl:value-of select="header/abstract"/>
+ </div>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2authors.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2authors.xsl
new file mode 100644
index 0000000..288b226
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2authors.xsl
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:if test="header/authors">
+ <xsl:apply-templates select="header/authors"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="header/authors">
+ <xsl:if test="person">
+ <div id="content-authors">
+ <xsl:for-each select="person">
+ <div class="author">
+ <div class="name">
+ <xsl:value-of select="@name"/>
+ </div>
+ <div class="email">
+ <xsl:value-of select="@email"/>
+ </div>
+ </div>
+ </xsl:for-each>
+ </div>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2title.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2title.xsl
new file mode 100644
index 0000000..f37db0a
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2title.xsl
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:choose>
+ <xsl:when test="header/title">
+ <xsl:copy-of select="header/title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>*No* title found</title>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2toc.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2toc.xsl
new file mode 100644
index 0000000..537000b
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/to-xml/document2toc.xsl
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:include href="../helper/generateId.xsl"/>
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:apply-templates mode="toc"/>
+ </xsl:template>
+ <xsl:template match="body" mode="toc">
+ <tocitems>
+ <xsl:apply-templates select="section" mode="toc">
+ <xsl:with-param name="level" select="1"/>
+ </xsl:apply-templates>
+ </tocitems>
+ </xsl:template>
+ <xsl:template match="section" mode="toc">
+ <xsl:param name="level"/>
+ <tocitem level="{$level}">
+ <xsl:attribute name="href">#<xsl:call-template
+ name="generate-id"/></xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="title"/>
+ </xsl:attribute>
+ <xsl:apply-templates mode="toc">
+ <xsl:with-param name="level" select="$level+1"/>
+ </xsl:apply-templates>
+ </tocitem>
+ </xsl:template>
+ <xsl:template match="node()|@*" mode="toc"/>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl
new file mode 100644
index 0000000..1bd3d6e
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <div class="abstract">
+ <xsl:value-of select="header/abstract"/>
+ </div>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl
new file mode 100644
index 0000000..288b226
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:if test="header/authors">
+ <xsl:apply-templates select="header/authors"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="header/authors">
+ <xsl:if test="person">
+ <div id="content-authors">
+ <xsl:for-each select="person">
+ <div class="author">
+ <div class="name">
+ <xsl:value-of select="@name"/>
+ </div>
+ <div class="email">
+ <xsl:value-of select="@email"/>
+ </div>
+ </div>
+ </xsl:for-each>
+ </div>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl
new file mode 100644
index 0000000..f37db0a
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:choose>
+ <xsl:when test="header/title">
+ <xsl:copy-of select="header/title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>*No* title found</title>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl
new file mode 100644
index 0000000..537000b
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+This stylesheet contains templates for converting documentv11 to HTML. See the
+imported document2html.xsl for details.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:include href="../helper/generateId.xsl"/>
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+ <xsl:template match="document">
+ <xsl:apply-templates mode="toc"/>
+ </xsl:template>
+ <xsl:template match="body" mode="toc">
+ <tocitems>
+ <xsl:apply-templates select="section" mode="toc">
+ <xsl:with-param name="level" select="1"/>
+ </xsl:apply-templates>
+ </tocitems>
+ </xsl:template>
+ <xsl:template match="section" mode="toc">
+ <xsl:param name="level"/>
+ <tocitem level="{$level}">
+ <xsl:attribute name="href">#<xsl:call-template
+ name="generate-id"/></xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="title"/>
+ </xsl:attribute>
+ <xsl:apply-templates mode="toc">
+ <xsl:with-param name="level" select="$level+1"/>
+ </xsl:apply-templates>
+ </tocitem>
+ </xsl:template>
+ <xsl:template match="node()|@*" mode="toc"/>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/favicon.ico b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/favicon.ico
new file mode 100644
index 0000000..161bcf7
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/favicon.ico
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/feeds/default.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/feeds/default.xml
new file mode 100644
index 0000000..ffa47ba
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/feeds/default.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<feedDescriptor>
+ <feed id="shows">
+ <url>http://m11.btefnet.net/torrents/backend.xml</url>
+ </feed>
+ <feed id="sf">
+ <url>http://sourceforge.net/export/rss2_projnews.php?group_id=96589</url>
+ </feed>
+</feedDescriptor>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/how/howItWork.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/how/howItWork.xml
new file mode 100644
index 0000000..15077ac
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/how/howItWork.xml
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>forrest:views - x formats, one config</title>
+ <abstract>This plugin depends on a ViewHelper and a BusinessHelper implementation.</abstract>
+ </header>
+ <body>
+ <section>
+ <title>How it works </title>
+ <source>
+This plugin has three components:
+ 1. viewHelper - delivers contracts in form of xsl:templates
+ 2. businessHelper - delivers content that is used in the contracts
+ 3. views - prepares and transforms the requested contracts (viewHelper)
+ and populate them with the content (businessHelper)
+
+1. viewHelper
+ This is the template producing factory.
+
+a. <![CDATA[<map:match pattern="resolve.contract.*.*">]]> -> Resolving factory
+Project implementation of templates have priority before default ones.
+If no implementation can be found we use the noFt (~ - no
+forrest:template) implementation.-> this match is implemented in the viewHelper plugin
+
+b. <![CDATA[<map:match pattern="get.contract.*.*">]]>-> this match is implemented in the viewHelper plugin
+Get the xsl:templates of the requested contract and specific format.
+
+c. <![CDATA[<map:match pattern="get.contract-property.*">]]>-> this match is implemented in the viewHelper plugin
+Get the forrest:properties of the requested contract.
+This will determine which templates (css, head, body) we have to call
+later on
+
+GENERAL:
+Contracts are stored in forrest:templates ({contract-name}.ft) please
+have a look on the templates/*.ft that the viewHelper implementation contain to get
+an idea how your own implementation have to look like.
+
+
+2. businessHelper
+ This is the content producing factory.
+
+NOTE: <![CDATA[<map:match pattern="*.page">]]>
+ The current factory uses the models the skin (e.g. document2xhtml.xsl from pelt [default skin]).
+ It is only exchanging the last model of the models the skin is producing (site2xhtml.xsl) till now.
+ This will have to be changed in the future.
+
+3. views
+ prepares the requested contracts viewHelper and dispatches
+the corresponding businessHelper.
+
+a. <![CDATA[<map:match pattern="prepare.view.*">]]> -> View config resolver
+File specific views have priority before default ones.
+If no view can be found in the project we use the default one of the
+views plugin.
+
+b. <![CDATA[<map:match pattern="prepare.include.*.**"> ]]>
+Aggregate the contract-templates requested by the view with xinclude.
+The result is a stylesheet with all needed xsl:templates.
+
+c. <![CDATA[<map:match pattern="prepare.properties.*.*">]]>
+Aggregate the forrest:properties requested by the *.fv.
+The result is an aggregation of properties which defines the templates
+to be call.
+
+d. <![CDATA[<map:match pattern="prepare.xhtml.*">]]>
+Aggregate all contracts-templates requested by the view.
+Create a xsl that can be used for the last step of the transformation of
+the view.
+
+e. <![CDATA[<map:match pattern="*.html"> ]]>-> Last processing step.
+Here we are overriding the default skin generation.
+-> this match is implemented in the viewHelper plugin
+
+GENERAL:
+Views are stored in forrest:view ({file-name}.fv) please have look on
+plugins/org.apache.forrest.plugin.internal.structurer/src/documentation/common.fv do
+get an idea how your own implementation have to look like.
+
+ </source>
+ </section>
+ <section>
+ <title>Resume</title>
+ <source>
+The views plugin can be seen as prototype for the next generation
+skinning of forrest. It is still in early stage but with extracting the businessHelper we
+hope to make it easier for all devs (not only committer) to get the idea
+and enable them to enhance the design of this plugin and their implementation.
+
+Some basic and simple hints:
+a) If you want another implementation of a contract then create a folder
+"templates" in ${project.resources-dir} and it will be matched before
+the standard implementation.
+
+e.g. feedback contract:
+<![CDATA[
+<forrest:contract name="feedback" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+<description>
+This function will output the html feedback information.
+</description>
+
+<forrest:template
+xmlns:forrest="http://apache.org/forrest/templates/1.0"
+format="xhtml" name="feedback" inputFormat="xsl" body="true"
+head="false" css="true">
+
+<xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+
+<xsl:template name="feedback-css">
+#feedback {
+ color: black;
+ background: #CFDCED;
+ text-align:center;
+ margin-top: 5px;
+}
+#feedback #feedbackto {
+ font-size: 90%;
+ color: black;
+}</xsl:template>
+
+<xsl:template name="feedback-body">
+<div id="feedback"> Modified project implementation
+<xsl:value-of select="$config/feedback"/>
+<xsl:choose>
+<xsl:when test="$config/feedback/@href and
+not($config/feedback/@href='')">
+ <a id="feedbackto">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$config/feedback/@href"/>
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ <xsl:value-of select="$config/feedback/@to"/>
+ </a>
+</xsl:when>
+<xsl:otherwise>
+ <xsl:value-of select="$config/feedback/@to"/>
+</xsl:otherwise>
+</xsl:choose>
+</div>
+</xsl:template>
+</xsl:stylesheet>
+</forrest:template>
+</forrest:contract>
+]]>
+The @attributes (body="true" head="false" css="true") of the
+forrest:template defining which parts of the html page (head, head-css
+and body) we have to render. The xsl:templates are following the simple
+naming convention {@name}-(css|head|body).
+
+
+b. If you want a default view for your project then copy the common.fv
+from the viewHelper implementation to your ${project.conf-dir} and modify this file. When
+you want another view for a specific file (e.g. ${project.xdocs-dir}/index.html) then copy
+the common.fv to your ${project.xdocs-dir} and renamed it to
+${project.xdocs-dir}/index.fv.</source>
+ </section>
+ </body>
+</document>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/how/index.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/how/index.xml
new file mode 100644
index 0000000..23701ee
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/how/index.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>forrest:views - x output formats, one config</title>
+ <abstract>This plugin depends on a ViewHelper and a BusinessHelper implementation.</abstract>
+ </header>
+ <body>
+ <section>
+ <title>view</title>
+ <p>Together with the ViewHelper and the BusinessHelper (to be implemented)
+ plugin this plugin is following the <a href="ext:sun/j2ee/patterns/dispatcherView">DispatcherView pattern</a>
+ and building the final view which will be delivered to the client. This implementation follows exactly the pattern shown on
+ <a href="ext:corej2eepatterns/patterns/dispatcherView">corej2eepatterns.com</a>
+ </p><p>
+ A view will be configured by a config file
+ which basically contains the following tags (it is still evolving): </p>
+<source><![CDATA[<forrest:view type="xhtml">
+ <forrest:css url="common.css"/>
+ <forrest:contract name="meta"/>
+ <forrest:hook name="container">
+ <forrest:contract name="feedback"/>
+ </forrest:hook />
+</forrest:view>]]></source>
+<p>The view tag's @type determines the final output format. The idea is to
+configure different output formats within a forrest:views. That means a forrest:views
+can contain n different "forrest:view" configurations for n different formats. <br/>
+In short: x formats, one config. :)</p>
+<source><![CDATA[<forrest:views
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+<forrest:view type="xhtml">
+ <forrest:css url="common.css"/>
+ <forrest:contract name="meta"/>
+ <forrest:hook name="container">
+ <forrest:contract name="feedback"/>
+ </forrest:hook />
+</forrest:view>
+<forrest:view type="fo">
+ <forrest:hook name="container">
+ <forrest:contract name="feedback"/>
+ </forrest:hook />
+</forrest:view>
+/forrest:views>]]></source>
+</section>
+<section>
+ <title>viewHelper</title>
+ <p>viewHelper class/implementation - a class/implementation which will
+access the presentation model and transform its models. In other words
+it is a presentation producing factory.
+</p>
+<note>The <![CDATA[<forrest:contract name="nav-main"/>]]> expects a certain model
+(now produced by leather-dev - tab2menu.xsl) to transform it. In the
+future this dependency will be on a businessHelper implementation that
+has to be defined in the view. For now it depends on leather-dev. I
+guess leather-dev is still not dead till the businessHelper plugin comes
+(which will implement the businessHelper of leather-dev). ;-)</note>
+<p>
+Each forrest:css will be transformed into a <![CDATA[<link rel="stylesheet" type="text/css" url="{$root}skin/{url}">]]> tag (in html
+output [only format that has an implementation]).
+This tags are designed to help <strong>web-designers</strong> to freely implemend their own css-implementations for a view.
+</p>
+<p>
+Each forrest:hook will be transformed into a <![CDATA[<div/>]]> tag (in html
+output [only format that has an implementation]).
+This tags are designed to help <strong>web-designers</strong> to freely move
+around and group contracts into design container.
+</p>
+<p>Each forrest:contract will dispatch a xml file (ViewHelper) that contains
+xsl:stylesheets (for now, but other implementations to transform the presentation
+ model are/should be possible) for the different output formats of a contract.
+ For html, the only format that we have implemented so far, we
+have three different kind of templates:</p><p>
+<![CDATA[<xsl:templates name="{contract/@name}-css/>]]><br/>
+Here the contract specific css will be stored.
+</p><p>
+<![CDATA[<xsl:templates name="{contract/@name}-head/>]]><br/>
+Here goes everything that belongs in the html head. e.g. scripts.
+</p><p>
+<![CDATA[<xsl:templates name="{contract/@name}-body/>]]><br/>
+Everything that belongs into the body.
+ </p>
+ </section>
+ <section>
+ <title>BusinessHelper </title>
+ <p><strong>businessHelper class/implementation </strong>- a class/implementation which will
+access businessServices to produce models for the presentation model. In
+other word it is a data producing factory.
+</p>
+<note>Right now we are using the default forrest businessHelper (defined
+by the skin you are using). There are contracts that depend on a
+businessHelper implementation of leather-dev (tab2menu.xsl, site2xhtml.xsl,...).
+We will create a businessHelper plugin to overcome this problem.</note>
+ <p>Right now it is implemented for the forrest way of producing the models
+for the view but we will create an independent BusinessHelper to
+access all BusinessServices you may have in your application. </p>
+ </section>
+ <section>
+ <title>links</title>
+ <note>There are/were lots of mails on the dev-list. Please, search the list</note>
+ <p>Background mailings around the views concept</p>
+ <ul>
+ <li><a href="ext:mailings/dev/pInfra">[RT] plugin infrastructure</a> </li>
+ <li><a href="ext:mailings/dev/ftLeather">[RT] Forrest templates for second generation skining - towards Corium</a> </li>
+ </ul>
+
+ </section>
+ </body>
+</document>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/howItWork.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/howItWork.xml
new file mode 100644
index 0000000..15077ac
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/howItWork.xml
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>forrest:views - x formats, one config</title>
+ <abstract>This plugin depends on a ViewHelper and a BusinessHelper implementation.</abstract>
+ </header>
+ <body>
+ <section>
+ <title>How it works </title>
+ <source>
+This plugin has three components:
+ 1. viewHelper - delivers contracts in form of xsl:templates
+ 2. businessHelper - delivers content that is used in the contracts
+ 3. views - prepares and transforms the requested contracts (viewHelper)
+ and populate them with the content (businessHelper)
+
+1. viewHelper
+ This is the template producing factory.
+
+a. <![CDATA[<map:match pattern="resolve.contract.*.*">]]> -> Resolving factory
+Project implementation of templates have priority before default ones.
+If no implementation can be found we use the noFt (~ - no
+forrest:template) implementation.-> this match is implemented in the viewHelper plugin
+
+b. <![CDATA[<map:match pattern="get.contract.*.*">]]>-> this match is implemented in the viewHelper plugin
+Get the xsl:templates of the requested contract and specific format.
+
+c. <![CDATA[<map:match pattern="get.contract-property.*">]]>-> this match is implemented in the viewHelper plugin
+Get the forrest:properties of the requested contract.
+This will determine which templates (css, head, body) we have to call
+later on
+
+GENERAL:
+Contracts are stored in forrest:templates ({contract-name}.ft) please
+have a look on the templates/*.ft that the viewHelper implementation contain to get
+an idea how your own implementation have to look like.
+
+
+2. businessHelper
+ This is the content producing factory.
+
+NOTE: <![CDATA[<map:match pattern="*.page">]]>
+ The current factory uses the models the skin (e.g. document2xhtml.xsl from pelt [default skin]).
+ It is only exchanging the last model of the models the skin is producing (site2xhtml.xsl) till now.
+ This will have to be changed in the future.
+
+3. views
+ prepares the requested contracts viewHelper and dispatches
+the corresponding businessHelper.
+
+a. <![CDATA[<map:match pattern="prepare.view.*">]]> -> View config resolver
+File specific views have priority before default ones.
+If no view can be found in the project we use the default one of the
+views plugin.
+
+b. <![CDATA[<map:match pattern="prepare.include.*.**"> ]]>
+Aggregate the contract-templates requested by the view with xinclude.
+The result is a stylesheet with all needed xsl:templates.
+
+c. <![CDATA[<map:match pattern="prepare.properties.*.*">]]>
+Aggregate the forrest:properties requested by the *.fv.
+The result is an aggregation of properties which defines the templates
+to be call.
+
+d. <![CDATA[<map:match pattern="prepare.xhtml.*">]]>
+Aggregate all contracts-templates requested by the view.
+Create a xsl that can be used for the last step of the transformation of
+the view.
+
+e. <![CDATA[<map:match pattern="*.html"> ]]>-> Last processing step.
+Here we are overriding the default skin generation.
+-> this match is implemented in the viewHelper plugin
+
+GENERAL:
+Views are stored in forrest:view ({file-name}.fv) please have look on
+plugins/org.apache.forrest.plugin.internal.structurer/src/documentation/common.fv do
+get an idea how your own implementation have to look like.
+
+ </source>
+ </section>
+ <section>
+ <title>Resume</title>
+ <source>
+The views plugin can be seen as prototype for the next generation
+skinning of forrest. It is still in early stage but with extracting the businessHelper we
+hope to make it easier for all devs (not only committer) to get the idea
+and enable them to enhance the design of this plugin and their implementation.
+
+Some basic and simple hints:
+a) If you want another implementation of a contract then create a folder
+"templates" in ${project.resources-dir} and it will be matched before
+the standard implementation.
+
+e.g. feedback contract:
+<![CDATA[
+<forrest:contract name="feedback" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+<description>
+This function will output the html feedback information.
+</description>
+
+<forrest:template
+xmlns:forrest="http://apache.org/forrest/templates/1.0"
+format="xhtml" name="feedback" inputFormat="xsl" body="true"
+head="false" css="true">
+
+<xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+
+<xsl:template name="feedback-css">
+#feedback {
+ color: black;
+ background: #CFDCED;
+ text-align:center;
+ margin-top: 5px;
+}
+#feedback #feedbackto {
+ font-size: 90%;
+ color: black;
+}</xsl:template>
+
+<xsl:template name="feedback-body">
+<div id="feedback"> Modified project implementation
+<xsl:value-of select="$config/feedback"/>
+<xsl:choose>
+<xsl:when test="$config/feedback/@href and
+not($config/feedback/@href='')">
+ <a id="feedbackto">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$config/feedback/@href"/>
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ <xsl:value-of select="$config/feedback/@to"/>
+ </a>
+</xsl:when>
+<xsl:otherwise>
+ <xsl:value-of select="$config/feedback/@to"/>
+</xsl:otherwise>
+</xsl:choose>
+</div>
+</xsl:template>
+</xsl:stylesheet>
+</forrest:template>
+</forrest:contract>
+]]>
+The @attributes (body="true" head="false" css="true") of the
+forrest:template defining which parts of the html page (head, head-css
+and body) we have to render. The xsl:templates are following the simple
+naming convention {@name}-(css|head|body).
+
+
+b. If you want a default view for your project then copy the common.fv
+from the viewHelper implementation to your ${project.conf-dir} and modify this file. When
+you want another view for a specific file (e.g. ${project.xdocs-dir}/index.html) then copy
+the common.fv to your ${project.xdocs-dir} and renamed it to
+${project.xdocs-dir}/index.fv.</source>
+ </section>
+ </body>
+</document>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/group-logo.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/group-logo.gif
new file mode 100644
index 0000000..f017f32
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/group-logo.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/group.svg b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/group.svg
new file mode 100644
index 0000000..fcfcaca
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/group.svg
@@ -0,0 +1,81 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+ SVG Anteater logo
+
+To get started with SVG, I'd recommend getting the Adobe SVG plugin, and the
+xml-batik CVS module. Then have a look at the xml-batik/samples files. Use the
+SVG spec (http://www.w3.org/TR/SVG/) as a reference.
+-->
+
+<!-- See Forrest Issue: FOR-229
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
+[
+ <!ATTLIST svg xmlns:for CDATA #FIXED "http://apache.org/forrest">
+ <!ENTITY % textExt "|for:group-name">
+ <!ELEMENT for:group-name (#PCDATA)>
+]>
+-->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xsl:version="1.0"
+ xmlns:for="http://apache.org/forrest"
+ width="220" height="65" >
+ <title>Anteater logo</title>
+
+ <defs>
+
+ <!--
+ <radialGradient id="radialGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </radialGradient>
+ <linearGradient id="linearGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </linearGradient>
+ -->
+
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
+ <stop style="stop-color:white" offset="0"/>
+ <stop style="stop-color:lightgreen" offset="1"/>
+ </linearGradient>
+ <filter id="shadowFilter" filterUnits="objectBoundingBox" width="1.4" height="1.4">
+ <!-- Takes the alpha channel (black outline of the text), blurs it and saves as 'blur' -->
+ <feGaussianBlur in="SourceAlpha" stdDeviation="2 2" result="blur"/>
+ <!-- Takes saved 'blur' and offsets it by 4 pixels, saves as 'offsetBlur' -->
+ <feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
+ <!-- Merges SourceGraphic (original image) and 'offsetBlur', putting the
+ former 'over' the latter, and using the merged result as the finished
+ image -->
+ <feComposite in="SourceGraphic" in2="offsetBlur" operator="over"/>
+ </filter>
+
+ </defs>
+
+ <g filter="url(#shadowFilter)" fill="url(#gradient)">
+ <text x="40%" y="60%" style="font-size:24pt; font-family:Verdana ; text-anchor: middle">
+ <for:group-name />
+ </text>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/icon.png b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/icon.png
new file mode 100644
index 0000000..3be8bbb
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/icon.png
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/project-logo.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/project-logo.gif
new file mode 100644
index 0000000..0be777d
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/project-logo.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/project.svg b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/project.svg
new file mode 100644
index 0000000..01abcdb
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/project.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+ SVG Anteater logo
+
+To get started with SVG, I'd recommend getting the Adobe SVG plugin, and the
+xml-batik CVS module. Then have a look at the xml-batik/samples files. Use the
+SVG spec (http://www.w3.org/TR/SVG/) as a reference.
+-->
+
+<!-- See Forrest Issue: FOR-229
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
+[
+ <!ATTLIST svg xmlns:for CDATA #FIXED "http://apache.org/forrest">
+ <!ENTITY % textExt "|for:project-name">
+ <!ELEMENT for:project-name (#PCDATA)>
+]>
+-->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xsl:version="1.0"
+ xmlns:for="http://apache.org/forrest"
+ width="420" height="65" >
+ <title>Anteater logo</title>
+
+ <defs>
+
+ <!--
+ <radialGradient id="radialGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </radialGradient>
+ <linearGradient id="linearGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </linearGradient>
+ -->
+
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
+ <stop style="stop-color:white" offset="0"/>
+ <stop style="stop-color:lightgreen" offset="1"/>
+ </linearGradient>
+
+ <filter id="shadowFilter" filterUnits="objectBoundingBox" width="1.4" height="1.4">
+ <!-- Takes the alpha channel (black outline of the text), blurs it and saves as 'blur' -->
+ <feGaussianBlur in="SourceAlpha" stdDeviation="2 2" result="blur"/>
+ <!-- Takes saved 'blur' and offsets it by 4 pixels, saves as 'offsetBlur' -->
+ <feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
+ <!-- Merges SourceGraphic (original image) and 'offsetBlur', putting the
+ former 'over' the latter, and using the merged result as the finished
+ image -->
+ <feComposite in="SourceGraphic" in2="offsetBlur" operator="over"/>
+ </filter>
+
+ </defs>
+
+ <g filter="url(#shadowFilter)" fill="url(#gradient)">
+ <text x="100%" y="60%" style="font-size:24pt; font-family:Verdana ; text-anchor: end" >
+ <for:project-name />
+ </text>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/usemap.gif b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/usemap.gif
new file mode 100644
index 0000000..c10732c
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/images/usemap.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/index.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/index.xml
new file mode 100644
index 0000000..23701ee
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/index.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>forrest:views - x output formats, one config</title>
+ <abstract>This plugin depends on a ViewHelper and a BusinessHelper implementation.</abstract>
+ </header>
+ <body>
+ <section>
+ <title>view</title>
+ <p>Together with the ViewHelper and the BusinessHelper (to be implemented)
+ plugin this plugin is following the <a href="ext:sun/j2ee/patterns/dispatcherView">DispatcherView pattern</a>
+ and building the final view which will be delivered to the client. This implementation follows exactly the pattern shown on
+ <a href="ext:corej2eepatterns/patterns/dispatcherView">corej2eepatterns.com</a>
+ </p><p>
+ A view will be configured by a config file
+ which basically contains the following tags (it is still evolving): </p>
+<source><![CDATA[<forrest:view type="xhtml">
+ <forrest:css url="common.css"/>
+ <forrest:contract name="meta"/>
+ <forrest:hook name="container">
+ <forrest:contract name="feedback"/>
+ </forrest:hook />
+</forrest:view>]]></source>
+<p>The view tag's @type determines the final output format. The idea is to
+configure different output formats within a forrest:views. That means a forrest:views
+can contain n different "forrest:view" configurations for n different formats. <br/>
+In short: x formats, one config. :)</p>
+<source><![CDATA[<forrest:views
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+<forrest:view type="xhtml">
+ <forrest:css url="common.css"/>
+ <forrest:contract name="meta"/>
+ <forrest:hook name="container">
+ <forrest:contract name="feedback"/>
+ </forrest:hook />
+</forrest:view>
+<forrest:view type="fo">
+ <forrest:hook name="container">
+ <forrest:contract name="feedback"/>
+ </forrest:hook />
+</forrest:view>
+/forrest:views>]]></source>
+</section>
+<section>
+ <title>viewHelper</title>
+ <p>viewHelper class/implementation - a class/implementation which will
+access the presentation model and transform its models. In other words
+it is a presentation producing factory.
+</p>
+<note>The <![CDATA[<forrest:contract name="nav-main"/>]]> expects a certain model
+(now produced by leather-dev - tab2menu.xsl) to transform it. In the
+future this dependency will be on a businessHelper implementation that
+has to be defined in the view. For now it depends on leather-dev. I
+guess leather-dev is still not dead till the businessHelper plugin comes
+(which will implement the businessHelper of leather-dev). ;-)</note>
+<p>
+Each forrest:css will be transformed into a <![CDATA[<link rel="stylesheet" type="text/css" url="{$root}skin/{url}">]]> tag (in html
+output [only format that has an implementation]).
+This tags are designed to help <strong>web-designers</strong> to freely implemend their own css-implementations for a view.
+</p>
+<p>
+Each forrest:hook will be transformed into a <![CDATA[<div/>]]> tag (in html
+output [only format that has an implementation]).
+This tags are designed to help <strong>web-designers</strong> to freely move
+around and group contracts into design container.
+</p>
+<p>Each forrest:contract will dispatch a xml file (ViewHelper) that contains
+xsl:stylesheets (for now, but other implementations to transform the presentation
+ model are/should be possible) for the different output formats of a contract.
+ For html, the only format that we have implemented so far, we
+have three different kind of templates:</p><p>
+<![CDATA[<xsl:templates name="{contract/@name}-css/>]]><br/>
+Here the contract specific css will be stored.
+</p><p>
+<![CDATA[<xsl:templates name="{contract/@name}-head/>]]><br/>
+Here goes everything that belongs in the html head. e.g. scripts.
+</p><p>
+<![CDATA[<xsl:templates name="{contract/@name}-body/>]]><br/>
+Everything that belongs into the body.
+ </p>
+ </section>
+ <section>
+ <title>BusinessHelper </title>
+ <p><strong>businessHelper class/implementation </strong>- a class/implementation which will
+access businessServices to produce models for the presentation model. In
+other word it is a data producing factory.
+</p>
+<note>Right now we are using the default forrest businessHelper (defined
+by the skin you are using). There are contracts that depend on a
+businessHelper implementation of leather-dev (tab2menu.xsl, site2xhtml.xsl,...).
+We will create a businessHelper plugin to overcome this problem.</note>
+ <p>Right now it is implemented for the forrest way of producing the models
+for the view but we will create an independent BusinessHelper to
+access all BusinessServices you may have in your application. </p>
+ </section>
+ <section>
+ <title>links</title>
+ <note>There are/were lots of mails on the dev-list. Please, search the list</note>
+ <p>Background mailings around the views concept</p>
+ <ul>
+ <li><a href="ext:mailings/dev/pInfra">[RT] plugin infrastructure</a> </li>
+ <li><a href="ext:mailings/dev/ftLeather">[RT] Forrest templates for second generation skining - towards Corium</a> </li>
+ </ul>
+
+ </section>
+ </body>
+</document>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/site.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/site.xml
new file mode 100644
index 0000000..cd6b4d3
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/site.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+Forrest site.xml
+
+This file contains an outline of the site's information content. It is used to:
+- Generate the website menus (though these can be overridden - see docs)
+- Provide semantic, location-independent aliases for internal 'site:' URIs, eg
+<link href="site:changes"> links to changes.html (or ../changes.html if in
+ subdir).
+- Provide aliases for external URLs in the external-refs section. Eg, <link
+ href="ext:cocoon"> links to http://cocoon.apache.org/
+
+See http://forrest.apache.org/docs/linking.html for more info
+-->
+
+<site label="org.apache.forrest.plugin.internal.views" href="" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
+
+ <about label="About">
+ <index label="Index" href="index.html" description="Welcome to org.apache.forrest.plugin.internal.views"/>
+ <howItWorks label="howItWorks" href="how/howItWork.html" description="howItWorks"/>
+ <changes label="Changes" href="changes.html" description="History of Changes" />
+ <todo label="Todo" href="todo.html" description="Todo List" />
+ </about>
+
+ <!--
+ The href must be wholesite.html/pdf You can change the labels and node names
+ <all label="All">
+ <whole_site_html label="Whole Site HTML" href="wholesite.html"/>
+ <whole_site_pdf label="Whole Site PDF" href="wholesite.pdf"/>
+ </all>
+ -->
+
+ <external-refs>
+ <forrest href="http://forrest.apache.org/">
+ <linking href="docs/linking.html"/>
+ <validation href="docs/validation.html"/>
+ <webapp href="docs/your-project.html#webapp"/>
+ <dtd-docs href="docs/dtd-docs.html"/>
+ </forrest>
+ <sun href="http://java.sun.com/">
+ <j2ee href="j2ee/">
+ <patterns href="patterns/">
+ <dispatcherView href="DispatcherView.html" />
+ </patterns>
+ </j2ee>
+ </sun>
+ <corej2eepatterns href="http://corej2eepatterns.com/">
+ <patterns href="Patterns2ndEd/">
+ <dispatcherView href="DispatcherView.htm" />
+ </patterns>
+ </corej2eepatterns>
+ <cocoon href="http://cocoon.apache.org/"/>
+ <xml.apache.org href="http://xml.apache.org/"/>
+ <mailings href="http://marc.theaimsgroup.com/?">
+ <dev href="l=forrest-dev&">
+ <pInfra href="m=110019697426791&w=2"/>
+ <ftLeather href="m=109959086204887&w=2"/>
+ </dev>
+ </mailings>
+ </external-refs>
+
+</site>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/tabs.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/tabs.xml
new file mode 100644
index 0000000..43e3d9c
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/content/xdocs/tabs.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE tabs PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.1//EN" "http://forrest.apache.org/dtd/tab-cocoon-v11.dtd">
+
+<tabs software="MyProj"
+ title="MyProj"
+ copyright="Foo"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <!-- The rules for tabs are:
+ @dir will always have '/@indexfile' added.
+ @indexfile gets appended to @dir if the tab is selected. Defaults to 'index.html'
+ @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 @id's are present, site.xml entries with a matching @tab will be in that tab.
+
+ Tabs can be embedded to a depth of two. The second level of tabs will only
+ be displayed when their parent tab is selected.
+ -->
+
+ <tab id="" label="Home" dir="" indexfile="index.html"/>
+ <!-- Add new tabs here, eg:
+ <tab label="How-Tos" dir="community/howto/"/>
+ <tab label="XML Site" dir="xml-site/"/>
+ -->
+
+</tabs>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/skinconf.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/skinconf.xml
new file mode 100644
index 0000000..86b3bc9
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/documentation/skinconf.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2006 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!DOCTYPE skinconfig PUBLIC "-//APACHE//DTD Skin Configuration V0.7-1//EN" "http://forrest.apache.org/dtd/skinconfig-v07-1.dtd"
+[
+ <!ENTITY skinconf-common PUBLIC "-//Apache Forrest//ENTITIES Skin Configuration common plugins V0.7-1//EN" "">
+]>
+
+<skinconfig>
+ &skinconf-common;
+
+ <project-name>Plugin: structurer internal</project-name>
+ <project-description>org.apache.forrest.plugin.internal.structurer plugin for Apache Forrest</project-description>
+
+</skinconfig>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBean.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBean.java
new file mode 100644
index 0000000..f963e14
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBean.java
@@ -0,0 +1,187 @@
+package org.apache.forrest.dispatcher;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.dom.DOMResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public interface ContractBean {
+
+ /**
+ * The resolver prefix
+ */
+ public static final String CONTRACT_RESOLVE_PREFIX = "lm://resolve.contract";
+
+ /**
+ * <code>forrest:contract</code> element is used to include extra content
+ * and/or functionality.
+ *
+ * <p>
+ * extra functionality requested from a uri via CONTRACT_NUGGET_ATTRIBUTE
+ * attribute - example:
+ * </p>
+ *
+ * <pre>
+ * <forrest:contract name="nav-section" dataURI="cocoon://index.navigation.xml"/>
+ * </pre>
+ */
+ public static final String CONTRACT_ELEMENT = "contract";
+
+ /**
+ * Each contract can contact external/internal business services to get the
+ * data model. The attribute "CONTRACT_NUGGET_ATTRIBUTE" is the identifier
+ * for the uri of the business data
+ */
+ public static final String CONTRACT_NUGGET_ATTRIBUTE = "dataURI";
+
+ /**
+ * Each contract must have an unique identifier. The attribute
+ * "CONTRACT_ID_ATTRIBUTE" stands for this id
+ */
+ public static final String CONTRACT_ID_ATTRIBUTE = "name";
+
+ /**
+ * Each contract implementation needs to define the input format for the
+ * transformation. ATM we only support xsl. The attribute
+ * "CONTRACT_IMPL_INPUT_FORMAT_ATTRIBUTE" defines the input format for
+ * transformation
+ */
+ public static final String CONTRACT_IMPL_INPUT_FORMAT_ATTRIBUTE = "inputFormat";
+
+ /**
+ * Each contract implementation needs to store the input format within a
+ * root element
+ */
+ public static final String CONTRACT_IMPL_ROOT_ELEMENT = "forrest:template";
+
+ /**
+ * Each contract can have properties, which are definite e.g. in the
+ * structurer index.fv and used in the contract.
+ *
+ * <pre>
+ * <forrest:contract name="nav-main-testing" nugget="cocoon://index.navigation.xml">
+ * <forrest:property name="nav-main-testing-test1" >Just a test</forrest:property>
+ * </forrest:contract>
+ * </pre>
+ */
+ public static final String PROPERTY_ELEMENT = "property";
+
+ /**
+ * Each property must have an unique identifier. The attribute
+ * "PROPERTY_ID_ATTRIBUTE" stands for this id
+ */
+ static public final String PROPERTY_ID_ATTRIBUTE = "name";
+
+ /**
+ * Recycle the component
+ */
+ public abstract void recycle();
+
+ /**
+ * initialize the contract (normally done after recycle) Do not use to
+ * create a new instance!!!
+ *
+ * @throws ParserConfigurationException
+ */
+ public abstract void initialize() throws ParserConfigurationException;
+
+ /**
+ * setContractImpl(String contractUri)
+ *
+ * This method invokes the setting of the actual contract implementation via
+ * an URI.
+ *
+ * @param contractUri
+ * @throws Exception
+ */
+ public abstract void setContractImpl(String contractUri) throws Exception;
+
+ /**
+ * setContractImpl(Document _contractImpl,systemID)
+ *
+ * This method invokes the setting of the actual contract implementation via
+ * a document.
+ *
+ * @param _contractImpl
+ * @param systemID
+ * @throws Exception
+ */
+ public abstract void setContractImpl(Document _contractImpl, String systemID)
+ throws Exception;
+
+ /**
+ * The presentation model (contractRawData) has to be requested by the
+ * contract if it needs it. This is be done by setting the
+ * CONTRACT_NUGGET_ATTRIBUTE attribute in the structurer which then use this
+ * method to set the contractRawData.
+ * <p>
+ * Extra functionality requested from a uri via CONTRACT_NUGGET_ATTRIBUTE
+ * attribute - example:
+ * </p>
+ *
+ * <pre>
+ * <forrest:contract name="nav-section" dataURI="cocoon://index.navigation.xml"/>
+ * </pre>
+ *
+ * @param nuggetUri
+ * @throws Exception
+ */
+ public abstract void setNuggetUri(String nuggetUri) throws Exception;
+
+ /**
+ * This method invokes the transformation of the this.contractRawData with
+ * the this.contractTransformer (make sure you set them before). The result
+ * is set to this.contractResultData.
+ *
+ * @throws TransformerException
+ */
+ public abstract void setContractResultData() throws DispatcherException;
+
+ /*
+ * Getter and setter methods
+ */
+ public abstract String getContractName();
+
+ public abstract void setContractName(String contractName);
+
+ public abstract boolean isHasProperties();
+
+ public abstract void setHasProperties(boolean hasProperties);
+
+ public abstract boolean isNugget();
+
+ public abstract void setNugget(boolean isNugget);
+
+ public abstract String getNuggetUri();
+
+ public abstract Node getContractRawData();
+
+ public abstract void setContractRawData(Document contractRawData);
+
+ public abstract Transformer getContractTransformer();
+
+ public abstract void setContractTransformer(Transformer contractTransformer);
+
+ public abstract Document getContractImpl();
+
+ public abstract Element getContractDescription();
+
+ public abstract void setContractDescription(Element contractDescription);
+
+ public abstract Element getContractUsage();
+
+ public abstract void setContractUsage(Element contractUsage);
+
+ public abstract Element[] getPropertyList();
+
+ public abstract void setPropertyList(Element[] propertyList);
+
+ public abstract DOMResult getContractResultData();
+
+ public abstract void setContractResultData(DOMResult contractResultData);
+
+}
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
new file mode 100644
index 0000000..a528fc2
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
@@ -0,0 +1,523 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.dispatcher;
+
+import java.beans.Beans;
+import java.util.HashMap;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author thorsten
+ *
+ */
+public class ContractBeanDOMImpl extends Beans implements ContractBean {
+
+ private Element[] propertyList;
+
+ /**
+ * The implementation of the contract
+ */
+ private Document contractImpl;
+
+ /**
+ * The description of the contract
+ */
+ private Element contractDescription;
+
+ /**
+ * The usage instruction of this contract for the structurer
+ */
+ private Element contractUsage;
+
+ /**
+ * The raw data that should be used in the transformation. Either coming
+ * from the business service or from the calling class (as e.g. foo element
+ * document)
+ */
+ private Document contractRawData;
+
+ /**
+ * The transformer that will transform the raw data with the contract
+ * implementation
+ */
+ private Transformer contractTransformer;
+
+ /**
+ * The resulting data from the transformation
+ */
+ private DOMResult contractResultData;
+
+ /**
+ * Does this contract request a business service
+ */
+ private boolean isNugget = false;
+
+ /**
+ * Does the contract has properties
+ */
+ private boolean hasProperties = false;
+
+ /**
+ * The name of the contract
+ */
+ private String contractName;
+
+ /**
+ * The uri of the business service
+ */
+ private String nuggetUri;
+
+ /*
+ * Helper
+ */
+ protected NamespaceHelper namespaceHelper;
+
+ protected DispatcherHelper dispatcherHelper;
+
+ protected ServiceManager manager;
+
+ private HashMap parameterHelper;
+
+ private String m_systemID;
+
+ private URIResolver m_uriResolver;
+
+ /**
+ * The ContractBean contains all fields to work with contracts. It is a
+ * helper bean.
+ *
+ * Helpers (forrest:contracts) mainly adapt and transform the presentation
+ * model (pm), but also help with any limited business processing that is
+ * initiated from the structurer by forrest:properties by passing this
+ * information to the transfomer.
+ *
+ * @param manager
+ * @param parameterHelper
+ * @throws ParserConfigurationException
+ */
+ public ContractBeanDOMImpl(ServiceManager manager, HashMap parameterHelper,URIResolver uriResolver)
+ throws ParserConfigurationException {
+ m_uriResolver=uriResolver;
+ this.manager = manager;
+ dispatcherHelper = new DispatcherHelper(manager);
+ this.parameterHelper = parameterHelper;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#recycle()
+ */
+ public void recycle() {
+ this.contractDescription = null;
+ this.contractImpl = null;
+ this.contractName = null;
+ this.contractRawData = null;
+ this.contractResultData = null;
+ this.contractTransformer = null;
+ this.contractUsage = null;
+ this.dispatcherHelper = null;
+ this.hasProperties = false;
+ this.isNugget = false;
+ this.namespaceHelper = null;
+ this.nuggetUri = null;
+ this.propertyList = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#initialize()
+ */
+ public void initialize() throws ParserConfigurationException {
+ dispatcherHelper = new DispatcherHelper(this.manager);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractImpl(java.lang.String)
+ */
+ public void setContractImpl(String contractUri) throws Exception {
+ m_systemID = contractUri;
+ Document _contractImpl = dispatcherHelper.getDocument(contractUri);
+ this.contractImpl = _contractImpl;
+ contractImplHelper(this.contractImpl);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractImpl(org.w3c.dom.Document)
+ */
+ public void setContractImpl(Document _contractImpl, String systemID)
+ throws Exception {
+ m_systemID = systemID;
+ this.contractImpl = _contractImpl;
+ contractImplHelper(this.contractImpl);
+ }
+
+ /**
+ * contractImplHelper(Document _contractImpl)
+ *
+ * This method set the actual contract implementation via a document.
+ *
+ * Here we set the description and the usage instruction of the contract
+ * implementation. As well we prepare the transformer. The simplest form is
+ * a contract that does not need a pm. It can provide all data through the
+ * transformation. A more dynamic contract would provide properties to the
+ * transformation (contractImpl) to apply limited business logic.
+ *
+ * @param _contractImpl
+ * @throws Exception
+ * @throws TransformerFactoryConfigurationError
+ * @throws TransformerConfigurationException
+ * @throws IllegalArgumentException
+ */
+ private void contractImplHelper(Document _contractImpl) throws Exception,
+ TransformerFactoryConfigurationError,
+ TransformerConfigurationException, IllegalArgumentException {
+ NodeList template = _contractImpl
+ .getElementsByTagName(CONTRACT_IMPL_ROOT_ELEMENT);
+ if (template.getLength() == 1) {
+ Element templateElement = (Element) template.item(0);
+ String format = templateElement
+ .getAttribute(CONTRACT_IMPL_INPUT_FORMAT_ATTRIBUTE);
+ if ("".equals(format) | format == null) {
+ throw new DispatcherException(DispatcherException.ERROR_500
+ + "\n" + "component: ContractBean" + "\n" + "message:"
+ + "\n" + "inputFormat cannot be null");
+ } else if ("xsl".equals(format)) {
+ NodeList list_transformer = _contractImpl
+ .getElementsByTagName("xsl:stylesheet");
+ if (list_transformer.getLength() == 1) {
+ Node node = list_transformer.item(0);
+ TransformerFactory transFact = TransformerFactory
+ .newInstance();
+ DOMSource stylesource = new DOMSource(node);
+ stylesource.setSystemId(m_systemID);
+ transFact.setURIResolver(m_uriResolver);
+ Templates cachedXSLT = transFact.newTemplates(stylesource);
+ if (cachedXSLT == null)
+ throw new DispatcherException(
+ DispatcherException.ERROR_500
+ + "\n"
+ + "component: ContractBean"
+ + "\n"
+ + "message:"
+ + "\n"
+ + "Could not setup transformer in the contractBean."
+ + "\n"
+ + "Please check that the contract implementation is wellformed and valid!"
+ + "\n"
+ + "\n"
+ + "One reason that an implementation may not be valid is that you are using variables that cannot be resolved."
+ + "\n"
+ + "Please see the logs and the sysout for more information, you may are see right away the error.");
+ /**
+ * Set default properties
+ */
+ // default forrest properties
+ Transformer transformer = cachedXSLT.newTransformer();
+ Node defaultVariables = org.apache.forrest.dispatcher.util.SourceUtil
+ .readDOM("cocoon://test-props", this.manager);
+ transformer.setParameter("defaultVariables",
+ defaultVariables);
+ transformer.setOutputProperty(
+ OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ this.contractTransformer = transformer;
+ }
+ } else {
+ throw new DispatcherException(DispatcherException.ERROR_404
+ + "\n" + "component: ContractBean" + "\n" + "message:"
+ + "\n" + "inputFormat=\"" + format
+ + "\" not implemented");
+ }
+ }
+ NodeList description = _contractImpl
+ .getElementsByTagName("description");
+ if (description.getLength() == 1) {
+ Element node = (Element) description.item(0);
+ this.contractDescription = node;
+ }
+ NodeList usage = _contractImpl.getElementsByTagName("usage");
+ if (usage.getLength() == 1) {
+ Element node = (Element) usage.item(0);
+ this.contractUsage = node;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setNuggetUri(java.lang.String)
+ */
+ public void setNuggetUri(String nuggetUri) throws Exception {
+ this.nuggetUri = nuggetUri;
+ Document rawData = dispatcherHelper.getDocument(nuggetUri);
+ this.contractRawData = rawData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractResultData()
+ */
+ public void setContractResultData() throws DispatcherException {
+ if (this.getContractRawData() == null
+ || this.contractTransformer == null) {
+ throw new DispatcherException(
+ DispatcherException.ERROR_500
+ + "\n"
+ + "component: ContractBean"
+ + "\n"
+ + "message:"
+ + "\n"
+ + "Could not transform the result data in contractBean."
+ + "\n"
+ + "You need to invoke first the transfomer and the rawData."
+ + "\n"
+ + "If you see \"The contract \"null\" has thrown thrown an exception...\" "
+ + "that can mean you nested contracts, which is forbidden!"
+
+ );
+ } else {
+ DOMSource source = new DOMSource(contractRawData);
+ DOMResult result = new DOMResult();
+ try {
+ this.contractTransformer.transform(source, result);
+ } catch (TransformerException e) {
+ throw new DispatcherException(
+ DispatcherException.ERROR_500
+ + "\n"
+ + "component: ContractBean"
+ + "\n"
+ + "message:"
+ + "\n"
+ + "Could not transform the result data in contractBean."
+ + "\n"
+ + "While trying to transform the raw data with the transformer, following error was thrown:\n"
+ + e);
+ }
+ this.setContractResultData(result);
+ }
+ }
+
+ /*
+ * Simple getter and setter methods
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractName()
+ */
+ public String getContractName() {
+ return contractName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractName(java.lang.String)
+ */
+ public void setContractName(String contractName) {
+ this.contractName = contractName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#isHasProperties()
+ */
+ public boolean isHasProperties() {
+ return hasProperties;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setHasProperties(boolean)
+ */
+ public void setHasProperties(boolean hasProperties) {
+ this.hasProperties = hasProperties;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#isNugget()
+ */
+ public boolean isNugget() {
+ return isNugget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setNugget(boolean)
+ */
+ public void setNugget(boolean isNugget) {
+ this.isNugget = isNugget;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getNuggetUri()
+ */
+ public String getNuggetUri() {
+ return nuggetUri;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractRawData()
+ */
+ public Node getContractRawData() {
+ return contractRawData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractRawData(org.w3c.dom.Document)
+ */
+ public void setContractRawData(Document contractRawData) {
+ this.contractRawData = contractRawData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractTransformer()
+ */
+ public Transformer getContractTransformer() {
+ return contractTransformer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractTransformer(javax.xml.transform.Transformer)
+ */
+ public void setContractTransformer(Transformer contractTransformer) {
+ this.contractTransformer = contractTransformer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractImpl()
+ */
+ public Document getContractImpl() {
+ return contractImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractDescription()
+ */
+ public Element getContractDescription() {
+ return contractDescription;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractDescription(org.w3c.dom.Element)
+ */
+ public void setContractDescription(Element contractDescription) {
+ this.contractDescription = contractDescription;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractUsage()
+ */
+ public Element getContractUsage() {
+ return contractUsage;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractUsage(org.w3c.dom.Element)
+ */
+ public void setContractUsage(Element contractUsage) {
+ this.contractUsage = contractUsage;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getPropertyList()
+ */
+ public Element[] getPropertyList() {
+ return propertyList;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setPropertyList(org.w3c.dom.Element[])
+ */
+ public void setPropertyList(Element[] propertyList) {
+ this.propertyList = propertyList;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#getContractResultData()
+ */
+ public DOMResult getContractResultData() {
+ return contractResultData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.forrest.dispatcher.ContractBeanInterface#setContractResultData(javax.xml.transform.dom.DOMResult)
+ */
+ public void setContractResultData(DOMResult contractResultData) {
+ this.contractResultData = contractResultData;
+ }
+
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/DispatcherException.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/DispatcherException.java
new file mode 100644
index 0000000..f34bff3
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/DispatcherException.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.dispatcher;
+
+/**
+ * Dispatcher Exception
+ */
+public class DispatcherException extends Exception {
+ public static final String ERROR_404 = "404 - Source not found";
+ public static final String ERROR_500 = "500 - Internal server error";
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Creates a new DispatcherException.
+ */
+ public DispatcherException() {
+ super();
+ }
+
+ /**
+ * Creates a new DispatcherException.
+ * @param message the exception message
+ */
+ public DispatcherException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a new DispatcherException.
+ * @param message the exception message
+ * @param cause the cause of the exception
+ */
+ public DispatcherException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Creates a new DispatcherException.
+ * @param cause the cause of the exception
+ */
+ public DispatcherException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/DispatcherHelper.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/DispatcherHelper.java
new file mode 100644
index 0000000..136f608
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/DispatcherHelper.java
@@ -0,0 +1,180 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.dispatcher;
+
+import java.beans.Beans;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.excalibur.source.SourceNotFoundException;
+import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class DispatcherHelper extends Beans {
+ /**
+ * The namespace for the dispatcher configuration is
+ * http://apache.org/forrest/templates/1.0
+ */
+ static public final String DISPATCHER_NAMESPACE_URI = "http://apache.org/forrest/templates/1.0";
+
+ /**
+ * The namespace prefix for this namespace.
+ */
+ static public final String DISPATCHER_PREFIX = "forrest";
+
+ private NamespaceHelper namespaceHelper;
+
+ private ServiceManager manager;
+
+ /**
+ * Create a DOM representation of this dispatcher.
+ *
+ * @return A DOM document.
+ * @throws ServiceException
+ * if a general error occurs.
+ * @throws SourceNotFoundException
+ * if the dispatcher's source can not be found
+ * @throws ParserConfigurationException
+ * if an error occurs during XML parsing.
+ * @throws SAXException
+ * if an error occurs during XML parsing.
+ * @throws IOException
+ * if an error occurs during source access..
+ */
+ public Document getDocument(String uri) throws Exception {
+ Document doc = org.apache.forrest.dispatcher.util.SourceUtil.readDOM(
+ uri, this.manager);
+ if (doc != null) {
+ this.namespaceHelper = new NamespaceHelper(
+ DISPATCHER_NAMESPACE_URI, DISPATCHER_PREFIX, doc);
+ }
+ return namespaceHelper.getDocument();
+ }
+
+ /**
+ * Creates a new document with the param rootName
+ *
+ * @param rootName
+ * @return
+ * @throws SAXException
+ */
+ public Document createDocument(String rootName) throws SAXException {
+ DOMBuilder builder = new DOMBuilder();
+ builder.startDocument();
+ builder.startElement("", rootName, rootName, XMLUtils.EMPTY_ATTRIBUTES);
+ builder.endElement("", rootName, rootName);
+ builder.endDocument();
+ return builder.getDocument();
+
+ }
+
+ public Transformer createTransformer()
+ throws TransformerConfigurationException {
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer();
+ // transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
+ // "yes");
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ return transformer;
+
+ }
+
+ public Transformer createTransformer(Source source)
+ throws TransformerConfigurationException {
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ Transformer transformer = tFactory.newTransformer(source);
+ // transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
+ // "yes");
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ return transformer;
+
+ }
+
+ /**
+ * void setAttributesDOM(Attributes attr, Node xpathNode) sets all
+ * attributes to the node (like <xsl:copy-of select="@*"/>)
+ *
+ * @param attr
+ * @param xpathNode
+ * @throws DOMException
+ */
+ public void setAttributesDOM(Attributes attr, Node xpathNode)
+ throws DOMException {
+ for (int i = 0; i < attr.getLength(); i++) {
+ String localName = attr.getLocalName(i);
+ String value = attr.getValue(i);
+ ((Element) xpathNode).setAttribute(localName, value);
+ }
+ }
+
+ public String setAttributesXPath(Attributes attr, String path)
+ throws DOMException {
+ if (attr.getLength() > 0) {
+ String xpath = "[";
+ for (int i = 0; i < attr.getLength(); i++) {
+ String localName = attr.getLocalName(i);
+ String value = attr.getValue(i);
+ xpath = xpath + "@" + localName + "='" + value + "'";
+ if (i < (attr.getLength() - 1)) {
+ xpath = xpath + " and ";
+ }
+ }
+ xpath = xpath + "]";
+ path = path + xpath;
+ }
+ return path;
+
+ }
+
+ public DispatcherHelper(ServiceManager manager)
+ throws ParserConfigurationException {
+ this.manager = manager;
+ this.namespaceHelper = new NamespaceHelper(DISPATCHER_NAMESPACE_URI,
+ DISPATCHER_PREFIX, "foo");
+ }
+
+ public NamespaceHelper getNamespaceHelper() {
+ return namespaceHelper;
+ }
+
+ public void setNamespaceHelper(NamespaceHelper namespaceHelper) {
+ this.namespaceHelper = namespaceHelper;
+ }
+
+ public void setNamespaceHelper(String uri, String prefix, String localName)
+ throws ParserConfigurationException {
+ this.namespaceHelper = new NamespaceHelper(uri, prefix, localName);
+ }
+
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/lenya/xml/DocumentHelper.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/lenya/xml/DocumentHelper.java
new file mode 100644
index 0000000..64431b7
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/lenya/xml/DocumentHelper.java
@@ -0,0 +1,446 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
+ */
+
+package org.apache.forrest.dispatcher.lenya.xml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.xml.resolver.tools.CatalogResolver;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.xml.sax.SAXException;
+
+/**
+ * Various utility methods to work with JAXP.
+ * @version $Id: DocumentHelper.java 264963 2005-08-31 07:58:45Z andreas $
+ */
+public class DocumentHelper {
+ /**
+ * Creates a non-validating and namespace-aware DocumentBuilder.
+ * @return A new DocumentBuilder object.
+ * @throws ParserConfigurationException if an error occurs
+ */
+ public static DocumentBuilder createBuilder() throws ParserConfigurationException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+
+ CatalogResolver cr = new CatalogResolver();
+ builder.setEntityResolver(cr);
+ return builder;
+ }
+
+ /**
+ * Creates a document. A xmlns:prefix="namespaceUri" attribute is added to
+ * the document element.
+ * @param namespaceUri The namespace URL of the root element.
+ * @param qualifiedName The qualified name of the root element.
+ * @param documentType The type of document to be created or null. When
+ * doctype is not null, its Node.ownerDocument attribute is set
+ * to the document being created.
+ * @return A new Document object.
+ * @throws DOMException if an error occurs
+ * @throws ParserConfigurationException if an error occurs
+ * @see org.w3c.dom.DOMImplementation#createDocument(String, String,
+ * DocumentType)
+ */
+ public static Document createDocument(String namespaceUri, String qualifiedName,
+ DocumentType documentType) throws DOMException, ParserConfigurationException {
+ DocumentBuilder builder = createBuilder();
+ Document document = builder.getDOMImplementation().createDocument(namespaceUri,
+ qualifiedName,
+ documentType);
+
+ // add xmlns:prefix attribute
+ String name = "xmlns";
+ int index = qualifiedName.indexOf(":");
+
+ if (index > -1) {
+ name += (":" + qualifiedName.substring(0, index));
+ }
+
+ document.getDocumentElement().setAttributeNS("http://www.w3.org/2000/xmlns/",
+ name,
+ namespaceUri);
+
+ return document;
+ }
+
+ /**
+ * Reads a document from a file.
+ * @return A document.
+ * @param file The file to load the document from.
+ * @throws ParserConfigurationException if an error occurs
+ * @throws SAXException if an error occurs
+ * @throws IOException if an error occurs
+ */
+ public static Document readDocument(File file) throws ParserConfigurationException,
+ SAXException, IOException {
+ DocumentBuilder builder = createBuilder();
+ return builder.parse(file);
+ }
+
+ /**
+ * Reads a document from a URL.
+ * @return A document.
+ * @param url The URL to load the document from.
+ * @throws ParserConfigurationException if an error occurs
+ * @throws SAXException if an error occurs
+ * @throws IOException if an error occurs
+ */
+ public static Document readDocument(URL url) throws ParserConfigurationException, SAXException,
+ IOException {
+ DocumentBuilder builder = createBuilder();
+ return builder.parse(url.toString());
+ }
+
+ /**
+ * Reads a document from a URI.
+ * @return A document.
+ * @param uri The URI to load the document from.
+ * @throws ParserConfigurationException if an error occurs
+ * @throws SAXException if an error occurs
+ * @throws IOException if an error occurs
+ */
+ public static Document readDocument(URI uri) throws ParserConfigurationException, SAXException,
+ IOException {
+ DocumentBuilder builder = createBuilder();
+ return builder.parse(uri.toString());
+ }
+
+ /**
+ * Reads a document from a string.
+ * @return A document.
+ * @param string The string to load the document from.
+ * @throws ParserConfigurationException if an error occurs
+ * @throws SAXException if an error occurs
+ * @throws IOException if an error occurs
+ */
+ public static Document readDocument(String string) throws ParserConfigurationException,
+ SAXException, IOException {
+ DocumentBuilder builder = createBuilder();
+ return builder.parse(string);
+ }
+
+ /**
+ * Reads a document from an input stream.
+ * @return A document.
+ * @param stream The input stream to load the document from.
+ * @throws ParserConfigurationException if an error occurs
+ * @throws SAXException if an error occurs
+ * @throws IOException if an error occurs
+ */
+ public static Document readDocument(InputStream stream) throws ParserConfigurationException,
+ SAXException, IOException {
+ DocumentBuilder builder = createBuilder();
+ return builder.parse(stream);
+ }
+
+ /**
+ * Writes a document to a file. A new file is created if it does not exist.
+ * @param document The document to save.
+ * @param file The file to save the document to.
+ * @throws IOException if an error occurs
+ * @throws TransformerConfigurationException if an error occurs
+ * @throws TransformerException if an error occurs
+ */
+ public static void writeDocument(Document document, File file)
+ throws TransformerConfigurationException, TransformerException, IOException {
+ // sanity checks
+ if (document == null)
+ throw new IllegalArgumentException("illegal usage, parameter document may not be null");
+ if (file == null)
+ throw new IllegalArgumentException("illegal usage, parameter file may not be null");
+
+ file.getParentFile().mkdirs();
+ file.createNewFile();
+
+ DOMSource source = new DOMSource(document);
+ StreamResult result = new StreamResult(file);
+ getTransformer(document.getDoctype()).transform(source, result);
+ }
+
+ /**
+ * Writes a document to a writer.
+ * @param document The document to write.
+ * @param writer The writer to write the document to.
+ * @throws TransformerConfigurationException if an error occurs
+ * @throws TransformerException if an error occurs
+ */
+ public static void writeDocument(Document document, Writer writer)
+ throws TransformerConfigurationException, TransformerException {
+
+ // sanity checks
+ if (document == null)
+ throw new IllegalArgumentException("illegal usage of DocumentHelper::writeDocument(), parameter document may not be null");
+
+ DOMSource source = new DOMSource(document);
+ StreamResult result = new StreamResult(writer);
+ getTransformer(document.getDoctype()).transform(source, result);
+ }
+
+ /**
+ * Get the transformer.
+ * @param documentType the document type
+ * @return a transformer
+ * @throws TransformerConfigurationException if an error occurs
+ */
+ protected static Transformer getTransformer(DocumentType documentType)
+ throws TransformerConfigurationException {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+
+ if (documentType != null) {
+ if (documentType.getPublicId() != null)
+ transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, documentType.getPublicId());
+ if (documentType.getSystemId() != null)
+ transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, documentType.getSystemId());
+ }
+
+ return transformer;
+ }
+
+ /**
+ * Creates a document type.
+ * @param qualifiedName The qualified name of the document type.
+ * @param publicId The public identifier.
+ * @param systemId The system identifier.
+ * @return the document type
+ * @throws ParserConfigurationException if an error occurs
+ * @see org.w3c.dom.DOMImplementation#createDocumentType(java.lang.String,
+ * java.lang.String, java.lang.String)
+ */
+ public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId)
+ throws ParserConfigurationException {
+ DocumentBuilder builder = createBuilder();
+
+ return builder.getDOMImplementation().createDocumentType(qualifiedName, publicId, systemId);
+ }
+
+ /**
+ * Returns the first child element of an element that belong to a certain
+ * namespace or <code>null</code> if none exists.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @return The first child element or <code>null</code> if none exists.
+ */
+ public static Element getFirstChild(Element element, String namespaceUri) {
+ return getFirstChild(element, namespaceUri, "*");
+ }
+
+ /**
+ * Returns the first child element of an element that belongs to a certain
+ * namespace and has a certain local name or <code>null</code> if none
+ * exists.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @param localName The local name of the children.
+ * @return The child element or <code>null</code> if none exists.
+ */
+ public static Element getFirstChild(Element element, String namespaceUri, String localName) {
+ Element[] children = getChildren(element, namespaceUri, localName);
+
+ if (children.length > 0) {
+ return children[0];
+ }
+ return null;
+ }
+
+ /**
+ * Returns all child elements of an element, regardless of the namespace.
+ * @param element The parent element.
+ * @return The child elements.
+ */
+ public static Element[] getChildren(Element element) {
+ List childElements = new ArrayList();
+ NodeList children = element.getElementsByTagName("*");
+
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getParentNode() == element) {
+ childElements.add(children.item(i));
+ }
+ }
+
+ return (Element[]) childElements.toArray(new Element[childElements.size()]);
+ }
+
+ /**
+ * Returns all child elements of an element that belong to a certain
+ * namespace.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @return The child elements.
+ */
+ public static Element[] getChildren(Element element, String namespaceUri) {
+ return getChildren(element, namespaceUri, "*");
+ }
+
+ /**
+ * Returns all child elements of an element that belong to a certain
+ * namespace and have a certain local name.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @param localName The local name of the children.
+ * @return The child elements.
+ */
+ public static Element[] getChildren(Element element, String namespaceUri, String localName) {
+ List childElements = new ArrayList();
+ NodeList children = element.getElementsByTagNameNS(namespaceUri, localName);
+
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getParentNode() == element) {
+ childElements.add(children.item(i));
+ }
+ }
+
+ return (Element[]) childElements.toArray(new Element[childElements.size()]);
+ }
+
+ /**
+ * Returns the text inside an element. Only the child text nodes of this
+ * element are collected.
+ * @param element The element.
+ * @return The text inside the element.
+ */
+ public static String getSimpleElementText(Element element) {
+ StringBuffer buffer = new StringBuffer();
+ NodeList children = element.getChildNodes();
+
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+
+ if (child instanceof Text) {
+ buffer.append(child.getNodeValue());
+ }
+ }
+
+ return buffer.toString();
+ }
+
+ /**
+ * Replaces all child nodes of an element by a single text node.
+ * @param element The element.
+ * @param text The text to insert.
+ */
+ public static void setSimpleElementText(Element element, String text) {
+ NodeList children = element.getChildNodes();
+
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ element.removeChild(child);
+ }
+
+ Node textNode = element.getOwnerDocument().createTextNode(text);
+ element.appendChild(textNode);
+ }
+
+ /**
+ * Returns all following sibling elements of an element that belong to a
+ * certain namespace.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @return The following sibling elements.
+ */
+ public static Element[] getNextSiblings(Element element, String namespaceUri) {
+ return getNextSiblings(element, namespaceUri, "*");
+ }
+
+ /**
+ * Returns all following sibling elements of an element that belong to a
+ * certain namespace. and have a certain local name.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @param localName The local name of the children.
+ * @return The following sibling elements.
+ */
+ public static Element[] getNextSiblings(Element element, String namespaceUri, String localName) {
+ List childElements = new ArrayList();
+ Element parent = (Element) element.getParentNode();
+ Element[] children = getChildren(parent, namespaceUri, localName);
+
+ int l = children.length;
+ for (int i = 0; i < children.length; i++) {
+ if (children[i] == element) {
+ l = i;
+ }
+ if (i > l) {
+ childElements.add(children[i]);
+ }
+ }
+
+ return (Element[]) childElements.toArray(new Element[childElements.size()]);
+ }
+
+ /**
+ * Returns all preceding sibling elements of an element that belong to a
+ * certain namespace.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @return The preceding sibling elements.
+ */
+ public static Element[] getPrecedingSiblings(Element element, String namespaceUri) {
+ return getPrecedingSiblings(element, namespaceUri, "*");
+ }
+
+ /**
+ * Returns all preceding sibling elements of an element that belong to a
+ * certain namespace. and have a certain local name.
+ * @param element The parent element.
+ * @param namespaceUri The namespace that the childen must belong to.
+ * @param localName The local name of the children.
+ * @return The preceding sibling elements.
+ */
+ public static Element[] getPrecedingSiblings(Element element, String namespaceUri,
+ String localName) {
+ List childElements = new ArrayList();
+ Element parent = (Element) element.getParentNode();
+ Element[] children = getChildren(parent, namespaceUri, localName);
+
+ int i = 0;
+ while (children[i] != element && i < children.length) {
+ childElements.add(children[i]);
+ i++;
+ }
+
+ return (Element[]) childElements.toArray(new Element[childElements.size()]);
+ }
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/lenya/xml/NamespaceHelper.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/lenya/xml/NamespaceHelper.java
new file mode 100644
index 0000000..55ada26
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/lenya/xml/NamespaceHelper.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
+ */
+
+/* $Id: NamespaceHelper.java 155269 2005-02-24 22:42:55Z andreas $ */
+
+package org.apache.forrest.dispatcher.lenya.xml;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Text;
+
+
+/**
+ * A NamespaceHelper object simplifies the creation of elements in a certain
+ * namespace. All elements are owned by a document that is passed to the
+ * {@link #NamespaceHelper(String, String, Document)} constructor or created
+ * using the {@link #NamespaceHelper(String, String, String)} constructor.
+ */
+public class NamespaceHelper {
+ private String namespaceUri;
+ private String prefix;
+ private Document document;
+
+ /**
+ * Creates a new instance of NamespaceHelper using an existing document. The
+ * document is not affected. If you omit the prefix, the default namespace is used.
+ * @param _document The document.
+ * @param _namespaceUri The namespace URI.
+ * @param _prefix The namespace prefix.
+ */
+ public NamespaceHelper(String _namespaceUri, String _prefix, Document _document) {
+ this.namespaceUri = _namespaceUri;
+ this.prefix = _prefix;
+ this.document = _document;
+ }
+
+ /**
+ * <p>
+ * Creates a new instance of NamespaceHelper. A new document is created
+ * using a document element in the given namespace with the given prefix.
+ * If you omit the prefix, the default namespace is used.
+ * </p>
+ * <p>
+ * NamespaceHelper("http://www.w3.org/2000/svg", "svg", "svg"):<br/>
+ * <?xml version="1.0"><br/>
+ * <svg:svg xmlns:svg="http://www.w3.org/2000/svg"><br/>
+ * </svg:svg>
+ * </p>
+ * @param localName The local name of the document element.
+ * @param _namespaceUri The namespace URI.
+ * @param _prefix The namespace prefix.
+ * @throws ParserConfigurationException if an error occured
+ */
+ public NamespaceHelper(String _namespaceUri, String _prefix, String localName)
+ throws ParserConfigurationException {
+ this.namespaceUri = _namespaceUri;
+ this.prefix = _prefix;
+ setDocument(DocumentHelper.createDocument(getNamespaceURI(), getQualifiedName(localName),
+ null));
+ }
+
+ /**
+ * Sets the document of this NamespaceHelper.
+ * @param _document the document
+ */
+ protected void setDocument(Document _document) {
+ this.document = _document;
+ }
+
+ /**
+ * Returns the document that is used to create elements.
+ * @return A document object.
+ */
+ public Document getDocument() {
+ return this.document;
+ }
+
+ /**
+ * Returns the namespace URI of this NamespaceHelper.
+ * @return The namespace URI.
+ */
+ public String getNamespaceURI() {
+ return this.namespaceUri;
+ }
+
+ /**
+ * Returns the namespace prefix that is used to create elements.
+ * @return The namespace prefix.
+ */
+ public String getPrefix() {
+ return this.prefix;
+ }
+
+ /**
+ * Returns the qualified name for a local name using the prefix of this
+ * NamespaceHelper.
+ * @param localName The local name.
+ * @return The qualified name, i.e. prefix:localName.
+ */
+ public String getQualifiedName(String localName) {
+ if (getPrefix().equals("")) {
+ return localName;
+ }
+ return getPrefix() + ":" + localName;
+ }
+
+ /**
+ * <p>
+ * Creates an element within the namespace of this NamespaceHelper object with
+ * a given local name containing a text node.<br/>
+ * </p>
+ * <p>
+ * <code>createElement("text")</code>: <code><prefix:text/><code>.
+ * </p>
+ * @param localName The local name of the element.
+ * @return A new element.
+ */
+ public Element createElement(String localName) {
+ return getDocument().createElementNS(getNamespaceURI(), getQualifiedName(localName));
+ }
+
+ /**
+ * <p>
+ * Creates an element within the namespace of this NamespaceHelper object with
+ * a given local name containing a text node.
+ * </p>
+ * <p>
+ * <code>createElement("text", "Hello World!")</code>:
+ * <code><prefix:text>Hello World!</prefix:text></code>.
+ * </p>
+ * @param localName The local name of the element.
+ * @param text The text for the text node inside the element.
+ * @return A new element containing a text node.
+ */
+ public Element createElement(String localName, String text) {
+ Element element = createElement(localName);
+ Text textNode = getDocument().createTextNode(text);
+ element.appendChild(textNode);
+
+ return element;
+ }
+
+ /**
+ * Returns all children of an element in the namespace
+ * of this NamespaceHelper.
+ * @param element The parent element.
+ * @return the children.
+ */
+ public Element[] getChildren(Element element) {
+ return DocumentHelper.getChildren(element, getNamespaceURI());
+ }
+
+ /**
+ * Returns all children of an element with a local name in the namespace
+ * of this NamespaceHelper.
+ * @param element The parent element.
+ * @param localName The local name of the children to return.
+ * @return the children.
+ */
+ public Element[] getChildren(Element element, String localName) {
+ return DocumentHelper.getChildren(element, getNamespaceURI(), localName);
+ }
+
+ /**
+ * Returns the first childr of an element with a local name in the namespace
+ * of this NamespaceHelper or <code>null</code> if none exists.
+ * @param element The parent element.
+ * @param localName The local name of the children to return.
+ * @return the first child.
+ */
+ public Element getFirstChild(Element element, String localName) {
+ return DocumentHelper.getFirstChild(element, getNamespaceURI(), localName);
+ }
+
+ /**
+ * Returns the next siblings of an element with a local name in the namespace
+ * of this NamespaceHelper or <code>null</code> if none exists.
+ * @param element The parent element.
+ * @param localName The local name of the children to return.
+ * @return the next siblings.
+ */
+ public Element[] getNextSiblings(Element element, String localName) {
+ return DocumentHelper.getNextSiblings(element, getNamespaceURI(), localName);
+ }
+
+ /**
+ * Returns the preceding siblings of an element with a local name in the namespace
+ * of this NamespaceHelper or <code>null</code> if none exists.
+ * @param element The parent element.
+ * @param localName The local name of the children to return.
+ * @return the preceding siblings.
+ */
+ public Element[] getPrecedingSiblings(Element element, String localName) {
+ return DocumentHelper.getPrecedingSiblings(element, getNamespaceURI(), localName);
+ }
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
new file mode 100644
index 0000000..9b1b037
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
@@ -0,0 +1,1030 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.dispatcher.transformation;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.caching.CacheableProcessingComponent;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.transformation.AbstractSAXTransformer;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
+import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.cocoon.xml.dom.DOMUtil;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceException;
+import org.apache.excalibur.source.SourceValidity;
+import org.apache.excalibur.xml.xpath.XPathProcessor;
+import org.apache.forrest.dispatcher.ContractBean;
+import org.apache.forrest.dispatcher.ContractBeanDOMImpl;
+import org.apache.forrest.dispatcher.DispatcherException;
+import org.apache.forrest.dispatcher.DispatcherHelper;
+import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+public class DispatcherTransformer extends AbstractSAXTransformer implements
+ Disposable, CacheableProcessingComponent, URIResolver {
+
+ /* Node and attribute names */
+ /**
+ * <code>forrest:view</code> element is used to structure contracts and
+ * hooks into format specific container. It allows to configure x different
+ * format for the request.
+ *
+ * <pre>
+ * <<strong>forrest:view</strong> format="html"/>
+ * </pre>
+ */
+ public static final String STRUCTURER_ELEMENT = "view";
+
+ /**
+ * <code>forrest:view</code> element is used to structure contracts and
+ * hooks into format specific container. It allows to configure x different
+ * format for the request. The attribute which identify a view format is
+ * <strong>format</strong>.
+ *
+ * <pre>
+ * <forrest:view <strong>format</strong>="html"/>
+ * </pre>
+ */
+ public static final String STRUCTURER_FORMAT_ATTRIBUTE = "type";
+
+ public static final String STRUCTURER_HOOK_XPATH_ATTRIBUTE = "hooksXpath";
+
+ protected String requestedFormat;
+
+ private boolean includeNodes = true;
+
+ /**
+ * <code>forrest:hook</code> element is used to structure the elements. It
+ * allows to create skeletons that a designer needs to apply a specific
+ * layout via e.g. css. In html for example
+ *
+ * <pre>
+ * <forrest:hook name="test"/>
+ * </pre>
+ *
+ * <p>
+ * will be transformed to
+ * </p>
+ *
+ * <pre>
+ * <div id="test"/>
+ * </pre>
+ */
+ public static final String DISPATCHER_HOOK_ELEMENT = "hook";
+
+ /**
+ * <code>forrest:css</code> element is used to apply a specific layout via
+ * css. In html for example
+ *
+ * <pre>
+ * <forrest:css url="pelt.basic.css" media="screen" theme="Pelt"/>
+ * </pre>
+ *
+ * <p>
+ * will be transformed to
+ * </p>
+ *
+ * <pre>
+ * <link media="screen" href="../themes/pelt.basic.css" title="Pelt" rel="stylesheet" type="text/css" />
+ * </pre>
+ */
+ public static final String DISPATCHER_CSS_ELEMENT = "css";
+
+ private String propertyID;
+
+ private boolean insideProperties = false;
+
+ /**
+ * Convenience object, so we don't need to create an AttributesImpl for
+ * every element.
+ */
+ protected AttributesImpl attributes;
+
+ protected String currentFormat;
+
+ protected ContractBean contract;
+
+ /**
+ * The namespace used by the transformer for the SAX events filtering. This
+ * either equals to the {@link #defaultNamespaceURI} or to the value set by
+ * the <code>namespaceURI</code> sitemap parameter for the pipeline. Must
+ * never be null.
+ */
+ protected String namespaceURI;
+
+ /**
+ * This is the default namespace used by the transformer. Implementations
+ * should set its value in the constructor. Must never be null.
+ */
+ protected String defaultNamespaceURI;
+
+ private DOMBuilder builder, dispatcherBuilder;
+
+ private Transformer structurerTransformer;
+
+ private Element rootNode;
+
+ private XPathProcessor processor;
+
+ private Document document;
+
+ private NamespaceHelper dispatcher;
+
+ private Map storedPrefixMap;
+
+ private String path = null;
+
+ private boolean recording, allowMarkup;
+
+ public static final String DISPATCHER_ALLOW_MARKUP = "allowMarkup";
+
+ private DispatcherHelper dispatcherHelper;
+
+ private boolean insideStructurer = false;
+
+ private String hooksXSL;
+
+ private HashMap parameterHelper;
+
+ private SourceResolver m_resolver;
+
+ public static final String HOOKS_TRANSFORMER_PARAMETER = "hooksTransformer";
+
+ public static final String PATH_PARAMETER = "path";
+
+ /**
+ * Constructor Set the namespace
+ */
+ public DispatcherTransformer() {
+ this.defaultNamespaceURI = DispatcherHelper.DISPATCHER_NAMESPACE_URI;
+ }
+
+ // FIXME: turn on caching!!!
+ /**
+ * Generate the unique key. This key must be unique inside the space of this
+ * component.
+ *
+ * @return The generated key hashes the src
+ */
+ public Serializable getKey() {
+ return null;
+ }
+
+ // FIXME: turn on caching!!!
+ /**
+ * Generate the validity object.
+ *
+ * @return The generated validity object or <code>null</code> if the
+ * component is currently not cacheable.
+ */
+ public SourceValidity getValidity() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+ */
+ public void service(ServiceManager manager) throws ServiceException {
+ super.service(manager);
+ }
+
+ /**
+ * @see org.apache.avalon.framework.activity.Disposable#dispose()
+ */
+ public void dispose() {
+ if (null != this.manager) {
+ this.manager.release(m_resolver);
+ this.manager = null;
+ }
+ m_resolver = null;
+ insideProperties = false;
+ super.dispose();
+ }
+
+ /**
+ * Recycle the component
+ */
+ public void recycle() {
+ localRecycle();
+ super.recycle();
+
+ }
+
+ /**
+ * Setup the file generator. Try to get the last modification date of the
+ * source for caching.
+ */
+ public void setup(SourceResolver resolver, Map objectModel, String src,
+ Parameters par) throws ProcessingException, SAXException,
+ IOException {
+ super.setup(resolver, objectModel, src, par);
+ localRecycle();
+ try {
+ this.dispatcherHelper = new DispatcherHelper(manager);
+ this.processor = (XPathProcessor) this.manager
+ .lookup(XPathProcessor.ROLE);
+ m_resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
+ } catch (Exception e) {
+ String error = "dispatcherError:\n Could not set up the dispatcherHelper!\n DispatcherStack: "
+ + e;
+ getLogger().error(error);
+ throw new ProcessingException(error);
+ }
+ storedPrefixMap = new HashMap();
+ this.parameterHelper = new HashMap();
+
+ this.allowMarkup = Boolean.getBoolean(parameters.getParameter(
+ DISPATCHER_ALLOW_MARKUP, null));
+ this.requestedFormat = parameters.getParameter(
+ STRUCTURER_FORMAT_ATTRIBUTE, null);
+ if (requestedFormat == null) {
+ String error = "dispatcherError:\n"
+ + "You have to set the \"type\" parameter in the sitemap!";
+ getLogger().error(error);
+ throw new ProcessingException(error);
+ }
+ parameterHelper.put(STRUCTURER_FORMAT_ATTRIBUTE, requestedFormat);
+ /*
+ * this.pathXSL = parameters.getParameter(PATH_PARAMETER,null); if
+ * (this.pathXSL==null){ String warning = "dispatcherError:\n" + "You
+ * did not set up the \"path\" parameter in the sitemap, we are not
+ * going to support default variables in contracts." + " Meaning that
+ * you are not able to use e.g. $skin-img-dir, if you do the contract
+ * bean implementation will throw an exception.";
+ * getLogger().warn(warning); }
+ * parameterHelper.put(PATH_PARAMETER,pathXSL);
+ */
+ this.hooksXSL = parameters.getParameter(HOOKS_TRANSFORMER_PARAMETER,
+ null);
+ try {
+ if (this.hooksXSL == null || this.hooksXSL.equals("")) {
+ String warning = "dispatcherError:\n"
+ + "You did not set up the \"hooksTransformer\" parameter in the sitemap, we are not going to transform forrest:hooks elements."
+ + " For text output where you would not have to use hooks as structurer, the way you want it.";
+ getLogger().warn(warning);
+ } else {
+ DOMSource stylesheet = new DOMSource(dispatcherHelper
+ .getDocument(this.hooksXSL));
+ this.structurerTransformer = dispatcherHelper
+ .createTransformer(stylesheet);
+ }
+ parameterHelper.put(HOOKS_TRANSFORMER_PARAMETER, hooksXSL);
+ } catch (Exception e) {
+ String error = "dispatcherError:\n"
+ + "Could not set up the \"hooks transformer\".\n\n DispatcherStack:\n "
+ + e;
+ getLogger().error(error);
+ throw new ProcessingException(error);
+ }
+ }
+
+ /**
+ * Cleanup the transformer
+ */
+ private void localRecycle() {
+ this.processor = null;
+ this.dispatcherHelper = null;
+ this.contract = null;
+ this.hooksXSL = null;
+ this.structurerTransformer = null;
+ this.insideProperties = false;
+ this.m_resolver = null;
+ }
+
+ public void startElement(String uri, String name, String raw,
+ Attributes attr) throws SAXException {
+ // Process start element event
+ // Are we inside of properties? If so we need to record the elements.
+ if (this.insideProperties & this.includeNodes) {
+ try {
+ this.builder.startElement(uri, name, raw, attr);
+ } catch (SAXException e) {
+ this.insideProperties = false;
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500 + "\n"
+ + "The contract \"" + contract.getContractName()
+ + "\" has thrown in the property with ID \""
+ + this.propertyID
+ + "\" an error.\n\n DispatcherStack:\n " + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ } else if (DispatcherHelper.DISPATCHER_NAMESPACE_URI.equals(uri)) {
+ /*
+ * We are in the dispatcher ns.
+ */
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Starting dispatcher element: " + raw);
+ }
+ if (STRUCTURER_ELEMENT.equals(name))
+ structurerProcessingStart(attr);
+ else if (DISPATCHER_HOOK_ELEMENT.equals(name) & this.includeNodes)
+ hookProcessingStart(name, raw, attr);
+ else if (ContractBean.CONTRACT_ELEMENT.equals(name)
+ & this.includeNodes)
+ contractProcessingStart(attr);
+ else if (ContractBean.PROPERTY_ELEMENT.equals(name)
+ & this.includeNodes) {
+ this.insideProperties = true;
+ propertyProcessingStart(uri, name, raw, attr);
+ }
+ } else {
+ if (!this.insideProperties & this.includeNodes
+ & this.insideStructurer & this.allowMarkup)
+ super.startElement(uri, name, raw, attr);
+ if (!this.insideProperties & this.includeNodes
+ & !this.insideStructurer)
+ super.startElement(uri, name, raw, attr);
+ }
+ }
+
+ /**
+ * @param name
+ * @param raw
+ * @param attr
+ * @throws DOMException
+ * @throws SAXException
+ */
+ private void hookProcessingStart(String name, String raw, Attributes attr)
+ throws DOMException, SAXException {
+ /* create a DOM node from the current sax event */
+ Element currentElement = dispatcher.getDocument().createElement(name);
+ dispatcherHelper.setAttributesDOM(attr, currentElement);
+ String tempPath = path + "/" + name;
+ tempPath = dispatcherHelper.setAttributesXPath(attr, tempPath);
+ if (path == null || path.equals("")) {
+ path = name;
+ this.rootNode.appendChild(currentElement);
+ } else {
+ /* calculate, prepare and add node to the dispatcher */
+ try {
+ Node xpathNode;
+ xpathNode = DOMUtil.getSingleNode(rootNode, path,
+ this.processor);
+ if (xpathNode == null)
+ createXpathNode(attr, tempPath);
+ else
+ xpathNode.appendChild(currentElement);
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500 + "\n"
+ + "Could not set up xpath!\n\n DispatcherStack:\n " + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ path = tempPath;
+ }
+ }
+
+ /**
+ * @param attr
+ * @param tempPath
+ * @throws ProcessingException
+ * @throws DOMException
+ */
+ private void createXpathNode(Attributes attr, String tempPath)
+ throws ProcessingException, DOMException {
+ Node xpathNode;
+ xpathNode = DOMUtil
+ .selectSingleNode(rootNode, tempPath, this.processor);
+ if (attr != null)
+ dispatcherHelper.setAttributesDOM(attr, xpathNode);
+ }
+
+ /**
+ * @param attr
+ * @param tempPath
+ * @throws ProcessingException
+ * @throws DOMException
+ */
+ private Node createXpathNode(String tempPath) throws ProcessingException,
+ DOMException {
+ Node xpathNode;
+ xpathNode = DOMUtil
+ .selectSingleNode(rootNode, tempPath, this.processor);
+ return xpathNode;
+ }
+
+ public void endElement(String uri, String name, String raw)
+ throws SAXException {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Ending element: " + raw);
+ }
+ // Are we inside of properties? If so we need to record the elements.
+ if (this.insideProperties) {
+ propertyProcessingEnd(uri, name, raw);
+ } else if (DispatcherHelper.DISPATCHER_NAMESPACE_URI.equals(uri)) {
+ if (STRUCTURER_ELEMENT.equals(name))
+ structurerProcessingEnd(raw);
+ else if (ContractBean.CONTRACT_ELEMENT.equals(name)
+ & this.includeNodes)
+ contractProcessingEnd();
+ else if (DISPATCHER_HOOK_ELEMENT.equals(name) & this.includeNodes)
+ if (path.lastIndexOf("/") > -1)
+ path = path.substring(0, path.lastIndexOf("/"));
+ else
+ path = null;
+ } else {
+ if (!this.insideProperties & this.includeNodes
+ & this.insideStructurer & this.allowMarkup)
+ super.endElement(uri, name, raw);
+ if (!this.insideProperties & this.includeNodes
+ & !this.insideStructurer)
+ super.endElement(uri, name, raw);
+ }
+ }
+
+ /**
+ * view type="?" Here we check which format we have in the view. That should
+ * be extended to matching the requested format
+ *
+ * @param attr
+ * @throws SAXException
+ */
+ private void structurerProcessingStart(Attributes attr) throws SAXException {
+ this.insideStructurer = true;
+ for (int i = 0; i < attr.getLength(); i++) {
+ String localName = attr.getLocalName(i);
+ String value = attr.getValue(i);
+ if (localName.equals(STRUCTURER_FORMAT_ATTRIBUTE)) {
+ currentFormat = value;
+ }
+ if (localName.equals(STRUCTURER_HOOK_XPATH_ATTRIBUTE)) {
+ if ("/".equals(String.valueOf(value.charAt(0)))
+ & value.length() != 1) {
+ path = "result" + value;
+ } else if ("/".equals(String.valueOf(value.charAt(0)))
+ & value.length() == 1) {
+ path = "result";
+ } else {
+ path = "result/" + value;
+ }
+ }
+ }
+ if (requestedFormat.equals(currentFormat)) {
+ if (path == null)
+ path = "result";
+ this.includeNodes = true;
+ this.recording = true;
+ try {
+ dispatcherHelper.setNamespaceHelper(
+ DispatcherHelper.DISPATCHER_NAMESPACE_URI,
+ DispatcherHelper.DISPATCHER_PREFIX, STRUCTURER_ELEMENT);
+ this.dispatcher = dispatcherHelper.getNamespaceHelper();
+ this.document = dispatcher.getDocument();
+ this.rootNode = document.getDocumentElement();
+ this.rootNode.setAttribute(STRUCTURER_FORMAT_ATTRIBUTE,
+ currentFormat);
+ this.rootNode.setAttribute(STRUCTURER_HOOK_XPATH_ATTRIBUTE,
+ path);
+ // we create the path node for the result node
+ DOMUtil.selectSingleNode(rootNode, path, this.processor);
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500
+ + "\n"
+ + "Could not setup dispatcherHelper!\n\n DispatcherStack:\n "
+ + e;
+ getLogger().error(error);
+ this.recording = false;
+ throw new SAXException(error);
+ }
+
+ } else {
+ path = null; // unset path because we do not process the node
+ this.includeNodes = false;
+ this.recording = false;
+ }
+ }
+
+ /**
+ * @param raw
+ * @throws SAXException
+ */
+ private void structurerProcessingEnd(String raw) throws SAXException {
+ if (this.recording) {
+ try {
+ NodeList resultList = this.rootNode.getFirstChild()
+ .getChildNodes();
+ for (int i = 0; i < resultList.getLength(); i++) {
+ Node array_element = resultList.item(i);
+ if (this.structurerTransformer == null) {
+ XMLUtils.valueOf(new IncludeXMLConsumer(
+ super.xmlConsumer), array_element);
+ } else {
+ DOMSource source = new DOMSource(array_element);
+ DOMResult result = new DOMResult();
+ this.structurerTransformer.transform(source, result);
+ XMLUtils.valueOf(new IncludeXMLConsumer(
+ super.xmlConsumer), result.getNode());
+ }
+ }
+
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500
+ + "\n"
+ + "Could not setup final transformer!\n\n DispatcherStack:\n "
+ + e;
+ getLogger().error(error);
+ this.recording = false;
+ throw new SAXException(error);
+ } finally {
+ this.recording = false;
+ this.insideStructurer = false;
+ }
+ }
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "Ending \"" + STRUCTURER_ELEMENT + "\" element: " + raw);
+ }
+ }
+
+ /**
+ * We have found a contract. Now we have to prepare a bean to later add it
+ * to the output stream in the endElement.
+ *
+ * @param attr
+ * @throws SAXException
+ */
+ private void contractProcessingStart(Attributes attr) throws SAXException {
+ try {
+ if (contract == null)
+ contract = new ContractBeanDOMImpl(this.manager,
+ parameterHelper,(URIResolver)this);
+ else
+ contract.initialize();
+ } catch (Exception e) {
+ String error = DispatcherException.ERROR_500 + "\n"
+ + "component: ContractBean" + "\n"
+ + "message: Could not setup contractBean." + "\n" + "\n\n"
+ + "dispatcherErrorStack:\n" + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ for (int i = 0; i < attr.getLength(); i++) {
+ String localName = attr.getLocalName(i);
+ String value = attr.getValue(i);
+ if (ContractBean.CONTRACT_ID_ATTRIBUTE.equals(localName)) {
+ // getting the contract name
+ contract.setContractName(value);
+ String contractUri = ContractBean.CONTRACT_RESOLVE_PREFIX + "."
+ + currentFormat + "." + value;
+ try {
+ Document doc = org.apache.forrest.dispatcher.util.SourceUtil
+ .readDOM(contractUri, this.manager);
+ contract.setContractImpl(doc, contractUri);
+ // contract.setContractImpl(contractUri);
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500
+ + "\n"
+ + "The contract \""
+ + contract.getContractName()
+ + "\" has thrown an exception by resolving the implementation from \""
+ + contractUri + "\".\n\n"
+ + "dispatcherErrorStack:\n" + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "DISPATCHER_CONTRACT_ID_ATTRIBUTE" + "-->"
+ + localName + "\n" + "value" + "-->"
+ + value);
+ }
+ } else if (ContractBean.CONTRACT_NUGGET_ATTRIBUTE.equals(localName)) {
+ // contract is a nugget-contract
+ contract.setNugget(true);
+ try {
+ Document doc = org.apache.forrest.dispatcher.util.SourceUtil
+ .readDOM(value, this.manager);
+ contract.setContractRawData(doc);
+ // contract.setNuggetUri(value);
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500
+ + "\n"
+ + "The contract \""
+ + contract.getContractName()
+ + "\" has thrown thrown an exception by resolving raw data from \""
+ + value + "\".\n\n" + "dispatcherErrorStack:\n "
+ + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "ContractBean.CONTRACT_NUGGET_ATTRIBUTE" + "-->"
+ + localName + "\n" + "value" + "-->"
+ + value);
+ }
+ } else {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "localName" + "-->" + localName
+ + " not implemented");
+ }
+ }
+ }
+ /*
+ * if we do not have a nugget add a foo element to the raw data to
+ * invoke the transformation.
+ */
+ if (!contract.isNugget()) {
+ Document foo;
+ try {
+ foo = dispatcherHelper.createDocument("foo");
+ contract.setContractRawData(foo);
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500
+ + "\n"
+ + "The contract \""
+ + contract.getContractName()
+ + "\" has thrown thrown an exception by creating the dummy foo document."
+ + ".\n\n" + "dispatcherErrorStack:\n " + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ }
+ }
+
+ /**
+ * @throws SAXException
+ */
+ private void contractProcessingEnd() throws SAXException {
+ try {
+ contract.setContractResultData();
+ Document node = (Document) contract.getContractResultData()
+ .getNode();
+ Document root = this.rootNode.getOwnerDocument();
+ /*
+ * debug code - uncomment it if you need it! will output the
+ * contract resulting data to sysout
+ */
+ // DOMSource source = new DOMSource(node);
+ // StreamResult result = new StreamResult(System.out);
+ // contract.getContractTransformer().transform(source, result);
+ /*
+ * append this node to the current path after testing where there is
+ * a fixed location for the contract content. If so then add it
+ * there.
+ */
+ NodeList contentChildren = node.getElementsByTagNameNS(
+ DispatcherHelper.DISPATCHER_NAMESPACE_URI, "part");
+ for (int i = 0; i < contentChildren.getLength(); i++) {
+ Element contentChild = (Element) contentChildren.item(i);
+ NodeList finalContent = contentChild.getChildNodes();
+ if (contentChild != null) {
+ String location = contentChild.getAttribute("xpath");
+ if (location.equals("") | location == null) {
+ Node xpathNode = DOMUtil.getSingleNode(rootNode, path,
+ this.processor);
+ if (xpathNode != null) {
+ // add everything *within* the forrest:part element
+ appendChildToResultIterator(root, finalContent,
+ xpathNode);
+ }
+ } else {
+ if (location.charAt(0) == '/')
+ location = "result" + location;
+ else
+ location = "result/" + location;
+ Node xpathNode = DOMUtil.getSingleNode(rootNode,
+ location, this.processor);
+ if (xpathNode != null) {
+ // add everything *within* the forrest:part element
+ appendChildToResultIterator(root, finalContent,
+ xpathNode);
+ } else {
+ xpathNode = createXpathNode(location);
+ // add everything *within* the forrest:part element
+ appendChildToResultIterator(root, finalContent,
+ xpathNode);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ String error = "dispatcherError: "
+ + DispatcherException.ERROR_500
+ + "\n"
+ + "The contract \""
+ + contract.getContractName()
+ + "\" has thrown thrown an exception while trying to transform the final markup. \n\n"
+ + "dispatcherErrorStack:\n " + e;
+ getLogger().error(error);
+ throw new SAXException(error);
+ } finally {
+ this.contract.recycle();
+ }
+ }
+
+ /**
+ * @param root
+ * @param finalContent
+ * @param xpathNode
+ * @throws DOMException
+ */
+ private void appendChildToResultIterator(Document root,
+ NodeList finalContent, Node xpathNode) throws DOMException {
+ for (int j = 0; j < finalContent.getLength(); j++) {
+ appendChildToResult(root, finalContent, xpathNode, j);
+ }
+ }
+
+ /**
+ * @param root
+ * @param finalContent
+ * @param xpathNode
+ * @param j
+ * @throws DOMException
+ */
+ private void appendChildToResult(Document root, NodeList finalContent,
+ Node xpathNode, int j) throws DOMException {
+ Node contractData = finalContent.item(j);
+ Node toMove = root.importNode(contractData, true);
+ xpathNode.appendChild(toMove);
+ }
+
+ /**
+ * @param uri
+ * @param name
+ * @param raw
+ * @param attr
+ * @throws SAXException
+ */
+ private void propertyProcessingStart(String uri, String name, String raw,
+ Attributes attr) throws SAXException {
+ for (int i = 0; i < attr.getLength(); i++) {
+ String localName = attr.getLocalName(i);
+ String value = attr.getValue(i);
+ if (ContractBean.PROPERTY_ID_ATTRIBUTE.equals(localName))
+ this.propertyID = value;
+ }
+ if (this.propertyID.equals("") | this.propertyID == null) {
+ String error = "dispatcherError: " + DispatcherException.ERROR_500
+ + "\n" + "The contract \"" + contract.getContractName()
+ + "\" has no identifier attribute \""
+ + ContractBean.PROPERTY_ID_ATTRIBUTE + "\" in the " + raw;
+ getLogger().error(error);
+ throw new SAXException(error);
+ }
+ this.builder = new DOMBuilder();
+ this.builder.startDocument();
+ launchStoredMappings();
+ this.builder.startElement(uri, name, raw, attr);
+ }
+
+ /**
+ * @param uri
+ * @param name
+ * @param raw
+ * @throws SAXException
+ */
+ private void propertyProcessingEnd(String uri, String name, String raw)
+ throws SAXException {
+ if (ContractBean.PROPERTY_ELEMENT.equals(name)) {
+ this.insideProperties = false;
+ if (this.includeNodes) {
+ this.builder.endElement(uri, name, raw);
+ this.builder.endDocument();
+ if (getLogger().isDebugEnabled()) {
+ getLogger()
+ .debug(
+ "DispatcherTransformer: putting DOM tree into the contract transformer");
+ }
+ Transformer transformer = contract.getContractTransformer();
+ transformer.setParameter(this.propertyID, this.builder
+ .getDocument().getFirstChild());
+ contract.setContractTransformer(transformer);
+ this.propertyID = "";
+ contract.setHasProperties(true);
+ if (getLogger().isDebugEnabled()) {
+ getLogger()
+ .debug(
+ "DispatcherTransformer: DOM tree is in the contract transformer");
+ }
+ this.builder = null;
+ }
+ } else {
+ if (this.includeNodes)
+ this.builder.endElement(uri, name, raw);
+ }
+ }
+
+ public void characters(char c[], int start, int len) throws SAXException {
+ if (this.insideProperties & this.includeNodes)
+ this.builder.characters(c, start, len);
+ else if (!this.insideProperties & this.includeNodes
+ & !this.insideStructurer)
+ super.contentHandler.characters(c, start, len);
+ }
+
+ public void startCDATA() throws SAXException {
+ if (this.insideProperties & this.includeNodes)
+ this.builder.startCDATA();
+ else if (!this.insideProperties & this.includeNodes
+ & !this.insideStructurer)
+ super.lexicalHandler.startCDATA();
+ }
+
+ public void endCDATA() throws SAXException {
+ if (this.insideProperties & this.includeNodes)
+ this.builder.endCDATA();
+ else if (!this.insideProperties & this.includeNodes
+ & !this.insideStructurer)
+ super.lexicalHandler.endCDATA();
+ }
+
+ /** BEGIN SAX ContentHandler handlers * */
+
+ public void startPrefixMapping(String prefix, String uri)
+ throws SAXException {
+ super.startPrefixMapping(prefix, uri);
+ if (this.insideProperties & this.includeNodes) {
+ this.builder.startPrefixMapping(prefix, uri);
+ } else {
+ storePrefixMapping(prefix, uri);
+ }
+ }
+
+ /** END SAX ContentHandler handlers * */
+
+ protected void storePrefixMapping(String prefix, String uri) {
+ storedPrefixMap.put(prefix, uri);
+ }
+
+ protected void launchStoredMappings() throws SAXException {
+ Iterator it = storedPrefixMap.keySet().iterator();
+ while (it.hasNext()) {
+ String pre = (String) it.next();
+ String uri = (String) storedPrefixMap.get(pre);
+ getLogger().debug(
+ "WriteSessionTransformer: launching prefix mapping[ pre: "
+ + pre + " uri: " + uri + " ]");
+ this.builder.startPrefixMapping(pre, uri);
+ }
+ }
+
+ protected void launchStoredMappingsDispatcher() throws SAXException {
+ Iterator it = storedPrefixMap.keySet().iterator();
+ while (it.hasNext()) {
+ String pre = (String) it.next();
+ String uri = (String) storedPrefixMap.get(pre);
+ getLogger().debug(
+ "WriteSessionTransformer: launching prefix mapping[ pre: "
+ + pre + " uri: " + uri + " ]");
+ this.dispatcherBuilder.startPrefixMapping(pre, uri);
+ }
+ }
+
+ public javax.xml.transform.Source resolve(String href, String base)
+ throws TransformerException {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "resolve(href = " + href + ", base = " + base
+ + "); resolver = " + m_resolver);
+ }
+
+ Source xslSource = null;
+ try {
+ if (base == null || href.indexOf(":") > 1) {
+ // Null base - href must be an absolute URL
+ xslSource = m_resolver.resolveURI(href);
+ } else if (href.length() == 0) {
+ // Empty href resolves to base
+ xslSource = m_resolver.resolveURI(base);
+ } else {
+ // is the base a file or a real m_url
+ if (!base.startsWith("file:")) {
+ int lastPathElementPos = base.lastIndexOf('/');
+ if (lastPathElementPos == -1) {
+ // this should never occur as the base should
+ // always be protocol:/....
+ return null; // we can't resolve this
+ } else {
+ xslSource = m_resolver.resolveURI(base.substring(0,
+ lastPathElementPos)
+ + "/" + href);
+ }
+ } else {
+ File parent = new File(base.substring(5));
+ File parent2 = new File(parent.getParentFile(), href);
+ xslSource = m_resolver.resolveURI(parent2.toURL()
+ .toExternalForm());
+ }
+ }
+
+ InputSource is = getInputSource(xslSource);
+
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "xslSource = " + xslSource + ", system id = "
+ + xslSource.getURI());
+ }
+
+// if (m_checkIncludes) {
+// // Populate included validities
+// List includes = (List) m_includesMap.get(base);
+// if (includes != null) {
+// SourceValidity included = xslSource.getValidity();
+// if (included != null) {
+// includes.add(new Object[] { xslSource.getURI(),
+// xslSource.getValidity() });
+// } else {
+// // One of the included stylesheets is not cacheable
+// m_includesMap.remove(base);
+// }
+// }
+// }
+
+ return new StreamSource(is.getByteStream(), is.getSystemId());
+ } catch (SourceException e) {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "Failed to resolve " + href + "(base = " + base
+ + "), return null", e);
+ }
+
+ // CZ: To obtain the same behaviour as when the resource is
+ // transformed by the XSLT Transformer we should return null here.
+ return null;
+ } catch (java.net.MalformedURLException mue) {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "Failed to resolve " + href + "(base = " + base
+ + "), return null", mue);
+ }
+
+ return null;
+ } catch (IOException ioe) {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug(
+ "Failed to resolve " + href + "(base = " + base
+ + "), return null", ioe);
+ }
+
+ return null;
+ } finally {
+ m_resolver.release(xslSource);
+ }
+ }
+
+ /**
+ * Return a new <code>InputSource</code> object that uses the
+ * <code>InputStream</code> and the system ID of the <code>Source</code>
+ * object.
+ *
+ * @throws IOException
+ * if I/O error occured.
+ */
+ private static InputSource getInputSource(final Source source) throws IOException, SourceException {
+ final InputSource newObject = new InputSource(source.getInputStream());
+ newObject.setSystemId(source.getURI());
+ return newObject;
+ }
+
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java
new file mode 100644
index 0000000..00763f1
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/util/SourceUtil.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.dispatcher.util;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceNotFoundException;
+import org.apache.forrest.dispatcher.lenya.xml.DocumentHelper;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+public class SourceUtil {
+ /**
+ * Reads a DOM from a source.
+ * @param sourceUri The source URI.
+ * @param manager The service manager.
+ * @return A document or <code>null</code> if the source does not exist.
+ * @throws ServiceException if an error occurs.
+ * @throws SourceNotFoundException if an error occurs.
+ * @throws ParserConfigurationException if an error occurs.
+ * @throws SAXException if an error occurs.
+ * @throws IOException if an error occurs.
+ */
+ public static Document readDOM(String sourceUri, ServiceManager manager)
+ throws ServiceException, SourceNotFoundException, ParserConfigurationException,
+ SAXException, IOException {
+ SourceResolver resolver = null;
+ Source source = null;
+ Document document = null;
+ try {
+
+ resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
+ source = resolver.resolveURI(sourceUri);
+
+ if (source.exists()) {
+ document = DocumentHelper.readDocument(source.getInputStream());
+ }
+ } finally {
+ if (resolver != null) {
+ if (source != null) {
+ resolver.release(source);
+ }
+ manager.release(resolver);
+ }
+ }
+ return document;
+ }
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/plugin/internal/view/acting/FallbackResolverAction.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/plugin/internal/view/acting/FallbackResolverAction.java
new file mode 100644
index 0000000..f0b72b0
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/plugin/internal/view/acting/FallbackResolverAction.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.plugin.internal.view.acting;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.acting.ServiceableAction;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceNotFoundException;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This action simply checks to see if a resource identified by the <code>src</code>
+ * sitemap attribute exists or not. The action returns empty <code>Map</code> if
+ * resource exists, <code>null</code> otherwise.
+ *
+ * <p>Instead of src attribute, source can be specified using
+ * parameter named <code>url</code> (this is old syntax, should be removed soon).
+ *
+ * <p><b>NOTE:</b> {@link org.apache.cocoon.selection.ResourceExistsSelector}
+ * should be preferred to this component, as the semantics of a Selector better
+ * matches the supplied functionality.
+ *
+ * @author <a href="mailto:balld@apache.org">Donald Ball</a>
+ * @version CVS $Id$
+ */
+
+public class FallbackResolverAction extends ServiceableAction implements
+ ThreadSafe {
+ private FallbackResolverHelper fallbackHelper = new FallbackResolverHelper();
+
+ public Map act(Redirector redirector, SourceResolver resolver,
+ Map objectModel, String src, Parameters parameters)
+ throws Exception {
+ this.prepare(parameters, src);
+ String uri = fallbackHelper.getProjectDir() + fallbackHelper.getRequest()
+ + fallbackHelper.getProjectExtension();
+ computeResponseURI(resolver, uri);
+ if (fallbackHelper.getResponseURI()==null){
+ uri = fallbackHelper.getDefaultDir()+"/"
+ +fallbackHelper.getProjectFallback()
+ +fallbackHelper.getDefaultExtension();
+ if (this.resourceExist(resolver, uri)) {
+ fallbackHelper.setResponseURI(uri);
+ }else{
+ fallbackHelper.setResponseURI(fallbackHelper.getDefaultDir()+"/"
+ +fallbackHelper.getDefaultFallback()
+ +fallbackHelper.getDefaultExtension());
+ }
+ }
+ HashMap map = new HashMap();
+ map.put("uri", fallbackHelper.getResponseURI());
+ return map;
+ }
+
+/**
+ * prepare(Parameters parameters, String src)
+ *
+ * <map:parameter value="{1}" name="request"/><br/>
+ * <map:parameter value="{project:theme}" name="projectFallback"/><br/>
+ * <map:parameter value="{project:theme-ext}" name="projectExtension"/><br/>
+ * <map:parameter value="{project:content.xdocs}" name="projectDir"/><br/>
+ * <map:parameter value="{defaults:view-themes}" name="defaultDir"/><br/>
+ * <map:parameter value="{defaults:theme}" name="defaultFallback"/><br/>
+ * <map:parameter value="{defaults:theme-ext}" name="defaultExtension"/>
+ *
+ */
+ public void prepare(Parameters parameters, String src) {
+ fallbackHelper.setRequest(parameters.getParameter("request", src));
+ fallbackHelper.setProjectFallback(parameters.getParameter(
+ "projectFallback", src));
+ fallbackHelper.setProjectExtension(parameters.getParameter(
+ "projectExtension", src));
+ fallbackHelper
+ .setProjectDir(parameters.getParameter("projectDir", src));
+ fallbackHelper.setDefaultFallback(parameters.getParameter(
+ "defaultFallback", src));
+ fallbackHelper.setDefaultExtension(parameters.getParameter(
+ "defaultExtension", src));
+ fallbackHelper.setDefaultDir(parameters.getParameter(
+ "defaultDir", src));
+ fallbackHelper.setRest(fallbackHelper.getRequest());
+ fallbackHelper.setResponseURI(null);
+ }
+
+ public void computeResponseURI(SourceResolver resolver, String uri) {
+ if (this.resourceExist(resolver, uri)) {
+ fallbackHelper.setResponseURI(uri);
+ } else {
+ if (fallbackHelper.getRest().lastIndexOf("/") > -1) {
+ fallbackHelper.setRest(fallbackHelper.getRest().substring(0,
+ fallbackHelper.getRest().lastIndexOf("/")));
+ uri = fallbackHelper.getProjectDir() + fallbackHelper.getRest()
+ + "/" + fallbackHelper.getProjectFallback()
+ + fallbackHelper.getProjectExtension();
+ this.computeResponseURI(resolver,uri);
+ }else{
+ uri = fallbackHelper.getProjectDir()
+ +fallbackHelper.getProjectFallback()
+ +fallbackHelper.getProjectExtension();
+ if (this.resourceExist(resolver, uri)) {
+ fallbackHelper.setResponseURI(uri);
+ }
+ }
+ }
+ }
+
+ public boolean resourceExist(SourceResolver resolver, String uri) {
+ Source source = null;
+ try {
+ source = resolver.resolveURI(uri);
+ if (source.exists()) {
+ return true;
+ }
+ } catch (SourceNotFoundException e) {
+ // Do not log
+ } catch (Exception e) {
+ getLogger().warn("Exception resolving resource " + uri, e);
+ } finally {
+ if (source != null) {
+ resolver.release(source);
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/plugin/internal/view/acting/FallbackResolverHelper.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/plugin/internal/view/acting/FallbackResolverHelper.java
new file mode 100644
index 0000000..0a6bf29
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/plugin/internal/view/acting/FallbackResolverHelper.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.plugin.internal.view.acting;
+
+public class FallbackResolverHelper {
+ private String request, projectFallback, projectExtension, projectDir,
+ defaultFallback, defaultExtension, defaultDir, rest,responseURI;
+ /**
+ * @return Returns the defaultExtension.
+ */
+ public String getDefaultExtension() {
+ return defaultExtension;
+ }
+ /**
+ * @param defaultExtension The defaultExtension to set.
+ */
+ public void setDefaultExtension(String defaultExtension) {
+ this.defaultExtension = defaultExtension;
+ }
+ /**
+ * @return Returns the defaultFallback.
+ */
+ public String getDefaultFallback() {
+ return defaultFallback;
+ }
+ /**
+ * @param defaultFallback The defaultFallback to set.
+ */
+ public void setDefaultFallback(String defaultFallback) {
+ this.defaultFallback = defaultFallback;
+ }
+ /**
+ * @return Returns the request.
+ */
+ public String getRequest() {
+ return request;
+ }
+ /**
+ * @param request The request to set.
+ */
+ public void setRequest(String path) {
+ this.request = path;
+ }
+ /**
+ * @return Returns the projectDir.
+ */
+ public String getProjectDir() {
+ return projectDir;
+ }
+ /**
+ * @param projectDir The projectDir to set.
+ */
+ public void setProjectDir(String projectDir) {
+ this.projectDir = projectDir;
+ }
+ /**
+ * @return Returns the projectExtension.
+ */
+ public String getProjectExtension() {
+ return projectExtension;
+ }
+ /**
+ * @param projectExtension The projectExtension to set.
+ */
+ public void setProjectExtension(String projectExtension) {
+ this.projectExtension = projectExtension;
+ }
+ /**
+ * @return Returns the projectFallback.
+ */
+ public String getProjectFallback() {
+ return projectFallback;
+ }
+ /**
+ * @param projectFallback The projectFallback to set.
+ */
+ public void setProjectFallback(String projectFallback) {
+ this.projectFallback = projectFallback;
+ }
+ /**
+ * @return Returns the rest.
+ */
+ public String getRest() {
+ return rest;
+ }
+ /**
+ * @param rest The rest to set.
+ */
+ public void setRest(String rest) {
+ this.rest = rest;
+ }
+ /**
+ * @return Returns the responseURI.
+ */
+ public String getResponseURI() {
+ return responseURI;
+ }
+ /**
+ * @param responseURI The responseURI to set.
+ */
+ public void setResponseURI(String responseURI) {
+ this.responseURI = responseURI;
+ }
+ /**
+ * @return Returns the defaultDir.
+ */
+ public String getDefaultDir() {
+ return defaultDir;
+ }
+ /**
+ * @param defaultDir The defaultDir to set.
+ */
+ public void setDefaultDir(String defaultDir) {
+ this.defaultDir = defaultDir;
+ }
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/structurer/acting/RecursiveDirectoryTraversalAction.java b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/structurer/acting/RecursiveDirectoryTraversalAction.java
new file mode 100644
index 0000000..84b7682
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/structurer/acting/RecursiveDirectoryTraversalAction.java
@@ -0,0 +1,288 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.forrest.structurer.acting;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.acting.ServiceableAction;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceResolver;
+
+/**
+ * Selects the first of a set of Sources that exists in the context.
+ * <p>
+ * For example, we could define a SourceExistsSelector with:
+ *
+ * <pre>
+ *
+ * <map:selector name="exists"
+ * logger="sitemap.selector.source-exists"
+ * src="org.apache.cocoon.selection.SourceExistsSelector" />
+ *
+ * </pre>
+ *
+ * And use it to build a PDF from XSL:FO or a higher-level XML format with:
+ *
+ * <pre>
+ *
+ * <map:match pattern="**.pdf">
+ * <map:select type="exists">
+ * <map:when test="context/xdocs/{1}.fo">
+ * <map:generate src="content/xdocs/{1}.fo" />
+ * </map:when>
+ * <map:otherwise>
+ * <map:generate src="content/xdocs/{1}.xml" />
+ * <map:transform src="stylesheets/document2fo.xsl" />
+ * </map:otherwise>
+ * </map:select>
+ * <map:serialize type="fo2pdf" />
+ *
+ * </pre>
+ */
+public class RecursiveDirectoryTraversalAction extends ServiceableAction
+ implements ThreadSafe, Serviceable {
+
+ SourceResolver resolver = null;
+ HashMap map = new HashMap();
+
+ private String request, projectFallback, projectExtension, projectDir,
+ rest;
+
+ /**
+ * Set the current <code>ComponentManager</code> instance used by this
+ * <code>Composable</code>.
+ *
+ * @throws ServiceException
+ */
+
+ public void service(ServiceManager manager) throws ServiceException {
+ this.resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector,
+ * org.apache.cocoon.environment.SourceResolver, java.util.Map,
+ * java.lang.String, org.apache.avalon.framework.parameters.Parameters)
+ */
+ public Map act(Redirector redirector,
+ org.apache.cocoon.environment.SourceResolver resolver,
+ Map objectModel, String source, Parameters parameters)
+ throws Exception {
+ this.prepare(parameters, source);
+ String uri = this.getProjectDir() + this.getRequest()
+ + this.getProjectExtension();
+ Map returnMap = act(uri);
+ return returnMap;
+ }
+
+ /** Return a Map if Source 'uri' resolves and exists. */
+ public Map act(String uri) {
+ Source src = null;
+
+ // The locationmap module will return null if there is no match for
+ // the supplied hint, without the following the URI will be resolved to
+ // the context root, which always exists, but does not contain a valid
+ // resource.
+ if (uri == null || uri == "") {
+ return null;
+ }
+
+ try {
+ this.computeResponseURI(uri, src);
+ //src = resolver.resolveURI(uri);
+ if (this.map.containsKey("uri")) {
+ return this.map;
+ } else {
+ return null;
+ }
+ } catch (MalformedURLException e) {
+ getLogger().warn(
+ "Selector URL '" + uri + "' is not a valid Source URL");
+ return null;
+ } catch (IOException e) {
+ getLogger().warn(
+ "Error reading from source '" + uri + "': "
+ + e.getMessage());
+ return null;
+ } finally {
+ resolver.release(src);
+ }
+ }
+
+ /**
+ * @param resolver
+ * @param uri
+ * *viewSelector* project-xdocs will return which view is
+ * responsible for the requested path. If no view
+ * (choice|fallback) could be found the template will return the
+ * viewFallback (resources/views/default.fv).
+ *
+ * ex.: 1.request: index First choice: index.fv First/last fallback:
+ * default.fv
+ *
+ * 2.request: sample/index First choice: sample/index.fv First fallback:
+ * sample/default.fv Last fallback: default.fv
+ *
+ * 3.request: sample/subdir/index First choice: sample/subdir/index.fv First
+ * fallback: sample/subdir/default.fv Second fallback: sample/default.fv
+ * Last fallback: default.fv
+ *
+ * ...
+ *
+ * des.: The parent view (root-view) inherits to its children until a child
+ * is overriding this view. This override can be used for directories
+ * (default.fv) and/or files (*.fv). That means that the root view is the
+ * default view as long no other view can be found in the requested child.
+ * @throws IOException
+ * @throws MalformedURLException
+ *
+ */
+ private void computeResponseURI(String uri, Source src)
+ throws MalformedURLException, IOException {
+ src = resolver.resolveURI(uri);
+ if (src.exists()) {
+ this.map.put("uri", uri);
+ } else {
+ if (this.getRest().lastIndexOf("/") > -1) {
+ this.setRest(this.getRest().substring(0,
+ this.getRest().lastIndexOf("/")));
+ uri = this.getProjectDir() + this.getRest() + "/"
+ + this.getProjectFallback()
+ + this.getProjectExtension();
+ this.computeResponseURI(uri, src);
+ } else {
+ uri = this.getProjectDir() + this.getProjectFallback()
+ + this.getProjectExtension();
+ src = resolver.resolveURI(uri);
+ if (src.exists()) {
+ this.map.put("uri", uri);
+ }
+ }
+ }
+ }
+
+ public void prepare(Parameters parameters, String src) {
+ this.setRequest(parameters.getParameter("request", src));
+ this.setProjectFallback(parameters.getParameter("projectFallback",
+ src));
+ this.setProjectExtension(parameters.getParameter("projectExtension",
+ src));
+ this.setProjectDir(parameters.getParameter("projectDir", src));
+ this.setRest(this.getRequest());
+ }
+
+ /**
+ * @return Returns the projectDir.
+ */
+ public String getProjectDir() {
+ return projectDir;
+ }
+
+ /**
+ * @param projectDir
+ * The projectDir to set.
+ */
+ public void setProjectDir(String projectDir) {
+ this.projectDir = projectDir;
+ }
+
+ /**
+ * @return Returns the projectExtension.
+ */
+ public String getProjectExtension() {
+ return projectExtension;
+ }
+
+ /**
+ * @param projectExtension
+ * The projectExtension to set.
+ */
+ public void setProjectExtension(String projectExtension) {
+ this.projectExtension = projectExtension;
+ }
+
+ /**
+ * @return Returns the projectFallback.
+ */
+ public String getProjectFallback() {
+ return projectFallback;
+ }
+
+ /**
+ * @param projectFallback
+ * The projectFallback to set.
+ */
+ public void setProjectFallback(String projectFallback) {
+ this.projectFallback = projectFallback;
+ }
+
+ /**
+ * @return Returns the request.
+ */
+ public String getRequest() {
+ return request;
+ }
+
+ /**
+ * @param request
+ * The request to set.
+ */
+ public void setRequest(String request) {
+ this.request = request;
+ }
+
+ /**
+ * @return Returns the resolver.
+ */
+ public SourceResolver getResolver() {
+ return resolver;
+ }
+
+ /**
+ * @param resolver
+ * The resolver to set.
+ */
+ public void setResolver(SourceResolver resolver) {
+ this.resolver = resolver;
+ }
+
+ /**
+ * @return Returns the rest.
+ */
+ public String getRest() {
+ return rest;
+ }
+
+ /**
+ * @param rest
+ * The rest to set.
+ */
+ public void setRest(String rest) {
+ this.rest = rest;
+ }
+}
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/status.xml b/plugins/org.apache.forrest.plugin.internal.dispatcher/status.xml
new file mode 100644
index 0000000..c7eadb2
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/status.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<status>
+
+ <developers>
+ <person name="Ross Gardler" email="rgardler@apache.org" id="RDG" />
+ <person name="Volunteer needed" email="dev@forrest.apache.org" id="open"/>
+ </developers>
+
+ <!-- Define here the Title of the Context you want to display in the Changes pages.
+ id = the context value of actions
+ title = Title of the Context
+ -->
+ <contexts>
+ <context id="code" title="Changes to the Code Base"/>
+ <context id="docs" title="Changes to Documentation"/>
+ <context id="admin" title="Changes to Project Administration"/>
+ <context id="design" title="Changes to Design"/>
+ <context id="build" title="Changes to Build"/>
+ </contexts>
+
+ <changes>
+ <!-- Add new releases here -->
+ <release version="0.1" date="unreleased">
+ <action dev="TS" type="add" context="admin">
+ Initial plugin code extracted from the old views plugin.
+ </action>
+ <action dev="TS" type="add" context="docs">
+ Added infos of the pattern the plugin is using.
+ </action>
+ <action dev="TS" type="add" context="docs">
+ Updated the "how it works" section and moved it to its own site.
+ </action>
+ </release>
+ </changes>
+
+ <todo>
+ <actions priority="high">
+ <action context="docs" dev="open">
+ create some more example, that it is easier to adapt the concept.
+ </action>
+ <action context="core" dev="open">
+ Rewrite matches to allow other output implementation then html.
+ </action>
+ <action context="core" dev="open">
+ Extract businessHelper to their on implementation plugin.
+ </action>
+
+ </actions>
+ </todo>
+
+</status>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/tabs.xmap b/plugins/org.apache.forrest.plugin.internal.dispatcher/tabs.xmap
new file mode 100644
index 0000000..5b05341
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/tabs.xmap
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:generators default="file"/>
+ <map:serializers default="html"/>
+ <map:matchers default="wildcard"/>
+ <map:selectors>
+ <map:selector logger="sitemap.selector.config" name="config"
+ src="org.apache.cocoon.selection.SimpleSelector" />
+ </map:selectors>
+ <map:transformers default="xslt">
+ <map:transformer name="i18n"
+ src="org.apache.cocoon.transformation.I18nTransformer">
+ <catalogues default="tabs">
+ <catalogue id="tabs" name="tabs" location="{project:translations}"/>
+ </catalogues>
+ <!-- <untranslated-text>untranslated</untranslated-text-->
+ <cache-at-startup>true</cache-at-startup>
+ </map:transformer>
+ </map:transformers>
+ <map:actions>
+ <map:action name="locale" src="org.apache.cocoon.acting.LocaleAction" />
+ </map:actions>
+ </map:components>
+ <map:pipelines>
+ <map:pipeline >
+ <map:match pattern="**tab-*.html">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}tabs.xml">
+ <map:generate src="{project:content.xdocs}tabs.xml"/>
+ </map:when>
+ <map:when test="{lm:tabs.xml}">
+ <map:generate src="{lm:tabs.xml}"/>
+ </map:when>
+ <map:otherwise>
+ <map:generate src="{project:content.xdocs}tabs.xml"/>
+ </map:otherwise>
+ </map:select>
+ <map:transform type="xinclude"/>
+ <map:select type="config">
+ <map:parameter name="value" value="{defaults:i18n}"/>
+ <map:when test="true">
+ <map:act type="locale">
+ <map:transform src="{forrest:stylesheets}/i18n.xsl"/>
+ <map:transform type="i18n">
+ <map:parameter name="locale" value="{request:locale}"/>
+ </map:transform>
+ </map:act>
+ </map:when>
+ </map:select>
+ <map:transform type="linkrewriter" src="cocoon://{1}linkmap-{2}.html"/>
+ <map:transform src="{lm:dataModel-html-tab-to-menu.xsl}">
+ <!--<map:transform src="{lm:dataModel-html-tab2menu.xsl}">-->
+ <map:parameter name="path" value="{1}{2}.html"/>
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.plugin.internal.dispatcher/themer.xmap b/plugins/org.apache.forrest.plugin.internal.dispatcher/themer.xmap
new file mode 100644
index 0000000..4f5e248
--- /dev/null
+++ b/plugins/org.apache.forrest.plugin.internal.dispatcher/themer.xmap
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!-- forrest:structurer
+ ***********************
+ The structuring of the assembled page where all content is in place
+ and structured with forrest:hooks to provide hooks for theming.
+
+ It is the job of a forrest:structurer to define this structure. The
+ structurer uses for this a couple of helper classes forrest:contracts,
+ forrest:hooks and forrest:properties. But there is more to a
+ forrest:structurer than just structure.
+
+ The structurer is not limited to a document but can request and
+ structure the content from multiple input sources. Far more actually
+ because it provides as well logical conditions for presentation formatting logic
+-->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:pipes default="caching" />
+ <map:generators default="file" />
+ <map:transformers default="xslt" />
+ <map:serializers default="xml" />
+ </map:components>
+ <map:pipelines>
+ <map:pipeline>
+ <map:match pattern="resolve.contract.*.**">
+ <map:generate src="{lm:resolve.contract.{1}.{2}}" />
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <!-- prepare the xsl:templates of the requested contract.
+ {1} format to deliver
+ {2} contract name -->
+ <map:pipeline>
+ <map:match pattern="prepare.contract.*.**">
+ <map:generate src="{lm:resolve.contract.{1}.{2}}" />
+ <map:transform src="{lm:contract-strip-xsl.xsl}">
+ <map:parameter name="format" value="{1}" />
+ </map:transform>
+ <map:transform type="i18n">
+ <map:parameter name="locale" value="{request:locale}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <!--
+ Get the forrest:properties of the requested contract.
+ This will determine which templates (head, body) we have to call later on
+ {1} format to deliver
+ {2} contract name
+ -->
+ <map:pipeline>
+ <map:match pattern="prepare.contract-property.*.**">
+ <map:generate src="{lm:resolve.contract.{1}.{2}}" />
+ <map:transform src="{lm:contract-property.xsl}">
+ <map:parameter name="format" value="{1}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ <!-- ls.contracts
+ list the default contracts-->
+ <map:pipeline>
+ <map:match pattern="ls.contracts.source.xml">
+ <map:generate src="{lm:themer.contracts.dir}"
+ type="xpathdirectory">
+ <map:parameter name="xpath" value="/*" />
+ <map:parameter name="xmlFiles" value="\.ft$" />
+ <map:parameter name="exclude" value="[\w]*.svn" />
+ <map:parameter name="depth" value="3" />
+ </map:generate>
+ <map:transform src="{lm:ls.contracts.xsl}" />
+ <map:serialize />
+ </map:match>
+ <map:match pattern="ls.contracts.project.source.xml">
+ <map:generate src="{lm:themer.project.dir}"
+ type="xpathdirectory">
+ <map:parameter name="xpath" value="/*" />
+ <map:parameter name="xmlFiles" value="\.ft$" />
+ <map:parameter name="exclude" value="[\w]*.svn" />
+ <map:parameter name="depth" value="3" />
+ </map:generate>
+ <map:transform src="{lm:ls.contracts.xsl}" />
+ <map:serialize />
+ </map:match>
+ <map:match pattern="ls.contracts.xml">
+ <map:generate src="{lm:ls.contracts}" />
+ <map:transform src="{lm:ls.contracts-to-document.xsl}" />
+ <map:serialize />
+ </map:match>
+ <map:match pattern="ls.contracts.project.xml">
+ <map:generate src="{lm:ls.contracts.project}" />
+ <map:transform src="{lm:ls.contracts-to-document.xsl}" />
+ <map:serialize />
+ </map:match>
+ <map:match pattern="ls.contract-*.xml">
+ <map:generate src="{lm:ls.contracts}" />
+ <map:transform src="{lm:ls.contracts-to-document.xsl}">
+ <map:parameter name="requestedContract" value="{1}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ <map:match pattern="ls.contract.project-*.xml">
+ <map:generate src="{lm:ls.contracts.project}" />
+ <map:transform src="{lm:ls.contracts-to-document.xsl}">
+ <map:parameter name="requestedContract" value="{1}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ <map:match pattern="less.contract-*.xml">
+ <map:generate src="{lm:ls.contracts}" />
+ <map:transform src="{lm:ls.contracts-to-document.xsl}">
+ <map:parameter name="requestedContract" value="{1}" />
+ <map:parameter name="less" value="true" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ <map:match pattern="less.contract.project-*.xml">
+ <map:generate src="{lm:ls.contracts.project}" />
+ <map:transform src="{lm:ls.contracts-to-document.xsl}">
+ <map:parameter name="requestedContract" value="{1}" />
+ <map:parameter name="less" value="true" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.themes.core/build.xml b/plugins/org.apache.forrest.themes.core/build.xml
new file mode 100644
index 0000000..83f127b
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/build.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<project default="docs" basedir="." name="Forrest plugin build file">
+
+ <property name="plugin-name" value="org.apache.forrest.plugin.output.themer"/>
+ <property name="forrest.version" value="0.7"/>
+ <property name="type" value="output"/>
+ <property name="plugin-version" value="0.1-dev"/>
+ <property name="description" value="The XHTML representation of a view."/>
+ <property name="author" value="Apache Forrest Project"/>
+ <property name="websiteURL" value="http://forrest.apache.org/docs/plugins/org.apache.forrest.plugin.output.themer/"/>
+ <property name="downloadURL" value="http://forrest.apache.org/plugins/"/>
+
+ <import file="../build.xml"/>
+
+ <!-- Add any additional installation work here in the build target, for example:
+ <target name="build"
+ description="Extract the tools">
+ <unzip dest="${plugins.localDeploy-dir}/${plugin-name}/resources">
+ <fileset dir="tools">
+ <include name="pluginBionaryTools.zip"/>
+ </fileset>
+ </unzip>
+ </target>
+ -->
+</project>
+
+
diff --git a/plugins/org.apache.forrest.themes.core/foo.xml b/plugins/org.apache.forrest.themes.core/foo.xml
new file mode 100644
index 0000000..649dff2
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/foo.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<foo/>
diff --git a/plugins/org.apache.forrest.themes.core/forrest.properties b/plugins/org.apache.forrest.themes.core/forrest.properties
new file mode 100644
index 0000000..89502cd
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/forrest.properties
@@ -0,0 +1,25 @@
+# Copyright 2002-2005 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed 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.
+
+##############
+# This is a minimal properties file.
+# These are defaults, un-comment them only if you need to change them.
+# See the full set of default properties in a 'forrest seed-sample' site.
+# Copy properties from there as needed.
+##############
+
+project.skin=leather-dev
+
+project.required.plugins=org.apache.forrest.plugin.output.themer,org.apache.forrest.plugin.internal.view,org.apache.forrest.plugin.input.projectInfo
diff --git a/plugins/org.apache.forrest.themes.core/jtidy.properties b/plugins/org.apache.forrest.themes.core/jtidy.properties
new file mode 100644
index 0000000..ca092c6
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/jtidy.properties
@@ -0,0 +1,30 @@
+# Copyright 2002-2004 The Apache Software Foundation or its licensors,
+# as applicable.
+#
+# Licensed 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.
+
+indent=yes
+indent-spaces=8
+wrap=72
+markup=yes
+output-xml=no
+input-xml=no
+show-warnings=yes
+numeric-entities=yes
+quote-marks=yes
+quote-nbsp=yes
+quote-ampersand=yes
+break-before-br=yes
+uppercase-tags=no
+uppercase-attributes=no
+char-encoding=UTF-8
diff --git a/plugins/org.apache.forrest.themes.core/locationmap.xml b/plugins/org.apache.forrest.themes.core/locationmap.xml
new file mode 100644
index 0000000..98ca214
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/locationmap.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!-- Default Forrest locationmap for the structurer/themer -->
+
+<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
+
+ <components>
+ <matchers default="lm">
+ <matcher
+ name="lm"
+ src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
+ </matchers>
+ <selectors default="exists">
+ <selector name="exists" logger="sitemap.selector.exists"
+ src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+ </selectors>
+ </components>
+
+ <locator>
+ <!-- Project implementation of templates have priority before default ones.
+ If no implementation can be found we use the noFt (~ - no forrest:template) implementation.
+ {1} name of the contract -->
+ <match pattern="resolve.contract.*.**">
+ <select type="exists">
+ <!-- project-based theme -->
+ <location src="{lm:themer.project.dir}/{project:theme}/{1}/{2}.ft" />
+ <!-- project-based default fallback -->
+ <location src="{lm:themer.project.dir}/{defaults:theme}/{1}/{2}.ft" />
+ <!-- project-application-based theme -->
+ <location src="{project:themer}/resources/themes/{project:theme}/{1}/{2}.ft" />
+ <!-- project-application-based default fallback -->
+ <location src="{project:themer}/resources/themes/{defaults:theme}/{1}/{2}.ft" />
+ <!-- plugin provided contracts -->
+ <location src="{lm:resolvePluginContract.{1}.{2}}" />
+ <!-- forrest-application-based theme -->
+ <location src="{defaults:themer}/resources/themes/{project:theme}/{1}/{2}.ft" />
+ <!-- forrest-application-based default fallback -->
+ <location src="{defaults:themer}/resources/themes/{defaults:theme}/{1}/{2}.ft" />
+ <!-- forrest-application-based no found -->
+ <location src="{defaults:themer}/resources/themes/{defaults:theme}/{1}/noFt.ft" />
+ </select>
+ </match>
+ <match pattern="contract.html.**">
+ <select type="exists">
+ <location src="cocoon://prepare.contract.html.{1}" />
+ </select>
+ </match>
+ <match pattern="contract-property.html.**">
+ <select type="exists">
+ <location src="cocoon://prepare.contract-property.html.{1}" />
+ </select>
+ </match>
+ <match pattern="dataModel-xml-document-to-**.xsl">
+ <select type="exists">
+ <!-- FIXME
+ to-xml should become xml
+ document2 should become document-to-
+ after commiting -->
+ <!--<location src="{project:skins-dir}{project:theme}/xslt/to-xml/document2{1}.xsl" />-->
+ <!--<location src="{project:structurer}/resources/stylesheets/to-xml/document2{1}.xsl" />-->
+ <!--<location src="{defaults:structurer}/resources/stylesheets/to-xml/document2{1}.xsl" />-->
+ <location
+ src="{project:skins-dir}{project:theme}/xslt/xml/document-to-{1}.xsl" />
+ <location
+ src="{project:structurer}/resources/stylesheets/xml/document-to-{1}.xsl" />
+ <location
+ src="{defaults:structurer}/resources/stylesheets/xml/document-to-{1}.xsl" />
+ </select>
+ </match>
+ <match pattern="dataModel-html-**.xsl">
+ <select type="exists">
+ <location src="{project:skins-dir}{project:theme}/xslt/html/{1}.xsl" />
+ <location src="{project:structurer}/resources/stylesheets/html/{1}.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/html/{1}.xsl" />
+ </select>
+ </match>
+ <!-- contracts have to be striped to their stylesheet for aggregation. -->
+ <match pattern="contract-strip-xsl.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/contract-strip-xsl.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/contract-strip-xsl.xsl" />
+ </select>
+ </match>
+ <match pattern="hooks-to-html.xsl">
+ <select type="exists">
+ <location src="{project:themer}/resources/stylesheets/hooksMatcher-html.xsl" />
+ <location src="{defaults:themer}/resources/stylesheets/hooksMatcher-html.xsl" />
+ </select>
+ </match>
+ <!-- contracts (e.g. html) need to be prepared for their stylesheet-aggregation. -->
+ <match pattern="contract-property.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/contract.property.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/contract.property.xsl" />
+ </select>
+ </match>
+ <!-- contracts (e.g. html) that can be used in the project. -->
+ <match pattern="ls.contracts.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/ls.contracts.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/ls.contracts.xsl" />
+ </select>
+ </match>
+ <match pattern="ls.contracts">
+ <select type="exists">
+ <location src="cocoon://ls.contracts.source.xml" />
+ </select>
+ </match>
+ <match pattern="ls.contracts.project">
+ <select type="exists">
+ <location src="cocoon://ls.contracts.project.source.xml" />
+ </select>
+ </match>
+ <match pattern="ls.contracts-to-document.xsl">
+ <select type="exists">
+ <location src="{project:structurer}/resources/stylesheets/ls.contracts-to-document.xsl" />
+ <location src="{defaults:structurer}/resources/stylesheets/ls.contracts-to-document.xsl" />
+ </select>
+ </match>
+ <!--Theme dir-->
+ <match pattern="themer.project.dir">
+ <select type="exists">
+ <location src="{project:resources}themes"/>
+ <!-- v1 location -->
+ <location src="{project:resources}templates" />
+ </select>
+ </match>
+ <!-- contracts (e.g. html) that can be used in the project. -->
+ <match pattern="themer.contracts.dir">
+ <select type="exists">
+ <location src="{project:themer}/resources/themes" />
+ <location src="{defaults:themer}/resources/themes" />
+ </select>
+ </match>
+ <!-- generic match for theme image ressources. -->
+ <!--
+ {1} name
+ {2} extension (note we assume e.g. {1}.gif)
+ -->
+ <match pattern="themes/images/**.*">
+ <select type="exists">
+ <location src="{lm:themer.project.dir}/{project:theme}/images/{1}.{2}" />
+ <location src="{lm:themer.project.dir}/{defaults:theme}/images/{1}.{2}" />
+ <location src="{project:themer}/resources/themes/{project:theme}/images/{1}.{2}" />
+ <location src="{project:themer}/resources/themes/{defaults:theme}/images/{1}.{2}" />
+ <location src="{defaults:themer}/resources/themes/{project:theme}/images/{1}.{2}" />
+ <location src="{defaults:themer}/resources/themes/{defaults:theme}/images/{1}.{2}" />
+ </select>
+ </match>
+ <!-- generic match for theme ressources like css and js. -->
+ <!--
+ {1} name
+ {2} extension (note we assume e.g. PATH/css/{1}.css)
+ -->
+ <match pattern="themes/**.*">
+ <select type="exists">
+ <location src="{lm:themer.project.dir}/{project:theme}/{2}/{1}.{2}" />
+ <location src="{lm:themer.project.dir}/{defaults:theme}/{2}/{1}.{2}" />
+ <location src="{project:themer}/resources/themes/{project:theme}/{2}/{1}.{2}" />
+ <location src="{project:themer}/resources/themes/{defaults:theme}/{2}/{1}.{2}" />
+ <location src="{defaults:themer}/resources/themes/{project:theme}/{2}/{1}.{2}" />
+ <location src="{defaults:themer}/resources/themes/{defaults:theme}/{2}/{1}.{2}" />
+ </select>
+ </match>
+ </locator>
+</locationmap>
diff --git a/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_de.xml b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_de.xml
new file mode 100644
index 0000000..fa1a085
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_de.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Schriftgrösse:</message>
+ <message key="Last Published:">Zuletzt veröffentlicht:</message>
+ <message key="Search">Suche</message>
+ <message key="More">Mehr</message>
+ <message key="Search the site with">Suche auf der Seite mit</message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_es.xml b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_es.xml
new file mode 100644
index 0000000..e0c0526
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_es.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Tamaño de fuente:</message>
+ <message key="Last Published:">Último publicado:</message>
+ <message key="Search">Búsqueda</message>
+ <message key="More">Más</message>
+ <message key="Search the site with">Búsqueda en</message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_fr.xml b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_fr.xml
new file mode 100644
index 0000000..60bbbff
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_fr.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Taille :</message>
+ <message key="Last Published:">Derniere Publication :</message>
+ <message key="Search">Rechercher</message>
+ <message key="More">Encore</message>
+ <message key="Search the site with">Rechercher avec</message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_us.xml b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_us.xml
new file mode 100644
index 0000000..38cbdf6
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/messages/ContractsMessages_us.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<catalogue>
+ <message key="Font size:">Font size:</message>
+ <message key="Last Published:">Last Published:</message>
+ <message key="Search">Search</message>
+ <message key="More">More</message>
+ <message key="Search the site with">Suche auf der Seite mit </message>
+</catalogue>
diff --git a/plugins/org.apache.forrest.themes.core/output.xmap b/plugins/org.apache.forrest.themes.core/output.xmap
new file mode 100644
index 0000000..7690991
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/output.xmap
@@ -0,0 +1,232 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:pipes default="caching">
+ <map:pipe name="caching"
+ src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline" />
+ <map:pipe name="noncaching"
+ src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline" />
+ </map:pipes>
+ <map:selectors>
+ <map:selector logger="sitemap.selector.exists" name="exists"
+ src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+ </map:selectors>
+ <map:generators default="file">
+ <map:generator name="html"
+ src="org.apache.cocoon.generation.HTMLGenerator">
+ <jtidy-config>jtidy.properties</jtidy-config>
+ </map:generator>
+ <map:generator name="text"
+ src="org.apache.cocoon.generation.TextGenerator">
+ <parameter name="localizable" value="true" />
+ </map:generator>
+ <map:generator name="directory"
+ src="org.apache.cocoon.generation.DirectoryGenerator" />
+ <!--<map:generator name="structurerXsl"
+ src="org.apache.forrest.structurer.generation.StructurerXSLGenerator" />
+ -->
+ </map:generators>
+ <map:transformers default="xslt">
+ <map:transformer name="cinclude"
+ src="org.apache.cocoon.transformation.CIncludeTransformer" />
+ <map:transformer name="dispatcher"
+ src="org.apache.forrest.dispatcher.transformation.DispatcherTransformer" />
+ <map:transformer name="i18n"
+ src="org.apache.cocoon.transformation.I18nTransformer">
+ <catalogues default="contracts">
+ <catalogue id="other" name="OtherMessages"
+ location="messages" />
+ <catalogue id="contracts" name="ContractsMessages"
+ location="messages" />
+ </catalogues>
+ <cache-at-startup>true</cache-at-startup>
+ </map:transformer>
+ </map:transformers>
+ <map:serializers default="xml">
+ <map:serializer logger="sitemap.serializer.xhtml"
+ mime-type="text/html" name="xhtml" pool-grow="2" pool-max="64"
+ pool-min="2"
+ src="org.apache.cocoon.serialization.XMLSerializer">
+ <doctype-public>
+ -//W3C//DTD XHTML 1.0 Strict//EN
+ </doctype-public>
+ <doctype-system>
+ http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
+ </doctype-system>
+ <encoding>UTF-8</encoding>
+ <indent>yes</indent>
+ </map:serializer>
+ <map:serializer name="txt"
+ src="org.apache.cocoon.serialization.TextSerializer"
+ mime-type="text/plain" logger="sitemap.serializer.text" />
+ <map:serializer mime-type="image/png" name="svg2png"
+ src="org.apache.cocoon.serialization.SVGSerializer">
+ <!--<parameter name="background_color" type="color" value="#ff00ff"/>-->
+ <!-- <parameter name="gamma" type="float" value="0.48"/> -->
+ <parameter name="gamma" type="float" value="0" />
+ </map:serializer>
+ </map:serializers>
+ </map:components>
+ <map:resources>
+ <map:resource name="read-linked-text">
+ <map:generate type="text" src="{path}" />
+ <map:transform type="pattern"
+ src="{forrest:context}/resources/chaperon/grammars/link.xlex" />
+ <map:transform
+ src="{forrest:context}/resources/chaperon/stylesheets/pattern2link.xsl" />
+ <map:serialize type="text" mime-type="text/css" />
+ </map:resource>
+ </map:resources>
+ <map:pipelines>
+ <map:pipeline>
+ <map:match pattern="test.dispatcher">
+ <map:generate src="{lm:resolve.structurer.index-foo}" />
+ <map:transform type="dispatcher">
+ <map:parameter name="type" value="html" />
+ <map:parameter name="hooksTransformer"
+ value="{lm:hooks-to-html.xsl}" />
+ </map:transform>
+ <map:serialize type="xhtml" />
+ </map:match>
+ <map:match pattern="test.css">
+ <map:generate src="{lm:resolve.structurer.index-foo}" />
+ <map:transform type="dispatcher">
+ <map:parameter name="type" value="css" />
+ </map:transform>
+ <map:transform type="pattern"
+ src="{forrest:context}/resources/chaperon/grammars/link.xlex" />
+ <map:transform
+ src="{forrest:context}/resources/chaperon/stylesheets/pattern2link.xsl" />
+ <map:serialize type="text" mime-type="text/css" />
+ </map:match>
+ <map:match pattern="test-lm.**">
+ <!-- FIXME
+ e.g. lm://"test-lm.resolve.structurer.index-foo" throws an exception
+ cause: Invalid System ID
+ but e.g. lm://"test-lm.plugin.xmap.output" just works fine.
+ I do not know why but seems that the main forrest lm is read but only the <match/> elements and not the mount ones.
+ -->
+ <map:generate src="lm://{1}" />
+ <map:serialize type="xml" />
+ </map:match>
+ <map:match pattern="test-props">
+ <map:generate src="foo.xml" />
+ <map:transform src="lm://transform.xml.variable.helper">
+ <map:parameter name="path" value="samples/index.html" />
+ </map:transform>
+ <map:serialize type="xml" />
+ </map:match>
+ <map:match pattern="test.**">
+ <map:generate src="{lm:resolve.structurer.{1}}" />
+ <map:transform type="dispatcher">
+ <map:parameter name="type" value="html" />
+ </map:transform>
+ <map:serialize />
+
+ <map:transform
+ src="resources/stylesheets/hooksMatcher-html.xsl" />
+ <!-- type="structurerXsl" -->
+ <map:generate src="status.xml" />
+ <map:transform src="resources/stylesheets/temp.xsl">
+ <map:parameter name="test"
+ value="{lm:resolve.structurer.{1}}" />
+ </map:transform>
+ <map:serialize />
+ </map:match>
+ </map:pipeline>
+
+ <map:pipeline>
+ <!--
+ Last processing step.
+ Here we are overriding the default skin generation.
+ -->
+
+ <map:match pattern="themes/**.css">
+ <map:call resource="read-linked-text">
+ <map:parameter name="path" value="{lm:themes/{1}.css}" />
+ </map:call>
+ <!-- <map:read mime-type="text/css" src="{lm:themes/{1}.css}" /> -->
+ </map:match>
+
+ <map:match pattern="themes/**.js">
+ <map:read mime-type="application/x-javascript"
+ src="{lm:themes/{1}.js}" />
+ </map:match>
+
+ <map:match
+ pattern="themes/images**/roundcorner-*-*-*-bg*-stroke*-fg*.svg">
+ <map:generate src="status.xml" />
+ <map:transform
+ src="resources/stylesheets/round-corner-hex.svg.xslt">
+ <map:parameter name="orientation-tb" value="{2}" />
+ <map:parameter name="orientation-lr" value="{3}" />
+ <map:parameter name="size" value="{4}" />
+ <map:parameter name="bg-color-name" value="{5}" />
+ <map:parameter name="stroke-color-name" value="{6}" />
+ <map:parameter name="fg-color-name" value="{7}" />
+ </map:transform>
+ <map:serialize type="xml" />
+ </map:match>
+ <map:match
+ pattern="themes/images**/roundcorner-*-*-*-bg*-stroke*-fg*.svg-to-png">
+ <map:generate
+ src="cocoon:/themes/images{1}/roundcorner-{2}-{3}-{4}-bg{5}-stroke{6}-fg{7}.svg" />
+ <map:serialize type="svg2png" />
+ </map:match>
+ <map:match
+ pattern="themes/images**/roundcorner-*-*-*-bg*-stroke*-fg*.png">
+ <map:read
+ src="cocoon:/themes/images{1}/roundcorner-{2}-{3}-{4}-bg{5}-stroke{6}-fg{7}.svg-to-png"
+ mime-type="image/png" />
+ </map:match>
+ <map:match pattern="themes/images/**.*">
+ <map:match type="regexp"
+ pattern="(.*\.)(jpg|JPG|Jpg|jpeg|Jpeg|JPEG)$">
+ <map:read src="{lm:{1}{2}}" mime-type="image/jpeg" />
+ </map:match>
+ <map:match type="regexp" pattern="(.*)(gif|GIF|Gif)$">
+ <map:read src="{lm:{1}{2}}" mime-type="image/gif" />
+ </map:match>
+ <map:match type="regexp" pattern="(.*)(png|PNG|Png)$">
+ <map:read src="{lm:{1}{2}}" mime-type="image/png" />
+ </map:match>
+ </map:match>
+ <map:match pattern="**.js">
+ <map:mount uri-prefix="" src="resources.xmap"
+ check-reload="yes" />
+ </map:match>
+ <map:match pattern="**.css">
+ <map:mount uri-prefix="" src="resources.xmap"
+ check-reload="yes" />
+ </map:match>
+ <!-- <map:match pattern="**images**">
+ <map:mount uri-prefix="" src="resources.xmap"
+ check-reload="yes" />
+ </map:match>-->
+ <map:match pattern="**.png">
+ <map:mount uri-prefix="" src="resources.xmap"
+ check-reload="yes" />
+ </map:match>
+ <map:match pattern="**.ico">
+ <map:mount uri-prefix="" src="resources.xmap"
+ check-reload="yes" />
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.themes.core/resources.xmap b/plugins/org.apache.forrest.themes.core/resources.xmap
new file mode 100644
index 0000000..50fedd2
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources.xmap
@@ -0,0 +1,439 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!-- ===============================================
+Pipelines for resources (css, images, javascript etc).
+
+
+Generates : CSS, images (possibly from SVG), javascript.
+Example URL: http://localhost:8888/images/project-logo.gif
+Used by : sitemap.xmap
+Uses : resources/*, skins/*/{css,images}
+
+$Revision: 1.13 $
+==================================================== -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+ <map:generators default="file" >
+ <map:generator name="asciiart-svg"
+ src="org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator"/>
+ <map:generator name="text"
+ src="org.apache.cocoon.generation.TextGenerator">
+ <parameter name="localizable" value="true"/>
+ </map:generator>
+ </map:generators>
+ <map:serializers default="html">
+ <map:serializer name="svg2jpeg" mime-type="image/jpeg" src="org.apache.cocoon.serialization.SVGSerializer">
+ <parameter name="quality" type="float" value="1.0" />
+ </map:serializer>
+ <map:serializer mime-type="image/png"
+ name="svg2png"
+ src="org.apache.cocoon.serialization.SVGSerializer" >
+ <!--<parameter name="background_color" type="color" value="#ff00ff"/>-->
+ <!-- <parameter name="gamma" type="float" value="0.48"/> -->
+ <parameter name="gamma" type="float" value="0"/>
+ </map:serializer>
+ <map:serializer name="text" mime-type="text/plain" src="org.apache.cocoon.serialization.TextSerializer"/>
+ </map:serializers>
+ <map:transformers default="xslt">
+ <map:transformer name="pattern"
+ src="org.apache.cocoon.transformation.PatternTransformer">
+ <parameter name="groups" value="true"/>
+ </map:transformer>
+ </map:transformers>
+
+ <map:readers default="resource" />
+ <map:matchers default="wildcard" />
+ </map:components>
+
+ <map:resources>
+ <map:resource name="skin-read">
+ <map:select type="exists">
+ <!-- First location: project skin dir -->
+ <map:when test="{project:skins-dir}{path}/{name}.css">
+ <map:call resource="read-linked-text">
+ <map:parameter name="path" value="{project:skins-dir}{path}/{name}.css" />
+ </map:call>
+ </map:when>
+ <map:when test="{project:skins-dir}{path}/{name}.{ext}">
+ <map:read src="{project:skins-dir}{path}/{name}.{ext}" mime-type="{mime-type}" />
+ </map:when>
+ <map:when test="{project:skins-dir}{path}/{name}.css.xslt">
+ <map:call resource="pipe-text-resource">
+ <map:parameter name="path" value="{project:skins-dir}{path}/{name}.css.xslt" />
+ <map:parameter name="mime-type" value="text/css" />
+ </map:call>
+ </map:when>
+ <map:when test="{project:skins-dir}{path}/{name}.svg.xslt">
+ <map:call resource="pipe-transformed-svg2png-resource">
+ <map:parameter name="path" value="{project:skins-dir}{path}/{name}.svg.xslt" />
+ </map:call>
+ </map:when>
+
+ <!-- Second location: skin dir -->
+
+ <map:when test="resources/skin/{path}/{project:theme}/{name}.css">
+ <map:call resource="read-linked-text">
+ <map:parameter name="path" value="resources/skin/{path}/{project:theme}/{name}.css" />
+ </map:call>
+ </map:when>
+ <map:when test="resources/skin/{path}/{project:theme}/{name}.{ext}">
+ <map:read src="resources/skin/{path}/{project:theme}/{name}.{ext}" mime-type="{mime-type}" />
+ </map:when>
+ <map:when test="resources/skin/{path}/{project:theme}/{name}.css.xslt">
+ <map:call resource="pipe-text-resource">
+ <map:parameter name="path" value="resources/skin/{path}/{project:theme}/{name}.css.xslt" />
+ <map:parameter name="mime-type" value="text/css" />
+ </map:call>
+ </map:when>
+ <map:when test="resources/skin/{path}/{project:theme}/{name}.svg.xslt">
+ <map:call resource="pipe-transformed-svg2png-resource">
+ <map:parameter name="path" value="resources/skin/{path}/{project:theme}/{name}.svg.xslt" />
+ </map:call>
+ </map:when>
+
+ <!-- Third location: leather skin dir -->
+
+ <map:when test="resources/skin/{path}/{name}.css">
+ <map:call resource="read-linked-text">
+ <map:parameter name="path" value="resources/skin/{path}/{name}.css" />
+ </map:call>
+ </map:when>
+ <map:when test="resources/skin/{path}/{name}.{ext}">
+ <map:read src="resources/skin/{path}/{name}.{ext}" mime-type="{mime-type}" />
+ </map:when>
+ <map:when test="resources/skin/{path}/{name}.css.xslt">
+ <map:call resource="pipe-text-resource">
+ <map:parameter name="path" value="resources/skin/{path}/{name}.css.xslt" />
+ <map:parameter name="mime-type" value="text/css" />
+ </map:call>
+ </map:when>
+ <map:when test="resources/skin/{path}/{name}.svg.xslt">
+ <map:call resource="pipe-transformed-svg2png-resource">
+ <map:parameter name="path" value="resources/skin/{path}/{name}.svg.xslt" />
+ </map:call>
+ </map:when>
+
+ <!-- Fourth location: forrest common skin dir -->
+ <map:when test="{forrest:context}/skins/common/{path}/{name}.css">
+ <map:call resource="read-linked-text">
+ <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.css" />
+ </map:call>
+ </map:when>
+ <map:when test="{forrest:context}/skins/common/{path}/{name}.{ext}">
+ <map:read src="{forrest:context}/skins/common/{path}/{name}.{ext}" mime-type="{mime-type}" />
+ </map:when>
+ <map:when test="{forrest:context}/skins/common/{path}/{name}.css.xslt">
+ <map:call resource="pipe-text-resource">
+ <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.css.xslt" />
+ <map:parameter name="mime-type" value="text/css" />
+ </map:call>
+ </map:when>
+ <map:when test="{forrest:context}/skins/common/{path}/{name}.svg.xslt">
+ <map:call resource="pipe-transformed-svg2png-resource">
+ <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.svg.xslt" />
+ </map:call>
+ </map:when>
+ <map:otherwise>
+ <!-- this should always fail; it is used so the error has the correct filename and extension -->
+ <map:read src=".../{path}/{name}.{ext}" mime-type="{mime-type}" />
+ </map:otherwise>
+ </map:select>
+ </map:resource>
+
+ <map:resource name="read-svg2png-corner-resource">
+ <map:select type="exists">
+ <map:when test="{project:skins-dir}{forrest:skin}/{path}/{name}.svg.xslt">
+ <map:call resource="pipe-transformed-svg2png-corner-resource">
+ <map:parameter name="path" value="{project:skins-dir}{forrest:skin}/{path}/{name}.svg.xslt" />
+ <map:parameter name="orientation-tb" value="{orientation-tb}"/>
+ <map:parameter name="orientation-lr" value="{orientation-lr}"/>
+ <map:parameter name="size" value="{size}"/>
+ <map:parameter name="bg-color-name" value="{bg-color-name}"/>
+ <map:parameter name="stroke-color-name" value="{stroke-color-name}"/>
+ <map:parameter name="fg-color-name" value="{fg-color-name}"/>
+ </map:call>
+ </map:when>
+ <map:when test="resources/skin/{path}/{name}.svg.xslt">
+ <map:call resource="pipe-transformed-svg2png-corner-resource">
+ <map:parameter name="path" value="resources/skin/{path}/{name}.svg.xslt" />
+ <map:parameter name="orientation-tb" value="{orientation-tb}"/>
+ <map:parameter name="orientation-lr" value="{orientation-lr}"/>
+ <map:parameter name="size" value="{size}"/>
+ <map:parameter name="bg-color-name" value="{bg-color-name}"/>
+ <map:parameter name="stroke-color-name" value="{stroke-color-name}"/>
+ <map:parameter name="fg-color-name" value="{fg-color-name}"/>
+ </map:call>
+ </map:when>
+ <map:otherwise>
+ <map:call resource="pipe-svg2png-corner-resource">
+ <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.svg.xslt" />
+ <map:parameter name="orientation-tb" value="{orientation-tb}"/>
+ <map:parameter name="orientation-lr" value="{orientation-lr}"/>
+ <map:parameter name="size" value="{size}"/>
+ <map:parameter name="bg-color-name" value="{bg-color-name}"/>
+ <map:parameter name="stroke-color-name" value="{stroke-color-name}"/>
+ <map:parameter name="fg-color-name" value="{fg-color-name}"/>
+ </map:call>
+ </map:otherwise>
+ </map:select>
+ </map:resource>
+
+ <map:resource name="pipe-text-resource">
+ <map:call resource="generate-transformed-resource">
+ <map:parameter name="path" value="{path}" />
+ </map:call>
+ <map:serialize type="text" mime-type="{mime-type}"/>
+ </map:resource>
+
+ <map:resource name="pipe-aggregate-svg2png-resource">
+ <map:call resource="generate-aggregate-resource">
+ <map:parameter name="path" value="{path}" />
+ </map:call>
+ <map:call resource="transform-project2text"/>
+ <map:transform src="{forrest:stylesheets}/extract-svg.xsl"/>
+ <map:serialize type="svg2png" />
+ </map:resource>
+
+ <map:resource name="pipe-transformed-svg2png-resource">
+ <map:call resource="generate-transformed-resource">
+ <map:parameter name="path" value="{path}" />
+ </map:call>
+ <map:call resource="transform-project2text"/>
+ <map:serialize type="svg2png" />
+ </map:resource>
+
+ <map:resource name="pipe-svg2png-corner-resource">
+ <map:generate src="cocoon://skinconf.xml" />
+ <map:transform src="{path}">
+ <map:parameter name="orientation-tb"
+ value="{orientation-tb}"/>
+ <map:parameter name="orientation-lr"
+ value="{orientation-lr}"/>
+ <map:parameter name="size"
+ value="{size}"/>
+ <map:parameter name="bg-color-name"
+ value="{bg-color-name}"/>
+ <map:parameter name="stroke-color-name"
+ value="{stroke-color-name}"/>
+ <map:parameter name="fg-color-name"
+ value="{fg-color-name}"/>
+ </map:transform>
+ <map:call resource="transform-project2text"/>
+ <map:serialize type="svg2png" />
+ </map:resource>
+
+ <map:resource name="generate-aggregate-resource">
+ <map:aggregate element="resource">
+ <map:part src="cocoon://skinconf.xml" />
+ <map:part src="{path}"/>
+ </map:aggregate>
+ </map:resource>
+
+ <map:resource name="generate-transformed-resource">
+ <map:generate src="cocoon://skinconf.xml" />
+ <map:transform src="{path}"/>
+ </map:resource>
+
+ <map:resource name="transform-project2text">
+ <map:transform src="{forrest:stylesheets}/project2text.xsl"/>
+ </map:resource>
+
+ <map:resource name="read-linked-text">
+ <map:generate type="text" src="{path}" />
+ <map:transform type="pattern" src="{forrest:context}/resources/chaperon/grammars/link.xlex"/>
+ <map:transform src="{forrest:context}/resources/chaperon/stylesheets/pattern2link.xsl"/>
+ <map:serialize type="text" mime-type="text/css"/>
+ </map:resource>
+
+ </map:resources>
+
+ <map:pipelines>
+ <map:pipeline>
+ <map:match pattern="**skin/**.js">
+ <map:call resource="skin-read">
+ <map:parameter name="path" value="scripts" />
+ <map:parameter name="name" value="{2}" />
+ <map:parameter name="ext" value="js" />
+ <map:parameter name="mime-type" value="application/x-javascript" />
+ </map:call>
+ </map:match>
+
+ <map:match pattern="**skin/**.css">
+ <map:call resource="skin-read">
+ <map:parameter name="path" value="css" />
+ <map:parameter name="name" value="{2}" />
+ <map:parameter name="ext" value="css" />
+ <map:parameter name="mime-type" value="text/css" />
+ </map:call>
+ </map:match>
+
+ <!-- special case corner generator pipeline -->
+ <map:match pattern="skin/images**/*c-*-*-*-1*-2*-3*.png">
+ <map:call resource="read-svg2png-corner-resource">
+ <map:parameter name="path" value="images/{1}" />
+ <map:parameter name="name" value="{2}c" />
+ <map:parameter name="orientation-tb" value="{3}"/>
+ <map:parameter name="orientation-lr" value="{4}"/>
+ <map:parameter name="size" value="{5}"/>
+ <map:parameter name="bg-color-name" value="{6}"/>
+ <map:parameter name="stroke-color-name" value="{7}"/>
+ <map:parameter name="fg-color-name" value="{8}"/>
+ </map:call>
+ </map:match>
+ <!-- special case corner generator pipeline -->
+ <!--<map:match pattern="themes/images**/*c-*-*-*-1*-2*-3*.png">
+ <map:call resource="read-svg2png-corner-resource">
+ <map:parameter name="path" value="images/{1}" />
+ <map:parameter name="name" value="{2}c" />
+ <map:parameter name="orientation-tb" value="{3}"/>
+ <map:parameter name="orientation-lr" value="{4}"/>
+ <map:parameter name="size" value="{5}"/>
+ <map:parameter name="bg-color-name" value="{6}"/>
+ <map:parameter name="stroke-color-name" value="{7}"/>
+ <map:parameter name="fg-color-name" value="{8}"/>
+ </map:call>
+ </map:match>-->
+ <!-- special case corner generator pipeline -->
+
+ <map:match pattern="skin/images**/*.*">
+ <map:call resource="skin-read">
+ <map:parameter name="path" value="images/{1}" />
+ <map:parameter name="name" value="{2}" />
+ <map:parameter name="ext" value="{3}" />
+ <map:parameter name="mime-type" value="image/{3}" />
+ </map:call>
+ </map:match>
+
+ <!-- handles images local to a contributor directory -->
+ <map:match pattern="**my-images/**.*">
+ <map:read src="{project:content.xdocs}{1}my-images/{2}.{3}" mime-type="image/{3}" />
+ </map:match>
+
+ <map:match pattern="images/**.png">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}/images/{1}.svg">
+ <map:call resource="pipe-aggregate-svg2png-resource">
+ <map:parameter name="path" value="{project:content.xdocs}/images/{1}.svg" />
+ </map:call>
+ </map:when>
+ <map:when test="{project:resources.images}/{1}.svg">
+ <map:call resource="pipe-aggregate-svg2png-resource">
+ <map:parameter name="path" value="{project:resources.images}/{1}.svg" />
+ </map:call>
+ </map:when>
+ <map:when test="resources/images/{1}.svg">
+ <map:call resource="pipe-aggregate-svg2png-resource">
+ <map:parameter name="path" value="resources/images/{1}.svg" />
+ </map:call>
+ </map:when>
+ <map:when test="{project:content.xdocs}/images/{1}.png">
+ <map:read src="{project:content.xdocs}/images/{1}.png" mime-type="image/png" />
+ </map:when>
+ <map:when test="resources/images/{1}.png">
+ <map:read src="resources/images/{1}.png" mime-type="image/png" />
+ </map:when>
+ <map:when test="{project:resources.images}/{1}.png">
+ <map:read src="{project:resources.images}/{1}.png" mime-type="image/png" />
+ </map:when>
+ <map:otherwise>
+ <!-- needed for compatibility for the standard resources/images that are now
+ in the common skin -->
+ <map:call resource="skin-read">
+ <map:parameter name="path" value="images" />
+ <map:parameter name="name" value="{1}" />
+ <map:parameter name="ext" value="png" />
+ <map:parameter name="mime-type" value="image/png" />
+ </map:call>
+ </map:otherwise>
+ </map:select>
+ </map:match>
+
+ <map:match pattern="images/**.*">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}/images/{1}.{2}">
+ <map:read src="{project:content.xdocs}/images/{1}.{2}" mime-type="image/{2}" />
+ </map:when>
+ <map:when test="resources/images/{1}.{2}">
+ <map:read src="resources/images/{1}.{2}" mime-type="image/{2}" />
+ </map:when>
+ <map:when test="{project:resources.images}/{1}.{2}">
+ <map:read src="{project:resources.images}/{1}.{2}" mime-type="image/{2}" />
+ </map:when>
+ <map:otherwise>
+ <!-- needed for compatibility for the standard resources/images that are now
+ in the common skin -->
+ <map:call resource="skin-read">
+ <map:parameter name="path" value="images" />
+ <map:parameter name="name" value="{1}" />
+ <map:parameter name="ext" value="{2}" />
+ <map:parameter name="mime-type" value="image/{2}" />
+ </map:call>
+ </map:otherwise>
+ </map:select>
+ </map:match>
+
+ <map:match pattern="**/images/**.*">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}/{1}/images/{2}.{3}">
+ <map:read src="{project:content.xdocs}/{1}/images/{2}.{3}" mime-type="image/{3}" />
+ </map:when>
+ <map:when test="resources/images/{2}.{3}">
+ <map:read src="resources/images/{2}.{3}" mime-type="image/{3}" />
+ </map:when>
+ <map:otherwise>
+ <map:read src="{project:resources.images}/{2}.{3}" mime-type="image/{3}" />
+ </map:otherwise>
+ </map:select>
+ </map:match>
+
+ <map:match pattern="**.png">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}/{1}.svg">
+ <map:call resource="pipe-aggregate-svg2png-resource">
+ <map:parameter name="path" value="{project:content.xdocs}/{1}.svg" />
+ </map:call>
+ </map:when>
+ <map:when test="{project:content.xdocs}/{1}.aart">
+ <map:generate type="asciiart-svg" src="{project:content.xdocs}/{1}.aart" />
+ <map:call resource="transform-project2text"/>
+ <map:serialize type="svg2png" />
+ </map:when>
+ <map:otherwise>
+ <map:read src="{project:content.xdocs}/{1}.png" mime-type="image/png" />
+ </map:otherwise>
+ </map:select>
+ </map:match>
+
+ <map:match pattern="**.ico">
+ <map:select type="exists">
+ <map:when test="{project:content.xdocs}/{1}.ico">
+ <map:read src="{project:content.xdocs}/{1}.ico" mime-type="image/x-icon" />
+ </map:when>
+ <map:otherwise>
+ <map:call resource="skin-read">
+ <map:parameter name="path" value="images" />
+ <map:parameter name="name" value="{1}" />
+ <map:parameter name="ext" value="ico" />
+ <map:parameter name="mime-type" value="image/x-icon" />
+ </map:call>
+ </map:otherwise>
+ </map:select>
+ </map:match>
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
diff --git a/plugins/org.apache.forrest.themes.core/resources/stylesheets/contract.css.xsl b/plugins/org.apache.forrest.themes.core/resources/stylesheets/contract.css.xsl
new file mode 100644
index 0000000..0f24ef5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/stylesheets/contract.css.xsl
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="//forrest:template/xsl:stylesheet/xsl:template[contains(@name,'-css')]"/>
+ </xsl:template>
+
+ <xsl:template match="xsl:template[contains(@name,'-css')]">
+ <xsl:value-of select="."/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/stylesheets/hooksMatcher-html.xsl b/plugins/org.apache.forrest.themes.core/resources/stylesheets/hooksMatcher-html.xsl
new file mode 100644
index 0000000..cc7e09c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/stylesheets/hooksMatcher-html.xsl
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <!--This template will match the different combinations for hooks-->
+ <xsl:template match="hook[@name and (@type='div' or not(@type) and not(@class))]">
+ <div id="{@name}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </div>
+ </xsl:template>
+ <xsl:template match="hook[@class and (@type='div' or not(@type))]">
+ <div class="{@class}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </div>
+ </xsl:template>
+ <xsl:template match="hook[@class and @type='span']">
+ <span class="{@class}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </span>
+ </xsl:template>
+ <xsl:template match="hook[@name and @type='span']">
+ <span id="{@name}">
+ <xsl:apply-templates/>
+ <xsl:if test="@nbsp='true'"> </xsl:if>
+ </span>
+ </xsl:template>
+ <xsl:template match="@*|*|text()|processing-instruction()|comment()">
+ <xsl:copy>
+ <xsl:apply-templates
+ select="@*|*|text()|processing-instruction()|comment()"/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/stylesheets/round-corner-hex.svg.xslt b/plugins/org.apache.forrest.themes.core/resources/stylesheets/round-corner-hex.svg.xslt
new file mode 100644
index 0000000..0e304f1
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/stylesheets/round-corner-hex.svg.xslt
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="orientation-tb"/>
+ <xsl:param name="orientation-lr"/>
+ <xsl:param name="size"/>
+ <xsl:param name="bg-color-name"/>
+ <xsl:param name="stroke-color-name"/>
+ <xsl:param name="fg-color-name"/>
+
+ <!-- if not all colors are present, don't even try to render the corners -->
+ <xsl:variable name="isize">
+ <xsl:choose>
+ <xsl:when test="$bg-color-name and $stroke-color-name and $fg-color-name"><xsl:value-of select="$size"/></xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="smallersize" select="number($isize)-1"/>
+ <xsl:variable name="biggersize" select="number($isize)+1"/>
+ <xsl:variable name="bg">fill:#<xsl:value-of select="$bg-color-name"/>;</xsl:variable>
+ <xsl:variable name="fill">fill:#<xsl:value-of select="$fg-color-name"/>;</xsl:variable>
+ <xsl:variable name="stroke">stroke:#<xsl:value-of select="$stroke-color-name"/>;</xsl:variable>
+
+ <xsl:template match="/">
+
+
+<svg width="{$isize}" height="{$isize}">
+<!-- background -->
+ <rect x="-1" y="-1" width="{$biggersize}" height="{$biggersize}" style="{$bg}stroke-width:0"/>
+<!-- 0,0 0,-4 4,0 4,-4-->
+
+ <xsl:variable name="flip-tb-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-lr-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-tb-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-lr-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- flip transform -->
+ <g transform="scale({$flip-lr-scale},{$flip-tb-scale}) translate({$flip-lr-translate}, {$flip-tb-translate})">
+ <xsl:call-template name="figure" />
+ </g>
+</svg>
+</xsl:template>
+
+
+ <xsl:template name="figure">
+ <!-- Just change shape here -->
+ <g transform="translate(0.5 0.5)">
+ <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ <!-- end -->
+ </xsl:template>
+
+
+ <!--<xsl:template match="*"></xsl:template>
+ <xsl:template match="text()"></xsl:template>-->
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/stylesheets/strip_namespaces.xsl b/plugins/org.apache.forrest.themes.core/resources/stylesheets/strip_namespaces.xsl
new file mode 100644
index 0000000..067075e
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/stylesheets/strip_namespaces.xsl
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="yes"/>
+ <xsl:template match="*">
+ <!-- remove element prefix (if any) -->
+ <xsl:element name="{local-name()}">
+ <!-- process attributes -->
+ <xsl:for-each select="@*">
+ <!-- remove attribute prefix (if any) -->
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/stylesheets/temp.xsl b/plugins/org.apache.forrest.themes.core/resources/stylesheets/temp.xsl
new file mode 100644
index 0000000..22919d7
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/stylesheets/temp.xsl
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <xsl:strip-space elements="forrest:properties"/>
+ <xsl:param name="test"/>
+
+ <xsl:template match="/">
+ <p> XXX<xsl:value-of select="$test"/>xxx</p>
+ </xsl:template>
+
+ <!--<xsl:template match="forrest:property[@name=$contract]">
+ <xsl:comment> properties <xsl:value-of select="$contract"/> </xsl:comment>
+ <xsl:copy-of select="*"/>
+ </xsl:template>
+
+ <xsl:template match="forrest:property"/>-->
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common.fv b/plugins/org.apache.forrest.themes.core/resources/themes/common.fv
new file mode 100644
index 0000000..2268487
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common.fv
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+
+<forrest:views
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+ <forrest:view type="html">
+ <forrest:css url="common.css"/>
+ <forrest:contract name="siteinfo-meta">
+ <forrest:properties contract="siteinfo-meta">
+ <forrest:property name="siteinfo-meta" nugget="get.build.info">
+ <jx:import uri="cocoon://build-info"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook name="container">
+ <forrest:hook name="header">
+ <forrest:contract name="branding-tagline">
+ <forrest:properties contract="branding-tagline">
+ <forrest:property name="branding-tagline-name">new seed</forrest:property>
+ <forrest:property name="branding-tagline-tagline">powered by forrest:views</forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook name="nav-main-hook">
+ <forrest:contract name="nav-main">
+ <forrest:properties contract="nav-main">
+ <forrest:property name="nav-main" nugget="get.navigation">
+ <jx:import uri="cocoon://${cocoon.parameters.getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="nav-main-sub">
+ <forrest:properties contract="nav-main-sub">
+ <forrest:property name="nav-main-sub" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ </forrest:hook>
+ <forrest:hook name="page">
+ <forrest:hook name="leftbar">
+ <forrest:contract name="nav-section">
+ <forrest:properties contract="nav-section">
+ <forrest:property name="nav-section" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="search-input">
+ <forrest:properties contract="search-input">
+ <forrest:property name="search-input">
+ <search name="MyProject" domain="mydomain" provider="google"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+<!--
+ You can group elements to a template and call it from any view. e.g.
+<forrest:hook name="export-link">
+ <forrest:contract name="content-xml-link"/>
+ <forrest:contract name="content-pdf-link"/>
+</forrest:hook>
+ can be called as <jx:import uri="cocoon://prepare.tiles.export-link"/>
+ when saved as
+ {project:resources}/templates/{project:theme}/export-link.vt.xml
+ or
+ {project:resources}/templates/export-link.vt.xml
+
+HEADSUP:
+<forrest:call-template name="export-link"/> is *not* working anymore!!!
+-->
+ <jx:import uri="cocoon://prepare.tiles.export-link"/>
+ <!-- FIXME: jxpath -->
+ <!-- Use this when jxpath bug is solved -->
+ <!--<jx:import uri="lm:tiles.export-link"/>-->
+
+ <forrest:hook name="content">
+ <forrest:contract name="content-title">
+ <forrest:properties contract="content-title">
+ <forrest:property name="content-title" nugget="get.title">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.title.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-abstract">
+ <forrest:properties contract="content-abstract">
+ <forrest:property name="content-abstract" nugget="get.abstract">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-minitoc">
+ <forrest:properties contract="content-minitoc">
+ <forrest:property name="content-minitoc-toc" nugget="get.toc">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
+ </forrest:property>
+ <forrest:property name="content-minitoc-conf" >
+ <toc max-depth="2"
+ min-sections="1" location="page"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-main">
+ <forrest:properties contract="content-main">
+ <forrest:property name="content-main" nugget="get.body">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.body.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ </forrest:hook>
+ </forrest:hook>
+ <forrest:hook name="footer">
+ <forrest:contract name="siteinfo-feedback">
+ <forrest:properties contract="siteinfo-feedback">
+ <forrest:property name="siteinfo-feedback">
+ <feedback to="webmaster@foo.com"
+ href="mailto:webmaster@foo.com?subject=Feedback " >
+ Send feedback about the website to:
+ </feedback>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="siteinfo-last-published"/>
+ </forrest:hook>
+ </forrest:view>
+</forrest:views>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/css/basic.css b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/basic.css
new file mode 100644
index 0000000..4955680
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/basic.css
@@ -0,0 +1,164 @@
+/*
+* Copyright 2005 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/*============HTML tags==========================*/
+body {
+ text-align:center;
+ font-family: verdana, helvetica, sans;
+ font-size: 8pt;
+}
+img {border:0;}
+hr {border:0px; height: 1px; background-color:#ddd;}
+
+/*============Container and branding=============*/
+#container {
+ width: 750px;
+ text-align:left;
+ margin: 0 auto 12px auto;
+}
+#branding {
+ padding: 0;
+ height: 75px;
+ max-height: 75px;
+ background: url(/themes/images/header-background.gif) transparent;
+ background-repeat: no-repeat;
+ position: relative;
+}/*
+#projectlogo {
+ height: 75px;
+ width: 0;
+ padding: 5px;
+ float: left;
+}
+#search {
+ padding: 8px;
+ float: right;
+ font-family: verdana, helvetica, sans;
+ font-size: 8pt;
+ font-weight: bold;
+ color: #ddddff;
+}
+#search input {
+ font-size: 8pt;
+ font-family: verdana, helvetica, sans;
+}*/
+#spacer {
+ clear:both;
+}
+
+/*============Sub-tabs===========================*/
+#nav-main-sub {
+ text-align: right;
+ margin-right: 20px;
+}
+
+/*============Main content=======================*/
+#content {
+ clear: none;
+ margin-left: 25%;
+ padding: 10px;
+ font-family: verdana, helvetica, sans;
+ font-size: 10pt;
+ max-width: 75%;
+}
+#content-pdf {
+ float: right;
+ text-decoration: none;
+}
+#content-pdf a {
+ text-decoration: none;
+}
+#content h1 {
+ font-weight: bold;
+ font-size: 16pt;
+ letter-spacing: 2px;
+ padding: 0;
+ margin: 0;
+ display: block;
+ border-bottom: 2px solid #ddd;
+ color: #9AB;
+}
+#content h2 {
+ font-weight: bold;
+ font-size: 11pt;
+ letter-spacing: 1.5px;
+ padding: 0;
+ margin: 0;
+ display: block;
+ border-bottom: 2px solid #ddd;
+ color: #567;
+ font-family: "Trebuchet MS", helvetica, sans
+}
+#content h3 {
+ font-weight: bold;
+ font-size: 10pt;
+ letter-spacing: 1px;
+ padding: 0;
+ margin: 0;
+ display: block;
+ border-bottom: 2px solid #ddd;
+ color: #567;
+ font-family: verdana, helvetica, sans
+}
+
+#content a {
+ text-decoration:underline;
+ color: #567;
+}
+#content a:hover {
+ text-decoration:none;
+ color: #678;
+}
+
+/*============Labels, fixme etc.=================*/
+.frame {
+ border: solid black 1px;
+ margin: 1em 3em;
+}
+.frame .label {
+ background: #369;
+ color: white;
+ font-weight: bold;
+ padding: 5px 10px;
+}
+.frame .content {
+ padding: 5px 10px;
+ background: #F0F0FF;
+ color: black;
+ line-height: 170%;
+ font-size: 90%;
+}
+.warning .label {
+ background: #C00;
+ color: white;
+}
+.warning .content {
+ background: #FFF0F0;
+ color: black;
+}
+.fixme .label {
+ background: #C6C600;
+}
+
+/*============Footer=============================*/
+#siteinfo {
+ text-align: center;
+ clear: both;
+ padding: 5px;
+}
+#siteinfo p {
+ margin: 5px;
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/css/common.css b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/common.css
new file mode 100644
index 0000000..a29d1b1
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/common.css
@@ -0,0 +1,266 @@
+/*
+* Copyright 2005 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/************************************************************************
+ * Apache Forrest
+ * Skin: Minimalistic
+ * Author: Diwaker Gupta <diwakergupta AT gmail DOT com>
+ *
+ * Notes:
+ * =====
+ * The colors used have been picked to taste from the Ubuntu, KDE and
+ * GNOME color palettes.
+ * This skin uses relative positioning for the menu on the left, and the
+ * floating text for the alternative format icons on the right
+ ***********************************************************************/
+
+/* header */
+#header {
+ background: #ffffff;
+ border-bottom: thick solid #002b3d;
+}
+
+/* tabs */
+#nav-main-hook {
+ background: #ffffff;
+ text-align: center;
+ text-decoration: none;
+ font-weight: bold;
+ text-transform: lowercase;
+ font-family: sans-serif;
+ max-width: 90%;
+}
+
+#nav-main li {
+ display: inline;
+ padding: 0 1em 0 1em;
+}
+
+#nav-main li a {
+ font-weight: bold;
+}
+
+#nav-main li a:hover {
+ text-decoration: underline;
+}
+
+#nav-main li a.base-selected:before {
+ content: "[ ";
+}
+
+#nav-main li a.base-selected:after {
+ content: " ]";
+}
+
+/* menu */
+#leftbar {
+ width: 25%;
+ float: left;
+}
+
+#nav-section {
+ background: #eae8e3;
+ border: thin dashed #565248;
+ margin-bottom: 10px;
+}
+
+#nav-section ul {
+ list-style: none;
+ padding-left: 20px;
+}
+
+#nav-section li.pagegroup ul {
+ list-style: none;
+}
+
+.menupagetitle {
+ color: #013396;
+ display: inline;
+ font-weight: bold;
+}
+
+.menupagetitle:before {
+ content: "[ ";
+}
+
+.menupagetitle:after {
+ content: " ]";
+}
+
+/* The actual content */
+#content {
+ margin-left: 25%;
+ padding: 0 20px 0 20px;
+}
+
+/* footer */
+#footer {
+ text-align: center;
+ font-style: italic;
+ font-size: 10px;
+ background: #314e6c;
+ color: #ffffff;
+ padding: 2px;
+ clear: both;
+}
+
+#footer a {
+ color: #9db8d2;
+}
+
+/* note */
+.note {
+ border: 2px solid #013397;
+ background: #b3d3fd;
+ padding: 4px;
+ margin: 4px;
+}
+
+.note .label {
+ font-weight: bold;
+ text-decoration: underline;
+ font-size: large;
+ text-align: center;
+ padding-bottom: 2px;
+}
+
+/* warning */
+.warning {
+ border: 2px solid #980101;
+ background: #f44800;
+ padding: 4px;
+ margin: 4px;
+}
+
+.warning .label {
+ font-weight: bold;
+ text-decoration: underline;
+ font-size: large;
+ text-align: center;
+ padding-bottom: 2px;
+}
+
+/* link to alternate formats */
+#export-link {
+ text-align: right;
+ display: inline;
+ float: right;
+}
+
+/* search box */
+#search-input {
+ padding-left: 10px;
+ padding-top: 10px;
+ border-top: 4px groove #bab5ab;
+}
+
+#search-input form input {
+ width: 90%;
+}
+
+div.searchbox-input form input {
+ display: block;
+}
+
+/* header */
+#branding-tagline-name {
+ text-align: center;
+ font-size: 24px;
+ font-weight: bold;
+ text-transform: lowercase;
+ background: #314e6c;
+ color: #ffffff;
+ padding-top: 10px;
+}
+
+#branding-tagline-tagline {
+ text-align: center;
+ font-size: 16px;
+ font-weight: bold;
+ text-transform: lowercase;
+ background: #314e6c;
+ color: #ffffff;
+ padding-bottom: 10px;
+ border-bottom: thick solid #002b3d;
+}
+
+/* abstract */
+
+div.abstract {
+ font-style: italic;
+}
+
+/* container */
+#container {
+ max-width: 900px;
+ margin-left: auto;
+ margin-right: auto;
+ border: thin solid #565248;
+ background: #ffffff;
+}
+
+/* page */
+#page {
+ padding: 10px;
+}
+
+/* HTML elements */
+a {
+ color: #013397;
+ text-decoration: none;
+ font-weight: bold;
+}
+
+a:visited {
+ font-weight: normal;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+body {
+ color: #000000;
+ font-family: sans-serif;
+ background: #eae8e3;
+ font-size: 12px;
+}
+
+pre {
+ background: #eae8e3;
+ border: thin dashed #565248;
+ font-family: monospace;
+ padding-top: 10px;
+}
+
+img {
+ border: 0;
+}
+
+h1 {
+ font-size: 18px;
+ margin: 4px 0 4px 0;
+}
+
+h2 {
+ font-size: 16px;
+ margin: 4px 0 4px 0;
+}
+
+h3 {
+ font-size: 14px;
+ margin: 4px 0 4px 0
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/css/default.scale-dev.css b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/default.scale-dev.css
new file mode 100644
index 0000000..e0a91a5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/default.scale-dev.css
@@ -0,0 +1,298 @@
+/*
+* Copyright 2005 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/*============HTML tags==========================*/
+body {
+ text-align:center;
+ font-family: verdana, helvetica, sans;
+ font-size: 8pt;
+}
+img {border:0;}
+hr {border:0px; height: 1px; background-color:#ddd;}
+
+/*============Container and branding=============*/
+#container {
+ width: 750px;
+ text-align:left;
+ margin: 0 auto 12px auto;
+}
+#branding {
+ padding: 0;
+ height: 75px;
+ max-height: 75px;
+ background: url(themes/images/header-background.gif) transparent;
+ background-repeat: no-repeat;
+ position: relative;
+}
+#projectlogo {
+ height: 75px;
+ width: 0;
+ padding: 5px;
+ float: left;
+}
+#grouplogo {
+ height: 75px;
+ width: 150px;
+ margin-left: 25px;
+ padding: 5px;
+ float: left;
+}
+#search {
+ padding: 8px;
+ float: right;
+ font-family: verdana, helvetica, sans;
+ font-size: 8pt;
+ font-weight: bold;
+ color: #ddddff;
+}
+#search input {
+ font-size: 8pt;
+ font-family: verdana, helvetica, sans;
+}*/
+#spacer {
+ clear:both;
+}
+#searchbox {
+ padding: 8px;
+ float: right;
+ font-family: verdana, helvetica, sans;
+ font-size: 8pt;
+ font-weight: bold;
+ color: #ddddff;
+}
+#searchbox input {
+ font-size: 8pt;
+ font-family: verdana, helvetica, sans;
+}
+#branding ul {
+ position: absolute;
+ /*display: block;*/
+ bottom: 0px;
+ right: 0;
+ margin: 0;
+ padding: 0px 15px 0px 0px;
+ list-style: none;
+}
+#branding li {
+ float: right;
+ background: transparent url("themes/images/tr-on.gif") 100% 0% no-repeat;
+ padding: 0 6px 0 0;
+ margin: 0 1px 0 0;
+ border-bottom: 1px solid #515358;
+}
+#branding ul a {
+ float: left;
+ display: block;
+ padding: 4px 4px 4px 10px;
+ background: transparent url("themes/images/tl-on.gif") no-repeat;
+ font-weight: bold;
+ color: #fff;
+ text-decoration: none;
+}
+#branding ul li:hover a {background: url("themes/images/tl-off.gif") no-repeat;}
+#branding ul li:hover {background: url("themes/images/tr-off.gif") 100% 0% no-repeat;}
+
+#branding ul li.current a {background: url("themes/images/tl-off.gif") no-repeat;}
+#branding ul li.current {background: url("themes/images/tr-off.gif") 100% 0% no-repeat;}
+
+#nav {
+ width: 23%;
+ display: block;
+ margin: 10px 0 0 0;
+ padding: 0;
+ background: #E0E9E9;
+ float: left;
+}
+#nav ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ font-size: 0px;
+}
+#nav ul li a {
+ display: block;
+ width: auto;
+ padding: 6px 10px 6px 10px;
+ background: #EDF2F2;
+ text-decoration: none;
+ font-size: 10pt;
+ font-family: verdana, helvetica, sans;
+ color: #000066;
+ margin: 0;
+ border-left: 1px solid #fff;
+ border-bottom: 1px solid #ddd;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #ddd;
+}
+#nav ul .menupage {
+ display: block;
+ font-weight: bold;
+ width: auto;
+ padding: 6px 10px;
+ background: #D9E4E4;
+ text-decoration: none;
+ font-size: 10pt;
+ font-family: verdana, helvetica, sans;
+ color: #000066;
+ margin: 0;
+ border-left: 1px solid #fff;
+ border-bottom: 1px solid #ddd;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #ddd;
+}
+#nav ul li .menupage {
+ display: block;
+ font-weight: bold;
+ width: auto;
+ padding: 4px 8px 4px 20px;
+ background: #C9D4D4;
+ text-decoration: none;
+ font-size: 8pt;
+ font-family: verdana, helvetica, sans;
+ color: #000066;
+ margin: 0;
+ border-left: 1px solid #fff;
+ border-bottom: 1px solid #ddd;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #ddd;
+}
+#nav ul strong {
+ display: block;
+ width: auto;
+ padding: 6px 10px;
+ background: #E0E9E9;
+ text-decoration: none;
+ font-size: 10pt;
+ font-family: verdana, helvetica, sans;
+ color: #000066;
+ margin: 0;
+ border-left: 1px solid #fff;
+ border-bottom: 1px solid #ddd;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #ddd;
+}
+#nav ul li li a {
+ padding: 4px 8px 4px 20px;
+ margin: 0;
+ font-size: 8pt;
+}
+#nav ul li a:hover {
+ background: #E0E9E9;
+}
+
+/*============Sub-tabs===========================*/
+#nav-main-sub {
+ text-align: right;
+ margin-right: 20px;
+}
+
+/*============Main content=======================*/
+#content {
+ clear: none;
+ margin-left: 25%;
+ padding: 10px;
+ font-family: verdana, helvetica, sans;
+ font-size: 10pt;
+ max-width: 75%;
+}
+#content-pdf {
+ float: right;
+ text-decoration: none;
+}
+#content-pdf a {
+ text-decoration: none;
+}
+#content h1 {
+ font-weight: bold;
+ font-size: 16pt;
+ letter-spacing: 2px;
+ padding: 0;
+ margin: 0;
+ display: block;
+ border-bottom: 2px solid #ddd;
+ color: #9AB;
+}
+#content h2 {
+ font-weight: bold;
+ font-size: 11pt;
+ letter-spacing: 1.5px;
+ padding: 0;
+ margin: 0;
+ display: block;
+ border-bottom: 2px solid #ddd;
+ color: #567;
+ font-family: "Trebuchet MS", helvetica, sans
+}
+#content h3 {
+ font-weight: bold;
+ font-size: 10pt;
+ letter-spacing: 1px;
+ padding: 0;
+ margin: 0;
+ display: block;
+ border-bottom: 2px solid #ddd;
+ color: #567;
+ font-family: verdana, helvetica, sans
+}
+
+#content a {
+ text-decoration:underline;
+ color: #567;
+}
+#content a:hover {
+ text-decoration:none;
+ color: #678;
+}
+
+/*============Labels, fixme etc.=================*/
+.frame {
+ border: solid black 1px;
+ margin: 1em 3em;
+}
+.frame .label {
+ background: #369;
+ color: white;
+ font-weight: bold;
+ padding: 5px 10px;
+}
+.frame .content {
+ padding: 5px 10px;
+ background: #F0F0FF;
+ color: black;
+ line-height: 170%;
+ font-size: 90%;
+}
+.warning .label {
+ background: #C00;
+ color: white;
+}
+.warning .content {
+ background: #FFF0F0;
+ color: black;
+}
+.fixme .label {
+ background: #C6C600;
+}
+
+/*============Footer=============================*/
+#siteinfo {
+ text-align: center;
+ clear: both;
+ padding: 5px;
+}
+#siteinfo p {
+ margin: 5px;
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/css/new.css b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/new.css
new file mode 100644
index 0000000..8c70175
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/new.css
@@ -0,0 +1,138 @@
+/*
+* Copyright 2005 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/*============HTML tags==========================*/
+body {
+
+}
+img {}
+hr {}
+
+/*============Container and branding=============*/
+#container {
+
+}
+#branding {
+
+}
+#projectlogo {
+
+}
+#search {
+
+}
+#search input {
+
+}
+#branding ul {
+
+}
+#branding li {
+
+}
+#branding ul a {
+
+}
+#branding ul li:hover a {}
+#branding ul li:hover {}
+
+#branding ul li.current a {}
+#branding ul li.current {}
+
+#nav {
+
+}
+#nav ul {
+
+}
+#nav ul li a {
+
+}
+#nav ul .menupage {
+
+}
+#nav ul li .menupage {
+
+}
+#nav ul strong {
+
+}
+#nav ul li li a {
+
+}
+#nav ul li a:hover {
+
+}
+
+/*============Sub-tabs===========================*/
+#nav-main-sub {
+
+}
+
+/*============Main content=======================*/
+#content {
+
+}
+#content-pdf {
+
+}
+#content-pdf a {
+
+}
+#content h1 {
+
+}
+#content h2 {
+
+}
+#content h3 {
+
+}
+
+#content a {
+
+}
+#content a:hover {
+
+}
+
+/*============Labels, fixme etc.=================*/
+.frame {
+
+}
+.frame .label {
+
+}
+.frame .content {
+
+}
+.warning .label {
+
+}
+.warning .content {
+
+}
+.fixme .label {
+
+}
+
+/*============Footer=============================*/
+#siteinfo {
+
+}
+#siteinfo p {
+
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/css/profiling.css.xslt b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/profiling.css.xslt
new file mode 100644
index 0000000..9e13d3f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/css/profiling.css.xslt
@@ -0,0 +1,212 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:import href="../../common/css/forrest.css.xslt"/>
+
+ <!-- This is not used by Forrest but makes it possible to debug the
+ stylesheet in standalone editors -->
+ <xsl:output method = "text" omit-xml-declaration="yes" />
+
+<!-- ==================== main block colors ============================ -->
+
+<xsl:template match="color[@name='header']">
+#branding {
+background-color: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+
+<xsl:template match="color[@name='tab-selected']">
+#nav-main .current { background-color: <xsl:value-of select="@value"/>;}
+#nav-main .current a:link { color: <xsl:value-of select="@link"/>; }
+#nav-main .current a:visited { color: <xsl:value-of select="@vlink"/>; }
+#nav-main .current a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+
+<xsl:template match="color[@name='tab-unselected']">
+#nav-main li { background-color: <xsl:value-of select="@value"/> ;}
+#nav-main li a:link { color: <xsl:value-of select="@link"/>; }
+#nav-main li a:visited { color: <xsl:value-of select="@vlink"/>; }
+#nav-main li a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+
+<xsl:template match="color[@name='subtab-selected']">
+#branding-tagline { background-color: <xsl:value-of select="@value"/> ;}
+#branding-tagline a:link { color: <xsl:value-of select="@link"/>; }
+#branding-tagline a:visited { color: <xsl:value-of select="@vlink"/>; }
+#branding-tagline a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+
+<!--xsl:template match="color[@name='subtab-unselected']">
+.level2tabstrip { background-color: <xsl:value-of select="@value"/>;}
+.datenote { background-color: <xsl:value-of select="@value"/>;}
+.level2tabstrip.unselected a:link { color: <xsl:value-of select="@link"/>; }
+.level2tabstrip.unselected a:visited { color: <xsl:value-of select="@vlink"/>; }
+.level2tabstrip.unselected a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template-->
+<!--
+<xsl:template match="color[@name='heading']">
+.heading { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+-->
+<!--xsl:template match="color[@name='subheading']">
+.boxed { background-color: <xsl:value-of select="@value"/>;}
+.underlined_5 {border-bottom: solid 5px <xsl:value-of select="@value"/>;}
+.underlined_10 {border-bottom: solid 10px <xsl:value-of select="@value"/>;}
+table caption {
+ background-color: <xsl:value-of select="@value"/>;
+ color: <xsl:value-of select="@font"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='feedback']">
+#feedback {
+ color: <xsl:value-of select="@font"/>;
+ background: <xsl:value-of select="@value"/>;
+ text-align: <xsl:value-of select="@align"/>;
+}
+#feedback #feedbackto {
+ color: <xsl:value-of select="@font"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='published']">
+#published {
+ color: <xsl:value-of select="@font"/>;
+ background: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+
+<xsl:template match="color[@name='navstrip']">
+#main .breadtrail {
+ background: <xsl:value-of select="@value"/>;
+ color: <xsl:value-of select="@font"/>;
+}
+#main .breadtrail a:link { color: <xsl:value-of select="@link"/>; }
+#main .breadtrail a:visited { color: <xsl:value-of select="@vlink"/>; }
+#main .breadtrail a:hover { color: <xsl:value-of select="@hlink"/>; }
+#top .breadtrail {
+ background: <xsl:value-of select="@value"/>;
+ color: <xsl:value-of select="@font"/>;
+}
+#top .breadtrail a:link { color: <xsl:value-of select="@link"/>; }
+#top .breadtrail a:visited { color: <xsl:value-of select="@vlink"/>; }
+#top .breadtrail a:hover { color: <xsl:value-of select="@hlink"/>; }
+
+</xsl:template>
+
+<xsl:template match="color[@name='toolbox']">
+#menu .menupagetitle { background-color: <xsl:value-of select="@value"/>}
+</xsl:template>
+
+<xsl:template match="color[@name='border']">
+#menu { border-color: <xsl:value-of select="@value"/>;}
+#menu .menupagetitle { border-color: <xsl:value-of select="@value"/>;}
+#menu .menupageitemgroup { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template-->
+
+<xsl:template match="color[@name='menu']">
+#nav-section {
+background-color: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@font"/>;
+}
+#nav-section a:link { color: <xsl:value-of select="@link"/>;}
+#nav-section a:visited { color: <xsl:value-of select="@vlink"/>;}
+#nav-section a:hover {
+background-color: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@hlink"/>;
+}
+#nav-section .menupagetitle { color: <xsl:value-of select="@hlink"/>;}
+</xsl:template>
+<!--xsl:template match="color[@name='dialog']">
+#menu .menupageitemgroup {
+ background-color: <xsl:value-of select="@value"/>;
+}
+#menu .menupageitem {
+ color: <xsl:value-of select="@font"/>;
+}
+</xsl:template-->
+<xsl:template match="color[@name='menuheading']">
+.nav-section-title {
+ color: <xsl:value-of select="@font"/>;
+ background-color: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='menuarea']">
+#nav-section .currentmenuitemgroup {
+ color: <xsl:value-of select="@font"/>;
+ background-color: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='searchbox']">
+.search-input {
+ background-color: <xsl:value-of select="@value"/> ;
+ color: <xsl:value-of select="@font"/>;
+}
+</xsl:template>
+
+<xsl:template match="color[@name='body']">
+body { background-color: <xsl:value-of select="@value"/>;
+ color: <xsl:value-of select="@font"/>;}
+a:link { color:<xsl:value-of select="@link"/>}
+a:visited { color:<xsl:value-of select="@vlink"/>}
+a:hover { color:<xsl:value-of select="@hlink"/>}
+/*
+.menupage a:link { background-color: <xsl:value-of select="@value"/>;
+ color:<xsl:value-of select="@link"/>}
+.menupage a:visited { background-color: <xsl:value-of select="@value"/>;
+ color:<xsl:value-of select="@vlink"/>}
+.menupage a:hover { background-color: <xsl:value-of select="@value"/>;
+ color:<xsl:value-of select="@hlink"/>}
+*/
+</xsl:template>
+
+<xsl:template match="color[@name='footer']">
+#footer { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+
+<!-- ==================== other colors ============================ -->
+<!--xsl:template match="color[@name='highlight']">
+.highlight { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='fixme']">
+.fixme { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='note']">
+.note { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='warning']">
+.warning { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='code']">
+.code { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='table']">
+.ForrestTable { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='table-cell']">
+.ForrestTable td { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template-->
+
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/blank.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/blank.ft
new file mode 100644
index 0000000..bd9a14e
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/blank.ft
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="blank" type="nugget">
+
+ <!--NOTE:
+ When using the blank template as c'n p master just search and replace 'blank' by the {contract-name}!-->
+
+ <description>
+ {contract-name} will output {contract-funtion}. This is just a blank contract, it will output *nothing*.
+ </description>
+ <usage><![CDATA[<forrest:contract name="blank"/>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="blank" inputFormat="xsl" body="false" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!--
+ Add here the needed templates.
+ Remember to set the forrest:template @attributes!
+ -->
+ <!--
+ <xsl:template name="blank-head">
+ </xsl:template>
+ <xsl:template name="blank-body">
+ </xsl:template>
+ -->
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-breadcrumbs.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-breadcrumbs.ft
new file mode 100644
index 0000000..034df32
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-breadcrumbs.ft
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="branding-breadcrumbs"
+ type="nugget">
+ <description>
+ branding-breadcrumbs will output the breadcrumbs.
+ </description>
+ <usage><![CDATA[<forrest:contract name="branding-breadcrumbs">
+ <forrest:properties contract="branding-breadcrumbs">
+ <forrest:property name="branding-breadcrumbs">
+ <trail>
+ <link1 name="Apache Forrest" href="http://forrest.apache.org/"/>
+ <link2 name="Plugins" href="http://forrest.apache.org/docs/plugins/"/>
+ <link3 name="org.apache.forrest.plugin.output.themer" href="http://forrest.apache.org/docs/plugins/org.apache.forrest.plugin.output.themer/"/>
+ </trail>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="branding-breadcrumbs" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="branding-breadcrumbs-body">
+ <xsl:param name="branding-breadcrumbs"/>
+ <!--breadcrumbs org location-->
+<xsl:comment>+
+ |breadtrail
+ +</xsl:comment>
+ <div class="breadtrail">
+ <xsl:if
+ test="($branding-breadcrumbs/trail/link1/@name)and($branding-breadcrumbs/trail/link1/@name!='')">
+ <a href="{$branding-breadcrumbs/trail/link1/@href}">
+ <xsl:value-of select="$branding-breadcrumbs/trail/link1/@name"/>
+ </a>
+ </xsl:if>
+ <xsl:if
+ test="($branding-breadcrumbs/trail/link2/@name)and($branding-breadcrumbs/trail/link2/@name!='')">
+ > <a href="{$branding-breadcrumbs/trail/link2/@href}">
+ <xsl:value-of select="$branding-breadcrumbs/trail/link2/@name"/></a>
+ </xsl:if>
+ <xsl:if
+ test="($branding-breadcrumbs/trail/link3/@name)and($branding-breadcrumbs/trail/link3/@name!='')">
+ > <a href="{$branding-breadcrumbs/trail/link3/@href}">
+ <xsl:value-of select="$branding-breadcrumbs/trail/link3/@name"/></a>
+ </xsl:if>
+ <script type="text/javascript" language="JavaScript" src="{$root}themes/breadcrumbs.js"> </script>
+ </div>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-fontsize.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-fontsize.ft
new file mode 100644
index 0000000..daad637
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-fontsize.ft
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="branding-fontsize" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+ <description>
+ branding-fontsize lets you change the size of the font you are using in the site with a jscript.
+ </description>
+ <usage><![CDATA[<forrest:contract name="branding-fontsize"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="branding-fontsize" inputFormat="xsl" body="true" head="true">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="branding-fontsize-head">
+ <script type="text/javascript" language="javascript"
+ src="{$root}themes/fontsize.js"> </script>
+ </xsl:template>
+
+ <xsl:template name="branding-fontsize-body">
+ <script type="text/javascript">ndeSetTextSize();</script>
+ <i18n:text >Font size:</i18n:text>
+  <input type="button" onclick="ndeSetTextSize('reset'); return false;" title="Reset text" class="resetfont" value="Reset"/>
+  <input type="button" onclick="ndeSetTextSize('decr'); return false;" title="Shrink text" class="smallerfont" value="-a"/>
+  <input type="button" onclick="ndeSetTextSize('incr'); return false;" title="Enlarge text" class="biggerfont" value="+a"/>
+ </xsl:template>
+
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-logo.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-logo.ft
new file mode 100644
index 0000000..9b3a7d6
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-logo.ft
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="branding-logo" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ branding-logo will output the logo defined in the view.
+ </description>
+ <usage><![CDATA[<forrest:contract name="branding-logo">
+ <forrest:properties contract="branding-logo">
+ <forrest:property name="branding-logo-name">Apache Forrest</forrest:property>
+ <forrest:property name="branding-logo-description">Apache Forrest</forrest:property>
+ <forrest:property name="branding-logo-url">http://forrest.apache.org/</forrest:property>
+ <forrest:property name="branding-logo-logo">images/project-logo.gif</forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="branding-logo" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="branding-logo-body">
+ <xsl:param name="branding-logo-name"/>
+ <xsl:param name="branding-logo-description"/>
+ <xsl:param name="branding-logo-url"/>
+ <xsl:param name="branding-logo-logo"/>
+<xsl:comment>+
+ |start Logo
+ +</xsl:comment>
+ <xsl:call-template name="renderlogo">
+ <xsl:with-param name="name" select="normalize-space($branding-logo-name)"/>
+ <xsl:with-param name="url" select="normalize-space($branding-logo-url)"/>
+ <xsl:with-param name="logo" select="normalize-space($branding-logo-logo)"/>
+ <xsl:with-param name="root" select="$root"/>
+ <xsl:with-param name="description"
+ select="normalize-space($branding-logo-description)"/>
+ </xsl:call-template>
+<xsl:comment>+
+ |end group Logo
+ +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-tagline.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-tagline.ft
new file mode 100644
index 0000000..a78caa5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/branding-tagline.ft
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="branding-tagline" type="nugget">
+ <description>
+ branding-tagline will output the site name and tagline.
+ </description>
+ <usage><![CDATA[<forrest:contract name="branding-tagline">
+ <forrest:properties contract="branding-tagline">
+ <forrest:property name="branding-tagline-name">new seed</forrest:property>
+ <forrest:property name="branding-tagline-tagline">powered by
+ forrest:views</forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="branding-tagline" inputFormat="xsl" body="true" head="false" css="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="branding-tagline-body">
+ <xsl:param name="branding-tagline-name"/>
+ <xsl:param name="branding-tagline-tagline"/>
+ <div id="branding-tagline-name"><xsl:value-of select="$branding-tagline-name"/> </div>
+ <div id="branding-tagline-tagline"><xsl:value-of select="$branding-tagline-tagline"/></div>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-abstract.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-abstract.ft
new file mode 100644
index 0000000..a9be081
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-abstract.ft
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-abstract" type="nugget">
+ <description>
+ content-abstract will output the abstract of the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-abstract">
+ <forrest:properties contract="content-abstract">
+ <forrest:property name="content-abstract" nugget="get.body">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-abstract" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-abstract-body">
+ <xsl:param name="content-abstract"/>
+ <xsl:comment>+ |start content-abstract +</xsl:comment>
+ <xsl:copy-of
+ select="$content-abstract/div[@class='abstract']"/>
+ <xsl:comment>+ |end content-abstract +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-author.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-author.ft
new file mode 100644
index 0000000..cc213de
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-author.ft
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-author" type="nugget">
+ <description>
+ content-author will output the author of the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-author"/>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-author" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-author-body">
+ <xsl:comment>+
+ |start content-author
+ +</xsl:comment>
+ <xsl:copy-of select="div[@id='content']/div[@class='author']"/>
+<xsl:comment>+
+ |end content-author
+ +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-authors.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-authors.ft
new file mode 100644
index 0000000..30e8e63
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-authors.ft
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-authors" type="nugget">
+ <description>
+ content-authors will output the authors of the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-authors">
+ <forrest:properties contract="content-authors">
+ <forrest:property name="content-authors" nugget="get.authors">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.authors.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-authors" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-authors-body">
+ <xsl:param name="content-authors"/>
+ <xsl:comment>+ |start content-authors +</xsl:comment>
+ <!--<xsl:copy-of
+ select="$content-authors/div[@id='content-authors']"/>-->
+ <xsl:call-template name="content-author-processing">
+ <xsl:with-param name="authors"
+ select="$content-authors/div[@id='content-authors']"/>
+ </xsl:call-template>
+ <xsl:comment>+ |end content-authors +</xsl:comment>
+ </xsl:template>
+ <xsl:template name="content-author-processing">
+ <xsl:param name="authors"/>
+ <xsl:for-each select="$authors/div[@class='author']">
+ <xsl:choose>
+ <xsl:when test="position()=1">by</xsl:when>
+ <xsl:otherwise>,</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <span class="name">
+ <xsl:value-of select="./div[@class='name']/text()"/>
+ </span>
+ </xsl:for-each>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-feeder.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-feeder.ft
new file mode 100644
index 0000000..583d854
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-feeder.ft
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:contract name="content-feeder" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-feeder will output the html information retrieved by the feeder plugin (needs to be installed!).
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-feeder">
+ <forrest:properties contract="content-feeder">
+ <forrest:property name="content-feeder" nugget="get.nugget.feeder">
+ <jx:import uri="/feeds/somefeed.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-feeder" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-feeder-body" >
+ <xsl:param name="content-feeder"/>
+ <xsl:apply-templates select="$content-feeder/document"/>
+ </xsl:template>
+
+ <xsl:template match="document">
+ <div id="content-feeder">
+ <xsl:apply-templates select="body/section"/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="section">
+ <div class="channelTitle">
+ <xsl:value-of select="title"/>
+ </div>
+ <div class="channelItems">
+ <xsl:apply-templates select="p[@class]"/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="link">
+ <a href="{@href}">...more</a>
+ </xsl:template>
+
+ <xsl:template match="p[@class]">
+ <div class="{@class}">
+ <xsl:apply-templates/>
+ </div>
+
+<!--
+ <xsl:variable name="parse">
+ <xsl:if test="$feedConfig/feed[@position]">
+ <xsl:value-of select="position()"/><xsl:value-of select="$feedConfig/feed/@position"/>
+ </xsl:if>
+ <div class="itemTitle"><xsl:value-of select="title" disable-output-escaping="yes"/></div>
+ <div class="itemLink"><a href="{link}">...more</a></div>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$feedConfig/feed[@maxItem]">
+ <xsl:if test="position()<=$feedConfig/feed/@maxItem">
+ <xsl:copy-of select="$parse"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$parse"/>
+ </xsl:otherwise>
+ </xsl:choose>-->
+ </xsl:template>
+
+ </xsl:stylesheet>
+
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-include-html.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-include-html.ft
new file mode 100644
index 0000000..bed201b
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-include-html.ft
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:contract name="content-include-html" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+
+ <description>
+ content-include-html retrieves the content from a Forrest generated HTML document and
+ includes the current document.
+ </description>
+
+ <usage>
+<![CDATA[<forrest:contract name="content-include-html">
+ <forrest:properties contract="content-include-html">
+ <forrest:property name="content-include-html" nugget="get.nugget.include.html">
+ <url>/path/to/a/document.html</url>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]>
+ </usage>
+
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html"
+ name="content-include-html"
+ inputFormat="xsl"
+ body="true"
+ head="false">
+
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template name="content-include-html-body" >
+ <xsl:param name="content-include-html"/>
+ <xsl:copy-of select="$content-include-html//div[@id='content']/*"/>
+ </xsl:template>
+
+ </xsl:stylesheet>
+
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-ls-contracts.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-ls-contracts.ft
new file mode 100644
index 0000000..1bd7617
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-ls-contracts.ft
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:contract name="content-ls-contracts" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-ls-contracts will output the contracts provided by the
+ themer plugin (the org.apache.forrest.plugin.input.viewHelper.xhtml.ls needs to be installed!).
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-ls-contracts">
+ <forrest:properties contract="content-ls-contracts">
+ <forrest:property name="content-ls-contracts"
+ nugget="get.nugget.ls.contracts">
+ <jx:import uri="cocoon://ls.contracts.xml"/>
+ </forrest:property>
+ <forrest:property name="content-ls-contracts-config" file="true"
+ description="false" usage="true" path="false"/>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-ls-contracts" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-ls-contracts-body" >
+ <xsl:param name="content-ls-contracts"/>
+ <xsl:param name="content-ls-contracts-config"/>
+ <div id="content-ls-contracts">
+ <xsl:apply-templates select="$content-ls-contracts/document">
+ <xsl:with-param name="content-ls-contracts-config" select="$content-ls-contracts-config"/>
+ </xsl:apply-templates>
+ </div>
+ </xsl:template>
+ <xsl:template match="document">
+ <xsl:param name="content-ls-contracts-config"/>
+ <xsl:if test="normalize-space(header/title)!=''">
+ <h1>
+ <xsl:value-of select="header/title"/>
+ </h1>
+ <xsl:apply-templates select="body/section">
+ <xsl:with-param name="content-ls-contracts-config" select="$content-ls-contracts-config"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="section">
+ <xsl:param name="content-ls-contracts-config"/>
+ <!-- count the number of section in the ancestor-or-self axis to compute
+ the title element name later on -->
+ <xsl:variable name="sectiondepth" select="count(ancestor-or-self::section)"/>
+ <!-- generate a title element, level 1 -> h3, level 2 -> h4 and so on... -->
+ <xsl:element name="{concat('h',$sectiondepth + 2)}">
+ <xsl:value-of select="title"/>
+ </xsl:element>
+
+ <xsl:apply-templates select="*[not(self::title)]">
+ <xsl:with-param name="content-ls-contracts-config" select="$content-ls-contracts-config"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="source">
+ <pre class="code">
+ <xsl:apply-templates/>
+ </pre>
+ </xsl:template>
+ <xsl:template match="p[@class='file']">
+ <xsl:param name="content-ls-contracts-config"/>
+ <xsl:if test="$content-ls-contracts-config[@file='true']">
+ <p class="{@class}"><xsl:apply-templates/></p>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="p[@class='description']">
+ <xsl:param name="content-ls-contracts-config"/>
+ <xsl:if test="$content-ls-contracts-config[@description='true']">
+ <p class="{@class}"><xsl:apply-templates/></p>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="p[@class='usage']">
+ <xsl:param name="content-ls-contracts-config"/>
+ <xsl:if test="$content-ls-contracts-config[@usage='true']">
+ <p class="{@class}"><xsl:apply-templates/></p>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="p[@class='realpath']">
+ <xsl:param name="content-ls-contracts-config"/>
+ <xsl:if test="$content-ls-contracts-config[@realpath='true']">
+ <p class="{@class}"><xsl:apply-templates/></p>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="p"/>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-main-lenya.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-main-lenya.ft
new file mode 100644
index 0000000..cac3bb4
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-main-lenya.ft
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-main-lenya" type="nugget">
+ <description>
+ content-main-lenya - Template will output the content-main-lenya.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-main-lenya">
+ <forrest:properties contract="content-main-lenya">
+ <forrest:property name="content-main-lenya"
+ nugget="get.nugget.lenya.content.main">
+ <url>lenya/test.html</url>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-main-lenya" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-main-lenya-body" >
+ <xsl:param name="content-main-lenya"/>
+ <xsl:comment>+
+ |start content-main-lenya
+ +</xsl:comment>
+ <xsl:copy-of select="$content-main-lenya//div[@id='body']/*"/>
+<xsl:comment>+
+ |end content-main-lenya
+ +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-main.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-main.ft
new file mode 100644
index 0000000..e233a21
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-main.ft
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-main" type="nugget">
+ <description>
+ content-main - Template will output the content-main.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-main">
+ <forrest:properties contract="content-main">
+ <forrest:property name="content-main" nugget="get.body">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.body.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-main" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-main-body" >
+ <xsl:param name="content-main"/>
+ <xsl:comment>+ |start content-main +</xsl:comment>
+ <xsl:copy-of
+ select="$content-main/div[@id='content']/div[@id='content-main']/*"/>
+ <xsl:comment>+ |end content-main +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-minitoc.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-minitoc.ft
new file mode 100644
index 0000000..a1d570e
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-minitoc.ft
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-minitoc" type="nugget">
+ <description>
+ content-minitoc - Configure the TOC, i.e. the Table of Contents.
+ @max-depth -
+ how many "section" levels need to be included in the
+ generated Table of Contents (TOC).
+ @min-sections -
+ Minimum required to create a TOC.
+ @location ("page","menu","page,menu", "none") -
+ Where to show the TOC.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-minitoc">
+ <forrest:properties contract="content-minitoc">
+ <forrest:property name="content-minitoc-toc" nugget="get.toc">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
+ </forrest:property>
+ <forrest:property name="content-minitoc-conf" max-depth="2" min-sections="1" location="page"/>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-minitoc" inputFormat="xsl" body="true"
+ head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!--FIXME: that need come from the content-main-->
+ <xsl:template name="content-minitoc-body"
+ match="div[@id='content']/div[@id='skinconf-toc-page']">
+ <xsl:param name="content-minitoc-toc"/>
+ <xsl:param name="content-minitoc-conf"/>
+ <xsl:comment>+ |start content-minitoc +</xsl:comment>
+ <xsl:if test="contains($content-minitoc-conf/toc/@location,'page')">
+ <xsl:if
+ test="count($content-minitoc-toc/tocitems/tocitem) >= $content-minitoc-conf/toc/@min-sections">
+ <div id="content-minitoc-area">
+ <xsl:call-template name="content-minitoc-processing">
+ <xsl:with-param name="tocroot"
+ select="$content-minitoc-toc/tocitems"/>
+ <xsl:with-param name="content-minitoc-conf"
+ select="$content-minitoc-conf"/>
+ </xsl:call-template>
+ </div>
+ </xsl:if>
+ </xsl:if>
+ <xsl:comment>+ |end minitoc +</xsl:comment>
+ </xsl:template>
+ <xsl:template name="content-minitoc-processing">
+ <xsl:param name="tocroot"/>
+ <xsl:param name="content-minitoc-conf"/>
+ <xsl:if
+ test="count($tocroot/tocitem) >= $content-minitoc-conf/toc/@min-sections">
+ <xsl:if test="contains($content-minitoc-conf/toc/@location,'page')">
+ <ul class="minitoc">
+ <xsl:for-each select="$tocroot/tocitem">
+ <li>
+ <a href="{@href}">
+ <xsl:value-of select="@title"/>
+ </a>
+ <xsl:if
+ test="@level<$content-minitoc-conf/toc/@max-depth+1">
+ <xsl:call-template name="content-minitoc-processing">
+ <xsl:with-param name="tocroot" select="."/>
+ <xsl:with-param name="content-minitoc-conf"
+ select="$content-minitoc-conf"/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-motd-page.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-motd-page.ft
new file mode 100644
index 0000000..fed7081
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-motd-page.ft
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-motd-page" type="nugget">
+ <description>
+ <p>Message of the day (MOTD). <br/> If the optional <motd> element is
+ used, then messages will be appended depending on the URI string pattern.
+ </p>
+ <p> motd-option : <br/>Each option will match a pattern and apply its text.
+ The "pattern" attribute specifies the pattern to be matched. This can be
+ a specific page, or a general pattern to match a set of pages, e.g.
+ everything in the "samples" directory. </p>
+ <p>motd-title : <br/>This text will be added in brackets after the
+ <html><title> and this can be empty. </p>
+ <p>motd-page : <br/>This text will be added in a panel on the face of the
+ page, with the "motd-page-url" being the hyperlink "More". </p>
+ <p>Values for the "location" attribute are: </p>
+ <ul>
+ <li>page : on the face of the page, e.g. in the spare space of </li>
+ <li>the toc alt : at the bottom of the left-hand navigation panel</li>
+ <li>both : both </li>
+ </ul>
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-motd-page">
+ <forrest:properties contract="content-motd-page">
+ <forrest:property name="content-motd-page">
+ <motd>
+ <motd-option pattern="samples/sample.html">
+ <motd-title>sample</motd-title>
+ <motd-page location="both">
+ This is an example of a Message of the day (MOTD).
+ </motd-page>
+ <motd-page-url>/samples/faq.html</motd-page-url>
+ </motd-option>
+ <motd-option pattern="samples/faq.html">
+ <motd-title></motd-title>
+ <motd-page location="both">
+ How to enable this MOTD is on this page.
+ </motd-page>
+ <motd-page-url>#motd</motd-page-url>
+ </motd-option>
+ </motd>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-motd-page" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-motd-page-body"
+ match="div[@id='content']/div[@id='skinconf-toc-page']">
+ <xsl:param name="content-motd-page"/>
+ <xsl:comment>+ |start content-motd-page +</xsl:comment>
+ <xsl:if test="$content-motd-page/motd">
+ <xsl:for-each select="$content-motd-page/motd/motd-option">
+ <xsl:if test="contains($path, @pattern)">
+ <div class="motd-area">
+ <xsl:value-of select="motd-page"/>
+ <xsl:if test="motd-page-url">
+ <xsl:text> (</xsl:text>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="motd-page-url"/>
+ </xsl:attribute>
+ <xsl:text>
+ <i18n:text >More</i18n:text>
+ </xsl:text>
+ </a>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ </div>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:comment>+ |end content-motd-page +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-pdf-link.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-pdf-link.ft
new file mode 100644
index 0000000..6cf4ec9
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-pdf-link.ft
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="content-pdf-link" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-pdf-link will output the PDF link with image to the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-pdf-link"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-pdf-link" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-pdf-link-body">
+ <a href="{$filename-noext}.pdf" class="format">
+ <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF - icon"/>
+ <span class="caption">PDF</span>
+ </a>
+ </xsl:template>
+
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-pod-link.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-pod-link.ft
new file mode 100644
index 0000000..9721cf1
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-pod-link.ft
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="content-pod-link" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-pod-link will output the POD link with image to the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-pod-link"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-pod-link" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-pod-link-body">
+ <a href="{$filename-noext}.pod" class="format">
+ <img class="skin" src="{$skin-img-dir}/poddoc.png" alt="POD - icon" />
+ <span class="caption">POD</span></a>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-source-xml-link.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-source-xml-link.ft
new file mode 100644
index 0000000..e5889b6
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-source-xml-link.ft
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+ <forrest:contract name="content-source-xml-link" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-source-xml-link will output the XML link with image to the
+ original source content of the document. Input plugins should provide
+ the ability to retrieve the original source XML by making a request for
+ *.source.xml, this contract provides a link to that file. If you want to
+ provide a link to the XDoc format of the content use the
+ content-xml-link template.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-source-xml-link"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-source-xml-link" inputFormat="xsl" body="true">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-source-xml-link-body">
+ <a href="{$filename-noext}.source.xml" class="format">
+ <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="Source XML - icon" />
+ <span class="caption">Source XML</span>
+ </a>
+ </xsl:template>
+
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-title.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-title.ft
new file mode 100644
index 0000000..54f5cdc
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-title.ft
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-title" type="nugget">
+ <description>
+ content-title - Template will output the title (first h1 of the content) and the sub-title (first h3 of the content).
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-title">
+ <forrest:properties contract="content-title">
+ <forrest:property name="content-title" nugget="get.body">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.title.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-title" inputFormat="xsl" body="true" head="true">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-title-head" >
+ <xsl:param name="content-title"/>
+ <xsl:comment>+ |start content-title +</xsl:comment>
+ <xsl:copy-of select="$content-title/*"/>
+ <xsl:comment>+ |end content-title +</xsl:comment>
+ </xsl:template>
+ <xsl:template name="content-title-body" >
+ <xsl:param name="content-title"/>
+ <xsl:comment>+ |start content-title +</xsl:comment>
+ <h1><xsl:value-of select="$content-title/*"/></h1>
+ <xsl:comment>+ |end content-title +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-txt-link.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-txt-link.ft
new file mode 100644
index 0000000..1f0795b
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-txt-link.ft
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="content-txt-link" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-txt-link will output the TXT link with image to the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-txt-link"/>]]></usage>
+
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-txt-link" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-txt-link-body">
+ <a href="{$filename-noext}.txt" class="format"> <img class="skin"
+ src="{$skin-img-dir}/txtdoc.png" alt="TXT - icon" /><span
+ class="caption">TXT</span></a>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-xml-link.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-xml-link.ft
new file mode 100644
index 0000000..eb407f5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/content-xml-link.ft
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+ <forrest:contract name="content-xml-link" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ content-xml-link will output an XML link with image to the content.
+ This link will retrieve the content as an XDoc. If you want to
+ retrieve the source use content-source-xml-link.ft.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-xml-link"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-xml-link" inputFormat="xsl" body="true">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-xml-link-body">
+ <a href="{$filename-noext}.xml" class="format">
+ <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="XML - icon" />
+ <span class="caption">XML</span>
+ </a>
+ </xsl:template>
+
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/export-link.vt.xml b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/export-link.vt.xml
new file mode 100644
index 0000000..a22d6a7
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/export-link.vt.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+
+<forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+ <forrest:hook name="export-link">
+ <forrest:contract name="content-source-xml-link"/>
+ <forrest:contract name="content-pdf-link"/>
+ <!-- You can include other templates from tiles as well -->
+ <!--<jx:import uri="cocoon://prepare.structurer-tiles.export-link-test"/>-->
+ <!-- FIXME: jxpath -->
+ <!-- Use this when jxpath bug is solved -->
+ <!--<jx:import uri="lm:tiles.export-link-test"/>-->
+ </forrest:hook>
+</forrest:template>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/genericMarkup.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/genericMarkup.ft
new file mode 100644
index 0000000..779d79c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/genericMarkup.ft
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="genericMarkup" type="nugget">
+ <description>
+ <p>genericMarkup - Template will output generic markup.</p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="genericMarkup">
+ <forrest:properties contract="genericMarkup">
+ <forrest:property name="genericMarkup">
+ <hr/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="genericMarkup" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="genericMarkup-body">
+ <xsl:param name="genericMarkup"/>
+ <xsl:copy-of select="$genericMarkup/*"/>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/helper-prototype-ajax.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/helper-prototype-ajax.ft
new file mode 100644
index 0000000..ba1c338
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/helper-prototype-ajax.ft
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="helper-prototype-ajax" type="nugget">
+
+ <description>
+ <p>
+ This contract gives basic ajax support with the help of the prototype.js.<br/>
+ The prototype.js offers a framework for javascript.<br/>
+ For details, see the Prototype web site:
+ <a href="http://prototype.conio.net/">http://prototype.conio.net/</a>.
+ </p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="helper-prototype-ajax"/>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="helper-prototype-ajax" inputFormat="xsl" body="false" head="true">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="helper-prototype-ajax-head">
+ <script type="text/javascript" src="{$root}themes/prototype.js"> </script>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-main-sub.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-main-sub.ft
new file mode 100644
index 0000000..817b26d
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-main-sub.ft
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="nav-main-sub" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ nav-main-sub will output the secondary navigation AKA level2.
+ </description>
+ <usage><![CDATA[<forrest:contract name="nav-main-sub">
+ <forrest:properties contract="nav-main-sub">
+ <forrest:property name="nav-main-sub" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="nav-main-sub" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="nav-main-sub-body">
+ <xsl:param name="nav-main-sub" select="'test'"/>
+ <xsl:copy-of select="$nav-main-sub/navigation/tab/div[@id='nav-main-sub']/*"/>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-main.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-main.ft
new file mode 100644
index 0000000..3037cf5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-main.ft
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="nav-main" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ nav-main will output the main or primary navigation AKA tabs.
+ </description>
+ <usage><![CDATA[<forrest:contract name="nav-main">
+ <forrest:properties contract="nav-main">
+ <forrest:property name="nav-main" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="nav-main" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="nav-main-body">
+ <xsl:param name="nav-main" select="'test'"/>
+ <div id="tabs">
+<xsl:comment>+
+ |start Tabs
+ +</xsl:comment>
+ <xsl:copy-of select="$nav-main/navigation/tab/ul[@id='nav-main']"/>
+<xsl:comment>+
+ |end Tabs
+ +</xsl:comment>
+ </div>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-section.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-section.ft
new file mode 100644
index 0000000..b19ce8d
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/nav-section.ft
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="nav-section" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ <p>
+ <strong>nav-section</strong> will output the navigation to pages within the current site section AKA menu.
+ </p>
+ <div class="note">
+ <div class="label">Minitoc inclusion</div>
+ <div class="content">
+ <p><code><toc></code> argument can be used to specify the minitoc depth.<br/>
+ This argument is facultative and no minitoc will be displayed if it is omitted.
+ </p>
+ </div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="nav-section">
+ <forrest:properties contract="nav-section">
+ <forrest:property name="nav-section" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ <forrest:property name="nav-section-toc" nugget="get.toc">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
+ </forrest:property>
+ [<forrest:property name="toc" max-depth="2"/>]
+ [<forrest:property name="expanding">false</forrest:property>]
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="nav-section" inputFormat="xsl" body="true" head="true">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="nav-section-head">
+ <xsl:param name="expanding" select="'true'"/>
+ <xsl:if test="$expanding = 'true'">
+ <script type="text/javascript" language="javascript"
+ src="{$root}themes/menu.js"> </script>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="nav-section-body">
+ <xsl:param name="nav-section" select="'test'"/>
+ <xsl:param name="nav-section-toc" select="'test'"/>
+ <xsl:param name="toc" select="'noToc'"/>
+<xsl:comment>+
+ |start menu
+ +</xsl:comment>
+ <xsl:variable name="max-depth">
+ <xsl:choose>
+ <xsl:when test="$toc = 'noToc'">0</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$toc/@max-depth"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$nav-section/navigation/menu/div[@id='menu']/ul/li">
+ <xsl:call-template name="menu">
+ <xsl:with-param name="root" select="$nav-section/navigation/menu"/>
+ <xsl:with-param name="nav-section-toc" select="$nav-section-toc"/>
+ <xsl:with-param name="max-depth" select="$max-depth"/>
+ </xsl:call-template>
+ </xsl:if>
+<xsl:comment>+
+ |end menu
+ +</xsl:comment>
+ </xsl:template>
+ <xsl:template name="menu">
+ <xsl:param name="root" value="'test'"/>
+ <xsl:param name="nav-section-toc" value="'test'"/>
+ <xsl:param name="max-depth" value="0"/>
+<xsl:comment>+
+ |start Menu
+ +</xsl:comment>
+ <div id="nav-section">
+ <ul>
+<!--menu - inner-->
+ <xsl:for-each select = "$root/div[@id='menu']/ul/li">
+ <xsl:call-template name = "innermenuli" >
+ <xsl:with-param name="id" select="concat('1.', position())"/>
+ <xsl:with-param name="nav-section-toc" select="$nav-section-toc"/>
+ <xsl:with-param name="max-depth" select="$max-depth"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </ul>
+ </div>
+ </xsl:template>
+
+ <xsl:template name="innermenuli">
+ <xsl:param name="id"/>
+ <xsl:param name="nav-section-toc"/>
+ <xsl:param name="max-depth"/>
+ <xsl:variable name="tagid">
+ <xsl:choose>
+ <xsl:when test="descendant-or-self::node()/li/div/@class='current'"><xsl:value-of select="concat('menu_selected_',$id)"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="concat('menu_',concat(font,$id))"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="selected">
+ <xsl:choose>
+ <xsl:when test="descendant-or-self::node()/li/div/@class='current'">selected</xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <li class="pagegroup{$selected}" id="{$tagid}Title"><span onclick="SwitchMenu('{$tagid}')"><xsl:value-of select="h1"/></span>
+ <ul class="{$selected}menuitemgroup" id="{$tagid}">
+ <xsl:for-each select= "ul/li">
+
+ <xsl:choose>
+ <xsl:when test="a">
+ <li class="menuitem"><a href="{a/@href}" title="{a/@title}"><xsl:value-of select="a" /></a></li>
+ </xsl:when>
+ <xsl:when test="div/@class='current'">
+ <li class="menupage">
+ <div class="menupagetitle"><xsl:value-of select="div" /></div>
+ <xsl:if test="$max-depth>0">
+ <ul>
+ <li class="menupageitemgroup">
+ <xsl:for-each select = "$nav-section-toc//tocitems/tocitem">
+ <div class="menupageitem">
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space(@title))>15">
+ <a href="{@href}" title="{normalize-space(@title)}"><xsl:value-of
+ select="substring(@title,0,20)" />...</a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@href}" title="{normalize-space(@title)}">
+ <xsl:value-of select="@title" />
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:for-each>
+ </li>
+ </ul>
+ </xsl:if>
+ </li>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name = "innermenuli">
+ <xsl:with-param name="id" select="concat($id, '.', position())"/>
+ <xsl:with-param name="nav-section-toc" select="$nav-section-toc"/>
+ <xsl:with-param name="max-depth" select="$max-depth"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/noFt.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/noFt.ft
new file mode 100644
index 0000000..69212b9
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/noFt.ft
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="noFt" type="nugget">
+ <description>
+ <p>Error 440<br/> Template not found. This functions is a fallback
+ when no ft is found. This is just a dummy, it will output *nothing*.</p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="doNotUseJustDummy"/>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="noFt" inputFormat="xsl" body="true" head="true"
+ css="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="noFt-head"> Error 440 - Template not found.
+ </xsl:template>
+ <xsl:template name="noFt-body"> Error 440 - Template not found.
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/search-input.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/search-input.ft
new file mode 100644
index 0000000..5b70416
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/search-input.ft
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="search-input" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ <p>search-input will output the default search form.</p>
+ <p>To enable lucene search add provider="lucene" (default is google).
+ @domain will enable sitesearch for the specific domain with google. In
+ other words google will search the @domain for the query string.</p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="search-input">
+ <forrest:properties contract="search-input">
+ <forrest:property name="search-lucene">lucene-search.html</forrest:property>
+ <forrest:property name="search-input">
+ <search name="MyProject" domain="mydomain" provider="google"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="search-input" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!--FIXME: IMO each search provider should provide a form. This form should be refactored into
+ a meta-search from-->
+ <xsl:template name="search-input-body">
+ <xsl:param name="search-lucene" select="'lucene-search.html'"/>
+ <xsl:param name="search-input"/>
+<xsl:comment>+
+ |start Search
+ +</xsl:comment>
+ <div class="search-input">
+ <xsl:choose>
+ <xsl:when test="$search-input/search/@provider = 'lucene'">
+ <!-- Lucene search -->
+ <form method="get" action="{$root}{$search-lucene}">
+ <div id="search-field"> <input type="text" id="query"
+ name="queryString" size="25"
+ value="Search the site with {$search-input/search/@provider}:"
+ onFocus="getBlank (this, 'Search the site with {$search-input/search/@provider}:');"/>
+  </div>
+ <div id="search-submit">
+ <input type="submit" value="Search" name="Search" i18n:attr="value"/>
+ </div>
+ </form>
+ </xsl:when>
+ <xsl:otherwise>
+ <form method="get" action="http://www.google.com/search">
+ <div id="search-hidden">
+ <input type="hidden" name="sitesearch"
+ value="{$search-input/search/@domain}"/>
+ </div>
+ <div id="search-field">
+ <input type="text" id="query" name="q" size="25"/>
+ </div>
+ <div id="search-submit">
+ <input type="submit" value="Search" name="Search" i18n:attr="value"/>
+ </div>
+ </form>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+<xsl:comment>+
+ |end search
+ +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-compliance-links.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-compliance-links.ft
new file mode 100644
index 0000000..bf06202
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-compliance-links.ft
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-compliance-links" type="nugget">
+ <description>
+ Display valid XHTML and CSS compliance links
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-compliance-links"/>]]></usage>
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-compliance-links" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-compliance-links-body">
+ <div id="siteinfo-compliance-links">
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88" />
+ </a>
+ <a href="http://jigsaw.w3.org/css-validator/check/referer">
+ <img style="border:0;width:88px;height:31px"
+ src="http://jigsaw.w3.org/css-validator/images/vcss"
+ alt="Valid CSS!"/>
+ </a>
+ </div>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-copyright.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-copyright.ft
new file mode 100644
index 0000000..b30a45c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-copyright.ft
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-copyright" type="nugget">
+ <description>
+ <p><strong>siteinfo-copyright</strong> <br/>The following properties are
+ used to construct a copyright statement.</p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-copyright">
+ <forrest:properties contract="siteinfo-copyright">
+ <forrest:property name="siteinfo-copyright">
+ <copyright>
+ <year [inception="[true|false]"]>2005</year>
+ <vendor>The Acme Software Foundation.</vendor>
+ [<copyright-link>http://...</copyright-link>]
+ [<msg>All rights reserved.</msg>]
+ </copyright>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0" format="html"
+ name="siteinfo-copyright" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:java="http://xml.apache.org/xslt/java"
+ exclude-result-prefixes="java">
+ <xsl:template name="siteinfo-copyright-body">
+ <xsl:param name="siteinfo-copyright"/>
+ Copyright ©
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$siteinfo-copyright/copyright/year"/>
+ <xsl:call-template name="current-year">
+ <xsl:with-param name="copyrightyear" select="$siteinfo-copyright/copyright/year"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ <xsl:choose>
+ <xsl:when test="$siteinfo-copyright/copyright/copyright-link">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="$siteinfo-copyright/copyright/copyright-link"/>
+ </xsl:attribute>
+ <xsl:value-of select="$siteinfo-copyright/copyright/vendor"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$siteinfo-copyright/copyright/vendor"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$siteinfo-copyright/copyright/msg"/>
+ </xsl:template>
+
+ <xsl:template name="current-year">
+ <!-- Displays the current year after the inception year (in the copyright i.e: 2002-2005)
+ - the copyright year (2005 by default) can be indicated in the copyrightyear parameter,
+ - the year format (yyyy by default) can be indicated in the dateformat parameter,
+ - the dates separator (- by default) can be indicated in the dateseparator parameter.
+ For instance the following call will format the year on 2 digits and separates the dates
+ with /
+ (copyright 02/05)
+ <xsl:call-template name="current-year">
+ <xsl:with-param name="copyrightyear" select="'02'"/>
+ <xsl:with-param name="dateformat" select="'yy'"/>
+ <xsl:with-param name="dateseparator" select="'/'"/>
+ </xsl:call-template>
+ Warning, to enable inception year, inception attribute must be set to "true" in copyright/year/@inception
+ -->
+ <xsl:param name="copyrightyear">2005</xsl:param>
+ <xsl:param name="dateformat">yyyy</xsl:param>
+ <xsl:param name="dateseparator">-</xsl:param>
+ <xsl:if test="$copyrightyear[@inception = 'true']">
+ <xsl:variable name="tz" select='java:java.util.SimpleTimeZone.new(0,"GMT+00:00")' />
+ <xsl:variable name="formatter" select="java:java.text.SimpleDateFormat.new($dateformat)"/>
+ <xsl:variable name="settz" select="java:setTimeZone($formatter, $tz)" />
+ <xsl:variable name="date" select="java:java.util.Date.new()"/>
+ <xsl:variable name="year" select="java:format($formatter, $date)"/>
+
+ <xsl:if test="$copyrightyear != $year">
+ <xsl:value-of select="$dateseparator"/><xsl:value-of select="$year"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-credits.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-credits.ft
new file mode 100644
index 0000000..b933e40
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-credits.ft
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+<forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-credits" type="nugget">
+ <description>
+ <p> Output the credits.<br/>Credits are typically rendered as a set of
+ small clickable images in the page footer. </p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-credits">
+ <forrest:properties contract="siteinfo-credits">
+ <forrest:property name="siteinfo-credits">
+ <credits>
+ <credit>
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ <image>themes/images/built-with-forrest-button.png</image>
+ <width>88</width>
+ <height>31</height>
+ </credit>
+ </credits>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-credits" inputFormat="xsl" body="true"
+ head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-credits-body">
+ <xsl:param name="siteinfo-credits"/>
+ <xsl:if test="$siteinfo-credits/credits">
+ <div id="credits">
+ <xsl:for-each
+ select="$siteinfo-credits/credits/credit[not(@role='pdf')]">
+ <div class="credit">
+ <xsl:call-template name="renderlogo">
+ <xsl:with-param name="name" select="name"/>
+ <xsl:with-param name="url" select="url"/>
+ <xsl:with-param name="logo" select="image"/>
+ <xsl:with-param name="root" select="$root"/>
+ <xsl:with-param name="width" select="width"/>
+ <xsl:with-param name="height" select="height"/>
+ </xsl:call-template>
+ </div>
+ </xsl:for-each>
+ </div>
+ </xsl:if>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-current-time.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-current-time.ft
new file mode 100644
index 0000000..8fb4d28
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-current-time.ft
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-current-time"
+ type="nugget">
+ <description>
+ siteinfo-current-time will output the current time and date with the help of jscript.
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-current-time"/>]]></usage>
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-current-time" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-current-time-body">
+ <script type="text/javascript">document.write("<i18n:text >Today:</i18n:text> " + new Date());</script>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-feedback-dyn.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-feedback-dyn.ft
new file mode 100644
index 0000000..7e1206a
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-feedback-dyn.ft
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:contract name="siteinfo-feedback-dyn" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ This function will output the html siteinfo-feedback-dyn information.
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-feedback-dyn">
+ <forrest:properties contract="siteinfo-feedback-dyn">
+ <forrest:property name="siteinfo-feedback-dyn-config" to="webmaster@foo.com"
+ href="mailto:webmaster@foo.com?subject=Feedback "> Send feedback
+ about the website to: </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-feedback-dyn" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template name="siteinfo-feedback-dyn-body">
+ <xsl:param name="siteinfo-feedback-dyn-config"/>
+ <xsl:value-of select="$siteinfo-feedback-dyn-config"/>
+ <xsl:choose>
+ <xsl:when test="$siteinfo-feedback-dyn-config[@href] and $siteinfo-feedback-dyn-config[@href!='']">
+ <a id="feedbackto">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$siteinfo-feedback-dyn-config/@href"/>
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ <xsl:value-of select="$siteinfo-feedback-dyn-config/@to"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$siteinfo-feedback-dyn-config/@to"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-feedback.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-feedback.ft
new file mode 100644
index 0000000..9d80792
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-feedback.ft
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:contract name="siteinfo-feedback" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ <p>The feedback element will be used to construct a
+ feedback link in the page appending: <a href="@href">{@to}</a> </p>
+ <div class="note">
+ <div class="label">Beware the link rewritting !</div>
+ <div class="content">
+ <p>Forrest recognise links or e-mail address in the text of the site and automatically converts them into real links or mailto.<br/>
+ if the <em>to</em> attribute is of the following form : <code>\xxx.yyy@zzz.www</code> it is recognised as a mailto link and will be converted too.<br/>
+ </p>
+ <p>To avoid this, you can <em>escape</em> the conversion by prefixing the email adress by the '\' character : <strong>\</strong><code>\xxx.yyy@zzz.www</code> will not be converted.<br/>
+ (Note that none of the previous examples are rewritten because we used the '\' character in the source !).</p>
+ </div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-feedback">
+ <forrest:properties contract="siteinfo-feedback">
+ <forrest:property name="siteinfo-feedback">
+ <feedback to="\webmaster@foo.com"
+ href="\mailto:webmaster@foo.com?subject=Feedback " >
+ Send feedback about the website to:
+ </feedback>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-feedback" inputFormat="xsl" body="true"
+ head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-feedback-body">
+ <xsl:param name="siteinfo-feedback"/>
+ <div id="siteinfo-feedback">
+ <xsl:value-of select="$siteinfo-feedback/feedback"/>
+ <xsl:choose>
+ <xsl:when
+ test="$siteinfo-feedback/feedback/@href and not($siteinfo-feedback/feedback/@href='')">
+ <a id="feedbackto">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$siteinfo-feedback/feedback/@href"/>
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ <xsl:value-of select="$siteinfo-feedback/feedback/@to"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$siteinfo-feedback/feedback/@to"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-last-published-net.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-last-published-net.ft
new file mode 100644
index 0000000..a1db693
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-last-published-net.ft
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-last-published-net" type="nugget">
+ <description>
+ <p> siteinfo-last-published-net<br/> will output the last published date of
+ the site with the help of a timeserver.</p>
+ <div class="warning">
+ <div class="label">Warning</div>
+ <div class="content">You need to be able to reach
+ http://xobjex.com/service/date.xsl!!! If you are not, it will crash
+ views.</div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-last-published-net"/>]]>
+ </usage>
+ <forrest:template xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0" format="html"
+ name="siteinfo-last-published-net" inputFormat="xsl" body="true"
+ head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-last-published-net-body"> <xsl:variable
+ name="date"
+ select="document('http://xobjex.com/service/date.xsl')/date"/>
+ <xsl:variable name="dt" select="$date/utc/@rfc-822"/> <i18n:text >Last
+ Published:</i18n:text>  <xsl:value-of select="$dt"/>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-last-published.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-last-published.ft
new file mode 100644
index 0000000..c8b284e
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-last-published.ft
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-last-published" type="nugget">
+ <description>
+ siteinfo-last-published will output the last published date of the site with the help of jscript.
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-last-published"/>]]></usage>
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-last-published" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-last-published-body">
+ <script type="text/javascript">document.write("<i18n:text >Last Published:</i18n:text> " + document.lastModified);</script>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta-icon.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta-icon.ft
new file mode 100644
index 0000000..ea3235f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta-icon.ft
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-meta-icon"
+ type="nugget">
+ <description>
+ <p><strong>siteinfo-meta-icon</strong> <br/>will output the html
+ additional shortcut icon in head element. This icon is generally
+ displayed by browser at the beginning of the URL. </p>
+ <p>This icon is directly searched in the <code>xdoc</code> directory.</p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-meta-icon">
+ <forrest:properties contract="siteinfo-meta-icon">
+ <forrest:property name="siteinfo-meta-icon">
+ <favicon-url>favico.ico</favicon-url>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-meta-icon" inputFormat="xsl" body="false" head="true">
+ <xsl:stylesheet version="1.1"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-meta-icon-head">
+ <xsl:param name="siteinfo-meta-icon"/>
+<!--+
+ |favicon
+ +-->
+ <xsl:if test="$siteinfo-meta-icon/favicon-url">
+ <link rel="shortcut icon">
+ <xsl:attribute name="href">
+ <xsl:value-of
+ select="concat($root,$siteinfo-meta-icon/favicon-url)"/>
+ </xsl:attribute>
+ </link>
+ </xsl:if>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template >
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta-navigation.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta-navigation.ft
new file mode 100644
index 0000000..be67cde
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta-navigation.ft
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="siteinfo-meta-navigation" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ <p>
+ <strong>siteinfo-meta-navigation</strong> will output the html additional navigation targets in head element.
+ Implemented forrest 0.8/common. </p>
+ <div class="note">
+ <div class="label">And why ?</div>
+ <div class="content">
+ <p>This contract insert <code><link></code> HTML elements defined by <a href="http://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-links" class="fork">W3C</a>
+ which can be interpreted by browsers to navigate between page.<br/>
+ At the moment, the contract implements NEXT, PREVIOUS, LAST, FIRST, Index and CONTENT pages.
+ </p>
+ </div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-meta-navigation">
+ <forrest:properties contract="nav-section">
+ <forrest:property name="nav-section" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-meta-navigation" inputFormat="xsl"
+ body="false" head="true">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- ********************************** -->
+ <!-- Creates navigation links in header -->
+ <!-- ********************************** -->
+ <xsl:template name="siteinfo-meta-navigation-head">
+ <xsl:param name="nav-main" select="'test'"/>
+
+ <!-- Index and Table of Contents -->
+ <xsl:call-template name="navigation-link-index-content"/>
+
+ <!-- NEXT, PREVIOUS... -->
+ <xsl:for-each select="$nav-main/navigation/menu/div[@id='menu']//div[@class='current']">
+ <!-- NEXT -->
+ <xsl:if test="ancestor::node()/following-sibling::*[1]//a">
+ <link rel="NEXT"
+ href="{ancestor::node()/following-sibling::*[1]//a/@href}"
+ title="{ancestor::node()/following-sibling::*[1]//a}">
+ </link>
+ </xsl:if>
+ <!-- PREVIOUS -->
+ <xsl:for-each
+ select="ancestor::node()/preceding-sibling::*[1]//a[not( starts-with( @class, 'base' ) )]">
+ <xsl:if test="position()=last()">
+ <link rel="PREVIOUS" href="{./@href}">
+ <xsl:attribute name="title">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </link>
+ </xsl:if>
+ </xsl:for-each>
+ <!-- LAST -->
+ <xsl:if test="parent::node()/following-sibling::*[last()]/a">
+ <link rel="LAST"
+ href="{parent::node()/following-sibling::*[last()]/a/@href}">
+ <xsl:attribute name="title">
+ <xsl:value-of
+ select="parent::node()/following-sibling::*[last()]/a" />
+ </xsl:attribute>
+ </link>
+ </xsl:if>
+ <!-- FIRST -->
+ <xsl:if test="parent::node()/preceding-sibling::*[last()]/a">
+ <link rel="FIRST"
+ href="{parent::node()/preceding-sibling::*[last()]/a/@href}">
+ <xsl:attribute name="title">
+ <xsl:value-of
+ select="parent::node()/preceding-sibling::*[last()]/a"/>
+ </xsl:attribute>
+ </link>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- extraction of the Index and the table of content in order to, possibly, overide them in skins... -->
+ <xsl:template name="navigation-link-index-content">
+ <!-- Index ... -->
+ <link rel="Index" href="{$root}index.html">
+ <xsl:attribute name="title">Index...</xsl:attribute>
+ </link>
+ <!-- Site map ... -->
+ <link rel="CONTENTS" href="{$root}linkmap.html">
+ <xsl:attribute name="title">Site map...</xsl:attribute>
+ </link>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta.ft b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta.ft
new file mode 100644
index 0000000..c84802c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/html/siteinfo-meta.ft
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="siteinfo-meta" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ <p>This functions will output the html meta information.</p>
+ <div class="note">
+ <div class="label">Note</div>
+ <div class="content">Implemented forrest version/skin name.</div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-meta">
+ <forrest:properties contract="siteinfo-meta">
+ <forrest:property name="siteinfo-meta" nugget="get.build.info">
+ <url>build-info</url>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-meta" inputFormat="xsl" body="false" head="true">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-meta-head">
+ <xsl:param name="siteinfo-meta" select="'test'"/>
+ <meta name="Generator" content="Apache Forrest"/>
+ <meta name="Forrest-version">
+ <xsl:attribute name="content">
+ <xsl:value-of select="$siteinfo-meta/info/forrest-version"/>
+ </xsl:attribute>
+ </meta>
+ <meta name="Forrest-skin-name">
+ <xsl:attribute name="content">
+ <xsl:value-of select="$siteinfo-meta/info/project-skin"/>
+ </xsl:attribute>
+ </meta>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/README.txt b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/README.txt
new file mode 100644
index 0000000..e0932f4
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/README.txt
@@ -0,0 +1 @@
+The images in this directory are used if the current skin lacks them.
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/add.jpg b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/add.jpg
new file mode 100644
index 0000000..06831ee
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/add.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/built-with-forrest-button.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/built-with-forrest-button.png
new file mode 100644
index 0000000..4a787ab
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/built-with-forrest-button.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/corner-imports.svg.xslt b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/corner-imports.svg.xslt
new file mode 100644
index 0000000..3c335b4
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/corner-imports.svg.xslt
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="orientation-tb"/>
+ <xsl:param name="orientation-lr"/>
+ <xsl:param name="size"/>
+ <xsl:param name="bg-color-name"/>
+ <xsl:param name="stroke-color-name"/>
+ <xsl:param name="fg-color-name"/>
+
+ <!-- if not all colors are present, don't even try to render the corners -->
+ <xsl:variable name="isize"><xsl:choose>
+ <xsl:when test="$bg-color-name and $stroke-color-name and $fg-color-name"><xsl:value-of select="$size"/></xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose></xsl:variable>
+ <xsl:variable name="smallersize" select="number($isize)-1"/>
+ <xsl:variable name="biggersize" select="number($isize)+1"/>
+ <xsl:variable name="bg"><xsl:if test="skinconfig/colors/color[@name=$bg-color-name]">fill:<xsl:value-of select="skinconfig/colors/color[@name=$bg-color-name]/@value"/>;</xsl:if></xsl:variable>
+ <xsl:variable name="fill"><xsl:if test="skinconfig/colors/color[@name=$stroke-color-name]">fill:<xsl:value-of select="skinconfig/colors/color[@name=$stroke-color-name]/@value"/>;</xsl:if></xsl:variable>
+ <xsl:variable name="stroke"><xsl:if test="skinconfig/colors/color[@name=$fg-color-name]">stroke:<xsl:value-of select="skinconfig/colors/color[@name=$fg-color-name]/@value"/>;</xsl:if></xsl:variable>
+
+ <xsl:template match="skinconfig">
+
+
+
+<svg width="{$isize}" height="{$isize}">
+ <!-- background-->
+ <rect x="-1" y="-1" width="{$biggersize}" height="{$biggersize}" style="{$bg}stroke-width:0"/>
+<!-- 0,0 0,-4 4,0 4,-4-->
+
+ <xsl:variable name="flip-tb-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-lr-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-tb-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="flip-lr-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- flip transform -->
+ <g transform="scale({$flip-lr-scale},{$flip-tb-scale}) translate({$flip-lr-translate}, {$flip-tb-translate})">
+ <xsl:call-template name="figure" />
+ </g>
+</svg>
+</xsl:template>
+
+
+ <xsl:template name="figure">
+ <!-- Just change shape here -->
+ <g transform="translate(0.5 0.5)">
+ <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ <!-- end -->
+ </xsl:template>
+
+
+ <xsl:template match="*"></xsl:template>
+ <xsl:template match="text()"></xsl:template>
+
+</xsl:stylesheet>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/dc.svg.xslt b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/dc.svg.xslt
new file mode 100644
index 0000000..fb8cfb0
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/dc.svg.xslt
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:import href="corner-imports.svg.xslt" />
+
+ <!-- Diagonal 45 degrees corner -->
+ <xsl:template name="figure">
+ <xsl:variable name="biggersize" select="number($size)+number($size)"/>
+ <g transform="translate(0 0.5)">
+ <polygon points="0,{$size} {$size},0 {$biggersize},0 {$biggersize},{$biggersize} 0,{$biggersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/external-link.gif b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/external-link.gif
new file mode 100644
index 0000000..ff2f7b2
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/external-link.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/fix.jpg b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/fix.jpg
new file mode 100644
index 0000000..1d6820b
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/fix.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/forrest-credit-logo.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/forrest-credit-logo.png
new file mode 100644
index 0000000..8a63e42
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/forrest-credit-logo.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/hack.jpg b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/hack.jpg
new file mode 100644
index 0000000..f38d50f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/hack.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/pdfdoc.gif b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/pdfdoc.gif
new file mode 100644
index 0000000..00dee28
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/pdfdoc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/poddoc.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/poddoc.png
new file mode 100644
index 0000000..a393df7
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/poddoc.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/poddoc.svg.xslt b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/poddoc.svg.xslt
new file mode 100644
index 0000000..160d3da
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/poddoc.svg.xslt
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<svg width="20pt" height="20pt"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs
+ id="defs550">
+ <linearGradient id="gray2white">
+ <stop style="stop-color:#7f7f7f;stop-opacity:1;" offset="0.000000"/>
+ <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1.000000"/>
+ </linearGradient>
+ <linearGradient id="pageshade" xlink:href="#gray2white"
+ x1="0.95" y1="0.95"
+ x2="0.40" y2="0.20"
+ gradientUnits="objectBoundingBox" spreadMethod="pad" />
+ <path d="M 0 0 L 200 0" style="stroke:#000000;stroke-width:1pt;" id="hr"/>
+ </defs>
+
+ <g transform="scale(0.08)">
+ <g transform="translate(40, 0)">
+ <rect width="230" height="300" x="0" y="0"
+ style="fill:url(#pageshade);fill-rule:evenodd;
+ stroke:#000000;stroke-width:1.25;"/>
+
+ <g transform="translate(15, 60)">
+ <use xlink:href="#hr" x="0" y="0"/>
+ <use xlink:href="#hr" x="0" y="60"/>
+ <use xlink:href="#hr" x="0" y="120"/>
+ <use xlink:href="#hr" x="0" y="180"/>
+ </g>
+ </g>
+
+ <g transform="translate(0,70),scale(1.1,1.6)">
+ <rect width="200" height="100" x="0" y="0"
+ style="fill:#ff0000;fill-rule:evenodd;
+ stroke:#000000;stroke-width:2.33903;"/>
+ <text x="20" y="75"
+ style="stroke:#ffffff;stroke-width:1.0;
+ font-size:72;font-weight:normal;fill:#ffffff;
+ font-family:Arial;text-anchor:start;">POD</text>
+ </g>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/printer.gif b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/printer.gif
new file mode 100644
index 0000000..5021187
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/printer.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/rc.svg.xslt b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/rc.svg.xslt
new file mode 100644
index 0000000..fe097eb
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/rc.svg.xslt
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:import href="corner-imports.svg.xslt" />
+
+ <!-- Rounded corner -->
+ <xsl:template name="figure">
+ <g transform="translate(0.5 0.5)">
+ <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
+ style="{$fill}{$stroke}stroke-width:1"/>
+ </g>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/remove.jpg b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/remove.jpg
new file mode 100644
index 0000000..8c9b9ef
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/remove.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/rss.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/rss.png
new file mode 100644
index 0000000..f0796ac
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/rss.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/spacer.gif b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/spacer.gif
new file mode 100644
index 0000000..35d42e8
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/spacer.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/txtdoc.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/txtdoc.png
new file mode 100644
index 0000000..bf8b374
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/txtdoc.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/txtdoc.svg.xslt b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/txtdoc.svg.xslt
new file mode 100644
index 0000000..ebbdef5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/txtdoc.svg.xslt
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<svg width="20pt" height="20pt"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs
+ id="defs550">
+ <linearGradient id="gray2white">
+ <stop style="stop-color:#7f7f7f;stop-opacity:1;" offset="0.000000"/>
+ <stop style="stop-color:#ffffff;stop-opacity:1;" offset="1.000000"/>
+ </linearGradient>
+ <linearGradient id="pageshade" xlink:href="#gray2white"
+ x1="0.95" y1="0.95"
+ x2="0.40" y2="0.20"
+ gradientUnits="objectBoundingBox" spreadMethod="pad" />
+ <path d="M 0 0 L 200 0" style="stroke:#000000;stroke-width:1pt;" id="hr"/>
+ </defs>
+
+ <g transform="scale(0.08)">
+ <g transform="translate(40, 0)">
+ <rect width="230" height="300" x="0" y="0"
+ style="fill:url(#pageshade);fill-rule:evenodd;
+ stroke:#000000;stroke-width:1.25;"/>
+
+ <g transform="translate(15, 60)">
+ <use xlink:href="#hr" x="0" y="0"/>
+ <use xlink:href="#hr" x="0" y="60"/>
+ <use xlink:href="#hr" x="0" y="120"/>
+ <use xlink:href="#hr" x="0" y="180"/>
+ </g>
+ </g>
+
+ <g transform="translate(0,70),scale(1.1,1.6)">
+ <rect width="200" height="100" x="0" y="0"
+ style="fill:#ff0000;fill-rule:evenodd;
+ stroke:#000000;stroke-width:2.33903;"/>
+ <text x="20" y="75"
+ style="stroke:#ffffff;stroke-width:1.0;
+ font-size:72;font-weight:normal;fill:#ffffff;
+ font-family:Arial;text-anchor:start;">TXT</text>
+ </g>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/update.jpg b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/update.jpg
new file mode 100644
index 0000000..beb9207
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/update.jpg
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/valid-html401.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/valid-html401.png
new file mode 100644
index 0000000..3855210
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/valid-html401.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/vcss.png b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/vcss.png
new file mode 100644
index 0000000..9b2f596
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/vcss.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/images/xmldoc.gif b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/xmldoc.gif
new file mode 100644
index 0000000..ca1224f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/images/xmldoc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/LICENSE-prototype.txt b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/LICENSE-prototype.txt
new file mode 100644
index 0000000..45ac250
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/LICENSE-prototype.txt
@@ -0,0 +1,16 @@
+Copyright (c) 2005 Sam Stephenson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/breadcrumbs-optimized.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/breadcrumbs-optimized.js
new file mode 100644
index 0000000..dbef530
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/breadcrumbs-optimized.js
@@ -0,0 +1,90 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+var PREPREND_CRUMBS=new Array();
+var link1="@skinconfig.trail.link1.name@";
+var link2="@skinconfig.trail.link2.name@";
+var link3="@skinconfig.trail.link3.name@";
+if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link1, @skinconfig.trail.link1.href@ ) ); }
+if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link2, @skinconfig.trail.link2.href@ ) ); }
+if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link3, @skinconfig.trail.link3.href@ ) ); }
+var DISPLAY_SEPARATOR=" > ";
+var DISPLAY_PREPREND=" > ";
+var DISPLAY_POSTPREND=":";
+var CSS_CLASS_CRUMB="breadcrumb";
+var CSS_CLASS_TRAIL="breadcrumbTrail";
+var CSS_CLASS_SEPARATOR="crumbSeparator";
+var FILE_EXTENSIONS=new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
+var PATH_SEPARATOR="/";
+
+function sc(s) {
+ var l=s.toLowerCase();
+ return l.substr(0,1).toUpperCase()+l.substr(1);
+}
+function getdirs() {
+ var t=document.location.pathname.split(PATH_SEPARATOR);
+ var lc=t[t.length-1];
+ for(var i=0;i < FILE_EXTENSIONS.length;i++)
+ {
+ if(lc.indexOf(FILE_EXTENSIONS[i]))
+ return t.slice(1,t.length-1); }
+ return t.slice(1,t.length);
+}
+function getcrumbs( d )
+{
+ var pre = "/";
+ var post = "/";
+ var c = new Array();
+ if( d != null )
+ {
+ for(var i=0;i < d.length;i++) {
+ pre+=d[i]+postfix;
+ c.push(new Array(d[i],pre)); }
+ }
+ if(PREPREND_CRUMBS.length > 0 )
+ return PREPREND_CRUMBS.concat( c );
+ return c;
+}
+function gettrail( c )
+{
+ var h=DISPLAY_PREPREND;
+ for(var i=0;i < c.length;i++)
+ {
+ h+='<a href="'+c[i][1]+'" >'+sc(c[i][0])+'</a>';
+ if(i!=(c.length-1))
+ h+=DISPLAY_SEPARATOR; }
+ return h+DISPLAY_POSTPREND;
+}
+
+function gettrailXHTML( c )
+{
+ var h='<span class="'+CSS_CLASS_TRAIL+'">'+DISPLAY_PREPREND;
+ for(var i=0;i < c.length;i++)
+ {
+ h+='<a href="'+c[i][1]+'" class="'+CSS_CLASS_CRUMB+'">'+sc(c[i][0])+'</a>';
+ if(i!=(c.length-1))
+ h+='<span class="'+CSS_CLASS_SEPARATOR+'">'+DISPLAY_SEPARATOR+'</span>'; }
+ return h+DISPLAY_POSTPREND+'</span>';
+}
+
+if(document.location.href.toLowerCase().indexOf("http://")==-1)
+ document.write(gettrail(getcrumbs()));
+else
+ document.write(gettrail(getcrumbs(getdirs())));
+
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/breadcrumbs.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/breadcrumbs.js
new file mode 100644
index 0000000..52a7da7
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/breadcrumbs.js
@@ -0,0 +1,237 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * This script, when included in a html file, builds a neat breadcrumb trail
+ * based on its url. That is, if it doesn't contains bugs (I'm relatively
+ * sure it does).
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="breadcrumbs.js"></script>
+ */
+
+/**
+ * IE 5 on Mac doesn't know Array.push.
+ *
+ * Implement it - courtesy to fritz.
+ */
+var abc = new Array();
+if (!abc.push) {
+ Array.prototype.push = function(what){this[this.length]=what}
+}
+
+/* ========================================================================
+ CONSTANTS
+ ======================================================================== */
+
+/**
+ * Two-dimensional array containing extra crumbs to place at the front of
+ * the trail. Specify first the name of the crumb, then the URI that belongs
+ * to it. You'll need to modify this for every domain or subdomain where
+ * you use this script (you can leave it as an empty array if you wish)
+ */
+var PREPREND_CRUMBS = new Array();
+
+var link1 = "@skinconfig.trail.link1.name@";
+var link2 = "@skinconfig.trail.link2.name@";
+var link3 = "@skinconfig.trail.link3.name@";
+
+var href1 = "@skinconfig.trail.link1.href@";
+var href2 = "@skinconfig.trail.link2.href@";
+var href3 = "@skinconfig.trail.link3.href@";
+
+ if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link1, href1 ) );
+ }
+ if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link2, href2 ) );
+ }
+ if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
+ PREPREND_CRUMBS.push( new Array( link3, href3 ) );
+ }
+
+/**
+ * String to include between crumbs:
+ */
+var DISPLAY_SEPARATOR = " > ";
+/**
+ * String to include at the beginning of the trail
+ */
+var DISPLAY_PREPREND = " > ";
+/**
+ * String to include at the end of the trail
+ */
+var DISPLAY_POSTPREND = "";
+
+/**
+ * CSS Class to use for a single crumb:
+ */
+var CSS_CLASS_CRUMB = "breadcrumb";
+
+/**
+ * CSS Class to use for the complete trail:
+ */
+var CSS_CLASS_TRAIL = "breadcrumbTrail";
+
+/**
+ * CSS Class to use for crumb separator:
+ */
+var CSS_CLASS_SEPARATOR = "crumbSeparator";
+
+/**
+ * Array of strings containing common file extensions. We use this to
+ * determine what part of the url to ignore (if it contains one of the
+ * string specified here, we ignore it).
+ */
+var FILE_EXTENSIONS = new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
+
+/**
+ * String that separates parts of the breadcrumb trail from each other.
+ * When this is no longer a slash, I'm sure I'll be old and grey.
+ */
+var PATH_SEPARATOR = "/";
+
+/* ========================================================================
+ UTILITY FUNCTIONS
+ ======================================================================== */
+/**
+ * Capitalize first letter of the provided string and return the modified
+ * string.
+ */
+function sentenceCase( string )
+{ return string;
+ //var lower = string.toLowerCase();
+ //return lower.substr(0,1).toUpperCase() + lower.substr(1);
+}
+
+/**
+ * Returns an array containing the names of all the directories in the
+ * current document URL
+ */
+function getDirectoriesInURL()
+{
+ var trail = document.location.pathname.split( PATH_SEPARATOR );
+
+ // check whether last section is a file or a directory
+ var lastcrumb = trail[trail.length-1];
+ for( var i = 0; i < FILE_EXTENSIONS.length; i++ )
+ {
+ if( lastcrumb.indexOf( FILE_EXTENSIONS[i] ) )
+ {
+ // it is, remove it and send results
+ return trail.slice( 1, trail.length-1 );
+ }
+ }
+
+ // it's not; send the trail unmodified
+ return trail.slice( 1, trail.length );
+}
+
+/* ========================================================================
+ BREADCRUMB FUNCTIONALITY
+ ======================================================================== */
+/**
+ * Return a two-dimensional array describing the breadcrumbs based on the
+ * array of directories passed in.
+ */
+function getBreadcrumbs( dirs )
+{
+ var prefix = "/";
+ var postfix = "/";
+
+ // the array we will return
+ var crumbs = new Array();
+
+ if( dirs != null )
+ {
+ for( var i = 0; i < dirs.length; i++ )
+ {
+ prefix += dirs[i] + postfix;
+ crumbs.push( new Array( dirs[i], prefix ) );
+ }
+ }
+
+ // preprend the PREPREND_CRUMBS
+ if(PREPREND_CRUMBS.length > 0 )
+ {
+ return PREPREND_CRUMBS.concat( crumbs );
+ }
+
+ return crumbs;
+}
+
+/**
+ * Return a string containing a simple text breadcrumb trail based on the
+ * two-dimensional array passed in.
+ */
+function getCrumbTrail( crumbs )
+{
+ var xhtml = DISPLAY_PREPREND;
+
+ for( var i = 0; i < crumbs.length; i++ )
+ {
+ xhtml += '<a href="' + crumbs[i][1] + '" >';
+ xhtml += unescape( crumbs[i][0] ) + '</a>';
+ if( i != (crumbs.length-1) )
+ {
+ xhtml += DISPLAY_SEPARATOR;
+ }
+ }
+
+ xhtml += DISPLAY_POSTPREND;
+
+ return xhtml;
+}
+
+/**
+ * Return a string containing an XHTML breadcrumb trail based on the
+ * two-dimensional array passed in.
+ */
+function getCrumbTrailXHTML( crumbs )
+{
+ var xhtml = '<span class="' + CSS_CLASS_TRAIL + '">';
+ xhtml += DISPLAY_PREPREND;
+
+ for( var i = 0; i < crumbs.length; i++ )
+ {
+ xhtml += '<a href="' + crumbs[i][1] + '" class="' + CSS_CLASS_CRUMB + '">';
+ xhtml += unescape( crumbs[i][0] ) + '</a>';
+ if( i != (crumbs.length-1) )
+ {
+ xhtml += '<span class="' + CSS_CLASS_SEPARATOR + '">' + DISPLAY_SEPARATOR + '</span>';
+ }
+ }
+
+ xhtml += DISPLAY_POSTPREND;
+ xhtml += '</span>';
+
+ return xhtml;
+}
+
+/* ========================================================================
+ PRINT BREADCRUMB TRAIL
+ ======================================================================== */
+
+// check if we're local; if so, only print the PREPREND_CRUMBS
+if( document.location.href.toLowerCase().indexOf( "http://" ) == -1 )
+{
+ document.write( getCrumbTrail( getBreadcrumbs() ) );
+}
+else
+{
+ document.write( getCrumbTrail( getBreadcrumbs( getDirectoriesInURL() ) ) );
+}
+
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/fontsize.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/fontsize.js
new file mode 100644
index 0000000..44a2345
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/fontsize.js
@@ -0,0 +1,166 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+function init()
+{ //embedded in the doc
+ //ndeSetTextSize();
+}
+
+function checkBrowser(){
+ if (!document.getElementsByTagName){
+ return true;
+ }
+ else{
+ return false;
+ }
+}
+
+
+function ndeSetTextSize(chgsize,rs)
+{
+ var startSize;
+ var newSize;
+
+ if (!checkBrowser)
+ {
+ return;
+ }
+
+ startSize = parseInt(ndeGetDocTextSize());
+
+ if (!startSize)
+ {
+ startSize = 16;
+ }
+
+ switch (chgsize)
+ {
+ case 'incr':
+ newSize = startSize + 2;
+ break;
+
+ case 'decr':
+ newSize = startSize - 2;
+ break;
+
+ case 'reset':
+ if (rs) {newSize = rs;} else {newSize = 16;}
+ break;
+
+ default:
+ try{
+ newSize = parseInt(ndeReadCookie("nde-textsize"));
+ }
+ catch(e){
+ alert(e);
+ }
+
+ if (!newSize || newSize == 'NaN')
+ {
+ newSize = startSize;
+ }
+ break;
+
+ }
+
+ if (newSize < 10)
+ {
+ newSize = 10;
+ }
+
+ newSize += 'px';
+
+ document.getElementsByTagName('html')[0].style.fontSize = newSize;
+ document.getElementsByTagName('body')[0].style.fontSize = newSize;
+
+ ndeCreateCookie("nde-textsize", newSize, 365);
+}
+
+function ndeGetDocTextSize()
+{
+ if (!checkBrowser)
+ {
+ return 0;
+ }
+
+ var size = 0;
+ var body = document.getElementsByTagName('body')[0];
+
+ if (body.style && body.style.fontSize)
+ {
+ size = body.style.fontSize;
+ }
+ else if (typeof(getComputedStyle) != 'undefined')
+ {
+ size = getComputedStyle(body,'').getPropertyValue('font-size');
+ }
+ else if (body.currentStyle)
+ {
+ size = body.currentStyle.fontSize;
+ }
+
+ //fix IE bug
+ if( isNaN(size)){
+ if(size.substring(size.length-1)=="%"){
+ return
+ }
+
+ }
+
+ return size;
+
+}
+
+
+
+function ndeCreateCookie(name,value,days)
+{
+ var cookie = name + "=" + value + ";";
+
+ if (days)
+ {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ cookie += " expires=" + date.toGMTString() + ";";
+ }
+ cookie += " path=/";
+
+ document.cookie = cookie;
+
+}
+
+function ndeReadCookie(name)
+{
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+
+
+ for(var i = 0; i < ca.length; i++)
+ {
+ var c = ca[i];
+ while (c.charAt(0) == ' ')
+ {
+ c = c.substring(1, c.length);
+ }
+
+ ctest = c.substring(0,name.length);
+
+ if(ctest == name){
+ return c.substring(nameEQ.length,c.length);
+ }
+ }
+ return null;
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/getBlank.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/getBlank.js
new file mode 100644
index 0000000..a45e9da
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/getBlank.js
@@ -0,0 +1,40 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * getBlank script - when included in a html file and called from a form text field, will set the value of this field to ""
+ * if the text value is still the standard value.
+ * getPrompt script - when included in a html file and called from a form text field, will set the value of this field to the prompt
+ * if the text value is empty.
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="getBlank.js"></script>
+ * <input type="text" id="query" value="Search the site:" onFocus="getBlank (this, 'Search the site:');" onBlur="getBlank (this, 'Search the site:');"/>
+ */
+<!--
+function getBlank (form, stdValue){
+if (form.value == stdValue){
+ form.value = '';
+ }
+return true;
+}
+function getPrompt (form, stdValue){
+if (form.value == ''){
+ form.value = stdValue;
+ }
+return true;
+}
+//-->
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/getMenu.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/getMenu.js
new file mode 100644
index 0000000..1d9efc3
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/getMenu.js
@@ -0,0 +1,45 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * This script, when included in a html file, can be used to make collapsible menus
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="menu.js"></script>
+ */
+
+if (document.getElementById){
+ document.write('<style type="text/css">.menuitemgroup{display: none;}</style>')
+}
+
+
+function SwitchMenu(obj, thePath)
+{
+var open = 'url("'+thePath + 'images/chapter_open.gif")';
+var close = 'url("'+thePath + 'images/chapter.gif")';
+ if(document.getElementById) {
+ var el = document.getElementById(obj);
+ var title = document.getElementById(obj+'Title');
+
+ if(el.style.display != "block"){
+ title.style.backgroundImage = open;
+ el.style.display = "block";
+ }else{
+ title.style.backgroundImage = close;
+ el.style.display = "none";
+ }
+ }// end - if(document.getElementById)
+}//end - function SwitchMenu(obj)
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/menu.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/menu.js
new file mode 100644
index 0000000..b060202
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/menu.js
@@ -0,0 +1,48 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * This script, when included in a html file, can be used to make collapsible menus
+ *
+ * Typical usage:
+ * <script type="text/javascript" language="JavaScript" src="menu.js"></script>
+ */
+
+if (document.getElementById){
+ document.write('<style type="text/css">.menuitemgroup{display: none;}</style>')
+}
+
+function SwitchMenu(obj)
+{
+ if(document.getElementById) {
+ var el = document.getElementById(obj);
+ var title = document.getElementById(obj+'Title');
+
+ if(obj.indexOf("_selected_")==0&&el.style.display == ""){
+ el.style.display = "block";
+ title.className = "pagegroupselected";
+ }
+
+ if(el.style.display != "block"){
+ el.style.display = "block";
+ title.className = "pagegroupopen";
+ }
+ else{
+ el.style.display = "none";
+ title.className = "pagegroup";
+ }
+ }// end - if(document.getElementById)
+}//end - function SwitchMenu(obj)
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/common/js/prototype.js b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/prototype.js
new file mode 100644
index 0000000..ed7d920
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/common/js/prototype.js
@@ -0,0 +1,1257 @@
+/* Prototype JavaScript framework, version 1.4.0_pre4
+ * (c) 2005 Sam Stephenson <sam@conio.net>
+ *
+ * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
+ * against the source tree, available from the Prototype darcs repository.
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ *
+ * For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.4.0_pre4',
+
+ emptyFunction: function() {},
+ K: function(x) {return x}
+}
+
+var Class = {
+ create: function() {
+ return function() {
+ this.initialize.apply(this, arguments);
+ }
+ }
+}
+
+var Abstract = new Object();
+
+Object.extend = function(destination, source) {
+ for (property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+}
+
+Function.prototype.bind = function(object) {
+ var __method = this;
+ return function() {
+ return __method.apply(object, arguments);
+ }
+}
+
+Function.prototype.bindAsEventListener = function(object) {
+ var __method = this;
+ return function(event) {
+ return __method.call(object, event || window.event);
+ }
+}
+
+Number.prototype.toColorPart = function() {
+ var digits = this.toString(16);
+ if (this < 16) return '0' + digits;
+ return digits;
+}
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0; i < arguments.length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) {}
+ }
+
+ return returnValue;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create();
+PeriodicalExecuter.prototype = {
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.callback();
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+function $() {
+ var elements = new Array();
+
+ for (var i = 0; i < arguments.length; i++) {
+ var element = arguments[i];
+ if (typeof element == 'string')
+ element = document.getElementById(element);
+
+ if (arguments.length == 1)
+ return element;
+
+ elements.push(element);
+ }
+
+ return elements;
+}
+
+if (!Array.prototype.push) {
+ Array.prototype.push = function() {
+ var startLength = this.length;
+ for (var i = 0; i < arguments.length; i++)
+ this[startLength + i] = arguments[i];
+ return this.length;
+ }
+}
+
+if (!Function.prototype.apply) {
+ // Based on code from http://www.youngpup.net/
+ Function.prototype.apply = function(object, parameters) {
+ var parameterStrings = new Array();
+ if (!object) object = window;
+ if (!parameters) parameters = new Array();
+
+ for (var i = 0; i < parameters.length; i++)
+ parameterStrings[i] = 'parameters[' + i + ']';
+
+ object.__apply__ = this;
+ var result = eval('object.__apply__(' +
+ parameterStrings.join(', ') + ')');
+ object.__apply__ = null;
+
+ return result;
+ }
+}
+
+Object.extend(String.prototype, {
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ escapeHTML: function() {
+ var div = document.createElement('div');
+ var text = document.createTextNode(this);
+ div.appendChild(text);
+ return div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = document.createElement('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0].nodeValue;
+ },
+
+ parseQuery: function() {
+ var str = this;
+ if (str.substring(0,1) == '?') {
+ str = this.substring(1);
+ }
+ var result = {};
+ var pairs = str.split('&');
+ for (var i = 0; i < pairs.length; i++) {
+ var pair = pairs[i].split('=');
+ result[pair[0]] = pair[1];
+ }
+ return result;
+ }
+});
+
+
+var _break = new Object();
+var _continue = new Object();
+
+var Enumerable = {
+ each: function(iterator) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ try {
+ iterator(value, index++);
+ } catch (e) {
+ if (e != _continue) throw e;
+ }
+ });
+ } catch (e) {
+ if (e != _break) throw e;
+ }
+ },
+
+ all: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ if (!(result &= (iterator || Prototype.K)(value, index)))
+ throw _break;
+ });
+ return result;
+ },
+
+ any: function(iterator) {
+ var result = true;
+ this.each(function(value, index) {
+ if (result &= (iterator || Prototype.K)(value, index))
+ throw _break;
+ });
+ return result;
+ },
+
+ collect: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator(value, index));
+ });
+ return results;
+ },
+
+ detect: function (iterator) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator(value, index)) {
+ result = value;
+ throw _break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(pattern, iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ var stringValue = value.toString();
+ if (stringValue.match(pattern))
+ results.push((iterator || Prototype.K)(value, index));
+ })
+ return results;
+ },
+
+ include: function(object) {
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw _break;
+ }
+ });
+ return found;
+ },
+
+ inject: function(memo, iterator) {
+ this.each(function(value, index) {
+ memo = iterator(memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.collect(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (value >= (result || value))
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator) {
+ var result;
+ this.each(function(value, index) {
+ value = (iterator || Prototype.K)(value, index);
+ if (value <= (result || value))
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator) {
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ ((iterator || Prototype.K)(value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value, index) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator) {
+ return this.collect(function(value, index) {
+ return {value: value, criteria: iterator(value, index)};
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.collect(Prototype.K);
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (typeof args.last() == 'function')
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ iterator(value = collections.pluck(index));
+ return value;
+ });
+ }
+}
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray
+});
+
+$A = Array.from = function(iterable) {
+ var results = [];
+ for (var i = 0; i < iterable.length; i++)
+ results.push(iterable[i]);
+ return results;
+}
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0; i < this.length; i++)
+ iterator(this[i]);
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ }
+});
+
+Object.extend(Array.prototype, Enumerable);
+
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')},
+ function() {return new XMLHttpRequest()}
+ ) || false;
+ }
+}
+
+Ajax.Base = function() {};
+Ajax.Base.prototype = {
+ setOptions: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ parameters: ''
+ }
+ Object.extend(this.options, options || {});
+ },
+
+ responseIsSuccess: function() {
+ return this.transport.status == undefined
+ || this.transport.status == 0
+ || (this.transport.status >= 200 && this.transport.status < 300);
+ },
+
+ responseIsFailure: function() {
+ return !this.responseIsSuccess();
+ }
+}
+
+Ajax.Request = Class.create();
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(url, options) {
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+ this.request(url);
+ },
+
+ request: function(url) {
+ var parameters = this.options.parameters || '';
+ if (parameters.length > 0) parameters += '&_=';
+
+ try {
+ if (this.options.method == 'get')
+ url += '?' + parameters;
+
+ this.transport.open(this.options.method, url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) {
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
+ }
+
+ this.setRequestHeaders();
+
+ var body = this.options.postBody ? this.options.postBody : parameters;
+ this.transport.send(this.options.method == 'post' ? body : null);
+
+ } catch (e) {
+ }
+ },
+
+ setRequestHeaders: function() {
+ var requestHeaders =
+ ['X-Requested-With', 'XMLHttpRequest',
+ 'X-Prototype-Version', Prototype.Version];
+
+ if (this.options.method == 'post') {
+ requestHeaders.push('Content-type',
+ 'application/x-www-form-urlencoded');
+
+ /* Force "Connection: close" for Mozilla browsers to work around
+ * a bug where XMLHttpReqeuest sends an incorrect Content-length
+ * header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType)
+ requestHeaders.push('Connection', 'close');
+ }
+
+ if (this.options.requestHeaders)
+ requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
+
+ for (var i = 0; i < requestHeaders.length; i += 2)
+ this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState != 1)
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ respondToReadyState: function(readyState) {
+ var event = Ajax.Request.Events[readyState];
+
+ if (event == 'Complete')
+ (this.options['on' + this.transport.status]
+ || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(this.transport);
+
+ (this.options['on' + event] || Prototype.emptyFunction)(this.transport);
+
+ /* Avoid memory leak in MSIE: clean up the oncomplete event handler */
+ if (event == 'Complete')
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+});
+
+Ajax.Updater = Class.create();
+Ajax.Updater.ScriptFragment = '(?:<script.*?>)((\n|.)*?)(?:<\/script>)';
+
+Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
+ initialize: function(container, url, options) {
+ this.containers = {
+ success: container.success ? $(container.success) : $(container),
+ failure: container.failure ? $(container.failure) :
+ (container.success ? null : $(container))
+ }
+
+ this.transport = Ajax.getTransport();
+ this.setOptions(options);
+
+ var onComplete = this.options.onComplete || Prototype.emptyFunction;
+ this.options.onComplete = (function() {
+ this.updateContent();
+ onComplete(this.transport);
+ }).bind(this);
+
+ this.request(url);
+ },
+
+ updateContent: function() {
+ var receiver = this.responseIsSuccess() ?
+ this.containers.success : this.containers.failure;
+
+ var match = new RegExp(Ajax.Updater.ScriptFragment, 'img');
+ var response = this.transport.responseText.replace(match, '');
+ var scripts = this.transport.responseText.match(match);
+
+ if (receiver) {
+ if (this.options.insertion) {
+ new this.options.insertion(receiver, response);
+ } else {
+ receiver.innerHTML = response;
+ }
+ }
+
+ if (this.responseIsSuccess()) {
+ if (this.onComplete)
+ setTimeout((function() {this.onComplete(
+ this.transport)}).bind(this), 10);
+ }
+
+ if (this.options.evalScripts && scripts) {
+ match = new RegExp(Ajax.Updater.ScriptFragment, 'im');
+ setTimeout((function() {
+ for (var i = 0; i < scripts.length; i++)
+ eval(scripts[i].match(match)[1]);
+ }).bind(this), 10);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create();
+Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
+ initialize: function(container, url, options) {
+ this.setOptions(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = 1;
+
+ this.updater = {};
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Ajax.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(request) {
+ if (this.options.decay) {
+ this.decay = (request.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = request.responseText;
+ }
+ this.timer = setTimeout(this.onTimerEvent.bind(this),
+ this.decay * this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+
+document.getElementsByClassName = function(className) {
+ var children = document.getElementsByTagName('*') || document.all;
+ var elements = new Array();
+
+ for (var i = 0; i < children.length; i++) {
+ var child = children[i];
+ var classNames = child.className.split(' ');
+ for (var j = 0; j < classNames.length; j++) {
+ if (classNames[j] == className) {
+ elements.push(child);
+ break;
+ }
+ }
+ }
+
+ return elements;
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Element) {
+ var Element = new Object();
+}
+
+Object.extend(Element, {
+ toggle: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = $(arguments[i]);
+ element.style.display =
+ (element.style.display == 'none' ? '' : 'none');
+ }
+ },
+
+ hide: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = $(arguments[i]);
+ element.style.display = 'none';
+ }
+ },
+
+ show: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ var element = $(arguments[i]);
+ element.style.display = '';
+ }
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ },
+
+ getHeight: function(element) {
+ element = $(element);
+ return element.offsetHeight;
+ },
+
+ hasClassName: function(element, className) {
+ element = $(element);
+ if (!element)
+ return;
+ var a = element.className.split(' ');
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] == className)
+ return true;
+ }
+ return false;
+ },
+
+ addClassName: function(element, className) {
+ element = $(element);
+ Element.removeClassName(element, className);
+ element.className += ' ' + className;
+ },
+
+ removeClassName: function(element, className) {
+ element = $(element);
+ if (!element)
+ return;
+ var newClassName = '';
+ var a = element.className.split(' ');
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] != className) {
+ if (i > 0)
+ newClassName += ' ';
+ newClassName += a[i];
+ }
+ }
+ element.className = newClassName;
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ var element = $(element);
+ for (var i = 0; i < element.childNodes.length; i++) {
+ var node = element.childNodes[i];
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ Element.remove(node);
+ }
+ }
+});
+
+var Toggle = new Object();
+Toggle.display = Element.toggle;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.Insertion = function(adjacency) {
+ this.adjacency = adjacency;
+}
+
+Abstract.Insertion.prototype = {
+ initialize: function(element, content) {
+ this.element = $(element);
+ this.content = content;
+
+ if (this.adjacency && this.element.insertAdjacentHTML) {
+ this.element.insertAdjacentHTML(this.adjacency, this.content);
+ } else {
+ this.range = this.element.ownerDocument.createRange();
+ if (this.initializeRange) this.initializeRange();
+ this.fragment = this.range.createContextualFragment(this.content);
+ this.insertContent();
+ }
+ }
+}
+
+var Insertion = new Object();
+
+Insertion.Before = Class.create();
+Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
+ initializeRange: function() {
+ this.range.setStartBefore(this.element);
+ },
+
+ insertContent: function() {
+ this.element.parentNode.insertBefore(this.fragment, this.element);
+ }
+});
+
+Insertion.Top = Class.create();
+Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(true);
+ },
+
+ insertContent: function() {
+ this.element.insertBefore(this.fragment, this.element.firstChild);
+ }
+});
+
+Insertion.Bottom = Class.create();
+Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
+ initializeRange: function() {
+ this.range.selectNodeContents(this.element);
+ this.range.collapse(this.element);
+ },
+
+ insertContent: function() {
+ this.element.appendChild(this.fragment);
+ }
+});
+
+Insertion.After = Class.create();
+Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
+ initializeRange: function() {
+ this.range.setStartAfter(this.element);
+ },
+
+ insertContent: function() {
+ this.element.parentNode.insertBefore(this.fragment,
+ this.element.nextSibling);
+ }
+});
+
+var Field = {
+ clear: function() {
+ for (var i = 0; i < arguments.length; i++)
+ $(arguments[i]).value = '';
+ },
+
+ focus: function(element) {
+ $(element).focus();
+ },
+
+ present: function() {
+ for (var i = 0; i < arguments.length; i++)
+ if ($(arguments[i]).value == '') return false;
+ return true;
+ },
+
+ select: function(element) {
+ $(element).select();
+ },
+
+ activate: function(element) {
+ $(element).focus();
+ $(element).select();
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Form = {
+ serialize: function(form) {
+ var elements = Form.getElements($(form));
+ var queryComponents = new Array();
+
+ for (var i = 0; i < elements.length; i++) {
+ var queryComponent = Form.Element.serialize(elements[i]);
+ if (queryComponent)
+ queryComponents.push(queryComponent);
+ }
+
+ return queryComponents.join('&');
+ },
+
+ getElements: function(form) {
+ var form = $(form);
+ var elements = new Array();
+
+ for (tagName in Form.Element.Serializers) {
+ var tagElements = form.getElementsByTagName(tagName);
+ for (var j = 0; j < tagElements.length; j++)
+ elements.push(tagElements[j]);
+ }
+ return elements;
+ },
+
+ getInputs: function(form, typeName, name) {
+ var form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name)
+ return inputs;
+
+ var matchingInputs = new Array();
+ for (var i = 0; i < inputs.length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) ||
+ (name && input.name != name))
+ continue;
+ matchingInputs.push(input);
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ var elements = Form.getElements(form);
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ element.blur();
+ element.disabled = 'true';
+ }
+ },
+
+ enable: function(form) {
+ var elements = Form.getElements(form);
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ element.disabled = '';
+ }
+ },
+
+ focusFirstElement: function(form) {
+ var form = $(form);
+ var elements = Form.getElements(form);
+ for (var i = 0; i < elements.length; i++) {
+ var element = elements[i];
+ if (element.type != 'hidden' && !element.disabled) {
+ Field.activate(element);
+ break;
+ }
+ }
+ },
+
+ reset: function(form) {
+ $(form).reset();
+ }
+}
+
+Form.Element = {
+ serialize: function(element) {
+ var element = $(element);
+ var method = element.tagName.toLowerCase();
+ var parameter = Form.Element.Serializers[method](element);
+
+ if (parameter)
+ return encodeURIComponent(parameter[0]) + '=' +
+ encodeURIComponent(parameter[1]);
+ },
+
+ getValue: function(element) {
+ var element = $(element);
+ var method = element.tagName.toLowerCase();
+ var parameter = Form.Element.Serializers[method](element);
+
+ if (parameter)
+ return parameter[1];
+ }
+}
+
+Form.Element.Serializers = {
+ input: function(element) {
+ switch (element.type.toLowerCase()) {
+ case 'submit':
+ case 'hidden':
+ case 'password':
+ case 'text':
+ return Form.Element.Serializers.textarea(element);
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element);
+ }
+ return false;
+ },
+
+ inputSelector: function(element) {
+ if (element.checked)
+ return [element.name, element.value];
+ },
+
+ textarea: function(element) {
+ return [element.name, element.value];
+ },
+
+ select: function(element) {
+ var value = '';
+ if (element.type == 'select-one') {
+ var index = element.selectedIndex;
+ if (index >= 0)
+ value = element.options[index].value || element.options[index].text;
+ } else {
+ value = new Array();
+ for (var i = 0; i < element.length; i++) {
+ var opt = element.options[i];
+ if (opt.selected)
+ value.push(opt.value || opt.text);
+ }
+ }
+ return [element.name, value];
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var $F = Form.Element.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = function() {}
+Abstract.TimedObserver.prototype = {
+ initialize: function(element, frequency, callback) {
+ this.frequency = frequency;
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ onTimerEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+}
+
+Form.Element.Observer = Class.create();
+Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create();
+Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = function() {}
+Abstract.EventObserver.prototype = {
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ var elements = Form.getElements(this.element);
+ for (var i = 0; i < elements.length; i++)
+ this.registerCallback(elements[i]);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ element.target = this;
+ element.prev_onclick = element.onclick || Prototype.emptyFunction;
+ element.onclick = function() {
+ this.prev_onclick();
+ this.target.onElementEvent();
+ }
+ break;
+ case 'password':
+ case 'text':
+ case 'textarea':
+ case 'select-one':
+ case 'select-multiple':
+ element.target = this;
+ element.prev_onchange = element.onchange || Prototype.emptyFunction;
+ element.onchange = function() {
+ this.prev_onchange();
+ this.target.onElementEvent();
+ }
+ break;
+ }
+ }
+ }
+}
+
+Form.Element.EventObserver = Class.create();
+Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create();
+Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+
+if (!window.Event) {
+ var Event = new Object();
+}
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+
+ element: function(event) {
+ return event.target || event.srcElement;
+ },
+
+ isLeftClick: function(event) {
+ return (((event.which) && (event.which == 1)) ||
+ ((event.button) && (event.button == 1)));
+ },
+
+ pointerX: function(event) {
+ return event.pageX || (event.clientX +
+ (document.documentElement.scrollLeft || document.body.scrollLeft));
+ },
+
+ pointerY: function(event) {
+ return event.pageY || (event.clientY +
+ (document.documentElement.scrollTop || document.body.scrollTop));
+ },
+
+ stop: function(event) {
+ if (event.preventDefault) {
+ event.preventDefault();
+ event.stopPropagation();
+ } else {
+ event.returnValue = false;
+ }
+ },
+
+ // find the first node with the given tagName, starting from the
+ // node the event was triggered on; traverses the DOM upwards
+ findElement: function(event, tagName) {
+ var element = Event.element(event);
+ while (element.parentNode && (!element.tagName ||
+ (element.tagName.toUpperCase() != tagName.toUpperCase())))
+ element = element.parentNode;
+ return element;
+ },
+
+ observers: false,
+
+ _observeAndCache: function(element, name, observer, useCapture) {
+ if (!this.observers) this.observers = [];
+ if (element.addEventListener) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.addEventListener(name, observer, useCapture);
+ } else if (element.attachEvent) {
+ this.observers.push([element, name, observer, useCapture]);
+ element.attachEvent('on' + name, observer);
+ }
+ },
+
+ unloadCache: function() {
+ if (!Event.observers) return;
+ for (var i = 0; i < Event.observers.length; i++) {
+ Event.stopObserving.apply(this, Event.observers[i]);
+ Event.observers[i][0] = null;
+ }
+ Event.observers = false;
+ },
+
+ observe: function(element, name, observer, useCapture) {
+ var element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ ((/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ || element.attachEvent))
+ name = 'keydown';
+
+ this._observeAndCache(element, name, observer, useCapture);
+ },
+
+ stopObserving: function(element, name, observer, useCapture) {
+ var element = $(element);
+ useCapture = useCapture || false;
+
+ if (name == 'keypress' &&
+ ((/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ || element.detachEvent))
+ name = 'keydown';
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, observer, useCapture);
+ } else if (element.detachEvent) {
+ element.detachEvent('on' + name, observer);
+ }
+ }
+});
+
+/* prevent memory leaks in IE */
+Event.observe(window, 'unload', Event.unloadCache, false);
+
+var Position = {
+
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, every time the
+ // page is scrolled
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ realOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ cumulativeOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ return [valueL, valueT];
+ },
+
+ // caches x/y coordinate pair to use with overlap
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = this.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = this.realOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = this.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ // within must be called directly before
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+ clone: function(source, target) {
+ source = $(source);
+ target = $(target);
+ target.style.position = 'absolute';
+ var offsets = this.cumulativeOffset(source);
+ target.style.top = offsets[1] + 'px';
+ target.style.left = offsets[0] + 'px';
+ target.style.width = source.offsetWidth + 'px';
+ target.style.height = source.offsetHeight + 'px';
+ }
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/default.scale-dev.fv b/plugins/org.apache.forrest.themes.core/resources/themes/default.scale-dev.fv
new file mode 100644
index 0000000..8dfa756
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/default.scale-dev.fv
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0" >
+ <forrest:view type="html">
+ <forrest:contract name="meta"/>
+ <forrest:hook name="container">
+ <forrest:hook name="branding">
+ <forrest:contract name="projectlogo"/>
+ <forrest:contract name="grouplogo"/>
+ <forrest:contract name="searchbox"/>
+ <forrest:contract name="nav-main"/>
+ <!--<forrest:contract name="nav-main-sub"/>-->
+ </forrest:hook>
+ <forrest:hook name="spacer" />
+ <forrest:contract name="nav"/>
+ <forrest:hook name="last-published-tagline">
+ <forrest:contract name="last-published"/>
+ </forrest:hook>
+ <forrest:contract name="content">
+ <forrest:contract name="fontsize"/>
+ <!--<forrest:hook name="export-link">
+ <forrest:contract name="txt-link"/>
+ <forrest:contract name="xml-link"/>
+ </forrest:hook>-->
+ </forrest:contract>
+ </forrest:hook>
+ <forrest:contract name="feedback"/>
+ <!--<forrest:contract name="last-published"/>-->
+ </forrest:view>
+</forrest:views>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt.fv b/plugins/org.apache.forrest.themes.core/resources/themes/pelt.fv
new file mode 100644
index 0000000..aa3400d
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt.fv
@@ -0,0 +1,480 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<forrest:views
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+ <forrest:view type="html">
+ <forrest:css url="common.css" media="screen" rel="alternate stylesheet" theme="common"/>
+ <forrest:css url="leather-dev.css" media="screen" rel="alternate stylesheet" theme="common"/>
+ <forrest:css url="pelt.basic.css" media="screen" theme="Pelt"/>
+ <forrest:css url="pelt.screen.css" media="screen" theme="Pelt"/>
+ <forrest:css url="pelt.print.css" media="print"/>
+ <forrest:css >
+/* Extra css */
+ p.quote {
+ margin-left: 2em;
+ padding: .5em;
+ background-color: #f0f0f0;
+ font-family: monospace;
+ }
+ </forrest:css>
+ <forrest:contract name="branding-theme-profiler">
+ <forrest:properties contract="branding-theme-profiler">
+ <forrest:property name="branding-theme-profiler-theme">Pelt</forrest:property>
+ <forrest:property name="branding-theme-profiler">
+
+ <!-- These values are used for the generated CSS files.
+ They essentially "override" the default colors defined in the chosen theme.
+ There are four duplicate "groups" of colors below, denoted by comments:
+ Color group: Forrest, Krysalis, Collabnet, and Lenya using Pelt.
+ They are provided for example only. To customize the colors of any theme,
+ uncomment one of these groups of color elements and change the values
+ of the particular color elements that you wish to change.
+ Note that by default, all color groups are commented-out which means that
+ the default colors provided by the theme are being used.
+ -->
+
+ <!-- Color group: Forrest: example colors similar to forrest.apache.org
+ Some of the element names are obscure, so comments are added to show how
+ the "pelt" theme uses them, other themes might use these elements in a different way.
+ Tip: temporarily change the value of an element to red (#ff0000) and see the effect.
+ pelt: breadtrail: the strip at the top of the page and the second strip under the tabs
+ pelt: header: top strip containing project and group logos
+ pelt: heading|subheading: section headings within the content
+ pelt: navstrip: the strip under the tabs which contains the published date
+ pelt: menu: the left-hand navigation panel
+ pelt: toolbox: the selected menu item
+ pelt: searchbox: the background of the searchbox
+ pelt: border: line border around selected menu item
+ pelt: body: any remaining parts, e.g. the bottom of the page
+ pelt: footer: the second from bottom strip containing credit logos and published date
+ pelt: feedback: the optional bottom strip containing feedback link
+ -->
+
+ <color name="breadtrail" value="#cedfef" font="#0F3660" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="header" value="#294563"/>
+ <color name="tab-selected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="tab-unselected" value="#b5c7e7" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="subtab-selected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="subtab-unselected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="heading" value="#294563"/>
+ <color name="subheading" value="#4a6d8c"/>
+ <color name="published" value="#4C6C8F" font="#FFFFFF"/>
+ <color name="feedback" value="#4C6C8F" font="#FFFFFF" align="center"/>
+ <color name="navstrip" value="#4a6d8c" font="#ffffff" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="menu" value="#4a6d8c" font="#cedfef" link="#ffffff" vlink="#ffffff" hlink="#ffcf00"/>
+ <color name="toolbox" value="#4a6d8c"/>
+ <color name="border" value="#294563"/>
+ <color name="dialog" value="#4a6d8c"/>
+ <color name="searchbox" value="#4a6d8c" font="#000000"/>
+ <color name="body" value="#ffffff" link="#0F3660" vlink="#009999" hlink="#000066"/>
+ <color name="table" value="#7099C5"/>
+ <color name="table-cell" value="#f0f0ff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#CFDCED"/>
+ <color name="footer" value="#cedfef"/>
+
+
+ <!-- Color group: Krysalis -->
+<!--
+ <color name="header" value="#FFFFFF"/>
+
+ <color name="tab-selected" value="#a5b6c6" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="tab-unselected" value="#F7F7F7" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-selected" value="#a5b6c6" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-unselected" value="#a5b6c6" link="#000000" vlink="#000000" hlink="#000000"/>
+
+ <color name="heading" value="#a5b6c6"/>
+ <color name="subheading" value="#CFDCED"/>
+
+ <color name="navstrip" value="#CFDCED" font="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="toolbox" value="#a5b6c6"/>
+ <color name="border" value="#a5b6c6"/>
+
+ <color name="menu" value="#F7F7F7" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="dialog" value="#F7F7F7"/>
+
+ <color name="body" value="#ffffff" link="#0F3660" vlink="#009999" hlink="#000066"/>
+
+ <color name="table" value="#a5b6c6"/>
+ <color name="table-cell" value="#ffffff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#a5b6c6"/>
+
+ <color name="footer" value="#a5b6c6"/>
+-->
+
+ <!-- Color group: Collabnet -->
+<!--
+ <color name="header" value="#003366"/>
+
+ <color name="tab-selected" value="#dddddd" link="#555555" vlink="#555555" hlink="#555555"/>
+ <color name="tab-unselected" value="#999999" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
+ <color name="subtab-selected" value="#cccccc" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-unselected" value="#cccccc" link="#555555" vlink="#555555" hlink="#555555"/>
+
+ <color name="heading" value="#003366"/>
+ <color name="subheading" value="#888888"/>
+
+ <color name="navstrip" value="#dddddd" font="#555555"/>
+ <color name="toolbox" value="#dddddd" font="#555555"/>
+ <color name="border" value="#999999"/>
+
+ <color name="menu" value="#ffffff"/>
+ <color name="dialog" value="#eeeeee"/>
+
+ <color name="body" value="#ffffff"/>
+
+ <color name="table" value="#ccc"/>
+ <color name="table-cell" value="#ffffff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#003366"/>
+
+ <color name="footer" value="#ffffff"/>
+-->
+ <!-- Color group: Lenya using pelt-->
+
+
+ <!--<color name="header" value="#ffffff"/>
+
+ <color name="tab-selected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="tab-unselected" value="#F5F4E9" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-selected" value="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-unselected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
+
+ <color name="heading" value="#E5E4D9"/>
+ <color name="subheading" value="#000000"/>
+ <color name="published" value="#000000"/>
+ <color name="navstrip" value="#E5E4D9" font="#000000"/>
+ <color name="toolbox" value="#CFDCED" font="#000000"/>
+ <color name="border" value="#999999"/>
+
+ <color name="menu" value="#E5E4D9" font="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="dialog" value="#CFDCED"/>
+ <color name="body" value="#ffffff" />
+
+ <color name="table" value="#ccc"/>
+ <color name="table-cell" value="#ffffff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#003366"/>
+
+ <color name="footer" value="#E5E4D9"/>-->
+
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="siteinfo-meta">
+ <forrest:properties contract="siteinfo-meta">
+ <forrest:property name="siteinfo-meta" nugget="get.build.info">
+ <jx:import uri="cocoon://build-info"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+
+ <forrest:contract name="siteinfo-meta-navigation">
+ <forrest:properties contract="siteinfo-meta-navigation">
+ <forrest:property name="nav-main" nugget="get.navigation">
+ <jx:import uri="cocoon://${cocoon.parameters.getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="siteinfo-meta-icon">
+ <forrest:properties contract="siteinfo-meta-icon">
+ <forrest:property name="siteinfo-meta-icon">
+ <favicon-url></favicon-url>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+
+ <forrest:hook name="container">
+ <forrest:contract name="branding-breadcrumbs">
+ <forrest:properties contract="branding-breadcrumbs">
+ <forrest:property name="branding-breadcrumbs">
+ <trail>
+ <link1 name="Apache Forrest" href="http://forrest.apache.org/"/>
+ <link2 name="Plugins" href="http://forrest.apache.org/docs/plugins/"/>
+ <link3 name="org.apache.forrest.plugin.output.themer" href="http://forrest.apache.org/docs/plugins/org.apache.forrest.plugin.output.themer/"/>
+ </trail>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook name="header">
+ <forrest:contract name="branding-tagline">
+ <forrest:properties contract="branding-tagline">
+ <forrest:property name="branding-tagline-name">new
+ seed v2</forrest:property>
+ <forrest:property name="branding-tagline-tagline">powered by
+ forrest:views v2</forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook class="logo">
+ <forrest:contract name="branding-logo">
+ <forrest:properties contract="branding-logo">
+ <forrest:property name="branding-logo-name">
+ MyGroup</forrest:property>
+ <forrest:property name="branding-logo-description">MyGroup
+ Description</forrest:property>
+ <forrest:property name="branding-logo-url">
+ http://mygroup.org/</forrest:property>
+ <forrest:property name="branding-logo-logo">
+ images/group.png</forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ <forrest:hook class="logo">
+ <forrest:contract name="branding-logo">
+ <forrest:properties contract="branding-logo">
+ <forrest:property name="branding-logo-name">
+ MyProject</forrest:property>
+ <forrest:property name="branding-logo-description">MyProject
+ Description</forrest:property>
+ <forrest:property name="branding-logo-url">
+ http://myproj.mygroup.org/</forrest:property>
+ <forrest:property name="branding-logo-logo">
+ images/project.png</forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ <forrest:contract name="search-input">
+ <forrest:properties contract="search-input">
+ <forrest:property name="input-size">25</forrest:property>
+ <forrest:property name="search-input">
+ <search name="MyProject" domain="mydomain" provider="google"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook name="nav-main-hook">
+ <forrest:contract name="nav-main">
+ <forrest:properties contract="nav-main">
+ <forrest:property name="nav-main" nugget="get.navigation">
+ <jx:import uri="cocoon://${cocoon.parameters.getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook name="publishedStrip">
+ <forrest:contract name="nav-main-sub">
+ <forrest:properties contract="nav-main-sub">
+ <forrest:property name="nav-main-sub" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="siteinfo-current-time"/>
+ </forrest:hook>
+ </forrest:hook>
+ </forrest:hook>
+ <forrest:hook name="page">
+ <forrest:contract name="branding-breadcrumbs">
+ <forrest:properties contract="branding-breadcrumbs">
+ <forrest:property name="branding-breadcrumbs">
+ <trail>
+ <link1 name="myGroup" href="http://www.apache.org/"/>
+ <link2 name="myProject" href="http://forrest.apache.org/"/>
+ <link3 name="" href=""/>
+ </trail>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:hook name="leftbar">
+ <forrest:contract name="nav-section">
+ <forrest:properties contract="nav-section">
+ <forrest:property name="nav-section" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ <forrest:property name="nav-section-toc" nugget="get.tov">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
+ </forrest:property>
+ <forrest:property name="toc" max-depth="2"/>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="genericMarkup">
+ <forrest:properties contract="genericMarkup">
+ <forrest:property name="genericMarkup">
+ <hr/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="search-input">
+ <forrest:properties contract="search-input">
+ <forrest:property name="input-size">18</forrest:property>
+ <forrest:property name="search-input">
+ <search name="MyProject" domain="mydomain" provider="google"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="siteinfo-credits">
+ <forrest:properties contract="siteinfo-credits">
+ <forrest:property name="box-location">credit</forrest:property>
+ <forrest:property name="top-separator">true</forrest:property>
+ <forrest:property name="siteinfo-credits">
+ <credits>
+ <credit>
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ <image>images/built-with-forrest-button.png</image>
+ <width>88</width>
+ <height>31</height>
+ </credit>
+ </credits>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="genericMarkup">
+ <forrest:properties contract="genericMarkup">
+ <forrest:property name="genericMarkup">
+ <hr/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-motd-page">
+ <forrest:properties contract="content-motd-page">
+ <forrest:property name="content-motd-page">
+ <motd>
+ <motd-option pattern="index.html">
+ <motd-title>sample</motd-title>
+ <motd-page location="both">
+ This is an example of a Message of the day (MOTD).
+ </motd-page>
+ <motd-page-url>index.html</motd-page-url>
+ </motd-option>
+ <motd-option pattern="samples/faq.html">
+ <motd-title></motd-title>
+ <motd-page location="both">
+ How to enable this MOTD is on this page.
+ </motd-page>
+ <motd-page-url>#motd</motd-page-url>
+ </motd-option>
+ </motd>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="nav-section-round-bottom"/>
+ </forrest:hook>
+ <jx:import uri="cocoon://prepare.tiles.export-link"/>
+ <forrest:hook name="content">
+ <!-- FIXME - Problem with ndeSetTextSize() script from fontsize.js not compliant between Pelt and Leather-dev... -->
+ <!--<forrest:hook class="trail">
+ <forrest:contract name="branding-fontsize"/>
+ </forrest:hook>-->
+ <forrest:contract name="content-title">
+ <forrest:properties contract="content-title">
+ <forrest:property name="content-title" nugget="get.title">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.title.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-abstract">
+ <forrest:properties contract="content-abstract">
+ <forrest:property name="content-abstract" nugget="get.abstract">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-minitoc">
+ <forrest:properties contract="content-minitoc">
+ <forrest:property name="content-minitoc-toc" nugget="get.toc">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
+ </forrest:property>
+ <forrest:property name="content-minitoc-conf" >
+ <toc max-depth="2"
+ min-sections="1" location="page"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-main">
+ <forrest:properties contract="content-main">
+ <forrest:property name="content-main" nugget="get.body">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.body.xml"/>
+ </forrest:property>
+ <forrest:property name="content-main-conf">
+ <headings type="underlined"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="content-authors">
+ <forrest:properties contract="content-authors">
+ <forrest:property name="content-authors" nugget="get.authors">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.authors.xml"/>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ </forrest:hook>
+ <forrest:hook name="footer">
+ <forrest:hook class="lastmodified">
+ <forrest:contract name="siteinfo-last-published"/>
+ </forrest:hook>
+ <forrest:hook class="copyright">
+ <forrest:contract name="siteinfo-copyright">
+ <forrest:properties contract="siteinfo-copyright">
+ <forrest:property name="siteinfo-copyright">
+ <copyright>
+ <year>2005</year>
+ <vendor>The Acme Software Foundation.</vendor>
+ </copyright>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ <!--FIXME thorsten turned this off while developing (no internet connection)
+ <forrest:contract name="siteinfo-compliance-links"/>-->
+ <forrest:contract name="siteinfo-credits">
+ <forrest:properties contract="siteinfo-credits">
+ <forrest:property name="box-location">credit</forrest:property>
+ <forrest:property name="top-separator">true</forrest:property>
+ <forrest:property name="siteinfo-credits">
+ <credits>
+ <credit>
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ <image>images/built-with-forrest-button.png</image>
+ <width>88</width>
+ <height>31</height>
+ </credit>
+ </credits>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ <forrest:contract name="siteinfo-feedback">
+ <forrest:properties contract="siteinfo-feedback">
+ <forrest:property name="siteinfo-feedback">
+ <feedback to="the Webmaster"
+ href="mailto:webmaster@foo.com?subject=Feedback " >
+ Send feedback about the website to:
+ </feedback>
+ </forrest:property>
+ </forrest:properties>
+ </forrest:contract>
+ </forrest:hook>
+ </forrest:hook>
+ </forrest:view>
+</forrest:views>
+
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/leather-dev.css b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/leather-dev.css
new file mode 100644
index 0000000..0807545
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/leather-dev.css
@@ -0,0 +1,50 @@
+/*
+* Copyright 2002-2005 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+
+#container .breadtrail {
+ display: none;
+}
+
+#container .logo {
+ display: none;
+}
+
+#header .searchbox {
+ display: none;
+}
+#header .lastmodified {
+ display: none;
+}
+#leftbar #credit {
+ display: none;
+}
+
+#leftbar hr {
+ display: none;
+}
+
+#leftbar #credit2 {
+ display: none;
+}
+
+.trail {
+ display: none;
+}
+
+.motd-area {
+ display: none;
+}
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.basic.css b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.basic.css
new file mode 100644
index 0000000..1f5d3e4
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.basic.css
@@ -0,0 +1,169 @@
+/*
+* Copyright 2002-2005 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+/**
+ * General
+ */
+
+img { border: 0; }
+
+#content table {
+ border: 0;
+ width: 100%;
+}
+/*Hack to get IE to render the table at 100%*/
+* html #content table { margin-left: -3px; }
+
+#content th,
+#content td {
+ margin: 0;
+ padding: 0;
+ vertical-align: top;
+}
+
+.clearboth {
+ clear: both;
+}
+
+.frame {
+ border: solid black 1px;
+ margin: 1em 3em;
+}
+
+.frame .label {
+ background: #369;
+ color: white;
+ font-weight: bold;
+ padding: 5px 10px;
+}
+.frame .content {
+ padding: 5px 10px;
+ background: #F0F0FF;
+ color: black;
+ line-height: 120%;
+ font-size: 90%;
+}
+/*
+ * Notes, Warnings, Fixme ...
+ */
+.note, .warning, .fixme {
+ border: solid black 1px;
+ margin: 1em 3em;
+}
+.fixme { border-color: #CC6600;}
+.note { border-color: #006699;}
+.warning { border-color: #990000;}
+
+/* Label */
+.note .label { background: #336699; }
+.warning .label { background: #CC0000; }
+.fixme .label { background: #C6C600; }
+
+.note .label, .warning .label, .fixme .label {
+ color: white;
+ font-weight: bold;
+ padding: 5px 10px;
+}
+
+/* Content */
+.note .content { background: #F0F0FF; }
+.warning .content { background: #FFF0F0; }
+.fixme .content { background: #FFFFBF; }
+
+.note .content, .warning .content, .fixme .content {
+ color: black;
+ line-height: 120%;
+ font-size: 90%;
+ padding: 5px 10px;
+}
+
+/**
+ * Typography
+ */
+
+body {
+ font-family: verdana, "Trebuchet MS", arial, helvetica, sans-serif;
+ font-size: 100%;
+}
+
+#content {
+ font-family: Georgia, Palatino, Times, serif;
+ /* font-size: 95%; */
+}
+#nav-main {
+ font-size: 90%;
+}
+#menu {
+ font-size: 80%;
+}
+#footer {
+ font-size: 80%;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif;
+ font-weight: bold;
+ margin-top: 1em;
+ margin-bottom: .5em;
+}
+
+h1 {
+ margin-top: 0;
+ margin-bottom: 1em;
+ font-size: 1.4em;
+}
+#content h1 {
+ font-size: 160%;
+ margin-bottom: .5em;
+}
+#menu h1 {
+ margin: 0;
+ padding: 10px;
+ background: #336699;
+ color: white;
+}
+h2 { font-size: 120%; }
+h3 { font-size: 100%; }
+h4 { font-size: 90%; }
+h5 { font-size: 80%; }
+h6 { font-size: 75%; }
+
+p {
+ line-height: 120%;
+ text-align: left;
+ margin-top: .5em;
+ margin-bottom: 1em;
+}
+
+#content li,
+#content th,
+#content td {
+ line-height: 110%;
+ margin-top: .1em;
+ margin-bottom: .1em;
+}
+
+#content .attribution {
+ text-align: right;
+ font-style: italic;
+ font-size: 85%;
+ margin-top: 1em;
+}
+
+.codefrag {
+ font-family: "Courier New", Courier, monospace;
+ font-size: 110%;
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.print.css b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.print.css
new file mode 100644
index 0000000..415995e
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.print.css
@@ -0,0 +1,45 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+body {
+ font-family: Georgia, Palatino, serif;
+ font-size: 12pt;
+ background: white;
+}
+
+#header, #leftbar,#export-link, .breadtrail, #siteinfo-compliance-links { display: none; }
+
+#content {
+ width: auto;
+ padding: 0;
+ float: none !important;
+ color: black;
+ background: transparent;
+}
+
+a:link, a:visited {
+ color: #336699;
+ background: transparent;
+ text-decoration: underline;
+}
+
+#footer {
+ margin-top: 4em;
+}
+
+acronym {
+ border: 0;
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.screen.css b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.screen.css
new file mode 100644
index 0000000..acfe84c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/css/pelt.screen.css
@@ -0,0 +1,607 @@
+/*
+* Copyright 2002-2004 The Apache Software Foundation or its licensors,
+* as applicable.
+*
+* Licensed 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.
+*/
+
+.breadtrail {
+ background: #CEDFEF;
+ color: #0F3660;
+ border-bottom: solid 1px white;
+ padding: 3px 10px;
+ font-size: 75%;
+}
+.breadtrail a:link { color: #0F3660; }
+.breadtrail a:visited { color: #0F3660; }
+.breadtrail a:hover { color: #000066; }
+
+#page .breadtrail {
+ clear:both;
+ position: relative;
+ border-bottom: solid 1px black;
+ border-top: solid 1px black;
+ padding: 0px 200px;
+ z-index:10;
+}
+
+#branding-tagline-name {
+ display: none;
+}
+
+#branding-tagline-tagline {
+ display: none;
+}
+
+a:link { color: #0F3660; }
+a:visited { color: #009999; }
+a:hover { color: #000066; }
+
+body {
+ margin: 0px 0px 0px 0px; font-family: Verdana, Helvetica, sans-serif;
+ background-color: #FFFFFF;
+ color: #000000;
+ font-size: 12px;
+}
+
+h1 { font-size : 160%; margin: 0px 0px 0px 0px; padding: 0px; }
+h2 { font-size : 140%; margin: 0.9em 0px 0px 0px; padding: 0px; font-weight : bold;}
+h3 { font-size : 120%; margin: 0.8em 0px 0px 0px; padding: 0px; font-weight : bold; }
+.h3 { margin: 22px 0px 3px 0px; }
+h4 { font-size : 100%; margin: 0.7em 0px 0px 0px; padding: 0px; font-weight : normal; text-align: left; }
+.h4 { margin: 18px 0px 0px 0px; }
+h4.faq { font-size : 100%; margin: 18px 0px 0px 0px; padding: 0px; font-weight : bold; text-align: left; }
+h5 { font-size : 80%; margin: 14px 0px 0px 0px; padding: 0px; font-weight : normal; text-align: left; }
+
+/**
+* table
+*/
+table .title { background-color: #000000; }
+.ForrestTable {
+ color: #ffffff;
+ background-color: #7099C5;
+ width: 100%;
+ font-size : 100%;
+ empty-cells: show;
+}
+table caption {
+ padding-left: 5px;
+ color: #000000;
+ text-align: left;
+ font-weight: bold;
+ background-color: #E5E4D9;
+}
+.ForrestTable td {
+ color: black;
+ background-color: #F0F0FF;
+}
+.ForrestTable th { text-align: center; }
+/**
+ * Page Header
+ */
+
+#container {
+ position: relative;
+ float: left;
+ width: 100%;
+ background-color: #FFFFFF; /* if you want a background in the header, put it here */
+}
+
+#container #header {
+ position: relative;
+ float: left;
+ width: 100%;
+ background: url("../themes/images/header_white_line.gif") repeat-x bottom;
+}
+
+/* branding-logo Template */
+#header .logo {
+ padding: 7px 0px 10px 10px;
+ float: left;
+ text-align: left;
+}
+
+#header .searchbox {
+ position: absolute;
+ margin: 0;
+ right: 10px;
+ height: 42px;
+ white-space: nowrap;
+ text-align: right;
+ color: #000000;
+ background-color: #E5E4D9;
+ z-index:0;
+ bottom: 18px; /* compensate for IE rendering issue */
+}
+/* DUC - Formerly searchbox */
+#header .search-input {
+ padding: 5px 10px;
+}
+
+#header .round-top-left-small {
+ background-repeat: no-repeat;
+ background-position: top left;
+ background-image: url(../themes/images/roundcorner-t-l-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ }
+#header .round-top-right-small {
+ background-repeat: no-repeat;
+ background-position: top right;
+ background-image: url(../themes/images/roundcorner-t-r-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ }
+.round-bottom-left-small {
+ background-repeat: no-repeat;
+ background-position: bottom left;
+ background-image: url(../themes/images/roundcorner-b-l-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ }
+.round-bottom-right-small {
+ background-repeat: no-repeat;
+ background-position: bottom right;
+ background-image: url(../themes/images/roundcorner-b-r-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ }
+.round-bottom-left-big {
+ background-repeat: no-repeat;
+ background-position: bottom left;
+ background-image: url(../themes/images/roundcorner-b-l-15-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ }
+.round-bottom-right-big {
+ background-repeat: no-repeat;
+ background-position: bottom right;
+ background-image: url(../themes/images/roundcorner-b-r-15-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ }
+
+#header .search-field {
+ float: left;
+}
+
+#nav-main {
+ clear: both;
+ padding-left: 10px;
+ margin: 0;
+ list-style: none;
+}
+
+#nav-main li {
+ float: left;
+ background-image: url(../themes/images/roundcorner-t-r-5-bgffffff-strokeF5F4E9-fgF5F4E9.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+ background-color: #F5F4E9;
+ margin: 0 3px 0 0;
+ padding: 0;
+}
+
+#nav-main li a {
+ float: left;
+ display: block;
+ font-family: verdana, arial, sans-serif;
+ text-decoration: none;
+ color: black;
+ white-space: nowrap;
+ background-image: url(../themes/images/roundcorner-t-l-5-bgffffff-strokeF5F4E9-fgF5F4E9.png);
+ background-repeat: no-repeat;
+ background-position: top left;
+ padding: 5px 15px 4px;
+ width: .1em; /* IE/Win fix */
+}
+#nav-main li a:link { color: #000000; }
+#nav-main li a:visited { color: #000000; }
+#nav-main li a:hover { color: #000000; }
+
+#nav-main > li a { width: auto; } /* Rest of IE/Win fix */
+
+/* Commented Backslash Hack hides rule from IE5-Mac \*/
+#nav-main a { float: none; }
+/* End IE5-Mac hack */
+
+#nav-main .current {
+ background-color: #E5E4D9;
+ background-image: url(../themes/images/roundcorner-t-r-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+#nav-main .current a {
+ font-weight: bold;
+ padding-bottom: 5px;
+ color: #000000;
+ background-image: url(../themes/images/roundcorner-t-l-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: top left;
+}
+
+#nav-main .current a:link { color: #000000; }
+#nav-main .current a:visited { color: #000000; }
+#nav-main .current a:hover { color: #000000; }
+
+#publishedStrip {
+ position: relative;
+ background: #E5E4D9;
+ clear:both;
+ padding-right: 10px;
+ padding-left: 20px;
+ padding-top: 3px;
+ padding-bottom:3px;
+ color: #000000;
+ font-size : 80%;
+ font-weight: bold;
+ text-align:right;
+}
+
+#level2tabs {
+ color: #000000;
+ margin: 0;
+ float:left;
+ position:relative;
+ /*background-color: #4A6D8C ;*/
+}
+#level2tabs a{padding-right: 5px;}
+#level2tabs a:link { color: #000000; }
+#level2tabs a:visited { color: #000000; }
+#level2tabs a:hover { color: #000066; }
+/*
+* border-top: solid #4C6C8F 15px;
+*/
+#page {
+ position: relative;
+ background: white;
+ clear:both;
+}
+
+/**
+* Round corner
+*/
+#roundtop {
+ background-image: url(../themes/images/roundcorner-t-r-15-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+
+#roundbottom {
+ background-image: url(../themes/images/roundcorner-b-r-15-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+
+#roundbottomLeft {
+ background-image: url(../themes/images/roundcorner-b-l-15-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: bottom left;
+}
+
+img.corner {
+ width: 15px;
+ height: 15px;
+ border: none;
+ display: block !important;
+}
+
+.roundtopsmall {
+ background-image: url(../themes/images/roundcorner-t-r-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+
+#roundbottomsmall {
+ background-image: url(../themes/images/roundcorner-b-r-5-bgffffff-strokeE5E4D9-fgE5E4D9.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+
+img.cornersmall {
+ width: 5px;
+ height: 5px;
+ border: none;
+ display: block !important;
+}
+/**
+ * Side menu
+ */
+#leftbar a { font-weight: normal;}
+#leftbar a:link { color: #000000; }
+#leftbar a:visited { color: #000000; }
+#leftbar a:active { color: #000000; }
+#leftbar a:hover { color: #FFCF00; }
+
+#menuarea { width:10em;}
+
+#leftbar {
+ position: relative;
+ float: left;
+ width: 180px;
+ padding-top: 0px;
+ top:-16px;
+ left:10px;
+ z-index: 20;
+ border-color: #000000;
+ background-color: #E5E4D9;
+ font-size : 90%;
+ color: #000000;
+}
+
+#nav-section ul {
+ list-style: none;
+ margin: 0px;
+ padding: 0px;
+}
+
+.pagegroup ul {
+ list-style: none;
+}
+
+.pagegroup {
+ display: block;
+ cursor:pointer;
+}
+
+#nav-section span {
+ background-repeat: no-repeat;
+ background-position: center left;
+ margin-left: 10px;
+ padding: 3px 12px;
+ font-weight : bold;
+}
+#nav-section .pagegroup span {
+ background-image: url('../themes/images/chapter.gif');
+ color: #000000;
+}
+.pagegroupselected span {
+ background-image: url('../themes/images/chapter_open.gif');
+ color: #000000;
+}
+.pagegroupopen span {
+ background-image: url('../themes/images/chapter_open.gif');
+ color: #000000;
+}
+
+.pagegroupselected {
+ display: block;
+ cursor:pointer;
+}
+
+.pagegroupopen {
+ display: block;
+ cursor:pointer;
+}
+#nav-section .menuitemgroup {
+ margin: 0px 0px 6px 8px;
+ padding: 0px;
+ font-weight : bold; }
+
+#nav-section .selectedmenuitemgroup{
+ margin: 0px 0px 6px 8px;
+ padding: 0px;
+ font-weight : bold; }
+
+#nav-section .menuitem {
+ padding: 0px 0px 2px 12px;
+ background-image: url('../themes/images/page.gif');
+ background-repeat: no-repeat;
+ background-position: center left;
+ font-weight : normal;
+ margin-left: 10px;
+}
+
+#nav-section .menupage {
+ margin: 5px 0px 5px 10px;
+ padding: 0px 3px 0px 12px;
+ background-image: url('../themes/images/current.gif');
+ background-repeat: no-repeat;
+ background-position: top left;
+ font-style : normal;
+}
+
+#nav-section .menupagetitle {
+ color: #000000;
+ padding: 0px 0px 0px 6px;
+ font-style : normal;
+ border-style: solid;
+ border-width: 1px;
+ margin-right: 10px;
+ border-color: #999999;
+ background-color: #CEDFEF;
+}
+
+#nav-section .menupageitemgroup {
+ padding: 3px 0px 4px 6px;
+ font-style : normal;
+ border-bottom: 1px solid ;
+ border-left: 1px solid ;
+ border-right: 1px solid ;
+ margin-right: 10px;
+ border-color: #999999;
+ background-color: #E5E4D9;
+}
+
+#nav-section .menupageitem {
+ color: #000000;
+ font-style : normal;
+ font-weight : normal;
+ border-width: 0px;
+ font-size : 90%;
+}
+#nav-section .menupageitem a:link { color: #000000;}
+#nav-section .menupageitem a:visited { color: #000000;}
+#nav-section .menupageitem a:hover {
+ background-color: #E5E4D9;
+ color: #000000;
+}
+
+#leftbar #credit {
+ text-align: center;
+}
+
+#leftbar #credit2 {
+ text-align: center;
+ padding: 3px 3px 3px 3px;
+ background-color: #ffffff;
+}
+
+/* DUC - Formerly searchbox */
+#leftbar .searchbox {
+ text-align: center;
+}
+#leftbar .search-input {
+ padding: 3px 3px;
+ margin: 0;
+}
+
+#content {
+ padding: 20px 20px 20px 200px;
+ margin: 0;
+ font : small Verdana, Helvetica, sans-serif;
+}
+
+#content ul {
+ margin: 0;
+ padding: 0 25px;
+}
+#content li {
+ padding: 0 5px;
+}
+#feedback {
+ color: black;
+ background: #CFDCED;
+ text-align:center;
+ margin-top: 5px;
+}
+#feedback #feedbackto {
+ font-size: 90%;
+ color: black;
+}
+#footer {
+ clear: both;
+ position: relative; /* IE bugfix (http://www.dracos.co.uk/web/css/ie6floatbug/) */
+ width: 100%;
+ background-color: #E5E4D9;
+ border-top: solid 1px #4C6C8F;
+ color: black;
+}
+#footer .copyright {
+ position: relative; /* IE bugfix cont'd */
+ padding: 5px;
+ margin: 0;
+ width: 45%;
+}
+#footer .lastmodified {
+ position: relative; /* IE bugfix cont'd */
+ float: right;
+ width: 45%;
+ padding: 5px;
+ margin: 0;
+ text-align: right;
+}
+#footer a { color: brown; }
+
+#footer #siteinfo-compliance-links {
+ text-align: left;
+}
+
+
+/**
+ * Misc Styles
+ */
+
+acronym { cursor: help; }
+.boxed { background-color: #E5E4D9;}
+.underlined_5 { border-bottom: solid 5px #E5E4D9;}
+.underlined_10 { border-bottom: solid 10px #E5E4D9;}
+.code { border-color: #CFDCED;}
+
+
+/* ==================== snail trail ============================ */
+
+.trail {
+ position: relative; /* IE bugfix cont'd */
+ float: left;
+ margin: -10px 5px 0px 5px;
+ padding: 0;
+}
+
+#content .motd-area {
+ position: relative; /* IE bugfix cont'd */
+ float: right;
+ width: 35%;
+ background-color: #f0f0ff;
+ border-top: solid 1px #4C6C8F;
+ border-bottom: solid 1px #4C6C8F;
+ margin-bottom: 15px;
+ margin-left: 15px;
+ margin-right: 10%;
+ padding-bottom: 5px;
+ padding-top: 5px;
+}
+
+#content-minitoc-area {
+ border-top: solid 1px #4C6C8F;
+ border-bottom: solid 1px #4C6C8F;
+ margin-bottom: 15px;
+ margin-left: 15px;
+ margin-right: 10%;
+ padding-bottom: 5px;
+ padding-top: 5px;
+}
+/*** CD : Lien en bleu lors du survol de la souris... **/
+#content-minitoc-area a:hover { border: 0px solid #a5b6c6; background: #CFDCED; }
+
+.minitoc {
+ list-style-image: url('../themes/images/current.gif');
+ font-weight: normal;
+}
+
+li p {
+ margin: 0;
+ padding: 0;
+}
+
+#export-link {
+ position: relative; /* IE bugfix cont'd */
+ float: right;
+ margin: 5px 5px;
+ padding: 0;
+}
+#export-link .caption {
+ display: block;
+ font-size: 70%;
+ padding-left: 1px;
+}
+#export-link .format {
+ display: block;
+ text-align: center;
+ text-decoration: none;
+}
+
+.printlink {
+ float: right;
+}
+.printlink br {
+ margin-top: -10px;
+ padding-left: 1px;
+}
+.printlink a {
+ display: block;
+ font-size: 70%;
+ text-align: center;
+ margin: 0;
+ padding: 0;
+}
+.printlink img {
+ display: block;
+ height: 16px;
+ width: 16px;
+}
+
+p.instruction {
+ display: list-item;
+ list-style-image: url('../themes/images/instruction_arrow.png');
+ list-style-position: outside;
+ margin-left: 2em;
+}
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/branding-theme-profiler.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/branding-theme-profiler.ft
new file mode 100644
index 0000000..f8d7277
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/branding-theme-profiler.ft
@@ -0,0 +1,361 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="branding-theme-profiler" type="nugget">
+
+ <description>
+ <p>
+ <strong>branding-theme-profiler</strong> provides a quick
+ way to change the colors of the theme (it not a "real" color-theme switcher).
+ </p>
+ <pre class="code"><![CDATA[ A theme is a presentation layer that provides an aggregation of
+a) theme structure information (*.fv)
+b) theme style information (*.css & *.png|jpg|gif|...)
+c) theme functionality (*.js & *.ft)]]> </pre>
+ <p> A "real" theme switcher would change a/b/c. </p>
+ <p> A "real" color-theme switcher should also provide a possibility to
+ change each color with a WEB-GUI. </p>
+ <pre class="code"><![CDATA[ <!--Color group: Forrest: example colors similar to forrest.apache.org-->
+ <color name="breadtrail" value="#cedfef" font="#0F3660" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="header" value="#294563"/>
+ <color name="tab-selected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="tab-unselected" value="#b5c7e7" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="subtab-selected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="subtab-unselected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="heading" value="#294563"/>
+ <color name="subheading" value="#4a6d8c"/>
+ <color name="published" value="#4C6C8F" font="#FFFFFF"/>
+ <color name="feedback" value="#4C6C8F" font="#FFFFFF" align="center"/>
+ <color name="navstrip" value="#4a6d8c" font="#ffffff" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="menu" value="#4a6d8c" font="#cedfef" link="#ffffff" vlink="#ffffff" hlink="#ffcf00"/>
+ <color name="toolbox" value="#4a6d8c"/>
+ <color name="border" value="#294563"/>
+ <color name="dialog" value="#4a6d8c"/>
+ <color name="searchbox" value="#4a6d8c" font="#000000"/>
+ <color name="body" value="#ffffff" link="#0F3660" vlink="#009999" hlink="#000066"/>
+ <color name="table" value="#7099C5"/>
+ <color name="table-cell" value="#f0f0ff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#CFDCED"/>
+ <color name="footer" value="#cedfef"/>]]>
+ </pre>
+ <p>
+ These values are used for the generated CSS files.
+ They essentially "override" the default colors defined in the chosen theme.
+ To customize the colors of any theme,
+ use one or all color elements and change the values
+ of the particular color elements that you wish to change.
+ Note that by default, if you do not overide them means that
+ the default colors provided by the theme are being used.
+ </p>
+ <div class="warning">
+ <div class="label">fixme</div>
+ <div class="content">We need to use naming convention for the naming. To overcome following comment:<br/>
+ Some of the element names are obscure, so comments are added to show how
+ the "pelt" theme uses them, other themes might use these elements in a different way or do not support them at all.<br/>
+ Tip: temporarily change the value of an element to red (#ff0000) and see the effect.
+ </div>
+ </div>
+ <div class="note">
+ <div class="label">Comments</div>
+ <div class="content">
+ <p>
+ pelt: breadtrail: the strip at the top of the page and the second strip under the tabs<br/>
+ pelt: header: top strip containing project and group logos<br/>
+ pelt: heading|subheading: section headings within the content<br/>
+ pelt: navstrip: the strip under the tabs which contains the published date<br/>
+ pelt: menu: the left-hand navigation panel<br/>
+ pelt: toolbox: the selected menu item<br/>
+ pelt: searchbox: the background of the searchbox<br/>
+ pelt: border: line border around selected menu item<br/>
+ pelt: body: any remaining parts, e.g. the bottom of the page<br/>
+ pelt: footer: the second from bottom strip containing credit logos and published date<br/>
+ pelt: feedback: the optional bottom strip containing feedback link<br/>
+ </p>
+ </div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="branding-theme-profiler">
+ <forrest:properties contract="branding-theme-profiler">
+ <forrest:property name="branding-theme-profiler-theme">pelt</forrest:property>
+ <forrest:property name="branding-theme-profiler">
+ <color name="header" value="#ff0000"/>
+ <!-- more colors -->
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="branding-theme-profiler" inputFormat="xsl" body="false" head="true">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="branding-theme-profiler-head">
+ <xsl:param name="branding-theme-profiler"/>
+ <xsl:param name="branding-theme-profiler-theme"/>
+ <style type="text/css" media="screen" title="{$branding-theme-profiler-theme}" rel="alternate stylesheet" >
+ <!-- ==================== corner image colors ========================= -->
+ <!--FIXME: Add default values!
+ If not it can result in
+ <link message="http://localhost/:-1
+The attribute "rx of the element ><ellipse> can not be negative" uri="themes/images/roundcorner-t-l-5-bg003366-stroke-fg.png">
+ <referrer uri="samples/index.html"/>
+ </link>
+ Maybe like:
+ -->
+ <xsl:variable name="header-input" select="substring-after($branding-theme-profiler/color[@name='header']/@value, '#')"/>
+ <xsl:variable name="header">
+ <xsl:if test="$header-input=''">000000</xsl:if>
+ <xsl:if test="not($header-input='')"><xsl:value-of select="$header-input"/></xsl:if>
+ </xsl:variable>
+ <xsl:variable name="body-input" select="substring-after($branding-theme-profiler/color[@name='body']/@value, '#')"/>
+ <xsl:variable name="body">
+ <xsl:if test="$body-input=''">ffffff</xsl:if>
+ <xsl:if test="not($body-input='')"><xsl:value-of select="$body-input"/></xsl:if>
+ </xsl:variable>
+ <xsl:variable name="searchbox-input" select="substring-after($branding-theme-profiler/color[@name='searchbox']/@value, '#')"/>
+ <xsl:variable name="searchbox">
+ <xsl:if test="$searchbox-input=''">000000</xsl:if>
+ <xsl:if test="not($searchbox-input='')"><xsl:value-of select="$searchbox-input"/></xsl:if>
+ </xsl:variable>
+
+ <xsl:variable name="tab-selected" select="substring-after($branding-theme-profiler/color[@name='tab-selected']/@value, '#')"/>
+ <xsl:variable name="tab-unselected" select="substring-after($branding-theme-profiler/color[@name='tab-unselected']/@value, '#')"/>
+ <xsl:variable name="menu" select="substring-after($branding-theme-profiler/color[@name='menu']/@value, '#')"/>
+#header .round-top-left-small {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-t-l-5-bg<xsl:value-of select="normalize-space($header)"/>-stroke<xsl:value-of select="normalize-space($searchbox)"/>-fg<xsl:value-of select="normalize-space($searchbox)"/>.png);
+ background-repeat: no-repeat;
+ background-position: top left;
+}
+#header .round-top-right-small {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-t-r-5-bg<xsl:value-of select="normalize-space($header)"/>-stroke<xsl:value-of select="normalize-space($searchbox)"/>-fg<xsl:value-of select="normalize-space($searchbox)"/>.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+#nav-main li {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-t-r-5-bg<xsl:value-of select="normalize-space($header)"/>-stroke<xsl:value-of select="normalize-space($tab-unselected)"/>-fg<xsl:value-of select="normalize-space($tab-unselected)"/>.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+#nav-main li a {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-t-l-5-bg<xsl:value-of select="normalize-space($header)"/>-stroke<xsl:value-of select="normalize-space($tab-unselected)"/>-fg<xsl:value-of select="normalize-space($tab-unselected)"/>.png);
+ background-repeat: no-repeat;
+ background-position: top left;
+}
+#nav-main .current {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-t-r-5-bg<xsl:value-of select="normalize-space($header)"/>-stroke<xsl:value-of select="normalize-space($tab-selected)"/>-fg<xsl:value-of select="normalize-space($tab-selected)"/>.png);
+ background-repeat: no-repeat;
+ background-position: top right;
+}
+#nav-main .current a {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-t-l-5-bg<xsl:value-of select="normalize-space($header)"/>-stroke<xsl:value-of select="normalize-space($tab-selected)"/>-fg<xsl:value-of select="normalize-space($tab-selected)"/>.png);
+ background-repeat: no-repeat;
+ background-position: top left;
+}
+#roundbottom {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-b-r-15-bg<xsl:value-of select="normalize-space($body)"/>-stroke<xsl:value-of select="normalize-space($menu)"/>-fg<xsl:value-of select="normalize-space($menu)"/>.png);
+ background-repeat: no-repeat;
+ background-position: bottom right;
+}
+#roundbottomLeft {
+ background-image: url(<xsl:value-of select="$skin-img-dir"/>/roundcorner-b-l-15-bg<xsl:value-of select="normalize-space($body)"/>-stroke<xsl:value-of select="normalize-space($menu)"/>-fg<xsl:value-of select="normalize-space($menu)"/>.png);
+ background-repeat: no-repeat;
+ background-position: bottom left;
+}
+ <xsl:apply-templates select="$branding-theme-profiler/color"/>
+ </style>
+</xsl:template>
+
+ <!-- ==================== main block colors ============================ -->
+<xsl:template match="color[@name='header']">
+#container { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='tab-selected']">
+#nav-main .current { background-color: <xsl:value-of select="@value"/>;}
+#nav-main .current a:link { color: <xsl:value-of select="@link"/>; }
+#nav-main .current a:visited { color: <xsl:value-of select="@vlink"/>; }
+#nav-main .current a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+
+<xsl:template match="color[@name='tab-unselected']">
+#nav-main li { background-color: <xsl:value-of select="@value"/> ;}
+#nav-main li a:link { color: <xsl:value-of select="@link"/>; }
+#nav-main li a:visited { color: <xsl:value-of select="@vlink"/>; }
+#nav-main li a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+
+<xsl:template match="color[@name='subtab-selected']">
+#level2tabs { background-color: <xsl:value-of select="@value"/> ;}
+#level2tabs a:link { color: <xsl:value-of select="@link"/>; }
+#level2tabs a:visited { color: <xsl:value-of select="@vlink"/>; }
+#level2tabs a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+
+<!--xsl:template match="color[@name='subtab-unselected']">
+.level2tabstrip { background-color: <xsl:value-of select="@value"/>;}
+.datenote { background-color: <xsl:value-of select="@value"/>;}
+.level2tabstrip.unselected a:link { color: <xsl:value-of select="@link"/>; }
+.level2tabstrip.unselected a:visited { color: <xsl:value-of select="@vlink"/>; }
+.level2tabstrip.unselected a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template-->
+
+<xsl:template match="color[@name='heading']">
+.heading { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='subheading']">
+.boxed { background-color: <xsl:value-of select="@value"/>;}
+.underlined_5 {border-bottom: solid 5px <xsl:value-of select="@value"/>;}
+.underlined_10 {border-bottom: solid 10px <xsl:value-of select="@value"/>;}
+table caption {
+background-color: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@font"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='feedback']">
+#feedback {
+color: <xsl:value-of select="@font"/>;
+background: <xsl:value-of select="@value"/>;
+text-align: <xsl:value-of select="@align"/>;
+}
+#feedback #feedbackto {
+color: <xsl:value-of select="@font"/>;
+}
+</xsl:template>
+
+<xsl:template match="color[@name='breadtrail']">
+.breadtrail {
+background: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@font"/>;
+}
+.breadtrail a:link { color: <xsl:value-of select="@link"/>; }
+.breadtrail a:visited { color: <xsl:value-of select="@vlink"/>; }
+.breadtrail a:hover { color: <xsl:value-of select="@hlink"/>; }
+</xsl:template>
+<!--Fix for other (old) profiles-->
+<xsl:template match="color[@name='navstrip']">
+#publishedStrip {
+color: <xsl:value-of select="@font"/>;
+background: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+<!--has to go after the nav-strip (no 'navstrip')-->
+<xsl:template match="color[@name='published']">
+#publishedStrip {
+color: <xsl:value-of select="@font"/>;
+background: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='toolbox']">
+#nav-section .menupagetitle { background-color: <xsl:value-of select="@value"/>}
+</xsl:template>
+
+<xsl:template match="color[@name='border']">
+#leftbar { border-color: <xsl:value-of select="@value"/>;}
+#nav-section .menupagetitle { border-color: <xsl:value-of select="@value"/>;}
+#nav-section .menupageitemgroup { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='menu']">
+#leftbar { background-color: <xsl:value-of select="@value"/>;}
+#leftbar { color: <xsl:value-of select="@font"/>;}
+#leftbar a:link { color: <xsl:value-of select="@link"/>;}
+#leftbar a:visited { color: <xsl:value-of select="@vlink"/>;}
+#leftbar a:hover {
+background-color: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@hlink"/>;}
+</xsl:template>
+<xsl:template match="color[@name='dialog']">
+#nav-section .menupagetitle { color: <xsl:value-of select="@font"/>;}
+#nav-section .menupageitemgroup {
+background-color: <xsl:value-of select="@value"/>;
+}
+#nav-section .menupageitem {
+color: <xsl:value-of select="@font"/>;
+}
+#nav-section .menupageitem a:link { color: <xsl:value-of select="@link"/>;}
+#nav-section .menupageitem a:visited { color: <xsl:value-of select="@vlink"/>;}
+#nav-section .menupageitem a:hover {
+background-color: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@hlink"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='menuheading']">
+#leftbar h1 {
+color: <xsl:value-of select="@font"/>;
+background-color: <xsl:value-of select="@value"/>;
+}
+</xsl:template>
+<xsl:template match="color[@name='searchbox']">
+#header .searchbox {
+background-color: <xsl:value-of select="@value"/> ;
+color: <xsl:value-of select="@font"/>;
+}
+</xsl:template>
+
+<xsl:template match="color[@name='body']">
+body{
+background-color: <xsl:value-of select="@value"/>;
+color: <xsl:value-of select="@font"/>;
+}
+a:link { color:<xsl:value-of select="@link"/>}
+a:visited { color:<xsl:value-of select="@vlink"/>}
+a:hover { color:<xsl:value-of select="@hlink"/>}
+
+</xsl:template>
+
+<xsl:template match="color[@name='footer']">
+#footer { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+
+<!-- ==================== other colors ============================ -->
+<xsl:template match="color[@name='highlight']">
+.highlight { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='fixme']">
+.fixme { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='note']">
+.note { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='warning']">
+.warning { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='code']">
+.code { border-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='table']">
+.ForrestTable { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+
+<xsl:template match="color[@name='table-cell']">
+.ForrestTable td { background-color: <xsl:value-of select="@value"/>;}
+</xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/content-abstract.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/content-abstract.ft
new file mode 100644
index 0000000..bb335ef
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/content-abstract.ft
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-abstract" type="nugget">
+ <description>
+ content-abstract will output the abstract of the content.
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-abstract">
+ <forrest:properties contract="content-abstract">
+ <forrest:property name="content-abstract" nugget="get.abstract">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.abstract.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-abstract" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-abstract-body">
+ <xsl:param name="content-abstract"/>
+<xsl:comment>+
+ |start content-abstract
+ +</xsl:comment>
+ <!-- FIXME - Suppress the following test when empty div problem is solved -->
+ <xsl:if
+ test="normalize-space($content-abstract/div[@class='abstract'])">
+ <xsl:copy-of
+ select="$content-abstract/div[@class='abstract']"/>
+ </xsl:if>
+<xsl:comment>+
+ |end content-abstract
+ +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/content-main.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/content-main.ft
new file mode 100644
index 0000000..4bde390
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/content-main.ft
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="content-main" type="nugget">
+ <description>
+ <p>content-main <br/>Template will output the content-main.</p>
+ <p> properties:<br/> <headings type="boxed"/> - Heading types can be
+ clean|underlined|boxed</p>
+ </description>
+ <usage><![CDATA[<forrest:contract name="content-main">
+ <forrest:properties contract="content-main">
+ <forrest:property name="content-main" nugget="get.body">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.body.xml"/>
+ </forrest:property>
+ <!-- Heading types can be clean|underlined|boxed -->
+ <forrest:property name="content-main-conf">
+ <headings type="boxed"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="content-main" inputFormat="xsl" body="true" head="false">
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="content-main-body" >
+ <xsl:param name="content-main"/>
+ <xsl:param name="content-main-conf"/>
+ <xsl:comment>+ |start content-main +</xsl:comment>
+ <xsl:apply-templates
+ select="$content-main/div[@id='content']/div[@id='content-main']/*">
+ <xsl:with-param name="content-main-conf"
+ select="$content-main-conf"/>
+ </xsl:apply-templates>
+ <xsl:comment>+ |end content-main +</xsl:comment>
+ </xsl:template>
+ <!--headings-->
+ <xsl:template match="div[@class = 'skinconf-heading-1']">
+ <xsl:param name="content-main-conf"/>
+ <xsl:choose>
+ <xsl:when test="$content-main-conf/headings/@type='underlined'">
+ <h2 class="underlined_10"><xsl:value-of select="h1"/></h2>
+ </xsl:when>
+ <xsl:when test="$content-main-conf/headings/@type='boxed'">
+ <h2 class="boxed"><xsl:value-of select="h1"/></h2>
+ </xsl:when>
+ <xsl:otherwise>
+ <h2 class="h3"><xsl:value-of select="h1"/></h2>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="div[@class = 'section']">
+ <xsl:param name="content-main-conf"/>
+ <div class="section">
+ <xsl:apply-templates select="*">
+ <xsl:with-param name="content-main-conf"
+ select="$content-main-conf"/>
+ </xsl:apply-templates>
+ </div>
+ </xsl:template>
+ <xsl:template match="div[@class = 'skinconf-heading-2']">
+ <xsl:param name="content-main-conf"/>
+ <xsl:choose>
+ <xsl:when test="$content-main-conf/headings/@type='underlined'">
+ <h3 class="underlined_5"><xsl:value-of select="h2"/></h3>
+ </xsl:when>
+ <xsl:when test="$content-main-conf/headings/@type='boxed'">
+ <h3 class="boxed"><xsl:value-of select="h2"/></h3>
+ </xsl:when>
+ <xsl:otherwise>
+ <h3 class="h3"><xsl:value-of select="h2"/></h3>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
+ </xsl:copy>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-main-sub.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-main-sub.ft
new file mode 100644
index 0000000..6c79ae6
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-main-sub.ft
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="nav-main-sub" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ nav-main-sub will output the secondary navigation AKA level2.
+ </description>
+ <usage><![CDATA[<forrest:contract name="nav-main-sub">
+ <forrest:properties contract="nav-main-sub">
+ <forrest:property name="nav-main-sub" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="nav-main-sub" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="nav-main-sub-body">
+ <xsl:param name="nav-main-sub" select="'test'"/>
+ <xsl:comment>+
+ |start nav-main-sub
+ +</xsl:comment>
+ <!-- FIXME - Suppress the following test when empty div problem is solved -->
+ <xsl:if test="$nav-main-sub/navigation/tab/div[@id='nav-main-sub']/*">
+ <div id="level2tabs">
+ <xsl:copy-of
+ select="$nav-main-sub/navigation/tab/div[@id='nav-main-sub']/*"/>
+ </div>
+ </xsl:if>
+ <xsl:comment>+
+ |end Endtabs
+ +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-section-round-bottom.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-section-round-bottom.ft
new file mode 100644
index 0000000..09e748a
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-section-round-bottom.ft
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="nav-section-round-bottom" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ nav-section-round-bottom will output the round bottom of the navigation menues
+ </description>
+ <usage><![CDATA[<forrest:contract name="nav-section-round-bottom"/>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="nav-section-round-bottom" inputFormat="xsl" body="true" head="false">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="nav-section-round-bottom-body">
+ <div id="roundbottom">
+ <div id="roundbottomLeft"><img src="{$skin-img-dir}/spacer.gif" alt="spacer" /></div>
+ </div>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-section.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-section.ft
new file mode 100644
index 0000000..aede67f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/nav-section.ft
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="nav-section" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ <p>
+ <strong>nav-section</strong> will output the navigation to pages within the current site section AKA menu.
+ </p>
+ <div class="note">
+ <div class="label">Minitoc inclusion</div>
+ <div class="content">
+ <p><code><toc></code> argument can be used to specify the minitoc depth.<br/>
+ This argument is facultative and no minitoc will be displayed if it is omitted.
+ </p>
+ </div>
+ </div>
+ </description>
+ <usage><![CDATA[<forrest:contract name="nav-section">
+ <forrest:properties contract="nav-section">
+ <forrest:property name="nav-section" nugget="get.navigation">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.navigation.xml"/>
+ </forrest:property>
+ <forrest:property name="nav-section-toc" nugget="get.toc">
+ <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.toc.xml"/>
+ </forrest:property>
+ [<forrest:property name="toc" max-depth="2"/>]
+ </forrest:properties>
+</forrest:contract>]]></usage>
+ <forrest:template
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="nav-section" inputFormat="xsl" body="true" head="true">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="nav-section-head">
+ <script type="text/javascript" language="javascript"
+ src="{$root}themes/menu.js"> </script>
+ </xsl:template>
+
+ <xsl:template name="nav-section-body">
+ <xsl:param name="nav-section" select="'test'"/>
+ <xsl:param name="nav-section-toc" select="'test'"/>
+ <xsl:param name="toc" select="'noToc'"/>
+<xsl:comment>+
+ |start menu
+ +</xsl:comment>
+ <xsl:variable name="max-depth">
+ <xsl:choose>
+ <xsl:when test="$toc = 'noToc'">0</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$toc/@max-depth"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$nav-section/navigation/menu/div[@id='menu']/ul/li">
+ <xsl:call-template name="menu">
+ <xsl:with-param name="root" select="$nav-section/navigation/menu"/>
+ <xsl:with-param name="nav-section-toc" select="$nav-section-toc"/>
+ <xsl:with-param name="max-depth" select="$max-depth"/>
+ </xsl:call-template>
+ </xsl:if>
+<xsl:comment>+
+ |end menu
+ +</xsl:comment>
+ </xsl:template>
+ <xsl:template name="menu">
+ <xsl:param name="root" value="'test'"/>
+ <xsl:param name="nav-section-toc" value="'test'"/>
+ <xsl:param name="max-depth" value="0"/>
+<xsl:comment>+
+ |start Menu
+ +</xsl:comment>
+ <div id="nav-section">
+ <ul>
+<!--menu - inner-->
+ <xsl:for-each select = "$root/div[@id='menu']/ul/li">
+ <xsl:call-template name = "innermenuli" >
+ <xsl:with-param name="id" select="concat('1.', position())"/>
+ <xsl:with-param name="nav-section-toc" select="$nav-section-toc"/>
+ <xsl:with-param name="max-depth" select="$max-depth"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </ul>
+ </div>
+ </xsl:template>
+
+ <xsl:template name="innermenuli">
+ <xsl:param name="id"/>
+ <xsl:param name="nav-section-toc"/>
+ <xsl:param name="max-depth"/>
+ <xsl:variable name="tagid">
+ <xsl:choose>
+ <xsl:when test="descendant-or-self::node()/li/div/@class='current'"><xsl:value-of select="concat('menu_selected_',$id)"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="concat('menu_',concat(font,$id))"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="selected">
+ <xsl:choose>
+ <xsl:when test="descendant-or-self::node()/li/div/@class='current'">selected</xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <li class="pagegroup{$selected}" id="{$tagid}Title"><span onclick="SwitchMenu('{$tagid}')"><xsl:value-of select="h1"/></span>
+ <ul class="{$selected}menuitemgroup" id="{$tagid}">
+ <xsl:for-each select= "ul/li">
+
+ <xsl:choose>
+ <xsl:when test="a">
+ <li class="menuitem"><a href="{a/@href}" title="{a/@title}"><xsl:value-of select="a" /></a></li>
+ </xsl:when>
+ <xsl:when test="div/@class='current'">
+ <li class="menupage">
+ <div class="menupagetitle"><xsl:value-of select="div" /></div>
+ <xsl:if test="$max-depth>0">
+ <ul>
+ <li class="menupageitemgroup">
+ <xsl:for-each select = "$nav-section-toc//tocitems/tocitem">
+ <div class="menupageitem">
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space(@title))>15">
+ <a href="{@href}" title="{normalize-space(@title)}"><xsl:value-of
+ select="substring(@title,0,20)" />...</a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@href}" title="{normalize-space(@title)}">
+ <xsl:value-of select="@title" />
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:for-each>
+ </li>
+ </ul>
+ </xsl:if>
+ </li>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name = "innermenuli">
+ <xsl:with-param name="id" select="concat($id, '.', position())"/>
+ <xsl:with-param name="nav-section-toc" select="$nav-section-toc"/>
+ <xsl:with-param name="max-depth" select="$max-depth"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/search-input.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/search-input.ft
new file mode 100644
index 0000000..22383b4
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/search-input.ft
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<forrest:contract name="search-input" type="nugget"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
+ <description>
+ search-input will output the default search form.
+ </description>
+ <usage><![CDATA[<forrest:contract name="search-input">
+ <forrest:properties contract="search-input">
+ <forrest:property name="search-lucene">lucene-search.html</forrest:property>
+ <forrest:property name="input-size">25</forrest:property>
+ <forrest:property name="search-input">
+ <search name="MyProject" domain="mydomain" provider="google"/>
+ </forrest:property>
+ </forrest:properties>]
+</forrest:contract>]]></usage>
+
+ <forrest:template
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="search-input" inputFormat="xsl" body="true" head="true">
+
+ <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!--FIXME: IMO each search provider should provide a form. This form should be refactored into
+ a meta-search from-->
+ <xsl:template name="search-input-head">
+ <script type="text/javascript" language="javascript" src="{$root}themes/getBlank.js"> </script>
+ </xsl:template>
+
+ <xsl:template name="search-input-body">
+ <xsl:param name="search-lucene" select="'lucene-search.html'"/>
+ <xsl:param name="input-size">25</xsl:param>
+ <xsl:param name="search-input"/>
+<xsl:comment>+
+ |start Search
+ +</xsl:comment>
+ <div class="searchbox">
+ <div class="round-top-left-small">
+ <div class="round-top-right-small">
+ <div class="search-input">
+ <!-- Form prompt -->
+ <xsl:variable name="search-prompt">
+ <i18n:text>Search the site with</i18n:text>
+ <xsl:value-of select="$search-input/search/@provider"/>
+ </xsl:variable>
+ <!-- Form action -->
+ <xsl:variable name="search-action">
+ <xsl:choose>
+ <xsl:when test="$search-input/search/@provider = 'lucene'">
+ <xsl:value-of select="$root"/>
+ <xsl:value-of select="$search-lucene"/>
+ </xsl:when>
+ <xsl:otherwise>http://www.google.com/search</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Form query field -->
+ <xsl:variable name="search-query">
+ <xsl:choose>
+ <xsl:when test="$search-input/search/@provider = 'lucene'">
+ queryString</xsl:when>
+ <xsl:otherwise>q</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Search form generation -->
+ <form method="get" action="{$search-action}">
+ <div class="search-hidden">
+ <input type="hidden" name="sitesearch"
+ value="{$search-input/search/@domain}"/>
+ </div>
+ <div class="search-field">
+ <input type="text" name="{$search-query}"
+ size="{$input-size}" value="{normalize-space($search-prompt)}"
+ onFocus="getBlank(this, '{normalize-space($search-prompt)}');"
+ onBlur="getPrompt(this, '{normalize-space($search-prompt)}');"/>
+ </div>
+ <div class="search-submit">
+ <input type="submit" value="Search" name="Search"
+ i18n:attr="value"/>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ <xsl:comment>+ |end search +</xsl:comment>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/siteinfo-credits.ft b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/siteinfo-credits.ft
new file mode 100644
index 0000000..c9a4316
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/html/siteinfo-credits.ft
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed 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.
+-->
+<forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ name="siteinfo-credits" type="nugget">
+ <description> siteinfo-credits - Template will output the siteinfo-credits
+ with pelt look'n feel. </description>
+ <usage><![CDATA[<forrest:contract name="siteinfo-credits">
+ [<forrest:properties contract="siteinfo-credits">
+ <forrest:property name="box-location"></forrest:property>
+ <forrest:property name="top-separator">[true|<strong>false</strong>]</forrest:property>
+ <forrest:property name="use-role-as-prefix">[true|<strong>false</strong>]</forrest:property>
+ <forrest:property name="siteinfo-credits">
+ <credits>
+ <credit>
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ <image>images/built-with-forrest-button.png</image>
+ <width>88</width>
+ <height>31</height>
+ </credit>
+ </credits>
+ </forrest:property>
+ </forrest:properties>]
+ </forrest:contract>]]></usage>
+ <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+ format="html" name="siteinfo-credits" inputFormat="xsl" body="true"
+ head="false">
+ <xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template name="siteinfo-credits-body">
+ <xsl:param name="siteinfo-credits"/>
+ <xsl:param name="box-location"></xsl:param>
+ <xsl:param name="top-separator">false</xsl:param>
+ <xsl:param name="use-role-as-prefix">false</xsl:param>
+ <xsl:if test="$siteinfo-credits/credits/credit[starts-with( $filename, concat( @role, '.') )]">
+ <xsl:comment> |start siteinfo-credits </xsl:comment>
+ <div id="{$box-location}">
+ <xsl:if test="$top-separator = 'true'">
+ <hr/>
+ </xsl:if>
+ <xsl:for-each
+ select="$siteinfo-credits/credits/credit[starts-with( $filename, concat( @role, '.') )]">
+ <xsl:if test="not( position()=1 )">
+ <br/>
+ </xsl:if>
+ <xsl:variable name="name" select="name"/>
+ <xsl:variable name="url" select="url"/>
+ <xsl:variable name="image" select="image"/>
+ <xsl:variable name="width" select="width"/>
+ <xsl:variable name="height" select="height"/>
+ <a href="{$url}">
+ <img alt="{$name} - logo" title="{$name}" border="0">
+ <xsl:attribute name="src">
+ <xsl:if test="not(starts-with($image, 'http://'))">
+ <xsl:value-of select="$root"/>
+ </xsl:if>
+ <xsl:value-of select="$image"/>
+ </xsl:attribute>
+ <xsl:attribute name="style">
+ <xsl:if test="$width">width: <xsl:value-of
+ select="$width"/>px;</xsl:if>
+ <xsl:if test="$height">height: <xsl:value-of
+ select="$height"/>px;</xsl:if>
+ </xsl:attribute>
+ </img>
+ </a>
+ </xsl:for-each>
+ </div>
+ <xsl:comment>+ |end siteinfo-credits +</xsl:comment>
+ </xsl:if>
+ </xsl:template>
+ </xsl:stylesheet>
+ </forrest:template>
+</forrest:contract>
\ No newline at end of file
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/Thumbs.db b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/Thumbs.db
new file mode 100644
index 0000000..447f3da
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/Thumbs.db
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/chapter.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/chapter.gif
new file mode 100644
index 0000000..72b8f01
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/chapter.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/chapter_open.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/chapter_open.gif
new file mode 100644
index 0000000..56acd7e
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/chapter_open.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/current.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/current.gif
new file mode 100644
index 0000000..af0f64f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/current.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/doc.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/doc.gif
new file mode 100644
index 0000000..0837437
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/doc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background-grad.png b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background-grad.png
new file mode 100644
index 0000000..6f0b9de
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background-grad.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background.gif
new file mode 100644
index 0000000..054508c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background.png b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background.png
new file mode 100644
index 0000000..5a476e2
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header-background.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header_white_line.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header_white_line.gif
new file mode 100644
index 0000000..369cae8
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/header_white_line.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/instruction_arrow.png b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/instruction_arrow.png
new file mode 100644
index 0000000..0fbc724
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/instruction_arrow.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/label.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/label.gif
new file mode 100644
index 0000000..bc4cb58
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/label.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/page.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/page.gif
new file mode 100644
index 0000000..b0b3944
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/page.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/pdfdoc.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/pdfdoc.gif
new file mode 100644
index 0000000..00dee28
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/pdfdoc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/printer.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/printer.gif
new file mode 100644
index 0000000..5021187
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/printer.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/search-left.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/search-left.gif
new file mode 100644
index 0000000..cb20446
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/search-left.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/search-right.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/search-right.gif
new file mode 100644
index 0000000..1005573
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/search-right.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/sidebar_bg.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/sidebar_bg.gif
new file mode 100644
index 0000000..4e5eb05
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/sidebar_bg.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/singlepage.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/singlepage.gif
new file mode 100644
index 0000000..cb0d293
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/singlepage.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/spacer.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/spacer.gif
new file mode 100644
index 0000000..35d42e8
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/spacer.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tab-left.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tab-left.gif
new file mode 100644
index 0000000..1b46b5a
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tab-left.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tab-right.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tab-right.gif
new file mode 100644
index 0000000..81125cb
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tab-right.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tl-off.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tl-off.gif
new file mode 100644
index 0000000..0b841e0
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tl-off.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tl-on.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tl-on.gif
new file mode 100644
index 0000000..bfe1278
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tl-on.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tr-off.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tr-off.gif
new file mode 100644
index 0000000..3fc57ac
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tr-off.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tr-on.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tr-on.gif
new file mode 100644
index 0000000..b236289
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/tr-on.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/xmldoc.gif b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/xmldoc.gif
new file mode 100644
index 0000000..ca1224f
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/resources/themes/pelt/images/xmldoc.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/favicon.ico b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/favicon.ico
new file mode 100644
index 0000000..161bcf7
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/favicon.ico
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/group-logo.gif b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/group-logo.gif
new file mode 100644
index 0000000..f017f32
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/group-logo.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/group.svg b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/group.svg
new file mode 100644
index 0000000..4819612
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/group.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+ SVG Anteater logo
+
+To get started with SVG, I'd recommend getting the Adobe SVG plugin, and the
+xml-batik CVS module. Then have a look at the xml-batik/samples files. Use the
+SVG spec (http://www.w3.org/TR/SVG/) as a reference.
+-->
+
+<!-- See Forrest Issue: FOR-229
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
+[
+ <!ATTLIST svg xmlns:for CDATA #FIXED "http://apache.org/forrest">
+ <!ENTITY % textExt "|for:group-name">
+ <!ELEMENT for:group-name (#PCDATA)>
+]>
+-->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xsl:version="1.0"
+ xmlns:for="http://apache.org/forrest"
+ width="220" height="65" >
+ <title>Anteater logo</title>
+
+ <defs>
+
+ <!--
+ <radialGradient id="radialGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </radialGradient>
+ <linearGradient id="linearGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </linearGradient>
+ -->
+
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
+ <stop style="stop-color:white" offset="0"/>
+ <stop style="stop-color:lightgreen" offset="1"/>
+ </linearGradient>
+
+ <filter id="shadowFilter" filterUnits="objectBoundingBox">
+ <!-- Takes the alpha channel (black outline of the text), blurs it and saves as 'blur' -->
+ <feGaussianBlur in="SourceAlpha" stdDeviation="2 2" result="blur"/>
+ <!-- Takes saved 'blur' and offsets it by 4 pixels, saves as 'offsetBlur' -->
+ <feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
+ <!-- Merges SourceGraphic (original image) and 'offsetBlur', putting the
+ former 'over' the latter, and using the merged result as the finished
+ image -->
+ <feComposite in="SourceGraphic" in2="offsetBlur" operator="over"/>
+ </filter>
+
+ </defs>
+
+ <g filter="url(#shadowFilter)" fill="url(#gradient)">
+ <text x="40%" y="60%" style="font-size:24pt; font-family:Verdana ; text-anchor: middle">
+ <for:group-name />
+ </text>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/icon.png b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/icon.png
new file mode 100644
index 0000000..3be8bbb
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/icon.png
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/project-logo.gif b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/project-logo.gif
new file mode 100644
index 0000000..0be777d
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/project-logo.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/project.svg b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/project.svg
new file mode 100644
index 0000000..01abcdb
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/project.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+ Copyright 2002-2004 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+ SVG Anteater logo
+
+To get started with SVG, I'd recommend getting the Adobe SVG plugin, and the
+xml-batik CVS module. Then have a look at the xml-batik/samples files. Use the
+SVG spec (http://www.w3.org/TR/SVG/) as a reference.
+-->
+
+<!-- See Forrest Issue: FOR-229
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
+[
+ <!ATTLIST svg xmlns:for CDATA #FIXED "http://apache.org/forrest">
+ <!ENTITY % textExt "|for:project-name">
+ <!ELEMENT for:project-name (#PCDATA)>
+]>
+-->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xsl:version="1.0"
+ xmlns:for="http://apache.org/forrest"
+ width="420" height="65" >
+ <title>Anteater logo</title>
+
+ <defs>
+
+ <!--
+ <radialGradient id="radialGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </radialGradient>
+ <linearGradient id="linearGradient">
+ <stop style="stop-color:gold" offset="0"/>
+ <stop style="stop-color:orange" offset=".5"/>
+ <stop style="stop-color:crimson" offset="1"/>
+ </linearGradient>
+ -->
+
+ <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
+ <stop style="stop-color:white" offset="0"/>
+ <stop style="stop-color:lightgreen" offset="1"/>
+ </linearGradient>
+
+ <filter id="shadowFilter" filterUnits="objectBoundingBox" width="1.4" height="1.4">
+ <!-- Takes the alpha channel (black outline of the text), blurs it and saves as 'blur' -->
+ <feGaussianBlur in="SourceAlpha" stdDeviation="2 2" result="blur"/>
+ <!-- Takes saved 'blur' and offsets it by 4 pixels, saves as 'offsetBlur' -->
+ <feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
+ <!-- Merges SourceGraphic (original image) and 'offsetBlur', putting the
+ former 'over' the latter, and using the merged result as the finished
+ image -->
+ <feComposite in="SourceGraphic" in2="offsetBlur" operator="over"/>
+ </filter>
+
+ </defs>
+
+ <g filter="url(#shadowFilter)" fill="url(#gradient)">
+ <text x="100%" y="60%" style="font-size:24pt; font-family:Verdana ; text-anchor: end" >
+ <for:project-name />
+ </text>
+ </g>
+</svg>
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/usemap.gif b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/usemap.gif
new file mode 100644
index 0000000..c10732c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/images/usemap.gif
Binary files differ
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/index.xml b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/index.xml
new file mode 100644
index 0000000..68f18d5
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/index.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>forrest:viewsHelper - style your site</title>
+ <abstract>This plugin is a ViewHelper implementation used by the view plugin.</abstract>
+ </header>
+ <body>
+<section>
+ <title>How to create your own implementation </title>
+ <p>Diwaker Gupta wrote: "Of course, we can have a good debate on whats the best way to
+generate XHTML content for the tabs to make it "most amenable" to CSS
+skinning. Personally, I would just output each tab in its own div
+element, with class attributes denoting the selected tab. One can then
+use CSS to structure/color them appropriately."</p>
+<note>All following explanations/steps assume you use the default
+configuration of forrest.</note>
+ <p>Ok, you may want to try another feature that is coming with
+forrest:views.</p>
+<section>
+ <title>Create your own contract implementation</title>
+ <ol>
+ <li>Create in src/documentation the folder resources/templates. ...or
+more generally speaking create ${project.resources-dir}/templates.</li>
+ <li>Copy
+{this.plugins.path}/resources/templates/nav-main.ft to this folder.
+</li>
+ <li>Add after the <![CDATA[<xsl:template name="nav-main-body"/>]]> something like
+</li>
+</ol>
+ <source><![CDATA[<xsl:template match="ul[@id='nav-main']">
+<div id="nav-main">
+ <xsl:apply-templates select="li"/>
+</div>
+</xsl:template>
+<xsl:template match="li[not(@class)]">
+<div class="base-not-selected">
+ <xsl:apply-templates/>
+</div>
+</xsl:template>
+<xsl:template match="li[@class='current']">
+<div class="current">
+ <xsl:apply-templates/>
+</div>
+</xsl:template>]]></source>
+<ol>
+<li>Change the css in <![CDATA[<xsl:template name="nav-main-css">]]>. I tried but
+the result is not nice. If you succeed please change the name of the
+contract to "nav-main-div", add the patch to the issue-tracker and I add
+the new contract to the themer plugin. ;-)</li>
+ </ol>
+</section>
+
+ <p>You can find more implementations in {this.plugins.path}/resources/templates/.</p>
+ </section>
+ </body>
+</document>
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/site.xml b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/site.xml
new file mode 100644
index 0000000..08563b4
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/site.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+Forrest site.xml
+
+This file contains an outline of the site's information content. It is used to:
+- Generate the website menus (though these can be overridden - see docs)
+- Provide semantic, location-independent aliases for internal 'site:' URIs, eg
+<link href="site:changes"> links to changes.html (or ../changes.html if in
+ subdir).
+- Provide aliases for external URLs in the external-refs section. Eg, <link
+ href="ext:cocoon"> links to http://cocoon.apache.org/
+
+See http://forrest.apache.org/docs/linking.html for more info
+-->
+
+<site label="org.apache.forrest.plugin.output.themer" href="" xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
+
+ <about label="About">
+ <index label="Index" href="index.html" description="Welcome to org.apache.forrest.plugin.output.themer"/>
+ <changes label="Changes" href="changes.html" description="History of Changes" />
+ <todo label="Todo" href="todo.html" description="Todo List" />
+ </about>
+
+ <!--
+ The href must be wholesite.html/pdf You can change the labels and node names
+ <all label="All">
+ <whole_site_html label="Whole Site HTML" href="wholesite.html"/>
+ <whole_site_pdf label="Whole Site PDF" href="wholesite.pdf"/>
+ </all>
+ -->
+
+ <external-refs>
+ <forrest href="http://forrest.apache.org/">
+ <linking href="docs/linking.html"/>
+ <validation href="docs/validation.html"/>
+ <webapp href="docs/your-project.html#webapp"/>
+ <dtd-docs href="docs/dtd-docs.html"/>
+ </forrest>
+ <cocoon href="http://cocoon.apache.org/"/>
+ <xml.apache.org href="http://xml.apache.org/"/>
+ </external-refs>
+
+</site>
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/tabs.xml b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/tabs.xml
new file mode 100644
index 0000000..43e3d9c
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/content/xdocs/tabs.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!DOCTYPE tabs PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.1//EN" "http://forrest.apache.org/dtd/tab-cocoon-v11.dtd">
+
+<tabs software="MyProj"
+ title="MyProj"
+ copyright="Foo"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <!-- The rules for tabs are:
+ @dir will always have '/@indexfile' added.
+ @indexfile gets appended to @dir if the tab is selected. Defaults to 'index.html'
+ @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 @id's are present, site.xml entries with a matching @tab will be in that tab.
+
+ Tabs can be embedded to a depth of two. The second level of tabs will only
+ be displayed when their parent tab is selected.
+ -->
+
+ <tab id="" label="Home" dir="" indexfile="index.html"/>
+ <!-- Add new tabs here, eg:
+ <tab label="How-Tos" dir="community/howto/"/>
+ <tab label="XML Site" dir="xml-site/"/>
+ -->
+
+</tabs>
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/skinconf.proposal.xml b/plugins/org.apache.forrest.themes.core/src/documentation/skinconf.proposal.xml
new file mode 100644
index 0000000..b9f58af
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/skinconf.proposal.xml
@@ -0,0 +1,392 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--
+Skin configuration file. This file contains details of your project,
+which will be used to configure the chosen Forrest skin.
+-->
+
+<!--<!DOCTYPE skinconfig PUBLIC "-//APACHE//DTD Skin Configuration V0.6-3//EN" "http://forrest.apache.org/dtd/skinconfig-v06-3.dtd">-->
+<forrest:properties contract="skinconfig">
+
+ <forrest:property contract="search">
+ <!-- To enable lucene search add provider="lucene" (default is google).
+ Add box-location="alt" to move the search box to an alternate location
+ (if the skin supports it) and box-location="all" to show it in all
+ available locations on the page. Remove the <search> element to show
+ no search box. @domain will enable sitesearch for the specific domain with google.
+ In other words google will search the @domain for the query string.
+ -->
+ <search name="org.apache.forrest.plugin.leather Plugin" domain="mydomain" provider="google"/>
+ </forrest:property>
+
+
+ <!-- Disable the print link? If enabled, invalid HTML 4.0.1 -->
+ <forrest:property name="print-link">true</forrest:property>
+ <!-- Disable the PDF link? -->
+ <forrest:property name="pdf-link">false</forrest:property>
+ <!-- Disable the POD link? -->
+ <forrest:property name="pod-link">true</forrest:property>
+ <!-- Disable the Text link? FIXME: NOT YET IMPLEMENETED. -->
+ <forrest:property name="txt">true</forrest:property>
+ <!-- Disable the xml source link? -->
+ <!-- The xml source link makes it possible to access the xml rendition
+ of the source frim the html page, and to have it generated statically.
+ This can be used to enable other sites and services to reuse the
+ xml format for their uses. Keep this disabled if you don't want other
+ sites to easily reuse your pages.-->
+ <forrest:property name="xml-link">true</forrest:property>
+
+ <!-- Disable navigation icons on all external links? -->
+ <forrest:property name="external-link-image">false</forrest:property>
+
+ <!-- Disable w3c compliance links?
+ Use e.g. align="center" to move the compliance links logos to
+ an alternate location default is left.
+ (if the skin supports it) -->
+ <forrest:property name="compliance-links">false</forrest:property>
+
+ <!-- Render mailto: links unrecognisable by spam harvesters? -->
+ <forrest:property name="obfuscate-mail-links">true</forrest:property>
+ <forrest:property name="obfuscate-mail-value">.at.</forrest:property>
+
+ <!-- Disable the javascript facility to change the font size -->
+ <forrest:property name="font-script">true</forrest:property>
+
+
+ <forrest:property contract="project-logo">
+ <!-- mandatory project logo
+ default skin: renders it at the top -->
+ <project-name>org.apache.forrest.plugin.leather</project-name>
+ <project-description>org.apache.forrest.plugin.leather plugin for Apache Forrest</project-description>
+ <project-url>http://myproj.mygroup.org/</project-url>
+ <project-logo>images/project.png</project-logo>
+ <!-- Alternative static image:
+ <project-logo>images/project-logo.gif</project-logo> -->
+ </forrest:property>
+
+
+ <forrest:property contract="group-logo">
+ <!-- optional group logo
+ default skin: renders it at the top-left corner -->
+ <group-name>MyGroup</group-name>
+ <group-description>MyGroup Description</group-description>
+ <group-url>http://mygroup.org</group-url>
+ <group-logo>images/group.png</group-logo>
+ <!-- Alternative static image:
+ <group-logo>images/group-logo.gif</group-logo> -->
+ </forrest:property>
+
+
+ <forrest:property contract="host-logo">
+ <!-- optional host logo (e.g. sourceforge logo)
+ default skin: renders it at the bottom-left corner -->
+ <host-url></host-url>
+ <host-logo></host-logo>
+ </forrest:property>
+
+
+ <forrest:property contract="favicon">
+ <!-- relative url of a favicon file, normally favicon.ico -->
+ <favicon-url></favicon-url>
+ </forrest:property>
+
+
+ <forrest:property contract="copyright">
+ <!-- The following are used to construct a copyright statement -->
+ <year>2005</year>
+ <vendor>The Apache Software Foundation.</vendor>
+ <copyright-link>http://www.apache.org/licenses/</copyright-link>
+ </forrest:property>
+
+
+ <forrest:property contract="trail">
+ <!-- Some skins use this to form a 'breadcrumb trail' of links.
+ Use location="alt" to move the trail to an alternate location
+ (if the skin supports it).
+ Omit the location attribute to display the trail in the default location.
+ Use location="none" to not display the trail (if the skin supports it).
+ For some skins just set the attributes to blank.
+ -->
+ <trail>
+ <link1 name="Apache Forrest" href="http://forrest.apache.org/"/>
+ <link2 name="org.apache.forrest.plugin.leather" href="http://forrest.apache.org/plugins/org.apache.forrest.plugin.leather"/>
+ <link3 name="" href=""/>
+ </trail>
+ </forrest:property>
+
+
+ <forrest:property contract="toc">
+ <!-- Configure the TOC, i.e. the Table of Contents.
+ @max-depth
+ how many "section" levels need to be included in the
+ generated Table of Contents (TOC).
+ @min-sections
+ Minimum required to create a TOC.
+ @location ("page","menu","page,menu", "none")
+ Where to show the TOC.
+ -->
+ <toc max-depth="2" min-sections="1" location="page"/>
+ </forrest:property>
+
+
+ <forrest:property contract="heading">
+ <!-- Heading types can be clean|underlined|boxed -->
+ <headings type="boxed"/>
+ </forrest:property>
+
+
+ <forrest:property contract="feedback">
+ <!-- The optional feedback element will be used to construct a
+ feedback link in the footer with the page pathname appended:
+ <a href="@href">{@to}</a>
+ -->
+ <feedback to="webmaster@foo.com"
+ href="mailto:webmaster@foo.com?subject=Feedback " >
+ Send feedback about the website to:
+ </feedback>
+ </forrest:property>
+
+
+ <forrest:property contract="extra-css">
+ <!--
+ extra-css - here you can define custom css-elements that are
+ a. overriding the fallback elements or
+ b. adding the css definition from new elements that you may have
+ used in your documentation.
+ -->
+ <extra-css>
+ <!--Example of b.
+ To define the css definition of a new element that you may have used
+ in the class attribute of a <p> node.
+ e.g. <p class="quote"/>
+ -->
+ p.quote {
+ margin-left: 2em;
+ padding: .5em;
+ background-color: #f0f0f0;
+ font-family: monospace;
+ }
+ </extra-css>
+ </forrest:property>
+
+
+ <forrest:property contract="colors">
+ <colors>
+ <!-- These values are used for the generated CSS files. -->
+
+ <!-- Krysalis -->
+<!--
+ <color name="header" value="#FFFFFF"/>
+
+ <color name="tab-selected" value="#a5b6c6" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="tab-unselected" value="#F7F7F7" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-selected" value="#a5b6c6" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-unselected" value="#a5b6c6" link="#000000" vlink="#000000" hlink="#000000"/>
+
+ <color name="heading" value="#a5b6c6"/>
+ <color name="subheading" value="#CFDCED"/>
+
+ <color name="navstrip" value="#CFDCED" font="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="toolbox" value="#a5b6c6"/>
+ <color name="border" value="#a5b6c6"/>
+
+ <color name="menu" value="#F7F7F7" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="dialog" value="#F7F7F7"/>
+
+ <color name="body" value="#ffffff" link="#0F3660" vlink="#009999" hlink="#000066"/>
+
+ <color name="table" value="#a5b6c6"/>
+ <color name="table-cell" value="#ffffff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#a5b6c6"/>
+
+ <color name="footer" value="#a5b6c6"/>
+-->
+
+ <!-- Forrest -->
+<!--
+ <color name="header" value="#294563"/>
+
+ <color name="tab-selected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="tab-unselected" value="#b5c7e7" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="subtab-selected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="subtab-unselected" value="#4a6d8c" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+
+ <color name="heading" value="#294563"/>
+ <color name="subheading" value="#4a6d8c"/>
+
+ <color name="navstrip" value="#cedfef" font="#0F3660" link="#0F3660" vlink="#0F3660" hlink="#000066"/>
+ <color name="toolbox" value="#4a6d8c"/>
+ <color name="border" value="#294563"/>
+
+ <color name="menu" value="#4a6d8c" font="#cedfef" link="#ffffff" vlink="#ffffff" hlink="#ffcf00"/>
+ <color name="dialog" value="#4a6d8c"/>
+
+ <color name="body" value="#ffffff" link="#0F3660" vlink="#009999" hlink="#000066"/>
+
+ <color name="table" value="#7099C5"/>
+ <color name="table-cell" value="#f0f0ff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#CFDCED"/>
+
+ <color name="footer" value="#cedfef"/>
+-->
+
+ <!-- Collabnet -->
+<!--
+ <color name="header" value="#003366"/>
+
+ <color name="tab-selected" value="#dddddd" link="#555555" vlink="#555555" hlink="#555555"/>
+ <color name="tab-unselected" value="#999999" link="#ffffff" vlink="#ffffff" hlink="#ffffff"/>
+ <color name="subtab-selected" value="#cccccc" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-unselected" value="#cccccc" link="#555555" vlink="#555555" hlink="#555555"/>
+
+ <color name="heading" value="#003366"/>
+ <color name="subheading" value="#888888"/>
+
+ <color name="navstrip" value="#dddddd" font="#555555"/>
+ <color name="toolbox" value="#dddddd" font="#555555"/>
+ <color name="border" value="#999999"/>
+
+ <color name="menu" value="#ffffff"/>
+ <color name="dialog" value="#eeeeee"/>
+
+ <color name="body" value="#ffffff"/>
+
+ <color name="table" value="#ccc"/>
+ <color name="table-cell" value="#ffffff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#003366"/>
+
+ <color name="footer" value="#ffffff"/>
+-->
+ <!-- Lenya using pelt-->
+<!--
+
+ <color name="header" value="#ffffff"/>
+
+ <color name="tab-selected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="tab-unselected" value="#F5F4E9" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-selected" value="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="subtab-unselected" value="#E5E4D9" link="#000000" vlink="#000000" hlink="#000000"/>
+
+ <color name="heading" value="#E5E4D9"/>
+ <color name="subheading" value="#000000"/>
+ <color name="published" value="#000000"/>
+ <color name="navstrip" value="#E5E4D9" font="#000000"/>
+ <color name="toolbox" value="#CFDCED" font="#000000"/>
+ <color name="border" value="#999999"/>
+
+ <color name="menu" value="#E5E4D9" font="#000000" link="#000000" vlink="#000000" hlink="#000000"/>
+ <color name="dialog" value="#CFDCED"/>
+ <color name="body" value="#ffffff" />
+
+ <color name="table" value="#ccc"/>
+ <color name="table-cell" value="#ffffff"/>
+ <color name="highlight" value="#ffff00"/>
+ <color name="fixme" value="#cc6600"/>
+ <color name="note" value="#006699"/>
+ <color name="warning" value="#990000"/>
+ <color name="code" value="#003366"/>
+
+ <color name="footer" value="#E5E4D9"/>
+-->
+ </colors>
+ </forrest:property>
+
+
+ <forrest:property contract="credits">
+ <!-- Settings specific to PDF output. -->
+ <pdf>
+ <!--
+ Supported page sizes are a0, a1, a2, a3, a4, a5, executive,
+ folio, legal, ledger, letter, quarto, tabloid (default letter).
+ Supported page orientations are portrait, landscape (default
+ portrait).
+ Supported text alignments are left, right, justify (default left).
+ -->
+ <page size="letter" orientation="portrait" text-align="left"/>
+
+ <!--
+ Margins can be specified for top, bottom, inner, and outer
+ edges. If double-sided="false", the inner edge is always left
+ and the outer is always right. If double-sided="true", the
+ inner edge will be left on odd pages, right on even pages,
+ the outer edge vice versa.
+ Specified below are the default settings.
+ -->
+ <margins double-sided="false">
+ <top>1in</top>
+ <bottom>1in</bottom>
+ <inner>1.25in</inner>
+ <outer>1in</outer>
+ </margins>
+
+ <!--
+ Print the URL text next to all links going outside the file
+ -->
+ <show-external-urls>false</show-external-urls>
+
+ <!--
+ Disable the copyright footer on each page of the PDF.
+ A footer is composed for each page. By default, a "credit" with role=pdf
+ will be used, as explained below. Otherwise a copyright statement
+ will be generated. This latter can be disabled.
+ -->
+ <disable-copyright-footer>false</disable-copyright-footer>
+ </pdf>
+ </forrest:property>
+
+
+ <forrest:property contract="credits">
+ <!-- Credits are typically rendered as a set of small clickable
+ images in the page footer.
+ Use box-location="alt" to move the credit to an alternate location
+ (if the skin supports it).
+ -->
+ <credits>
+ <credit box-location="alt">
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ <image>images/built-with-forrest-button.png</image>
+ <width>88</width>
+ <height>31</height>
+ </credit>
+ <!-- A credit with @role="pdf" will be used to compose a footer
+ for each page in the PDF, using either "name" or "url" or both.
+ -->
+ <!--
+ <credit role="pdf">
+ <name>Built with Apache Forrest</name>
+ <url>http://forrest.apache.org/</url>
+ </credit>
+ -->
+ </credits>
+ </forrest:property>
+
+</forrest:properties>
diff --git a/plugins/org.apache.forrest.themes.core/src/documentation/skinconf.xml b/plugins/org.apache.forrest.themes.core/src/documentation/skinconf.xml
new file mode 100644
index 0000000..b29592a
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/src/documentation/skinconf.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2006 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!DOCTYPE skinconfig PUBLIC "-//APACHE//DTD Skin Configuration V0.7-1//EN" "http://forrest.apache.org/dtd/skinconfig-v07-1.dtd"
+[
+ <!ENTITY skinconf-common PUBLIC "-//Apache Forrest//ENTITIES Skin Configuration common plugins V0.7-1//EN" "">
+]>
+
+<skinconfig>
+ &skinconf-common;
+
+ <project-name>Plugin: themer output</project-name>
+ <project-description>org.apache.forrest.plugin.output.themer plugin for Apache Forrest</project-description>
+
+</skinconfig>
diff --git a/plugins/org.apache.forrest.themes.core/status.xml b/plugins/org.apache.forrest.themes.core/status.xml
new file mode 100644
index 0000000..7a398c3
--- /dev/null
+++ b/plugins/org.apache.forrest.themes.core/status.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<status>
+
+ <developers>
+ <person name="Volunteer needed" email="dev@forrest.apache.org" id="open"/>
+ </developers>
+
+ <!-- Define here the Title of the Context you want to display in the Changes pages.
+ id = the context value of actions
+ title = Title of the Context
+ -->
+ <contexts>
+ <context id="code" title="Changes to the Code Base"/>
+ <context id="docs" title="Changes to Documentation"/>
+ <context id="admin" title="Changes to Project Administration"/>
+ <context id="design" title="Changes to Design"/>
+ <context id="build" title="Changes to Build"/>
+ </contexts>
+
+ <changes>
+ <!-- Add new releases here -->
+ <release version="0.1" date="unreleased">
+ <action dev="TS" type="add" context="admin">
+ initial plugin code extracted from the old views plugin and leather plugin.
+ </action>
+ <action dev="TS" type="add" context="docs">
+ added initial index description of the plugin.
+ </action>
+ </release>
+ </changes>
+
+ <todo>
+ <actions priority="high">
+ <action context="docs" dev="open">
+ create some more example, that it is easier to adapt the concept.
+ </action>
+ </actions>
+ </todo>
+
+</status>