Re: [Lift] Multipage wizards

2009-11-25 Thread Jeppe Nejsum Madsen
David Pollak feeder.of.the.be...@gmail.com writes:

 Folks,

 I've completed the first pass at multi-page input Wizards in Lift.  You can
 see an example at: http://demo.liftweb.net/wiz

Great news!

[...]

 The building of HTML forms from the given field type is based on the type
 (currently, there's support for String and Int, but more to come) and it's
 based on plugable functions, so you can build date pickers that are
 localized, etc.

 What needs to be done:

- The naming (including the names that the various parts of the wizard
bind to) need a good going-over
- Support for many different input types (not just Int and String)
- Feedback

I've been thinking about this for a while and haven't really reached
anything concrete yet, but it overlaps enough with the wizard stuff that
I might just throw it out here now:

I think that form handling in Lift is too cumbersome. I.e. all the
building blocks are there to create great forms, but it takes too much
boilerplate code to achieve a nice result. 

I know forms are not sexy in the ways Comet  Ajax support is, but for
many applications (ours included :-) it's where the major interactions
with the user happens, so a good UX is essential. 

Here's my (ultimate) list of things that should be easy (for the
developer) to do without too much fuzz:

- Provide field level validations - including client side if possible
- Provide form level validations - including client side
- If the form contains Mapper fields, you should not have to respecify
  the validations
- Render fields with proper markup (ie required fields should be indicated)
- When a form is in error, retain values entered by the user
- When a field is in error render it differently (ie red) with field
  specific error
- Provide field level help (inline, popup etc)
- Provide form level help
- All fields and text should support i18n (ie both labels, text and for numeric 
and e.g
  date entries)

I haven't looked closely at the wizard code yet, but it seems like it
does provide some of these benefits. Some possible ideas:

- Could be nice if the wizard code could be extended to generic
  forms. Wizards would just be a special case, with a sequence of forms
  and prev/next buttons etc.
- I would very much like to see validations lifted to a higher level so
  that the same validation rule can be used for Mapper (and Record),
  forms  wizards.
- Fields should be able to emit client side validations and code
- Maybe we could introduce generic form fields (ie Number, Date etc) and
  they could be reused by the Mapper/Record fields. In this way, they
  would all share the same presentation logic (ie i18n formatting for
  display/editing, datepickers, more advanced dialogs etc)
- Much more

Thoughts?

We'll soon be needing much of this in our app, so I'm willing to
participate in this if there's any interest.

/Jeppe

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Improving lift-flot

2009-11-25 Thread Timothy Perrett
David,

Francois is still lurking - if changes are needed, just ping him a mail or IM 
and im sure he'd be happy to fix whatever peter wants.

Cheers, Tim

On 24 Nov 2009, at 23:59, Peter Robinett wrote:

 I'd be happy to but I'd appreciate some advice and guidance.
 
 Peter
 
 On Nov 24, 2:26 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 I'm all for enhancing the flot stuff.
 
 Do I see anyone raising their hand to own the changes?
 
 On Tue, Nov 24, 2009 at 12:57 AM, Jeppe Nejsum Madsen 
 je...@ingolfs.dkwrote:
 
 
 
 Peter Robinett pe...@bubblefoundry.com writes:
 
 I've been working with lift-flot a lot recently and I'd like to share
 some thoughts and suggest some improvements. It's a very useful
 interface to a great Javascript plotting library, so consider these as
 small suggestions from a fan.
 
 I had some of the same concerns as you a while back. I ended up writing
 a wrapper to the JqPlot library instead since it better matched the
 features we needed.
 
 But the inner workings are about the same, so maybe you can use some of
 the ideas. I'm mainly using category plots with name/value pairs.
 
 I have basic structure for a single series:
 
 class CategorySeries[T](val categories : List[T], val values :
 List[Double], val name : Option[String])
 
 And a complete dataset:
 
 class CategoryDataset[T](val series : List[CategorySeries[T]], val name:
 Option[String])
 
 I then defined several different plot types that do the right thing
 with respect to the dataset:
 
 class BarChart[T] (dataset: CategoryDataset[T])
 class StackedBarChart[T] (dataset: CategoryDataset[T])
 class PieChart[T] (dataset: CategoryDataset[T])
 
 etc
 
 I haven't made any partial updates so don't know how well this works
 here :-)
 
 /Jeppe
 
 --
 
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Surf the harmonics
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Timothy Perrett
Guys,

I have some major issues with LiftRules.explicitlyParsedSuffixes - I
just wasted almost a whole day yesterday chasing around what I thought
were bugs in my code but were actually issues with the new suffix
handling. The list of defaults are just wa to narrow. Missing out
standard web formats like pdf, swf and that little know
format .txt ;-) This is causing me all sorts of hard-to-debug issues -
no errors, no warnings etc; just blank screens.

Can I suggest the list of defaults is made much larger and encompasses
all manner of formats and that some warning log messages are added to
Req so that if what you want is not in the list it gives you some note
to that effect. Ones that are obviously missing:

pdf
txt
tif
tiff

Cheers, Tim

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Need for lift application to coexist with spring in the same webapp

2009-11-25 Thread Chris Lewis
Don't forget that if the lift filter is inspecting the request before 
your servlet, you'll need to tell lift to pass it on. In boot:

LiftRules.passNotFoundToChain = true

chris

sunanda wrote:
 Hi David,
 
 Thank for all the help so far.
 
  My lift  application needs to  coexist  with the spring servlet in
 the same web application. I have configured the web.xml file for both
 of the spring servlet and lift filter.
 Hence I need to configure the url pattern in such a way that  /grid/*
 request will be handled by lift application  and  other urls will be
 processed by spring.
 
 
 What I need to understand is how to set up the rules such that this
 can be achieved.
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Derek Chen-Becker
Was that what was preventing your dispatch from working?

On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Guys,

 I have some major issues with LiftRules.explicitlyParsedSuffixes - I
 just wasted almost a whole day yesterday chasing around what I thought
 were bugs in my code but were actually issues with the new suffix
 handling. The list of defaults are just wa to narrow. Missing out
 standard web formats like pdf, swf and that little know
 format .txt ;-) This is causing me all sorts of hard-to-debug issues -
 no errors, no warnings etc; just blank screens.

 Can I suggest the list of defaults is made much larger and encompasses
 all manner of formats and that some warning log messages are added to
 Req so that if what you want is not in the list it gives you some note
 to that effect. Ones that are obviously missing:

 pdf
 txt
 tif
 tiff

 Cheers, Tim

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Timothy Perrett
Yeah :-)

I had not realised that there was this list of approved extensions. I 
actually have a custom mime type and extension in my application and upgrading 
from M6 to SNAPSHOT caused this extremely difficult to debug situation.

As below, some warnings or something like that would really really help.

Cheers, Tim

On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:

 Was that what was preventing your dispatch from working?
 
 On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Guys,
 
 I have some major issues with LiftRules.explicitlyParsedSuffixes - I
 just wasted almost a whole day yesterday chasing around what I thought
 were bugs in my code but were actually issues with the new suffix
 handling. The list of defaults are just wa to narrow. Missing out
 standard web formats like pdf, swf and that little know
 format .txt ;-) This is causing me all sorts of hard-to-debug issues -
 no errors, no warnings etc; just blank screens.
 
 Can I suggest the list of defaults is made much larger and encompasses
 all manner of formats and that some warning log messages are added to
 Req so that if what you want is not in the list it gives you some note
 to that effect. Ones that are obviously missing:
 
 pdf
 txt
 tif
 tiff
 
 Cheers, Tim
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Derek Chen-Becker
I would agree. In general I would lean toward being overly verbose about
what's happening in Lift when in dev mode.

On Wed, Nov 25, 2009 at 6:49 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Yeah :-)

 I had not realised that there was this list of approved extensions. I
 actually have a custom mime type and extension in my application and
 upgrading from M6 to SNAPSHOT caused this extremely difficult to debug
 situation.

 As below, some warnings or something like that would really really help.

 Cheers, Tim

 On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:

  Was that what was preventing your dispatch from working?
 
  On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett 
 timo...@getintheloop.eu wrote:
  Guys,
 
  I have some major issues with LiftRules.explicitlyParsedSuffixes - I
  just wasted almost a whole day yesterday chasing around what I thought
  were bugs in my code but were actually issues with the new suffix
  handling. The list of defaults are just wa to narrow. Missing out
  standard web formats like pdf, swf and that little know
  format .txt ;-) This is causing me all sorts of hard-to-debug issues -
  no errors, no warnings etc; just blank screens.
 
  Can I suggest the list of defaults is made much larger and encompasses
  all manner of formats and that some warning log messages are added to
  Req so that if what you want is not in the list it gives you some note
  to that effect. Ones that are obviously missing:
 
  pdf
  txt
  tif
  tiff
 
  Cheers, Tim
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Is there a togglable ajax button in lift?

2009-11-25 Thread Derek Chen-Becker
I haven't tried it, but I'm pretty sure that if you give the button an id
you should be able to fire the text change from the AJAX handler. Something
like:

import net.liftweb.http.js._
import JE._

SHtml.ajaxButton(Click me!, () = { doSomethingServerSide();
JsCmds.SetElemById(myButton, Click me again!, innerHtml)}, id -
myButton)

That's off the top of my head, so let me know if that doesn't work.

Derek

On Tue, Nov 24, 2009 at 4:23 PM, Jonathan Ferguson j...@spiralarm.comwrote:

 I've looked through the API and couldn't find anything that seemed
 suitable.

 We need an ajax button that when clicked will fire an event to the server
 and then toggle the button text. This could be by having two different
 buttons and only showing one.

 Cheers
 Jono

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.


--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread David Pollak
I'm not overly keen on the whitelist stuff.  Someone's going to get cranky
about it.

I'm open to either adding a whole lot more to the white list or saying that
everything  n characters (e.g., 5) is a suffix unless it's on a blacklist.

On Wed, Nov 25, 2009 at 5:49 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Yeah :-)

 I had not realised that there was this list of approved extensions. I
 actually have a custom mime type and extension in my application and
 upgrading from M6 to SNAPSHOT caused this extremely difficult to debug
 situation.

 As below, some warnings or something like that would really really help.

 Cheers, Tim

 On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:

  Was that what was preventing your dispatch from working?
 
  On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett 
 timo...@getintheloop.eu wrote:
  Guys,
 
  I have some major issues with LiftRules.explicitlyParsedSuffixes - I
  just wasted almost a whole day yesterday chasing around what I thought
  were bugs in my code but were actually issues with the new suffix
  handling. The list of defaults are just wa to narrow. Missing out
  standard web formats like pdf, swf and that little know
  format .txt ;-) This is causing me all sorts of hard-to-debug issues -
  no errors, no warnings etc; just blank screens.
 
  Can I suggest the list of defaults is made much larger and encompasses
  all manner of formats and that some warning log messages are added to
  Req so that if what you want is not in the list it gives you some note
  to that effect. Ones that are obviously missing:
 
  pdf
  txt
  tif
  tiff
 
  Cheers, Tim
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.





-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Timothy Perrett
Agreed - I work with lift every day and this was a new one on me!

I think adding a whole raft of common types would be the simplest way  
to go an be quickest to implement. If memory serves there is a fairly  
comprehensive list on IANA (or some similar acronym) that we could  
grab and implement - thoughts?

Cheers, Tim

Sent from my iPhone

On 25 Nov 2009, at 15:34, David Pollak feeder.of.the.be...@gmail.com  
wrote:

 I'm not overly keen on the whitelist stuff.  Someone's going to get  
 cranky about it.

 I'm open to either adding a whole lot more to the white list or  
 saying that everything  n characters (e.g., 5) is a suffix unless  
 it's on a blacklist.

 On Wed, Nov 25, 2009 at 5:49 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
 Yeah :-)

 I had not realised that there was this list of approved  
 extensions. I actually have a custom mime type and extension in my  
 application and upgrading from M6 to SNAPSHOT caused this extremely  
 difficult to debug situation.

 As below, some warnings or something like that would really really  
 help.

 Cheers, Tim

 On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:

  Was that what was preventing your dispatch from working?
 
  On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
  Guys,
 
  I have some major issues with LiftRules.explicitlyParsedSuffixes - I
  just wasted almost a whole day yesterday chasing around what I  
 thought
  were bugs in my code but were actually issues with the new suffix
  handling. The list of defaults are just wa to narrow. Missing  
 out
  standard web formats like pdf, swf and that little know
  format .txt ;-) This is causing me all sorts of hard-to-debug  
 issues -
  no errors, no warnings etc; just blank screens.
 
  Can I suggest the list of defaults is made much larger and  
 encompasses
  all manner of formats and that some warning log messages are added  
 to
  Req so that if what you want is not in the list it gives you some  
 note
  to that effect. Ones that are obviously missing:
 
  pdf
  txt
  tif
  tiff
 
  Cheers, Tim
 
  --
 
  You received this message because you are subscribed to the Google  
 Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com 
 .
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=en 
 .
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google  
 Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com 
 .
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=en 
 .

 --

 You received this message because you are subscribed to the Google  
 Groups Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com 
 .
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en 
 .





 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Surf the harmonics
 --

 You received this message because you are subscribed to the Google  
 Groups Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com 
 .
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en 
 .

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] partialUpdate

2009-11-25 Thread jack
I have the following method in a CometActor

override def highPriority = {
case Tick(page) = {
  pages = processPages(pages,page)
  reRender(false)
}
  }

where pages is a list of Page objects.

How do I make this into a partialUpdate. I looked at the chat example
but do not see how to do it in this case.

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread David Pollak
On Wed, Nov 25, 2009 at 7:59 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Agreed - I work with lift every day and this was a new one on me!

 I think adding a whole raft of common types would be the simplest way to go
 an be quickest to implement. If memory serves there is a fairly
 comprehensive list on IANA (or some similar acronym) that we could grab and
 implement - thoughts?


Sounds good.  I'd rather see a fix sooner rather than later.  Can you open a
ticket?  Can you own the ticket?



 Cheers, Tim

 Sent from my iPhone

 On 25 Nov 2009, at 15:34, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 I'm not overly keen on the whitelist stuff.  Someone's going to get cranky
 about it.

 I'm open to either adding a whole lot more to the white list or saying that
 everything  n characters (e.g., 5) is a suffix unless it's on a blacklist.

 On Wed, Nov 25, 2009 at 5:49 AM, Timothy Perrett timo...@getintheloop.eu
 timo...@getintheloop.eu wrote:

 Yeah :-)

 I had not realised that there was this list of approved extensions. I
 actually have a custom mime type and extension in my application and
 upgrading from M6 to SNAPSHOT caused this extremely difficult to debug
 situation.

 As below, some warnings or something like that would really really help.

 Cheers, Tim

 On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:

  Was that what was preventing your dispatch from working?
 
  On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett timo...@getintheloop.eu
 timo...@getintheloop.eu wrote:
  Guys,
 
  I have some major issues with LiftRules.explicitlyParsedSuffixes - I
  just wasted almost a whole day yesterday chasing around what I thought
  were bugs in my code but were actually issues with the new suffix
  handling. The list of defaults are just wa to narrow. Missing out
  standard web formats like pdf, swf and that little know
  format .txt ;-) This is causing me all sorts of hard-to-debug issues -
  no errors, no warnings etc; just blank screens.
 
  Can I suggest the list of defaults is made much larger and encompasses
  all manner of formats and that some warning log messages are added to
  Req so that if what you want is not in the list it gives you some note
  to that effect. Ones that are obviously missing:
 
  pdf
  txt
  tif
  tiff
 
  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
 lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb%2bunsubscr...@googlegroups.com
 liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
  --
 
  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
 lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb%2bunsubscr...@googlegroups.com
 liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en
 http://groups.google.com/group/liftweb?hl=en.

 --

 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
 lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb%2bunsubscr...@googlegroups.com
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en
 http://groups.google.com/group/liftweb?hl=en.





 --
 Lift, the simply functional web framework http://liftweb.net
 http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpphttp://twitter.com/dpp
 Surf the harmonics

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

  --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send 

Re: [Lift] Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Timothy Perrett
Im all over it.  I'll have a fix on review board within the hour.

Cheers, Tim

On 25 Nov 2009, at 17:09, David Pollak wrote:

 
 
 On Wed, Nov 25, 2009 at 7:59 AM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Agreed - I work with lift every day and this was a new one on me!
 
 I think adding a whole raft of common types would be the simplest way to go 
 an be quickest to implement. If memory serves there is a fairly comprehensive 
 list on IANA (or some similar acronym) that we could grab and implement - 
 thoughts?
 
 Sounds good.  I'd rather see a fix sooner rather than later.  Can you open a 
 ticket?  Can you own the ticket?
  
 
 Cheers, Tim
 
 Sent from my iPhone
 
 On 25 Nov 2009, at 15:34, David Pollak feeder.of.the.be...@gmail.com wrote:
 
 I'm not overly keen on the whitelist stuff.  Someone's going to get cranky 
 about it.
 
 I'm open to either adding a whole lot more to the white list or saying that 
 everything  n characters (e.g., 5) is a suffix unless it's on a blacklist.
 
 On Wed, Nov 25, 2009 at 5:49 AM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Yeah :-)
 
 I had not realised that there was this list of approved extensions. I 
 actually have a custom mime type and extension in my application and 
 upgrading from M6 to SNAPSHOT caused this extremely difficult to debug 
 situation.
 
 As below, some warnings or something like that would really really help.
 
 Cheers, Tim
 
 On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:
 
  Was that what was preventing your dispatch from working?
 
  On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
  Guys,
 
  I have some major issues with LiftRules.explicitlyParsedSuffixes - I
  just wasted almost a whole day yesterday chasing around what I thought
  were bugs in my code but were actually issues with the new suffix
  handling. The list of defaults are just wa to narrow. Missing out
  standard web formats like pdf, swf and that little know
  format .txt ;-) This is causing me all sorts of hard-to-debug issues -
  no errors, no warnings etc; just blank screens.
 
  Can I suggest the list of defaults is made much larger and encompasses
  all manner of formats and that some warning log messages are added to
  Req so that if what you want is not in the list it gives you some note
  to that effect. Ones that are obviously missing:
 
  pdf
  txt
  tif
  tiff
 
  Cheers, Tim
 
  --
 
  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=en.
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
 
 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Surf the harmonics
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Surf the harmonics
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To 

[Lift] Re: Beef with LiftRules.explicitlyParsedSuffixes

2009-11-25 Thread Timothy Perrett
As promised:

http://reviewboard.liftweb.net/r/126/

These 447 extension types should cover mode dispatch use cases. Custom
extensions / mime types will still need to add to the list, but this
is alright IMHO. Your thoughts please!

Cheers, Tim

On Nov 25, 5:39 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Im all over it.  I'll have a fix on review board within the hour.

 Cheers, Tim

 On 25 Nov 2009, at 17:09, David Pollak wrote:





  On Wed, Nov 25, 2009 at 7:59 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
  Agreed - I work with lift every day and this was a new one on me!

  I think adding a whole raft of common types would be the simplest way to go 
  an be quickest to implement. If memory serves there is a fairly 
  comprehensive list on IANA (or some similar acronym) that we could grab and 
  implement - thoughts?

  Sounds good.  I'd rather see a fix sooner rather than later.  Can you open 
  a ticket?  Can you own the ticket?

  Cheers, Tim

  Sent from my iPhone

  On 25 Nov 2009, at 15:34, David Pollak feeder.of.the.be...@gmail.com 
  wrote:

  I'm not overly keen on the whitelist stuff.  Someone's going to get cranky 
  about it.

  I'm open to either adding a whole lot more to the white list or saying 
  that everything  n characters (e.g., 5) is a suffix unless it's on a 
  blacklist.

  On Wed, Nov 25, 2009 at 5:49 AM, Timothy Perrett timo...@getintheloop.eu 
  wrote:
  Yeah :-)

  I had not realised that there was this list of approved extensions. I 
  actually have a custom mime type and extension in my application and 
  upgrading from M6 to SNAPSHOT caused this extremely difficult to debug 
  situation.

  As below, some warnings or something like that would really really help.

  Cheers, Tim

  On 25 Nov 2009, at 13:35, Derek Chen-Becker wrote:

   Was that what was preventing your dispatch from working?

   On Wed, Nov 25, 2009 at 4:43 AM, Timothy Perrett 
   timo...@getintheloop.eu wrote:
   Guys,

   I have some major issues with LiftRules.explicitlyParsedSuffixes - I
   just wasted almost a whole day yesterday chasing around what I thought
   were bugs in my code but were actually issues with the new suffix
   handling. The list of defaults are just wa to narrow. Missing out
   standard web formats like pdf, swf and that little know
   format .txt ;-) This is causing me all sorts of hard-to-debug issues -
   no errors, no warnings etc; just blank screens.

   Can I suggest the list of defaults is made much larger and encompasses
   all manner of formats and that some warning log messages are added to
   Req so that if what you want is not in the list it gives you some note
   to that effect. Ones that are obviously missing:

   pdf
   txt
   tif
   tiff

   Cheers, Tim

   --

   You received this message because you are subscribed to the Google 
   Groups Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to 
   liftweb+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/liftweb?hl=en.

   --

   You received this message because you are subscribed to the Google 
   Groups Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to 
   liftweb+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/liftweb?hl=en.

  --

  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/liftweb?hl=en.

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics

  --

  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/liftweb?hl=en.

  --

  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/liftweb?hl=en.

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics

  --

  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to 

[Lift] Re: Newbie Question: Problems compiling/running examples

2009-11-25 Thread Jcon
Thanks for the quick response.  I'm still having the same error after
trying the following:

1. upgrade to maven 2.2 as suggested
2. ran 'mvn install' in the lift-examples directory again.  Same error
(tests failing, although I think the root cause is actually
ClassNotFoundException bootstrap.liftweb.Boot)
3. deleted my local .m2/repository just for kicks and reran.  Same
error (tests failing)
4. ran 'git pull' and did get some changes.  Reran mvn install and get
the same error.

I'm guessing, but it seems the root cause is not really a bad test,
but:

   java.lang.ClassNotFoundException: bootstrap.liftweb.Boot

That is the same error I see if I skip the tests and just run jetty
with 'mvn jetty:run -DskipTests'


To provide a little more info, here's the (horribly verbose) maven
output:

[INFO] [enforcer:enforce {execution: default-enforce}]
[INFO] [scala:compile {execution: scala-compile}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[WARNING] No source files found.
[INFO] [scala:testCompile {execution: scala-testCompile}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[WARNING] No source files found.
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [source:jar-no-fork {execution: default}]
[INFO] [changes:changes-validate {execution: default-changes-
validate}]
[WARNING] changes.xml file /Users/JoelC/work/projects/lift/liftweb/
lift-examples/src/changes/changes.xml does not exist.
[INFO] [install:install {execution: default-install}]
[INFO] Installing /Users/JoelC/work/projects/lift/liftweb/lift-
examples/pom.xml to /Users/JoelC/.m2/repository/net/liftweb/lift-
examples-parent/1.1-SNAPSHOT/lift-examples-parent-1.1-SNAPSHOT.pom
[INFO]

[INFO] Building Lift Example
[INFO]task-segment: [install]
[INFO]

[INFO] [enforcer:enforce {execution: default-enforce}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/JoelC/work/projects/
lift/liftweb/lift-examples/example/src/main/resources
[INFO] [scala:compile {execution: scala-compile}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] Compiling 0 source files to /Users/JoelC/work/projects/lift/
liftweb/lift-examples/example/target/classes
[INFO] Nothing to compile - all classes are up to date
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/JoelC/work/projects/
lift/liftweb/lift-examples/example/src/test/resources
[INFO] [scala:testCompile {execution: scala-testCompile}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] Compiling 0 source files to /Users/JoelC/work/projects/lift/
liftweb/lift-examples/example/target/test-classes
[INFO] Nothing to compile - all classes are up to date
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /Users/JoelC/work/projects/lift/
liftweb/lift-examples/example/target/surefire-reports

---
 T E S T S
---
Running webapptest.WikiUsagesTest
2009-11-25 13:29:17.654::INFO:  Logging to STDERR via
org.mortbay.log.StdErrLog
2009-11-25 13:29:17.697::INFO:  jetty-6.1.18
2009-11-25 13:29:17.903::INFO:  NO JSP Support for /, did not find
org.apache.jasper.servlet.JspServlet
ERROR - Failed to Boot
java.lang.ClassNotFoundException: bootstrap.liftweb.Boot
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1196)
at net.liftweb.http.provider.HTTPProvider$class.bootLift
(HTTPProvider.scala:70)
at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:516)
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init

[Lift] lift-json question related to Lists of things

2009-11-25 Thread harryh
consider:

case class Foo(id: Int, bars: List[Bar])
case class Bar(id: Int)

val foo = json.extract[Foo]

The following json will cause a problem:

{
  id: 12
}

This can be fixed by changing bars to an Option[List[Bar]].  Should
that really be necessary though?  Can't bars just be an empty list if
there are none of them?

-harryh

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Validations

2009-11-25 Thread suls
Hi guys,

It seems that I don't completely understand how validations work.. I
am having a model with the following property:

object size extends MappedInt(this) {
override def validations =  validPosition _ :: super.validations

def validPosition(in: Int): List[FieldError] =
  if (-100 until 101 contains in) Nil
  else List(FieldError(this, bPosition size must not be greater
than +/- 100/b))
  }

And in the snippet I do the following:

pos.validate match {
  case Nil = pos.save; S.notice(Position change 
 + pos.size +  for 
 + pos.dateOf.asHtml +  successful.)

  case xs = S.error(xs); Log.error(. + xs)
}

Now something I cannot explain to myself happens: If the validation
fails, the error gets logged on the console but not displayed in the
browser:

ERROR - .List(Full(position_size) : bPosition size must not be
greater than +/- 100/b)

Am I getting something wrong with how validations work?

Cheers, suls

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Validations

2009-11-25 Thread David Pollak
On Wed, Nov 25, 2009 at 11:52 AM, suls s...@suls.org wrote:

 Hi guys,

 It seems that I don't completely understand how validations work.. I
 am having a model with the following property:

 object size extends MappedInt(this) {
override def validations =  validPosition _ :: super.validations

def validPosition(in: Int): List[FieldError] =
  if (-100 until 101 contains in) Nil
  else List(FieldError(this, bPosition size must not be greater
 than +/- 100/b))
  }

 And in the snippet I do the following:

 pos.validate match {
  case Nil = pos.save; S.notice(Position change 
 + pos.size +  for 
 + pos.dateOf.asHtml +  successful.)

  case xs = S.error(xs); Log.error(. + xs)
}

 Now something I cannot explain to myself happens: If the validation
 fails, the error gets logged on the console but not displayed in the
 browser:

 ERROR - .List(Full(position_size) : bPosition size must not be
 greater than +/- 100/b)

 Am I getting something wrong with how validations work?


In your default template (templates-hidden/default.html) change lift:Msgs
/ to lift:Msgs showAll=true/

A few months back, we changed MappedFields to having a field identifier.
 The default Msgs does not render error messages on fields with a field
identifier set.



 Cheers, suls

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.





-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: lift-json question related to Lists of things

2009-11-25 Thread Joni Freeman
Hi,

Totally agreed, this makes List extraction more robust. The change is
in reviewboard now:

http://reviewboard.liftweb.net/r/127/

Cheers Joni

On 25 marras, 20:42, harryh har...@gmail.com wrote:
 consider:

 case class Foo(id: Int, bars: List[Bar])
 case class Bar(id: Int)

 val foo = json.extract[Foo]

 The following json will cause a problem:

 {
   id: 12

 }

 This can be fixed by changing bars to an Option[List[Bar]].  Should
 that really be necessary though?  Can't bars just be an empty list if
 there are none of them?

 -harryh

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: how does lift work with redis?

2009-11-25 Thread surfman
Thanks. Does it mean I may not use lift mapper and I have to write
everything for database manipulation?

regards,

surfman


On 11月24日, 下午5时12分, Timothy Perrett timo...@getintheloop.eu wrote:
 There is no out of the box implementation. You could write a record  
 back end though - it depends on the features you want I guess.

 Cheers, Tim

 Sent from my iPhone

 On 24 Nov 2009, at 22:00, surfman chinasmile...@gmail.com wrote:



  Is there anything I could learn on how lift works with redis database?
  Thanks.

  --

  You received this message because you are subscribed to the Google  
  Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com
  .
  For more options, visit this group 
  athttp://groups.google.com/group/liftweb?hl=en
  .- 隐藏被引用文字 -

 - 显示引用的文字 -

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: partialUpdate

2009-11-25 Thread jack
Just to clarify: the render function takes the list 'pages' and
transforms it into HTML.

On Nov 25, 11:25 am, jack jack.wid...@gmail.com wrote:
 I have the following method in a CometActor

 override def highPriority = {
     case Tick(page) = {
       pages = processPages(pages,page)
       reRender(false)
     }
   }

 where pages is a list of Page objects.

 How do I make this into a partialUpdate. I looked at the chat example
 but do not see how to do it in this case.

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: how does lift work with redis?

2009-11-25 Thread Tim Nelson
I haven't used redis at all but it looks like they have a jdbc driver that
you might be able to use with mapper. It doesn't support all jdbc
functionality but it might work well enough for your needs.

If that doesn't work you could either use the jredis java client code
directly inside lift or use the record framework which is meant to be a
mapper like framework for generic (ie nosql ) dbs. It, however, requires a
back end implementation for each db system. Currently there is no back-end
implementation for redis, so one would need to be written for it.

Tim

On Wed, Nov 25, 2009 at 2:13 PM, surfman chinasmile...@gmail.com wrote:

 Thanks. Does it mean I may not use lift mapper and I have to write
 everything for database manipulation?

 regards,

 surfman


 On 11月24日, 下午5时12分, Timothy Perrett timo...@getintheloop.eu wrote:
  There is no out of the box implementation. You could write a record
  back end though - it depends on the features you want I guess.
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 24 Nov 2009, at 22:00, surfman chinasmile...@gmail.com wrote:
 
 
 
   Is there anything I could learn on how lift works with redis database?
   Thanks.
 
   --
 
   You received this message because you are subscribed to the Google
   Groups Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
   .
   For more options, visit this group athttp://
 groups.google.com/group/liftweb?hl=en
   .- 隐藏被引用文字 -
 
  - 显示引用的文字 -

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: how does lift work with redis?

2009-11-25 Thread Timothy Perrett
Correct - Redis is a nosql database, mapper is only for RDBMS

Cheers, Tim

On 25 Nov 2009, at 20:13, surfman wrote:

 Thanks. Does it mean I may not use lift mapper and I have to write
 everything for database manipulation?
 
 regards,
 
 surfman
 
 
 On 11月24日, 下午5时12分, Timothy Perrett timo...@getintheloop.eu wrote:
 There is no out of the box implementation. You could write a record  
 back end though - it depends on the features you want I guess.
 
 Cheers, Tim
 
 Sent from my iPhone
 
 On 24 Nov 2009, at 22:00, surfman chinasmile...@gmail.com wrote:
 
 
 
 Is there anything I could learn on how lift works with redis database?
 Thanks.
 
 --
 
 You received this message because you are subscribed to the Google  
 Groups Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com
 .
 For more options, visit this group 
 athttp://groups.google.com/group/liftweb?hl=en
 .- 隐藏被引用文字 -
 
 - 显示引用的文字 -
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: Strip ?xml ? header from a subset of pages

2009-11-25 Thread harryh
It is not 100% obvious to me how I would, after this change is
submitted, avoid sending an ?xml? header when serving pages under a
certain path.

Should we be adding something similar to S.skipDocType
(S.skipXmlHeader)?

-harryh

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Is there a togglable ajax button in lift?

2009-11-25 Thread Jonathan Ferguson
Will have a look over the next few days.

Thanks you very much.

Jono

2009/11/26 Derek Chen-Becker dchenbec...@gmail.com

 I haven't tried it, but I'm pretty sure that if you give the button an id
 you should be able to fire the text change from the AJAX handler. Something
 like:

 import net.liftweb.http.js._
 import JE._

 SHtml.ajaxButton(Click me!, () = { doSomethingServerSide();
 JsCmds.SetElemById(myButton, Click me again!, innerHtml)}, id -
 myButton)

 That's off the top of my head, so let me know if that doesn't work.

 Derek

 On Tue, Nov 24, 2009 at 4:23 PM, Jonathan Ferguson j...@spiralarm.comwrote:

 I've looked through the API and couldn't find anything that seemed
 suitable.

 We need an ajax button that when clicked will fire an event to the server
 and then toggle the button text. This could be by having two different
 buttons and only showing one.

 Cheers
 Jono

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.


--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Strip ?xml ? header from a subset of pages

2009-11-25 Thread David Pollak
object excludeXmlHeaderStuff extends RequestVar(false)

in boot:

val current = LiftRules.calculateXmlHeader
LiftRules.calculateXmlHeader = (resp, node, contentType) = if
(excludeXmlHeaderStuff)  else current(resp, node, contentType)



On Wed, Nov 25, 2009 at 2:09 PM, harryh har...@gmail.com wrote:

 It is not 100% obvious to me how I would, after this change is
 submitted, avoid sending an ?xml? header when serving pages under a
 certain path.

 Should we be adding something similar to S.skipDocType
 (S.skipXmlHeader)?

 -harryh

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.





-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Derek Chen-Becker
I don't think that that should be happening, but I would need to see the
code for PersonSnippets to really see what's going on.

Derek

On Wed, Nov 25, 2009 at 4:16 PM, Jim Barrows jim.barr...@gmail.com wrote:

 I'm using JPA, and need to do a One-Many, or master detail view.  So I
 tried the obvious:
 lift:PersonSnippets.save form=post
 !-- form --
  /lift:PersonSnippets.save
 lift:PersonSnippets.addContactMechanism form=post
 /lift:PersonSnippets.addContactMechanism

 However, the HTML that gets generated is the same form for both.
 Is there an example somewhere I've missed about how to do this?
 --
 James A Barrows

  --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.


--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Jim Barrows
package com.nsfw.snippet

import _root_.net.liftweb._
import common.{Empty, Full, Box}
import sitemap.{Loc}
import http._
import js.{JsCmd, JsCmds}
 import JsCmds._
import S._
import SHtml._
import util._
import Helpers._

import _root_.javax.persistence.{EntityExistsException,
PersistenceException}

import com.nsfw.model.Model
import xml.{Group, NodeSeq, Text}
import com.nsfw.bmp.partymodel.party.{PartyContactMechanism, Person}

class PersonSnippets {

  object personVar extends RequestVar(new Person())
  def person = personVar.is

  object partyContactMechanismVar extends RequestVar( new
PartyContactMechanism())
  def partyContactMechanism = partyContactMechanismVar.is

  def addContactMechanism (html: Group) : NodeSeq = {
var comment : String = 
bind(contactMechanism, html,
  comment - Text(partyContactMechanism.getComment()))
  }

  def list(xhtml: NodeSeq): NodeSeq = {

val people =
Model.createNamedQuery[Person](findAllPeople).getResultList()

people.flatMap(person =
bind(person, xhtml,
  firstName - Text(person.getFirstName()),
  middleName - Text(person.getMiddleName()),
  lastName - Text(person.getLastName()),
  edit - SHtml.link(/contact/person/edit.html, () =
personVar(person), Text(?(Edit))),
  delete - SHtml.link(/contact/person/delete.html, () =
personVar(person), Text(?(Delete)))
  ))
  }

  def form = {
lift:PersonSnippets.save form=post
person:id/
person:version/
  div class=span-3
label for=firstName
  lift:locFirst Name/lift:loc
/label
  /div
  div class=span-21 last
  person:firstName/
  /div
  div class=span-3
label for=middleName
  lift:locMiddle Name/lift:loc
/label
  /div
  div class=span-21 last
  person:middleName/
  /div
  div class=span-3
label for=lastName
  lift:locLast Name/lift:loc
/label
  /div
  div class=span-21 last
  person:lastName/
  /div
  div class=span-24
  person:submit/
  /div
/lift:PersonSnippets.save
  }

  def save(xhtml: NodeSeq): NodeSeq = {

bindPerson(xhtml, doSave, Save, false)
  }

  def delete(xhtml: NodeSeq): NodeSeq = {

bindPerson(xhtml, doDelete, Delete, true)

  }

  def doSave() = {

try {
  val name = person.getFirstName() +   + person.getLastName()
  Model.mergeAndFlush(person)
  notice(Saved  + name)
  redirectTo(/contact/list.html)
} catch {
  case ee: EntityExistsException = error(Person already exists)
  case pe: PersistenceException = error(Error adding person);
Log.error(Error adding person, pe)
}

  }

  def doDelete() = {
try {
  var mergedPerson = Model.mergeAndFlush(person);
  val name = mergedPerson.getFirstName() +   +
mergedPerson.getLastName()
  Model.removeAndFlush(mergedPerson);

  notice(Deleted  + name)
  redirectTo(/contact/list.html)
} catch {
  case pe: PersistenceException = error(Error removing person);
Log.error(Error removing person, pe);
}
  }


  def bindPerson(xhtml: NodeSeq, action: () = Unit, submitButtonName:
String, disableAll: boolean): NodeSeq = {
// Hold a val here so that the id closure holds it when we re-enter
this method
val currentId = person.getId()
val currentVersion = person.getVersion()

val disableAttr: Box[String] = if (disableAll) Full(disabled) else
Empty

bind(person, xhtml,
  id - SHtml.hidden(() = person.setId(currentId)),
  version - SHtml.hidden(() = person.setVersion(currentVersion)),
  firstName - (SHtml.text(person.getFirstName(),
person.setFirstName(_)) % (id - firstName) % (readonly -
disableAttr)),
  middleName - (SHtml.text(person.getMiddleName(),
person.setMiddleName(_)) % (id - middleName) % (readonly -
disableAttr)),
  lastName - (SHtml.text(person.getLastName(), person.setLastName(_))
% (id - lastName) % (readonly - disableAttr)),
  submit - SHtml.submit(?(submitButtonName), action))
  }

}

On Wed, Nov 25, 2009 at 4:21 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 I don't think that that should be happening, but I would need to see the
 code for PersonSnippets to really see what's going on.

 Derek

 On Wed, Nov 25, 2009 at 4:16 PM, Jim Barrows jim.barr...@gmail.comwrote:

 I'm using JPA, and need to do a One-Many, or master detail view.  So I
 tried the obvious:
 lift:PersonSnippets.save form=post
 !-- form --
  /lift:PersonSnippets.save
 lift:PersonSnippets.addContactMechanism form=post
 /lift:PersonSnippets.addContactMechanism

 However, the HTML that gets generated is the same form for both.
 Is there an example somewhere I've missed about how to do this?
 --
 James A Barrows

  --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, 

Re: [Lift] Re: Strip ?xml ? header from a subset of pages

2009-11-25 Thread Timothy Perrett
David,

I read harry's other email with interest - and thinking about it, it seems this 
style of implementation differs quite significantly from S.skipDocType. It 
strikes me that a LiftRules configuration is our usual idiom; is there a reason 
that S.skipDocType falls out of this? 

One way or another I think we ought to make these API's similar as they are 
fairly close in terms of likely use cases. 

Cheers, Tim

On 25 Nov 2009, at 23:18, David Pollak wrote:

 object excludeXmlHeaderStuff extends RequestVar(false)
 
 in boot:
 
 val current = LiftRules.calculateXmlHeader
 LiftRules.calculateXmlHeader = (resp, node, contentType) = if 
 (excludeXmlHeaderStuff)  else current(resp, node, contentType)
 
 
 
 On Wed, Nov 25, 2009 at 2:09 PM, harryh har...@gmail.com wrote:
 It is not 100% obvious to me how I would, after this change is
 submitted, avoid sending an ?xml? header when serving pages under a
 certain path.
 
 Should we be adding something similar to S.skipDocType
 (S.skipXmlHeader)?
 
 -harryh
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
 
 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Surf the harmonics
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Timothy Perrett
Lift does not use markup like that - there is no magic mapping between 
persistence and view. 

You would most likly have to construct the appropriate master - detail code in 
your snippets and work like that. 

Cheers, Tim

On 25 Nov 2009, at 23:16, Jim Barrows wrote:

 I'm using JPA, and need to do a One-Many, or master detail view.  So I tried 
 the obvious:
 lift:PersonSnippets.save form=post
 !-- form --
  /lift:PersonSnippets.save
 lift:PersonSnippets.addContactMechanism form=post
 /lift:PersonSnippets.addContactMechanism
 
 However, the HTML that gets generated is the same form for both.  
 Is there an example somewhere I've missed about how to do this?
 -- 
 James A Barrows
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: Strip ?xml ? header from a subset of pages

2009-11-25 Thread David Pollak
I'm not opposed to adding a skipXmlThingy style as well, but giving the
developer a generic function for inserting this XML top-matter is the higher
priority.

On Wed, Nov 25, 2009 at 3:24 PM, Timothy Perrett timo...@getintheloop.euwrote:

 David,

 I read harry's other email with interest - and thinking about it, it seems
 this style of implementation differs quite significantly from S.skipDocType.
 It strikes me that a LiftRules configuration is our usual idiom; is there a
 reason that S.skipDocType falls out of this?

 One way or another I think we ought to make these API's similar as they are
 fairly close in terms of likely use cases.

 Cheers, Tim

 On 25 Nov 2009, at 23:18, David Pollak wrote:

  object excludeXmlHeaderStuff extends RequestVar(false)
 
  in boot:
 
  val current = LiftRules.calculateXmlHeader
  LiftRules.calculateXmlHeader = (resp, node, contentType) = if
 (excludeXmlHeaderStuff)  else current(resp, node, contentType)
 
 
 
  On Wed, Nov 25, 2009 at 2:09 PM, harryh har...@gmail.com wrote:
  It is not 100% obvious to me how I would, after this change is
  submitted, avoid sending an ?xml? header when serving pages under a
  certain path.
 
  Should we be adding something similar to S.skipDocType
  (S.skipXmlHeader)?
 
  -harryh
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Surf the harmonics
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.





-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Jim Barrows
On Wed, Nov 25, 2009 at 4:26 PM, Timothy Perrett timo...@getintheloop.euwrote:

 Lift does not use markup like that - there is no magic mapping between
 persistence and view.

 You would most likly have to construct the appropriate master - detail
 code in your snippets and work like that.



That's what I was trying to do.  There's a list of contact mechanisms
attached to each person.  I was going to use the second form to add the
contact mechanism to the person.




 Cheers, Tim

 On 25 Nov 2009, at 23:16, Jim Barrows wrote:

  I'm using JPA, and need to do a One-Many, or master detail view.  So I
 tried the obvious:
  lift:PersonSnippets.save form=post
  !-- form --
   /lift:PersonSnippets.save
  lift:PersonSnippets.addContactMechanism form=post
  /lift:PersonSnippets.addContactMechanism
 
  However, the HTML that gets generated is the same form for both.
  Is there an example somewhere I've missed about how to do this?
  --
  James A Barrows
 
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.





-- 
James A Barrows

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Derek Chen-Becker
That markup should be in a template file somewhere, which would then call
the snippets appropriately. I don't see markup for a second form, but I
might just be missing it.

A couple of other notes:


   - Generally, on links, omit the suffix and Lift will then do I18N lookup
   for you as needed. That means use /contact/person/edit instead of
   /contact/person/edit.html
   - When you're deleting in JPA, there's no need to do a merge first. Just
   obtain a reference instead and delete that. It's more efficient. Your code
   would look like:

  def doDelete() = {
try {
  Model.removeAndFlush(Model.getReference(classOf[Person],
person.getId());

  notice(Deleted  + person.getFirstName() +   +
person.getLastName())
  redirectTo(/contact/list)
} catch {
  case pe: PersistenceException = error(Error removing person);
Log.error(Error removing person, pe);
}
  }


On Wed, Nov 25, 2009 at 4:26 PM, Timothy Perrett timo...@getintheloop.euwrote:

 Lift does not use markup like that - there is no magic mapping between
 persistence and view.

 You would most likly have to construct the appropriate master - detail
 code in your snippets and work like that.

 Cheers, Tim

 On 25 Nov 2009, at 23:16, Jim Barrows wrote:

  I'm using JPA, and need to do a One-Many, or master detail view.  So I
 tried the obvious:
  lift:PersonSnippets.save form=post
  !-- form --
   /lift:PersonSnippets.save
  lift:PersonSnippets.addContactMechanism form=post
  /lift:PersonSnippets.addContactMechanism
 
  However, the HTML that gets generated is the same form for both.
  Is there an example somewhere I've missed about how to do this?
  --
  James A Barrows
 
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: Need for lift application to coexist with spring in the same webapp

2009-11-25 Thread sunanda
Many Many thanks to David and Chris.
Your suggestions helped me a lot and I am now able to run  my
application using both  Lift Filter and Spring Servlet .
Regards,
Sunanda.

On Nov 25, 11:35 pm, Chris Lewis burningodzi...@gmail.com wrote:
 Don't forget that if the lift filter is inspecting the request before
 your servlet, you'll need to tell lift to pass it on. In boot:

 LiftRules.passNotFoundToChain = true

 chris



 sunandawrote:
  Hi David,

  Thank for all the help so far.

   My lift  application needs to  coexist  with the spring servlet in
  the same web application. I have configured the web.xml file for both
  of the spring servlet and lift filter.
  Hence I need to configure the url pattern in such a way that  /grid/*
  request will be handled by lift application  and  other urls will be
  processed by spring.

  What I need to understand is how to set up the rules such that this
  can be achieved.

  --

  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/liftweb?hl=en.- Hide quoted text -

 - Show quoted text -

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Jim Barrows
ARGGG

It's contactMechanism:comment not contactMechanism.comment

It's colons not dots in xhtml
It's colons not dots in xhtml
It's colons not dots in xhtml
It's colons not dots in xhtml
It's colons not dots in xhtml
it's colons not dots in xhtml
It's colons not dots in xhtml
It's colons not dots in xhtml


On Wed, Nov 25, 2009 at 5:03 PM, Jim Barrows jim.barr...@gmail.com wrote:

 Here's the complete xhtml file:
 lift:surround with=default at=content
 head
 title
 lift:locEdit Person/lift:loc
 /title
 /head
 h1You are editing: /h1

 lift:PersonSnippets.save form=post
 person:id/
 person:version/
 div class=span-8 last

 div class=span-3label for=firstName
 lift:locFirst Name/lift:loc
 /label/div
 div class=span-5
 person:firstName/
 /div
 /div
 div class=span-8 last

 div class=span-3label for=middleName
 lift:locMiddle Name/lift:loc
 /label/div
 div class=span-5
 person:middleName/
 /div
 /div
 div class=span-8 last

 div class=span-3label for=lastName
 lift:locLast Name/lift:loc
 /label/div
 div class=span-5
 person:lastName/
 /div
 /div
 person:submit/
 /lift:PersonSnippets.save

 div class=span-24 last
 h2Contact Mechanisms/h2

 lift:PersonSnippets.addContactMechanism form=post
 label for=comment
 lift:locComment/lift:loc
 /labelcontactMechanism.comment/br/
 input type=radio name=contactMechanism
 value=Email/labelEmail/label
 input type=radio name=contactMechanism value=Postal
 Address/labelPostal Address/label
 input type=radio name=contactMechanism value=Phone
 Number/labelPhone Number/label
 input type=radio name=contactMechanism
 value=Facebook/labelFacebook/label
 input type=radio name=contactMechanism
 value=Twitter/labelTwitter/label
 input type=text name=value/
 button type=submitSave/button
 table summary=A list of all the ways to contact this person
 or organizations title=Contact Mechanisms
 thead
 tr
 thComment/th
 thFrom/th
 thThru/th
 thMechanism/th
 /tr
 /thead
 /table
 /lift:PersonSnippets.addContactMechanism

 /div

 /lift:surround


 On Wed, Nov 25, 2009 at 4:35 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 That markup should be in a template file somewhere, which would then call
 the snippets appropriately. I don't see markup for a second form, but I
 might just be missing it.

 A couple of other notes:


- Generally, on links, omit the suffix and Lift will then do I18N
lookup for you as needed. That means use /contact/person/edit instead of
/contact/person/edit.html
- When you're deleting in JPA, there's no need to do a merge first.
Just obtain a reference instead and delete that. It's more efficient. Your
code would look like:

   def doDelete() = {
 try {
   Model.removeAndFlush(Model.getReference(classOf[Person],
 person.getId());

   notice(Deleted  + person.getFirstName() +   +
 person.getLastName())
   redirectTo(/contact/list)

 } catch {
   case pe: PersistenceException = error(Error removing person);
 Log.error(Error removing person, pe);
 }
   }


 On Wed, Nov 25, 2009 at 4:26 PM, Timothy Perrett timo...@getintheloop.eu
  wrote:

 Lift does not use markup like that - there is no magic mapping between
 persistence and view.

 You would most likly have to construct the appropriate master - detail
 code in your snippets and work like that.

 Cheers, Tim

 On 25 Nov 2009, at 23:16, Jim Barrows wrote:

  I'm using JPA, and need to do a One-Many, or master detail view.  So I
 tried the obvious:
  lift:PersonSnippets.save form=post
  !-- form --
   /lift:PersonSnippets.save
  lift:PersonSnippets.addContactMechanism form=post
  /lift:PersonSnippets.addContactMechanism
 
  However, the HTML that gets generated is the same form for both.
  Is there an example somewhere I've missed about how to do this?
  --
  James A Barrows
 
 
  --
 
  You received this message because you are subscribed to the Google
 Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to 

Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread Ross Mellgren
Well, except for after the snippet class name in lift:Snippet tags ;-)

-Ross

On Nov 25, 2009, at 7:45 PM, Jim Barrows wrote:

 ARGGG
 
 It's contactMechanism:comment not contactMechanism.comment
 
 It's colons not dots in xhtml
 It's colons not dots in xhtml
 It's colons not dots in xhtml
 It's colons not dots in xhtml
 It's colons not dots in xhtml
 it's colons not dots in xhtml
 It's colons not dots in xhtml
 It's colons not dots in xhtml
 
 
 On Wed, Nov 25, 2009 at 5:03 PM, Jim Barrows jim.barr...@gmail.com wrote:
 Here's the complete xhtml file:
 lift:surround with=default at=content
 head
 title
 lift:locEdit Person/lift:loc
 /title
 /head
 h1You are editing: /h1
 
 lift:PersonSnippets.save form=post
 person:id/
 person:version/
 div class=span-8 last
 
 div class=span-3label for=firstName
 lift:locFirst Name/lift:loc
 /label/div
 div class=span-5
 person:firstName/
 /div
 /div
 div class=span-8 last
 
 div class=span-3label for=middleName
 lift:locMiddle Name/lift:loc
 /label/div
 div class=span-5
 person:middleName/
 /div
 /div
 div class=span-8 last
 
 div class=span-3label for=lastName
 lift:locLast Name/lift:loc
 /label/div
 div class=span-5
 person:lastName/
 /div
 /div
 person:submit/
 /lift:PersonSnippets.save
 
 div class=span-24 last
 h2Contact Mechanisms/h2
 
 lift:PersonSnippets.addContactMechanism form=post
 label for=comment
 lift:locComment/lift:loc
 /labelcontactMechanism.comment/br/
 input type=radio name=contactMechanism 
 value=Email/labelEmail/label
 input type=radio name=contactMechanism value=Postal 
 Address/labelPostal Address/label
 input type=radio name=contactMechanism value=Phone 
 Number/labelPhone Number/label
 input type=radio name=contactMechanism 
 value=Facebook/labelFacebook/label
 input type=radio name=contactMechanism 
 value=Twitter/labelTwitter/label
 input type=text name=value/
 button type=submitSave/button
 table summary=A list of all the ways to contact this person or 
 organizations title=Contact Mechanisms
 thead
 tr
 thComment/th
 thFrom/th
 thThru/th
 thMechanism/th
 /tr
 /thead
 /table
 /lift:PersonSnippets.addContactMechanism
 
 /div
 
 /lift:surround
 
 
 On Wed, Nov 25, 2009 at 4:35 PM, Derek Chen-Becker dchenbec...@gmail.com 
 wrote:
 That markup should be in a template file somewhere, which would then call the 
 snippets appropriately. I don't see markup for a second form, but I might 
 just be missing it.
 
 A couple of other notes:
 
 Generally, on links, omit the suffix and Lift will then do I18N lookup for 
 you as needed. That means use /contact/person/edit instead of 
 /contact/person/edit.html
 When you're deleting in JPA, there's no need to do a merge first. Just obtain 
 a reference instead and delete that. It's more efficient. Your code would 
 look like:
   def doDelete() = {
 try {
   Model.removeAndFlush(Model.getReference(classOf[Person], 
 person.getId());
 
   notice(Deleted  + person.getFirstName() +   + person.getLastName())
   redirectTo(/contact/list)
 
 } catch {
   case pe: PersistenceException = error(Error removing person); 
 Log.error(Error removing person, pe);
 }
   }
 
 
 On Wed, Nov 25, 2009 at 4:26 PM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Lift does not use markup like that - there is no magic mapping between 
 persistence and view.
 
 You would most likly have to construct the appropriate master - detail code 
 in your snippets and work like that.
 
 Cheers, Tim
 
 On 25 Nov 2009, at 23:16, Jim Barrows wrote:
 
  I'm using JPA, and need to do a One-Many, or master detail view.  So I 
  tried the obvious:
  lift:PersonSnippets.save form=post
  !-- form --
   /lift:PersonSnippets.save
  lift:PersonSnippets.addContactMechanism form=post
  /lift:PersonSnippets.addContactMechanism
 
  However, the HTML that gets generated is the same form for both.
  Is there an example somewhere I've missed about how to do this?
  --
  James A Barrows
 
 
  --
 
  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=en.
 
 --
 
 You 

Re: [Lift] Looking for an example of how to do master detail, on the view side

2009-11-25 Thread David Pollak
Kris blogged about a really nice pattern: http://logji.blogspot.com/

On Wed, Nov 25, 2009 at 3:16 PM, Jim Barrows jim.barr...@gmail.com wrote:

 I'm using JPA, and need to do a One-Many, or master detail view.  So I
 tried the obvious:
 lift:PersonSnippets.save form=post
 !-- form --
  /lift:PersonSnippets.save
 lift:PersonSnippets.addContactMechanism form=post
 /lift:PersonSnippets.addContactMechanism

 However, the HTML that gets generated is the same form for both.
 Is there an example somewhere I've missed about how to do this?
 --
 James A Barrows

  --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] derby

2009-11-25 Thread jack
Could somebody point me to a quickstart or tutorial about how to use
Derby with Lift?

--

You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.