RE: View Loading and Caching

"Andy Zeneski" <[email protected]> Thu, 27 Feb 2003 10:18:24 -0500
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <[email protected]>
Well, first thanks for putting in the patch, now I can commit my stuff to
OFBiz. The main issue is Freemarker Transforms and custom methods, which
need to be on every page. Yes, one way that I didn't think of would be to
place these in a global action. But that would be one more action to run
each page. Actually, I believe the transforms (user-defined functions/tags)
*NEED* to be in the root context, which would be the FreeMarkerViewContext,
so an action may not work and a customized FreeMarkerViewContext would be
necessary.

-Andy

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of
> Anthony Eden
> Sent: Thursday, February 27, 2003 9:23 AM
> To: jpublish-developer
> Subject: Re: [JPublish-developer] View Loading and Caching
>
>
> I have committed your patch, but I want to say that it still
> bothers me.  The problem is that you will need to provide a new
> implementation of the FreeMarkerViewContext because that class
> only provides a wrapped version of the JPublishContext.  In most
> cases you will probably want to just put values directly in the
> JPublish context via an action.  That is unless I am missing a
> compelling reason why you must populate the FreeMarker context directly?
>
> Sincerely,
> Anthony Eden
>
> Andy Zeneski wrote:
> >>What is the point of passing the path to the createTemplateContext()
> >>method?  Also, can you explain to me why you would want to override this
> >>method?  I.e. why would you want to create a different instance of the
> >>root context when it is just a wrapper around the JPublishContext?
> >>
> >
> >
> > I put the path there, just in case someone came up with a
> reason to use it
> > and because it was available.
> >
> > The main reason for overriding this method is because other objects in
> > addition to the JPublishContext may (and in our case do) need
> to be in the
> > root context for the template. We have some custom transforms
> and freemarker
> > methods which need to be in the root. Also, we utilize some of
> the wrappers
> > for request parameters, etc.
> >
> > I thought this would make it more flexible for customization
> and allow to
> > reuse as much existing code as possible.
> >
> > -Andy
> >
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Jpublish-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer
>




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf