You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2008/01/04 23:19:57 UTC

svn commit: r609032 - in /lenya/sandbox/modules/forrest: config/cocoon-xconf/resourcetype-svnLog.xconf resources/samples/svnLog.xml xslt/svnLog2document.xsl

Author: andreas
Date: Fri Jan  4 14:19:56 2008
New Revision: 609032

URL: http://svn.apache.org/viewvc?rev=609032&view=rev
Log:
Added svnLog resource type for forrest module

Added:
    lenya/sandbox/modules/forrest/config/cocoon-xconf/resourcetype-svnLog.xconf
    lenya/sandbox/modules/forrest/resources/samples/svnLog.xml
    lenya/sandbox/modules/forrest/xslt/svnLog2document.xsl

Added: lenya/sandbox/modules/forrest/config/cocoon-xconf/resourcetype-svnLog.xconf
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/forrest/config/cocoon-xconf/resourcetype-svnLog.xconf?rev=609032&view=auto
==============================================================================
--- lenya/sandbox/modules/forrest/config/cocoon-xconf/resourcetype-svnLog.xconf (added)
+++ lenya/sandbox/modules/forrest/config/cocoon-xconf/resourcetype-svnLog.xconf Fri Jan  4 14:19:56 2008
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<!-- $Id: doctypes.xconf 164635 2005-04-25 20:01:43Z tschlabach $ -->
+
+<xconf xpath="/cocoon/resource-types" unless="/cocoon/resource-types/component-instance[@name = 'svnLog']">
+  
+  <component-instance name="svnLog"
+    logger="lenya.resourcetypes.svnLog"
+    class="org.apache.lenya.cms.publication.ResourceTypeImpl">
+    <schema 
+      namespace="http://relaxng.org/ns/structure/0.9"
+      uri="fallback://lenya/modules/forrest/resources/schemas/svnLog.rng"/>
+    
+    <!-- Default time in seconds until the resource-type has expired -->  
+    <expires seconds="3600" />
+    
+    <sample 
+      mime-type="application/xml" 
+      uri="fallback://lenya/modules/forrest/resources/samples/svnLog.xml"
+    />
+    
+    <format name="xhtml" uri="cocoon://modules/forrest/xhtml.xml"/>
+    <format name="webdavGET" uri="cocoon://modules/forrest/davget.xml"/>
+    <format name="luceneIndex" uri="cocoon://modules/forrest/lucene-index"/>
+    <!-- "xslt-clean" format is used by webDAV (and other editors?) to "clean" xml content before it is validated/saved --> 
+    <format name="xslt-clean" uri="fallback://lenya/modules/forrest/xslt/clean-xhtml.xsl"/>
+    <format name="icon" uri="cocoon://modules/forrest/icon"/>
+    
+  </component-instance>
+  
+</xconf>

Added: lenya/sandbox/modules/forrest/resources/samples/svnLog.xml
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/forrest/resources/samples/svnLog.xml?rev=609032&view=auto
==============================================================================
--- lenya/sandbox/modules/forrest/resources/samples/svnLog.xml (added)
+++ lenya/sandbox/modules/forrest/resources/samples/svnLog.xml Fri Jan  4 14:19:56 2008
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<log>
+  <logentry revision="580913">
+    <author>john</author>
+    <date>2007-10-01T10:11:28.396022Z</date>
+    <paths>
+      <path action="M">/lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/ac/shibboleth/ShibbolethAuthenticator.java</path>
+      <path action="M">/lenya/branches/branch_1_2_x_shibboleth/src/webapp/WEB-INF/cocoon-xconf.xsl</path>
+    </paths>
+    <msg>Make redirect to WAYF server configurable</msg>
+  </logentry>
+</log>

Added: lenya/sandbox/modules/forrest/xslt/svnLog2document.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/forrest/xslt/svnLog2document.xsl?rev=609032&view=auto
==============================================================================
--- lenya/sandbox/modules/forrest/xslt/svnLog2document.xsl (added)
+++ lenya/sandbox/modules/forrest/xslt/svnLog2document.xsl Fri Jan  4 14:19:56 2008
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+  
+  Licensed 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.
+-->
+<!-- $Id: svn2changes.xsl 608844 2008-01-04 14:13:53Z andreas $ -->
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
+  <xsl:strip-space elements="*"/>
+  <xsl:preserve-space elements="xsl:text"/>
+  
+  <xsl:template match="/log">
+    <document>
+      <header>
+        <title>
+          Changes in the Month <xsl:value-of select="substring(logentry/date, 1, 7)"/>
+        </title>
+      </header>
+      <body>
+        <table class="properties">
+          <tr>
+            <th>Date</th>
+            <th>Version</th>
+            <th>Comment</th>
+            <th>Author</th>
+            <th>Action</th>
+            <th>Diff</th>
+          </tr>
+          <xsl:apply-templates select="logentry">
+            <xsl:sort select="date" order="descending"/>
+          </xsl:apply-templates>
+        </table>
+      </body>
+    </document>>
+  </xsl:template>
+  
+  <xsl:template match="logentry">
+    <tr>
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="position() mod 2 = 0">row1</xsl:when>
+          <xsl:otherwise>row2</xsl:otherwise>
+        </xsl:choose>
+        <xsl:if test="starts-with(msg, '[minor change]')"> minorChange</xsl:if>
+      </xsl:attribute>
+      <xsl:variable name="type">
+        <xsl:choose>
+          <xsl:when test="contains(paths/path[1]/@action, 'A')">add</xsl:when>
+          <xsl:when test="contains(paths/path[1]/@action, 'M')">update</xsl:when>
+          <xsl:when test="contains(paths/path[1]/@action, 'R')">update</xsl:when>
+          <xsl:when test="contains(paths/path[1]/@action, 'D')">remove</xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:variable name="version">
+        <xsl:choose>
+          <xsl:when test="contains(paths/path[1], 'BRANCH_1_2_X')">1.2</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'lenya/trunk') and contains(date, '2008')">2.0</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'lenya/trunk') and contains(date, '2007')">2.0</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'lenya/trunk') and contains(date, '2006')">2.0</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'lenya/trunk') and contains(date, '2005')">2.0</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'lenya/trunk') and contains(date, '2004')">2.0</xsl:when>
+          <xsl:when test="contains(date, '2003')">1.0</xsl:when>
+          <xsl:when test="contains(date, '2002')">0.8</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'docu')">Docs</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'lenya/sandbox')">Sandbox</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'site')">Site</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'zone')">Zone</xsl:when>
+          <xsl:when test="contains(paths/path[1], 'branches/revolution')">Revolution</xsl:when>
+          <xsl:otherwise>Misc</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <td><xsl:value-of select="substring(date, 1, 10)"/></td>
+      <td><xsl:value-of select="$version"/></td>
+      <td><xsl:value-of select="msg"/></td>
+      <td><xsl:value-of select="author"/></td>
+      <td><xsl:value-of select="$type"/></td>
+      <td><link href="http://svn.apache.org/viewcvs.cgi?rev={@revision}&amp;view=rev">Diff</link></td>
+    </tr>
+  </xsl:template>
+  
+</xsl:stylesheet>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org