incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1180391 - in /incubator/public/trunk: build.xml site-author/stylesheets/project-index.xsl
Date Sat, 08 Oct 2011 15:34:08 GMT
Author: sebb
Date: Sat Oct  8 15:34:07 2011
New Revision: 1180391

URL: http://svn.apache.org/viewvc?rev=1180391&view=rev
Log:
Initial stab at stylesheet to create projects/index.xml from podlings.xml
TODO: incomplete, needs more work and must check output agrees with existing

Added:
    incubator/public/trunk/site-author/stylesheets/project-index.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=1180391&r1=1180390&r2=1180391&view=diff
==============================================================================
--- incubator/public/trunk/build.xml (original)
+++ incubator/public/trunk/build.xml Sat Oct  8 15:34:07 2011
@@ -126,6 +126,20 @@
         </xslt>
     </target>
 
+    <!--
+        Generate the project index file 
+        TODO currently creates .tmp; rename to .xml when format sorted 
+    -->
+    <target name="generate-index">
+        <xslt
+            force="true"
+            in="${docs.src}/podlings.xml"
+            out='${docs.src}/projects/index.tmp' 
+            style='${docs.src}/stylesheets/project-index.xsl'>
+        </xslt>
+        <fixcrlf srcdir="${docs.src}/projects/" includes="index.tmp"/> 
+    </target>
+
 	<!--
 Audit Tasks
 ===========

Added: incubator/public/trunk/site-author/stylesheets/project-index.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-author/stylesheets/project-index.xsl?rev=1180391&view=auto
==============================================================================
--- incubator/public/trunk/site-author/stylesheets/project-index.xsl (added)
+++ incubator/public/trunk/site-author/stylesheets/project-index.xsl Sat Oct  8 15:34:07 2011
@@ -0,0 +1,142 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
+    <xsl:output method='xml' indent='yes' encoding='utf-8'/>
+            
+<!-- 
+   Process podlings.xml to produce site-author//projects/index.xml.
+
+   Currently uses the original podlings.xml format, where all fields are tags.
+   Needs to be updated to work with new layout which will use attributes for the shorter
fields
+   
+   TODO - plenty!
+   - does not yet handle enddate
+   - output format is very different from existing index.xml which makes it difficult to
compare them
+
+ -->
+
+<xsl:template match='podlings'>
+<xsl:comment>
+ 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.
+
+</xsl:comment>
+<document>
+<properties>
+<title>Incubated Projects</title>
+<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC"/>
+</properties>
+  <body>
+    <section>
+      <title>This page lists all Incubator projects by status</title>
+      <ul>
+        <li><a href="#current">Currently in incubation</a></li>
+        <li><a href="#graduated">Graduated from incubation</a></li>
+        <li><a href="#dormant">Dormant Projects</a></li>
+        <li><a href="#retired">Retired from incubation</a></li>
+      </ul>
+    </section>
+    <xsl:call-template name="section">
+        <xsl:with-param name="status" select="'current'"/>
+        <xsl:with-param name="title" select="'Currently in incubation'"/>
+    </xsl:call-template>
+    <xsl:call-template name="section">
+        <xsl:with-param name="status" select="'graduated'"/>
+        <xsl:with-param name="title" select="'Graduated from incubation'"/>
+    </xsl:call-template>
+    <xsl:call-template name="section">
+        <xsl:with-param name="status" select="'dormant'"/>
+        <xsl:with-param name="title" select="'Dormant Projects'"/>
+    </xsl:call-template>
+    <xsl:call-template name="section">
+        <xsl:with-param name="status" select="'retired'"/>
+        <xsl:with-param name="title" select="'Retired from incubation'"/>
+    </xsl:call-template>
+  </body>
+</document>
+</xsl:template>
+
+<xsl:template name="section">
+    <xsl:param name='status'/>
+    <xsl:param name='title'/>
+        <xsl:element name="section">
+          <xsl:attribute name="id"><xsl:value-of select='$status'/></xsl:attribute>
+        <title><xsl:value-of select='$title'/></title>
+        <xsl:element name="table">
+          <xsl:attribute name="id"><xsl:value-of select='$status'/></xsl:attribute>
+        <tr>
+          <th>Project</th>
+          <th>Description</th>
+          <th>Apache Sponsor</th>
+          <th>Mentors</th>
+          <th>Start Date</th>
+        </tr>
+        <xsl:apply-templates select="podling[status = $status]">
+            <xsl:sort select='@name'/>
+        </xsl:apply-templates>
+        </xsl:element>
+        </xsl:element>
+    </xsl:template>    
+
+    <xsl:template match='podling'>
+      <!-- copy original spacing (could be removed) -->
+        <tr>
+<xsl:text>
+</xsl:text>
+          <td>
+<xsl:text>
+</xsl:text>
+            <xsl:element name="a">
+                <xsl:attribute name="href">
+                    <xsl:value-of select="concat(website)"/>
+                </xsl:attribute>
+                <xsl:value-of select="name"/>
+            </xsl:element>
+<xsl:text>
+</xsl:text>
+          </td>
+<xsl:text>
+</xsl:text>
+          <td><xsl:value-of select="description"/></td>
+<xsl:text>
+</xsl:text>
+          <td><xsl:value-of select="sponsor"/></td>
+<xsl:text>
+</xsl:text>
+          <td>
+          <xsl:call-template name="mentor-list"/>
+          </td>
+<xsl:text>
+</xsl:text>
+          <td><xsl:value-of select="startdate"/></td>
+<xsl:text>
+</xsl:text>
+        </tr>
+<!-- Add EOL after each entry -->
+<xsl:text>
+</xsl:text>
+<xsl:text>
+</xsl:text>
+    </xsl:template>
+
+  <xsl:template name="mentor-list">
+    <xsl:for-each select="mentors/mentor">
+      <xsl:value-of select="." />
+      <xsl:if test="position() != last()">
+        <xsl:value-of select="', '"/>
+      </xsl:if>
+    </xsl:for-each>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Propchange: incubator/public/trunk/site-author/stylesheets/project-index.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