abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Calavera" <david.calav...@gmail.com>
Subject Re: Route matching for categories
Date Thu, 01 May 2008 20:01:17 GMT
Hi Remy,

I think the pattern that match the uri doesn't support the slash. Look at
the regexp:

VARIABLE_CONTENT_MATCH = "([^:/\\?#\\[\\]@!\\$&'\\(\\)\\*\\+,;\\=]+)";

it matches any element that doesn't include that characters.



On Thu, May 1, 2008 at 4:53 PM, Remy Gendron <remy@arrova.ca> wrote:

> My requirements are pretty minimal.. no boolean arithmetic. An implicit
> AND
> is all I need. I would dislike having to use a pattern other than
> separating
> the categories with forward slashes. I could separate categories with
> underscores but I don't want to.
>
> Anyway to quickly fix the pattern used by the Route class so that using
> '/'
> between categories at the end of the URI is supported?
>
> Thanks,
>
> Rémy
>
>
>
> remy.gendron@arrova.ca
>
> 418 809-8585
> http://arrova.ca
>
> -----Original Message-----
> From: Chris Berry [mailto:chriswberry@gmail.com]
> Sent: May 1, 2008 10:45
> To: abdera-user@incubator.apache.org
> Subject: Re: Route matching for categories
>
> We resorted to creating our own TargetResolver (in 0.3.0, but don't
> know how this translates to 0.4.0)
> If you are using the GData scheme, then - once you get into boolean
> arithmetic on Categories - you will need to do the same eventually...
> Ditto for batching, etc.
> Cheers,
> -- Chris
>
> On May 1, 2008, at 9:31 AM, Remy Gendron wrote:
>
> > Hello all,
> >
> > My Regex is not good enough to interpret the intricacies of the
> > Route class internals.
> >
> > I have chosen the GDATA URI pattern (…/-/cat1/cat2/cat3/etc) to
> > target categories.
> >
> > It works great for targeting one category, but fails with multiple
> > categories. The second unit test below fails:
> >
> >     @Test
> >     public void testRouteSingleCategory() {
> >         Route r = new Route("test", "/
> > atom/:collection/-/:categories");
> >
> >         assertTrue(r.match("/atom/movies/-/scifi"));
> >     }
> >
> >     @Test
> >     public void testRouteMultipleCategories() {
> >         Route r = new Route("test", "/
> > atom/:collection/-/:categories");
> >
> >         assertTrue(r.match("/atom/movies/-/scifi/drama"));
> >     }
> >
> > Can a regex guru explain in plain english the match pattern used in
> > the Route class?
> >
> > Thanks,
> >
> > Rémy
> >
> >
> >
> > Courriel:            remy.gendron@arrova.ca
> > Cellulaire:          418 809-8585
> > Site Web:          http://arrova.ca
> > Liste:
> http://mail.arrova.ca/mailman/listinfo/dev-list_arrova.ca
> >
>
>
>


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message