asiri (SVN) wrote:
Author: asiri
Date: 2009-01-15 11:00:35 +0100 (Thu, 15 Jan 2009)
New Revision: 15438
Added:
platform/xwiki-applications/trunk/webdav/
platform/xwiki-applications/trunk/webdav/pom.xml
platform/xwiki-applications/trunk/webdav/src/
platform/xwiki-applications/trunk/webdav/src/main/
platform/xwiki-applications/trunk/webdav/src/main/resources/
platform/xwiki-applications/trunk/webdav/src/main/resources/XWiki/
platform/xwiki-applications/trunk/webdav/src/main/resources/XWiki/WebDAV.xml
Modified:
enterprise/trunk/pom.xml
enterprise/trunk/wiki/pom.xml
platform/core/trunk/xwiki-core/src/main/resources/ApplicationResources.properties
platform/web/trunk/standard/src/main/webapp/templates/attachmentsinline.vm
platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
platform/xwiki-applications/trunk/pom.xml
Log:
XE-335: Add support for editing attachments via webdav (from xwiki UI)
Modified: platform/web/trunk/standard/src/main/webapp/templates/attachmentsinline.vm
===================================================================
--- platform/web/trunk/standard/src/main/webapp/templates/attachmentsinline.vm 2009-01-14
19:45:40 UTC (rev 15437)
+++ platform/web/trunk/standard/src/main/webapp/templates/attachmentsinline.vm 2009-01-15
10:00:35 UTC (rev 15438)
@@ -37,6 +37,17 @@
<span class="name"><a
href="$doc.getAttachmentURL("${attach.filename}",
"download")"
title="$msg.get("downloadthisattachment")">#packName($attach.filename)</a></span>
#if($hasEdit || $hasAdmin)
<span class="xwikibuttonlinks"><a
class="deletelink"
href="$doc.getAttachmentURL("${attach.filename}",
"delattachment", "xredirect=${redirect}")" onclick="return
confirm('$msg.get("confirmdelattachment")');"
title="$msg.get("deletethisattachment")">$msg.get("delete")</a></span>
+ #set($documentUrl=$doc.getExternalURL("download"))
+ #set($attachmentUrl="$documentUrl/$attach.filename")
+ #set($attachmentSignature="/xwiki/bin/download/")
+ #set($webdavSignature="/xwiki/webdav/spaces/")
This isn't safe. It is possible to change this completely. Better use:
#set($attachmentSignature="${request.contextPath}${request.servletPath}/download/")
#set($webdavSignature="${request.contextPath}/webdav/spaces/")
Also, this doesn't work with the new "virtualwiki-as-path" URLs.
+
#set($fragments=$attachmentUrl.split($attachmentSignature))
+ #if($listtool.size($fragments) == 2)
+ #set($prefix=$listtool.get($fragments, 0))
+ #set($suffix=$listtool.get($fragments, 1))
+ #set($davUrl="$prefix$webdavSignature$suffix")
+ <span class="xwikibuttonlinks"><a
class="deletelink"
href="javascript:davEdit('$davUrl')">$msg.get("webdaveditattachment")</a></span>
You should escape $davUrl, because if it contains ' or " it will break.
+ #end
#end
<span class="version"><a
href="$doc.getAttachmentURL("${attach.filename}",
"viewattachrev")"
title="$msg.get("viewattachmenthistory")">$attach.version</a></span>
<div class="meta">
Added:
platform/xwiki-applications/trunk/webdav/pom.xml
===================================================================
--- platform/xwiki-applications/trunk/webdav/pom.xml (rev 0)
+++ platform/xwiki-applications/trunk/webdav/pom.xml 2009-01-15 10:00:35 UTC (rev 15438)
@@ -0,0 +1,14 @@
Don't forget to add our License header (for all files in this app).
+ InstallTrigger.install( {"FoXWiki"
:"https://addons.mozilla.org/en-US/firefox/downloads/file/39674/foxwiki-1.0b-fx.xpi"});
Isn't there a version-independent URL, so that we don't have to release
application-webdav each time we release foxwiki?
--
Sergiu Dumitriu
http://purl.org/net/sergiu/