You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/06/13 16:07:43 UTC

svn commit: r190407 - in /lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav: init.xml init.xsl sitemap.xmap

Author: gregor
Date: Mon Jun 13 07:07:43 2005
New Revision: 190407

URL: http://svn.apache.org/viewcvs?rev=190407&view=rev
Log:
Changed WebDAV status code and made WebDAV work with publication templating. Patch by Doug Chestnut, this resolves http://issues.apache.org/bugzilla/show_bug.cgi?id=35337

Added:
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/init.xsl
Removed:
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/init.xml
Modified:
    lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap

Added: lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/init.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/init.xsl?rev=190407&view=auto
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/init.xsl (added)
+++ lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/init.xsl Mon Jun 13 07:07:43 2005
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+    <xsl:param name="pubid" />
+
+	<xsl:template match="/">
+        <D:multistatus xmlns:D="DAV:" xmlns:collection="http://apache.org/cocoon/collection/1.0">
+           <D:response>
+              <D:href>/<xsl:value-of select="$pubid" />/</D:href>
+
+              <D:propstat>
+                 <D:prop>
+                    <D:displayname><xsl:value-of select="$pubid" /></D:displayname>
+
+                    <D:getlastmodified></D:getlastmodified>
+
+                    <D:creationdate />
+
+                    <D:resourcetype>
+                       <D:collection />
+                    </D:resourcetype>
+
+                    <D:getcontenttype>httpd/unix-directory</D:getcontenttype>
+
+                    <D:contentlength>0</D:contentlength>
+                 </D:prop>
+
+                 <D:status>HTTP/1.1 200 OK</D:status>
+              </D:propstat>
+           </D:response>
+
+           <D:response>
+              <D:href>/<xsl:value-of select="$pubid" />/authoring</D:href>
+
+              <D:propstat>
+                 <D:prop>
+                    <D:displayname>authoring</D:displayname>
+
+                    <D:getlastmodified></D:getlastmodified>
+
+                    <D:creationdate />
+
+                    <D:resourcetype>
+                       <D:collection />
+                    </D:resourcetype>
+
+                    <D:getcontenttype>httpd/unix-directory</D:getcontenttype>
+
+                    <D:contentlength>0</D:contentlength>
+                 </D:prop>
+
+                 <D:status>HTTP/1.1 200 OK</D:status>
+              </D:propstat>
+           </D:response>
+
+
+        </D:multistatus>	
+	</xsl:template>
+
+</xsl:stylesheet>

Modified: lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap?rev=190407&r1=190406&r2=190407&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap (original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap Mon Jun 13 07:07:43 2005
@@ -50,12 +50,6 @@
 
   <map:pipelines>
     
-    <map:component-configurations>
-      <global-variables>
-        <staging>../../../content/authoring/</staging>
-      </global-variables>
-    </map:component-configurations>
-    
     <map:pipeline type="noncaching">
       
       <!-- 
@@ -71,10 +65,14 @@
           <map:parameter name="locale" value="{request:locale}"/>
         </map:transform>
         <map:transform type="xslt" src="NSclean.xsl"/>
-        <map:match pattern="*opfind">
-          <map:serialize type="xml" status-code="207"/>
-        </map:match>
-        <map:serialize type="xml" status-code="207"/>
+        <map:select type="request-method">
+          <map:when test="PROPFIND">
+            <map:serialize type="xml" status-code="207"/>
+          </map:when>
+          <map:otherwise>
+            <map:serialize type="xml" status-code="200"/>
+          </map:otherwise>
+        </map:select>
       </map:match>
       
     </map:pipeline>
@@ -112,40 +110,42 @@
 <!-- ========================= Public Resources =========================== -->
     
     <map:pipeline type="caching">
-      <map:match pattern="default">
+ 
+      <map:match pattern="authoring">
         <map:call function="selectMethod">
           <map:parameter name="page" value=""/>
           <map:parameter name="requestURI" value="{request:requestURI}" />
         </map:call>
-      </map:match> 
-      <map:match pattern="default/">
+      </map:match>
+      <map:match pattern="authoring/**">
         <map:call function="selectMethod">
-          <map:parameter name="page" value=""/>
+          <map:parameter name="page" value="{1}"/>
           <map:parameter name="requestURI" value="{request:requestURI}" />
         </map:call>
-      </map:match>        
-      <map:match pattern="authoring">
+      </map:match>
+
+      <map:match pattern="{page-envelope:publication-id}">
         <map:call function="selectMethod">
           <map:parameter name="page" value=""/>
           <map:parameter name="requestURI" value="{request:requestURI}" />
         </map:call>
-      </map:match>
-      <map:match pattern="authoring/**">
+      </map:match> 
+      <map:match pattern="{page-envelope:publication-id}/">
         <map:call function="selectMethod">
-          <map:parameter name="page" value="{1}"/>
+          <map:parameter name="page" value=""/>
           <map:parameter name="requestURI" value="{request:requestURI}" />
         </map:call>
-      </map:match>
+      </map:match>        
       
       <map:match pattern="GET/**">
         <map:act type="set-header">
           <map:parameter name="Last-Modified" value="{page-envelope:document-lastmodified}" />
           <map:match pattern="GET/*_*.html">
-            <map:generate src="{global:staging}{1}/index_{2}.xml"/>
+            <map:generate src="fallback://content/authoring/{1}/index_{2}.xml"/>
             <map:serialize type="xml-get"/>
           </map:match>
           <map:match pattern="GET/**/*_*.html">
-            <map:generate src="{global:staging}{1}/{2}/index_{3}.xml"/>
+            <map:generate src="fallback://content/authoring/{1}/{2}/index_{3}.xml"/>
             <map:serialize type="xml-get"/>
           </map:match>
         </map:act>
@@ -175,15 +175,6 @@
         <map:call function="propfind" />
       </map:match>
       
-<!--      <map:match pattern="TRACE/**">
-        <map:generate src="dummy.xml"/>
-        <map:serialize type="xml"/>
-      </map:match>
-      <map:match pattern="POST/**">
-        <map:generate src="dummy.xml"/>
-        <map:serialize type="xml"/>
-      </map:match>  -->
-      
     </map:pipeline>
     
     <map:pipeline type="noncaching">
@@ -200,64 +191,11 @@
       <map:match pattern="PUT/**_*.html">
           <map:call function="put" />
       </map:match>
-      
-<!--      <map:match pattern="MKCOL/**">
-        <map:match pattern="MKCOL/**.*">
-          <map:call function="sendStatus">
-            <map:parameter name="status" value="405" />
-          </map:call>
-        </map:match>
-        <map:call function="mkcol">
-          <map:parameter name="location" value="{global:staging}{1}" />
-        </map:call>
-      </map:match>-->
-      
+            
       <map:match pattern="DELETE/**">
         <map:call function="remove" />
       </map:match> 
-      
-<!--      <map:match pattern="COPY/**">
-        <map:match pattern="http://**/repo/**" type="destination">
-          <map:call function="copy">
-            <map:parameter name="from" value="{global:staging}{../1}" />
-            <map:parameter name="to" value="{global:staging}/{2}" />
-            <map:parameter name="depth" value="{request-header:Depth}" />
-            <map:parameter name="overwrite" value="{request-header:Overwrite}" />
-          </map:call>
-        </map:match>
-        <map:call function="sendStatus">
-          <map:parameter name="status" value="405" />
-        </map:call>
-      </map:match>  -->
-      
-<!--      <map:match pattern="MOVE/**">
-        <map:match pattern="http://**/repo/**" type="destination">
-          <map:call function="move">
-            <map:parameter name="from" value="{global:staging}{../1}" />
-            <map:parameter name="to"   value="{global:staging}/{2}" />
-            <map:parameter name="depth" value="{request-header:Depth}" />
-            <map:parameter name="overwrite" value="{request-header:Overwrite}" />
-          </map:call>
-        </map:match>
-        <map:call function="sendStatus">
-          <map:parameter name="status" value="405" />
-        </map:call>
-      </map:match>  -->
-      
-      <!--+
-          | In order for proppatch to work you need to uncomment
-          | the simple jdbc source descriptor in cocoon.xconf
-          | and then define which properties you want to proppatch.
-          + -->
-<!--      <map:match pattern="PROPPATCH/**">
-        <map:generate type="stream" />
-        <map:transform src="proppatch2propwrite.xsl">
-          <map:parameter name="location" value="{global:staging}{1}" />
-        </map:transform>
-        <map:transform type="spw" />
-        <map:serialize type="xml" />
-      </map:match>  -->
-      
+                        
       <map:match pattern="LOCK/**">
         <map:act type="reserved-checkout">
           <map:generate src="dummy.xml"/>



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