[xwiki-devs] VelocityFactory API change (was Re: xwiki-velocity refactoring)
vincent at massol.net
Wed Mar 2 17:44:42 UTC 2011
I forgot to menton the alternative which is to create a WebAppVelocityFactory component impl (hint = "webapp"), in the same manner that I have already created WebAppVelocityConfiguration and WebAppVelocityEngine.
I think my preference foes to the API modification now.
On Mar 2, 2011, at 4:49 PM, Vincent Massol wrote:
> 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;
> 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.
> 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)
More information about the devs