The fellow readers of my blog might have noticed that pretty much on top of my Cocoon rant list is how unnecessarily complex is to build relocatable Cocoon applications, that is applications who can work no matter how shallow or deep are nested within the Cocoon hierarchy. The problem I'm facing is that in order to build relocatable links you either have to:

1. resort to strictly relative links, something that quickly becomes unmanageable;

2. perform string manipulation by substracting request.getSitemapURI() from request.getRequestURI(). This is painful and slow in XSLT, as an example, and requires two parameters instead than the one you're actually looking for (hence being error prone at best);

The solution is technically a piece of cake, and we have been using a braindead custom inputmodule exactly for that. However, I feel that this data should be available from the Cocoon environment straight away, the best place being o.a.c.environment.Request (which will provide immediate user access through the RequestInputModule). I am very bad in naming stuff, but I would say that something like getSitemapPath() could do the trick. Being this a change in the core environment API, no matter how harmless, the issue might deserve some discussion and a vote. Or a big slap in my face if I'm missing the obvious solution. :-)

So, is that only me having to face this issue day in day out?

Ciao,
--
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance: http://www.orixo.com



Reply via email to