forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r76240 - in forrest/trunk: main/fresh-site main/targets main/var main/webapp main/webapp/WEB-INF plugins
Date Thu, 18 Nov 2004 14:52:59 GMT
Author: rgardler
Date: Thu Nov 18 06:52:58 2004
New Revision: 76240

Modified:
   forrest/trunk/main/fresh-site/forrest.properties
   forrest/trunk/main/targets/plugins.xml
   forrest/trunk/main/var/pluginMountSnippet.xsl
   forrest/trunk/main/webapp/WEB-INF/web.xml
   forrest/trunk/main/webapp/sitemap.xmap
   forrest/trunk/plugins/build.xml
Log:
Enable auto loading of output and internal plugins (now works for all types)

Modified: forrest/trunk/main/fresh-site/forrest.properties
==============================================================================
--- forrest/trunk/main/fresh-site/forrest.properties	(original)
+++ forrest/trunk/main/fresh-site/forrest.properties	Thu Nov 18 06:52:58 2004
@@ -105,4 +105,4 @@
 # The names of plugins that are required to build the project
 # comma separated list (no spaces)
 # Run "forrest available-plugins" for a list of plug-ins currently available
-project.required.plugins=
+project.required.plugins=org.apache.forrest.plugin.pdf-output

Modified: forrest/trunk/main/targets/plugins.xml
==============================================================================
--- forrest/trunk/main/targets/plugins.xml	(original)
+++ forrest/trunk/main/targets/plugins.xml	Thu Nov 18 06:52:58 2004
@@ -65,18 +65,67 @@
      </delete>
   </target>  
   
-  <target name="configure-plugin" unless="plugin.unavailable">
+  <target name="configure-plugin" 
+    unless="plugin.unavailable"
+    depends="check-plugin-type, configure-input-plugin, configure-output-plugin, configure-internal-plugin"/>
+    
+  <target name="check-plugin-type" 
+    unless="plugin.unavailable">
+    <available property="input-plugin" file="${forrest.plugins-dir}/${plugin.name}/input.xmap"/>
+    <available property="output-plugin" file="${forrest.plugins-dir}/${plugin.name}/output.xmap"/>
+    <available property="internal-plugin" file="${forrest.plugins-dir}/${plugin.name}/internal.xmap"/>
+  </target>
+  
+  <target name="configure-input-plugin"
+    if="input-plugin"
+    unless="plugin.unavailable">
      <!-- add the snippet to plugins/input.xmap that will mount the plugin
           specific input.xmap -->
+     <echo>Mounting input plugin: ${plugin-name}</echo>
      <xslt in="${forrest.plugins-dir}/input.xmap"
        out="${forrest.plugins-dir}/input.xmap.new"
        style="${forrest.home}/var/pluginMountSnippet.xsl"
        force="true">
            <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-type" expression="input"/>  
      </xslt>
      <move file="${forrest.plugins-dir}/input.xmap.new" 
        tofile="${forrest.plugins-dir}/input.xmap"/>
   </target>
+  
+  <target name="configure-output-plugin"
+    if="output-plugin"
+    unless="plugin.unavailable">
+     <!-- add the snippet to plugins/output.xmap that will mount the plugin
+          specific input.xmap -->
+     <echo>Mounting output plugin: ${plugin-name}</echo>
+     <xslt in="${forrest.plugins-dir}/output.xmap"
+       out="${forrest.plugins-dir}/output.xmap.new"
+       style="${forrest.home}/var/pluginMountSnippet.xsl"
+       force="true">
+           <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-type" expression="output"/>  
+     </xslt>
+     <move file="${forrest.plugins-dir}/output.xmap.new" 
+       tofile="${forrest.plugins-dir}/output.xmap"/>
+  </target>
+  
+  <target name="configure-internal-plugin"
+    if="internal-plugin"
+    unless="plugin.unavailable">
+     <!-- add the snippet to plugins/internal.xmap that will mount the plugin
+          specific input.xmap -->
+     <echo>Mounting internals plugin: ${plugin-name}</echo>
+     <xslt in="${forrest.plugins-dir}/internal.xmap"
+       out="${forrest.plugins-dir}/internal.xmap.new"
+       style="${forrest.home}/var/pluginMountSnippet.xsl"
+       force="true">
+           <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-type" expression="internal"/>  
+     </xslt>
+     <move file="${forrest.plugins-dir}/internal.xmap.new" 
+       tofile="${forrest.plugins-dir}/internal.xmap"/>
+  </target>
 
   <target name="fetch-plugins-descriptors" if="plugin.unavailable">
     <delete>
@@ -124,6 +173,12 @@
     <mkdir dir="${forrest.plugins-dir}"/>
     <copy file="${forrest.home}/var/initial_plugins_sitemap.xmap"
       tofile="${forrest.plugins-dir}/input.xmap"
+      overwrite="true"/>
+    <copy file="${forrest.home}/var/initial_plugins_sitemap.xmap"
+      tofile="${forrest.plugins-dir}/output.xmap"
+      overwrite="true"/>
+    <copy file="${forrest.home}/var/initial_plugins_sitemap.xmap"
+      tofile="${forrest.plugins-dir}/internal.xmap"
       overwrite="true"/>
     
       <for list="${project.required.plugins}" param="name">

Modified: forrest/trunk/main/var/pluginMountSnippet.xsl
==============================================================================
--- forrest/trunk/main/var/pluginMountSnippet.xsl	(original)
+++ forrest/trunk/main/var/pluginMountSnippet.xsl	Thu Nov 18 06:52:58 2004
@@ -19,6 +19,7 @@
    <xsl:output method="xml" indent="yes" />
 
    <xsl:param name="plugin-name" />
+   <xsl:param name="plugin-type" />
 
    <xsl:template match="map:sitemap">
      <map:sitemap>
@@ -38,10 +39,10 @@
        <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"/>/input.xmap</xsl:attribute>
+           <xsl:attribute name="test">{forrest:plugins}/<xsl:value-of select="$plugin-name"/>/<xsl:value-of
select="$plugin-type"/>.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"/>/input.xmap</xsl:attribute>

+             <xsl:attribute name="src">{forrest:plugins}/<xsl:value-of select="$plugin-name"/>/<xsl:value-of
select="$plugin-type"/>.xmap</xsl:attribute> 
              <xsl:attribute name="check-reload">yes</xsl:attribute>  
              <xsl:attribute name="pass-through">true</xsl:attribute>
            </xsl:element>

Modified: forrest/trunk/main/webapp/WEB-INF/web.xml
==============================================================================
--- forrest/trunk/main/webapp/WEB-INF/web.xml	(original)
+++ forrest/trunk/main/webapp/WEB-INF/web.xml	Thu Nov 18 06:52:58 2004
@@ -144,7 +144,7 @@
     -->
     <init-param>
       <param-name>enable-uploads</param-name>
-      <param-value>false</param-value>
+      <param-value>true</param-value>
     </init-param>
     
     <!--

Modified: forrest/trunk/main/webapp/sitemap.xmap
==============================================================================
--- forrest/trunk/main/webapp/sitemap.xmap	(original)
+++ forrest/trunk/main/webapp/sitemap.xmap	Thu Nov 18 06:52:58 2004
@@ -316,34 +316,18 @@
            </map:select>
       </map:pipeline>     
       
-      <!-- FIXME: temporary fix to get leather plugin working
-           this mount should be managed by the plugns framework -->
       <map:pipeline internal-only="false">
         <map:select type="exists">
-          <map:when test="{forrest:plugins}/org.apache.forrest.plugin.fbits/output.xmap">
-            <map:mount uri-prefix="" src="{forrest:plugins}/org.apache.forrest.plugin.fbits/output.xmap"
check-reload="yes" pass-through="true"/>
+          <map:when test="{forrest:plugins}/internal.xmap">
+            <map:mount uri-prefix="" src="{forrest:plugins}/internal.xmap" check-reload="yes"
pass-through="true"/>
           </map:when>
         </map:select>
       </map:pipeline>
       
-      
-      <!-- FIXME: temporary fix to get PDF-output plugin working
-           this mount should be managed by the plugns framework -->
-      <map:pipeline internal-only="false">
-        <map:select type="exists">
-          <map:when test="{forrest:plugins}/org.apache.forrest.plugin.pdf-output/output.xmap">
-            <map:mount uri-prefix="" src="{forrest:plugins}/org.apache.forrest.plugin.pdf-output/output.xmap"
check-reload="yes" pass-through="true"/>
-          </map:when>
-        </map:select>
-      </map:pipeline>
-      
-      
-      <!-- FIXME: temporary fix to get IMSManifest plugin working
-           this mount should be managed by the plugns framework -->
       <map:pipeline internal-only="false">
         <map:select type="exists">
-          <map:when test="{forrest:plugins}/IMSManifest/sitemap.xmap">
-            <map:mount uri-prefix="" src="{forrest:plugins}/IMSManifest/sitemap.xmap"
check-reload="yes" pass-through="true"/>
+          <map:when test="{forrest:plugins}/output.xmap">
+            <map:mount uri-prefix="" src="{forrest:plugins}/output.xmap" check-reload="yes"
pass-through="true"/>
           </map:when>
         </map:select>
       </map:pipeline>

Modified: forrest/trunk/plugins/build.xml
==============================================================================
--- forrest/trunk/plugins/build.xml	(original)
+++ forrest/trunk/plugins/build.xml	Thu Nov 18 06:52:58 2004
@@ -15,15 +15,24 @@
   limitations under the License.
 -->
 <project default="local-deploy" basedir="." name="Forrest build file">
+  <property name="forrest.root-dir"           location=".."/>   
+  <property name="forrest.ant.lib-dir"        location="${forrest.root-dir}/tools/ant/lib"/>
 
+  <property name="forrest.build.dir"          location="../build"/>
   
   <property name="plugins.dist-dir" value="../site-author/content/plugins"/>
-  <property name="plugins.localDeploy-dir" value="../build/plugins"/>
+  <property name="plugins.localDeploy-dir" value="${forrest.build.dir}/plugins"/>
   
   <property name="plugin.src.dir" value="src"/>
   <property name="plugin.resources.dir" value="resources"/>
   <property name="plugin.stylesheets.dir" value="${plugin.resources.dir}/stylesheets"/>
   
   <property name="plugin.template.dir" value="pluginTemplate"/>
+  
+  <taskdef resource="net/sf/antcontrib/antcontrib.properties">
+    <classpath>
+      <fileset dir="${forrest.ant.lib-dir}" includes="ant-contrib-*.jar" />
+    </classpath>
+  </taskdef>
   
   <target name="init">
     <mkdir dir="${plugins.dist-dir}"/>  

Mime
View raw message