You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by M Harris <md...@yahoo.com> on 2008/05/03 01:56:36 UTC
General Question about IDs
This is not necessarily about Abdera, but about the Atom Publishing Protocol in general regarding entry Ids. I know there are some people on the mailing list who have developed their sites using Abdera and Atom. Are you storing the Entry Ids in a database or other structure? I was wondering how exactly to handle editing a resource.
I guess I am wondering how to ensure that the link during an edit of a resource is infact that Entry itself the client is trying to edit.
Taken from an article online just for reference:
PUT /blog/entries/1 HTTP/1.1
Host: example.org
Content-Type: application/atom+xml; charset=utf-8
Content-Length: nnnn
If-Match: "/blog/entries/1?1"
If-Unmodified-Since: Sat, 12 Aug 2006 13:40:03 GMT
<?xml version="1.0" ?>
<entry xmlns="http://www.w3.org/2005/Atom" >
<id>tag:example.org,2006:/blog/entries/1</id>
<title>Atom-Powered Robots Run Crazy</title>
<link href="http://example.org/2003/12/13/atom03"/>
<link rel="edit" href="http://example.org/blog/entries/1" />
<updated>2006-08-12T13:40:03Z</updated>
<author><name>John</name></author>
<summary>Some different text.</summary>
</entry>
How should it know that
/blog/entries/1
and the entry
<id>tag:example.org,2006:/blog/entries/1</id>
Mean the same? In this case the Id happens to be the URL of the entry but from what I have read the id does not have to be any part of the URL. If someone were to do a PUT to the same URL but with this ID (2007 instead of 2008)
<id>tag:example.org,2007:/blog/entries/1</id>
Does it overwrite the id?
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: General Question about IDs
Posted by James M Snell <ja...@gmail.com>.
M Harris wrote:
> I just answered my own question. The Ids can't be changed by the user (right?) and I think it would be best to do a GET first and then make sure the entry Ids match before pursuing.
>
Right.
- James
> M Harris <md...@yahoo.com> wrote: This is not necessarily about Abdera, but about the Atom Publishing Protocol in general regarding entry Ids. I know there are some people on the mailing list who have developed their sites using Abdera and Atom. Are you storing the Entry Ids in a database or other structure? I was wondering how exactly to handle editing a resource.
>
> I guess I am wondering how to ensure that the link during an edit of a resource is infact that Entry itself the client is trying to edit.
>
> Taken from an article online just for reference:
>
>
> PUT /blog/entries/1 HTTP/1.1
> Host: example.org
> Content-Type: application/atom+xml; charset=utf-8
> Content-Length: nnnn
> If-Match: "/blog/entries/1?1"
> If-Unmodified-Since: Sat, 12 Aug 2006 13:40:03 GMT
>
>
>
> tag:example.org,2006:/blog/entries/1
> Atom-Powered Robots Run Crazy
>
>
>
>
> 2006-08-12T13:40:03Z
> John
> Some different text.
>
>
>
>
> How should it know that
>
> /blog/entries/1
> and the entry
>
>
> tag:example.org,2006:/blog/entries/1
>
> Mean the same? In this case the Id happens to be the URL of the entry but from what I have read the id does not have to be any part of the URL. If someone were to do a PUT to the same URL but with this ID (2007 instead of 2008)
>
> tag:example.org,2007:/blog/entries/1
> Does it overwrite the id?
>
>
>
>
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
>
>
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: General Question about IDs
Posted by M Harris <md...@yahoo.com>.
I just answered my own question. The Ids can't be changed by the user (right?) and I think it would be best to do a GET first and then make sure the entry Ids match before pursuing.
M Harris <md...@yahoo.com> wrote: This is not necessarily about Abdera, but about the Atom Publishing Protocol in general regarding entry Ids. I know there are some people on the mailing list who have developed their sites using Abdera and Atom. Are you storing the Entry Ids in a database or other structure? I was wondering how exactly to handle editing a resource.
I guess I am wondering how to ensure that the link during an edit of a resource is infact that Entry itself the client is trying to edit.
Taken from an article online just for reference:
PUT /blog/entries/1 HTTP/1.1
Host: example.org
Content-Type: application/atom+xml; charset=utf-8
Content-Length: nnnn
If-Match: "/blog/entries/1?1"
If-Unmodified-Since: Sat, 12 Aug 2006 13:40:03 GMT
tag:example.org,2006:/blog/entries/1
Atom-Powered Robots Run Crazy
2006-08-12T13:40:03Z
John
Some different text.
How should it know that
/blog/entries/1
and the entry
tag:example.org,2006:/blog/entries/1
Mean the same? In this case the Id happens to be the URL of the entry but from what I have read the id does not have to be any part of the URL. If someone were to do a PUT to the same URL but with this ID (2007 instead of 2008)
tag:example.org,2007:/blog/entries/1
Does it overwrite the id?
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.