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 2007/04/11 18:33:04 UTC

svn commit: r527571 - in /lenya/trunk/src/modules: collection/ collection/config/cocoon-xconf/ collection/xslt/ news/

Author: andreas
Date: Wed Apr 11 09:33:03 2007
New Revision: 527571

URL: http://svn.apache.org/viewvc?view=rev&rev=527571
Log:
Refactored collection pipelines for more flexibility and consistence

Added:
    lenya/trunk/src/modules/collection/xslt/prepareCinclude.xsl
Modified:
    lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf
    lenya/trunk/src/modules/collection/sitemap.xmap
    lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl
    lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl
    lenya/trunk/src/modules/news/sitemap.xmap

Modified: lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf?view=diff&rev=527571&r1=527570&r2=527571
==============================================================================
--- lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf (original)
+++ lenya/trunk/src/modules/collection/config/cocoon-xconf/resourcetype-collection.xconf Wed Apr 11 09:33:03 2007
@@ -25,6 +25,7 @@
                       class="org.apache.lenya.cms.publication.ResourceTypeImpl">
     <sample-name name="Manual">fallback://lenya/modules/collection/samples/collection.xml</sample-name>
     <sample-name name="Children">fallback://lenya/modules/collection/samples/children.xml</sample-name>
+    <format name="collection" uri="cocoon://modules/collection/collection.xml"/>
   </component-instance>
 
 </xconf>

Modified: lenya/trunk/src/modules/collection/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/sitemap.xmap?view=diff&rev=527571&r1=527570&r2=527571
==============================================================================
--- lenya/trunk/src/modules/collection/sitemap.xmap (original)
+++ lenya/trunk/src/modules/collection/sitemap.xmap Wed Apr 11 09:33:03 2007
@@ -36,11 +36,13 @@
         <map:transform src="fallback://lenya/modules/collection/xslt/sitetree2children.xsl">
           <map:parameter name="language" value="{2}"/>
         </map:transform>
+        <!--
         <map:transform src="fallback://lenya/modules/collection/xslt/collection2cinclude.xsl">
           <map:parameter name="uuid" value="{1}"/>
           <map:parameter name="language" value="{2}"/>
         </map:transform>
         <map:transform type="cinclude"/>
+        -->
         <map:serialize type="xml"/>
       </map:match>
       
@@ -54,6 +56,17 @@
         </map:generate>
         <map:serialize type="xml"/>
       </map:match>
+      
+      <!-- collection format -->
+      <map:match pattern="collection.xml/*/*/*/*">
+        <map:generate src="lenya-document:{3},pub={1},area={2},lang={4}{link:rev}"/>
+        <map:transform src="fallback://lenya/modules/collection/xslt/prepareCinclude.xsl">
+          <map:parameter name="uuid" value="{3}"/>
+          <map:parameter name="language" value="{4}"/>
+        </map:transform>
+        <map:transform type="cinclude"/>
+        <map:serialize type="xml"/>
+      </map:match>        
       
     </map:pipeline>
     

Modified: lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl?view=diff&rev=527571&r1=527570&r2=527571
==============================================================================
--- lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl (original)
+++ lenya/trunk/src/modules/collection/xslt/collection2cinclude.xsl Wed Apr 11 09:33:03 2007
@@ -11,16 +11,8 @@
   <xsl:template match="col:collection">
     <xsl:copy>
       <xsl:copy-of select="@*"/>
-      <xsl:choose>
-        <xsl:when test="@type = 'children'">
-          <ci:include src="cocoon://modules/collection/collectionWithChildren/{$uuid}/{$language}.xml"
-            select="*/*"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <ci:include src="cocoon://modules/collection/metadata-{$uuid}.xml"/>
-          <xsl:apply-templates select="col:document"/>
-        </xsl:otherwise>
-      </xsl:choose>
+      <ci:include src="cocoon://modules/collection/metadata-{$uuid}.xml"/>
+      <xsl:apply-templates select="col:document"/>
     </xsl:copy>
   </xsl:template>
   

Added: lenya/trunk/src/modules/collection/xslt/prepareCinclude.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/xslt/prepareCinclude.xsl?view=auto&rev=527571
==============================================================================
--- lenya/trunk/src/modules/collection/xslt/prepareCinclude.xsl (added)
+++ lenya/trunk/src/modules/collection/xslt/prepareCinclude.xsl Wed Apr 11 09:33:03 2007
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+  xmlns:col="http://apache.org/cocoon/lenya/collection/1.0"
+  xmlns:ci="http://apache.org/cocoon/include/1.0">
+  
+  <xsl:param name="uuid"/>
+  <xsl:param name="language"/>
+  
+  <xsl:template match="col:collection">
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+      <xsl:if test="@type = 'children'">
+        <ci:include src="cocoon://modules/collection/collectionWithChildren/{$uuid}/{$language}.xml"
+          select="*/*"/>
+      </xsl:if>
+      <xsl:copy-of select="col:document"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  
+</xsl:stylesheet>
\ No newline at end of file

Modified: lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl?view=diff&rev=527571&r1=527570&r2=527571
==============================================================================
--- lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl (original)
+++ lenya/trunk/src/modules/collection/xslt/sitetree2children.xsl Wed Apr 11 09:33:03 2007
@@ -2,7 +2,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
   xmlns:site="http://apache.org/cocoon/lenya/sitetree/1.0"
   xmlns:col="http://apache.org/cocoon/lenya/collection/1.0"
-  xmlns:ci="http://apache.org/cocoon/include/1.0">
+  exclude-result-prefixes="site">
   
   
   <xsl:param name="language"/>

Modified: lenya/trunk/src/modules/news/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/news/sitemap.xmap?view=diff&rev=527571&r1=527570&r2=527571
==============================================================================
--- lenya/trunk/src/modules/news/sitemap.xmap (original)
+++ lenya/trunk/src/modules/news/sitemap.xmap Wed Apr 11 09:33:03 2007
@@ -46,7 +46,7 @@
       </map:match>
       
       <map:match pattern="*.xml/*/*/*/*">
-        <map:generate src="lenya-document:{4},pub={2},area={3},lang={5}{link:rev}"/>
+        <map:generate src="{resource-type:collection:format-collection}/{2}/{3}/{4}/{5}"/>
         <map:transform src="fallback://lenya/modules/collection/xslt/collection2cinclude.xsl">
           <map:parameter name="uuid" value="{4}"/>
           <map:parameter name="language" value="{5}"/>



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