cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
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 = selector.select("{module:name}");
String value = resolver.resolve();
selector.release(resolver);

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
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



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


Mime
View raw message