I recently developed a simple Webdav server using Apache Tomcat WebdavServlet as a base. I just got the source from SVN (see below) and modified it to meet my needs. You can add code to various methods:
doGet doLock doPut doUnlock etc...
I use it as bad mans webdav before corporate CMS, so in each method I added API calls to retrieve the document, lock it, its version or something else. Basically, they did not want to buy the webdav product from the supplier, and Tomcat - for free.
As for opening Office files on the client, you may need to use the library that comes with Office installations (at least with Office XP). Note that the component is called SharePoint blah blah, but it does not require the installation of SharePoint anywhere. I have a js fragment here that uses the library as an example, it is obvious that you will modify according to your needs. I understand that you said no ActiveX, but without it I’m not 100% sure how you will open links. You can try other ways.
function webedit(id) { if (window.ActiveXObject) { var ed; try { //Office 2003 ed = new ActiveXObject('SharePoint.OpenDocuments.2'); } catch (err1) { try { //Office 2000/XP ed = new ActiveXObject('SharePoint.OpenDocuments.1'); } catch (err2) { try { //Office 2007 ed = new ActiveXObject('SharePoint.OpenDocuments.3'); } catch (err3) { window.alert('Unable to create an ActiveX object to open the document. This is most likely because of the security settings for your browser.'); return false; } } } if (ed) { ed.EditDocument('<%=webdavPath%>/webdav/'+id); return false; } else { window.alert('Cannot instantiate the required ActiveX control to open the document. This is most likely because you do not have Office installed or you have an older version of Office.'); return false; } } else { window.alert('Internet Explorer is required to use this feature.'); } return false; }
I also understand that your server is IIS, not Apache, but you can always install Tomcat using IIS (this is what we are doing) and use the JK ISAPI filter over AJP. In any case, this is one way to do something and does not require you to buy something.
SVN source: http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
Brendan hannemann
source share