Discussion:
Multiple links (for a collection) on a atom entry
Julio Lima
2010-02-02 10:33:46 UTC
Permalink
Hi,

I'm working on a atom-entry spec for a "destination" feed. This
destination has relation with "credit-card" (all credit cards usually
accepted on that destination). Of course, one destination may have
more than one credit card associated.
So I thought on two different approaches :

First one, listing all links direct on entry (destination.xml) and
another way is to link to a entry point that list all credit cards
accepted by a destination (destination2.xml) :

https://gist.github.com/5a38922984fd94398012<http://www.google.com/url?sa=D&q=https://gist.github.com/5a38922984fd94398012&usg=AFQjCNEZix4Fyo6d0semmVzDUV0OKaHtsg>


Which one would you use? Any pros & cons ?

Thanks a lot!
Julio
Jan Algermissen
2010-02-02 12:33:16 UTC
Permalink
Julio,

I am afraid you need to provide more context....I don't get what you want to do.

Jan
Post by Julio Lima
Hi,
I'm working on a atom-entry spec for a "destination" feed. This
destination has relation with "credit-card" (all credit cards usually
accepted on that destination). Of course, one destination may have
more than one credit card associated.
First one, listing all links direct on entry (destination.xml) and
another way is to link to a entry point that list all credit cards
https://gist.github.com/5a38922984fd94398012
Which one would you use? Any pros & cons ?
Thanks a lot!
Julio
-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting

Mail: algermissen-***@public.gmane.org
Blog: http://www.nordsc.com/blog/
Work: http://www.nordsc.com/
-----------------------------------
Julio Lima
2010-02-02 14:35:59 UTC
Permalink
Jan

My scenario is : A already have one server, this server is responsible for
one research (credit card), and I can access it using a AtomPub protocol.
Now I am developing a second application, one a second server, which need to
provide information about about generic tourists destinations. For each
destination I would like to link all acceptable credit cards.
To expose this "destination" resource, I would like to use AtomPub as well.
And to "link" both resources, I thought that atom:link element is the more
appropriate tag, right?

So, I end up with two different possible atom feeds for a destination (see
below).

The difference between them are minus, but important.
The first one has only one link, to all credit cards accepted by a given
destination (possible a complete feed).
The second one has 3 links, one for each credit cards accepted by a given
destination (possible 3 entries).

My question is : both approaches are correct? Which one would you use? Any
pros & cons ?

Thanks a lot!
Julio

<entry xmlns="http://www.w3.org/2005/Atom"

xmlns:d="http://destinos.abril.com.br/2010/destinos"
xmlns:xh="http://www.w3.org/1999/xhtml">


<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<title>Brasil</title>


<summary type="plain/text">
Brasil, an amazing country.
</summary>

<content type="application/xhtml">
<xh:div> <b>Brasil</b> é um país muito bonito... e a melhor
cidade é a de <b>São Paulo</b> ...</xh:div>
</content>


<link rel="credit-cards"
type="application/atom+xml&profile=vnd/abd-credit-card"
href="http://destination.example.com/destination/brazil/credit-cards"/>

</entry>


or

<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://destinos.abril.com.br/2010/destinos"
xmlns:xh="http://www.w3.org/1999/xhtml">


<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<title>Brasil</title>


<summary type="plain/text">
Brasil, an amazing country.
</summary>

<content type="application/xhtml">
<xh:div> <b>Brasil</b> é um país muito bonito... e a melhor
cidade é a de <b>São Paulo</b> ...</xh:div>
</content>


<d:category>
<d:type>COUNTRY</d:type>
</d:category>


<link rel="credit-card"
type="application/atom+xml&profile=vnd/abd-credit-card"
href="http://destination.example.com/credit-card/amex"/>
<link rel="credit-card"
type="application/atom+xml&profile=vnd/abd-credit-card"
href="http://destination.example.com/credit-card/visa"/>
<link rel="credit-card"
type="application/atom+xml&profile=vnd/abd-credit-card"
href="http://destination.example.com/credit-card/mastercard"/>

</entry>
Post by Jan Algermissen
Julio,
I am afraid you need to provide more context....I don't get what you want to do.
Jan
Post by Julio Lima
Hi,
I'm working on a atom-entry spec for a "destination" feed. This
destination has relation with "credit-card" (all credit cards usually
accepted on that destination). Of course, one destination may have
more than one credit card associated.
First one, listing all links direct on entry (destination.xml) and
another way is to link to a entry point that list all credit cards
https://gist.github.com/5a38922984fd94398012
Which one would you use? Any pros & cons ?
Thanks a lot!
Julio
-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting
Blog: http://www.nordsc.com/blog/
Work: http://www.nordsc.com/
-----------------------------------
Jan Algermissen
2010-02-03 07:09:14 UTC
Permalink
Jan
My scenario is : A already have one server, this server is responsible for one research (credit card), and I can access it using a AtomPub protocol.
Now I am developing a second application, one a second server, which need to provide information about about generic tourists destinations. For each destination I would like to link all acceptable credit cards.
To expose this "destination" resource, I would like to use AtomPub as well.
And to "link" both resources, I thought that atom:link element is the more appropriate tag, right?
Yes.
So, I end up with two different possible atom feeds for a destination (see below).
The first one looks better. (the type is wrong though, you need to say ..+xml;profile=""
The difference between them are minus, but important.
The first one has only one link, to all credit cards accepted by a given destination (possible a complete feed).
The second one has 3 links, one for each credit cards accepted by a given destination (possible 3 entries).
My question is : both approaches are correct? Which one would you use? Any pros & cons ?
I would probably not prepresent a credit card with an atom entry, only when it appears inside a feed (example one).

Jan
Thanks a lot!
Julio
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://destinos.abril.com.br/2010/destinos"
xmlns:xh="http://www.w3.org/1999/xhtml">
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<title>Brasil</title>
<summary type="plain/text">
Brasil, an amazing country.
</summary>
<content type="application/xhtml">
<xh:div> <b>Brasil</b> é um país muito bonito... e a melhor cidade é a de <b>São Paulo</b> ...</xh:div>
</content>
<link rel="credit-cards" type="application/atom+xml&profile=vnd/abd-credit-card" href="http://destination.example.com/destination/brazil/credit-cards"/>
</entry>
or
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://destinos.abril.com.br/2010/destinos"
xmlns:xh="http://www.w3.org/1999/xhtml">
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<title>Brasil</title>
<summary type="plain/text">
Brasil, an amazing country.
</summary>
<content type="application/xhtml">
<xh:div> <b>Brasil</b> é um país muito bonito... e a melhor cidade é a de <b>São Paulo</b> ...</xh:div>
</content>
<d:category>
<d:type>COUNTRY</d:type>
</d:category>
<link rel="credit-card" type="application/atom+xml&profile=vnd/abd-credit-card" href="http://destination.example.com/credit-card/amex"/>
<link rel="credit-card" type="application/atom+xml&profile=vnd/abd-credit-card" href="http://destination.example.com/credit-card/visa"/>
<link rel="credit-card" type="application/atom+xml&profile=vnd/abd-credit-card" href="http://destination.example.com/credit-card/mastercard"/>
</entry>
Julio,
I am afraid you need to provide more context....I don't get what you want to do.
Jan
Post by Julio Lima
Hi,
I'm working on a atom-entry spec for a "destination" feed. This
destination has relation with "credit-card" (all credit cards usually
accepted on that destination). Of course, one destination may have
more than one credit card associated.
First one, listing all links direct on entry (destination.xml) and
another way is to link to a entry point that list all credit cards
https://gist.github.com/5a38922984fd94398012
Which one would you use? Any pros & cons ?
Thanks a lot!
Julio
-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting
Blog: http://www.nordsc.com/blog/
Work: http://www.nordsc.com/
-----------------------------------
-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting

Mail: algermissen-***@public.gmane.org
Blog: http://www.nordsc.com/blog/
Work: http://www.nordsc.com/
-----------------------------------

Loading...