cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: [RT]: Dynamic variables in the Sitemap / Input Modules revisited
Date Fri, 10 Jan 2003 16:28:25 GMT
On 10.Jan.2003 -- 04:42 PM, Sylvain Wallez wrote:
> FYI, I patched a bit VariableResolver in treeprocessor.variables so that 
> it can be used outside the sitemap context :
> 
> VariableResolver resolver = 
> VariableResolverFactory.getResolver("{module:name}", manager);
> String value = resolver.resolve(objectModel);
> if (resolver instanceof Disposable) ((Disposable)resolver).dispose();
> 
> It works but isn't clean since it's not COP, so I'm thinking of turning 
> it to a component :
> 
> ComponentSelector selector = 
> manager.lookup(VariableResolverSelector.ROLE + "Selector");
> VariableResolver resolver = selector.select("{module:name}");
> String value = resolver.resolve();
> selector.release(resolver);

This sounds extremely cool!

> The selector is a special implementation that does the parsing already 
> existing in the TreeProcessor, and resolver.resolve() accesses the 
> object model through CocoonComponentManager.

That would include parsing the complete string
eg. "log-{request-param:name}-{date:now}.xml", right?

Another thought: the Selector needs use the same component manager as
the component requiring the lookup. Otherwise there could be a
visibility problem, right? That is, if we allow module to be declared
anywhere else than in cocoon.xconf.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Mime
View raw message