[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: creating new categories w/ AtomPub
On Thu, Dec 11, 2008 at 4:24 PM, Peter Keane wrote:
> On Thu, Dec 11, 2008 at 2:10 PM, Thomas Broyer wrote:
>>
>> Use a Category Document and POST/PUT/PATCH an atomcat+xml entity there
>> (imo, POSTing would append and/or update the label="", PUTting would
>> replace the whole list –eventually responding with a 409 status in
>> case a category used in an entry would no longer be in the list, or
>> updating such entries to remove the category–, PATCHing would/should
>> require a "delta" format)
>
> Seems like we ought to include an atom:link@rel=edit in the app
> categories document in that case (i.e., here's where to "PUT" a new
> version of this), or do we assume that the url we used to GET it is
> the same we use to PUT and ammended version?
Why would it be a problem? (on the contrary, it's "just HTTP")
atom:link[@rel="edit"] is needed for entries because they are *listed*
in a feed, i.e. they do not have an URI by themselves (and rel="self"
might return a different "view" of the same entry, in some cases; for
example, the collection feed and rel="self" entries might be public
but rel="edit" might require an authentication --see below--).
If it is a problem, then I'd rather create a collection where each
member entry represents a category (as suggested by Erik), and include
a link[@rel="categories-collection"] in the <app:collection>.
You'd note however that an Atom Feed might be used by consumers
(syndication) *and* producers (AtomPub) at the same time, whereas a
service doc and category doc are only producer-oriented. So even if
the collection feed and rel="self" entries are public, the service doc
and category doc may require authentication.
I'd still recommend using an extension element/attribute within the
<app:collection> (or <app:categories>) to tell AtomPub clients that
the category doc is "editable".
(note that an app:collection only has an @href, there's no distinction
between "where are the entries?" and "where do I POST a new entry?")
(that's just my very own opinion)
--
Thomas Broyer