You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2008/03/08 23:59:02 UTC

svn commit: r635107 [6/7] - in /lenya/branches/revolution/1.3.x: ./ src/cocoon/ src/java/org/apache/cocoon/components/source/ src/java/org/apache/lenya/ac/ src/java/org/apache/lenya/ac/cache/ src/java/org/apache/lenya/ac/file/ src/java/org/apache/lenya...

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/parser/XercesParser.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/parser/XercesParser.java?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/parser/XercesParser.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/parser/XercesParser.java Sat Mar  8 14:58:32 2008
@@ -22,7 +22,6 @@
 import java.io.InputStream;
 import java.io.PrintWriter;
 import java.io.Reader;
-
 import org.apache.lenya.xml.DOMWriter;
 import org.apache.xerces.dom.CDATASectionImpl;
 import org.apache.xerces.dom.CommentImpl;

Modified: lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/xpointer/XPointer.java
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/xpointer/XPointer.java?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/xpointer/XPointer.java (original)
+++ lenya/branches/revolution/1.3.x/src/java/org/apache/lenya/xml/xpointer/XPointer.java Sat Mar  8 14:58:32 2008
@@ -20,7 +20,6 @@
 package org.apache.lenya.xml.xpointer;
 
 import java.util.Vector;
-
 import org.w3c.dom.Node;
 
 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/authoring/module.xmap Sat Mar  8 14:58:32 2008
@@ -1,21 +1,6 @@
 <?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.
--->
 <!-- Authoring Module for Lenya 1.3.  Migrated from 1.2.x publication-sitemap.xmap.  -->
-<!-- Assumes Hierarchical Storage.  Needs to be aware of Flat storage. -->
+<!-- Wants Hierarchical Storage.  Passes Flat storage to Edit Module. -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <map:components/>
   <map:views>
@@ -56,9 +41,11 @@
             <map:select type="parameter">
                <map:parameter name="parameter-selector-test" value="{publication:contenttype}"/>
                <map:when test="flat">
-                  <map:act type="resource-exists" src="module://edit/module.xmap">
-                     <map:redirect-to uri="/{publication:publication}/edit"/>
-                  </map:act>
+                  <map:select type="resource-exists">
+                     <map:when test="module://edit/module.xmap">
+                        <map:redirect-to uri="/{publication:publication}/edit"/>
+                     </map:when>
+                  </map:select>
                </map:when>
             </map:select>
 
@@ -124,14 +111,21 @@
           <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
           <map:part src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}" label="xdebug"/>
         </map:aggregate>
+        <map:transform src="module:///../../pubs/{publication:publication}/xslt/page2xhtml-{4}.xsl">
+            <map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
+            <map:parameter name="url" value="{5}"/>
+            <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+            <map:parameter name="document-type" value="{page-envelope:document-type}"/>
+            <map:parameter name="language" value="{page-envelope:document-language}"/>
+        </map:transform>
 <!-- WARNING: Different path needed by Global and Publication Modules. -->
         <map:transform src="module:///../../pubs/{publication:publication}/xslt/page2xhtml-{4}.xsl">
-<!--        <map:transform src="module:///../../xslt/page2xhtml-{4}.xsl"> -->
-          <map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
-          <map:parameter name="url" value="{5}"/>
-          <map:parameter name="document-id" value="{page-envelope:document-id}"/>
-          <map:parameter name="document-type" value="{page-envelope:document-type}"/>
-          <map:parameter name="language" value="{page-envelope:document-language}"/>
+        <!--        <map:transform src="module:///../../xslt/page2xhtml-{4}.xsl"> -->
+            <map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
+             <map:parameter name="url" value="{5}"/>
+            <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+            <map:parameter name="document-type" value="{page-envelope:document-type}"/>
+            <map:parameter name="language" value="{page-envelope:document-language}"/>
         </map:transform>
         <map:transform type="i18n">      
           <map:parameter name="locale" value="{page-envelope:document-language}"/>
@@ -159,21 +153,18 @@
       <map:match pattern="**.html">
         <map:act type="language-exists">
               <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-url}" label="debug"/>
+           <!-- This match does nothing.  Always true. No side-effects. -->
               <map:match pattern="authoring/**.html">
-                <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{../../1}.xml?doctype={page-envelope:document-type}"/>
+                 <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{../../1}.xml?doctype={page-envelope:document-type}"/>
               </map:match>
               <map:transform src="module://lenya/util/strip_namespaces.xsl"/>
               <map:serialize type="xhtml"/>
         </map:act>
-
-        <!-- There is no version of the requested document-id for the
-             requested language. -->
+        <!-- There is no version of the requested document-id for the requested language. -->
         <map:generate type="serverpages" src="module://lenya/exception/missing-language.xsp"/>
         <map:transform src="module://lenya/exception/missing-language.xsl"/>
         <map:call resource="style-cms-page"/>
-
       </map:match>
-      
       <map:handle-errors>
         <map:select type="exception">
           <map:when test="document-does-not-exist">

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/cache/module.xmap Sat Mar  8 14:58:32 2008
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Cache Module -->
+<!-- Use cache only for resources requiring generation resulting in HTML. --> 
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <map:views>
     <map:view name="debug" from-label="debug">
@@ -17,8 +18,8 @@
                <map:when test="">
                </map:when>
                <map:otherwise>
-        <map:generate src="cocoon://{page-envelope:publication-id}/{1}/cocoon/{1}/{2}"/>
-        <map:serialize type="html"/>
+      <map:generate src="cocoon://{page-envelope:publication-id}/{content:type:{2}}/cocoon/{1}/{2}"/>
+      <map:serialize type="html"/>
                </map:otherwise>
             </map:select>
             <!-- Is visitor logged in? -->
@@ -27,9 +28,9 @@
                <map:when test="">
                </map:when>
                <map:otherwise>
-                  <!-- Add individual caching? -->
-        <map:generate src="cocoon://{page-envelope:publication-id}/{1}/cocoon/{1}/{2}"/>
-        <map:serialize type="html"/>
+                  <!-- DESIGN: Add individual caching? -->
+      <map:generate src="cocoon://{page-envelope:publication-id}/{content:type:{2}}/cocoon/{1}/{2}"/>
+      <map:serialize type="html"/>
                </map:otherwise>
             </map:select>
             <!-- Check Cache -->
@@ -39,7 +40,7 @@
               </map:when>
             </map:select>
             <!-- Else Cache -->
-               <map:generate src="cocoon://{page-envelope:publication-id}/{1}/cocoon/{1}/{2}"/>
+      <map:generate src="cocoon://{page-envelope:publication-id}/{content:type:{2}}/cocoon/{1}/{2}"/>
                <map:transform src="module://lenya/edit/addSourceTags.xsl">
                   <map:parameter name="source" value="{module:cache-dir}/{1}/{2}"/>
                </map:transform>
@@ -47,7 +48,7 @@
                   <map:parameter name="serializer" value="html-no-dtd"/>
                </map:transform>
                <map:transform src="module://lenya/edit/removeSourceTags.xsl"/>
-               <map:serialize type="html"/>
+      <map:serialize type="html"/>
          </map:match>
       </map:pipeline>
    </map:pipelines>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/all.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/all.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/all.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/all.xsl Sat Mar  8 14:58:32 2008
@@ -15,6 +15,7 @@
 <xsl:param name="module"/>
 <xsl:param name="publicationname"/>
 <xsl:param name="publicationlanguages"/>
+<xsl:param name="new"/>
 <xsl:variable name="language"><xsl:value-of select="/index/@language"/></xsl:variable>
 
 <xsl:template match="/index">
@@ -24,6 +25,10 @@
     </head>	
     <body>
 <h1><xsl:value-of select="$publication"/>&#160;<i18n:text>Resources</i18n:text></h1>
+<xsl:if test="string-length($new) &gt; 0">
+<xsl:element name="a">
+<xsl:attribute name="href">/<xsl:value-of select="$publication"/>/<xsl:value-of select="$new"/></xsl:attribute>Create Resource</xsl:element>
+</xsl:if>
 <table border="1">
 <tr>
 <th><i18n:text>UNID</i18n:text></th>
@@ -37,19 +42,10 @@
 <xsl:template match="resource">
 <tr><td><xsl:element name="a">
 <xsl:attribute name="href">/<xsl:value-of select="$publication"/>/<xsl:value-of select="$module"/>/<xsl:value-of select="@unid"/></xsl:attribute><xsl:value-of select="@unid"/></xsl:element></td>
-<td><xsl:value-of select="@type"/><xsl:if test="@doctype">/<xsl:value-of select="@doctype"/></xsl:if></td>
+<td><xsl:value-of select="@type"/></td>
 <td><xsl:value-of select="@id"/></td>
 </tr>
 </xsl:template>
 
-<!-- OBSOLETE
-<xsl:template match="resource">
-<tr><td><xsl:element name="a">
-<xsl:attribute name="href">/<xsl:value-of select="$publication"/>/<xsl:value-of select="$module"/>/<xsl:value-of select="@type"/><xsl:if test="@doctype">/<xsl:value-of select="@doctype"/></xsl:if>/<xsl:value-of select="@unid"/></xsl:attribute><xsl:value-of select="@unid"/></xsl:element></td>
-<td><xsl:value-of select="@id"/></td>
-<td><xsl:value-of select="@title"/></td>
-</tr>
-</xsl:template>
--->
 
 </xsl:stylesheet> 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/edit/module.xmap Sat Mar  8 14:58:32 2008
@@ -6,20 +6,29 @@
          <map:select type="parameter">
             <map:parameter name="parameter-selector-test" value="{publication:contenttype}"/>
             <map:when test="flat">
-               <map:generate type="sitetree" src="all"/>
+               <map:generate type="sitetree"/>
                <map:transform src="module:///all.xsl">
                   <map:parameter name="publication" value="{publication:publication}"/>
                   <map:parameter name="module" value="{module:module}"/>
                   <map:parameter name="publicationname" value="{publication:name}"/>
                   <map:parameter name="publicationlanguages" value="{publication:languages}"/>
+                  <map:select type="resource-exists">
+                     <map:when test="module://new/module.xmap">
+                        <map:parameter name="new" value="new"/>
+                     </map:when>
+                  </map:select>
+<!-- BUG: Selector does not work.  -->
+                  <map:parameter name="new" value="new"/>
                </map:transform>
                <map:transform type="i18n"/>           
                <map:serialize type="html"/>
             </map:when>
             <map:otherwise>
-               <map:act type="resource-exists" src="module://authoring/module.xmap">
-                  <map:redirect-to uri="/{publication:publication}/authoring"/>
-               </map:act>
+               <map:select type="resource-exists">
+                  <map:when test="module://authoring/module.xmap">
+                     <map:redirect-to uri="/{publication:publication}/authoring"/>
+                  </map:when>
+               </map:select>
             </map:otherwise>
          </map:select>
          <map:generate src="module:///hierarchical.html"/> 
@@ -37,10 +46,12 @@
             </map:match>
 <!-- Resource -->
             <map:match pattern="{module:module}/*">
-               <map:act type="resource-exists" src="module://{content:type:{1}}/edit.xmap">
-                  <map:mount uri-prefix="" src="module://{content:type:{../1}}/edit.xmap"/> 
-                  <map:serialize type="html"/>
-               </map:act>
+               <map:select type="resource-exists">
+                  <map:when test="module://{content:type:{1}}/edit.xmap">
+                     <map:mount uri-prefix="" src="module://{content:type:{1}}/edit.xmap"/> 
+                     <map:serialize type="html"/>
+                  </map:when>
+               </map:select>
                <map:aggregate element="content">
                   <map:part src="content:::/{1}"/>
                   <map:part src="content::/{1}"/>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/live.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/live.xmap?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/live.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/live.xmap Sat Mar  8 14:58:32 2008
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- File Module - Live -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <map:flow language="javascript">
+     <map:script src="module:///code.js"/>
+  </map:flow>
+   <map:pipelines>
+      <map:pipeline type="noncaching">
+         <map:match pattern="*/**">
+            <!-- Send the file -->
+            <map:read src="content:/{2}"/>
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
+</map:sitemap>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/module.xmap Sat Mar  8 14:58:32 2008
@@ -1,41 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Link Module -->
+<!-- File Module -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <map:flow language="javascript">
      <map:script src="module:///code.js"/>
   </map:flow>
    <map:pipelines>
       <map:pipeline type="noncaching">
-         <map:match pattern="{module:module}/*.css">
-            <map:read src="module:///{1}.css" mime-type="text/css"/>
-         </map:match>
-         <map:match pattern="formdata">
-            <map:generate type="serverpages" src="module://form/post.xsp"/>
-            <map:serialize type="xml"/>
-         </map:match>
-         <map:match pattern="{module:module}/save/*">
-            <map:call function="update">
-             <map:parameter name="publication" value="{page-envelope:publication-id}"/>
-             <map:parameter name="module" value="{module:module}"/>
-             <map:parameter name="unid" value="{1}"/>
-           </map:call>
-         </map:match>
-         <map:match pattern="{module:module}/savedata/*">
-            <map:aggregate element="save">
-               <map:part src="content:/INFO/{1}!edit"/>
-               <map:part src="cocoon:/formdata"/>
-            </map:aggregate>
-            <map:transform src="module:///save.xsl">
-               <map:parameter name="unid" value="{1}"/>
-            </map:transform>
-            <map:serialize type="xml"/>
-         </map:match>
-         <map:match pattern="edit/*">
-            <map:act type="resource-exists" src="module://edit/module.xmap">
-               <map:redirect-to uri="/{publication:publication}/edit/{../1}"/>
-            </map:act>
-            <map:mount uri-prefix="" src="module:///edit.xmap"/> 
-            <map:serialize type="html"/>
+         <map:match pattern="**">
+<!-- CSS Bypass -->
+            <map:match pattern="{module:module}/*.css">
+               <map:read src="module:///{1}.css" mime-type="text/css"/>
+            </map:match>
+<!-- TODO: Remove uses of post.xsp -->
+            <map:match pattern="formdata">
+               <map:generate type="serverpages" src="module://form/post.xsp"/>
+               <map:serialize type="xml"/>
+            </map:match>
+<!-- Edit -->
+            <map:match pattern="edit/*">
+               <map:select type="resource-exists">
+                  <map:when test="module://edit/module.xmap">
+                     <map:redirect-to uri="/{publication:publication}/edit/{1}"/>
+                  </map:when>
+               </map:select>
+               <map:mount uri-prefix="" src="module:///edit.xmap"/> 
+               <map:serialize type="html"/>
+            </map:match>
+<!-- Save -->
+            <map:match pattern="{module:module}/save/*">
+               <map:call function="update">
+                <map:parameter name="publication" value="{page-envelope:publication-id}"/>
+                <map:parameter name="module" value="{module:module}"/>
+                <map:parameter name="unid" value="{1}"/>
+              </map:call>
+            </map:match>
+<!-- SaveData (Used by Update function.) -->
+            <map:match pattern="{module:module}/savedata/*">
+               <map:aggregate element="save">
+                  <map:part src="content:/INFO/{1}!edit"/>
+                  <map:part src="cocoon:/formdata"/>
+               </map:aggregate>
+               <map:transform src="module:///save.xsl">
+                  <map:parameter name="unid" value="{1}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+            </map:match>
+<!-- Remove module name and send the file -->
+            <map:match pattern="{module:module}/**">
+               <map:read src="content:/{1}"/>
+            </map:match>
+<!-- Send the file -->
+            <map:read src="content:/{1}"/>
          </map:match>
       </map:pipeline>
    </map:pipelines>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/resource.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/resource.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/resource.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/resource.xsl Sat Mar  8 14:58:32 2008
@@ -132,6 +132,7 @@
 <tr><td colspan="8" class="spacer">&#160;</td></tr>
 <tr><th colspan="8" class="spacer"><input type="submit" value="Save" i18n:attribute="value"/></th></tr>
 </table>
+If nothing saves, check that the "enable-uploads" setting in web.xml is "true".
 </form>
 <br/>
 </xsl:template>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/save.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/save.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/save.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/file/save.xsl Sat Mar  8 14:58:32 2008
@@ -39,7 +39,7 @@
 <xsl:attribute name="action">delete</xsl:attribute>
 </xsl:when>
 <xsl:otherwise>
-<xsl:if test="(@live != $livenew) and (($livenew != 'new') or (newrevision='1'))">
+<xsl:if test="((@live != $livenew) or (string-length(@live) = 0)) and (($livenew != 'new') or ($newrevision='1'))">
 <xsl:attribute name="live"><xsl:value-of select="$livenew"/></xsl:attribute>
 </xsl:if>
 <xsl:if test="(@edit != $editnew) and (newrevision != '1')"><xsl:attribute name="edit"><xsl:value-of select="$editnew"/></xsl:attribute></xsl:if>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/content3.xsl Sat Mar  8 14:58:32 2008
@@ -22,7 +22,7 @@
 <xsl:attribute name="unid"><xsl:value-of select="$unid"/></xsl:attribute>
 <xsl:attribute name="filename">/resource.xml</xsl:attribute>
 <xsl:choose>
-<xsl:when test="@id='/index'"><xsl:attribute name="doctype">homepage</xsl:attribute></xsl:when>
+<xsl:when test="@id='/index'"><xsl:attribute name="doctype">home</xsl:attribute></xsl:when>
 <xsl:when test="@type='xml'"><xsl:attribute name="doctype">xhtml</xsl:attribute></xsl:when>
 </xsl:choose>
 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/index/live.xconf Sat Mar  8 14:58:32 2008
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <index structure="livemenu">
-<filter property="type">xml</filter>
-<filter property="doctype">xhtml|link</filter>
+<filter property="type">xml|xhtml|link</filter>
 </index>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/flat/module.xmap Sat Mar  8 14:58:32 2008
@@ -51,16 +51,18 @@
 <!-- Content END -->
 <!-- Resources BEGIN -->
         <map:match pattern="rfiles/*">
-          <map:act type="resource-exists" src="module:///../../resources/{1}">
-            <map:generate type="directory" src="module:///../../resources/{../1}">
-               <map:parameter name="depth" value="99"/>
-             </map:generate>
-             <!-- Mess of all files -->
-             <map:transform src="module:///rdir.xsl">
-               <map:parameter name="area" value="{../1}"/>
-             </map:transform>
-             <map:serialize type="xml"/>
-             </map:act>
+           <map:select type="resource-exists">
+              <map:when test="module:///../../resources/{1}">
+                 <map:generate type="directory" src="module:///../../resources/{1}">
+                    <map:parameter name="depth" value="99"/>
+                 </map:generate>
+                 <!-- Mess of all files -->
+                 <map:transform src="module:///rdir.xsl">
+                    <map:parameter name="area" value="{1}"/>
+                 </map:transform>
+                 <map:serialize type="xml"/>
+              </map:when>
+           </map:select>
             <map:generate src="module://lenya/util/empty.xml"/>
             <map:serialize type="xml"/>
         </map:match>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/page2xhtml.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/page2xhtml.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/home/page2xhtml.xsl Sat Mar  8 14:58:32 2008
@@ -93,6 +93,7 @@
         </tr>
       </table>
       </div>
+Home page2xhtml
     </body>
   </html>
 </xsl:template>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/homepage/page2xhtml.xsl Sat Mar  8 14:58:32 2008
@@ -93,6 +93,7 @@
         </tr>
       </table>
       </div>
+Homepage Module's page2xhtml.xsl
     </body>
   </html>
 </xsl:template>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/lenya/sorry.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/lenya/sorry.xml?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/lenya/sorry.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/lenya/sorry.xml Sat Mar  8 14:58:32 2008
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" title="Sorry">
+<!-- TODO: Use i18n for all text -->
+  <head>
+    <title>Sorry</title>
+  </head>
+<div id="body">
+  <body>
+    <h1>Sorry</h1>
+    <p>The requested page cannot be displayed.  
+The page may not exist.  
+You may not have access to the page.  
+You may not be logged in.  
+If you cannot remedy this, please contact your administrator.</p>
+  </body>
+</div>
+</html>
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/a.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/a.xsl?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/a.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/a.xsl Sat Mar  8 14:58:32 2008
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xhtml="http://www.w3.org/1999/xhtml"
+    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    exclude-result-prefixes="xhtml lenya"
+    >
+
+
+<xsl:template match="/link">
+<xhtml:html>
+<a href="{@href}"><xsl:value-of select="@title"/></a>
+</xhtml:html>
+</xsl:template>
+
+
+
+<!--
+<xsl:template match="/">
+<xhtml:html>
+<xsl:apply-templates select="link"/>
+</xhtml:html>
+</xsl:template>
+
+<xsl:template match="link">
+<a href="{@href}"><xsl:value-of select="@title"/></a>
+</xsl:template>
+-->
+</xsl:stylesheet> 

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/broken.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/broken.xml?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/broken.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/broken.xml Sat Mar  8 14:58:32 2008
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- TODO: Use i18n for text -->
+<div class="brokenlink">BROKEN LINK</div>
+
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/live.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/live.xmap?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/live.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/live.xmap Sat Mar  8 14:58:32 2008
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Link Module - Live -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+   <map:pipelines>
+      <map:pipeline>
+         <map:match pattern="**">
+
+
+            <map:match pattern="*/**.*">
+<!-- Get the link -->
+               <map:select type="resource-exists">
+                  <map:when test="content:/{2}">
+                     <map:generate src="content:/{2}"/>
+                     <map:transform src="module:///a.xsl"/>
+                  </map:when>
+                  <map:otherwise>
+                     <map:generate src="module:///broken.xml"/>
+                  </map:otherwise>
+               </map:select>
+               <map:transform type="i18n">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:match pattern="**.html">
+                  <map:serialize type="html"/>
+               </map:match>
+               <map:serialize type="xml"/>
+            </map:match>
+<!-- No extension -->
+            <map:generate src="cocoon:/{1}.xml"/>
+            <map:serialize type="xml"/>
+<!-- Testing -->
+              <map:generate src="module://lenya/util/empty.xml"/>
+               <map:transform src="module://lenya/test.xsl">
+                  <map:parameter name="test1" value="{1}"/>
+                  <map:parameter name="test2" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test3" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test4" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test5" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test6" value="{page-envelope:document-node-id}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
+</map:sitemap>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/module.xmap Sat Mar  8 14:58:32 2008
@@ -31,12 +31,17 @@
             <map:serialize type="xml"/>
          </map:match>
          <map:match pattern="edit/*">
-            <map:act type="resource-exists" src="module://edit/module.xmap">
-               <map:redirect-to uri="/{publication:publication}/edit/{../1}"/>
-            </map:act>
+            <map:select type="resource-exists">
+                  <map:when test="module://edit/module.xmap">
+                     <map:redirect-to uri="/{publication:publication}/edit/{1}"/>
+                  </map:when>
+            </map:select>
             <map:mount uri-prefix="" src="module:///edit.xmap"/> 
             <map:serialize type="html"/>
          </map:match>
+<!-- Default -->
+         <map:mount uri-prefix="" src="module:///live.xmap"/> 
+         <map:serialize type="html"/>
       </map:pipeline>
    </map:pipelines>
 </map:sitemap>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/save.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/save.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/save.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/link/save.xsl Sat Mar  8 14:58:32 2008
@@ -39,10 +39,12 @@
 <xsl:attribute name="action">delete</xsl:attribute>
 </xsl:when>
 <xsl:otherwise>
-<xsl:if test="(@live != $livenew) and (($livenew != 'new') or (newrevision='1'))">
+<xsl:if test="((@live != $livenew) or (string-length(@live) = 0)) and (($livenew != 'new') or ($newrevision='1'))">
 <xsl:attribute name="live"><xsl:value-of select="$livenew"/></xsl:attribute>
 </xsl:if>
 <xsl:if test="(@edit != $editnew) and (newrevision != '1')"><xsl:attribute name="edit"><xsl:value-of select="$editnew"/></xsl:attribute></xsl:if>
+<test live="{@live" livenew="{$livenew}" newrevision="{$newrevision}"/>
+
 <xsl:apply-templates select="revision" mode="info">
    <xsl:with-param name="language" select="$language"/>
 </xsl:apply-templates>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/live/module.xmap Sat Mar  8 14:58:32 2008
@@ -1,62 +1,32 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Live Module -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
-  <map:views>
-    <map:view name="debug" from-label="debug">
-       <map:serialize type="xml"/>
-    </map:view> 
-  </map:views>
+   <map:views>
+      <map:view name="debug" from-label="debug">
+         <map:serialize type="xml"/>
+      </map:view> 
+   </map:views>
 <!-- ************************************************************** -->
    <map:pipelines>
       <map:pipeline type="noncaching">
          <map:match pattern="**">
-               <map:match pattern="*">
-                  <map:redirect-to uri="{1}/index.html"  session="false"/>
-               </map:match>
-               <map:match pattern="**/">
-                  <map:redirect-to uri="index.html"  session="false"/>
-               </map:match>
-               <map:match pattern="**/index*">
-                  <map:act type="resource-exists" src="module://homepage/module.xmap">
-                     <map:mount uri-prefix="" src="module://homepage/module.xmap"/> 
-                     <map:serialize type="html"/>
-                  </map:act>
-               </map:match>
-            <!-- Get the current document -->
-            <map:match pattern="*/cocoon/{module:module}/**">
-               <map:aggregate element="cmsbody">
-                  <map:part src="cocoon://{publication:publication}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{publication:publication}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{publication:publication}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
-                  <map:part src="cocoon://{publication:publication}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
-<!--  WORK: Get doctype from Resource -->
-                  <map:part src="cocoon://{publication:publication}/xhtml/{module:module}/{2}"/>
-               </map:aggregate>
-               <map:transform type="i18n">
-                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
-               </map:transform>
-               <map:transform src="module:///page2xhtml.xsl">
-                 <map:parameter name="contenttype" value="{publication:contenttype}"/>
-                 <map:parameter name="root" value="{page-envelope:context-prefix}/{publication:publication}/{module:module}"/>
-                 <map:parameter name="url" value="{2}"/>
-                 <map:parameter name="document-id" value="{page-envelope:document-id}"/>
-                 <map:parameter name="document-name" value="{page-envelope:document-name}"/>
-<!--  WORK: Get doctype from Resource -->
-                 <map:parameter name="document-type" value="xhtml"/>
-                 <map:parameter name="language" value="{page-envelope:document-language}"/>
-                 <map:parameter name="querystring" value="{request:queryString}"/>
-               </map:transform>
-               <map:transform type="i18n">
-                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
-               </map:transform>
-               <map:serialize type="html"/>
+            <map:match pattern="*">
+               <map:redirect-to uri="{1}/index.html"  session="false"/>
             </map:match>
-<!--Default -->
-            <map:act type="resource-exists" src="module://cache">
-               <map:mount uri-prefix="" src="module://cache/module.xmap"/> 
-               <map:serialize type="html"/>
-            </map:act>
-            <map:generate src="cocoon:/{module:module}/cocoon/{1}"/>
+            <map:match pattern="**/">
+               <map:redirect-to uri="index.html"  session="false"/>
+            </map:match>
+<!-- Pass to Resource Type Module -->
+            <map:match pattern="{module:module}/**">
+               <map:select type="resource-exists">
+                  <map:when test="module://{content:type:{1}}/live.xmap">
+                    <map:mount uri-prefix="" src="module://{content:type:{1}}/live.xmap"/>
+                    <map:serialize type="html"/>
+                  </map:when>
+               </map:select>
+            </map:match>
+<!-- Default -->
+            <map:generate src="module://lenya/sorry.xml"/>
             <map:serialize type="html"/>
          </map:match>
       </map:pipeline>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/nav/module.xmap Sat Mar  8 14:58:32 2008
@@ -50,22 +50,23 @@
          <map:generate src="cocoon:/{1}/{2}"/>
          <map:serialize type="xml"/>   
       </map:match>
-<!--  {menu}/{indexname} -->
-      <map:match pattern="*/**">
+       <!--  {menu}/{indexname}/id -->
        <map:match pattern="*/*/**">
 <!-- Module XMAP -->
-         <map:act type="resource-exists" src="module://{1}/{module:module}.xmap">
-            <map:mount uri-prefix="" src="module://{../1}/{module:module}.xmap"/> 
+      <map:select type="resource-exists">
+         <map:when test="module://{1}/{module:module}.xmap">
+            <map:mount uri-prefix="" src="module://{1}/{module:module}.xmap"/> 
             <map:serialize type="xml"/>
-        </map:act>
+         </map:when>
 <!-- Module XSL -->
-         <map:act type="resource-exists" src="module://{1}/{module:module}.xsl">
-            <map:generate type="sitetree" src="{../2}"/>
+         <map:when test="module://{1}/{module:module}.xsl">
+            <map:generate type="sitetree" src="{2}"/>
             <map:call resource="finish">
-              <map:parameter name="stylesheet" value="{../1}/{module:module}.xsl"/>
-              <map:parameter name="url" value="{../3}"/>
+              <map:parameter name="stylesheet" value="{1}/{module:module}.xsl"/>
+              <map:parameter name="url" value="{3}"/>
             </map:call>
-        </map:act>
+         </map:when>
+      </map:select>
 <!-- Local XSL -->
         <map:generate type="sitetree" src="{2}"/>
         <map:call resource="finish">
@@ -73,7 +74,6 @@
            <map:parameter name="url" value="{3}"/>
         </map:call>
          <map:serialize type="xml"/>   
-       </map:match>
       </map:match>
 <!-- Default -->
         <map:generate type="sitetree" src="live"/>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/navigation/module.xmap Sat Mar  8 14:58:32 2008
@@ -2,20 +2,15 @@
 <!-- Navigation Module -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <!-- =========================== Components ================================ -->
-
-  <map:components>
+<map:components>
   <map:views>
     <map:view name="nav" from-label="nav">
        <map:serialize type="xml"/>
     </map:view> 
   </map:views>
   </map:components>
-
-
   <!-- =========================== Pipelines ================================ -->
-  
   <map:resources>
-    
     <map:resource name="finish">
       <map:transform src="module://{stylesheet}">
         <map:parameter name="url" value="{url}"/>
@@ -28,10 +23,9 @@
       <map:serialize type="xml"/>      
     </map:resource>
   </map:resources>
-  
-  <map:pipelines>
-    <map:pipeline>
-   <map:match pattern="**">
+   <map:pipelines>
+      <map:pipeline>
+         <map:match pattern="**">
 <!-- Not tested -->
     <map:match pattern="admin/*/**.xml">
       <map:generate src="cocoon:/{publication:publication}/admin/sitetree/{2}.xml"/>
@@ -50,19 +44,19 @@
          <map:serialize type="xml"/>      
       </map:match>
 <!-- REMOVE .xml -->
-       <map:match pattern="**.xml">
+      <map:match pattern="**.xml">
          <map:generate src="cocoon:/{1}"/>
          <map:serialize type="xml"/>   
       </map:match>
 <!-- REMOVE .html -->
-       <map:match pattern="**.html">
+      <map:match pattern="**.html">
          <map:generate src="cocoon:/{1}"/>
-         <map:serialize type="xml"/>   
+         <map:serialize type="xml"/>
       </map:match>
 <!-- Sitetree -->
-       <map:match pattern="sitetree/**">
+      <map:match pattern="sitetree/**">
 <!-- WARNING: Need different Paths for Global and Publication Modules. -->
-             <map:generate src="module:///../../pubs/{publication:publication}/content/{page-envelope:area}/sitetree.xml"/>
+         <map:generate src="module:///../../pubs/{publication:publication}/content/{page-envelope:area}/sitetree.xml"/>
 <!--         <map:generate src="module:///../../content/{page-envelope:area}/sitetree.xml"/> -->
          <map:transform type="i18n">
             <map:parameter name="locale" value="{page-envelope:document-language}"/>
@@ -78,39 +72,43 @@
       <map:select type="parameter">
          <map:parameter name="parameter-selector-test" value="{publication:contenttype}"/>
          <map:when test="flat">
-            <map:act type="resource-exists" src="module://nav">
-               <map:generate src="cocoon://{publication:publication}/nav/{../1}/{page-envelope:area}/{../2}"/>
-               <map:serialize type="xml"/>
-            </map:act>
+            <map:select type="resource-exists">
+               <map:when test="module://nav">
+                  <map:generate src="cocoon://{publication:publication}/nav/{1}/{page-envelope:area}/{2}"/>
+                  <map:serialize type="xml"/>
+               </map:when>
+            </map:select>
          </map:when>
       </map:select>
+      <map:select type="resource-exists">
     <!-- pattern: {pub-id}/admin/{nav-element}/{url}.xml -->
 <!-- Navigation Module XMAP -->
-         <map:act type="resource-exists" src="module://{1}/{module:module}.xmap">
-            <map:mount uri-prefix="" src="module://{1}/{module:module}.xmap"/> 
-            <map:serialize type="xml"/>
-        </map:act>
+         <map:when test="module://{1}/{module:module}.xmap">
+            <map:mount uri-prefix="" src="module://{1}/{module:module}.xmap"/>
+            <map:serialize type="html"/>
+         </map:when>
+         <map:when test="module://{1}/{module:module}.xsl">
 <!-- Navigation Module XSL -->
-         <map:act type="resource-exists" src="module://{1}/{module:module}.xsl">
             <map:generate src="cocoon:/sitetree/{2}"/>
             <map:call resource="finish">
-              <map:parameter name="stylesheet" value="{../1}/{module:module}.xsl"/>
-              <map:parameter name="url" value="{../2}.html"/>
+               <map:parameter name="stylesheet" value="{1}/{module:module}.xsl"/>
+               <map:parameter name="url" value="{2}.html"/>
             </map:call>
-        </map:act>
+         </map:when>
+         <map:when test="module:///{1}.xsl">
 <!-- Navigation XSL -->
-        <map:act type="resource-exists" src="module:///{1}.xsl">
-           <map:generate src="cocoon:/sitetree/{../2}"/>
-           <map:call resource="finish">
-              <map:parameter name="stylesheet" value="/{../1}.xsl"/>
-              <map:parameter name="url" value="{../2}.html"/>
-           </map:call>
-        </map:act>
-      </map:match>
-<!-- Default -->
-        <map:generate src="cocoon:/sitetree/index"/>
-        <map:serialize type="xml"/>
+            <map:generate src="cocoon:/sitetree/{2}"/>
+            <map:call resource="finish">
+               <map:parameter name="stylesheet" value="/{1}.xsl"/>
+               <map:parameter name="url" value="{2}.html"/>
+            </map:call>
+         </map:when>
+      </map:select>
    </map:match>
-    </map:pipeline>
-  </map:pipelines>
+<!-- Default -->
+            <map:generate src="cocoon:/sitetree/index"/>
+            <map:serialize type="xml"/>
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
 </map:sitemap>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/NOTES.txt
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/NOTES.txt?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/NOTES.txt (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/NOTES.txt Sat Mar  8 14:58:32 2008
@@ -0,0 +1,11 @@
+
+XML for "new-resource" Transformer:
+
+<?xml version="1.0" encoding="UTF-8"?>
+<data>
+<newresource id="newID" type="/xml/xhtml" unid=""/>
+</data>
+
+The root element name is irrelevant.  The "newresource" elements must be children of the root element, must have "id" and "type" attributes, and can optionally have an "unid" attribute.  Multiple "newresource" elements are allowed; a new Resource will be created for each element.  Other elements are ignored and will be returned unchanged.
+
+The result will add the "unid" attribute from the new Resource and a "status" attribute with a value of "SUCCESS" or "FAILURE".  If the status is "FAILURE", a message will be placed in the value of the "newresource" element.
\ No newline at end of file

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/create.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/create.xsl?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/create.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/create.xsl Sat Mar  8 14:58:32 2008
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0" 
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+   xmlns:h="http://apache.org/cocoon/request/2.0"
+   exclude-result-prefixes="h">
+
+<xsl:template match="/">
+<data>
+<newresource>
+<xsl:attribute name="id"><xsl:value-of select="/h:request/h:requestParameters/h:parameter[@name='id']/h:value"/></xsl:attribute>
+<xsl:attribute name="type"><xsl:value-of select="/h:request/h:requestParameters/h:parameter[@name='type']/h:value"/></xsl:attribute>
+<xsl:attribute name="unid"><xsl:value-of select="/h:request/h:requestParameters/h:parameter[@name='unid']/h:value"/></xsl:attribute>
+</newresource>
+</data>
+</xsl:template>
+
+
+</xsl:stylesheet> 

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/edit.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/edit.xsl?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/edit.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/edit.xsl Sat Mar  8 14:58:32 2008
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:xhtml="http://www.w3.org/1999/xhtml"
+    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+    exclude-result-prefixes="page xhtml"
+    >
+    
+<xsl:param name="root"/>
+
+<xsl:template match="/data">
+  <html>
+   <xsl:apply-templates select="newresource[1]"/>
+  </html>
+</xsl:template>
+
+<xsl:template match="newresource">
+<xsl:variable name="newurl"><xsl:value-of select="$root"/><xsl:value-of select="@unid"/></xsl:variable>
+    <head>
+            <xsl:choose>
+              <xsl:when test="@status = 'SUCCESS'">
+      <meta http-equiv="Refresh" content="0;URL={$newurl}"/>
+      <title>New Resource Created</title>
+              </xsl:when>
+              <xsl:otherwise>
+      <title>New Resource Failed</title>
+              </xsl:otherwise>
+	    </xsl:choose>
+
+    </head>	
+    <body>
+      <div id="page">
+            <xsl:choose>
+              <xsl:when test="@status = 'SUCCESS'">
+Should be redirected to <a href="{$newurl}"><xsl:value-of select="@newurl"/></a>
+              </xsl:when>
+              <xsl:otherwise>
+Creating resource failed.
+<br/><xsl:value-of select="."/>
+              </xsl:otherwise>
+	    </xsl:choose>
+      </div>
+    </body>
+</xsl:template>
+
+<xsl:template match="@*|node()" priority="-1">
+</xsl:template>
+
+
+</xsl:stylesheet> 

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xmap Sat Mar  8 14:58:32 2008
@@ -20,8 +20,37 @@
 <!-- Actions -->
    <!-- Create Resource from POST data -->
             <map:match pattern="{module:module}/save*">
-<!-- TODO: Create Resource from POST data -->
                <map:generate type="request"/>
+               <map:transform src="module::///create.xsl"/> 
+               <map:transform type="new-resource">
+               </map:transform>
+               <!-- Open new resource or display failure message-->
+               <map:transform src="module:///edit.xsl">
+                  <map:parameter name="root" value="/{publication:publication}/edit/"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+<!-- DEV: passing UNID did not work
+               <map:select type="parameter">
+                  <map:parameter name="parameter-selector-test" value="{request-param:unid}"/>
+                  <map:when test="">
+                  </map:when>
+                  <map:otherwise>
+                     <map:redirect-to uri="/{publication:publication}/edit/{request-param:unid}"/>
+                  </map:otherwise>
+               </map:select>
+                     <map:redirect-to uri="/{publication:publication}/test/{request:unid}!{request-attr:unid}!{request-param:unid}"/>
+               <map:transform src="module://test/test.xsl">
+                  <map:parameter name="test1" value="{1}"/>
+                  <map:parameter name="test2" value="{request:unid}"/>
+                  <map:parameter name="test3" value="{request-attr:unid}"/>
+                  <map:parameter name="test4" value="{request-param:unid}"/>
+                  <map:parameter name="test5" value="{new:unid}"/>
+                  <map:parameter name="test6" value="{page-envelope:document-node-id}"/>
+               </map:transform>
+-->
+               <map:serialize type="xml"/>
+               <!-- Failure Message -->
+<!-- TODO: Format Failure Message -->
                <map:serialize type="xml"/>
             </map:match>
    <!-- Development -->

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xml?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xml (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/module.xml Sat Mar  8 14:58:32 2008
@@ -1,4 +1,5 @@
 <module id="new" name="New Resource" minimum="1.2" created="1.3" content="all">
+   <required id="edit">For editing newly created Resource.</required>
    <recommended id="file">Resource Type</recommended>
    <recommended id="home">Resource Type</recommended>
    <recommended id="link">Resource Type</recommended>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/resource.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/resource.xsl?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/resource.xsl (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/new/resource.xsl Sat Mar  8 14:58:32 2008
@@ -31,21 +31,10 @@
 </td></tr>
 <tr><td>UNID</td><td>
 <xsl:element name="input">
-<xsl:attribute name="type">radio</xsl:attribute>
-<xsl:attribute name="name">unid</xsl:attribute>
-<xsl:attribute name="value">auto</xsl:attribute>
-<xsl:attribute name="checked"/>
-</xsl:element>Generate UUID or 
-<br/><xsl:element name="input">
-<xsl:attribute name="type">radio</xsl:attribute>
-<xsl:attribute name="name">unid</xsl:attribute>
-<xsl:attribute name="value">name</xsl:attribute>
-</xsl:element>Specify
-<xsl:element name="input">
 <xsl:attribute name="type">text</xsl:attribute>
-<xsl:attribute name="name">unidname</xsl:attribute>
+<xsl:attribute name="name">unid</xsl:attribute>
 <xsl:attribute name="value"></xsl:attribute>
-</xsl:element></td></tr>
+</xsl:element><br/>Leave blank to generate UUID.</td></tr>
 <tr><td>URL identifier (no spaces): </td><td><xsl:element name="input">
 <xsl:attribute name="type">text</xsl:attribute>
 <xsl:attribute name="name">id</xsl:attribute>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/module.xmap Sat Mar  8 14:58:32 2008
@@ -4,12 +4,20 @@
    <map:pipelines>
       <map:pipeline>
          <map:match pattern="**">
-            <!-- Remove extension -->
-            <map:match pattern="**.*">
-               <map:generate src="cocoon:/{1}"/>
-               <map:serialize type="xml"/>
+<!-- CSS bypass -->
+         <map:match pattern="**/*.css">
+            <map:read src="module:///{2}.css" mime-type="text/css"/>
+         </map:match>
+<!-- Content request pass to live XMAP -->
+            <map:match pattern="*/cocoon/**">
+               <map:select type="resource-exists">
+                  <map:when test="module://{content:type:{2}}/live.xmap">
+                    <map:mount uri-prefix="" src="module://{content:type:{1}}/live.xmap"/> 
+                    <map:serialize type="xml"/>
+                  </map:when>
+               </map:select>
             </map:match>
-            <!-- Step: View Revision from Lenya 1.2 -->
+<!-- Step: View Revision from Lenya 1.2 -->
             <map:match type="step" pattern="view-revision">
                <map:generate type="serverpages" src="module://lenya/rc/view.xsp"/>
                <map:transform src="module://lenya/rc/toDoc.xsl"/>
@@ -18,15 +26,46 @@
                </map:transform>
                <map:serialize type="xml"/>
             </map:match>
-            <!-- xhtml/{view|edit}/{area}/{docpath}_{language}.xml -->
-            <map:match pattern="{module:module}/**">
-               <map:generate src="content://{1}"/>
-               <map:transform src="module:///xhtml.xsl">
-                  <map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
+<!-- For Hierarchical Content: Patched during testing, but uncertain why this is needed -->
+              <!-- Get document.  See 13HELP.txt for legal values to content:/ -->
+              <map:select type="parameter">
+                  <map:parameter name="parameter-selector-test" value="{publication:contenttype}"/>
+                  <map:when test="flat">
+                  </map:when>
+                  <map:otherwise>
+                     <map:select type="resource-exists">
+                        <map:when test="content:/{1}">
+                           <map:generate src="content:/{1}"/>
+                           <map:transform src="module:///xhtml.xsl">
+                              <map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
+                           </map:transform>
+                           <map:serialize type="xml"/>
+                        </map:when>
+                        <map:when test="content:/live/{page-envelope:document-id}">
+                           <map:generate src="content:/live/{page-envelope:document-id}"/>
+                           <map:transform src="module:///xhtml.xsl">
+                              <map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
+                           </map:transform>
+                           <map:serialize type="xml"/>
+                        </map:when>
+                     </map:select>
+                  </map:otherwise>
+               </map:select>
+<!-- Force inheritance. Pass to XML Module -->
+                    <map:mount uri-prefix="" src="module://xml/module.xmap"/>
+                    <map:serialize type="xml"/>
+<!-- Testing -->
+              <map:generate src="module://lenya/util/empty.xml"/>
+               <map:transform src="module://lenya/test.xsl">
+                  <map:parameter name="test1" value="{1}"/>
+                  <map:parameter name="test2" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test3" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test4" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test5" value="{page-envelope:document-node-id}"/>
+                  <map:parameter name="test6" value="{page-envelope:document-node-id}"/>
                </map:transform>
                <map:serialize type="xml"/>
-           </map:match>
-       </map:match>
+         </map:match>
       </map:pipeline>
    </map:pipelines>
 </map:sitemap>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/resource.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/resource.xml?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/resource.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xhtml/resource.xml Sat Mar  8 14:58:32 2008
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" 
+xmlns:dc="http://purl.org/dc/elements/1.1/" 
+xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+xmlns:xhtml="http://www.w3.org/1999/xhtml" title="New XHTML Resource">
+    <lenya:meta>
+        <dc:title/>
+        <dc:creator/>
+        <dc:subject/>
+        <dc:description/>
+        <dc:publisher/>
+        <dc:contributor/>
+        <dc:date/>
+        <dc:type/>
+        <dc:format/>
+        <dc:identifier/>
+        <dc:source/>
+        <dc:language/>
+        <dc:relation/>
+        <dc:coverage/>
+        <dc:rights/>
+    </lenya:meta>
+  <head><title/></head>
+  <body><br/></body>
+</html>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/code.js Sat Mar  8 14:58:32 2008
@@ -8,10 +8,7 @@
       </translation>
       <translation language="ru" action="delete"/>
    </resource>
-   <revision action="new" language="en">
-      <link href="http://enURL" title="enTitle"/>
-   </revision>
-   <translation action="new" language="xx"/>
+   <!-- Create Translation for language xx -->
    <revision action="new" language="xx">
       <link href="http://xxURL" title="xxTitle"/>
    </revision>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/edit.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/edit.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/edit.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/edit.xmap Sat Mar  8 14:58:32 2008
@@ -5,16 +5,18 @@
    <map:pipelines>
       <map:pipeline>
 <!-- Remove Revision -->
-<!-- Was this a bad idea from last year? -->
+<!-- Was this a bad idea from last year?
             <map:match pattern="edit/*!*">
                <map:generate src="cocoon:/edit/{1}"/>
                <map:serialize type="html"/>
             </map:match>
+ -->
 <!-- Show Resource -->
          <map:match pattern="edit/*">
-            <map:act type="resource-exists" src="content:::/{1}">
+            <map:select type="resource-exists">
+             <map:when test="content:::/{1}">
                <map:aggregate element="content">
-                  <map:part src="content:::/{../1}!edit"/>
+                  <map:part src="content:::/{1}!edit"/>
                </map:aggregate>
                <map:transform src="module:///resource.xsl">
                   <map:parameter name="module" value="{module:module}"/>
@@ -24,10 +26,12 @@
                </map:transform>
                <map:transform type="i18n"/>
                <map:serialize type="html"/>
-            </map:act>
+             </map:when>
+            </map:select>
          </map:match>
 <!-- BUG Cocoon: map:handle-errors does not work here. -->
-
+         <map:handle-errors>
+         </map:handle-errors>
       </map:pipeline>
    </map:pipelines>
 </map:sitemap>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live-hierarchical.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live-hierarchical.xmap?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live-hierarchical.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live-hierarchical.xmap Sat Mar  8 14:58:32 2008
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- XML Module - Live - Hierarchical -->
+<!-- Uses Navigation Module for Navigation -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+   <map:pipelines>
+      <map:pipeline type="noncaching">
+         <map:match pattern="**">
+<!-- Get the current document -->
+            <map:match pattern="*/cocoon/*/**">
+               <map:aggregate element="cmsbody">
+                  <map:part src="cocoon://{publication:publication}/navigation/breadcrumb{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/tabs{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/menu{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/navigation/search{page-envelope:document-id}_{page-envelope:document-language}"/>
+<!-- TODO: Get doctype.  Hardcoded to "xhtml".   -->
+                 <map:part src="cocoon://{publication:publication}/xhtml/{3}"/> 
+               </map:aggregate>
+               <map:transform type="i18n">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+<!-- TODO: Get doctype.  Hardcoded to "xhtml".   -->
+               <map:transform src="module://xhtml/page2xhtml.xsl">
+                 <map:parameter name="contenttype" value="{publication:contenttype}"/>
+                 <map:parameter name="root" value="{page-envelope:context-prefix}/{publication:publication}/{module:module}"/>
+                 <map:parameter name="url" value="{3}"/>
+                 <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+                 <map:parameter name="document-name" value="{page-envelope:document-name}"/>
+<!-- TODO: Get doctype.  Hardcoded to "xhtml".   -->
+                 <map:parameter name="document-type" value="xhtml"/>
+                 <map:parameter name="language" value="{page-envelope:document-language}"/>
+                 <map:parameter name="querystring" value="{request:queryString}"/>
+               </map:transform>
+               <map:transform type="i18n">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+            </map:match>
+<!-- Check Cache -->
+            <map:select type="resource-exists">
+               <map:when test="module://cache/module.xmap">
+                  <map:mount uri-prefix="" src="module://cache/module.xmap"/> 
+                  <map:serialize type="xml"/>
+               </map:when>
+            </map:select>
+<!-- Default -->
+            <map:generate src="cocoon:/{module:module}/cocoon/{1}"/>
+            <map:serialize type="xml"/>
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
+</map:sitemap>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live.xmap?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live.xmap (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/live.xmap Sat Mar  8 14:58:32 2008
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- XML Module - Live -->
+<!-- Uses Nav Module for Navigation -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+   <map:pipelines>
+      <map:pipeline type="noncaching">
+         <map:match pattern="**">
+<!-- Get the current document -->
+              <map:select type="parameter">
+                  <map:parameter name="parameter-selector-test" value="{publication:contenttype}"/>
+                  <map:when test="flat">
+                  </map:when>
+                  <map:otherwise>
+                  <!-- If not flat, use different XMAP -->
+                     <map:mount uri-prefix="" src="module:///live-hierarchical.xmap"/> 
+                     <map:serialize type="xml"/>
+                  </map:otherwise>
+               </map:select>
+<!-- TODO: Change to map:mount -->
+            <map:match pattern="body/**">
+               <map:select type="resource-exists">
+                  <!-- UNIDs -->
+                  <map:when test="content:/{1}">
+                     <map:generate src="content:/{1}"/>
+                  </map:when>
+                  <!-- IDs using live structure -->
+                  <map:when test="content:/live/{page-envelope:document-id}">
+                     <map:generate src="content:/live/{page-envelope:document-id}"/>
+                  </map:when>
+                  <map:otherwise>
+                     <map:generate src="module://lenya/sorry.xml"/>
+                     <map:serialize type="xml"/>
+                  </map:otherwise>
+               </map:select>
+               <map:transform src="module://{content:type:{1}}/xhtml.xsl">
+                   <map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+            </map:match>
+            <map:match pattern="*/cocoon/*/**">
+               <map:aggregate element="cmsbody">
+                  <map:part src="cocoon://{publication:publication}/nav/breadcrumb/live{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/nav/tabs/live{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/nav/menu/live{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <map:part src="cocoon://{publication:publication}/nav/search/live{page-envelope:document-id}_{page-envelope:document-language}"/>
+                  <!-- BUG: Cocoon protocol does not follow Module Inheritance.
+                       <map:part src="cocoon://{publication:publication}/{content:type:{3}}/{3}"/> 
+                   -->
+                  <map:part src="cocoon:/body/{3}"/>
+               </map:aggregate>
+               <map:transform type="i18n">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:transform src="module://{content:type:{3}}/page2xhtml.xsl">
+                 <map:parameter name="contenttype" value="{publication:contenttype}"/>
+                 <map:parameter name="root" value="{page-envelope:context-prefix}/{publication:publication}/live"/>
+                 <map:parameter name="url" value="{3}"/>
+                 <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+                 <map:parameter name="document-name" value="{page-envelope:document-name}"/>
+                 <map:parameter name="document-type" value="{content:type:{3}}"/>
+                 <map:parameter name="language" value="{page-envelope:document-language}"/>
+                 <map:parameter name="querystring" value="{request:queryString}"/>
+               </map:transform>
+               <map:transform type="i18n">
+                  <map:parameter name="locale" value="{page-envelope:document-language}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+            </map:match>
+<!-- Check Cache -->
+<!-- TODO: Reenable Cache (Remove x) -->
+            <map:select type="resource-exists">
+               <map:when test="module://xcache/module.xmap">
+                  <map:mount uri-prefix="" src="module://cache/module.xmap"/> 
+                  <map:serialize type="xml"/>
+               </map:when>
+            </map:select>
+<!-- Default -->
+            <map:generate src="cocoon:/{module:module}/cocoon/{1}"/>
+            <map:serialize type="xml"/>
+         </map:match>
+      </map:pipeline>
+   </map:pipelines>
+</map:sitemap>

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/merge.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/merge.xsl?rev=635107&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/merge.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/merge.xsl Sat Mar  8 14:58:32 2008
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="/">
+      <xsl:apply-templates select="merge" mode="root"/>
+</xsl:template>
+
+<xsl:template match="merge" mode="root">
+   <xsl:element name="{name(node()[1])}" namespace="{namespace-uri(node()[1])}">
+      <xsl:apply-templates select="node()[1]/@*" mode="properties"/>
+      <xsl:apply-templates select="node()[2]/@*" mode="properties"/>
+      <xsl:apply-templates select="node()[1]/*" mode="template">
+         <xsl:with-param name="otherroot" select="node()[2]"/>
+      </xsl:apply-templates>
+   </xsl:element>
+</xsl:template>
+
+<xsl:template match="@*" mode="properties">
+   <xsl:copy/>
+</xsl:template>
+<xsl:template match="*|text()" mode="properties"/>
+
+<xsl:template match="*" mode="template">
+   <xsl:param name="otherroot"/>
+   <xsl:variable name="name"><xsl:value-of select="name()"/></xsl:variable>
+   <xsl:variable name="replacenode" select="$otherroot/node()[name() = $name]"/>
+   <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
+      <xsl:apply-templates select="./@*" mode="properties"/>
+   <xsl:choose>
+      <xsl:when test="$replacenode">
+         <xsl:call-template name="mergetemplate">
+            <xsl:with-param name="node1" select="." />
+            <xsl:with-param name="node2" select="$replacenode" />
+         </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+          <xsl:apply-templates select="*" mode="copy"/>
+      </xsl:otherwise>
+   </xsl:choose>
+   </xsl:element>
+</xsl:template>
+
+<xsl:template match="*" mode="extras">
+   <xsl:param name="otherroot"/>
+   <xsl:variable name="name" select="name()"/>
+   <xsl:variable name="replacenode" select="$otherroot/node()[name() = $name]"/>
+   <xsl:choose>
+      <xsl:when test="$replacenode">
+         <xsl:apply-templates select="*" mode="extras">
+            <xsl:with-param name="otherroot" select="$replacenode"/>
+         </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+          <xsl:apply-templates select="." mode="copy"/>
+      </xsl:otherwise>
+   </xsl:choose>
+</xsl:template>
+
+<xsl:template name="mergetemplate">
+   <xsl:param name="node1"/>
+   <xsl:param name="node2"/>
+   <xsl:apply-templates select="$node2" mode="properties"/>
+   <xsl:apply-templates select="$node2" mode="text"/>
+   <xsl:apply-templates select="$node1/*" mode="template">
+       <xsl:with-param name="otherroot" select="$node2"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="$node2/*" mode="extras">
+       <xsl:with-param name="otherroot" select="$node1"/>
+    </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="*" mode="text"><xsl:value-of select="child::text()"/></xsl:template>
+<xsl:template match="*|@*" mode="copy">
+   <xsl:copy>
+      <xsl:apply-templates select="*|@*|text()" mode="copy"/>
+   </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>

Modified: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/module.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/module.xmap?rev=635107&r1=635106&r2=635107&view=diff
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/module.xmap (original)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xml/module.xmap Sat Mar  8 14:58:32 2008
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Link Module -->
+<!-- XML Module -->
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <map:flow language="javascript">
      <map:script src="module:///code.js"/>
@@ -7,68 +7,91 @@
    <map:pipelines>
       <map:pipeline type="noncaching">
 <!-- CSS bypass -->
-         <map:match pattern="{module:module}/*.css">
-            <map:read src="module:///{1}.css" mime-type="text/css"/>
+         <map:match pattern="**/*.css">
+            <map:read src="module:///{2}.css" mime-type="text/css"/>
+         </map:match>
+<!-- Content request pass to live XMAP -->
+         <map:match pattern="*/cocoon/**">
+            <map:mount uri-prefix="" src="module://{content:type:{2}}/live.xmap"/> 
+            <map:serialize type="html"/>
          </map:match>
 <!-- Get POST data function -->
+<!-- TODO: Replace uses of post.xsp with RequestGenerator -->
          <map:match pattern="formdata">
             <map:generate type="serverpages" src="module://form/post.xsp"/>
             <map:serialize type="xml"/>
          </map:match>
 <!-- Edit meta data -->
          <map:match pattern="edit/*">
-            <map:act type="resource-exists" src="module://edit/module.xmap">
-               <map:redirect-to uri="/{publication:publication}/edit/{../1}"/>
-            </map:act>
+            <map:select type="resource-exists">
+               <map:when test="module://edit/module.xmap">
+                  <map:redirect-to uri="/{publication:publication}/edit/{1}"/>
+               </map:when>
+            </map:select>
             <map:mount uri-prefix="" src="module:///edit.xmap"/> 
             <map:serialize type="html"/>
          </map:match>
 <!-- Save meta data -->
-         <map:match pattern="{module:module}/save/*">
-            <map:call function="update">
-             <map:parameter name="publication" value="{page-envelope:publication-id}"/>
-             <map:parameter name="module" value="{module:module}"/>
-             <map:parameter name="unid" value="{1}"/>
-           </map:call>
-         </map:match>
+            <map:match pattern="*/save/*">
+               <map:call function="update">
+                <map:parameter name="publication" value="{page-envelope:publication-id}"/>
+                <map:parameter name="module" value="{module:module}"/>
+                <map:parameter name="unid" value="{2}"/>
+              </map:call>
+            </map:match>
 <!-- Data for update() -->
-         <map:match pattern="{module:module}/savedata/*">
-            <map:aggregate element="save">
-               <map:part src="content:/INFO/{1}!edit"/>
-               <map:part src="cocoon:/formdata"/>
-            </map:aggregate>
-            <map:transform src="module:///save.xsl">
-               <map:parameter name="unid" value="{1}"/>
-            </map:transform>
-            <map:serialize type="xml"/>
-         </map:match>
+<!-- TODO: Replace use of post.xsp with RequestGenerator -->
+            <map:match pattern="*/savedata/*">
+               <map:aggregate element="save">
+                  <map:part src="content:/INFO/{2}!edit"/>
+                  <map:part src="cocoon:/formdata"/>
+               </map:aggregate>
+               <map:transform src="module:///save.xsl">
+                  <map:parameter name="unid" value="{2}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+            </map:match>
 <!-- Edit new revision -->
-         <map:match pattern="{module:module}/newrevision/*_*!*">
-            <map:generate src="content:/{1}_{2}!{3}"/>
-            <map:transform src="module:///doc2form.xsl">
-             <map:parameter name="publication" value="{publication:publication}"/>
-             <map:parameter name="publicationname" value="{publication:name}"/>
-             <map:parameter name="module" value="{module:module}"/>
-             <map:parameter name="unid" value="{1}"/>
-             <map:parameter name="lang" value="{2}"/>
-            </map:transform>
-            <map:serialize type="html"/>
-         </map:match>
+            <map:match pattern="*/newrevision/*_*!*">
+               <map:select type="resource-exists">
+                  <!-- If ResourceType has resource.xml, merge fields. -->
+                  <map:when test="module://{content:type:{2}}/resource.xml">
+                     <map:aggregate element="merge">
+                        <map:part src="module://{content:type:{2}}/resource.xml"/>
+                       <map:part src="content:/{2}_{3}!{4}"/>
+                     </map:aggregate>
+                     <map:transform src="module:///merge.xsl">
+                        <map:parameter name="extra" value="keep"/>
+                     </map:transform>
+                  </map:when>
+                  <map:otherwise>
+                     <map:generate src="content:/{2}_{3}!{4}"/>
+                  </map:otherwise>
+               </map:select>
+               <map:transform src="module:///doc2form.xsl">
+                  <map:parameter name="publication" value="{publication:publication}"/>
+                  <map:parameter name="publicationname" value="{publication:name}"/>
+                  <map:parameter name="module" value="{module:module}"/>
+                  <map:parameter name="unid" value="{2}"/>
+                  <map:parameter name="lang" value="{3}"/>
+               </map:transform>
+               <map:serialize type="html"/>
+            </map:match>
 <!-- Save new revision -->
-         <map:match pattern="{module:module}/saverevision/*">
-            <map:call function="create">
-             <map:parameter name="module" value="{module:module}"/>
-             <map:parameter name="unid" value="{1}"/>
-           </map:call>
-         </map:match>
+            <map:match pattern="*/saverevision/*">
+               <map:call function="create">
+                <map:parameter name="module" value="{module:module}"/>
+                <map:parameter name="unid" value="{2}"/>
+              </map:call>
+            </map:match>
 <!-- Data for Save new revision -->
-         <map:match pattern="{module:module}/saverevisiondata/**">
-            <map:generate src="cocoon:/formdata"/>
-            <map:transform src="module:///form2xhtml.xsl">
-               <map:parameter name="unid" value="{1}"/>
-            </map:transform>
-            <map:serialize type="xml"/>
-         </map:match>
+            <map:match pattern="*/saverevisiondata/**">
+               <map:generate src="cocoon:/formdata"/>
+               <map:transform src="module:///form2xhtml.xsl">
+                  <map:parameter name="unid" value="{2}"/>
+               </map:transform>
+               <map:serialize type="xml"/>
+            </map:match>
       </map:pipeline>
    </map:pipelines>
 </map:sitemap>



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