WebDav Save Document
June 05 2007
- 9 replies.
- This question is not yet resolved.
- This question was started by nyronian.
- Last post by Warrell.
user June 2007,
16:30 | I am evaluating Xopus and I am having a problem saving to my webdav system. (The WebDav system is Alfresco)
I am running your SaveUsingWebDAV in webdav.js. When the save method it called it returns the proper URI to save the document to but the xmlDocument passed in is empty and there is no changes saved to the document in the WebDav system. I am using the following function: // This function is called when the save button is pressed. // // Keeps the lock. function saveAndKeepLock(uri, xmlDocument) { alert("url="+uri); alert("xmldoc="+xmlDocument); var lockObj = WebDAVTools.putXML(uri, xmlDocument, "UTF-8", true); if (lockObj.locked == false) alert(lockObj.message); } Again, the uri is correct. The xmlDocument is empty and no changes are saved to the document. Please advise. NOTE: I sent the issue to support so it is a duplicate. I appoligize for the duplicate but wanted this on the forum as well. |
user June 2007,
00:15 | I have looked into this further and found that it IS sending the xmlDocument correctly but it is not saving to my WebDAV system. I am looking into why.
A couple of questions: 1. I cannot find any documentation on the XMLDOMDocument object and how to use it. Where is this documentation? 2. There is no documentation onto the WebDAVTools object. Where is this and how can I debug why it is not saving into my WebDAV System (Alfresco) Thanks |
member June 2007,
10:20 | Webdav savingIt is possible that the xmldocument you are saving to is locked to a specific owner.For example if you use windows and manually copy a document and trie to edit it through your webserver it will say that you are not the owner of the document. You can solve this by giving your server write access to your project. Our webdav tools uses propfind to check the ownership and if you are able to lock the file. You can find these props by creating a small js file wich uses xmlhttp tp send the following: YourHttpReqest.open("PROPFIND", URI, false) YourHttpReqest.send("<?xml version=\"1.0\" encoding=\"utf-8\"?> <D:propfind xmlns:D=\"DAV:\"> <D:prop> <D:supportedlock/> </D:prop> </D:propfind>"); What is your message of alert(lockObj.message) ? |
Xopus Team June 2007,
10:39 | alert("xmldoc=" + xmlDocument);
Doesn't work since xmlDocument is a native XMLDocument, to view the XML, use: alert("xmldoc=" + xmlDocument.xml); For Internet Explorer, you can find more documentation here: IXMLDOMDocument / DOMDocument Members We will update our documentation on WebDAVTools ASAP. |
user June 2007,
16:03 | Thank you so much for your responses :-)
Thank you for the info on the XMLDomDocument, I did not realize it was a Microsoft object. I am good to go with that. I am working on figuring out the ownership problem but you did hit the nail on the head. The message back is "You are not the owner of this document" and the success is false. I am looking into how to fix it. One Item to note though is the LockObj.locked does not work in the javascript. In the debugger is shows the locked property as lockObj.?A with a type of boolean and a value of false. I can send you a screenshot from the debugger if you let me know where. But as a result it cannot check the locked property of the LockObj. |
member June 2007,
16:13 | if you get the message that you are not the owner of the document, than it's correct that lockObj.locked == false;
The best way to debug the whole process is to install fiddler for internet explorer and follow the actions. If your server allows you to lock and unlock a document you should see something like this in your header (opaquelocktoken:xxxx) If you don't see any value after the opaquelocktoken: then it's almost 100% sure that it's a ownership problem on your webdav server. You can send the screenshot to: stephen@xopus.com |
user June 2007,
17:25 | This is my header response:
HTTP/1.1 207 Multi-Status Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=UTF-8 Date: Wed, 06 Jun 2007 14:55:31 GMT Content-Length: 491 <?xml version="1.0" encoding="UTF-8"?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>/alfresco/webdav/ <D:propstat> <D:prop> <D:supportedlock> <D:lockscope> <D:exclusive/></D:lockscope> <D:locktype> <D:write/></D:locktype> </D:supportedlock> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> I do not see an apoquelocktoken: What am I missing here? |
member June 2007,
17:39 | there should be another raw data in your proces while saving.
The 1 you sent is the propfind method of webdav. When you choose to save and keep the lock than you should see a PUT in 1 of the requests with an If header. Within the If header you see the url of the document with an opac token after it. When you choose to save and unlock, than you will see a UNLOCK request in the header, with a second header named: Lock-Token. If you don't see any value after Lock-Token, then it means that the document was locked. Token was created, but failed to store it in the cookie on your machine. |
user June 2007,
21:42 | Thank you so much for your effort on this issue but I have decided to create a post servlet and use the HTTPTools.xmlPost instead of the WebDAV tools and it works perfectly! :-)
I changed partly because I couldn't quite figure out how to get Alfresco configured properly and secondly I decided, from an architecture and usage standpoint, I like the post servlet better. Let me know if there anything else you need. I have another question but I will post it in a new thread. |
anonymous user 09 June,
11:56 | WebDavI abandoned use of the WebDavTools for the same reason. It would be nice to use this mechanism in future. More documentation would help. |
- support /
- forum /
- How To ... /
- WebDav Save Document
React
Write a comment