Author: rgardler Date: Wed Mar 21 14:45:51 2007 New Revision: 521010 URL: http://svn.apache.org/viewvc?view=rev&rev=521010 Log: Create plugins.xml directly from the build.xml files of individual plugins. Partial fix for FOR-533
Added: forrest/trunk/main/webapp/plugins.xmap forrest/trunk/main/webapp/resources/stylesheets/pluginBuildFiles-to-pluginDescriptor.xsl (with props) Modified: forrest/trunk/main/webapp/sitemap.xmap Added: forrest/trunk/main/webapp/plugins.xmap URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/plugins.xmap?view=auto&rev=521010 ============================================================================== --- forrest/trunk/main/webapp/plugins.xmap (added) +++ forrest/trunk/main/webapp/plugins.xmap Wed Mar 21 14:45:51 2007 @@ -0,0 +1,85 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- ================================================= +'plugins' pipeline. + +Provides access to the plugins descriptor files. + +==================================================== --> + + +<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> + <map:components> + <map:generators default="file"> + <map:generator name="xpathdirectory" src="org.apache.cocoon.generation.XPathDirectoryGenerator" /> + </map:generators> + <map:serializers default="html"/> + <map:transformers default="xslt"/> + <map:matchers default="wildcard"/> + </map:components> + + <map:pipelines> + + <map:pipeline> + <map:match pattern="corePlugins.xml"> + <map:generate type="xpathdirectory" src="file:///C:/projects/forrest-trunk/plugins/"> + <map:parameter name="depth" value="2"/> + <map:parameter name="xpath" value="/project"/> + <map:parameter name="xmlFiles" value="build\.xml$"/> + </map:generate> + <map:transform src="{lm:transform.pluginBuildFiles.pluginDescriptor}"> + <map:parameter name="type" value="core"/> + </map:transform> + <map:serialize type="xml"/> + </map:match> + + <map:match pattern="whiteboardPlugins.xml"> + <map:generate type="xpathdirectory" src="file:///C:/projects/forrest-trunk/whiteboard/plugins/"> + <map:parameter name="depth" value="2"/> + <map:parameter name="xpath" value="/project"/> + <map:parameter name="xmlFiles" value="build\.xml$"/> + </map:generate> + <map:transform src="{lm:transform.pluginBuildFiles.pluginDescriptor}"> + <map:parameter name="type" value="whiteboard"/> + </map:transform> + <map:serialize type="xml"/> + </map:match> + + <map:match pattern="pluginDocs/plugins_(.*)/index(|\.source).xml" type="regexp"> + <map:aggregate element="pluginList"> + <map:part src="{lm:plugin.descriptor.forrest}"/> + <map:part src="{lm:plugin.descriptor.whiteboard}"/> + </map:aggregate> + <map:transform src="{lm:transform.plugins.xdoc}"> + <map:parameter name="pluginDocsVersion" value="{1}"/> + </map:transform> + <map:serialize type="xml"/> + </map:match> + + <map:match pattern="plugins.xml"> + <map:aggregate element="masterPluginList"> + <map:part src="cocoon:/corePlugins.xml"/> + <map:part src="cocoon:/whiteboardPlugins.xml"/> + </map:aggregate> + <map:serialize type="xml"/> + </map:match> + </map:pipeline> + </map:pipelines> + +</map:sitemap> + Added: forrest/trunk/main/webapp/resources/stylesheets/pluginBuildFiles-to-pluginDescriptor.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/resources/stylesheets/pluginBuildFiles-to-pluginDescriptor.xsl?view=auto&rev=521010 ============================================================================== --- forrest/trunk/main/webapp/resources/stylesheets/pluginBuildFiles-to-pluginDescriptor.xsl (added) +++ forrest/trunk/main/webapp/resources/stylesheets/pluginBuildFiles-to-pluginDescriptor.xsl Wed Mar 21 14:45:51 2007 @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:dir="http://apache.org/cocoon/directory/2.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:param name="type" select="FIXME"/> + + <xsl:template match="/"> + <plugins> + <xsl:attribute name="type"><xsl:value-of select="$type"/></xsl:attribute> + <xsl:apply-templates select="/dir:directory/dir:directory/dir:[EMAIL PROTECTED]'build.xml']/dir:xpath"/> + </plugins> + </xsl:template> + + <xsl:template match="project"> + <plugin> + <xsl:attribute name="name"><xsl:value-of select="[EMAIL PROTECTED]'plugin-name']/@value"/></xsl:attribute> + <xsl:attribute name="type"><xsl:value-of select="[EMAIL PROTECTED]'type']/@value"/></xsl:attribute> + <xsl:attribute name="author"><xsl:value-of select="[EMAIL PROTECTED]'author']/@value"/></xsl:attribute> + <xsl:attribute name="website"><xsl:value-of select="[EMAIL PROTECTED]'websiteURL']/@value"/></xsl:attribute> + <xsl:attribute name="url"><xsl:value-of select="[EMAIL PROTECTED]'downloadURL']/@value"/></xsl:attribute> + <xsl:attribute name="version"><xsl:value-of select="[EMAIL PROTECTED]'plugin-version']/@value"/></xsl:attribute> + <forrestVersion><xsl:value-of select="[EMAIL PROTECTED]'forrest.version']/@value"/></forrestVersion> + + <description> + <xsl:value-of select="[EMAIL PROTECTED]'description']/@value"/> + </description> + </plugin> + </xsl:template> +</xsl:stylesheet> Propchange: forrest/trunk/main/webapp/resources/stylesheets/pluginBuildFiles-to-pluginDescriptor.xsl ------------------------------------------------------------------------------ svn:eol-style = native Modified: forrest/trunk/main/webapp/sitemap.xmap URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/sitemap.xmap?view=diff&rev=521010&r1=521009&r2=521010 ============================================================================== --- forrest/trunk/main/webapp/sitemap.xmap (original) +++ forrest/trunk/main/webapp/sitemap.xmap Wed Mar 21 14:45:51 2007 @@ -457,21 +457,18 @@ <!-- Body content --> <map:match pattern="**.xml"> - - <map:match pattern="pluginDocs/plugins_(.*)/index(|\.source).xml" type="regexp"> - <map:aggregate element="pluginList"> - <map:part src="{lm:plugin.descriptor.forrest}"/> - <map:part src="{lm:plugin.descriptor.whiteboard}"/> - </map:aggregate> - <map:transform src="{lm:transform.plugins.xdoc}"> - <map:parameter name="pluginDocsVersion" value="{1}"/> - </map:transform> - <map:serialize type="xml"/> - </map:match> <map:match pattern="locationmap.xml"> <map:generate src="{forrest:forrest.locationmap}" /> <map:serialize type="xml"/> + </map:match> + + <map:match pattern="plugins.xml"> + <map:mount uri-prefix="" src="plugins.xmap" check-reload="yes" /> + </map:match> + + <map:match pattern="pluginDocs/**"> + <map:mount uri-prefix="" src="plugins.xmap" check-reload="yes" /> </map:match> <map:match pattern="linkmap.*">