tags:

views:

3

answers:

1

Hello,

I am trying to localize Lenya publication URLs. I store URL translation in the Document metadata and rewrite urls with URLRewriter transformator.

e.g. I build /lenya/default/authoring/en/home from /lenya/default/authoring/index.html

But I can't find a simple way to force Lenya to tranlate incoming request URI back to the original path: /lenya/default/authoring/index.html

Really I want to process the request via pipelines using the original URL, not translated.

Is it possible at all? I had tried to add a servlet filter and use dispatcher, but filter can't access documents metadata because Environment object isn't in the processing stack yet at this stage...

(At this moment I see only one way - to update CocoonServlet and Cocoon classes)

Thanks!

A: 

I was able to do this via a RequestListener.

In the public void onRequestStart(Environment environment) method I create RequestWrapper with a new real URL and put it into objectModel. Also I change Environment context with a real URL: env.setContext("", realUrl, env.getContext())

This works fine!

Boris