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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Reply via email to