[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple links (for a collection) on a atom entry
On Feb 2, 2010, at 3:35 PM, Julio Lima wrote:
> 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>
>
>
>
>
> On Tue, Feb 2, 2010 at 10:33 AM, Jan Algermissen <algermissen1971@xxxxxxx> wrote:
> Julio,
>
> I am afraid you need to provide more context....I don't get what you want to do.
>
> Jan
>
>
>
> On Feb 2, 2010, at 11:33 AM, Julio Lima wrote:
>
> > 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
> > Which one would you use? Any pros & cons ?
> >
> > Thanks a lot!
> > Julio
> >
>
> -----------------------------------
> Jan Algermissen, Consultant
> NORD Software Consulting
>
> Mail: algermissen@xxxxxxx
> Blog: http://www.nordsc.com/blog/
> Work: http://www.nordsc.com/
> -----------------------------------
>
>
>
>
>
-----------------------------------
Jan Algermissen, Consultant
NORD Software Consulting
Mail: algermissen@xxxxxxx
Blog: http://www.nordsc.com/blog/
Work: http://www.nordsc.com/
-----------------------------------