On 1/19/02 2:14 PM, "James Taylor" <[EMAIL PROTECTED]> wrote:

> This is a tiny patch to TurbineTemplateService in fulcrum. Currently in
> turbine 3, TurbineTemplateService.templateExists is called (by
> DetermineTargetValve via Module.templateExists) to determine if the
> target parsed from the request parameters exists within the path of a
> configured template engine service. Template engine services are
> registered by extension, so templateExists first looks up the template
> engine service that is registered for the extension of the target, and
> then asks it if the template exists.
> 
> The problem I see is that if no template engine service is registered
> for that extension, a null pointer exception is thrown. I believe this
> is incorrect behavior, since having no template engine service
> registered for the extension implies that the template does not exist,
> and the method should return false.
> 
> So before the patch, asking for
> 
> /template/NonExistentTemplate.vm
> 
> returns false, but asking for
> 
> /template/NonExistentTemplate.food
> 
> throws an NPE. After the patch, both will return false, causing
> DetermineTargetValve to use the configured homepage as the target, which
> seems like a more consistent behavior.

That's certainly more consistent, but I think the whole 'view' system has to
be reworked. We have quite a mess in the template service to accommodate
what I once thought would be a slew of templating engines. But really what
is happening is that most people are settling on Velocity or JSP (more on
JSP being a first class citizen later) and the abstraction that we have
isn't worth it IMO and it makes things far too complicated with the
ContextAdapters.

I would like to see the 'view' systems be decoupled from Fulcrum and made in
a way similar to what we've been talking about for security. A skeletal
interface with guts of the implementation doing what is best suited for the
job. We have already had cases where specific features of Velocity are
needed, the EventCartridge I believe, and there is just no analog in JSP.
Even between the template engines there are enough differences that it's not
worth the effort in the abstraction.

At first I definitely thought it would be worth it, but what I can see
happening is Velocity devs are going to modify and tune a velocity 'view'
while people who need JSP will do the same. What we will arrive at is
something akin to what was originally in turbine where there was basically a
separate implementation of modules for each 'view' system we supported.

Basically what I'm saying is that I would like to toss the template service
and all the view services, declare 'view' systems a core aspect of Turbine
and reimplement as fully pluggable systems. What's there I think is way too
complicated.

That being said I will apply your patch :-)

> Thanks,
> James
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to