Author: rgardler
Date: Thu Dec 15 16:06:02 2005
New Revision: 357092
URL: http://svn.apache.org/viewcvs?rev=357092&view=rev
Log:
allow projects to use a unique extension rther than the default - used in
conjunction with the path prefix this enables the user to avoid the need to
limit the url space
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/default.plugin.properties.xml
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/input.xmap
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources.xmap
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/default.plugin.properties.xml
URL:
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/default.plugin.properties.xml?rev=357092&r1=357091&r2=357092&view=diff
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/default.plugin.properties.xml
(original)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/default.plugin.properties.xml
Thu Dec 15 16:06:02 2005
@@ -2,4 +2,9 @@
<properties>
<!-- Daisy plugin properties -->
<property name="daisy.pathPrefix" value=""/>
+ <!-- The extension to use for documents retrieved from Daisy
+ This is places between the filename and the file extension.
+ If you change this in your project you will need to add
+ handling to your sitemap (see plugin docs) -->
+ <property name="daisy.fileExt" value=".daisy"/>
</properties>
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/input.xmap
URL:
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/input.xmap?rev=357092&r1=357091&r2=357092&view=diff
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/input.xmap
(original)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/input.xmap
Thu Dec 15 16:06:02 2005
@@ -30,31 +30,56 @@
</map:selectors>
</map:components>
+
+ <map:resources>
+ <map:resource name="daisy-to-document">
+ <map:aggregate element="daisyDocument">
+ <map:part
src="cocoon://{project:daisy.pathPrefix}{docID}.daisy.source" />
+ <map:part src="cocoon://daisy.site.{project:daisy.navigation.docID}"
/>
+ </map:aggregate>
+ <map:transform
src="{forrest:plugins}/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy-to-html.xsl">
+ <map:parameter name="documentPath" value="{path}"/>
+ <map:parameter name="pathPrefix" value="{project:daisy.pathPrefix}"/>
+ </map:transform>
+ <map:transform src="{lm:transform.html.document}"/>
+ <map:select type="exists">
+ <map:when
test="{project:resources.stylesheets}/daisy/postFilter.xsl">
+ <map:transform
src="{project:resources.stylesheets}/daisy/postFilter.xsl"/>
+ </map:when>
+ </map:select>
+ <map:serialize/>
+ </map:resource>
+ </map:resources>
<map:pipelines>
<!--
============================================================== -->
<!-- Repository pipeline
-->
<!--
============================================================== -->
- <map:pipeline>
-
- <map:match pattern="**.daisy.xml">
- <map:aggregate element="daisyDocument">
- <map:part src="cocoon://{1}.daisy.source" />
- <map:part
src="cocoon://daisy.site.{project:daisy.navigation.docID}" />
- </map:aggregate>
- <map:transform src="{lm:daisy.transform.daisy.html}">
- <map:parameter name="documentPath" value="{0}"/>
- <map:parameter name="daisyExtension" value=".daisy"/>
- <map:parameter name="pathPrefix" value=""/>
- </map:transform>
- <map:transform src="{lm:transform.html.document}"/>
- <map:select type="exists">
- <map:when
test="{project:resources.stylesheets}/daisy/postFilter.xsl">
- <map:transform
src="{project:resources.stylesheets}/daisy/postFilter.xsl"/>
- </map:when>
- </map:select>
- <map:serialize type="xml"/>
- </map:match>
- </map:pipeline>
+
+ <map:pipeline>
+ <map:match
pattern="{project:daisy.pathPrefix}*{project:daisy.pathPrefix}.xml">
+ <map:call resource="daisy-to-document">
+ <map:parameter name="docID" value="{1}"/>
+ <map:parameter name="path" value="{0}"/>
+ </map:call>
+ </map:match>
+
+ <map:match
pattern="{project:daisy.pathPrefix}**{project:daisy.pathPrefix}.xml">
+ <map:call resource="daisy-to-document">
+ <map:parameter name="docID" value="{1}"/>
+ <map:parameter name="path" value="{0}"/>
+ </map:call>
+ </map:match>
+
+ <!-- this one is needed becasue an empty {project:daisy.fileExt}
+ won't work with the previous match -->
+ <map:match pattern="{project:daisy.pathPrefix}**.xml">
+ <map:call resource="daisy-to-document">
+ <map:parameter name="docID" value="{1}"/>
+ <map:parameter name="path" value="{0}"/>
+ </map:call>
+ </map:match>
+ </map:pipeline>
+
</map:pipelines>
</map:sitemap>
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources.xmap
URL:
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources.xmap?rev=357092&r1=357091&r2=357092&view=diff
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources.xmap
(original)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources.xmap
Thu Dec 15 16:06:02 2005
@@ -50,7 +50,9 @@
<map:pipeline>
<map:match pattern="daisy.site.*">
<map:generate
src="{project:daisy.publisher.URL}blob?documentId={1}&version=live&partType=1"
/>
- <map:transform
src="{forrest:plugins}/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl"/>
+ <map:transform
src="{forrest:plugins}/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl">
+ <map:parameter name="daisyExt" value="{project:daisy.fileExt}"/>
+ </map:transform>
<map:transform type="xinclude"/>
<map:serialize type="xml" />
</map:match>
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl
URL:
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl?rev=357092&r1=357091&r2=357092&view=diff
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl
(original)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/navigation-to-siteSnippet.xsl
Thu Dec 15 16:06:02 2005
@@ -22,7 +22,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
version="1.0">
- <xsl:param name="daisyExt">.daisy</xsl:param>
+ <xsl:param name="daisyExt"/>
<xsl:template match="/">
<xsl:apply-templates/>