incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1181764 - in /incubator/public/trunk: build.xml site-author/projects/index.xml site-author/stylesheets/project-index.xsl site-publish/projects/index.html
Date Tue, 11 Oct 2011 13:03:43 GMT
Author: sebb
Date: Tue Oct 11 13:03:43 2011
New Revision: 1181764

URL: http://svn.apache.org/viewvc?rev=1181764&view=rev
Log:
Use entities for the sections of projects/index.xml rather than generating the whole file.
This simplifies the stylesheet and allows more flexibility in placing the tables where they
are needed.

Added:
    incubator/public/trunk/site-author/projects/index.xml   (with props)
Modified:
    incubator/public/trunk/build.xml
    incubator/public/trunk/site-author/stylesheets/project-index.xsl
    incubator/public/trunk/site-publish/projects/index.html

Modified: incubator/public/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/public/trunk/build.xml?rev=1181764&r1=1181763&r2=1181764&view=diff
==============================================================================
--- incubator/public/trunk/build.xml (original)
+++ incubator/public/trunk/build.xml Tue Oct 11 13:03:43 2011
@@ -40,7 +40,7 @@
              extension=".html" style="./site.vsl"
              projectFile="stylesheets/project.xml"
              excludes="**/stylesheets/** empty.xml podlings.xml **/projects/activemq/** **/projects/servicemix/**"
-             includes="**/*.xml **/index.tmp"
+             includes="**/*.xml"
              lastModifiedCheck="true"
              templatePath="${docs.src}/stylesheets"
              velocityPropertiesFile="build.props"
@@ -127,15 +127,19 @@
     </target>
 
     <!--
-        Generate the project index file
-        Output is written to a .tmp file, because it is not stored in SVN anymore 
+        Generate the project index files
+        Output is written to the target/ directory:
+        - index.tmp - dummy file, ignored
+        - (current|graduated|dormant|retired).ent
+         
     -->
     <target name="generate-index">
         <xslt
             force="true"
             in="${docs.src}/podlings.xml"
-            out='${docs.src}/projects/index.tmp' 
+            out='target/index.tmp'
             style='${docs.src}/stylesheets/project-index.xsl'>
+            <param name="outputdir" expression="target/"/>
         </xslt>
         <fixcrlf srcdir="${docs.src}/projects/" includes="index.tmp"/> 
     </target>

Added: incubator/public/trunk/site-author/projects/index.xml
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-author/projects/index.xml?rev=1181764&view=auto
==============================================================================
--- incubator/public/trunk/site-author/projects/index.xml (added)
+++ incubator/public/trunk/site-author/projects/index.xml [utf-8] Tue Oct 11 13:03:43 2011
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+
+-->
+
+<!DOCTYPE project
+[
+<!ENTITY current-table   SYSTEM "../../target/current.ent">
+<!ENTITY graduated-table SYSTEM "../../target/graduated.ent">
+<!ENTITY dormant-table   SYSTEM "../../target/dormant.ent">
+<!ENTITY retired-table   SYSTEM "../../target/retired.ent">
+]>
+
+
+
+<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>
+
+    <section id="current">
+      <title>Currently in incubation</title>
+      &current-table;
+    </section>
+
+    <section id="graduated">
+      <title>Graduated from incubation</title>
+      &graduated-table;
+    </section>
+
+    <section id="dormant">
+      <title>Dormant Projects</title>
+      &dormant-table;
+    </section>
+
+    <section id="retired">
+      <title>Retired from incubation</title>
+      &retired-table;
+    </section>
+  </body>
+</document>

Propchange: incubator/public/trunk/site-author/projects/index.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 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=1181764&r1=1181763&r2=1181764&view=diff
==============================================================================
--- incubator/public/trunk/site-author/stylesheets/project-index.xsl (original)
+++ incubator/public/trunk/site-author/stylesheets/project-index.xsl Tue Oct 11 13:03:43 2011
@@ -1,114 +1,47 @@
 <?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' 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='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
+   Process podlings.xml to produce tables for the podlings in each state.
+   Output is written to the files {$outputdir}{$status}.ent, e.g.
+   target/current.ent
+   target/graduated.ent
+   target/dormant.ent
+   target/retired.ent
    
-   TODO - plenty!
-   - does not yet handle enddate
-   - output format is very different from existing index.xml which makes it difficult to
compare them
-
+   TODO: remove output spacing, probably no longer necessary
  -->
 
-<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.
+<!-- where to store the output files (usually target/) -->
+<xsl:param name="outputdir"/>
 
-</xsl:comment>
-<document>
-<xsl:text>
-  </xsl:text>
-  <properties>
-<xsl:text>
-    </xsl:text>
-    <title>Incubated Projects</title>
-<xsl:text>
-    </xsl:text>
-    <link href="http://purl.org/DC/elements/1.0/" rel="schema.DC"/>
-<xsl:text>
-  </xsl:text>
-  </properties>
-<xsl:text>
-  </xsl:text>
-  <body>
-<xsl:text>
-    </xsl:text>
-    <section>
-<xsl:text>
-      </xsl:text>
-      <title>This page lists all Incubator projects by status</title>
-<xsl:text>
-      </xsl:text>
-      <ul>
-<xsl:text>
-        </xsl:text>
-        <li><a href="#current">Currently in incubation</a></li>
-<xsl:text>
-        </xsl:text>
-        <li><a href="#graduated">Graduated from incubation</a></li>
-<xsl:text>
-        </xsl:text>
-        <li><a href="#dormant">Dormant Projects</a></li>
-<xsl:text>
-        </xsl:text>
-        <li><a href="#retired">Retired from incubation</a></li>
-<xsl:text>
-      </xsl:text>
-      </ul>
-<xsl:text>
-    </xsl:text>
-    </section>
+<xsl:template match='podlings'>
     <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:with-param name="enddate" select="'true'"/>
     </xsl:call-template>
     <xsl:call-template name="section">
         <xsl:with-param name="status" select="'dormant'"/>
-        <xsl:with-param name="title" select="'Dormant Projects'"/>
         <xsl:with-param name="enddate" select="'true'"/>
     </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:with-param name="enddate" select="'true'"/>
     </xsl:call-template>
-<xsl:text>
-  </xsl:text>
-  </body>
-</document>
 </xsl:template>
 
 <xsl:template name="section">
     <xsl:param name='status'/>
-    <xsl:param name='title'/>
     <xsl:param name='enddate'/>
-    <xsl:element name="section">
-          <xsl:attribute name="id"><xsl:value-of select='$status'/></xsl:attribute>
-        <title><xsl:value-of select='$title'/></title>
+    <xsl:variable name="filename" select="concat($status,'.ent')" />
+      <redirect:write file="{$outputdir}{$status}.ent">
       <xsl:element name="table">
-          <xsl:attribute name="id"><xsl:value-of select='$status'/></xsl:attribute>
         <tr>
           <th>Project</th>
           <th>Description</th>
@@ -125,7 +58,7 @@
       </xsl:element>
 <xsl:text>
     </xsl:text>
-    </xsl:element>
+    </redirect:write>
     </xsl:template>    
 
     <xsl:template match='podling'>

Modified: incubator/public/trunk/site-publish/projects/index.html
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/projects/index.html?rev=1181764&r1=1181763&r2=1181764&view=diff
==============================================================================
--- incubator/public/trunk/site-publish/projects/index.html [utf-8] (original)
+++ incubator/public/trunk/site-publish/projects/index.html [utf-8] Tue Oct 11 13:03:43 2011
@@ -126,25 +126,17 @@ href="http://wiki.apache.org/incubator">
 </h2>
 <div class="section-content">
 <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>
+        <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>
 </div>
         <h2><img src="../images/redarrow.gif" />
    <a name="current">Currently in incubation</a>
 </h2>
 <div class="section-content">
-<table id="current" class="colortable" width="100%">
+<table class="colortable" width="100%">
 <tr>
 <th>Project</th>
 <th>Description</th>
@@ -738,7 +730,7 @@ href="http://wiki.apache.org/incubator">
    <a name="graduated">Graduated from incubation</a>
 </h2>
 <div class="section-content">
-<table id="graduated" class="colortable" width="100%">
+<table class="colortable" width="100%">
 <tr>
 <th>Project</th>
 <th>Description</th>
@@ -1567,7 +1559,7 @@ href="http://wiki.apache.org/incubator">
    <a name="dormant">Dormant Projects</a>
 </h2>
 <div class="section-content">
-<table id="dormant" class="colortable" width="100%">
+<table class="colortable" width="100%">
 <tr>
 <th>Project</th>
 <th>Description</th>
@@ -1615,7 +1607,7 @@ href="http://wiki.apache.org/incubator">
    <a name="retired">Retired from incubation</a>
 </h2>
 <div class="section-content">
-<table id="retired" class="colortable" width="100%">
+<table class="colortable" width="100%">
 <tr>
 <th>Project</th>
 <th>Description</th>



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


Mime
View raw message