cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [RT]: Dynamic variables in the Sitemap / Input Modules revisited
Date Fri, 10 Jan 2003 15:42:27 GMT
Carsten Ziegeler wrote:

>Stephan Michels wrote
>>One question, should these 'Dynamic variables' only be accessible
>>in the sitemap? Or will be there a 'Dynamic variables'Transformer,
>>or something more universal?
>Ah, good question, yes, this is something I forgot:
>These dynamic variables should also be accessible in any other
>component. They are avalon components that can be looked up
>using a corresponding selector.

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 ="{module:name}");
String value = resolver.resolve();

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

Used in such a context, "VariableResolve" and "resolve()" doesn't sound 
so good. So maybe another name ?

Thoughts ?

Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

To unsubscribe, e-mail:
For additional commands, email:

View raw message