incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1580236 - in /incubator/public/trunk: build.xml content/stylesheets/project-summary.xsl
Date Sat, 22 Mar 2014 15:55:28 GMT
Author: sebb
Date: Sat Mar 22 15:55:28 2014
New Revision: 1580236

URL: http://svn.apache.org/r1580236
Log:
Add stylesheet to create summary podling CSV listings
Not currently integrated into site build or output

Added:
    incubator/public/trunk/content/stylesheets/project-summary.xsl   (with props)
Modified:
    incubator/public/trunk/build.xml

Modified: incubator/public/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/public/trunk/build.xml?rev=1580236&r1=1580235&r2=1580236&view=diff
==============================================================================
--- incubator/public/trunk/build.xml (original)
+++ incubator/public/trunk/build.xml Sat Mar 22 15:55:28 2014
@@ -194,6 +194,24 @@
         </xslt>
     </target>
 
+    <!--
+        Generate podling summary files
+        - (current|graduated|retired|podlings).txt
+        - summary.tmp - dummy output file, removed after generation         
+    -->
+    <target name="generate-summary">
+        <!-- Need to use force, to ensure that .txt files are always created -->
+        <xslt
+            force="true"
+            in="${docs.src}/podlings.xml"
+            out='target/summary.tmp'
+            style='${docs.src}/stylesheets/project-summary.xsl'>
+        	<!-- TODO move somewhere under site ? -->
+            <param name="outputdir" expression="target/"/>
+        </xslt>
+    	<delete file="target/summary.tmp"/>
+    </target>
+
 	<!--
 Audit Tasks
 ===========

Added: incubator/public/trunk/content/stylesheets/project-summary.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/content/stylesheets/project-summary.xsl?rev=1580236&view=auto
==============================================================================
--- incubator/public/trunk/content/stylesheets/project-summary.xsl (added)
+++ incubator/public/trunk/content/stylesheets/project-summary.xsl Sat Mar 22 15:55:28 2014
@@ -0,0 +1,70 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'
+                xmlns:redirect="http://xml.apache.org/xalan/redirect"
+                extension-element-prefixes="redirect">
+    <xsl:output method='text' indent='no' encoding='utf-8'/>
+            
+<!-- 
+   Process podlings.xml to produce CSV lists for the podlings in each state.
+   Output is written to the files {$status}.txt, e.g.
+   current.txt
+   graduated.txt
+   retired.txt
+   Also creates a summary of all podlings in
+   podling.txt
+-->
+
+<!-- where to store the output files (usually target/) -->
+<xsl:param name="outputdir"/>
+
+<xsl:template match='podlings'>
+    <xsl:call-template name="summary">
+        <xsl:with-param name="status" select="'graduated'"/>
+    </xsl:call-template>
+    <xsl:call-template name="summary">
+        <xsl:with-param name="status" select="'retired'"/>
+    </xsl:call-template>
+    <xsl:call-template name="summary">
+        <xsl:with-param name="status" select="'current'"/>
+    </xsl:call-template>
+    <xsl:call-template name="summary">
+        <xsl:with-param name="status" select="'*'"/>
+        <xsl:with-param name="filename" select="'podlings'"/>
+    </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="summary">
+    <xsl:param name='status'/>
+    <xsl:param name='filename' select="$status"/>
+    <redirect:write file="{$outputdir}{$filename}.txt">
+        <xsl:choose>
+            <xsl:when test="$status='*'">
+                <xsl:apply-templates select="podling">
+                    <xsl:sort select='@resource'/>
+                </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:apply-templates select="podling[@status=$status]">
+                    <xsl:sort select='@resource'/>
+                </xsl:apply-templates>
+            </xsl:otherwise>
+        </xsl:choose>
+    </redirect:write>
+</xsl:template>
+
+<xsl:template match='podling'>
+    <xsl:value-of select="@resource"/>
+    <xsl:text>,</xsl:text>
+    <xsl:value-of select="@status"/>
+    <xsl:text>,</xsl:text>
+    <xsl:value-of select="@enddate"/>
+    <xsl:text>,</xsl:text>
+    <xsl:choose>
+        <xsl:when test="@longname"><xsl:value-of select="@longname"/></xsl:when>
+        <xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
+    </xsl:choose>
+<xsl:text>
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>

Propchange: incubator/public/trunk/content/stylesheets/project-summary.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message