On 7 Jul 2006, at 16:58, Alex Milowski wrote:
Henry Story wrote:
It seems to me it should be quite easy to be able to edit and
create feeds.
1. Edit feed metadata:
Send a PUT to a Container URL with a <feed>...</feed> body.
There should be no entries in that body (or they will be ignored)
I did this in my Atom implementation in eXist. I can't say I'm 100%
happy with this because the PUT's body has to be merged with the
existing feed document. That seems a stretch for PUT.
That is why I think one would have to strip all <entry> elements in a
feed.
Then there should be no trouble. It should be just the same as PUTing
to an entry URL, to edit the
entry.
In the case of entries, the client semantic is quite easy to explain
in that you just take the entry element, tweak it, and send it back.
In the case of a feed, you have to explain how you remove all
the entries. That is somewhat strange.
<rant>
It is a pitty that there was not a little more to and fro between
the atom syntax and the protocol earlier on, because one could have
easily solved these issues quite nicely.
For a long time the feed metadata was going to be written like this
<feed>
<head>
<title>My first feed</title>
<id>tag:eg.com,2005/feed1</id>
...
</head>
...
</feed>
This would have made it very easy to add a src attribute on the head
element pointing to an entry document that could have been edited
just like any other entry (assuming we had just made the elements on
a head the same as those of an entry). But conceptual simplicity was
not a value that had much resonance at the time.
</rant>
But I don't think the problem is so very big anyway. One should think
of entries and feeds as being very similar. A feed is nearly like an
entry. The biggest difference is that it can contain entries.
A Container resource has a feed representation. We can add new
entries by POSTing entries to the container resource. We can delete
and edit these entries by DELETEing and PUTing entries to the
entries resource directly. So we can manipulate entries that appear
in a feed already.
The way to think about it then is to say that entries are contained
in a container. What remains is the feed metadata, which we should be
able to edit by PUTing it to the feed.
Interestingly should DELETEing a container DELETE all its contained
entries?
Is this really such a semantic problem?
I really think this is a huge hole in the spec in that you can
fully edit entries but not feed metadata. For example, what if I
want to change the title or subtitle of the feed? Or add a category
element? Right now, there is no standard way to do it.
I agree. It seems a pitty not to be able to edit a feeds metadata.
Especially as a way to do it is just within easy reach.
2. Create a feed
Sent a POST to a Container URL with a <feed>...</feed> body. I
suppose there could be entries in the feed in this case. This will
create a new container object.
What I do for eXist, which can dynamically create collections, is
allow
a POST to any collection path. If there is no feed there, it creates
the collection and the feed for that collection.
a POST of a feed metadata right?
While that works for me, it may not for others. I think collection
creation is somewhat out of scope for this version--at least that is
what I understand from past discussions.
It's good to know there is some real experimenting on this topic
going on.
I wonder what cool things one could do with collection creation...
--Alex Milowski