[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PaceCategorize
Joe Gregorio wrote:
On 6/26/05, James M Snell <jasnell@xxxxxxxxx> wrote:
I'll maintain, however, that some form of mechanism for posting diff's
to an entry (as opposed to updating the entire entry every time) would
be very valuable. (e.g. rather that PUT'ing a new entry, POST a diff
against the existing entry where the diff contains only the metadata
modifications)
I like this train of thought, even allowing PUT and declaring that any
missing elements means don't bother updating that element.
Yes, However, that way, you can't remove elements...
One way to remove elements would be to PUT them as though you were
updated them but you'd add an app:remove="true" attribute:
<atom:category label="My Category" app:remove="true" />
One way to have "diff" format could be the following.
Well, the Atom Syndication Format clearly defines what are "extension
metadata elements", we could add to the "metadata elements" definition
the atom:link, atom:category, atom:author, atom:contributor, etc. (but
IMO not atom:summary of atom:content, which represent "the entry" rather
than "metadata about the entry").
We could then have Create/Delete (not the whole four CRUD operations) on
these "entry metadata elements":
<atom-diff:diff xmlns:atom-diff="..." xmlns:atom="...">
<atom-diff:add>
<atom:category term="a-term" label="Old Label"
atom-diff:fail-if-existing="true" />
<atom:category label="Added" atom-diff:fail-if-existing="false" />
</atom-diff:add>
<atom-diff:remove>
<atom:category term="a-term" label="New Label"
atom-diff:fail-if-missing="true" />
<atom:category label="Removed" atom-diff:fail-if-missing="false" />
</atom-diff:remove>
</atom-diff:diff>
The above document updates the label of the "a-term" category, adds a
category labeled as "Added" and removes the category labeled as "Removed".
It also tells the server how to deal with "to be removed" metadata
missing from the current entry and "to be added" metadata already
present into the current entry: fail (400 Bad Request or 409 Conflict)
or silently ignore.
If you PUT an entry to an entry URI, new metadata replaces the old one,
as of protocol-04, without the "missing means don't bother updating" trick.
And if you think PUTting a diff on the entry URI violates the first
SHOULD in HTTP PUT [1], then just POST the diff (instead of PUT) on the
member URI.
- POST to collection: create a member
- GET to member: get member
- PUT to member: update member
- DELETE to member: remove member
- POST to member: update member using a diff (e.g. create/delete entry
metadata)
[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
--
Thomas Broyer