incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject svn commit: r473605 - in /incubator/public/trunk/site-publish/doap_converter: ./ convert.pl export_doap.xsl export_news.xsl export_people.xsl export_progress.xsl export_reports.xsl
Date Sat, 11 Nov 2006 00:54:54 GMT
Author: fielding
Date: Fri Nov 10 16:54:53 2006
New Revision: 473605

URL: http://svn.apache.org/viewvc?view=rev&rev=473605
Log:
added to site-author by dreid, not sure why

Added:
    incubator/public/trunk/site-publish/doap_converter/
    incubator/public/trunk/site-publish/doap_converter/convert.pl   (with props)
    incubator/public/trunk/site-publish/doap_converter/export_doap.xsl   (with props)
    incubator/public/trunk/site-publish/doap_converter/export_news.xsl   (with props)
    incubator/public/trunk/site-publish/doap_converter/export_people.xsl   (with props)
    incubator/public/trunk/site-publish/doap_converter/export_progress.xsl   (with props)
    incubator/public/trunk/site-publish/doap_converter/export_reports.xsl   (with props)

Added: incubator/public/trunk/site-publish/doap_converter/convert.pl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/doap_converter/convert.pl?view=auto&rev=473605
==============================================================================
--- incubator/public/trunk/site-publish/doap_converter/convert.pl (added)
+++ incubator/public/trunk/site-publish/doap_converter/convert.pl Fri Nov 10 16:54:53 2006
@@ -0,0 +1,46 @@
+#!/usr/bin/env perl
+
+use strict;
+
+use File::Spec::Functions;
+
+my @converts = (
+    [ 'export_doap.xsl', 'doap' ],
+    [ 'export_news.xsl', 'news' ],
+    [ 'export_people.xsl', 'people' ],
+    [ 'export_progress.xsl', 'progress' ],
+    [ 'export_reports.xsl', 'reports' ],
+);
+
+opendir(my $dh, "..") || die "Unable to open directory\n$!";
+while (my $f = readdir($dh)) {
+    next if $f =~ /^\./;
+    next unless $f =~ /(.*)\.xml/;
+    my $pName = $1;
+    my $iFn = catfile('..', $f);
+    my $mFn = $pName.'.rdf';
+    print "$iFn\n";
+    my $links = '';
+    foreach my $arr (@converts) {
+         my $oFn = $pName.'_'.$arr->[1].'.rdf';
+         my $cmd = "xsltproc $arr->[0] $iFn > $oFn";
+         print "\t$cmd\n";
+         `$cmd`;
+         if ($? == 0) {
+             $links .= "    <$arr->[1] rdf:resource=\"$oFn\" />\n";
+         }
+    }
+    open(OUT, ">$mFn") || die "Unable to open '$mFn'\n$!";
+    print OUT <<EOT;
+<?xml version="1.0"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+         xmlns="http://projects.apache.org/ns/asfext#">
+  <incubatorProject rdf:about="$mFn">
+$links  </incubatorProject>
+</rdf:RDF>
+EOT
+    close(OOUT);
+}
+
+closedir($dh);

Propchange: incubator/public/trunk/site-publish/doap_converter/convert.pl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/public/trunk/site-publish/doap_converter/convert.pl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/public/trunk/site-publish/doap_converter/export_doap.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/doap_converter/export_doap.xsl?view=auto&rev=473605
==============================================================================
--- incubator/public/trunk/site-publish/doap_converter/export_doap.xsl (added)
+++ incubator/public/trunk/site-publish/doap_converter/export_doap.xsl Fri Nov 10 16:54:53
2006
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version = "1.0"
+                xmlns:Atom="http://www.w3.org/2005/Atom"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
+                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
+                xmlns:doap="http://usefulinc.com/ns/doap#"
+                xmlns:asfext="http://projects.apache.org/ns/asfext#"
+                >
+
+  <xsl:output method="xml" indent="yes"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="document"/>
+  </xsl:template>
+
+  <xsl:template match="document">
+<rdf:RDF>
+  <Project>
+    <license rdf:resource="http://usefulinc.com/doap/licenses/asl20" />
+    <asfext:pmc rdf:resource="http://incubator.apache.org" />
+    <shortdesc>This project is under incubation.</shortdesc>
+    <xsl:apply-templates select="body"/>
+  </Project>
+</rdf:RDF>
+  </xsl:template>
+
+  <xsl:template match="body">
+    <xsl:apply-templates select="section"/>
+  </xsl:template>
+
+  <xsl:template match="section">
+    <xsl:choose>
+      <xsl:when test="@id = 'Description'">
+    <description><xsl:value-of select="p"/></description>
+      </xsl:when>
+      <xsl:when test="contains(@id, 'Project+Incubation')">
+    <name>
+      <xsl:text>Apache </xsl:text>
+      <xsl:value-of select="substring-before(title, ' Project')"/>
+    </name>
+      </xsl:when>
+      <xsl:when test="contains(@id, 'Project+info')">
+        <xsl:apply-templates select="table"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <xsl:apply-templates select="tr"/>
+  </xsl:template>
+
+  <xsl:template match="tr">
+    <xsl:param name="type">
+      <xsl:apply-templates select="." mode="findType"/>
+    </xsl:param>
+
+    <xsl:choose>
+      <xsl:when test="contains($type, 'Website')">
+        <xsl:if test="contains(td[2], 'www')">
+    <homepage><xsl:value-of select="td[3]"/></homepage>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="contains($type, 'Source code')">
+    <repository>
+      <SVNRepository>
+        <location>
+          <xsl:attribute name="rdf:resource">
+            <xsl:value-of select="td[3]"/>
+          </xsl:attribute>
+        </location>
+      </SVNRepository>
+    </repository>
+      </xsl:when>
+      <xsl:when test="contains($type, 'Mailing list')">
+    <mailing-list>
+      <xsl:attribute name="rdf:resource">
+        <xsl:value-of select="td[3]"/>
+      </xsl:attribute>
+    </mailing-list>
+      </xsl:when>
+      <xsl:when test="contains($type, 'Bug tracking')">
+    <bug-database>
+      <xsl:attribute name="rdf:resource">
+        <xsl:value-of select="td[3]"/>
+      </xsl:attribute>
+    </bug-database>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="findType">
+    <xsl:choose>
+      <xsl:when test="contains(td[1], '.')">
+        <xsl:apply-templates select="preceding-sibling::tr[1]" mode="findType"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="td[1]"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template select="*|text()"/>
+</xsl:stylesheet>

Propchange: incubator/public/trunk/site-publish/doap_converter/export_doap.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/public/trunk/site-publish/doap_converter/export_news.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/doap_converter/export_news.xsl?view=auto&rev=473605
==============================================================================
--- incubator/public/trunk/site-publish/doap_converter/export_news.xsl (added)
+++ incubator/public/trunk/site-publish/doap_converter/export_news.xsl Fri Nov 10 16:54:53
2006
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version = "1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                >
+
+  <xsl:output method="xml" indent="yes"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="document"/>
+  </xsl:template>
+
+  <xsl:template match="document">
+<incubatorNews>
+    <xsl:apply-templates select="body"/>
+</incubatorNews>
+  </xsl:template>
+
+  <xsl:template match="body">
+    <xsl:apply-templates select="section"/>
+  </xsl:template>
+
+  <xsl:template match="section">
+    <xsl:if test="contains(@id, 'News')">
+      <xsl:apply-templates select="ul"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="ul">
+    <xsl:apply-templates select="li"/>
+  </xsl:template>
+
+  <xsl:template match="li">
+    <xsl:if test="not(contains(., 'none yet'))">
+  <newsItem>
+    <date><xsl:value-of select="substring-before(., ' - ')"/></date>
+    <text><xsl:value-of select="substring-after(., ' - ')"/></text>
+  </newsItem>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template select="*|text()" />
+</xsl:stylesheet>

Propchange: incubator/public/trunk/site-publish/doap_converter/export_news.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/public/trunk/site-publish/doap_converter/export_people.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/doap_converter/export_people.xsl?view=auto&rev=473605
==============================================================================
--- incubator/public/trunk/site-publish/doap_converter/export_people.xsl (added)
+++ incubator/public/trunk/site-publish/doap_converter/export_people.xsl Fri Nov 10 16:54:53
2006
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version = "1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                >
+
+  <xsl:output method="xml" indent="yes"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="document"/>
+  </xsl:template>
+
+  <xsl:template match="document">
+<incubatorPeople>
+    <xsl:apply-templates select="body"/>
+</incubatorPeople>
+  </xsl:template>
+
+  <xsl:template match="body">
+    <xsl:apply-templates select="section"/>
+  </xsl:template>
+
+  <xsl:template match="section">
+    <xsl:if test="contains(@id, 'Project+info')">
+      <xsl:apply-templates select="table"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="table">
+  <Mentors>
+    <xsl:apply-templates select="tr" mode="Mentors"/>
+  </Mentors>
+  <Committers>
+    <xsl:apply-templates select="tr" mode="Committers"/>
+  </Committers>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="Mentors">
+    <xsl:param name="type">
+      <xsl:apply-templates select="." mode="findType"/>
+    </xsl:param>
+
+    <xsl:if test="contains($type, 'Mentors')">
+      <xsl:apply-templates select="." mode="addPerson"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="Committers">
+    <xsl:param name="type">
+      <xsl:apply-templates select="." mode="findType"/>
+    </xsl:param>
+
+    <xsl:if test="contains($type, 'Committers')">
+      <xsl:apply-templates select="." mode="addPerson"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="addPerson">
+    <person>
+    <xsl:if test="not(contains(td[2], '.'))">
+      <availId><xsl:value-of select="td[2]"/></availId>
+    </xsl:if>
+      <name><xsl:value-of select="td[3]"/></name>
+    </person>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="findType">
+    <xsl:choose>
+      <xsl:when test="contains(td[1], '.')">
+        <xsl:apply-templates select="preceding-sibling::tr[1]" mode="findType"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="td[1]"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template select="*|text()" />
+</xsl:stylesheet>

Propchange: incubator/public/trunk/site-publish/doap_converter/export_people.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/public/trunk/site-publish/doap_converter/export_progress.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/doap_converter/export_progress.xsl?view=auto&rev=473605
==============================================================================
--- incubator/public/trunk/site-publish/doap_converter/export_progress.xsl (added)
+++ incubator/public/trunk/site-publish/doap_converter/export_progress.xsl Fri Nov 10 16:54:53
2006
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version = "1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                >
+
+  <xsl:output method="xml" indent="yes"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="document"/>
+  </xsl:template>
+
+  <xsl:template match="document">
+<incubatorProgress>
+    <xsl:apply-templates select="body"/>
+</incubatorProgress>
+  </xsl:template>
+
+  <xsl:template match="body">
+    <xsl:apply-templates select="section"/>
+  </xsl:template>
+
+  <xsl:template match="body/section">
+    <xsl:if test="contains(@id, 'Incubation+work+items')">
+      <xsl:apply-templates select="section"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="section/section">
+  <incubationStage>
+    <title><xsl:value-of select="title"/></title>
+    <xsl:apply-templates select="section"/>
+  </incubationStage>
+  </xsl:template>
+
+  <xsl:template match="section/section/section">
+    <workSection>
+      <title><xsl:value-of select="title"/></title>
+      <xsl:apply-templates select="table|ul"/>
+    </workSection>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <xsl:choose>
+      <xsl:when test="contains(tr[1]/th[1], 'status')">
+        <xsl:apply-templates select="tr" mode="status"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="tr" mode="dates"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="dates">
+    <xsl:if test="td">
+      <workItem>
+        <desc><xsl:value-of select="td[2]"/></desc>
+      <xsl:if test="contains(td[1], '-')">
+        <date>
+          <xsl:if test="not(contains(td[1], '..'))">
+            <xsl:value-of select="td[1]"/>
+          </xsl:if>
+        </date>
+      </xsl:if>
+      </workItem>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="tr" mode="status">
+    <xsl:if test="td">
+      <workItem>
+        <desc><xsl:value-of select="td[2]"/></desc>
+        <status>
+          <xsl:if test="contains(td[1], 'DONE')">
+            DONE
+          </xsl:if>
+        </status>
+      </workItem>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="ul">
+    <xsl:apply-templates select="li"/>
+  </xsl:template>
+
+  <xsl:template match="li">
+      <verificationItem><xsl:value-of select="."/></verificationItem>
+  </xsl:template>
+
+  <xsl:template select="*|text()" />
+</xsl:stylesheet>

Propchange: incubator/public/trunk/site-publish/doap_converter/export_progress.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/public/trunk/site-publish/doap_converter/export_reports.xsl
URL: http://svn.apache.org/viewvc/incubator/public/trunk/site-publish/doap_converter/export_reports.xsl?view=auto&rev=473605
==============================================================================
--- incubator/public/trunk/site-publish/doap_converter/export_reports.xsl (added)
+++ incubator/public/trunk/site-publish/doap_converter/export_reports.xsl Fri Nov 10 16:54:53
2006
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version = "1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                >
+
+  <xsl:output method="xml" indent="yes"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="document"/>
+  </xsl:template>
+
+  <xsl:template match="document">
+<incubatorReports>
+    <xsl:apply-templates select="body"/>
+</incubatorReports>
+  </xsl:template>
+
+  <xsl:template match="body">
+    <xsl:apply-templates select="section"/>
+  </xsl:template>
+
+  <xsl:template match="body/section">
+    <xsl:if test="contains(@id, 'Incubation+status+reports')">
+      <xsl:apply-templates select="ul"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="ul">
+    <xsl:apply-templates select="li"/>
+  </xsl:template>
+
+  <xsl:template match="li">
+    <xsl:if test="not(contains(., 'none yet'))">
+  <report>
+    <date><xsl:value-of select="substring-before(., ' - ')"/></date>
+    <text><xsl:value-of select="substring-after(., ' - ')"/></text>
+  </report>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template select="*|text()" />
+</xsl:stylesheet>

Propchange: incubator/public/trunk/site-publish/doap_converter/export_reports.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