cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: i18n catalogues and caching
Date Fri, 14 Jan 2005 15:58:58 GMT
Joerg Heinicke wrote:

>Hello,
>
>this is my first post for the new company I work for - and I have a problem with
>the caching of the i18n catalogues. The location of one i18n catalogue is
>defined to be dependent on {request-attr:xyz}, so it can change on each request.
>But the first access to this i18n transformer caches the catalogue and its
>location, later accesses to the transformer will not have the correct catalogues
>available. Is it possible to either prevent the caching of the catalogues at all
>or - even better - to influence the caching by adding the dependency on the
>request attribute?
>  
>

This seems to be related to the CatalogueInfo class in the 
I18nTransformer that holds the location of a catalogue. This class holds 
a VariableResolver, the object used in the sitemap engine to resolve 
{...} variables, which is resolved at the *first* use of a catalogue, 
and is never reevaluated again later.

So that means that when using {request-attr:xyz} in the catalogue 
location, this expression is evaluated only at the first request where 
this catalogue is used.

A solution would be for catalogue locations to be evaluated at each 
request, e.g. in the transformer's setup() method, or at the first use 
of a catalogue within a setup()/recycle() cycle.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message