WebDAV Locking of BaseX Source on Tomcat
Friday, 15 February 2013 · 2 messages · last reply 17 Feb 2013
SH
Sean Healy15 Feb 2013 01:47 #
BaseX 7.6
Tomcat 7
Oxygen Editor 14
Ubuntu 12.10
We would like writers to edit BaseX source via WebDAV and require level 2 WebDAV conformance (locking). We have uncommented:
...
<servlet>
<servlet-name>WebDAV</servlet-name>
<servlet-class>org.basex.http.webdav.WebDAVServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>WebDAV</servlet-name>
<url-pattern>/webdav/*</url-pattern>
</servlet-mapping>
…within .../tomcat7/webapps/bxApp/WEB-INF/web.xml. The class org.basex.http.webdav.WebDAVServlet does not seem to implement low-level, server-side methods such as LOCK. To verify that locking is possible with our toolset, we followed this generic Tomcat/WebDAV tutorial (http://www.mulesoft.com/tomcat-webdav).
Tutorial's web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
...
<display-name>Tomcat webDAV TEST 1</display-name>
<description>webDAV HTTP Services</description>
<servlet>
<servlet-name>webdav</servlet-name>
<servlet-class>org.apache.catalina.servlets.WebdavServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>webdav</servlet-name>
<url-pattern>/webdav/*</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>myApp</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>PROPFIND</http-method>
<http-method>PROPPATCH</http-method>
<http-method>COPY</http-method>
<http-method>MOVE</http-method>
<http-method>LOCK</http-method>
<http-method>UNLOCK</http-method>
</web-resource-collection>
</security-constraint>
<security-role>
<description>WebDAV User</description>
<role-name>webdav</role-name>
</security-role>
</web-app>The tutorial demonstrated for us that locking is possible.
What is the relationship/interaction between org.apache.catalina.servlets.WebdavServlet, with its full compliment of methods, and org.basex.http.webdav.WebDAVServlet? Or more to the point, how should web.xml within our BaseX servlet be configured within for webDAV on Tomcat? Does org.basex.http.webdav.WebDAVServlet even enter into the equation for our use (e.g., locking). An example web.xml would be much appreciated.
Also, is authentication for WebDAV using credentials from .../tomcat/config/tomcat-users.xml (as in the tutorial), from .basexperm, or from some other source?
Thank you in advance for your help.
Sean
CG
Christian Grün17 Feb 2013 18:17 #
Dear Sean,
just some quick reply:
Quoted text · Sean Healy · 3 lines
> What is the relationship/interaction between > org.apache.catalina.servlets.WebdavServlet, with its full compliment of > methods, and org.basex.http.webdav.WebDAVServlet?
I don’t know if you have done so already, but it may be worth to directly jump into the sources of our WebDAV implementation [1].
Quoted text · Sean Healy · 3 lines
> Also, is authentication for WebDAV using credentials from > .../tomcat/config/tomcat-users.xml (as in the tutorial), from .basexperm, or > from some other source?
The .basexperm file is used used for authentication [2], as WebDAV and all other HTTP services have been built to work with any web server supporting Java servlets.
Hope this helps,
Christian
[1] https://github.com/BaseXdb/basex-api/tree/master/src/main/java/org/basex/http/webdav [2] http://docs.basex.org/wiki/Web_Application#User_Management
Written for BaseX 7.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery