You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2007/07/31 22:48:06 UTC
svn commit: r561513 - in
/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap:
resources/stylesheets/ src/documentation/content/doap/
Author: rgardler
Date: Tue Jul 31 13:48:06 2007
New Revision: 561513
URL: http://svn.apache.org/viewvc?view=rev&rev=561513
Log:
Provide a map from category URIs to category names. It only works in the project detail pages right now, but the framework is there.
Added:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/content/doap/categoryDefinitions.xml (with props)
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/doap-to-document.xsl
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/locationmap-to-descriptorIndex.xsl
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl?view=diff&rev=561513&r1=561512&r2=561513
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl Tue Jul 31 13:48:06 2007
@@ -37,11 +37,22 @@
<xsl:template match="doap:Project">
"label":"<xsl:value-of select="doap:name"/>",
+ <xsl:call-template name="categories"/>
<xsl:apply-templates select="doap:name|doap:shortdesc|doap:homepage"/>
</xsl:template>
<xsl:template match="doap:homepage">
"<xsl:value-of select="local-name(.)"/>":"<xsl:apply-templates select="@rdf:resource"/>"<xsl:if test="not(position()=last())">, </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="categories">
+ <xsl:if test="doap:category">
+ "Category" : [<xsl:apply-templates select="doap:category"/>],
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="doap:category">
+ "<xsl:apply-templates select="@rdf:resource"/>"<xsl:if test="not(position()=last())">, </xsl:if>
</xsl:template>
<xsl:template match="doap:*">
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/doap-to-document.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/doap-to-document.xsl?view=diff&rev=561513&r1=561512&r2=561513
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/doap-to-document.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/doap-to-document.xsl Tue Jul 31 13:48:06 2007
@@ -26,7 +26,10 @@
xmlns:asfext="http://projects.apache.org/ns/asfext#"
>
<xsl:template match="/">
- <xsl:apply-templates select="doap:Project|rdf:RDF|atom:feed" />
+ <xsl:apply-templates select="projectDetails" />
+ </xsl:template>
+ <xsl:template match="projectDetails">
+ <xsl:apply-templates select="doap:Project|rdf:RDF|atom:feed"/>
</xsl:template>
<xsl:template match="rdf:RDF">
<xsl:apply-templates select="doap:Project" />
@@ -92,7 +95,9 @@
}
google.setOnLoadCallback(initialize);
</xsl:element>
- <div id="Feeds"/>
+ <div id="Feeds">
+ <p>Loading feeds...</p>
+ </div>
</section>
</xsl:if>
</body>
@@ -111,30 +116,65 @@
</xsl:if>
</xsl:template>
<xsl:template match="doap:category">
- <xsl:value-of select="@rdf:resource"/>
- <xsl:if test="not(position() = last())">
-<xsl:text>, </xsl:text>
- </xsl:if>
+ <xsl:variable name="category" select="@rdf:resource"/>
+ <li>
+ <xsl:choose>
+ <xsl:when test="//projectDetails/categories/doap:category[@rdf:resource = $category]/@dc:title">
+ <xsl:value-of select="//projectDetails/categories/doap:category[@rdf:resource = $category]/@dc:title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@dc:title">
+ <xsl:value-of select="@dc:title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@rdf:resource"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li>
</xsl:template>
<xsl:template match="foaf:seeAlso">
<xsl:choose>
- <xsl:when test="@dc:format='application/rss+xml'"><a class="rss-rss-link">
- <xsl:attribute name="href">
- <xsl:value-of select="@rdf:resource"/>
- </xsl:attribute> RSS
- </a>
+ <xsl:when test="@dc:format='application/rss+xml'">
+ <a class="rss-rss-link">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@rdf:resource"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@dc:title">
+ <xsl:value-of select="@dc:title"/>
+ </xsl:when>
+ <xsl:otherwise>RSS</xsl:otherwise>
+ </xsl:choose>
+ </a>
</xsl:when>
- <xsl:when test="@dc:format='application/atom+xml'"><a class="rss-atom-link">
- <xsl:attribute name="href">
- <xsl:value-of select="@rdf:resource"/>
- </xsl:attribute> Atom
- </a>
+ <xsl:when test="@dc:format='application/atom+xml'">
+ <a class="rss-atom-link">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@rdf:resource"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@dc:title">
+ <xsl:value-of select="@dc:title"/>
+ </xsl:when>
+ <xsl:otherwise>ATOM</xsl:otherwise>
+ </xsl:choose>
+ </a>
</xsl:when>
- <xsl:when test="@dc:format='application/rdf+xml'"><a class="rss-rdf-link">
- <xsl:attribute name="href">
- <xsl:value-of select="@rdf:resource"/>
- </xsl:attribute> RDF
- </a>
+ <xsl:when test="@dc:format='application/rdf+xml'">
+ <a class="rss-rdf-link">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@rdf:resource"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@dc:title">
+ <xsl:value-of select="@dc:title"/>
+ </xsl:when>
+ <xsl:otherwise>RDF</xsl:otherwise>
+ </xsl:choose>
+ </a>
</xsl:when>
</xsl:choose>
</xsl:template>
@@ -174,7 +214,9 @@
<td class="right">
<xsl:choose>
<xsl:when test="doap:category">
- <xsl:apply-templates select="doap:category" />
+ <ul>
+ <xsl:apply-templates select="doap:category" />
+ </ul>
</xsl:when>
<xsl:otherwise>
None Defined
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/locationmap-to-descriptorIndex.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/locationmap-to-descriptorIndex.xsl?view=diff&rev=561513&r1=561512&r2=561513
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/locationmap-to-descriptorIndex.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/locationmap-to-descriptorIndex.xsl Tue Jul 31 13:48:06 2007
@@ -21,6 +21,11 @@
xmlns:cinclude="http://apache.org/cocoon/include/1.0">
<xsl:template match="lm:locationmap">
<descriptors>
+ <categories>
+ <cinclude:include>
+ <xsl:attribute name="src">cocoon:/projectDetails/categoryDefinitions.xml</xsl:attribute>
+ </cinclude:include>
+ </categories>
<xsl:apply-templates/>
</descriptors>
</xsl:template>
Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/content/doap/categoryDefinitions.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/content/doap/categoryDefinitions.xml?view=auto&rev=561513
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/content/doap/categoryDefinitions.xml (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/content/doap/categoryDefinitions.xml Tue Jul 31 13:48:06 2007
@@ -0,0 +1,30 @@
+<?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.
+-->
+<categories
+ xmlns:doap="http://usefulinc.com/ns/doap#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <doap:category rdf:resource="http://projects.apache.org/category/build-management" dc:title="Build Management"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/xml" dc:title="XML"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/database" dc:title="Database"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/graphics" dc:title="Graphics"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/http" dc:title="HTTP"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/network-client" dc:title="Network Client"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/network-server" dc:title="Network Server"/>
+ <doap:category rdf:resource="http://projects.apache.org/category/web-framework" dc:title="Web Framework"/>
+</categories>
\ No newline at end of file
Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/content/doap/categoryDefinitions.xml
------------------------------------------------------------------------------
svn:eol-style = native