cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Ulrich Niedermann <niederm...@isd.uni-stuttgart.de>
Subject Re: [C2] Question About WildcardURIMatcher
Date Fri, 25 Aug 2000 23:46:13 GMT
Giacomo Pati <Giacomo.Pati@pwr.ch> writes:

> > Vadim Gritsenko wrote:

> > Is it OK that '<map:match pattern="welcome">' (from sitemap.xmap)
> > matches http://host/cocoon/welcome as well as
> > http://host/cocoon/zzzzzzwelcomezzzzzzzzz?
> > I mean, it should work this way or this is an error?
> 
> Unfortunately it's the way it workes. That's why I have used the
> RegexpURIMatcher to have a way to determine start and end on a pattern
> (see my mail yesterday about this topic).
> 
> Maybe you have a way or proposal how to fix it?

Why isnt't the pattern interpreted relatively to the base URL of the
sitemap in the first place? (I understand the cascading of sitemaps
leads to a base URL for every sitemap.) 

This would allow matching the beginning of a pattern agains the
beginning of the relative URL. If we also match the end of the
wildcard pattern against the end of the URL we get something IMHO
reasonable.

[ The following is not based on examination of current code and
  therefore perhaps contradicts current behaviour ("**" matching). 
  However, it may reflect the expectations of a new C2 user :-) ]

The URL would be the part of the URI in front of the first "?"
character: URI "http://xyz:80/a/b?d=e" -> URL "http:///xyz:80/a/b" 

So, if the base URL of a sitemap is http://localhost:8080/cocoon/

"welcome"
   matches "http://localhost:8080/cocoon/welcome"
   but not "http://localhost:8080/cocoon/mywelcomexx"
           "http://localhost:8080/cocoon/docs/welcome"

"docs/*"
   matches "http://localhost:8080/cocoon/docs/aaa"
           "http://localhost:8080/cocoon/docs/bbb"
   but not "http://localhost:8080/cocoon/newdocs/foo"
           "http://localhost:8080/cocoon/docs/dir/whatever"

"docs/**/dirindex"
   matches "http://localhost:8080/cocoon/docs/dirindex"
           "http://localhost:8080/cocoon/docs/a/dirindex",
           "http://localhost:8080/cocoon/docs/a/b/dirindex"
   but not "http://localhost:8080/cocoon/mydocs/dirindex"
           "http://localhost:8080/cocoon/docs/dirindex2"

Of course, this limits usage of the wildcard matcher to URIs of a
"http://host:port/path/to/resource?param=value&param2=value2"
structure.

Uli

Mime
View raw message