I have been working on generalizing the template framework, which currently
is implemented separately for FreeMarker and WebMacro. I am hoping to use
it in a JSP system as well. There are a few issues I suppose need voted on.
When cycling through the possible matches for a Screen module to a screen
template, etc., I am using a File.exists() check instead of the template
engines' specific getTemplate type call. I do not think this should be much
slower, especially since it should be a one time deal (in production.) This
requires a template.path property in TurbineResources. This is already
needed for FreeMarker, but it would be duplicating information for WebMacro
in WebMacro.properties. I would really like to make this an optional
property, so that if it is not given, the default would be the /templates
directory under your webapp directory. Then the property would only exist
in TurbineResources for non-standard setups or legacy servlet engines.
This requires the service to have information regarding the servlet context.
It is simple to do and has been requested before, I believe, with regard to
not having to specify an absolute path in WebMacro.properties as
well. A Service.init(Object) or more specific Service.init(ServletConfig)
can solve this. I propose that there continue to be a no arg init() as
well. Service will have one more method as well, requiresServlet().
TurbineServices.getService(String) then calls requiresServlet() to determine
whether to init with init() or init(Object). Turbine supplies its
ServletConfig to TurbineServices when it loads. If a service is called
which requires the servlet prior to the servlet initialization,
TurbineServices will throw an Exception.
This is reasonably clean, but some may object to having two init methods, so
we could just have one which takes an object.
Some may object to this since many services so not require the object.
Then we would need to define a separate Service interface for services which
depend on a servlet/servletengine environment.
How do you wish me to proceed?
John McNally
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]