Author: rgardler
Date: Sat Oct 22 16:53:12 2005
New Revision: 327720
URL: http://svn.apache.org/viewcvs?rev=327720&view=rev
Log:
add automatic index pages for programming languages and site.xml snippet
generator to link to these pages
Added:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex.xsl
(with props)
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex_siteSnippet.xsl
(with props)
Modified:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/index.xml
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/site.xml
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/status.xml
Modified:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap
URL:
http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap?rev=327720&r1=327719&r2=327720&view=diff
==============================================================================
---
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap
(original)
+++
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap
Sat Oct 22 16:53:12 2005
@@ -104,23 +104,63 @@
<map:serialize type="xml-document"/>
</map:match>
+ <!-- ================================================================ -->
+ <!-- HTML indexes -->
+ <!-- ================================================================ -->
+
+ <!-- FIXME: create the XSL for this pipeline
+
<map:match pattern="projectDetails/index.xml">
- <map:generate type="file" src="locationmap-projects.xml" />
+ <map:generate type="file"
src="cocoon:/projectDetails/descrptorIndex.xml" />
+ <map:transform src="{lm:projectInfo.transform.descriptorIndex.html}"/>
+ <map:serialize type="xml-document"/>
+ </map:match>
+ -->
+
+
+ <!-- Create an HTML page listing all projects using the indicated
language -->
+ <map:match pattern="projectDetails/*_lang.xml">
+ <map:generate type="file"
src="cocoon:/projectDetails/descrptorIndex.xml" />
+ <map:transform
src="{lm:projectInfo.transform.descriptorIndex.langIndex}">
+ <map:parameter name="language" value="{1}"/>
+ </map:transform>
+ <map:transform src="{lm:transform.html.document}"/>
+ <map:serialize type="xml-document"/>
+ </map:match>
+
+ <!-- ================================================================ -->
+ <!-- Site.xml snippets -->
+ <!-- ================================================================ -->
+
+ <!--
+ Create a snippet for inclusion in site.xml that provides a link to
+ all known programming languages for projects specified in
+ locationmap-projects.xml file.
+ -->
+ <map:match pattern="projectDetails/descrptorIndex.xml">
+ <map:generate type="file" src="{project:content}/locationmap.xml" />
<map:transform
src="{lm:projectInfo.transform.locationmap.descriptorIndex}"/>
<map:transform type="cinclude"/>
- <!--<map:transform
src="{lm:projectInfo.transform.descriptorIndex.html}"/>-->
<map:serialize type="xml-document"/>
</map:match>
+ <!--
+ Create a snippet for inclusion in site.xml that provides a link to
+ an index page for all known programming languages for projects
+ specified in locationmap-projects.xml file.
+ -->
+ <map:match pattern="projectDetails/lang_index.siteSnippet.xml">
+ <map:generate type="file"
src="cocoon:/projectDetails/descrptorIndex.xml" />
+ <map:transform
src="{lm:projectInfo.transform.descriptorIndex.langIndex_siteSnippet}"/>
+ <map:serialize type="xml-document"/>
+ </map:match>
<!--
Create a snippet for inclusion in site.xml that lists all projects
known in the locationmap-projects.xml file.
-->
<map:match pattern="projectDetails/index.siteSnippet.xml">
- <map:generate type="file" src="{project:content}/locationmap.xml" />
- <map:transform
src="{lm:projectInfo.transform.locationmap.descriptorIndex}"/>
- <map:transform type="cinclude"/>
+ <map:generate type="file"
src="cocoon:/projectDetails/descrptorIndex.xml" />
<map:transform
src="{lm:projectInfo.transform.descriptorIndex.siteSnippet}"/>
<map:serialize type="xml-document"/>
</map:match>
@@ -131,9 +171,7 @@
programming language.
-->
<map:match pattern="projectDetails/language-*/index.siteSnippet.xml">
- <map:generate type="file" src="{project:content}/locationmap.xml" />
- <map:transform
src="{lm:projectInfo.transform.locationmap.descriptorIndex}"/>
- <map:transform type="cinclude"/>
+ <map:generate type="file"
src="cocoon:/projectDetails/descrptorIndex.xml" />
<map:transform
src="{lm:projectInfo.transform.descriptorIndex.siteSnippet}">
<map:parameter name="name" value="{1}"/>
<map:parameter name="progLanguage" value="{1}"/>
Added:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex.xsl
URL:
http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex.xsl?rev=327720&view=auto
==============================================================================
---
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex.xsl
(added)
+++
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex.xsl
Sat Oct 22 16:53:12 2005
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Convert the descriptor index to a list of projects using a speciic language.
+-->
+<xsl:stylesheet version = "1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ 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#">
+
+ <xsl:param name="language"/>
+
+ <xsl:template match="descriptors">
+ <html>
+ <head>
+ <title>Index of Projects using the <xsl:value-of select="$language"/>
Programming language</title>
+ </head>
+ <body>
+ <h1>Index of Projects using the <xsl:value-of select="$language"/>
Programming language</h1>
+ <ul>
+ <xsl:for-each select="//doap:Project[doap:programming-language =
$language]/doap:name">
+ <li>
+ <a>
+ <xsl:attribute name="href">/projectDetails.<xsl:value-of
select="."/>.html</xsl:attribute>
+ <xsl:value-of select="."/>
+ </a>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </body>
+ </html>
+ </xsl:template>
+</xsl:stylesheet>
+
Propchange:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex_siteSnippet.xsl
URL:
http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex_siteSnippet.xsl?rev=327720&view=auto
==============================================================================
---
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex_siteSnippet.xsl
(added)
+++
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex_siteSnippet.xsl
Sat Oct 22 16:53:12 2005
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version = "1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ 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#">
+
+ <xsl:key name="kDistinctProgLang" match="doap:programming-language" use="."/>
+
+ <xsl:template match="/">
+ <langIndex>
+ <xsl:attribute name="label">Language Indexes</xsl:attribute>
+ <xsl:for-each select="//doap:programming-language[generate-id() =
generate-id(key('kDistinctProgLang',.))]">
+ <xsl:sort select="."/>
+ <xsl:variable name="name" select="."/>
+ <xsl:element name="{$name}">
+ <xsl:attribute name="label"><xsl:value-of
select="$name"/></xsl:attribute>
+ <xsl:attribute name="href"><xsl:value-of
select="$name"/>_lang.html</xsl:attribute>
+ <xsl:attribute name="description">All projects using <xsl:value-of
select="$name"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </langIndex>
+ </xsl:template>
+
+ <xsl:template match="descriptor">
+ <xsl:variable name="name">
+ <xsl:choose>
+ <xsl:when test="descendant::doap:Project/doap:shortname">
+ <xsl:value-of select="descendant::doap:Project/doap:shortname"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="descendant::doap:Project/doap:name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <project>
+ <xsl:attribute name="label"><xsl:value-of
select="$name"/></xsl:attribute>
+ <xsl:attribute name="href"><xsl:value-of
select="@href-noext"/>.html</xsl:attribute>
+ <xsl:attribute name="description">Project details for <xsl:value-of
select="$name"/></xsl:attribute>
+ </project>
+ </xsl:template>
+</xsl:stylesheet>
+
Propchange:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/descriptorIndex-to-langIndex_siteSnippet.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/index.xml
URL:
http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/index.xml?rev=327720&r1=327719&r2=327720&view=diff
==============================================================================
---
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/index.xml
(original)
+++
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/index.xml
Sat Oct 22 16:53:12 2005
@@ -130,6 +130,10 @@
<p>The system will automatically create an index of projects from your
projects locationmap file. For example, the "Projects" section of the
navigation on the left is automatically generated.</p>
+
+ <note>There is considerable repetition in the indexes in this demo.
The
+ intention is to show the range of indexes that can be created. You
should
+ select the most suitable for your individual project.</note>
</section>
</section>
Modified:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/site.xml
URL:
http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/site.xml?rev=327720&r1=327719&r2=327720&view=diff
==============================================================================
---
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/site.xml
(original)
+++
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/src/documentation/content/xdocs/site.xml
Sat Oct 22 16:53:12 2005
@@ -50,6 +50,7 @@
<projects label="Projects" href="projectDetails/">
<xi:include href="cocoon://projectDetails/index.siteSnippet.xml"/>
<xi:include
href="cocoon://projectDetails/language-Java/index.siteSnippet.xml"/>
+ <xi:include href="cocoon://projectDetails/lang_index.siteSnippet.xml"/>
</projects>
<!--
Modified:
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/status.xml
URL:
http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/status.xml?rev=327720&r1=327719&r2=327720&view=diff
==============================================================================
---
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/status.xml
(original)
+++
forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/status.xml
Sat Oct 22 16:53:12 2005
@@ -42,6 +42,17 @@
displaying information about a given project.</p>
</notes>
<action dev="RDG" type="add" context="code" importance="high">
+ Add an automated index page for all projects using a specified
+ programming language. Use <code>projectDetails/*_lang.xml</code>
+ to retrieve it.
+ </action>
+ <action dev="RDG" type="add" context="code" importance="high">
+ Add an automated site.xml snippet that provides links to an
+ index page for all languages in use in all projects. XInclude
+ <code>projectDetails/lang_index.siteSnippet.xml</code> in your
+ site.xml file.
+ </action>
+ <action dev="RDG" type="add" context="code" importance="high">
Add an indexing capability for all known project descriptors.
</action>
<action dev="RDG" type="add" context="code" importance="high">