A while ago a user on the Hippo CMS 7 forum donated a patch, which provided a servlet for simple WebDAV support. He donated his code as a proof of concept and hoped that somebody with some deeper knowledge of Hippo and it’s nodetypes could pick this up and continue to work on it. Since the patch was left alone for quite some time I picked it up and turned it into a Hippo Forge project and called it: ‘Hippo CMS 7 WebDAV Support’.
Now and then I find some time to work on this project and the current status now is that I have a working quickstart, which you can check out. I personally think it’s far from finished, because there is still a lot of work remaining, but it is already usable. In this post I will explain how the WebDAV plugin works, the current status of the project and some future plans. Let’s start with some of the basics.
What is WebDAV?
WebDAV is short for Web-based Distributed Authoring and Versioning. In short WebDAV is an extension on top of the default HTTP protocol and it allows computer users to edit and store files on a remote server. All the major operating systems provide support for WebDAV and will allow you to easily store and edit files on a remote server as if they were on your own computer.
Enable WebDAV support for your Hippo CMS 7 project
Using WebDAV in combination with Hippo CMS 7 is quite easy actually. All you need to do for now is do four things to enable the WebDAV support for your project.
First add the WebDAV support maven dependency to your project
<dependency>
<groupId>org.onehippo.forge.addon.webdav</groupId>
<artifactId>webdav-addon</artifactId>
<version>${webdav.addon.version}</version>
</dependency>
Second add the WebDAV support servlet definition to your web.xml
<servlet>
<servlet-name>WebDAVServlet</servlet-name>
<servlet-class>org.onehippo.forge.addon.webdav.HippoWebdavServlet</servlet-class>
<init-param>
<param-name>repository-address</param-name>
<param-value>vm://</param-value>
</init-param>
<init-param>
<param-name>resource-path-prefix</param-name>
<param-value>/webdav</param-value>
<description>defines the prefix for spooling resources out of the repository.</description>
</init-param>
<init-param>
<param-name>resource-config</param-name>
<param-value>/WEB-INF/config.xml</param-value>
<description>
Defines various dav-resource configuration parameters.
</description>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
Now add the WebDAV servlet mapping to your web.xml
<servlet-mapping>
<servlet-name>WebDAVServlet</servlet-name>
<url-pattern>/webdav/*</url-pattern>
</servlet-mapping>
And finally add the WebDAV support configuration file to your projects WEB-INF directory.
This configuration file can be found on the WebDAV support documentation site. It’s quite easy to read and you should put it into your /webapp/WEB-INF/ folder if possible.
In action
The following video will show you how easy it is to upload multiple files into the CMS.
Hippo CMS 7 WebDAV support from Jeroen Reijn on Vimeo.
This video is also available on YouTube.
Current status
The current status is that the WebDAV addon has default support for the Hippo assets folder. This was actually quite easy to develop. This can also be used to copy all assets from a CMS 6 instance directly into a running CMS 7 instance. All other folders are not WebDAV enabled yet, but I have some plans for the other folders in the future.
For the short-term roadmap: ‘pretty url support’ is the first thing I want to work on. I could have put it in hardcoded, but since I want to make it configurable like in the CMS this will my main focus for the next two weeks. If you have ideas or want to help out, please let me know!