[Lift] Re: Menu generated from database?

2009-11-19 Thread philip

Hi David,

Since I am programming a CMS for my client, I need my lift menu to
come from the database.

LiftRules.setSiteMap(SiteMap(MenuInfo.menu :_*))

  def menu: List[Menu] =
  {
Log.info(Menu called)
...

It seems my menu function only gets called once, on subsquent calls I
do not get any log message.

Maybe I have to subclass SiteMap?

Can you point me in the right direction?

Thanks, Philip



On 10月21日, 下午11時20分, David Pollak feeder.of.the.be...@gmail.com
wrote:
 I owe the list example code to do this... maybe tomorrow.

 On Wed, Oct 21, 2009 at 6:26 AM, philip philip14...@gmail.com wrote:

  Hi,

  How can I get a Liftweb menu to be generated from database content?

  Alternatively, can the menu come from a XML datasource? could I load/
  serialize from that?
  Could it change dynamically at any time?

  Thanks, Philip

 --
 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=.




[Lift] Re: Empty Box exception in MetaMapper

2009-11-19 Thread opyate
PS reproducible issue created here: 
http://github.com/dpp/liftweb/issues/#issue/199


On Nov 13, 11:43 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Thu, Nov 12, 2009 at 9:08 PM, Jim McBeath goo...@j.jimmc.org wrote:

  Assuming I prune it down to an example that requires only a few
  files, which would probably include an SQL script for creating a test
  database that has the appropriate schema in it, is there a procedure
  for submitting such a test case?  Should I just post source code
  to this group?  Make a jar file with sources and put it somewhere?
  If someone can point me to a wiki page or some other reference to clue
  me in as to standard procedure for doing this, that would be nice.

 Please open a ticket athttp://github.com/dpp/liftweb/issuesand if there's
 example code, the best thing is to create a GitHub project... the second
 best thing is to email me a tarball of the example.







  --
  Jim

  On Thu, Nov 12, 2009 at 07:28:24PM -0800, David Pollak wrote:
   Date: Thu, 12 Nov 2009 19:28:24 -0800
   From: David Pollak feeder.of.the.be...@gmail.com
   To: liftweb@googlegroups.com
   Subject: [Lift] Re: Empty Box exception in MetaMapper

      If you can create a reproducible case, we're look into it.

      On Thu, Nov 12, 2009 at 5:43 PM, Jim McBeath goo...@j.jimmc.org
      wrote:

        When I try to save a record in my table from the Create form built
        by
        CRUDify, I am getting a Trying to open an empty Box exception from
        within MetaMapper.scala, line 617 (in 1.1M7), which is this line:
        Â  Â findApplier(indexMap.open_!, rs.getObject(1)) match {
        It appears that indexMap is initialized to Empty at line 888
        and is set to Full at line 985, but the latter happens only if
        dbPrimaryKey_? and dbAutogenerated? are both true. Â In my case I
        have set dbAutogenerated_? = false for my primary key, so indexMap
        will always be Empty, and the code at line 617 will always throw
        an exception.
        Is this a bug, or am I misunderstanding or misusing something?
        My primary field in my KeyedMapper class looks essentially like
        this:
        Â  Â object pk extends MappedStringIndex(this,1) {
        Â  Â  Â  Â override def dbColumnName = TABLENAME_PK
        Â  Â  Â  Â override def dbDisplay_? = true
        Â  Â  Â  Â override def writePermission_? = true
        Â  Â  Â  Â override def dbAutogenerated_? = false
        Â  Â  Â  Â override lazy val defaultValue = 
        Â  Â }
        --
        Jim
        P.S. Thanks for the OracleDriver fix, Dave.

      --
      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

 --
 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=.




[Lift] Maper SQL stored procedures

2009-11-19 Thread Marcin Jurczuk
Hi group,


Is there a way for nice support for stored procedures in Mapper
Framework.
Let assume that I have database where only way to get data is stored
procedure for example
Instead SELECT * from user I must execute exec dbo.GET_USERS

How connect Mapper fields with access to them by stored procedures ?

A can of cource use raw/insecure SQL but then I'm loosing all Mapper
features ..

Thanks in advance

--

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=.




Re: [Lift] Re: Empty Box exception in MetaMapper

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 1:52 AM, opyate opy...@gmail.com wrote:

 PS reproducible issue created here:
 http://github.com/dpp/liftweb/issues/#issue/199


Thanks!



 On Nov 13, 11:43 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Thu, Nov 12, 2009 at 9:08 PM, Jim McBeath goo...@j.jimmc.org wrote:
 
   Assuming I prune it down to an example that requires only a few
   files, which would probably include an SQL script for creating a test
   database that has the appropriate schema in it, is there a procedure
   for submitting such a test case?  Should I just post source code
   to this group?  Make a jar file with sources and put it somewhere?
   If someone can point me to a wiki page or some other reference to clue
   me in as to standard procedure for doing this, that would be nice.
 
  Please open a ticket athttp://github.com/dpp/liftweb/issuesand if
 there's
  example code, the best thing is to create a GitHub project... the second
  best thing is to email me a tarball of the example.
 
 
 
 
 
 
 
   --
   Jim
 
   On Thu, Nov 12, 2009 at 07:28:24PM -0800, David Pollak wrote:
Date: Thu, 12 Nov 2009 19:28:24 -0800
From: David Pollak feeder.of.the.be...@gmail.com
To: liftweb@googlegroups.com
Subject: [Lift] Re: Empty Box exception in MetaMapper
 
   If you can create a reproducible case, we're look into it.
 
   On Thu, Nov 12, 2009 at 5:43 PM, Jim McBeath goo...@j.jimmc.org
   wrote:
 
 When I try to save a record in my table from the Create form
 built
 by
 CRUDify, I am getting a Trying to open an empty Box exception
 from
 within MetaMapper.scala, line 617 (in 1.1M7), which is this
 line:
 Â  Â findApplier(indexMap.open_!, rs.getObject(1)) match {
 It appears that indexMap is initialized to Empty at line 888
 and is set to Full at line 985, but the latter happens only if
 dbPrimaryKey_? and dbAutogenerated? are both true. Â In my case
 I
 have set dbAutogenerated_? = false for my primary key, so
 indexMap
 will always be Empty, and the code at line 617 will always throw
 an exception.
 Is this a bug, or am I misunderstanding or misusing something?
 My primary field in my KeyedMapper class looks essentially like
 this:
 Â  Â object pk extends MappedStringIndex(this,1) {
 Â  Â  Â  Â override def dbColumnName = TABLENAME_PK
 Â  Â  Â  Â override def dbDisplay_? = true
 Â  Â  Â  Â override def writePermission_? = true
 Â  Â  Â  Â override def dbAutogenerated_? = false
 Â  Â  Â  Â override lazy val defaultValue = 
 Â  Â }
 --
 Jim
 P.S. Thanks for the OracleDriver fix, Dave.
 
   --
   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
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





-- 
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=.




Re: [Lift] Re: Lift Scaladocs for Maven?

2009-11-19 Thread Josh Suereth
No, you can raise an issue on github (davidB/maven-scala-plugin).  You can
also use the build-helper-plugin to attach the scaladocs in maven.


We'll try to resolve this for the 2.13 or 2.14 release of the plugin.
Please raise the issue so it stays on the radar ;)

- Josh

On Thu, Nov 19, 2009 at 12:48 AM, aw anth...@whitford.com wrote:

 Note that the Maven Javadoc Plugin has a specific goal defined for
 creating a jar of the javadocs:
http://maven.apache.org/plugins/maven-javadoc-plugin/jar-mojo.html
 Then you need to add a goal to attach it when you create a package:

 http://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html

 Unfortunately, I don't see a corresponding goal for the Maven Scala
 Plugin:
http://scala-tools.org/mvnsites/maven-scala-plugin/plugin-info.html

 --

 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=.




--

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=.




[Lift] Re: Where are the dragons hiding?

2009-11-19 Thread Paul Butcher
On Nov 19, 12:37 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 But one of the key things to keep in mind regarding Lift is how we as a
 community handle problems.  One of the biggest, nastiest bugs in Lift-land
 crept into the code in the last few 
 days:http://groups.google.com/group/liftweb/browse_thread/thread/558280f51
 Sessions were getting destroyed seemingly randomly.  Please look at how the
 problem was dealt with.  There will be bugs in Lift in the future.  You can
 expect that they will be dealt with in the future in the same way.  What you
 will hear from the Lift developers is that we stand behind Lift and when
 there are problems, we stand behind fixing them.  In terms of Scala the
 language, EPFL has a very similar attitude.  We will do what it takes to
 support the folks who bet their careers and companies on Lift right on down
 to the JVM.

Good to know - thanks David.

I'm sure that I will have reason to call on that support, so thanks in
advance :-)

paul.butcher-msgCount++

--

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=.




Re: [Lift] Re: Ajax + Comet Chat across a Cluster

2009-11-19 Thread Timothy Perrett
What is it you were hoping to gain by using akka?

The description below was pretty confussing - can you start a-fresh  
description of *exactly* what you want to achive, what you want the  
user to experience and what your cluster config will be.

Cheers, Tim

Sent from my iPhone

On 19 Nov 2009, at 07:26, aw anth...@whitford.com wrote:

 I certainly understand the Actor model, but I am new to Akka...  From
 browsing their wiki (http://wiki.github.com/jboner/akka), it is
 unclear to me that they provide a publish/subscribe concept -- and I
 think I would need that...  Please point me to that reference if you
 are aware of that.

 I'll take a closer look at RabbitMQ...

 --

 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= 
 .




--

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=.




[Lift] Re: Maper SQL stored procedures

2009-11-19 Thread jon
I think you could do: User.findAllByInsecureSql(exec dbo.GET_USERS,
IHaveValidatedThisSQL(me, 19 Nov 2009)).  That would return a List
[User]


On Nov 19, 6:23 am, Marcin Jurczuk mjurc...@gmail.com wrote:
 Hi group,

 Is there a way for nice support for stored procedures in Mapper
 Framework.
 Let assume that I have database where only way to get data is stored
 procedure for example
 Instead SELECT * from user I must execute exec dbo.GET_USERS

 How connect Mapper fields with access to them by stored procedures ?

 A can of cource use raw/insecure SQL but then I'm loosing all Mapper
 features ..

 Thanks in advance

--

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=.




Re: [Lift] Maper SQL stored procedures

2009-11-19 Thread David Pollak
Marcin,

Back in SmartMode days (a Java-based precursor to Lift) we bound methods to
stored procedures, but it was pretty costly dev-wise in terms of abstracting
the way each RDBMS deals with stored procedures.

If you (or someone else) has a nice abstraction of stored procedures that's
type safe, let's see if we can add it to Lift.

Thanks,

David

On Thu, Nov 19, 2009 at 3:23 AM, Marcin Jurczuk mjurc...@gmail.com wrote:

 Hi group,


 Is there a way for nice support for stored procedures in Mapper
 Framework.
 Let assume that I have database where only way to get data is stored
 procedure for example
 Instead SELECT * from user I must execute exec dbo.GET_USERS

 How connect Mapper fields with access to them by stored procedures ?

 A can of cource use raw/insecure SQL but then I'm loosing all Mapper
 features ..

 Thanks in advance

 --

 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=.





-- 
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=.




[Lift] Re: Maper SQL stored procedures

2009-11-19 Thread Marcin Jurczuk

David,

Thanks for quick response,

On 19 Lis, 18:39, David Pollak feeder.of.the.be...@gmail.com wrote:
 Marcin,

 Back in SmartMode days (a Java-based precursor to Lift) we bound methods to
 stored procedures, but it was pretty costly dev-wise in terms of abstracting
 the way each RDBMS deals with stored procedures.

 If you (or someone else) has a nice abstraction of stored procedures that's
 type safe, let's see if we can add it to Lift.

 Thanks,

 David



 On Thu, Nov 19, 2009 at 3:23 AM, Marcin Jurczuk mjurc...@gmail.com wrote:
  Hi group,

  Is there a way for nice support for stored procedures in Mapper
  Framework.
  Let assume that I have database where only way to get data is stored
  procedure for example
  Instead SELECT * from user I must execute exec dbo.GET_USERS

  How connect Mapper fields with access to them by stored procedures ?

  A can of cource use raw/insecure SQL but then I'm loosing all Mapper
  features ..

  Thanks in advance

  --

  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=.

 --
 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=.




Re: [Lift] Re: Menu generated from database?

2009-11-19 Thread David Pollak
Philip  list,

I've had it on my to-do list to write up an example... and haven't... but...

In your Loc, you can override def supplimentalKidMenuItems and dynamically
generate kid menu items.

I'll try to get to an example but not today... sorry :-(

Thanks,

David

On Thu, Nov 19, 2009 at 12:35 AM, philip philip14...@gmail.com wrote:


 Hi David,

 Since I am programming a CMS for my client, I need my lift menu to
 come from the database.

 LiftRules.setSiteMap(SiteMap(MenuInfo.menu :_*))

  def menu: List[Menu] =
  {
Log.info(Menu called)
 ...

 It seems my menu function only gets called once, on subsquent calls I
 do not get any log message.

 Maybe I have to subclass SiteMap?

 Can you point me in the right direction?

 Thanks, Philip



 On 10月21日, 下午11時20分, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I owe the list example code to do this... maybe tomorrow.
 
  On Wed, Oct 21, 2009 at 6:26 AM, philip philip14...@gmail.com wrote:
 
   Hi,
 
   How can I get a Liftweb menu to be generated from database content?
 
   Alternatively, can the menu come from a XML datasource? could I load/
   serialize from that?
   Could it change dynamically at any time?
 
   Thanks, Philip
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





-- 
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=.




Re: [Lift] Re: Menu generated from database?

2009-11-19 Thread Jack Widman
This is one of thing that is so amazing about the lift community David. You
apologize for not getting to something today. [?]

On Thu, Nov 19, 2009 at 12:56 PM, David Pollak 
feeder.of.the.be...@gmail.com wrote:

 Philip  list,

 I've had it on my to-do list to write up an example... and haven't...
 but...

 In your Loc, you can override def supplimentalKidMenuItems and dynamically
 generate kid menu items.

 I'll try to get to an example but not today... sorry :-(

 Thanks,

 David


 On Thu, Nov 19, 2009 at 12:35 AM, philip philip14...@gmail.com wrote:


 Hi David,

 Since I am programming a CMS for my client, I need my lift menu to
 come from the database.

 LiftRules.setSiteMap(SiteMap(MenuInfo.menu :_*))

  def menu: List[Menu] =
  {
Log.info(Menu called)
 ...

 It seems my menu function only gets called once, on subsquent calls I
 do not get any log message.

 Maybe I have to subclass SiteMap?

 Can you point me in the right direction?

 Thanks, Philip



 On 10月21日, 下午11時20分, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I owe the list example code to do this... maybe tomorrow.
 
  On Wed, Oct 21, 2009 at 6:26 AM, philip philip14...@gmail.com wrote:
 
   Hi,
 
   How can I get a Liftweb menu to be generated from database content?
 
   Alternatively, can the menu come from a XML datasource? could I load/
   serialize from that?
   Could it change dynamically at any time?
 
   Thanks, Philip
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





 --
 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=.




-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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=.


330.gif

Re: [Lift] Tutorials or documentation about Factory?

2009-11-19 Thread David Pollak
I've added it to my to do list.

On Wed, Nov 18, 2009 at 6:26 AM, Vesa brut...@gmail.com wrote:

 Hi,

 It would be nice to have some kind of tutorial on how to use this new
 addition.

 - Vesa

 --

 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=.





-- 
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=.




Re: [Lift] Model field validation

2009-11-19 Thread David Pollak
On Wed, Nov 18, 2009 at 6:14 AM, Ferdinand Chan unique...@gmail.com wrote:

 If I have a model Item as follows,

 class Item extends LongKeyedMapper[Item] with IdPK{

  def getSingleton = Item

  object chiBrandName extends MappedPoliteString(this,255)

  object engBrandName extends MappedPoliteString(this,255)


 override def validate : List[FieldError] = runSafe {
 myLocalValidation // returns List[FieldError]
} ::: super.validate

def myLocalValidation: List[FieldError] = ... do your multi-field logic
here


 }


 An item is valid if and only if at least one of the brand name is non-
 empty.

 But from the lift example, field validation is done by overriding the
 validations method of each field and the validate method of the
 LongKeyedMetaMapper will invoke all validations method of its fields
 and return the list of FieldError if any.

 Is there anyway to implement my requirement in lift Mapper with
 something like (Sorry for my bad lift syntax, still learning :) )

  def isValidItem = {
 if ( (chiBrandName eq null) || chiBrandName.length == 0) 
 (engBrandName eq null) || engBrandName.length == 0) )
 // show the field error
 else Nil
  }

 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 at
 http://groups.google.com/group/liftweb?hl=.





-- 
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=.




Re: [Lift] overriding ConnectionManager.newSuperConnection

2009-11-19 Thread David Pollak
On Tue, Nov 17, 2009 at 10:50 AM, opyate opy...@gmail.com wrote:

 Hello Lifters,

 I overrode newSuperConnection like so:

 --START--
  object DBVendor extends ConnectionManager {
def newConnection(name: ConnectionIdentifier): Box[Connection]
 = {
  try {
Class.forName(dbDriver)
val dm =  DriverManager.getConnection(dbConnString,
 dbUser, dbPass)
Full(dm)
  } catch {
case e = {
  e.printStackTrace
  Empty
}
  }
}
def releaseConnection(conn: Connection) {conn.close}

override def newSuperConnection(name: ConnectionIdentifier):
 Box[SuperConnection] = {
val c: Connection = newConnection(name).open_!
def release = () = releaseConnection(c)
Full(new SuperConnection(c, release, Full(schema) ))
}
  }
 --END--

 ...where schema is defined beforehand.

 Now, I have to read/write to a Postgres table which is in a schema,
 e.g. schemaname.tablename

 When I run my Lift code, I get the following exception:

 Caught and thrown by:
 Message: org.postgresql.util.PSQLException: ERROR: relation
 tablename does not exist


schemaName is used in Schemifier, but not in query construction.

If this is a bug, please create a repro example (something we can use to
test) and open a ticket.

Thanks,

David



 However, if I change the model from this:

 override def dbTableName = tablename

 to this:

 override def dbTableName = schemaname.tablename

 ...then things start working, but this is obviously not the intended
 way to achieve this, right?

 Please let me know what I'm doing wrong.

 Thanks,
 Juan

 --

 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=.





-- 
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=.




Re: [Lift] Another List XYZ Menu Entry

2009-11-19 Thread David Pollak
On Mon, Nov 16, 2009 at 8:51 AM, Hannes hannes.flo...@gmx.li wrote:


 Hi Lifters,

 I need a new menu entry that displays a table similar to the one, that
 is shown by the CRUDify List XYZ link. But I need to display different
 fields without the chance to edit or delete the items. So basically,
 just a simple table. Later on, some Comet stuff would be nice, to see
 changes on the table immediately.

 I've tried to add a new menu entry in Boot.scala, but I don't really
 know how/where the XML should come from


What XML goes into a menu item?



 thanks.

 --~--~-~--~~~---~--~~
 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
 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=.




Re: [Lift] Re: odd ajax issue (works every other time)

2009-11-19 Thread David Pollak
On Wed, Nov 18, 2009 at 10:28 PM, Marius marius.dan...@gmail.com wrote:

 That makes two of us David ...

 The thing is that during my debugging there was no session destruction
 and I traced this right in the guts of SessionMaster.


I went further and it seemed that the sessions were destroyed at the Servlet
Container level.

I really need a couple of hours to figure this one out.  Sigh.


 The session was
 always there. But somehow the sessionId fed in was different even
 though the cookie seemed to be correct. I know I know ... it doesn't
 make much sense but if you find more info on this please do let me
 know. This is killing me :)


It's killing me, too... but if we're both dead...



 Br's,
 Marius

 On Nov 19, 2:20 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Marius,
 
  Thanks for tracking this down and checking in a fix.
 
  I'm still curious as to why a double-init was causing session
 destruction...
  I'll do more digging.
 
  We should also document this in the code (and maybe even thrown an
 exception
  on a double-init).
 
  Thanks,
 
  David
 
  On Wed, Nov 18, 2009 at 2:30 PM, Marius marius.dan...@gmail.com wrote:
   My assumption on the causality is that things remained set on
   ThreadGlobals and threads are re-used by container. I know it doesn't
   make the most sense what I'm saying since the ThredGlobals are
   properly scoped but the previous thread-global value is cached and
   restored after the closure execution. At least this is my assumption
   right now (so late) ...
 
   Br's,
   Marius
 
   On Nov 19, 12:26 am, Marius marius.dan...@gmail.com wrote:
Ok I did some more debugging on this.
 
I put traces in the code and at some point when LiftRules is
requesting the session from the SessionMaster I'm seeing a different
sessionId provided to the SessionMaster thus the session is not
 found.
I removed my addition from LiftSession#contextFuncBuilder
 
//S.init(req, session) {
  S.CurrentLocation.doWith(curLoc) {
snippetMap.doWith(snippetMap.is ++ currentMap) {
  super.apply(in)
}
  }
   // }
 
so I commented out the S.init and I wasn't able to reproduce the
problem anymore. Therefore I took the liberty of pushing this change
into master without going through the review board process. I did
 this
due to the urgency nature.
 
Please test this and see if you can reproduce the problem
 
Br's,
Marius
 
On Nov 18, 11:11 pm, Marius marius.dan...@gmail.com wrote:
 
 I've noticed this today as well but in a different context.
 Sometimes
 out of the sudden, I'm being kicked out of the session to the login
 page.
 
 Dave I wonder is this may have been caused by the S.init call
 inside
 LiftSession#contextFuncBuilder. I can't think of a reason right now
 on
 why would that such effect though.
 
 Br's,
 Marius
 
 On Nov 18, 10:18 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 
  Okay, I've reproduced the issue on Tomcat, so it's definitely
   something in
  Lift that's borking the session
 
  On Wed, Nov 18, 2009 at 12:00 PM, David Pollak 
 
  feeder.of.the.be...@gmail.com wrote:
   Kris,
 
   As far as I can tell, it's a Jetty issue.  Could you start by
   trying to
   reproduce the problem in Tomcat?  If you can repro it in
 Tomcat,
   then
   clearly the problem is in Lift.  If, however, the problem does
 not
   manifest
   in Tomcat, then we're poking Jetty wrong.
 
   Thanks,
 
   David
 
   On Wed, Nov 18, 2009 at 8:07 AM, Kris Nuttycombe 
   kris.nuttyco...@gmail.com wrote:
 
   I've got a few other things that I have to take care of today,
 but
   if
   I can get those out of the way I will run a git bisect,
 compiling
   
   running with your test project to see if I can at least figure
 out
   the
   commit that introduced the error. I've been wanting to learn
 about
   bisect anyway. :)
 
   Kris
 
   On Wed, Nov 18, 2009 at 7:26 AM, David Pollak
   feeder.of.the.be...@gmail.com wrote:
 
On Tue, Nov 17, 2009 at 10:33 PM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 
I am able to reproduce the problem with a simple Ajax
 control.
 
It's very, very odd.  It seems to be an intermittent
 failure of
   the
servlet container to find the HttpServletSession.  The
 client
   is
   presenting
the cookie correctly, but Jetty is not recognizing it.
 
For some reason, even though the browser sends the right
   cookies, Jetty
   is
not recognizing them.  This is pretty easy to reproduce with
   Firefox,
   but I
haven't seen it with Chrome.
 
I'm enclosing a simple version of the project I used for
   testing... just
keep pressing on the button and eventually the page will
 reload
   (indicating
 

Re: [Lift] Re: Call it Lift 2.0

2009-11-19 Thread David Pollak
On Tue, Nov 17, 2009 at 10:06 PM, Joni Freeman freeman.j...@gmail.comwrote:

 On 18 marras, 01:10, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I'd like to see the JSON stuff moved from Option to Box, but that's
 Joni's
  call.

 Hi,

 I do not agree. We have quite a lot of lift-json users who do not yet
 use other parts of Lift, and Box is not a familiar construct outside
 of Lift. I really like to keep it that way. But could lift REST APIs
 wrap the lib to provide more Liftesque API?


It's more of a return-type issue.

The reason I created Box in the first place is that Option doesn't give you
the ability to capture reasons for None (yeah, there's Either... although
there wasn't when I introduced Box [Can at the time], but you can't use
Either in a for comprehension).

In reviewing the JSON code, there's actually nothing that I'd change in the
APIs.  I would support Box everywhere there's support for Option
(serializing/deserializing and implicit helpers).



 Cheers Joni

 --

 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=.





-- 
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=.




[Lift] Looking for the single person who owns naming in Lift

2009-11-19 Thread David Pollak
Folks,

There has been a lot of talk about method/class naming in Lift lately.  It's
a good thing(tm) to normalize method and class naming in Lift.

But it's also important that after the initial cleanup is done, the
consistency is kept going forward.  It's also important that there's a pair
of eyes looking at code as it's evolving and getting the names right early.
For example, the common Actor stuff was floating around for 6 weeks (and
very publicly so) before we rolled it into Lift.  Jonas and I were the only
ones that commented on the code.  We got it to where we liked it and pushed
it into master... then people made suggestions about the names.  This is the
wrong time.  As important APIs are evolving, it's important to get the names
right before people start using the code.

So, I'm asking for someone in the community to step forward and own naming
in Lift.  You may choose to have commit rights to the Lift code or not, but
you will be responsible for:

   - Understanding most (all?) of the Lift modules such that the person has
   a broad understanding of the pieces of Lift
   - Organizing a set of change recommendations for name changes and
   deprecations
   - Soliciting community involvement and feedback on the recommendations
   - Finalizing the recommendations for the next release of Lift (whether
   that's called 1.1 or 2.0)
   - Doing ongoing review of material additions to Lift to make sure things
   are consistent

So, if you're interested in that role (and it's a non-trivial time
commitment over the next 6 weeks), please contact me off-list and let's
chat.

Thanks,

David

-- 
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=.




Re: [Lift] Lift 1.1-M7 and Terracotta

2009-11-19 Thread David Pollak
On Fri, Nov 6, 2009 at 2:06 PM, jon jonhoff...@gmail.com wrote:


 Hi,

 Has anyone had any recent success with using Terracotta to share
 session state?

 I've tried playing around with a simple lift app (1.1-M7) and
 terracotta's sessions-configurator app.  It doesn't just work, but I
 realized that's because Lift is hijacking sessions from the container
 and managing them in SessionMaster.  I've tried configuring the root
 object to be net.liftweb.http.SessionMaster$.MODULE$ which is the
 entire singleton, but that includes a lot of LiftActor stuff (and
 terracotta complains about unlocked accesses to shared fields), and I
 think really only want the sessions field.  I don't think i can make
 sessions the root because its reference is overwritten every time a
 new session is added.

 Any ideas?


Jon,

Can you send around the complaints TC has about sessions... I'll see where
Lift is doing the offending thing and see if I can fix it.

I'll ping Jonas on this... he's the resident TC expert.

Thanks,

David


 --~--~-~--~~~---~--~~
 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
 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=.




Re: [Lift] Looking for the single person who owns naming in Lift

2009-11-19 Thread Jim Barrows
I'm still new to learning Lift, and Scala for that matter, but if you can't
find anyone better, I'll do it.

On Thu, Nov 19, 2009 at 12:37 PM, David Pollak 
feeder.of.the.be...@gmail.com wrote:

 Folks,

 There has been a lot of talk about method/class naming in Lift lately.
 It's a good thing(tm) to normalize method and class naming in Lift.

 But it's also important that after the initial cleanup is done, the
 consistency is kept going forward.  It's also important that there's a pair
 of eyes looking at code as it's evolving and getting the names right early.
 For example, the common Actor stuff was floating around for 6 weeks (and
 very publicly so) before we rolled it into Lift.  Jonas and I were the only
 ones that commented on the code.  We got it to where we liked it and pushed
 it into master... then people made suggestions about the names.  This is the
 wrong time.  As important APIs are evolving, it's important to get the names
 right before people start using the code.

 So, I'm asking for someone in the community to step forward and own naming
 in Lift.  You may choose to have commit rights to the Lift code or not, but
 you will be responsible for:

- Understanding most (all?) of the Lift modules such that the person
has a broad understanding of the pieces of Lift
- Organizing a set of change recommendations for name changes and
deprecations
- Soliciting community involvement and feedback on the recommendations
- Finalizing the recommendations for the next release of Lift (whether
that's called 1.1 or 2.0)
- Doing ongoing review of material additions to Lift to make sure
things are consistent

 So, if you're interested in that role (and it's a non-trivial time
 commitment over the next 6 weeks), please contact me off-list and let's
 chat.

 Thanks,

 David

 --
 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=.




-- 
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=.




Re: [Lift] Lift 1.1-M7 and Terracotta

2009-11-19 Thread Jonas Bonér
Hi Jon.

Could you send me what you have so far and I'll try to take a look at it.
I'm pretty choked right now so I can't give it too many cycles but
I'll try to do my best :-)

Mail it to me directly: my first name AT jonasboner.com

/Jonas

2009/11/6 jon jonhoff...@gmail.com:

 Hi,

 Has anyone had any recent success with using Terracotta to share
 session state?

 I've tried playing around with a simple lift app (1.1-M7) and
 terracotta's sessions-configurator app.  It doesn't just work, but I
 realized that's because Lift is hijacking sessions from the container
 and managing them in SessionMaster.  I've tried configuring the root
 object to be net.liftweb.http.SessionMaster$.MODULE$ which is the
 entire singleton, but that includes a lot of LiftActor stuff (and
 terracotta complains about unlocked accesses to shared fields), and I
 think really only want the sessions field.  I don't think i can make
 sessions the root because its reference is overwritten every time a
 new session is added.

 Any ideas?
 --~--~-~--~~~---~--~~
 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 
 liftweb+unsubscr...@googlegroups.com
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en
 -~--~~~~--~~--~--~---





-- 
Jonas Bonér

twitter: @jboner
blog:http://jonasboner.com
work:   http://scalablesolutions.se
code:   http://github.com/jboner
code:   http://akkasource.org
also:http://letitcrash.com

--

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=.




[Lift] intro to lift-json?

2009-11-19 Thread harryh
Is there a basic intro to lift-json floating around anywhere?  I'm
having a bit of trouble getting started with a couple basic things.
For example if a have a JObject that corresponds to:

{
  foo : {
bar : 999
  }
}

How do I get the 999 (as an int) out of the JObject?  I'm sure this is
simple, just a bit confused on the basics.

-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=.




[Lift] Re: intro to lift-json?

2009-11-19 Thread TylerWeir
You may find the Extraction tests helpful:

http://github.com/dpp/liftweb/blob/master/lift-base/lift-json/src/test/scala/net/liftweb/json/ExtractionExamples.scala



On Nov 19, 3:20 pm, harryh har...@gmail.com wrote:
 Is there a basic intro to lift-json floating around anywhere?  I'm
 having a bit of trouble getting started with a couple basic things.
 For example if a have a JObject that corresponds to:

 {
   foo : {
     bar : 999
   }

 }

 How do I get the 999 (as an int) out of the JObject?  I'm sure this is
 simple, just a bit confused on the basics.

 -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=.




Re: [Lift] intro to lift-json?

2009-11-19 Thread Tim Nelson
Have you seen the readme file?

http://github.com/dpp/liftweb/tree/master/lift-base/lift-json/

On Thu, Nov 19, 2009 at 2:20 PM, harryh har...@gmail.com wrote:

 Is there a basic intro to lift-json floating around anywhere?  I'm
 having a bit of trouble getting started with a couple basic things.
 For example if a have a JObject that corresponds to:

 {
  foo : {
bar : 999
  }
 }

 How do I get the 999 (as an int) out of the JObject?  I'm sure this is
 simple, just a bit confused on the basics.

 -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=.




--

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=.




[Lift] Re: odd ajax issue (works every other time)

2009-11-19 Thread Jeppe Nejsum Madsen


On Nov 19, 8:16 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Wed, Nov 18, 2009 at 10:28 PM, Marius marius.dan...@gmail.com wrote:
  That makes two of us David ...

  The thing is that during my debugging there was no session destruction
  and I traced this right in the guts of SessionMaster.

 I went further and it seemed that the sessions were destroyed at the Servlet
 Container level.

I can't say I grok the lift request cycle, but I looked into the jetty
part and this is what I think happens:

At some point getCookies is called (by Lift) on a HttpServletRequest
that seems invalid (ie empty). This causes the internal state of the
request object to be marked cookies are parsed. Just there are no
cookies since the request is empty.

Jetty recycles the request objects, so later when a request comes in
that reuses this request object and it tries to fetch the session
cookie, it sees that cookies are already parsed but can't find the
session cookie (there are none) and thus creates a new session.

Why the request object is not re-initialized for the new request I
don't know...also it doesn't really explain the error on Tomcat

Not sure if this helps...:-)

/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=.




[Lift] Lift on Azure

2009-11-19 Thread Matt Harrington
Java apps have gotten a lot easier to run on Azure this week.  Here's
a video on developing a simple app with Eclipse and deploying in
Tomcat on Azure:

http://microsoftpdc.com/Sessions/SVC50

I don't believe Java on Azure has the same restrictions as Java on
GAE.  For example, you can write to the local filesystem and use
threads.  Using the REST-based Azure Tables datastore (non-RDBMS) with
Lift's ORM might be tricky, but SQL Azure is available via JDBC.  Or,
as far as I know Derby should work.

I think you need to be on Windows to develop though, even though the
example in the video just uses Eclipse.  For one thing, the desktop
version of Azure is Windows-only.

--

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=.




Re: [Lift] Problem with issue 182

2009-11-19 Thread Derek Chen-Becker
I hadn't though about mixing in CRUDify with users. I suppose we should just
pull it out and leave sitemap as the sole menuing method. Jeppe, can you
open a ticket?

On Tue, Nov 17, 2009 at 9:50 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Tue, Nov 17, 2009 at 7:01 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:

 Hi,

 Just updated to latest snapshot and noticed
 http://github.com/dpp/liftweb/issues/closed/#issue/182

 Imo, this is a bad idea since it makes it impossible to mixin Crudify
 to get easy user editing/listing.

 It's not a big problem for me since I have made my own Crudifyjust
 noticed it since I started out based on the original code :-)


 Good catch.

 Derek opened the ticket... it's his call as to what to do about this one.



 /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=.





 --
 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=.


--

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=.




[Lift] A sensible AJAX approach

2009-11-19 Thread Chris Lewis
Classic use case: a user chooses to view/edit and object by clicking on 
a link. This causes the app to fetch an edit view (form) and render it 
asynchronously, probably rendering it as a modal dialog. To specify the 
case a bit more, consider a table of like objects that allows you to 
edit them (orders or accounts). As far as the user experience, clicking 
edit for one would yield the same edit form as any other - only the 
contents (the target of the edit) would change.

Normal ajax forms in lift are simple - just wrap the bind in an ajax 
form (http://is.gd/4Z61Z) and you get an async submit with essentially 
the same template code.

But what about ajax forms delivered by ajax? What's the best way to 
implement this in lift? It seems like there are two routes: client and 
server-based.


1) In the client-based approach, I can declare an invisible form in the 
template, as well as write some static javascript to do the heavy 
lifting (no pun intended). This JS would be responsible for receiving 
the data representing the object to edit from the server as json, 
unpacking it into the form for editing, rendering the form, handling the 
submit as ajax, and finally hiding the form.

This means writing a good bit more JS by hand, but it keeps the 
(compiled) snippet code smaller. Ordinarily I'd see that as good, but 
more and more snippets seem like they are intended for such heavy view 
meddling.


2) The server-based approach would require very little of the main 
template: basically just a containing element (w/ dom id) to host the 
delivered form. The snippet itself would yield a form on an ajax call 
via SetHtml. It would also have to set up the handlers and populate the 
form contents with the target object.

This is the part that I'm not clear on. I know I can just inline the XML 
with bind points as if it were in a form, but that just feels strange. 
Would it make more sense to use an external template, similar to a rails 
partial? Is there a template loading facility for this?

Thanks for any and all input.

chris

--

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=.




Re: [Lift] H2 foreign keys

2009-11-19 Thread Derek Chen-Becker
Open a ticket and I'll see if I can get it done. I've been fighting a fire
at work pretty much the entire week so far, so needless to say I'm behind on
Lift tickets (and LiftTicket :( )

Derek

On Wed, Nov 18, 2009 at 7:04 AM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 I don't think I ended up creating the ticket, but do you want to volunteer
 to fix this?
 IIRC the H2 syntax was like the currently used syntax but without the firsy
 to words or so. Search the H2 SQL Grammar page.
 Thanks.
 P.S. I wonder which other DBs use H2's syntax.

 -
 Derek Chen-Beckerdchenbec...@gmail.com wrote:

 That's what I've been doing as we have to make changes. For instance, we
 needed to change how schemifier creates index columns to accomodate Oracle
 sequences, so I moved that to DriverType.

 On Sun, Nov 15, 2009 at 10:24 AM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

 
  The H2 DriverType does not indicate H2 supports foreign key constraints.
  However it does, albeit with a different syntax than Schemifier uses.
  I'll try to file a ticket later. If I decide to work on it, what would be
  the best way? Refactor the SQL in Schemifier to be generated by the
  DriverType?
 
 
  --~--~-~--~~~---~--~~
  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
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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=.


 --

 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=.




--

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=.




[Lift] Re: intro to lift-json?

2009-11-19 Thread harryh
Why does this parse into a JArray(List(..)) intead of a JArray(..) ?

-harryh

scala parse( { ids : [1, 2] } )
res5: net.liftweb.json.JsonAST.JValue = JObject(List(JField(ids,JArray
(List(JInt(1), JInt(2))


On Nov 19, 3:51 pm, Tim Nelson tnell...@gmail.com wrote:
 Have you seen the readme file?

 http://github.com/dpp/liftweb/tree/master/lift-base/lift-json/

 On Thu, Nov 19, 2009 at 2:20 PM, harryh har...@gmail.com wrote:
  Is there a basic intro to lift-json floating around anywhere?  I'm
  having a bit of trouble getting started with a couple basic things.
  For example if a have a JObject that corresponds to:

  {
   foo : {
     bar : 999
   }
  }

  How do I get the 999 (as an int) out of the JObject?  I'm sure this is
  simple, just a bit confused on the basics.

  -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=.

--

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=.




Re: [Lift] Re: intro to lift-json?

2009-11-19 Thread Ross Mellgren
JArray is a case class that wraps a List. It's not an array-of-list or  
anything, just that the actual elements are stored in a List that  
JArray holds.

-Ross

On Nov 19, 2009, at 5:12 PM, harryh wrote:

 Why does this parse into a JArray(List(..)) intead of a JArray(..) ?

 -harryh

 scala parse( { ids : [1, 2] } )
 res5: net.liftweb.json.JsonAST.JValue = JObject(List(JField(ids,JArray
 (List(JInt(1), JInt(2))


 On Nov 19, 3:51 pm, Tim Nelson tnell...@gmail.com wrote:
 Have you seen the readme file?

 http://github.com/dpp/liftweb/tree/master/lift-base/lift-json/

 On Thu, Nov 19, 2009 at 2:20 PM, harryh har...@gmail.com wrote:
 Is there a basic intro to lift-json floating around anywhere?  I'm
 having a bit of trouble getting started with a couple basic things.
 For example if a have a JObject that corresponds to:

 {
  foo : {
bar : 999
  }
 }

 How do I get the 999 (as an int) out of the JObject?  I'm sure  
 this is
 simple, just a bit confused on the basics.

 -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=.

 --

 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= 
 .



--

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=.




Re: [Lift] H2 foreign keys

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 2:08 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 Open a ticket and I'll see if I can get it done. I've been fighting a fire
 at work pretty much the entire week so far, so needless to say I'm behind on
 Lift tickets (and LiftTicket :( )


I so want LiftTicket... I'm waiting with baited breath... maybe it'll be an
early birthday present...



 Derek


 On Wed, Nov 18, 2009 at 7:04 AM, Naftoli Gugenheim 
 naftoli...@gmail.comwrote:

 I don't think I ended up creating the ticket, but do you want to volunteer
 to fix this?
 IIRC the H2 syntax was like the currently used syntax but without the
 firsy to words or so. Search the H2 SQL Grammar page.
 Thanks.
 P.S. I wonder which other DBs use H2's syntax.

 -
 Derek Chen-Beckerdchenbec...@gmail.com wrote:

 That's what I've been doing as we have to make changes. For instance, we
 needed to change how schemifier creates index columns to accomodate Oracle
 sequences, so I moved that to DriverType.

 On Sun, Nov 15, 2009 at 10:24 AM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

 
  The H2 DriverType does not indicate H2 supports foreign key constraints.
  However it does, albeit with a different syntax than Schemifier uses.
  I'll try to file a ticket later. If I decide to work on it, what would
 be
  the best way? Refactor the SQL in Schemifier to be generated by the
  DriverType?
 
 
  --~--~-~--~~~---~--~~
  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
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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=.


 --

 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=.



  --
 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=.




-- 
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=.




Re: [Lift] Lift on Azure

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 1:51 PM, Matt Harrington mbh.li...@gmail.comwrote:

 Java apps have gotten a lot easier to run on Azure this week.  Here's
 a video on developing a simple app with Eclipse and deploying in
 Tomcat on Azure:

 http://microsoftpdc.com/Sessions/SVC50


Cool!


 I don't believe Java on Azure has the same restrictions as Java on
 GAE.  For example, you can write to the local filesystem and use
 threads.  Using the REST-based Azure Tables datastore (non-RDBMS) with
 Lift's ORM might be tricky,


But maybe the Record stuff could work.


 but SQL Azure is available via JDBC.  Or,
 as far as I know Derby should work.


It'd be interesting to support SQL Azure... I'm betting it's not a material
deviation from SQL Server.



 I think you need to be on Windows to develop though, even though the
 example in the video just uses Eclipse.  For one thing, the desktop
 version of Azure is Windows-only.

 --

 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=.





-- 
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=.




Re: [Lift] Re: Lift Mapper support for Oracle Sequences

2009-11-19 Thread Derek Chen-Becker
I think that the change was committed pre-M7, so you should have it.

On Thu, Nov 19, 2009 at 12:12 AM, aw anth...@whitford.com wrote:

 Thank you Derek...  Clever trick!

 I'm not using 1.1-SNAPSHOT -- I am using 1.1-M7...  But that shouldn't
 matter to me since I am not using Schemifier to create and manage the
 database...  (I am using LiquiBase.)

 I had imagined an alternative strategy whereby I would provide a
 sequence name to the id object and then it would simply create
 statements like:

  insert into Table (id, colA, colB, colC) values
 (Table_Sequence.NextVal, colA, colB, colC)

 but the more I think about it...  I'm thinking your strategy insulates
 my code from declaring anything Oracle specific in my mapper
 objects...

 I will give this a go.  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 at
 http://groups.google.com/group/liftweb?hl=.




--

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=.




Re: [Lift] Re: odd ajax issue (works every other time)

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 1:45 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:



 On Nov 19, 8:16 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Wed, Nov 18, 2009 at 10:28 PM, Marius marius.dan...@gmail.com
 wrote:
   That makes two of us David ...
 
   The thing is that during my debugging there was no session destruction
   and I traced this right in the guts of SessionMaster.
 
  I went further and it seemed that the sessions were destroyed at the
 Servlet
  Container level.

 I can't say I grok the lift request cycle, but I looked into the jetty
 part and this is what I think happens:

 At some point getCookies is called (by Lift) on a HttpServletRequest
 that seems invalid (ie empty).


Excellent... I understand... this is awesomely helpful (and subject to a
simple and very lazy fix)  Thanks!


 This causes the internal state of the
 request object to be marked cookies are parsed. Just there are no
 cookies since the request is empty.

 Jetty recycles the request objects, so later when a request comes in
 that reuses this request object and it tries to fetch the session
 cookie, it sees that cookies are already parsed but can't find the
 session cookie (there are none) and thus creates a new session.

 Why the request object is not re-initialized for the new request I
 don't know...also it doesn't really explain the error on Tomcat

 Not sure if this helps...:-)

 /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=.





-- 
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=.




[Lift] Re: intro to lift-json?

2009-11-19 Thread harryh
Ah, ok.  That makes sense.  Thx!

On Nov 19, 5:14 pm, Ross Mellgren dri...@gmail.com wrote:
 JArray is a case class that wraps a List. It's not an array-of-list or  
 anything, just that the actual elements are stored in a List that  
 JArray holds.

 -Ross

 On Nov 19, 2009, at 5:12 PM, harryh wrote:

  Why does this parse into a JArray(List(..)) intead of a JArray(..) ?

  -harryh

  scala parse( { ids : [1, 2] } )
  res5: net.liftweb.json.JsonAST.JValue = JObject(List(JField(ids,JArray
  (List(JInt(1), JInt(2))

  On Nov 19, 3:51 pm, Tim Nelson tnell...@gmail.com wrote:
  Have you seen the readme file?

 http://github.com/dpp/liftweb/tree/master/lift-base/lift-json/

  On Thu, Nov 19, 2009 at 2:20 PM, harryh har...@gmail.com wrote:
  Is there a basic intro to lift-json floating around anywhere?  I'm
  having a bit of trouble getting started with a couple basic things.
  For example if a have a JObject that corresponds to:

  {
   foo : {
     bar : 999
   }
  }

  How do I get the 999 (as an int) out of the JObject?  I'm sure  
  this is
  simple, just a bit confused on the basics.

  -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=.

  --

  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=
  .

--

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=.




[Lift] How can one bind attribute values in a snippet?

2009-11-19 Thread Alex Black
For example, if my html template looks like this:

lift:surround with=default at=content
h2foobar/h2
lift:MySnippet.render
img src=dummy/
/lift:MySnippet.render
/lift:surround

In my snippet I'd like to replace dummy (in img src) with a real
value.  I'm sure there are other ways to output img tags with
attribute values, but I'm specifically interested in this general
case: writing the presentation in the template, and filling in the
attribute value from code.

Thanks!

- Alex

--

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=.




Re: [Lift] A sensible AJAX approach

2009-11-19 Thread Jeppe Nejsum Madsen
Chris Lewis burningodzi...@gmail.com writes:

 Classic use case: a user chooses to view/edit and object by clicking on 
 a link. This causes the app to fetch an edit view (form) and render it 
 asynchronously, probably rendering it as a modal dialog. To specify the 
 case a bit more, consider a table of like objects that allows you to 
 edit them (orders or accounts). As far as the user experience, clicking 
 edit for one would yield the same edit form as any other - only the 
 contents (the target of the edit) would change.

Seems you're a few steps ahead of me. I'll be looking at basically the same
use case soon :-)

 Normal ajax forms in lift are simple - just wrap the bind in an ajax 
 form (http://is.gd/4Z61Z) and you get an async submit with essentially 
 the same template code.

 But what about ajax forms delivered by ajax? What's the best way to 
 implement this in lift? It seems like there are two routes: client and 
 server-based.

Agreed

 1) In the client-based approach, I can declare an invisible form in the 
 template, as well as write some static javascript to do the heavy 
 lifting (no pun intended). This JS would be responsible for receiving 
 the data representing the object to edit from the server as json, 
 unpacking it into the form for editing, rendering the form, handling the 
 submit as ajax, and finally hiding the form.

 This means writing a good bit more JS by hand, but it keeps the 
 (compiled) snippet code smaller. Ordinarily I'd see that as good, but 
 more and more snippets seem like they are intended for such heavy view 
 meddling.

Probably depends on the app. If it's mostly a single-url, js based app
this would work. Personally (and since I'm not a JS ninja :-) I try to
limit the amount of client side code to the where it makes sense. I
think the development experience (for me) is better with a statically
typed languagne (tdd etc).

 2) The server-based approach would require very little of the main 
 template: basically just a containing element (w/ dom id) to host the 
 delivered form. The snippet itself would yield a form on an ajax call 
 via SetHtml. It would also have to set up the handlers and populate the 
 form contents with the target object.

 This is the part that I'm not clear on. I know I can just inline the XML 
 with bind points as if it were in a form, but that just feels strange. 
 Would it make more sense to use an external template, similar to a rails 
 partial? Is there a template loading facility for this?

I've been doing this (external templates) and it works great. Very easy
for designers to modify layout etc.

Here's a simple example the changes several page elements when a select
is changed:

 bind(select, in, 
 type - ajaxSelectObj(reportTypes, currentType.is,
(f:ResultF) = {
  currentResult(Empty)
  currentType(Full(f))
  val nodeseq = 
TemplateFinder.findAnyTemplate(List(tender, results)).open_!
  SetHtml(comparison, resultComparison(tender, 
chooseTemplate(lift, tender.result_comparison, nodeseq))) 
  SetHtml(summary, segmentSummary(tender, 
chooseTemplate(lift, tender.segment_summary, nodeseq)))
  })
)

Here the two elements are read from the same template file but it could
easily be split...

/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=.




[Lift] Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread Alex Black
I've been developing a REST api using Lift, and have just added some
basic html templates to it, and started using a snippet or two.

As I'm testing out my pages I'm noticing a number of odd things:
1. Often when I alt tab back to my browser, its not on the page i left
it on (say http://localhost:8080/mypage.html), instead its on
http://localhost:8080/ somehow.

2. I'm seeing requests in the jetty console like this:

INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
Milliseconds

I'm not using any AJAX at the moment, is there a way to turn this off?

3. Again, seemingly randomly, I get Couldn't start SessionMaster
ping errors:

ERROR - Couldn't start SessionMaster ping
net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
$checkandpur...@6326c98 could not be scheduled on
net.liftweb.http.sessionmast...@58777255
at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
$doPing(LiftSession.scala:209)
at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
$1.apply(LiftSession.scala:200)
at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
$1.apply(LiftSession.scala:169)
at scala.actors.Reaction.run(Reaction.scala:79)
at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
Source)
at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.util.concurrent.RejectedExecutionException
at java.util.concurrent.ThreadPoolExecutor
$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
at java.util.concurrent.ThreadPoolExecutor.reject
(ThreadPoolExecutor.java:767)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
(ScheduledThreadPoolExecutor.java:216)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
(ScheduledThreadPoolExecutor.java:379)
at java.util.concurrent.Executors
$DelegatedScheduledExecutorService.schedule(Executors.java:654)
at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
... 7 more

I might well have butchered something - when I started I removed some
of the boiler plate stuff created by the archetype that I didn't see
as necessary for the REST web service.

But, stuff is generally working, I can add templates, call snippets
from them etc.

Thanks,

- Alex

--

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=.




Re: [Lift] Problem with issue 182

2009-11-19 Thread Jeppe Nejsum Madsen
Derek Chen-Becker dchenbec...@gmail.com writes:

 I hadn't though about mixing in CRUDify with users. I suppose we should just
 pull it out and leave sitemap as the sole menuing method. Jeppe, can you
 open a ticket?

Sure: http://github.com/dpp/liftweb/issues/#issue/200

/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=.




Re: [Lift] Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread David Pollak
If you're doing mvn jetty:run, please edit your pom.xml and change:

 scanIntervalSeconds5/scanIntervalSeconds

to

 scanIntervalSeconds0/scanIntervalSeconds

On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca wrote:

 I've been developing a REST api using Lift, and have just added some
 basic html templates to it, and started using a snippet or two.

 As I'm testing out my pages I'm noticing a number of odd things:
 1. Often when I alt tab back to my browser, its not on the page i left
 it on (say http://localhost:8080/mypage.html), instead its on
 http://localhost:8080/ somehow.

 2. I'm seeing requests in the jetty console like this:

 INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
 Milliseconds

 I'm not using any AJAX at the moment, is there a way to turn this off?

 3. Again, seemingly randomly, I get Couldn't start SessionMaster
 ping errors:

 ERROR - Couldn't start SessionMaster ping
 net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
 $checkandpur...@6326c98 could not be scheduled on
 net.liftweb.http.sessionmast...@58777255
at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
 $doPing(LiftSession.scala:209)
at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
 $1.apply(LiftSession.scala:200)
at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
 $1.apply(LiftSession.scala:169)
at scala.actors.Reaction.run(Reaction.scala:79)
at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
 Source)
at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
 Source)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.util.concurrent.RejectedExecutionException
at java.util.concurrent.ThreadPoolExecutor
 $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
at java.util.concurrent.ThreadPoolExecutor.reject
 (ThreadPoolExecutor.java:767)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
 (ScheduledThreadPoolExecutor.java:216)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
 (ScheduledThreadPoolExecutor.java:379)
at java.util.concurrent.Executors
 $DelegatedScheduledExecutorService.schedule(Executors.java:654)
at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
... 7 more

 I might well have butchered something - when I started I removed some
 of the boiler plate stuff created by the archetype that I didn't see
 as necessary for the REST web service.

 But, stuff is generally working, I can add templates, call snippets
 from them etc.

 Thanks,

 - Alex

 --

 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=.





-- 
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=.




[Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread Alex Black
Yep, I am doing mvn jetty:run.. ok, I've edited my pom.xml, I'll keep
an eye out and see how it goes.

Related question: I see my pages have this in them:

script type=text/javascript src=/ajax_request/liftAjax.js

I'm not yet using any ajax stuff, can I remove that until I need it? I
don't see it in default.html, where do I find it?

- Alex

On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 If you're doing mvn jetty:run, please edit your pom.xml and change:

  scanIntervalSeconds5/scanIntervalSeconds

 to

  scanIntervalSeconds0/scanIntervalSeconds



 On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca wrote:
  I've been developing a REST api using Lift, and have just added some
  basic html templates to it, and started using a snippet or two.

  As I'm testing out my pages I'm noticing a number of odd things:
  1. Often when I alt tab back to my browser, its not on the page i left
  it on (sayhttp://localhost:8080/mypage.html), instead its on
 http://localhost:8080/somehow.

  2. I'm seeing requests in the jetty console like this:

  INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
  Milliseconds

  I'm not using any AJAX at the moment, is there a way to turn this off?

  3. Again, seemingly randomly, I get Couldn't start SessionMaster
  ping errors:

  ERROR - Couldn't start SessionMaster ping
  net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
  $checkandpur...@6326c98 could not be scheduled on
  net.liftweb.http.sessionmast...@58777255
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
         at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
  $doPing(LiftSession.scala:209)
         at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:200)
         at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:169)
         at scala.actors.Reaction.run(Reaction.scala:79)
         at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
  Source)
         at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
  Source)
         at java.lang.Thread.run(Thread.java:619)
  Caused by: java.util.concurrent.RejectedExecutionException
         at java.util.concurrent.ThreadPoolExecutor
  $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
         at java.util.concurrent.ThreadPoolExecutor.reject
  (ThreadPoolExecutor.java:767)
         at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
  (ScheduledThreadPoolExecutor.java:216)
         at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
  (ScheduledThreadPoolExecutor.java:379)
         at java.util.concurrent.Executors
  $DelegatedScheduledExecutorService.schedule(Executors.java:654)
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
         ... 7 more

  I might well have butchered something - when I started I removed some
  of the boiler plate stuff created by the archetype that I didn't see
  as necessary for the REST web service.

  But, stuff is generally working, I can add templates, call snippets
  from them etc.

  Thanks,

  - Alex

  --

  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=.

 --
 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=.




Re: [Lift] How can one bind attribute values in a snippet?

2009-11-19 Thread Jeppe Nejsum Madsen
Alex Black a...@alexblack.ca writes:

 For example, if my html template looks like this:

 lift:surround with=default at=content
   h2foobar/h2
 lift:MySnippet.render
 img src=dummy/
 /lift:MySnippet.render
 /lift:surround

 In my snippet I'd like to replace dummy (in img src) with a real
 value.  I'm sure there are other ways to output img tags with
 attribute values, but I'm specifically interested in this general
 case: writing the presentation in the template, and filling in the
 attribute value from code.

Use AttrBindParam and prefix the attribute with the bind point

Template:
  td values:rankClass=values:tco//td


Code:
 bind(values, in, 
  BindNumber(tco, res.filteredResult(lc).avgTCO(segment)),
  
AttrBindParam(rankClass,Text(rankClass(res.rankBySegment(lc, segment))), 
class)
 )

This will render
 td class=something42/td

/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=.




[Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread Alex Black
After changing that setting, i'm still seeing these requests:

INFO - Service request (POST) /ajax_request/F688441898562ZPV/ took 9
Milliseconds

That must be something called by that ajax script?  Is there a way I
can turn this off until I need it?

- Alex

On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 If you're doing mvn jetty:run, please edit your pom.xml and change:

  scanIntervalSeconds5/scanIntervalSeconds

 to

  scanIntervalSeconds0/scanIntervalSeconds



 On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca wrote:
  I've been developing a REST api using Lift, and have just added some
  basic html templates to it, and started using a snippet or two.

  As I'm testing out my pages I'm noticing a number of odd things:
  1. Often when I alt tab back to my browser, its not on the page i left
  it on (sayhttp://localhost:8080/mypage.html), instead its on
 http://localhost:8080/somehow.

  2. I'm seeing requests in the jetty console like this:

  INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
  Milliseconds

  I'm not using any AJAX at the moment, is there a way to turn this off?

  3. Again, seemingly randomly, I get Couldn't start SessionMaster
  ping errors:

  ERROR - Couldn't start SessionMaster ping
  net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
  $checkandpur...@6326c98 could not be scheduled on
  net.liftweb.http.sessionmast...@58777255
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
         at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
  $doPing(LiftSession.scala:209)
         at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:200)
         at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:169)
         at scala.actors.Reaction.run(Reaction.scala:79)
         at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
  Source)
         at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
  Source)
         at java.lang.Thread.run(Thread.java:619)
  Caused by: java.util.concurrent.RejectedExecutionException
         at java.util.concurrent.ThreadPoolExecutor
  $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
         at java.util.concurrent.ThreadPoolExecutor.reject
  (ThreadPoolExecutor.java:767)
         at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
  (ScheduledThreadPoolExecutor.java:216)
         at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
  (ScheduledThreadPoolExecutor.java:379)
         at java.util.concurrent.Executors
  $DelegatedScheduledExecutorService.schedule(Executors.java:654)
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
         ... 7 more

  I might well have butchered something - when I started I removed some
  of the boiler plate stuff created by the archetype that I didn't see
  as necessary for the REST web service.

  But, stuff is generally working, I can add templates, call snippets
  from them etc.

  Thanks,

  - Alex

  --

  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=.

 --
 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=.




[Lift] Re: How can one bind attribute values in a snippet?

2009-11-19 Thread Alex Black
Thanks Jeppe, that looks like what I need.

I'm having trouble following your example though, what are res,
filteredResult, lc, etc?  My code looks like this right now:

def render( xhtml: NodeSeq ): NodeSeq {
  items.flatMap( f =
  bind(item, xhtml,
name - item.name
  )
}

so presumably I'd need to add to that to bind an attribute called
value:

def render( xhtml: NodeSeq ): NodeSeq {
  items.flatMap( f =
  bind(item, xhtml,
 name - item.name,
 AttrBindParam(value, item.value)
  )
}


  bind(values, in,
   BindNumber(tco, 
 res.filteredResult(lc).avgTCO(segment)),
   
 AttrBindParam(rankClass,Text(rankClass(res.rankBySegment(lc, segment))), 
 class)
  )


On Nov 19, 5:46 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Alex Black a...@alexblack.ca writes:
  For example, if my html template looks like this:

  lift:surround with=default at=content
             h2foobar/h2
                  lift:MySnippet.render
                  img src=dummy/
                  /lift:MySnippet.render
  /lift:surround

  In my snippet I'd like to replace dummy (in img src) with a real
  value.  I'm sure there are other ways to output img tags with
  attribute values, but I'm specifically interested in this general
  case: writing the presentation in the template, and filling in the
  attribute value from code.

 Use AttrBindParam and prefix the attribute with the bind point

 Template:
       td values:rankClass=values:tco//td

 Code:
                  bind(values, in,
                       BindNumber(tco, 
 res.filteredResult(lc).avgTCO(segment)),
                       
 AttrBindParam(rankClass,Text(rankClass(res.rankBySegment(lc, segment))), 
 class)
                  )

 This will render
  td class=something42/td

 /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=.




[Lift] Re: How can one bind attribute values in a snippet?

2009-11-19 Thread Alex Black
I got it working, thanks again Jeppe.

On Nov 19, 5:46 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Alex Black a...@alexblack.ca writes:
  For example, if my html template looks like this:

  lift:surround with=default at=content
             h2foobar/h2
                  lift:MySnippet.render
                  img src=dummy/
                  /lift:MySnippet.render
  /lift:surround

  In my snippet I'd like to replace dummy (in img src) with a real
  value.  I'm sure there are other ways to output img tags with
  attribute values, but I'm specifically interested in this general
  case: writing the presentation in the template, and filling in the
  attribute value from code.

 Use AttrBindParam and prefix the attribute with the bind point

 Template:
       td values:rankClass=values:tco//td

 Code:
                  bind(values, in,
                       BindNumber(tco, 
 res.filteredResult(lc).avgTCO(segment)),
                       
 AttrBindParam(rankClass,Text(rankClass(res.rankBySegment(lc, segment))), 
 class)
                  )

 This will render
  td class=something42/td

 /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=.




[Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread Alex Black
I just did some work, restarted jetty, and upon startup saw that it
processed two requests (that I hadn't initiated):

INFO - Service request (POST) /ajax_request/F374747850325CGX/ took 104
Milliseconds
INFO - Service request (GET) / took 22 Milliseconds

I then looked at my browser and it has somehow gone back to / from
the page it was on.

thoughts?

On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 If you're doing mvn jetty:run, please edit your pom.xml and change:

  scanIntervalSeconds5/scanIntervalSeconds

 to

  scanIntervalSeconds0/scanIntervalSeconds



 On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca wrote:
  I've been developing a REST api using Lift, and have just added some
  basic html templates to it, and started using a snippet or two.

  As I'm testing out my pages I'm noticing a number of odd things:
  1. Often when I alt tab back to my browser, its not on the page i left
  it on (sayhttp://localhost:8080/mypage.html), instead its on
 http://localhost:8080/somehow.

  2. I'm seeing requests in the jetty console like this:

  INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
  Milliseconds

  I'm not using any AJAX at the moment, is there a way to turn this off?

  3. Again, seemingly randomly, I get Couldn't start SessionMaster
  ping errors:

  ERROR - Couldn't start SessionMaster ping
  net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
  $checkandpur...@6326c98 could not be scheduled on
  net.liftweb.http.sessionmast...@58777255
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
         at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
  $doPing(LiftSession.scala:209)
         at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:200)
         at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:169)
         at scala.actors.Reaction.run(Reaction.scala:79)
         at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
  Source)
         at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
  Source)
         at java.lang.Thread.run(Thread.java:619)
  Caused by: java.util.concurrent.RejectedExecutionException
         at java.util.concurrent.ThreadPoolExecutor
  $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
         at java.util.concurrent.ThreadPoolExecutor.reject
  (ThreadPoolExecutor.java:767)
         at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
  (ScheduledThreadPoolExecutor.java:216)
         at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
  (ScheduledThreadPoolExecutor.java:379)
         at java.util.concurrent.Executors
  $DelegatedScheduledExecutorService.schedule(Executors.java:654)
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
         ... 7 more

  I might well have butchered something - when I started I removed some
  of the boiler plate stuff created by the archetype that I didn't see
  as necessary for the REST web service.

  But, stuff is generally working, I can add templates, call snippets
  from them etc.

  Thanks,

  - Alex

  --

  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=.

 --
 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=.




Re: [Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 3:18 PM, Alex Black a...@alexblack.ca wrote:

 I just did some work, restarted jetty, and upon startup saw that it
 processed two requests (that I hadn't initiated):

 INFO - Service request (POST) /ajax_request/F374747850325CGX/ took 104
 Milliseconds
 INFO - Service request (GET) / took 22 Milliseconds

 I then looked at my browser and it has somehow gone back to / from
 the page it was on.

 thoughts?


This is defined behavior.  The Lift app will reload the current page on app
server restart (for 1.1-M6+) or / for prior versions of Lift.



 On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  If you're doing mvn jetty:run, please edit your pom.xml and change:
 
   scanIntervalSeconds5/scanIntervalSeconds
 
  to
 
   scanIntervalSeconds0/scanIntervalSeconds
 
 
 
  On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca wrote:
   I've been developing a REST api using Lift, and have just added some
   basic html templates to it, and started using a snippet or two.
 
   As I'm testing out my pages I'm noticing a number of odd things:
   1. Often when I alt tab back to my browser, its not on the page i left
   it on (sayhttp://localhost:8080/mypage.html), instead its on
  http://localhost:8080/somehow.
 
   2. I'm seeing requests in the jetty console like this:
 
   INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
   Milliseconds
 
   I'm not using any AJAX at the moment, is there a way to turn this off?
 
   3. Again, seemingly randomly, I get Couldn't start SessionMaster
   ping errors:
 
   ERROR - Couldn't start SessionMaster ping
   net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
   $checkandpur...@6326c98 could not be scheduled on
   net.liftweb.http.sessionmast...@58777255
  at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
  at
 net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
   $doPing(LiftSession.scala:209)
  at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
   $1.apply(LiftSession.scala:200)
  at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
   $1.apply(LiftSession.scala:169)
  at scala.actors.Reaction.run(Reaction.scala:79)
  at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
   Source)
  at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
   Source)
  at java.lang.Thread.run(Thread.java:619)
   Caused by: java.util.concurrent.RejectedExecutionException
  at java.util.concurrent.ThreadPoolExecutor
   $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
  at java.util.concurrent.ThreadPoolExecutor.reject
   (ThreadPoolExecutor.java:767)
  at
 java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
   (ScheduledThreadPoolExecutor.java:216)
  at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
   (ScheduledThreadPoolExecutor.java:379)
  at java.util.concurrent.Executors
   $DelegatedScheduledExecutorService.schedule(Executors.java:654)
  at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
  ... 7 more
 
   I might well have butchered something - when I started I removed some
   of the boiler plate stuff created by the archetype that I didn't see
   as necessary for the REST web service.
 
   But, stuff is generally working, I can add templates, call snippets
   from them etc.
 
   Thanks,
 
   - Alex
 
   --
 
   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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  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.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.





-- 
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 

[Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread Alex Black
thanks for the explanation. Can you tell me a bit more about that?
Not knowing anything about this it seem unfamiliar to me.

Say we had customers using our site, and we restarted one of our
webservers, the customers wouldn't expect to be redirected to /.
They'd expect to just keep on browsing as if nothing had happened.

On Nov 19, 6:28 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Thu, Nov 19, 2009 at 3:18 PM, Alex Black a...@alexblack.ca wrote:
  I just did some work, restarted jetty, and upon startup saw that it
  processed two requests (that I hadn't initiated):

  INFO - Service request (POST) /ajax_request/F374747850325CGX/ took 104
  Milliseconds
  INFO - Service request (GET) / took 22 Milliseconds

  I then looked at my browser and it has somehow gone back to / from
  the page it was on.

  thoughts?

 This is defined behavior.  The Lift app will reload the current page on app
 server restart (for 1.1-M6+) or / for prior versions of Lift.





  On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   If you're doing mvn jetty:run, please edit your pom.xml and change:

    scanIntervalSeconds5/scanIntervalSeconds

   to

    scanIntervalSeconds0/scanIntervalSeconds

   On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca wrote:
I've been developing a REST api using Lift, and have just added some
basic html templates to it, and started using a snippet or two.

As I'm testing out my pages I'm noticing a number of odd things:
1. Often when I alt tab back to my browser, its not on the page i left
it on (sayhttp://localhost:8080/mypage.html), instead its on
   http://localhost:8080/somehow.

2. I'm seeing requests in the jetty console like this:

INFO - Service request (POST) /ajax_request/F119708427865SPY/ took 52
Milliseconds

I'm not using any AJAX at the moment, is there a way to turn this off?

3. Again, seemingly randomly, I get Couldn't start SessionMaster
ping errors:

ERROR - Couldn't start SessionMaster ping
net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
$checkandpur...@6326c98 could not be scheduled on
net.liftweb.http.sessionmast...@58777255
       at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
       at
  net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
$doPing(LiftSession.scala:209)
       at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
$1.apply(LiftSession.scala:200)
       at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
$1.apply(LiftSession.scala:169)
       at scala.actors.Reaction.run(Reaction.scala:79)
       at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
Source)
       at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
Source)
       at java.lang.Thread.run(Thread.java:619)
Caused by: java.util.concurrent.RejectedExecutionException
       at java.util.concurrent.ThreadPoolExecutor
$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
       at java.util.concurrent.ThreadPoolExecutor.reject
(ThreadPoolExecutor.java:767)
       at
  java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
(ScheduledThreadPoolExecutor.java:216)
       at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
(ScheduledThreadPoolExecutor.java:379)
       at java.util.concurrent.Executors
$DelegatedScheduledExecutorService.schedule(Executors.java:654)
       at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
       ... 7 more

I might well have butchered something - when I started I removed some
of the boiler plate stuff created by the archetype that I didn't see
as necessary for the REST web service.

But, stuff is generally working, I can add templates, call snippets
from them etc.

Thanks,

- Alex

--

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
  liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com

.
For more options, visit this group at
   http://groups.google.com/group/liftweb?hl=.

   --
   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.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.

 --
 Lift, the 

Re: [Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 3:31 PM, Alex Black a...@alexblack.ca wrote:

 thanks for the explanation. Can you tell me a bit more about that?
 Not knowing anything about this it seem unfamiliar to me.

 Say we had customers using our site, and we restarted one of our
 webservers, the customers wouldn't expect to be redirected to /.
 They'd expect to just keep on browsing as if nothing had happened.


In the more recent versions of Lift, the browsers will be redirected to the
page that they are on.

But, if there are forms, ajax elements, etc. and you restart the server, the
current state will be lost and the users will experience a this thing isn't
working so we refresh the user's current page so they have a better chance
of having the right experience.

If you don't like the feature, you can turn it off in LiftRules (I don't
remember the property off hand, but I'm sure someone else can help me.)



 On Nov 19, 6:28 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Thu, Nov 19, 2009 at 3:18 PM, Alex Black a...@alexblack.ca wrote:
   I just did some work, restarted jetty, and upon startup saw that it
   processed two requests (that I hadn't initiated):
 
   INFO - Service request (POST) /ajax_request/F374747850325CGX/ took 104
   Milliseconds
   INFO - Service request (GET) / took 22 Milliseconds
 
   I then looked at my browser and it has somehow gone back to / from
   the page it was on.
 
   thoughts?
 
  This is defined behavior.  The Lift app will reload the current page on
 app
  server restart (for 1.1-M6+) or / for prior versions of Lift.
 
 
 
 
 
   On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
   wrote:
If you're doing mvn jetty:run, please edit your pom.xml and change:
 
 scanIntervalSeconds5/scanIntervalSeconds
 
to
 
 scanIntervalSeconds0/scanIntervalSeconds
 
On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca
 wrote:
 I've been developing a REST api using Lift, and have just added
 some
 basic html templates to it, and started using a snippet or two.
 
 As I'm testing out my pages I'm noticing a number of odd things:
 1. Often when I alt tab back to my browser, its not on the page i
 left
 it on (sayhttp://localhost:8080/mypage.html), instead its on
http://localhost:8080/somehow.
 
 2. I'm seeing requests in the jetty console like this:
 
 INFO - Service request (POST) /ajax_request/F119708427865SPY/ took
 52
 Milliseconds
 
 I'm not using any AJAX at the moment, is there a way to turn this
 off?
 
 3. Again, seemingly randomly, I get Couldn't start SessionMaster
 ping errors:
 
 ERROR - Couldn't start SessionMaster ping
 net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
 $checkandpur...@6326c98 could not be scheduled on
 net.liftweb.http.sessionmast...@58777255
at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
at
   net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
 $doPing(LiftSession.scala:209)
at
 net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
 $1.apply(LiftSession.scala:200)
at
 net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
 $1.apply(LiftSession.scala:169)
at scala.actors.Reaction.run(Reaction.scala:79)
at
 scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
 Source)
at
 scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
 Source)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.util.concurrent.RejectedExecutionException
at java.util.concurrent.ThreadPoolExecutor
 $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
at java.util.concurrent.ThreadPoolExecutor.reject
 (ThreadPoolExecutor.java:767)
at
   java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
 (ScheduledThreadPoolExecutor.java:216)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
 (ScheduledThreadPoolExecutor.java:379)
at java.util.concurrent.Executors
 $DelegatedScheduledExecutorService.schedule(Executors.java:654)
at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
... 7 more
 
 I might well have butchered something - when I started I removed
 some
 of the boiler plate stuff created by the archetype that I didn't
 see
 as necessary for the REST web service.
 
 But, stuff is generally working, I can add templates, call snippets
 from them etc.
 
 Thanks,
 
 - Alex
 
 --
 
 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
 

[Lift] JRebel: implements new interfaces and could not be reloaded!

2009-11-19 Thread Alex Black
Anyone got any tips on working around this error?

JRebel: Class 'com.blah.blah.explorer.snippet.Features$$anonfun$render
$1' implements new interfaces and could not be reloaded!

I've just tried JRebel for the first time, and I made what I thought
was a minor change to my snippet and JRebel wasn't able to reload it.

The change I made was to uncomment the sort line in this snippet:

class Features {
  def render( xhtml: NodeSeq) : NodeSeq = {
Server.store
  .classes
  //.sort( (c1,c2) = c1.name.toString  c2.name.toString)
  .flatMap( c =
  bind(feature, xhtml,
name - c.name
  )
)
  }
}

Thanks,

- Alex

--

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=.




[Lift] Re: Pages getting redirected back to root, /ajax_request/?? and ActorPingException

2009-11-19 Thread Alex Black
Yeah I'm currently approaching the stateful aspect of Lift with some
trepidation, so for now trying to avoid it, for exactly this type of
reason.

If someone could point out how to disable the mechanism that is
redirecting the page, and making periodic ajax requests I'd appreciate
it, thanks!

- Alex

On Nov 19, 6:54 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Thu, Nov 19, 2009 at 3:31 PM, Alex Black a...@alexblack.ca wrote:
  thanks for the explanation. Can you tell me a bit more about that?
  Not knowing anything about this it seem unfamiliar to me.

  Say we had customers using our site, and we restarted one of our
  webservers, the customers wouldn't expect to be redirected to /.
  They'd expect to just keep on browsing as if nothing had happened.

 In the more recent versions of Lift, the browsers will be redirected to the
 page that they are on.

 But, if there are forms, ajax elements, etc. and you restart the server, the
 current state will be lost and the users will experience a this thing isn't
 working so we refresh the user's current page so they have a better chance
 of having the right experience.

 If you don't like the feature, you can turn it off in LiftRules (I don't
 remember the property off hand, but I'm sure someone else can help me.)





  On Nov 19, 6:28 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   On Thu, Nov 19, 2009 at 3:18 PM, Alex Black a...@alexblack.ca wrote:
I just did some work, restarted jetty, and upon startup saw that it
processed two requests (that I hadn't initiated):

INFO - Service request (POST) /ajax_request/F374747850325CGX/ took 104
Milliseconds
INFO - Service request (GET) / took 22 Milliseconds

I then looked at my browser and it has somehow gone back to / from
the page it was on.

thoughts?

   This is defined behavior.  The Lift app will reload the current page on
  app
   server restart (for 1.1-M6+) or / for prior versions of Lift.

On Nov 19, 5:40 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 If you're doing mvn jetty:run, please edit your pom.xml and change:

  scanIntervalSeconds5/scanIntervalSeconds

 to

  scanIntervalSeconds0/scanIntervalSeconds

 On Thu, Nov 19, 2009 at 2:32 PM, Alex Black a...@alexblack.ca
  wrote:
  I've been developing a REST api using Lift, and have just added
  some
  basic html templates to it, and started using a snippet or two.

  As I'm testing out my pages I'm noticing a number of odd things:
  1. Often when I alt tab back to my browser, its not on the page i
  left
  it on (sayhttp://localhost:8080/mypage.html), instead its on
 http://localhost:8080/somehow.

  2. I'm seeing requests in the jetty console like this:

  INFO - Service request (POST) /ajax_request/F119708427865SPY/ took
  52
  Milliseconds

  I'm not using any AJAX at the moment, is there a way to turn this
  off?

  3. Again, seemingly randomly, I get Couldn't start SessionMaster
  ping errors:

  ERROR - Couldn't start SessionMaster ping
  net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
  $checkandpur...@6326c98 could not be scheduled on
  net.liftweb.http.sessionmast...@58777255
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51)
         at
net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
  $doPing(LiftSession.scala:209)
         at
  net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:200)
         at
  net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply
  $1.apply(LiftSession.scala:169)
         at scala.actors.Reaction.run(Reaction.scala:79)
         at
  scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown
  Source)
         at
  scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown
  Source)
         at java.lang.Thread.run(Thread.java:619)
  Caused by: java.util.concurrent.RejectedExecutionException
         at java.util.concurrent.ThreadPoolExecutor
  $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
         at java.util.concurrent.ThreadPoolExecutor.reject
  (ThreadPoolExecutor.java:767)
         at
java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
  (ScheduledThreadPoolExecutor.java:216)
         at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
  (ScheduledThreadPoolExecutor.java:379)
         at java.util.concurrent.Executors
  $DelegatedScheduledExecutorService.schedule(Executors.java:654)
         at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49)
         ... 7 more

  I might well have butchered something - when I started I removed
  some
  of the boiler plate stuff created by the archetype that I didn't
  see
  as necessary for the REST web service.

  But, stuff is generally working, I can add 

Re: [Lift] H2 foreign keys

2009-11-19 Thread Derek Chen-Becker
Great. No pressure now! ;)

On Thu, Nov 19, 2009 at 3:17 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Thu, Nov 19, 2009 at 2:08 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 Open a ticket and I'll see if I can get it done. I've been fighting a fire
 at work pretty much the entire week so far, so needless to say I'm behind on
 Lift tickets (and LiftTicket :( )


 I so want LiftTicket... I'm waiting with baited breath... maybe it'll be an
 early birthday present...



 Derek


 On Wed, Nov 18, 2009 at 7:04 AM, Naftoli Gugenheim 
 naftoli...@gmail.comwrote:

 I don't think I ended up creating the ticket, but do you want to
 volunteer to fix this?
 IIRC the H2 syntax was like the currently used syntax but without the
 firsy to words or so. Search the H2 SQL Grammar page.
 Thanks.
 P.S. I wonder which other DBs use H2's syntax.

 -
 Derek Chen-Beckerdchenbec...@gmail.com wrote:

 That's what I've been doing as we have to make changes. For instance, we
 needed to change how schemifier creates index columns to accomodate
 Oracle
 sequences, so I moved that to DriverType.

 On Sun, Nov 15, 2009 at 10:24 AM, Naftoli Gugenheim 
 naftoli...@gmail.comwrote:

 
  The H2 DriverType does not indicate H2 supports foreign key
 constraints.
  However it does, albeit with a different syntax than Schemifier uses.
  I'll try to file a ticket later. If I decide to work on it, what would
 be
  the best way? Refactor the SQL in Schemifier to be generated by the
  DriverType?
 
 
  --~--~-~--~~~---~--~~
  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
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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=.


 --

 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=.



  --
 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=.




 --
 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=.


--

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=.




Re: [Lift] JRebel: implements new interfaces and could not be reloaded!

2009-11-19 Thread Kris Nuttycombe
Unfortunately, JRebel is sensitive to certain kinds of changes;
changes to the names of the generated classes for function literals is
one of them. In this case, since you've got two function literals in
the class, their names are something$1 and something$2 or equivalent.
After commenting out the line, the second one is now something$1,
which has a totally different interface.

You can work around it if you really want to, but it's probably easier
(or at least prettier code) to just restart the server.

Also, just stylistically, that commented line could be:

  //.sort(_.name.toString  _.name.toString)

Kris

On Thu, Nov 19, 2009 at 4:56 PM, Alex Black a...@alexblack.ca wrote:
 Anyone got any tips on working around this error?

 JRebel: Class 'com.blah.blah.explorer.snippet.Features$$anonfun$render
 $1' implements new interfaces and could not be reloaded!

 I've just tried JRebel for the first time, and I made what I thought
 was a minor change to my snippet and JRebel wasn't able to reload it.

 The change I made was to uncomment the sort line in this snippet:

 class Features {
  def render( xhtml: NodeSeq) : NodeSeq = {
    Server.store
      .classes
      //.sort( (c1,c2) = c1.name.toString  c2.name.toString)
      .flatMap( c =
      bind(feature, xhtml,
        name - c.name
      )
    )
  }
 }

 Thanks,

 - Alex

 --

 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=.




--

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=.




[Lift] Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread David Pollak
Folks,

I'm pleased to announce that Ross Mellgren has joined the Lift committers.
He's been a very helpful voice on the list for a while now and he's decided
to help out with code as well... woo hoo and welcome.

Thanks,

David


-- 
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=.




[Lift] Re: Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread TylerWeir
Welcome Ross!

On Nov 19, 7:38 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Folks,

 I'm pleased to announce that Ross Mellgren has joined the Lift committers.
 He's been a very helpful voice on the list for a while now and he's decided
 to help out with code as well... woo hoo and welcome.

 Thanks,

 David

 --
 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=.




[Lift] Re: [scala-internals] Lift compiles on Scala 2.8 and runs the demo

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 4:44 PM, Paul Phillips pa...@improving.org wrote:

 On Thu, Nov 19, 2009 at 04:31:39PM -0800, David Pollak wrote:
  I spent most of today tracking down a bug that I can't reproduce in
  isolation, but it seems that the ensureCapacity method in Scala's
  StringBuilder method has an infinite:

 Yeah, it was pretty obvious knowing it was there.  This will show it:

  new StringBuilder(0, ).ensureCapacity(1)

 Because:

  while (n  newsize)
newsize = newsize * 2

 And um 0 * 2 == 0


Nice



 --
 Paul Phillips  | Simplicity and elegance are unpopular because
 Stickler   | they require hard work and discipline to achieve
 Empiricist | and education to be appreciated.
 i pull his palp!   | -- Dijkstra




-- 
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=.




Re: [Lift] Re: Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread Margaret
Welcome
-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 8:45 AM, TylerWeir tyler.w...@gmail.com wrote:
 Welcome Ross!

 On Nov 19, 7:38 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 Folks,

 I'm pleased to announce that Ross Mellgren has joined the Lift committers.
 He's been a very helpful voice on the list for a while now and he's decided
 to help out with code as well... woo hoo and welcome.

 Thanks,

 David

 --
 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=.




--

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=.




[Lift] Re: [scala-internals] Lift compiles on Scala 2.8 and runs the demo

2009-11-19 Thread Paul Phillips
On Thu, Nov 19, 2009 at 04:31:39PM -0800, David Pollak wrote:
 I spent most of today tracking down a bug that I can't reproduce in 
 isolation, but it seems that the ensureCapacity method in Scala's 
 StringBuilder method has an infinite:

Yeah, it was pretty obvious knowing it was there.  This will show it:

  new StringBuilder(0, ).ensureCapacity(1)

Because:

  while (n  newsize)
newsize = newsize * 2

And um 0 * 2 == 0

-- 
Paul Phillips  | Simplicity and elegance are unpopular because
Stickler   | they require hard work and discipline to achieve
Empiricist | and education to be appreciated.
i pull his palp!   | -- Dijkstra

--

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=.




[Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Neil.Lv
Hi all,

  I have a silly question about the deploy.

  Which web container is recommended to use to deploy the Lift app ?
Jetty or Tomcat ?

  I want to use the Comet to push the data in the app.

  * Apache + Tomcat ?
  * Apache + what  ?
  * Nginx + what ?

  Thanks for any suggestion !

Cheers,
  Neil

--

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=.




Re: [Lift] A sensible AJAX approach

2009-11-19 Thread Chris Lewis
Thanks for the feedback Jeppe. I can't completely infer the context of 
your example, but I get the idea (and I hadn't known about 
TemplateFinder). Here's what I've hacked together so far.

In my normal snippet, I have a render loop that binds orders to template 
names. One of the bind points looks like this:

..
label - SHtml.a(viewOrder _, Text(View)),
..

Here, viewOrder is a function called by ajax, so a () = JsCmd. I've 
defined it as follows (assume i've imported TemplateFinder.findAnyTemplate):

def viewOrder(): JsCmd = {
   SetHtml(order, SHtml.ajaxForm(
 bind(order, findAnyTemplate(List(orders/_edit_order)).open_!,
   orderNo - Text(order.orderNo),
   submit - SHtml.submit(submit, () = println( -- submit!))
 ) ++ SHtml.hidden(() = println( -- submit!))
   ))
}

Using the usual ajaxForm technique, I wrap the result of a bind which 
results in the contents passed to SetHtml. The funny part is that I 
directly load a template file as a NodeSeq and use that as the arg to 
bind. That template file doesn't call a snippet, but it uses the bind 
points bound in the call - and it works! Here's the full _edit_order.html:

div
   order:orderNo/
   order:submit/
/div

It's just raw xml. No snippet calls, yet bind still processes it 
correctly - even the ajax wiring! I think this is all in all a pretty 
good way to handle the common-edit-dialog problem, and certainly the 
cleanest I've seen yet. I wonder though, is it intentional that bind 
points work when not explicitly wrapped in a snippet call tag?

thanks!

chris

Jeppe Nejsum Madsen wrote:
 Chris Lewis burningodzi...@gmail.com writes:
 
 Classic use case: a user chooses to view/edit and object by clicking on 
 a link. This causes the app to fetch an edit view (form) and render it 
 asynchronously, probably rendering it as a modal dialog. To specify the 
 case a bit more, consider a table of like objects that allows you to 
 edit them (orders or accounts). As far as the user experience, clicking 
 edit for one would yield the same edit form as any other - only the 
 contents (the target of the edit) would change.
 
 Seems you're a few steps ahead of me. I'll be looking at basically the same
 use case soon :-)
 
 Normal ajax forms in lift are simple - just wrap the bind in an ajax 
 form (http://is.gd/4Z61Z) and you get an async submit with essentially 
 the same template code.

 But what about ajax forms delivered by ajax? What's the best way to 
 implement this in lift? It seems like there are two routes: client and 
 server-based.
 
 Agreed
 
 1) In the client-based approach, I can declare an invisible form in the 
 template, as well as write some static javascript to do the heavy 
 lifting (no pun intended). This JS would be responsible for receiving 
 the data representing the object to edit from the server as json, 
 unpacking it into the form for editing, rendering the form, handling the 
 submit as ajax, and finally hiding the form.

 This means writing a good bit more JS by hand, but it keeps the 
 (compiled) snippet code smaller. Ordinarily I'd see that as good, but 
 more and more snippets seem like they are intended for such heavy view 
 meddling.
 
 Probably depends on the app. If it's mostly a single-url, js based app
 this would work. Personally (and since I'm not a JS ninja :-) I try to
 limit the amount of client side code to the where it makes sense. I
 think the development experience (for me) is better with a statically
 typed languagne (tdd etc).
 
 2) The server-based approach would require very little of the main 
 template: basically just a containing element (w/ dom id) to host the 
 delivered form. The snippet itself would yield a form on an ajax call 
 via SetHtml. It would also have to set up the handlers and populate the 
 form contents with the target object.

 This is the part that I'm not clear on. I know I can just inline the XML 
 with bind points as if it were in a form, but that just feels strange. 
 Would it make more sense to use an external template, similar to a rails 
 partial? Is there a template loading facility for this?
 
 I've been doing this (external templates) and it works great. Very easy
 for designers to modify layout etc.
 
 Here's a simple example the changes several page elements when a select
 is changed:
 
  bind(select, in, 
  type - ajaxSelectObj(reportTypes, currentType.is,
 (f:ResultF) = {
   currentResult(Empty)
   currentType(Full(f))
   val nodeseq = 
 TemplateFinder.findAnyTemplate(List(tender, results)).open_!
   SetHtml(comparison, resultComparison(tender, 
 chooseTemplate(lift, tender.result_comparison, nodeseq))) 
   SetHtml(summary, segmentSummary(tender, 
 chooseTemplate(lift, tender.segment_summary, nodeseq)))
   })
 )
 
 Here the two elements are read from the same template file but 

Re: [Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
 * Apache + Tomcat

I deploy a comet actor demo on tomcat
the url is http://maweis.com:8080
you can try it?

-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 9:35 AM, Neil.Lv anim...@gmail.com wrote:
 Hi all,

  I have a silly question about the deploy.

  Which web container is recommended to use to deploy the Lift app ?
 Jetty or Tomcat ?

  I want to use the Comet to push the data in the app.

  * Apache + Tomcat ?
  * Apache + what  ?
  * Nginx + what ?

  Thanks for any suggestion !

 Cheers,
  Neil

 --

 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=.




--

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=.




[Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread monty chen
LVS + Nginx + Haproxy + Tomcat


On 11月20日, 上午9时44分, Margaret mawei...@gmail.com wrote:
  * Apache + Tomcat

 I deploy a comet actor demo on tomcat
 the url ishttp://maweis.com:8080
 you can try it?

 -
 mawei...@gmail.com
 13585201588http://maweis.com

 On Fri, Nov 20, 2009 at 9:35 AM, Neil.Lv anim...@gmail.com wrote:
  Hi all,

   I have a silly question about the deploy.

   Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?

   I want to use the Comet to push the data in the app.

   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?

   Thanks for any suggestion !

  Cheers,
   Neil

  --

  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=.

--

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=.




Re: [Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
perfect enviorment

WHO will be the database ?


-
mawei...@gmail.com
13585201588
http://maweis.com




2009/11/20 monty chen montyc...@qq.com:
 LVS + Nginx + Haproxy + Tomcat


 On 11月20日, 上午9时44分, Margaret mawei...@gmail.com wrote:
  * Apache + Tomcat

 I deploy a comet actor demo on tomcat
 the url ishttp://maweis.com:8080
 you can try it?

 -
 mawei...@gmail.com
 13585201588http://maweis.com

 On Fri, Nov 20, 2009 at 9:35 AM, Neil.Lv anim...@gmail.com wrote:
  Hi all,

   I have a silly question about the deploy.

   Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?

   I want to use the Comet to push the data in the app.

   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?

   Thanks for any suggestion !

  Cheers,
   Neil

  --

  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=.

 --

 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=.




--

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=.




Re: [Lift] Re: Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread Ross Mellgren
Thanks. If I'm elected, I promise no less than one (1) free beer to  
anyone who can come to retrieve it in or near Cambridge, MA ;-)

-Ross

On Nov 19, 2009, at 8:00 PM, Margaret wrote:

 Welcome
 -
 mawei...@gmail.com
 13585201588
 http://maweis.com




 On Fri, Nov 20, 2009 at 8:45 AM, TylerWeir tyler.w...@gmail.com  
 wrote:
 Welcome Ross!

 On Nov 19, 7:38 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 Folks,

 I'm pleased to announce that Ross Mellgren has joined the Lift  
 committers.
 He's been a very helpful voice on the list for a while now and  
 he's decided
 to help out with code as well... woo hoo and welcome.

 Thanks,

 David

 --
 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= 
 .




 --

 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= 
 .



--

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=.




Re: [Lift] Re: Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread Margaret
haha, I like beer but I am in China now. thanks Ross,You will do Good Job.
-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 10:06 AM, Ross Mellgren dri...@gmail.com wrote:
 Thanks. If I'm elected, I promise no less than one (1) free beer to
 anyone who can come to retrieve it in or near Cambridge, MA ;-)

 -Ross

 On Nov 19, 2009, at 8:00 PM, Margaret wrote:

 Welcome
 -
 mawei...@gmail.com
 13585201588
 http://maweis.com




 On Fri, Nov 20, 2009 at 8:45 AM, TylerWeir tyler.w...@gmail.com
 wrote:
 Welcome Ross!

 On Nov 19, 7:38 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 Folks,

 I'm pleased to announce that Ross Mellgren has joined the Lift
 committers.
 He's been a very helpful voice on the list for a while now and
 he's decided
 to help out with code as well... woo hoo and welcome.

 Thanks,

 David

 --
 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=
 .




 --

 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=
 .



 --

 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=.




--

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=.




[Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread monty chen

 mysql( for
transaction data)
   /
  /
LVS + Nginx + Haproxy + Tomcat   - - - memcache ( for cache)
 \
  \
 cassandra (for
web 2.0 data)

--

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=.




[Lift] Re: JRebel: implements new interfaces and could not be reloaded!

2009-11-19 Thread Alex Black
Damn. I guess there is no free lunch :)

Thanks for the response Kris, and the stylistic tips!  I am easing my
way into scala, starting with the more verbose syntax and picking up
shortcuts as I get more familiar with stuff!

- Alex

On Nov 19, 7:33 pm, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:
 Unfortunately, JRebel is sensitive to certain kinds of changes;
 changes to the names of the generated classes for function literals is
 one of them. In this case, since you've got two function literals in
 the class, their names are something$1 and something$2 or equivalent.
 After commenting out the line, the second one is now something$1,
 which has a totally different interface.

 You can work around it if you really want to, but it's probably easier
 (or at least prettier code) to just restart the server.

 Also, just stylistically, that commented line could be:

       //.sort(_.name.toString  _.name.toString)

 Kris



 On Thu, Nov 19, 2009 at 4:56 PM, Alex Black a...@alexblack.ca wrote:
  Anyone got any tips on working around this error?

  JRebel: Class 'com.blah.blah.explorer.snippet.Features$$anonfun$render
  $1' implements new interfaces and could not be reloaded!

  I've just tried JRebel for the first time, and I made what I thought
  was a minor change to my snippet and JRebel wasn't able to reload it.

  The change I made was to uncomment the sort line in this snippet:

  class Features {
   def render( xhtml: NodeSeq) : NodeSeq = {
     Server.store
       .classes
       //.sort( (c1,c2) = c1.name.toString  c2.name.toString)
       .flatMap( c =
       bind(feature, xhtml,
         name - c.name
       )
     )
   }
  }

  Thanks,

  - Alex

  --

  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=.

--

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=.




[Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread monty chen
Hi, Margaret,  Store engine use: mysq + cassandra , and plus memcached
for cache:


 mysql
( transaction data)
   /
  /
LVS + Nginx + Haproxy + Tomcat   - - - memcache ( for cache)
 \
  \
 cassandra (for
web 2.0 data)

--

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=.




Re: [Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
I will go and look  cassandra

-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 10:17 AM, monty chen montyc...@qq.com wrote:
 Hi, Margaret,  Store engine use: mysq + cassandra , and plus memcached
 for cache:


                                                     mysql
 ( transaction data)
                                                   /
                                                  /
 LVS + Nginx + Haproxy + Tomcat   - - - memcache ( for cache)
                                                 \
                                                  \
                                                     cassandra (for
 web 2.0 data)

 --

 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=.




--

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=.




Re: [Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
would you like give us the url of  your application website?
-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 10:19 AM, Margaret mawei...@gmail.com wrote:
 I will go and look  cassandra

 -
 mawei...@gmail.com
 13585201588
 http://maweis.com




 On Fri, Nov 20, 2009 at 10:17 AM, monty chen montyc...@qq.com wrote:
 Hi, Margaret,  Store engine use: mysq + cassandra , and plus memcached
 for cache:


                                                     mysql
 ( transaction data)
                                                   /
                                                  /
 LVS + Nginx + Haproxy + Tomcat   - - - memcache ( for cache)
                                                 \
                                                  \
                                                     cassandra (for
 web 2.0 data)

 --

 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=.





--

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=.




[Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Neil.Lv

  If i use LVS + Nginx + Haproxy + Tomcat  to deploy the app, Can it
work with Apache at simultaneously ?

Cheers,
  Neil

On Nov 20, 9:35 am, Neil.Lv anim...@gmail.com wrote:
 Hi all,

   I have a silly question about the deploy.

   Which web container is recommended to use to deploy the Lift app ?
 Jetty or Tomcat ?

   I want to use the Comet to push the data in the app.

   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?

   Thanks for any suggestion !

 Cheers,
   Neil

--

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=.




[Lift] JPA and eager fetch

2009-11-19 Thread wstrange


Newbie Lift / JPA alert!

I am sure I am doing something dumb here, but I can't quite figure it
out. I have a JPA project (modelled after the lift JPA demo app).

I have an object with a one-to-many association, and I want to eager
fetch the collection.  It is declared like :

 @OneToMany(){ val targetEntity = classOf[OpenIdUser], val cascade =
Array(CascadeType.ALL), val fetch=FetchType.EAGER}
  var openIds : _root_.java.util.Set[OpenIdUser] = new
_root_.java.util.HashSet[OpenIdUser]()


In my spa persistence unit, eager fetching works fine from the unit
test. The unit test uses plain old emf factory instances.

However, from my web application (run with jetty:run) and  using
Model.createNamedQuery, or Model.find, only the parent object is
fetched. The collection is not.


I gather this has something to do with the way that Model works? Or
are my annotations being ignored when they are packed in a .jar file?

Clues would be appreciated.

Thanks

Warren

--

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=.




[Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread philip
Hi Neil,

I use maven to build and Jetty in the maven, so I run from my IDE the
maven to run the Jetty. Well it works well for me.
I also have SEAM framework on my Jetty as well as part of the setup.

Philip

On 11月20日, 上午9時35分, Neil.Lv anim...@gmail.com wrote:
 Hi all,

   I have a silly question about the deploy.

   Which web container is recommended to use to deploy the Lift app ?
 Jetty or Tomcat ?

   I want to use the Comet to push the data in the app.

   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?

   Thanks for any suggestion !

 Cheers,
   Neil

--

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=.




Re: [Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
jetty is a lightweight container and can be webserver, in the cloud
computing , jetty is much agile for system start , restart.
-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 10:58 AM, philip philip14...@gmail.com wrote:
 Hi Neil,

 I use maven to build and Jetty in the maven, so I run from my IDE the
 maven to run the Jetty. Well it works well for me.
 I also have SEAM framework on my Jetty as well as part of the setup.

 Philip

 On 11月20日, 上午9時35分, Neil.Lv anim...@gmail.com wrote:
 Hi all,

   I have a silly question about the deploy.

   Which web container is recommended to use to deploy the Lift app ?
 Jetty or Tomcat ?

   I want to use the Comet to push the data in the app.

   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?

   Thanks for any suggestion !

 Cheers,
   Neil

 --

 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=.




--

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=.




Re: [Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Xuefeng Wu
Jetty is the better if you use Comet which support  jetty with
Continuations.

On Fri, Nov 20, 2009 at 9:35 AM, Neil.Lv anim...@gmail.com wrote:

 Hi all,

  I have a silly question about the deploy.

  Which web container is recommended to use to deploy the Lift app ?
 Jetty or Tomcat ?

  I want to use the Comet to push the data in the app.

  * Apache + Tomcat ?
  * Apache + what  ?
  * Nginx + what ?

  Thanks for any suggestion !

 Cheers,
  Neil

 --

 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=.





-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

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=.




Re: [Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
thanks for your reply

when we package a scala+lift app as war,

deploy it on tomcat will be use comet?
deploy it on jetty will be use continuations?

is that true?
-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 11:27 AM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 I recommend Nginx + Jetty.
 Apache is the worst front end for this situation... it can only support a
 few hundred simultaneous connections before it falls over.  Ngnix on the
 other hand can proxy tens of thousands.
 Jetty's continuations make it a much better choice than Tomcat.  You can
 have thousands of open Comet request to a Jetty instance where Tomcat is
 capped at a couple of hundred.
 Once the Servlet 3.0 spec in implemented in Glassfish, etc., Lift will
 support 3.0 continuations and any 3.0 container will have the same scaling
 characteristics that Jetty currently does.

 On Thu, Nov 19, 2009 at 5:35 PM, Neil.Lv anim...@gmail.com wrote:

 Hi all,

  I have a silly question about the deploy.

  Which web container is recommended to use to deploy the Lift app ?
 Jetty or Tomcat ?

  I want to use the Comet to push the data in the app.

  * Apache + Tomcat ?
  * Apache + what  ?
  * Nginx + what ?

  Thanks for any suggestion !

 Cheers,
  Neil

 --

 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=.





 --
 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=.


--

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=.




Re: [Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread David Pollak
On Thu, Nov 19, 2009 at 7:35 PM, Margaret mawei...@gmail.com wrote:

 thanks for your reply

 when we package a scala+lift app as war,

 deploy it on tomcat will be use comet?
 deploy it on jetty will be use continuations?


Comet is long polling.  In Jetty, Lift takes advantage of Jetty's
continuations so that during the long poll, there's no thread consumed.  In
Tomcat, 1 thread is consumed for each client that's connected to the server.



 is that true?
 -
 mawei...@gmail.com
 13585201588
 http://maweis.com




 On Fri, Nov 20, 2009 at 11:27 AM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
  I recommend Nginx + Jetty.
  Apache is the worst front end for this situation... it can only support a
  few hundred simultaneous connections before it falls over.  Ngnix on the
  other hand can proxy tens of thousands.
  Jetty's continuations make it a much better choice than Tomcat.  You can
  have thousands of open Comet request to a Jetty instance where Tomcat is
  capped at a couple of hundred.
  Once the Servlet 3.0 spec in implemented in Glassfish, etc., Lift will
  support 3.0 continuations and any 3.0 container will have the same
 scaling
  characteristics that Jetty currently does.
 
  On Thu, Nov 19, 2009 at 5:35 PM, Neil.Lv anim...@gmail.com wrote:
 
  Hi all,
 
   I have a silly question about the deploy.
 
   Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?
 
   I want to use the Comet to push the data in the app.
 
   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?
 
   Thanks for any suggestion !
 
  Cheers,
   Neil
 
  --
 
  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=.
 
 
 
 
 
  --
  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=.
 

 --

 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=.





-- 
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=.




Re: [Lift] Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread Margaret
I will try jetty
-
mawei...@gmail.com
13585201588
http://maweis.com




On Fri, Nov 20, 2009 at 11:51 AM, David Pollak
feeder.of.the.be...@gmail.com wrote:


 On Thu, Nov 19, 2009 at 7:35 PM, Margaret mawei...@gmail.com wrote:

 thanks for your reply

 when we package a scala+lift app as war,

 deploy it on tomcat will be use comet?
 deploy it on jetty will be use continuations?

 Comet is long polling.  In Jetty, Lift takes advantage of Jetty's
 continuations so that during the long poll, there's no thread consumed.  In
 Tomcat, 1 thread is consumed for each client that's connected to the server.


 is that true?
 -
 mawei...@gmail.com
 13585201588
 http://maweis.com




 On Fri, Nov 20, 2009 at 11:27 AM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
  I recommend Nginx + Jetty.
  Apache is the worst front end for this situation... it can only support
  a
  few hundred simultaneous connections before it falls over.  Ngnix on the
  other hand can proxy tens of thousands.
  Jetty's continuations make it a much better choice than Tomcat.  You can
  have thousands of open Comet request to a Jetty instance where Tomcat is
  capped at a couple of hundred.
  Once the Servlet 3.0 spec in implemented in Glassfish, etc., Lift will
  support 3.0 continuations and any 3.0 container will have the same
  scaling
  characteristics that Jetty currently does.
 
  On Thu, Nov 19, 2009 at 5:35 PM, Neil.Lv anim...@gmail.com wrote:
 
  Hi all,
 
   I have a silly question about the deploy.
 
   Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?
 
   I want to use the Comet to push the data in the app.
 
   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?
 
   Thanks for any suggestion !
 
  Cheers,
   Neil
 
  --
 
  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=.
 
 
 
 
 
  --
  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=.
 

 --

 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=.





 --
 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=.


--

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=.




Re: [Lift] A sensible AJAX approach

2009-11-19 Thread Kris Nuttycombe
On Thu, Nov 19, 2009 at 2:52 PM, Chris Lewis burningodzi...@gmail.com wrote:
 Classic use case: a user chooses to view/edit and object by clicking on
 a link. This causes the app to fetch an edit view (form) and render it
 asynchronously, probably rendering it as a modal dialog. To specify the
 case a bit more, consider a table of like objects that allows you to
 edit them (orders or accounts). As far as the user experience, clicking
 edit for one would yield the same edit form as any other - only the
 contents (the target of the edit) would change.

 Normal ajax forms in lift are simple - just wrap the bind in an ajax
 form (http://is.gd/4Z61Z) and you get an async submit with essentially
 the same template code.

 But what about ajax forms delivered by ajax? What's the best way to
 implement this in lift? It seems like there are two routes: client and
 server-based.


 1) In the client-based approach, I can declare an invisible form in the
 template, as well as write some static javascript to do the heavy
 lifting (no pun intended). This JS would be responsible for receiving
 the data representing the object to edit from the server as json,
 unpacking it into the form for editing, rendering the form, handling the
 submit as ajax, and finally hiding the form.

 This means writing a good bit more JS by hand, but it keeps the
 (compiled) snippet code smaller. Ordinarily I'd see that as good, but
 more and more snippets seem like they are intended for such heavy view
 meddling.


 2) The server-based approach would require very little of the main
 template: basically just a containing element (w/ dom id) to host the
 delivered form. The snippet itself would yield a form on an ajax call
 via SetHtml. It would also have to set up the handlers and populate the
 form contents with the target object.

 This is the part that I'm not clear on. I know I can just inline the XML
 with bind points as if it were in a form, but that just feels strange.
 Would it make more sense to use an external template, similar to a rails
 partial? Is there a template loading facility for this?

 Thanks for any and all input.

 chris

I use the second style, to great effect, in Lift - except I use
net.liftweb.http.TemplateFinder.findAnyTemplate to get the NodeSeq
representing the template instead of inlining the XML, and then use a
normal call to bind. It works a treat.

There are a couple of utility traits that I use to make this even
cleaner; I don't have time to detail how they're used at the moment
but maybe you can get a little bit of an idea by looking at the types.
One of these days I'll clean these up into something truly reusable
(these rely on the bindings stuff I detailed on my blog at
http://logji.blogspot.com/2009/09/composable-bindings-in-lift.html
with a couple of extra things, tbind and the Templated trait.

def tbind(x: Binding with Templated): NodeSeq = x.bind(x.template)

trait Templated {
def template: List[String]
}

trait Form[T] {
def onSubmit: Unit = process
def process: T
}

trait FormSnippets {
this: StatefulSnippet =

var actionBinding: Binding with Templated = _
var editFormBinding: Binding with Templated = _

lazy val dispatch: DispatchIt = {
case actionSelect = actionBinding
case editForm = editFormBinding
}

def ajaxify(b: Binding with Templated with Form[_],
clientOnSubmit: JsCmd, serverRedirect: Option[String]) = new Binding
with Templated {
override val template = b.template
override def apply(xhtml: NodeSeq): NodeSeq = {
def serverOnSubmit: JsCmd = {
b.onSubmit

serverRedirect.map(where = RedirectTo(where)).
getOrElse(SetHtml(action_selector,
tbind(actionBinding))  SetHtml(edit_form, tbind(editFormBinding)))
}

ajaxForm(b.apply(xhtml) ++ hidden(serverOnSubmit _), clientOnSubmit)
}
}
}

Kris

--

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=.




Re: [Lift] Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread Indrajit Raychaudhuri
Welcome Ross!
Would look forward to more of those well thought out responses.

Cheers, Indrajit

On 20/11/09 6:08 AM, David Pollak wrote:
 Folks,

 I'm pleased to announce that Ross Mellgren has joined the Lift
 committers.  He's been a very helpful voice on the list for a while now
 and he's decided to help out with code as well... woo hoo and welcome.

 Thanks,

 David


 --
 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=.

--

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=.




Re: [Lift] Welcome Ross Mellgren to the Lift Committers

2009-11-19 Thread Atsuhiko Yamanaka
Welcome Ross!

--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk

--

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=.




[Lift] Re: Jetty or Tomcat, Which web container is recommended to use to deploy the Lift app ?

2009-11-19 Thread monty chen
Hi,David Pollk!

Nginx only comes with a round-robin balancer and a hash-based
balancer, so if a request takes a while to load, Nginx will start
routing requests to backends that are already processing requests -- as
a result, some backends will be queueing up requests while some
backends will remain idle. You will get an uneven load distribution,
and the unevenness will increase with the amount of load subject to
the load-balancer.

Haproxy as a LB can:
1: Plenty of load-balancing algorithms, including a least
connections strategy that picks the backend with the fewest pending
connections. Which happens to be just what we want.

2:  Backends can be sanity- and health-checked by URL to avoid routing
requests to brain-damaged backends. (It can even stagger these checks
to avoid spikes.)

3: Requests can be routed based on all sorts of things: cookies, URL
substrings, client IP, etc.

So, I use nginx + haproxy + tomcat(jetty).


On 11月20日, 上午11时27分, David Pollak feeder.of.the.be...@gmail.com
wrote:
 I recommend Nginx + Jetty.

 Apache is the worst front end for this situation... it can only support a
 few hundred simultaneous connections before it falls over.  Ngnix on the
 other hand can proxy tens of thousands.

 Jetty's continuations make it a much better choice than Tomcat.  You can
 have thousands of open Comet request to a Jetty instance where Tomcat is
 capped at a couple of hundred.

 Once the Servlet 3.0 spec in implemented in Glassfish, etc., Lift will
 support 3.0 continuations and any 3.0 container will have the same scaling
 characteristics that Jetty currently does.



 On Thu, Nov 19, 2009 at 5:35 PM, Neil.Lv anim...@gmail.com wrote:
  Hi all,

   I have a silly question about the deploy.

   Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?

   I want to use the Comet to push the data in the app.

   * Apache + Tomcat ?
   * Apache + what  ?
   * Nginx + what ?

   Thanks for any suggestion !

  Cheers,
   Neil

  --

  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=.

 --
 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=.




Re: [Lift] A sensible AJAX approach

2009-11-19 Thread Jeppe Nejsum Madsen
Chris Lewis burningodzi...@gmail.com writes:

 Thanks for the feedback Jeppe. I can't completely infer the context of 
 your example,

Seems to happen a lot to me lately. :-) This was just a quick paste from
our codebase

 but I get the idea (and I hadn't known about TemplateFinder). Here's
 what I've hacked together so far.


/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=.