Author: rgardler
Date: Mon Oct 18 05:16:26 2004
New Revision: 54996
Added:
forrest/branches/sitemap-plugins/src/core/var/pluginMountSnippet.xsl (contents, props
changed)
Modified:
forrest/branches/sitemap-plugins/src/core/targets/plugins.xml
Log:
insert the mount snippet when a new plugin is installed
Modified: forrest/branches/sitemap-plugins/src/core/targets/plugins.xml
==============================================================================
--- forrest/branches/sitemap-plugins/src/core/targets/plugins.xml (original)
+++ forrest/branches/sitemap-plugins/src/core/targets/plugins.xml Mon Oct 18 05:16:26 2004
@@ -46,7 +46,7 @@
<!-- private -->
- <target name="init-plugins" depends="init-props, check-plugin, fetch-plugin, unpack-plugins"/>
+ <target name="init-plugins" depends="init-props, check-plugin, fetch-plugin, unpack-plugins,
configure-plugins"/>
<target name="plugin-unavailable">
<property name="plugin.unavailable" value="true"/>
@@ -78,6 +78,21 @@
</fileset>
</delete>
</target>
+
+ <target name="configure-plugins">
+ <!-- add the snippet to plugins/sitemap.xmap that will mount the plugin
+ specific sitemap -->
+ <xslt in="${forrest.plugins-dir}/sitemap.xmap"
+ out="${forrest.plugins-dir}/sitemap.xmap.new"
+ style="${forrest.home}/var/pluginMountSnippet.xsl"
+ force="true">
+ <param name="plugin-name" expression="${plugin.name}"/>
+ </xslt>
+ <move file="${forrest.plugins-dir}/sitemap.xmap"
+ tofile="${forrest.plugins-dir}/sitemap.xmap.old"/>
+ <move file="${forrest.plugins-dir}/sitemap.xmap.new"
+ tofile="${forrest.plugins-dir}/sitemap.xmap"/>
+ </target>
<target name="fetch-plugins-descriptors" if="plugin.unavailable">
<delete>
@@ -112,10 +127,9 @@
<param name="plugin-dir" expression="${forrest.plugins-dir}/"/>
<param name="forrest-version" expression="${version}"/>
</xslt>
- <ant antfile="${project.temp-dir}/pluginlist2fetchbuild.xml"/>
+ <ant antfile="${project.temp-dir}/pluginlist2fetchbuild.xml"/>
</sequential>
</for>
- <echo>FIXME: Still need to enable the plugin by adding snippet to plugins.xml</echo>
</target>
</project>
Added: forrest/branches/sitemap-plugins/src/core/var/pluginMountSnippet.xsl
==============================================================================
--- (empty file)
+++ forrest/branches/sitemap-plugins/src/core/var/pluginMountSnippet.xsl Mon Oct 18 05:16:26
2004
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <xsl:output method="xml" indent="yes" />
+
+ <xsl:param name="plugin-name" />
+
+ <xsl:template match="map:sitemap">
+ <map:sitemap>
+ <xsl:apply-templates/>
+ </map:sitemap>
+ </xsl:template>
+
+ <xsl:template match="map:pipelines">
+ <map:pipelines>
+ <xsl:apply-templates/>
+ </map:pipelines>
+ </xsl:template>
+
+ <xsl:template match="map:pipeline">
+ <map:pipeline>
+ <xsl:apply-templates/>
+ <xsl:element name="map:select">
+ <xsl:attribute name="type">exists</xsl:attribute>
+ <xsl:element name="map:when">
+ <xsl:attribute name="test">{forrest:plugins}/<xsl:value-of select="$plugin-name"/>/sitemap.xmap</xsl:attribute>
+ <xsl:element name="map:mount">
+ <xsl:attribute name="uri-prefix"/>
+ <xsl:attribute name="src">{forrest:plugins}/<xsl:value-of select="$plugin-name"/>/sitemap.xmap</xsl:attribute>
+ <xsl:attribute name="check-reload">yes</xsl:attribute>
+ <xsl:attribute name="pass-through">true</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </map:pipeline>
+ </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>
+
|