[xwiki-devs] VelocityFactory API change (was Re: xwiki-velocity refactoring)
Vincent Massol
vincent at massol.net
Wed Mar 2 15:49:17 UTC 2011
ok I have no added the following 2 new component impls:
* WebAppVelocityConfiguration
* WebAppVelocityEngine
However it's not enough since DefaultVelocityEngine.createVelocityEngine() does a component lookup on VelocityEngine and we need a way for it to look up with a passed hint.
I'm proposing to modify the current VelocityFactory API from:
VelocityEngine createVelocityEngine(String key, Properties properties) throws XWikiVelocityException;
to:
VelocityEngine createVelocityEngine(String key, Properties properties, String engineType) throws XWikiVelocityException;
where engineType is the hint corresponding to the engine to look up.
Then DefaultVelocityManager can call VelocityFactory, passing the "webapp" hint to createVelocityEngine.
WDYT?
Thanks
-Vincent
On Mar 2, 2011, at 1:56 PM, Vincent Massol wrote:
> Just a heads up of what I'm working on right now: cleaning up xwiki-velocity dependencies.
>
> I'm going to split it into several submodules:
> * xwiki-velocity-management (or xwiki-velocity-jmx)
> * xwiki-velocity-default
> * xwiki-velocity-webapp (implementation of VelocityEngine and VelocityConfiguration with hint = "webapp", this is to use use velocity with the WebappResourceLoader loading templates from the webapp's root dir)
>
> -Vincent
>
More information about the devs
mailing list