[Lift] Re: JPA and Record

2008-11-29 Thread Derek Chen-Becker
No big deal. In the example code I did a by-name in the delegate method so
at least it's transparent to the end-user.

Derek

On Sat, Nov 29, 2008 at 11:06 AM, Jorge Ortiz [EMAIL PROTECTED] wrote:

 Just wanted to chime in real quick...


 type Getter = () = MyType // Can this be by-name in any way?


 No. By-names are not first-class types. It's gotta be () = MyType

 --j


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
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
-~--~~~~--~~--~--~---



[Lift] Re: Using TemplatePf for JPA powered templates

2008-11-29 Thread Tim Perrett

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
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
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
-~--~~~~--~~--~--~---



[Lift] Re: JPA and Record

2008-11-29 Thread Viktor Klang
IMHO:

  @Column{val name = my_name}
  var name : String = _
  object nameField extends StringField(this,100) with Delegated
  nameField.delegate(name, name = _)

That's just too much boilerplate. For me, who went to scala to lose
boilerplate, this is not a viable solution.

Unfortunately the JPA spec is kind of weak when it comes to adaptation, so
my suggestion to make it work with Hibernate first still stands.

What do you guys think?

Cheers,
Viktor

On Sat, Nov 29, 2008 at 10:23 PM, Derek Chen-Becker
[EMAIL PROTECTED]wrote:

 No big deal. In the example code I did a by-name in the delegate method so
 at least it's transparent to the end-user.

 Derek


 On Sat, Nov 29, 2008 at 11:06 AM, Jorge Ortiz [EMAIL PROTECTED]wrote:

 Just wanted to chime in real quick...


 type Getter = () = MyType // Can this be by-name in any way?


 No. By-names are not first-class types. It's gotta be () = MyType

 --j





 



-- 
Viktor Klang
Senior Systems Analyst

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
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
-~--~~~~--~~--~--~---



[Lift] Re: Using TemplatePf for JPA powered templates

2008-11-29 Thread Viktor Klang
If you use Hibernate you could simply configure the L2-cache and have
Hibernate manage it for you. (EHCache or whatever cache-provider you like)
This means you won't have to manually use the filesystem and can let the
cache-provider do what it's good at :)

Cheers,
Viktor

On Sun, Nov 30, 2008 at 3:25 AM, 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
 



-- 
Viktor Klang
Senior Systems Analyst

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
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
-~--~~~~--~~--~--~---