The Artima Developer Community
Sponsored Link

Agile Buzz Forum
WebDAV support in VW using NetResources

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
WebDAV support in VW using NetResources Posted: Aug 14, 2005 9:59 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: WebDAV support in VW using NetResources
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

At Software WithStyle, with our beta release of XML WithStyle, we've already begun on the next set of jobs to get it to a 1.0 production release.

One of the jobs on my todo list is to add WebDAV support to it. To do that, I needed our code base to be able to support the core WebDAV API.

WebDAV is what lets users around the world add a 'Web Folder' in Windows Explorer and Microsoft Word and many other products. WebDAV is without a doubt a huge success. It works well and provides everything you need in a basic read-write web protocol.

It turns out that the designers of WebDAV did the right thing - they didn't use copious web services. Instead, they added a few more commands to HTTP.

Commands that come with HTTP/1.1: GET, PUT, DELETE

Commands added with WebDAV: PROPFIND, PROPPATCH, LOCK, UNLOCK, MKCOL

To Get/Put things in to a WebDAV directory is easy - you can do that without even knowing WebDAV, just HTTP/1.1. You simply use GET and PUT. Where the interesting stuff happens is with WebDAV directories (or 'Collections' as they are called).

You can make a collection using MKCOL. Then you can use PROPFIND to see what's inside a collection. Thus, you can now navigate a remote repository, adding and removing things at will.

I've added a new package to Public Store which is a companion to NetResources and NetResourcesHTTP called NetResourcesWebDAV. With it comes a new set of API's that will work on HTTP or FILE URL's.

'http://myserver/webdav/' asURI propFind

'http://myserver/webdav/' asURI makeResourceCollection

'http://myserver/webdav/mydocument.txt' asURI resourceLockExclusive

'http://myserver/webdav/mydocument.txt' asURI resourceLockShared

'http://myserver/webdav/mydocument.txt' asURI resourceUnlock

'http://myserver/webdav/' asURI propPatch: someWebDavCommands

'http://myserver/webdav/a.txt' asURI resourceCopyTo: 'http://myserver/webdav/b.txt' asURI

'http://myserver/webdav/a.txt' asURI resourceMoveTo: 'http://myserver/webdav/b.txt' asURI

'http://myserver/webdav/' asURI isResourceCollection

From there you can do whatever you want. The lock/unlock commands are completely automatic. You lock a resource and it remembers the lock token for you, then when you unlock (or try to lock again) it'll unlock using the same token.

You're on your own if you want to interpret the results of a propFind or propFind:

Enjoy

Read: WebDAV support in VW using NetResources

Topic: With that, I'm off Previous Topic   Next Topic Topic: Weblog API suckage

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use