Author: chestnut
Date: Mon Jun 20 12:46:13 2005
New Revision: 191546
URL: http://svn.apache.org/viewcvs?rev=191546&view=rev
Log:
Added UNLOCK and fixed some problems
Added:
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/lock.xsl
Removed:
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/lock.xml
Modified:
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/sitemap.xmap
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/webdav.js
Added: lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/lock.xsl
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/lock.xsl?rev=191546&view=auto
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/lock.xsl
(added)
+++ lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/lock.xsl
Mon Jun 20 12:46:13 2005
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="userid"/>
+ <xsl:param name="docid"/>
+
+ <xsl:template match="/">
+ <D:prop xmlns:D="DAV:">
+ <D:lockdiscovery>
+ <D:activelock>
+ <D:locktype><D:write/></D:locktype>
+ <D:lockscope><D:exclusive/></D:lockscope>
+ <D:depth>Infinity</D:depth>
+ <D:owner><D:href><xsl:value-of
select="$userid"/></D:href></D:owner>
+ <D:timeout>Second-604800</D:timeout>
+ <D:locktoken>
+ <D:href>
+ <xsl:value-of select="docid"/>
+ </D:href>
+ </D:locktoken>
+ </D:activelock>
+ </D:lockdiscovery>
+ </D:prop>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
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=191546&r1=191545&r2=191546&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 20 12:46:13 2005
@@ -151,10 +151,24 @@
</map:act>
</map:match>
- <map:match pattern="PROPFIND/**_*.html">
- <map:call function="filePropfind" >
- <map:parameter name="last-modified"
value="{page-envelope:document-lastmodified}"/>
- </map:call>
+ <map:match pattern="PROPFIND/**.html">
+ <map:match pattern="PROPFIND/*_*.html">
+ <map:act type="resource-exists"
src="fallback://content/authoring/{1}/index_{2}.xml">
+ <map:call function="filePropfind" >
+ <map:parameter name="last-modified"
value="{page-envelope:document-lastmodified}"/>
+ </map:call>
+ </map:act>
+ </map:match>
+ <map:match pattern="PROPFIND/**/*_*.html">
+ <map:act type="resource-exists"
src="fallback://content/authoring/{1}/{2}/index_{3}.xml">
+ <map:call function="filePropfind" >
+ <map:parameter name="last-modified"
value="{page-envelope:document-lastmodified}"/>
+ </map:call>
+ </map:act>
+ </map:match>
+ <!-- does not exist -->
+ <map:generate src="dummy.xml"/>
+ <map:serialize status-code="404"/>
</map:match>
<map:match pattern="PROPFIND/**">
@@ -167,8 +181,26 @@
</map:call>
</map:match>
- <map:match pattern="HEAD/**_*.html">
- <map:call function="filePropfind" />
+ <map:match pattern="HEAD/**.html">
+ <map:match pattern="HEAD/*_*.html">
+ <map:act type="resource-exists"
src="fallback://content/authoring/{1}/index_{2}.xml">
+ <map:act type="set-header">
+ <map:parameter name="Last-Modified"
value="{page-envelope:document-lastmodified}" />
+ <map:call function="filePropfind" />
+ </map:act>
+ </map:act>
+ </map:match>
+ <map:match pattern="HEAD/**/*_*.html">
+ <map:act type="resource-exists"
src="fallback://content/authoring/{1}/{2}/index_{3}.xml">
+ <map:act type="set-header">
+ <map:parameter name="Last-Modified"
value="{page-envelope:document-lastmodified}" />
+ <map:call function="filePropfind" />
+ </map:act>
+ </map:act>
+ </map:match>
+ <!-- doesn't exist -->
+ <map:generate src="dummy.xml"/>
+ <map:serialize status-code="404"/>
</map:match>
<map:match pattern="HEAD/**">
@@ -182,15 +214,19 @@
<map:match pattern="checkin">
<map:act type="reserved-checkin">
<map:generate src="dummy.xml"/>
- <map:serialize type="xml"/>
+ <map:serialize type="xml" status-code="423"/>
</map:act>
<map:generate src="dummy.xml"/>
<map:serialize type="xml" status-code="201" />
</map:match>
<map:match pattern="PUT/**_*.html">
+ <!--fixme: Have to checkin or we get "can not lock error" trying to
put when file is already checked out-->
+ <map:act type="reserved-checkin">
<map:call function="put" />
- </map:match>
+ </map:act>
+ <map:call function="put" />
+ </map:match>
<map:match pattern="DELETE/**">
<map:call function="remove" />
@@ -201,8 +237,21 @@
<map:generate src="dummy.xml"/>
<map:serialize type="xml" status-code="423"/>
</map:act>
- <map:generate src="lock.xml"/>
- <map:serialize type="xml"/>
+ <map:generate src="dummy.xml"/>
+ <map:transform type="xslt"
src="fallback://lenya/usecases/webdav/lock.xsl">
+ <map:parameter name="userid" value="{access-control:user-id}"/>
+ <map:parameter name="docid" value="{page-envelope:document-id}"/>
+ </map:transform>
+ <map:serialize type="xml" status-code="200" />
+ </map:match>
+
+ <map:match pattern="UNLOCK/**">
+ <map:act type="reserved-checkin">
+ <map:generate src="dummy.xml"/>
+ <map:serialize type="xml" status-code="424"/>
+ </map:act>
+ <map:generate src="dummy.xml"/>
+ <map:serialize type="xml" status-code="204" />
</map:match>
</map:pipeline>
Modified:
lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/webdav.js
URL:
http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/webdav.js?rev=191546&r1=191545&r2=191546&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/webdav.js
(original)
+++ lenya/trunk/src/webapp/lenya/pubs/default/lenya/usecases/webdav/webdav.js
Mon Jun 20 12:46:13 2005
@@ -58,7 +58,7 @@
if(status)
cocoon.sendPage("checkin",{});
else {
- sendStatus(500);
+ sendStatus(415);
}
}
|