we are using an "IT Hit WebDAV AJAX Library Redistribution Licence" library.
We have been using successfuly this library for this workflow: 1) the client clicks on a button en the webpage 2) the webpage finds a document on a webdav server 3) the plugin connects the webdav document with Ms Office Word of the client. 4) the client updates the content of the document 5) the client saves his changes. This changes are reflected and stored in the webdav storage.
Our problem is: We need to add these following tasks in this workflow:
6) the client closes the Ms Office Word application 7) the wepage is notified that the client has closed the webdav document 8) the webpage do something with that information ....
We don't know how to get a callback from your library, in order to trigger many tasks that are necessary for our logic.
We are using this code for open the document:
function editWordVersion(document_url){
oNs= ITHit.WebDAV.Client.DocManager;
oNs.EditDocument(document_url);
}
We Appreciate any way or alternative for doing this with your library.
There is no way to get the information about the document being closed directly from the MS Office application to IT Hit WebDAV Ajax library. After the document is opened, the WebDAV Ajax Library does not have any control over the document, it just initiates the process of opening the document.
To get the notification about about the document being closed you need to use the websockets and to send a notification to a webpages from your ILock.Unlock method implementation. Here is how to add SigmalR to a MVC 5 project with a WebDAV, send and consume the notification:
Create MVC 5 ASP.NET Web Application in VS 2013.
Add WebDAV to your project using 'Add WebDAV Server Implementation' wizard.
Add web sockets to your project on a server site:
Add reference to Microsoft.AspNet.SignalR.Core and Microsoft.AspNet.SignalR.SystemWeb in your project.
Call app.MapSignalR() in Startup.cs:
Create a class derived from Hub. You can leave it empty:
In ILock.Unlock method implementation send a notification to a webpage. By default Add WebDAV Server Implementation wizard adds Unlock method to DavHierarchyItem class, which implements ILock, extend this method with the following code:
Consume the event on the client side. Add the following JavaScript to your web page, for example to MyCustomHandlerPage.aspx page generated by the WebDAV wizard: