[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Option #6: Using POST for uploading associated resources
Here's the basic use case I've been keeping in mind when evaluating
these options. I'd love to see other use cases worked out in detail as
well so that we could see how solutions meet or don't meet their needs.
Use Case: Posting a Cat Picture
A user is watching their cat and, taken by the epistolary impulse,
decides to write a poem about their feline companion. They fire up
their Atom enabled client and whip out a cat haiku[1]. Then they drag
and drop a convenient picture of their cat into their editor, which
automatically flows the text around it. Internally, hidden from the
user, this is represented as XHTML or at least a DOM that looks like this:
About my cat...<br/>
<img src="file:photo0006.jpg" align="right"/>
You never feed me.<br/>
Perhaps I'll sleep on your face.<br/>
That will show you.<br/>
The user impetuously hits the Publish button on their Atom enabled
client. At the end of the publishing process, however it's done, there
must be an Atom entry that, when viewed, contains the above haiku,
displayed next to the cat picture, which is aligned right[2] of the
text, which flows around it. The atom:entry source for this could look
something like this:
<entry>
<title>My Cat</title>
<id>http://www.example.com/catblog/entries/001</id>
<issued>2003-12-15T14:43:07Z</issued>
<content type="application/xml+xhtml">
About my cat...<br/>
<img src="http://www.example.com/catblog/resources/img3832162.jpg"
align="right"/>
You never feed me.<br/>
Perhaps I'll sleep on your face.<br/>
That will show you.<br/>
</content>
</entry>
Where of course http://www.example.com/catblog/resources/img3832162.jpg
contains the same bits that the local photo0006.jpg file contained
originally.
I'll grant that this is a simple, perhaps simplistic use case, but I'll
also argue that it will be a very common one. Note that for this use
case, nobody really wants there to be Atom metadata associated with the
image itself; the image is conceptually just part of the Atom entry,
part of a compound document. The fact that it's actually stored
separately, could be downloaded lazily, etc. is of interest to
technologists but not to users who just want to see their cat pictures.
Note also that you _do_ need an <img src> tag embedded in the text for
this use case, and it needs to refer somehow to the picture content, if
Atom is to support (X)HTML.
-John
[1] Hit Google for "cat haiku". It's frightening.
[2] Yes, I fully admit this should be styled with CSS.