Subject: WebDAV capabilities in HTML?

From: Jim Whitehead <[email-masked]>
Date: Wed, 11 Oct 2006 09:09:00 -0700

All,

I am interested in your ideas on what WebDAV capabilities inside HTML  
might look like.

A Master's student at UC Santa Cruz is starting to explore this idea.  
So far we are able to grab properties from a web resource and insert  
them into an HTML page, and there are also facilities for iterating  
over all resources in a collection while grabbing properties and  
inserting them into the HTML. At present, we have only explored read- 
only scenarios.

So, what kinds of scenarios could be supported by DAV-in-HTML, and  
what kinds of capabilities would HTML need to support to make this  
possible?

Being able to write to properties seems potentially useful, though  
it's unclear whether this is better than using native HTML forms and  
POSTing data.

- Jim

---

From: Michael Wechner <[email-masked]>
Date: Wed, 11 Oct 2006 23:06:35 +0200

> what kinds of capabilities would HTML need to support to make this  

I am not sure if I understand. Is the browser acting as a WebDAV client 
whereas the WebDAV commands are part of the HTML?

What usecases do you consider?

Cheers

Michi

-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[email-masked]                        [email-masked]
+41 44 272 91 61

---

From: Werner Donné <[email-masked]>
Date: Thu, 12 Oct 2006 09:04:15 +0200

Hi Jim,

If you combine HTML with the AJAX approach you can probably create a
full-fletched WebDAV client. With this approach you can send and
receive XML messages and JavaScript allows you to modified the
current document in the browser.

Regards,

Werner.

Jim Whitehead wrote:
> So, what kinds of scenarios could be supported by DAV-in-HTML, and  what
> kinds of capabilities would HTML need to support to make this  possible?
> 
> Being able to write to properties seems potentially useful, though  it's
> unclear whether this is better than using native HTML forms and  POSTing
> data.
> 
> - Jim
> 
> 
> 

-- 
Werner Donné  --  Re
Engelbeekstraat 8
B-3300 Tienen
tel: (+32) 486 425803	e-mail: [email-masked]

---

From: Julian Reschke <[email-masked]>
Date: Thu, 12 Oct 2006 15:52:27 +0200

Jim Whitehead schrieb:
> A Master's student at UC Santa Cruz is starting to explore this idea. So 
> far we are able to grab properties from a web resource and insert them 
> into an HTML page, and there are also facilities for iterating over all 
> resources in a collection while grabbing properties and inserting them 
> into the HTML. At present, we have only explored read-only scenarios.
> 

Jim,

from the description above it's not really clear to me what you're 
trying to achieve. So maybe the stuff below is relevant or isn't :-).

To expose property values other than by PROPFIND, several approaches 
come to mind:

- Inline in HTML - using DC-encoding (RFC2731), microformats, RDF/A 
(<http://www.w3.org/TR/xhtml-rdfa-primer/>), ...

- In separate resources: for instance, the origin server can return a 
Link response header, specifying a URL for the metadata; that has the 
benefit that the metadata has it's own URL, and standard HTTP methods 
can be applied. Of course that would leave us with the issue what format 
to use; RDF and the XML format used in RFC2518's PROPFIND responses come 
to mind...

Best regards, Julian

---

From: Jim Whitehead <[email-masked]>
Date: Thu, 12 Oct 2006 08:21:05 -0700

OK, it appears I wasn't clear enough in my original post. Let me try  
again.

I am interested in the kinds of applications that might be possible if:
a) a standard Web browser can act as a WebDAV client
b) new XHTML tags existed whose semantics mapped to one or more  
WebDAV methods

I recognize that current web browsers currently can execute WebDAV  
methods via Javascript. This requires a fair degree of  
sophistication, and raises cross-browser compatibility issues. What  
if some set of WebDAV operations were accessible via XHTML elements?  
This would permit these operations to be specified in an XHTML  
document simply, ideally with greater cross-platform compatibility.

At UC Santa Cruz we have been playing around with this capability. We  
have a Firefox implementation that traps the display of our new  
"WebDAV HTML elements", executes the appropriate WebDAV commands,  
then modifies the document's DOM model based on the results of the  
WebDAV operations.

An open question is how someone might use this capability. We're  
unclear on exactly which WebDAV functionalities to expose via HTML,  
and what scenarios these capabilities might support.

One scenario we've explored so far is Weblogs. Consider a weblog data  
model in which every message is a separate DAV resource in a per-user  
collection. If user jim has 3 messages, this might result in a  
collection:

/blogs/users/jim/

This collection contains resources:

index.html
msg1
msg2
msg3

The "msg*" resources each have the properties:

{namespace}, title
{namespace}, date
{namespace}, contents

Where the {namespace} is anything other than "DAV:" :-)

We've been exploring what WebDAV XHTML tags you would need to have in  
index.html such that a browser loading this resource would be able to  
make a nice display of the weblog for "jim".

Our index.html looks something like (inside the <body> element):

<resource-iterate ignore-self="true">
   <p><b><getprop namespace="{namespace}" name="title"/>,
   <getpropr namespace="{namespace}" name="date"/></b></p>

    <p><getprop namespace="{namespace}", name="contents"/></p>
</resource-iterate>

The semantics of getprop are to execute a PROPFIND and take the  
resulting property value XML stream (i.e., we strip the WebDAV XML  
elements in the PROPFIND response) and inject it into the DOM at the  
point of the getprop element, replacing this element.

The resource-iterate element does a "for each" over all the resources  
in a collection. By default, it is the collection containing the  
current resource. The ignore-self attribute says to ignore the  
current resource in the iteration. The XHTML sequence inside resource- 
iterate is injected (executed) once for each resource in the  
iteration set.

What I take away from this scenario:

A mapping of WebDAV capabilities to XHTML is more than just a one-to- 
one mapping of XHTML to WebDAV methods. By considering the specific  
Weblog scenario, we see the need for the resource-iterate capability.  
Hence, having a rich set of other scenarios would be useful in  
determining the requirements for DAV in XHTML.

One can view this as creating a new kind of property-driven web  
application. In this kind of web application, there is no explicit  
database (it's hidden behind the property interface), and the client  
is responsible for creating the final presentation seen by the user.  
This has the effect of pushing most of the functionality away from  
the center to the edges, that is, the clients. This may result in  
greater scalability of such web applications (the hedging is due to  
the fact that such applications may generate large numbers of  
PROPFINDs -- client side PROPFIND optimization would be important for  
good performance). However, despite being executed on the client,  
such web applications are still configuration controlled on the  
server. If a new application is desired, the provider (server  
operator) just changes the index.html contents.

Of course, an open issue is how to handle property-driven web  
applications that write content to properties, since this raises  
authentication issues. At present, WebDAV mostly relies on HTTP  
authentication for security, while a more web-application-logon-style  
might be better for users.

As well, these client-side web applications currently couldn't have  
very rich semantics, since there are no control flow elements in  
XHTML. But, perhaps Javascript could be used for this.

I'm interested in any ideas you may have on scenarios for using DAV  
in XHTML. I view implementation as being fairly straightforward --  
the difficult question here is what you might be able to do with this  
capability.

Thanks!

- Jim

---

From: Julian Reschke <[email-masked]>
Date: Thu, 12 Oct 2006 18:04:44 +0200

Jim Whitehead schrieb:
> OK, it appears I wasn't clear enough in my original post. Let me try again.
> 
> b) new XHTML tags existed whose semantics mapped to one or more WebDAV 
> methods
> 
> methods via Javascript. This requires a fair degree of sophistication, 
> and raises cross-browser compatibility issues. What if some set of 
> WebDAV operations were accessible via XHTML elements? This would permit 
> these operations to be specified in an XHTML document simply, ideally 
> with greater cross-platform compatibility.
> ...

Ah.

Well, the cross-browser issues are IMHO slowly going away, with most 
current browsers exposing the XMLHttpRequest object (see 
<http://www.w3.org/TR/XMLHttpRequest/>).

I'm not sure what the chances of getting cross-browser support for new 
XHTML elements are, considering that IE7 still doesn't support XHTML at 
all...

Best regards, Julian

---

From: "Alex Jalali" <[email-masked]>
Date: Thu, 12 Oct 2006 09:19:23 -0700

One usage could be for podcasting. the properties can map into atom or
others and the output would be an xml describing the collection and its
resources.

---

From: Mark Nottingham <[email-masked]>
Date: Thu, 12 Oct 2006 10:34:49 -0700

The biggest advantage I can see is that having PUT and DELETE  
capabilities in HTML forms would allow server-side implementations to  
be generic (e.g., Apache modules), rather than application-specific  
code. This is attractive from development resources/process and  
security perspectives.

I've been experimenting with using XMLHttpRequest to POST/PUT things  
from forms, see:
   http://www.mnot.net/javascript/json_form.js
Sorry, no docs yet. Basically, this looks for forms with a particular  
MIME type and takes over the submission process, overriding the  
content type, request body and request method.

Note that some browser vendors are wary of generating request methods  
other than POST or GET, because they're concerned about security  
implications. This is an ongoing discussion in the Web APIs WG (which  
is specific to XHR, but I imagine the same objections would have to  
be overcome for a forms language, given that it would likely be  
scriptable, eventually).
   http://www.w3.org/2006/webapi/

Cheers,

On 2006/10/11, at 9:09 AM, Jim Whitehead wrote:

>
> All,
>
> I am interested in your ideas on what WebDAV capabilities inside  
> HTML might look like.
>
> A Master's student at UC Santa Cruz is starting to explore this  
> idea. So far we are able to grab properties from a web resource and  
> insert them into an HTML page, and there are also facilities for  
> iterating over all resources in a collection while grabbing  
> properties and inserting them into the HTML. At present, we have  
> only explored read-only scenarios.
>
> it's unclear whether this is better than using native HTML forms  
> and POSTing data.
>
> - Jim
>

--
Mark Nottingham
[email-masked]