Tags: #webdav #tomcat #integration
Since Magnolia CMS 5.7, magnolia-webdav-module were deprecated where customers still using and wishing to have this feature.
This guideline helps you to use an existing supported Tomcat Webdav (link here) to partially serve this need.
This would be extremely useful when using with Magnolia Light-development function where you can directly interact with Modules file system.
Usage warning: Some Webdav implementations will copy original file when you start editing, and once you save, they delete original and rename edited copy to match the name of original... from magnolia point of view, they're different UUIDs and if you had UUID links to the resources, they are going to be broken. Also various temp files will be created for mapping Webdav folders.
Limitation: This integration does NOT support JCR webdav, which means end user cannot manage JCR nodes and workspaces using webdav integration. However users till able to manipulate files within your webapp. Also end users still able to manage Jackrabbit content using our provided out of the box JCR browser app.
This guideline will focus on using org.apache.catalina.servlets.WebdavServlet which is a built-in function of Apache Tomcat releases. Steps we will follow:
Setup webdav custom servlet
Security configuration
Since Magnolia CMS is protecting you with lots of security filters, so depend on your specific needs, please configure them accordingly. Since Webdav protocol need HTTP OPTIONS method supported, you might interested in MAGNOLIA-7215 - Getting issue details... STATUS
Add below config under /server/filters/servlets/WebdavServlet with below properties
Change parameters based on your need including 'listing', 'debug' and 'readonly'
Example: config.server.filters.servlets.WebdavServlet.json
Exported config: config.server.filters.servlets.WebdavServlet.yaml
Setup Magnolia IPConfig security methods
Set this property /server/IPConfig/allow-all@methods to below value
GET,POST,PUT,DELETE,GETLIB,COPY,MOVE,PROPFIND,GET,HEAD,MKCOL,PROPPATCH,LOCK,UNLOCK,VERSION-CONTROL,CHECKIN,CHECKOUT,UNCHECKOUT,REPORT,UPDATE,CANCELUPLOAD,OPTIONS
Note that you should not allow all IPs with above methods, just provide IPs of your users are enough.
Verify your setup
Read write mode on file browser
On Mac OS X: Open Finder app > Go to server > enter your webdav link such as http://host:port/your-webapp/.webdav/
You should be able to connect to webdav server with similarly content below
Verify on the web
Connect to that address on, default Tomcat servlet should show your contents such as