cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: i18n catalogues and caching
Date Fri, 14 Jan 2005 16:15:31 GMT
Sylvain Wallez <sylvain <at> apache.org> writes:

> > 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.

No, CatalogueInfo is not the problem. The variables are resolved on each
request. But the bundles returned by the (String[] directories, ...) in
XMLResourceBundleFactory is always the same though the String[] directories are
different. The first directory in the String[] is evaluated and taken from cache
- with all the other bundles attached as parents.

Joerg


Mime
View raw message