Editing MS Office documents from a web application: custom implementation of WebDaV or ...?

Below are our settings and requirements:

  • There is a publicly accessible web application available through SSL + Basic Authentication. Most of these applications are in ASP.Net; a pair of obsolete in classic ASP. Win 2003 / IIS 6.0 Server
  • This application should support online editing of (mostly) MS Office documents (2007 and 2010). The documents themselves are stored in the database along with the contents of the application.
  • Users should be able to open the document through HTML links; the corresponding external Office application (say, MS Word) should open the document in edit mode (with exclusive locking), and when the user clicks the "Save" button, the document should be sent back to the application.
  • On the client side, you do not need to deploy external ActiveX plugins / controls.

Is a regular WebDAV implementation the best approach? Please note that we may not need all the features of WebDAV to support the above requirements. Do you know about alternatives?

If a custom implementation of WebDAV is a way, can you recommend some good resources (IIS plugins for commercial / open sources, samples in .Net, docs, etc.) other than http://www.webdav.org/ ? By the way, I don’t want to install a bulky CMS such as Sharepoint to support such a small requirement!

I found a stream on SO about a custom implementation of WebDav: What are your impressions of implementing / using WebDAV? It sounds so discouraging :( (can only be used for IIS root, requires Windows authentication, etc.)

Thanks in advance!

+8
ms-office sharepoint webdav
source share
3 answers

What is wrong with WebDAV? There are a couple of third-party WebDAV server components that you can connect to the server application ( www.webdavsystem.com , our WebDAVBlackbox ).

Alternatively, you can create a virtual file system on the client that will interact with the server using some other protocol (simple HTTP, if it is easier for you to implement this procedure or FTP or SFTP).

+1
source share

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

+5
source share

When Office opens a file from a URL, it checks to see if WebDav is supported at that URL. If so, and WebDav allows writing to this URL, then Office will allow the user to edit the file.

Getting Office to open the file when the user clicks the link in the browser seems to work best with a URL like:

 ms-word:ofe|u|https://someOfficeFile.docx 

A URL in this style does not work when Office is not present on the user machine.

Integration with software installed on the user's hardware is, of course, difficult, since the developer has no control over the user equipment.

It would be better if editing Office documents could be fully done in the browser. Office365 does it. The Line-Of-Business application is integrated with Office365 via the WOPI protocol.

Office integrates with DropBox and similar using this protocol. However, it seems that Microsoft is not yet ready to allow a large number of LOB applications to integrate with Office365.

Perhaps Microsoft will someday publish an SDK for this integration without writing a WOPI from scratch.

+2
source share

All Articles