Tim,

Please remember that Lift's Snippet processing is recursive.  Thus, you
don't really need to hook into the templating system in order to be able to
using Lift's templates.  For example, if your snippet returned:

<span><lift:comet type="Dog"/><lift:comet type="Cat"/></span>

Lift would then interpret the two comet tags and you'd wind up with two
comet components on the page.

However, I think it's a security risk to allow arbitrary users to be able to
embed <lift:xxx/> tags in their content.  This would in effect allow any
user access to any resource that any snippet has access to.

On the caching front, I'd hand-roll my own caching mechanism.  You'll
probably end up caching all (or almost all) the content.  Rather than doing
some goofy stuff in SQL trying to do object graph traversals, just do it in
objects.  You can use immutability and actors to deal with most of the
concurrency issues.

Thanks,

David

On Sat, Nov 29, 2008 at 6:25 PM, Tim Perrett <[EMAIL PROTECTED]> wrote:

>
> I've been playing around with this and extending the template loader
> is actually pretty easy. Its much simpler than I thought it would be!
>
> I have a dilemma however - store the templates (and associated meta
> data) in the database and then have to do a fetch / read on every
> request, or, use the file system and hold (for instance):
>
> example.html
> and
> example.meta // java properties file format
>
> The tree structure of the file system is the path of least resistance
> for my particular use case i think, but i guess im after some input /
> advice...? I feel as either way has a couple of hang-ups! The kind of
> meta data is just simple key-value pair stuff, but my plan would be to
> extend Record so that the save() etc became transparent and was
> abstracted away (i.e. don't need to worry about InputStreams etc)
>
> Appreciate any input / advice people have
>
> Cheers
>
> Tim
>
> On Nov 29, 2:31 pm, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > Looking at findVisibleTemplate in LiftSession (line 512) certainly makes
> it
> > appear that the template table defined by addTemplateBefore/After is
> > consulted before it checks the filesystem.
> >
> > Derek
> >
> > On Fri, Nov 28, 2008 at 10:26 AM, Tim Perrett <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hey guys,
> >
> > > I want to user lifts LiftRules.addTemplateBefore/After to load
> > > templates from a database, where my persistence is JPA.
> >
> > > With TemplatePf can I do this? Im also thinking this will be one of
> > > the nice things about having lift tags, as it will mean i shouldn't
> > > need to build a custom tagging language or anything (as we already
> > > have it!). I presume that TemplatePf just tells lift where to get the
> > > XHTML from then it continues to do the processing on it (process
> > > snippets etc)?
> >
> > > Cheers
> >
> > > Tim
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to