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
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to