> I could also work with Velocity to make a Context object system that auto
> populates itself, however, I think that this functionality should be
> somewhere within Turbine instead of Velocity because we would want to make
> it generic enough to work in other systems like WebMacro.
> 
> What do you all think that I should do?

Is there a way that we can make sure that template service
initializes before the velocity service, or webmacro service?

During the init of the template service an application
toolbox could be constructed. This could be a Map object
or a bean we design to house the application tools. A
simple Map object might be wise because we can then
populate the Map with a set of standard tools for
the Pull Model, and let users specify any 
additional tools in the TR.props file:

context.tool.name = mathtool
context.tool.class = org.whatever.MathTool

context.tool.name = stringtool
context.tool.class = org.whatever.StringTool

So I would say that all these tools, standard and
user defined would be accessible as:

$app.<tool.name>

Or we could just list all the tools in the TR.props
file so that people could choose which app tools
they want. Regardless of whether they are provided
by Turbine or are custom tools.

During the initialization of the individual template
services (Vel, WM, FM) we could do whatever was necessary
to make the toolbox available. Because the toolbox will
already be made we could simply do the following:

context.put("app", TurbineTemplateServer.getAppToolBox())

Or the TurbineTemplateService could stick the app tool
box in the global cache and we can retrieve it from
there.

So I think if we can force the TemplateService to init
first, then it can build up the toolbox and make it
available the other template services, and the template
services in turn can make sure that the app tool box
is always present in the context for use.

jvz.
 
> (Please send responses to the Turbine mailing list.)
> 
> -jon
> 
> 
> 
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]
> 
> 



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to