+1, it's also easier to maintain. However, why wouldn't you map it to TargetType.TYPE_CATEGORIES ?

- James

David Calavera wrote:
I don't know if it's the best practice but I usually add another route with
categories as part of the url:

.addRoute("feed", base + "*:collection/category/:cat*",
TargetType.TYPE_COLLECTION)

I think this approach is more user friendly

On Tue, Apr 29, 2008 at 11:00 PM, Remy Gendron <[EMAIL PROTECTED]> wrote:

Ok I have found in the Abdera unit tests and examples some code that
indicates that the following url should return the list of categories
associated to the specified entry:

http://localhost:8080/imdb/atom/movies/630226;categories

What I am trying to understand is the URL scheme to use to request the
collection of movies that are part of say, both the scifi and top100
categories.

Of course, I could do something like .../movies?cat=scifi&top100, but I
believe the best practice is to specify the categories as part of the URL
path... Am I right?

Remy



-----Original Message-----
From: Remy Gendron [mailto:[EMAIL PROTECTED]
Sent: April 29, 2008 15:52
To: [email protected]
Subject: RE: Categories example

And just to be clear, I understand the Atom spec of the categories
document,
and how categories can be added to an entry, be it on the server side
(Entry.addCategory) or the client side (atom:category element).

I need to understand how it relates to URIs...

Thanks,


Rémy



[EMAIL PROTECTED]

418 809-8585
http://arrova.ca


-----Original Message-----
From: Remy Gendron [mailto:[EMAIL PROTECTED]
Sent: April 29, 2008 15:40
To: [email protected]
Subject: RE: Categories example

More questions:

I see that AbstractProvider will call the adapter's getCategories on a GET
for entries that are part of one or more categories:

Question 1) I cannot decipher from the Route implementation how you
specify
one of more categories for a feed request. Could you provide expansion
examples for base/:collection/:entry;categories, as defined in
DefaultProvider.

Question 2) I use AbstractEntityCollectionAdapter. Is there proper
integration for categories support with this entity oriented adapter?

Question 3) On a getEntries, I know how to fetch the parameters from the
request and use them to fetch the entries. Assuming that getCategories is
called, do I only have to retrieve the categories from the URL path and
fetch the matching entries?

Is the scheme used to specify the categories (which I don't know at the
moment - see question 1) part of some Atom specifications? How does this
compare with the GDATA path/-/category/category/... scheme?

I have seen in the Abdera codebase how to add category info to a feed.
That
part is clearer.

Thanks again,

Rémy



[EMAIL PROTECTED]

418 809-8585
http://arrova.ca


-----Original Message-----
From: Remy Gendron [mailto:[EMAIL PROTECTED]
Sent: April 29, 2008 14:54
To: [email protected]
Subject: Categories example

I was looking for an example of dealing with categories.



I am using the DefaultProvider implementation, hence the RouteManager,
which
defines a route I have trouble interpreting. How would the URL to access a
collection category look like?



What is the contract of the AbstractCollectionAdapter with regard to
category support (getCategories(RequestContext)).



Thanks,





Rémy






--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.6/1403 - Release Date:
29/04/2008
7:26 AM



--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.6/1403 - Release Date:
29/04/2008
7:26 AM





Reply via email to