cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: URL translations/rewriting
Date Thu, 30 Aug 2007 14:51:08 GMT
Ken Gerrard pisze:
> Hello. I've been using Cocoon for a few years and I love it! I'm using
> 2.1.10 on Windows, MacOS X, and SuSE linux.
> 
> A web services interface has been written at my work, a public transit
> provider. I find some of the URLs distasteful (queries when they
> should be resources) and would like to create aliases on top of them
> that translate invisibly to the underlying URLs.
> 
> For instance:
> 
> /stops/10064/schedule
> |
> -> /schedules?stopNumber=10064
> 
> /stops/(49.856,-97.149),(49.870,-97.112)
> |
> -> /stops?lat1=49.856&lon1=-97.149&lat2=49.870&lon2=-97.112
> 
> I have tried to solve this several ways. The first attempt, for the
> second URL, looked like this:
>     		<match pattern="stops/(*,*),(*,*)">
>     			<redirect-to
> uri="cocoon:/stops?lat1={1}&amp;lon1={2}&amp;lat2={3}&amp;lon2={4}"/>
>     		</match>
> 
> That didn't work; the URL parameters don't seem to survive into the
> cocoon protocol.

The cocoon protocol should work well with any parameters that are given in the url. Can you
show
what exactly does not work?

> I've also tried CInclude, but since that uses the same cocoon
> protocol, it doesn't work either.
> 
> It works with http://, of course, but that requires me to know the
> host I'm on and the directory I'm in.
> 
> I've poked around in the CInclude transformer. Might I have to do
> something with the SourceResolver? It accepts parameters, but the
> SitemapSource that comes out never has them.
> 
> I hope this question hasn't been asked. I searched various places, but
> the term "URL rewriting" has a different meaning than I expect.

I'm not really sure what do you want to achieve. Do you have poorly written pipelines (matches)
in
your sitemap and you want to create "alias" matches? Or do you have an external service and
you want
to create aliases internally so you can use that external service in more convenient way?

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message