You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by Remy Gendron <re...@arrova.ca> on 2008/04/29 20:54:28 UTC

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

 


RE: Categories example

Posted by Remy Gendron <re...@arrova.ca>.
I've added a route of type COLLECTION using Google GDATA approach (base +
":collection/-/:categories").

Now, the resolver returns the :categories variable in Target.params. I just
.split("/") this value to get the list of targeted categories.

Thanks all for your insights.

 
Rémy
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: David Calavera [mailto:david.calavera@gmail.com] 
Sent: April 30, 2008 03:51
To: abdera-user@incubator.apache.org; remy@arrova.ca
Subject: Re: Categories example

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 <re...@arrova.ca> 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:remy@arrova.ca]
> Sent: April 29, 2008 15:52
> To: abdera-user@incubator.apache.org
> 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
>
>
>
> remy.gendron@arrova.ca
>
> 418 809-8585
> http://arrova.ca
>
>
> -----Original Message-----
> From: Remy Gendron [mailto:remy@arrova.ca]
> Sent: April 29, 2008 15:40
> To: abdera-user@incubator.apache.org
> 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
>
>
>
> remy.gendron@arrova.ca
>
> 418 809-8585
> http://arrova.ca
>
>
> -----Original Message-----
> From: Remy Gendron [mailto:remy@arrova.ca]
> Sent: April 29, 2008 14:54
> To: abdera-user@incubator.apache.org
> 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
>
>
>


-- 
David Calavera
http://www.thinkincode.net


Re: Categories example

Posted by James M Snell <ja...@gmail.com>.
Ah, sorry, I missed the original context.  That'll teach me to come into 
the middle of a conversation :-)

- James

Remy Gendron wrote:
> Isn't TYPE_CATEGORIES, which routes to AbstractAdapter.getCategories(), used
> to return a categories document? I understand that a categories document
> lists the categories associated to a feed or an entry. DefaultProvider
> creates a route (base + ":collection/:entry;categories) of type
> TYPE_CATEGORIES. This seems to support my interpretation.
> 
> Returning a categories document is different than returning the entries
> associated to a list of categories.
> 
>  
> Rémy
>  
> 
>  
> remy.gendron@arrova.ca
>  
> 418 809-8585
> http://arrova.ca
>  
> 
> -----Original Message-----
> From: James M Snell [mailto:jasnell@gmail.com] 
> Sent: April 30, 2008 11:09
> To: abdera-user@incubator.apache.org
> Cc: remy@arrova.ca
> Subject: Re: Categories example
> 
> +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 <re...@arrova.ca> 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:remy@arrova.ca]
>>> Sent: April 29, 2008 15:52
>>> To: abdera-user@incubator.apache.org
>>> 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
>>>
>>>
>>>
>>> remy.gendron@arrova.ca
>>>
>>> 418 809-8585
>>> http://arrova.ca
>>>
>>>
>>> -----Original Message-----
>>> From: Remy Gendron [mailto:remy@arrova.ca]
>>> Sent: April 29, 2008 15:40
>>> To: abdera-user@incubator.apache.org
>>> 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
>>>
>>>
>>>
>>> remy.gendron@arrova.ca
>>>
>>> 418 809-8585
>>> http://arrova.ca
>>>
>>>
>>> -----Original Message-----
>>> From: Remy Gendron [mailto:remy@arrova.ca]
>>> Sent: April 29, 2008 14:54
>>> To: abdera-user@incubator.apache.org
>>> 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
>>>
>>>
>>>
>>
> 
> 

RE: Categories example

Posted by Remy Gendron <re...@arrova.ca>.
Isn't TYPE_CATEGORIES, which routes to AbstractAdapter.getCategories(), used
to return a categories document? I understand that a categories document
lists the categories associated to a feed or an entry. DefaultProvider
creates a route (base + ":collection/:entry;categories) of type
TYPE_CATEGORIES. This seems to support my interpretation.

Returning a categories document is different than returning the entries
associated to a list of categories.

 
Rémy
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: James M Snell [mailto:jasnell@gmail.com] 
Sent: April 30, 2008 11:09
To: abdera-user@incubator.apache.org
Cc: remy@arrova.ca
Subject: Re: Categories example

+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 <re...@arrova.ca> 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:remy@arrova.ca]
>> Sent: April 29, 2008 15:52
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>> remy.gendron@arrova.ca
>>
>> 418 809-8585
>> http://arrova.ca
>>
>>
>> -----Original Message-----
>> From: Remy Gendron [mailto:remy@arrova.ca]
>> Sent: April 29, 2008 15:40
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>> remy.gendron@arrova.ca
>>
>> 418 809-8585
>> http://arrova.ca
>>
>>
>> -----Original Message-----
>> From: Remy Gendron [mailto:remy@arrova.ca]
>> Sent: April 29, 2008 14:54
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
> 
> 


-- 
No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.6/1404 - Release Date: 29/04/2008
6:27 PM



Re: Categories example

Posted by James M Snell <ja...@gmail.com>.
+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 <re...@arrova.ca> 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:remy@arrova.ca]
>> Sent: April 29, 2008 15:52
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>> remy.gendron@arrova.ca
>>
>> 418 809-8585
>> http://arrova.ca
>>
>>
>> -----Original Message-----
>> From: Remy Gendron [mailto:remy@arrova.ca]
>> Sent: April 29, 2008 15:40
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>> remy.gendron@arrova.ca
>>
>> 418 809-8585
>> http://arrova.ca
>>
>>
>> -----Original Message-----
>> From: Remy Gendron [mailto:remy@arrova.ca]
>> Sent: April 29, 2008 14:54
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
> 
> 

Re: Categories example

Posted by Chris Berry <ch...@gmail.com>.
Categories are one of the most powerful and important aspects of Atom.
FWIW, in our Atom server;

1) We use GData-style Categories, at least in spirit.
GData uses some non-URL friendly characters, which we have swapped out  
for ease-of-use
So to select a Feed of a single URL;
      GET /v1/foos/bars/-/(urn:ha.foos.brands)HR

2) We have settled on "prefix notation" for more complex Category  
logic. e.g.  OR AND x y z
So in a URL, if you want to get all foos in brand "HR" that have  
Categories of type of "xxx" or "yyy", you would say:

     GET /v1/foos/bars/-/AND/(urn:ha.foos.brands)HR/OR/(urn:ha.foos.type)xxx/(urn:ha.foos.type)yyy

3) We allow the user to manipulate Categories themselves using a  
specialized Workspace.
This was the most natural choice. We already have that vocabulary, so  
why not extend it.
So we use an automatic, parallel, transparent workspace.
E.g. for workspace "foo", the Categories are manipulated in workspace  
"tags:foo"

4) We have an easily configured "auto-tagger", which can be configured  
for each Workspace.
Its an interface, but the primary form is XPathAutoTagger.

Cheers,
- Chris


On Apr 30, 2008, at 2:50 AM, 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 <re...@arrova.ca> 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:remy@arrova.ca]
>> Sent: April 29, 2008 15:52
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>> remy.gendron@arrova.ca
>>
>> 418 809-8585
>> http://arrova.ca
>>
>>
>> -----Original Message-----
>> From: Remy Gendron [mailto:remy@arrova.ca]
>> Sent: April 29, 2008 15:40
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>> remy.gendron@arrova.ca
>>
>> 418 809-8585
>> http://arrova.ca
>>
>>
>> -----Original Message-----
>> From: Remy Gendron [mailto:remy@arrova.ca]
>> Sent: April 29, 2008 14:54
>> To: abdera-user@incubator.apache.org
>> 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
>>
>>
>>
>
>
> -- 
> David Calavera
> http://www.thinkincode.net


Re: Categories example

Posted by David Calavera <da...@gmail.com>.
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 <re...@arrova.ca> 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:remy@arrova.ca]
> Sent: April 29, 2008 15:52
> To: abdera-user@incubator.apache.org
> 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
>
>
>
> remy.gendron@arrova.ca
>
> 418 809-8585
> http://arrova.ca
>
>
> -----Original Message-----
> From: Remy Gendron [mailto:remy@arrova.ca]
> Sent: April 29, 2008 15:40
> To: abdera-user@incubator.apache.org
> 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
>
>
>
> remy.gendron@arrova.ca
>
> 418 809-8585
> http://arrova.ca
>
>
> -----Original Message-----
> From: Remy Gendron [mailto:remy@arrova.ca]
> Sent: April 29, 2008 14:54
> To: abdera-user@incubator.apache.org
> 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
>
>
>


-- 
David Calavera
http://www.thinkincode.net

RE: Categories example

Posted by Remy Gendron <re...@arrova.ca>.
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:remy@arrova.ca] 
Sent: April 29, 2008 15:52
To: abdera-user@incubator.apache.org
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
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: Remy Gendron [mailto:remy@arrova.ca] 
Sent: April 29, 2008 15:40
To: abdera-user@incubator.apache.org
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
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: Remy Gendron [mailto:remy@arrova.ca] 
Sent: April 29, 2008 14:54
To: abdera-user@incubator.apache.org
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



RE: Categories example

Posted by Remy Gendron <re...@arrova.ca>.
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
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: Remy Gendron [mailto:remy@arrova.ca] 
Sent: April 29, 2008 15:40
To: abdera-user@incubator.apache.org
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
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: Remy Gendron [mailto:remy@arrova.ca] 
Sent: April 29, 2008 14:54
To: abdera-user@incubator.apache.org
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


RE: Categories example

Posted by Remy Gendron <re...@arrova.ca>.
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
 

 
remy.gendron@arrova.ca
 
418 809-8585
http://arrova.ca
 

-----Original Message-----
From: Remy Gendron [mailto:remy@arrova.ca] 
Sent: April 29, 2008 14:54
To: abdera-user@incubator.apache.org
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