forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r567800 - /forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-rss.xsl
Date Mon, 20 Aug 2007 19:39:49 GMT
Author: rgardler
Date: Mon Aug 20 12:39:46 2007
New Revision: 567800

URL: http://svn.apache.org/viewvc?rev=567800&view=rev
Log:
Generate correct links in changes.rss: 
dispatcher-enabled projects set the value of 'project.url' e.g. in forrest.properties.xml

dispatcher-disabled projects set the 'projects-url' e.g. in skinconf.xml. 

The same's true for the 'project-name/project.name' property. 

(fixes FOR-1073, thanks to Sina K. Heshmati)

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-rss.xsl

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-rss.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-rss.xsl?rev=567800&r1=567799&r2=567800&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-rss.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-rss.xsl
Mon Aug 20 12:39:46 2007
@@ -15,29 +15,50 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0" 
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:forrest="http://apache.org/forrest/properties/1.0">
   <xsl:param name="versionNumber"/>
-  <xsl:variable name="changes-url"
-    select="concat(../skinconfig/project-url, 'changes.html')"/>
+  <xsl:variable name="changes-url">
+    <xsl:choose>
+      <xsl:when test="/*/skinconfig">
+        <xsl:value-of select="concat(/*/skinconfig/project-url, 'changes.html')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="concat(/*/forrest:properties/forrest:property[@name='project.url']/@value,
'changes.html')"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:template match="status">
+    <xsl:variable name="project-name">
+      <xsl:choose>
+        <xsl:when test="../skinconfig">
+          <xsl:value-of select="../skinconfig/project-name"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="../forrest:properties/forrest:property[@name='project.name']/@value"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
     <rss version="0.91">
       <channel>
         <xsl:choose>
           <xsl:when test="$versionNumber = 'current'">
-            <title><xsl:value-of select="../skinconfig/project-name"/> (<xsl:value-of
select="//release[1]/@version"/>) Changes</title>
+            <title><xsl:value-of select="$project-name"/> (<xsl:value-of select="//release[1]/@version"/>)
Changes</title>
           </xsl:when>
           <xsl:when test="$versionNumber">
-            <title><xsl:value-of select="../skinconfig/project-name"/> (<xsl:value-of
select="$versionNumber"/>) Changes</title>
+            <title><xsl:value-of select="$project-name"/> (<xsl:value-of select="$versionNumber"/>)
Changes</title>
           </xsl:when>
           <xsl:otherwise>
-            <title><xsl:value-of select="../skinconfig/project-name"/> (<xsl:value-of
select="//release[1]/@version"/>) Changes</title>
+            <title><xsl:value-of select="$project-name"/> (<xsl:value-of select="//release[1]/@version"/>)
Changes</title>
           </xsl:otherwise>
         </xsl:choose><link>
         <xsl:value-of select="$changes-url"/></link>
         <xsl:choose>
           <xsl:when test="$versionNumber = 'current'">
             <description>
-              <xsl:value-of select="../skinconfig/project-name"/>
+              <xsl:value-of select="$project-name"/>
               (
               <xsl:value-of select="//release[1]/@version"/>
               ) Changes
@@ -45,7 +66,7 @@
           </xsl:when>
           <xsl:when test="$versionNumber">
             <description>
-              <xsl:value-of select="../skinconfig/project-name"/>
+              <xsl:value-of select="$project-name"/>
               (
               <xsl:value-of select="$versionNumber"/>
               ) Changes
@@ -53,7 +74,7 @@
           </xsl:when>
           <xsl:otherwise>
             <description>
-              <xsl:value-of select="../skinconfig/project-name"/>
+              <xsl:value-of select="$project-name"/>
               (
               <xsl:value-of select="//release[1]/@version"/>
               ) Changes



Mime
View raw message