Re: [Lift] Ideas for how to inject QueryParams into find() and findAll()

2010-01-21 Thread Jeppe Nejsum Madsen
Naftoli Gugenheim  writes:

> Why not define a new method?
> def findByCurUser(params: QueryParam*) = User.currentUser.flatMap(user=> 
> find((Seq(By(User.username, user.username.is)) ++ params): _*))
> find returns a Box and currentUser does too, so flatMap flattens them into 
> one. Basically find takes a varargs and you're passing a Seq instead using : 
> _*, and that Seq contains the user and other params.
> You could probably write params + By(User.username, user.username.is) instead 
> of the reverse order, as it's shorter than the previous version.

The problem with this solution is that you cannot use any of Lift's
builtin stuff such as CRUDify.

If you wan't to create a multitenant service with only a single set of tables, 
you wan't do make damn
sure that each customer only sees his/her own data :-)

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




[Lift] Re: 1.1-M8 to 2.0-M1 behavior change

2010-01-21 Thread aw
I think I discovered that my issue is related to the fact that the
code is part of a CometActor/CometListener, and it sounds like S isn't
fully functional from this perspective...  My clue was the
inStatefulScope_? method documentation.

I do think I managed to work around my specific issue, but I don't
fully understand this, and I'm not sure if this change in behavior was
intentional.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread Neil.Lv

  I have added the demo code on the Github now.
  ( Mabye it's a bug with DB.runQuery and DB.use in the two db
vender )

  Here is the address:
  http://github.com/anim510/two_db_demo

  Thanks very much!

Cheers,
  Neil

On Jan 21, 11:26 am, "Neil.Lv"  wrote:
>   My email is :   anim...@gmail.com
>
> On Jan 21, 11:17 am, "Neil.Lv"  wrote:
>
> > Mabye it's a bug with DB.runQuery and DB.use in the two db vender 
>
> > Two question: (problem)
>
> > 1: I don't know why the HelloWorld snippet code will be execute 2
> > times in this code. (See the HelloWorld.scala file.)
> > 2: The dbDefaultConnectionIdentifier method in the Model that it works
> > fine when using Mapper's method such as ModelName.findAll(),
> > it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe it
> > can't find the default db identifier)
>
> > The question 2 I test it many times that found this problem.
>
> > In the test app , the Hot.getHots2 and Hot.getHots3 method can't work.
>
> > I comment the code now in the HelloWorld.scala file, you can try it.
>
> > 
>
> >   I can push the code on the github, and get this errors "fatal:
> > unable to fork"
>
> >   So If anyone know what's wrong with it and I can send the demo.tar
> > file through the email.
>
> >   Thanks very much!
>
> > 
>
> > Cheers,
> >   Neil
>
> > On Jan 21, 1:56 am, "Neil.Lv"  wrote:
>
> > >   The DB.runQuery can works now, but the DB.prepareStatement also
> > > cant' work.
>
> > >   Here is the test app address:
> > >  http://github.com/anim510/two_db_demo
>
> > > Cheers,
> > >   Neil
>
> > > On Jan 21, 1:16 am, "Neil.Lv"  wrote:
>
> > > >    Thank you very much,
>
> > > >    But it doesn't work yet, maybe because of using two db connections.
>
> > > >    I'll test it later again.
>
> > > > On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
>
> > > > > "Neil.Lv"  writes:
> > > > > > Hi all,
>
> > > > > >   I use two db connections in my app, and I want to use
> > > > > > DB.prepareStatement to select
> > > > > > the records from the second db.
>
> > > > > >   It failed, Here is the code:
> > > > > > ###
> > > > > >   def getHotByTid(id : Long) =
> > > > > >     DB.use(bootstrap.liftweb.TwoDB) {
> > > > > >       conn =>
> > > > > >      DB.prepareStatement("SELECT * FROM hots WHERE id=? ", conn) {
> > > > > >              stmt =>
> > > > > >                      stmt.setLong(1, id)
> > > > > > Log.info("stmt :" + stmt)   // The information is correctly now, but
> > > > > > after call executeUpdate method
> > > > > >                      stmt.executeUpdate()
> > > > > >       }
> > > > > >    }
>
> > > > > Not sure what your problem is really, but I think you should use
> > > > > DB.runQuery to execute a select statement
>
> > > > > Ie
>
> > > > >   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length  
> > > > > FROM "+
> > > > >                     "vehicles_current v "+
> > > > >                     "WHERE v.account_id=? "+
> > > > >                     "GROUP BY contract_length "+
> > > > >                     "ORDER BY contract_length",
> > > > >                     List(42))
>
> > > > > /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: What happens between 7000 and 8000 requests?

2010-01-21 Thread Stefan Koenig
First of all thanks for the replies. Your comments made a lot of
sense, so I tested again using a cookie jsessionid and voilà no
problems anymore even running more than 100,000 requests in a row now.
Also the failed requests are gone.

Thanks again.
Stefan Koenig



On Jan 21, 5:16 am, Derek Williams  wrote:
> Okay, I tried it out. jsessionid is sometimes 12 or 13 characters long
> which is why the document length is changing. Those failures due to
> length are probably safe to ignore.
>
> On Wed, Jan 20, 2010 at 6:00 PM, Derek Williams  wrote:
> > I could be wrong here, but I think the failed requests might be due to the
> > jsessionid that jetty adds onto the links, they may be different sizes. I am
> > away from my computer right now and can't test it though.
>
> --
> Derek Williams
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: What happens between 7000 and 8000 requests?

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 6:25 AM, Stefan Koenig  wrote:

> First of all thanks for the replies. Your comments made a lot of
> sense, so I tested again using a cookie jsessionid and voilà no
> problems anymore even running more than 100,000 requests in a row now.
> Also the failed requests are gone.
>

And is Lift still much faster?


>
> Thanks again.
> Stefan Koenig
>
>
>
> On Jan 21, 5:16 am, Derek Williams  wrote:
> > Okay, I tried it out. jsessionid is sometimes 12 or 13 characters long
> > which is why the document length is changing. Those failures due to
> > length are probably safe to ignore.
> >
> > On Wed, Jan 20, 2010 at 6:00 PM, Derek Williams  wrote:
> > > I could be wrong here, but I think the failed requests might be due to
> the
> > > jsessionid that jetty adds onto the links, they may be different sizes.
> I am
> > > away from my computer right now and can't test it though.
> >
> > --
> > Derek Williams
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
>


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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



Re: [Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread David Pollak
What is wrong with:

DB.use(FirstDB) {
  firstConnection =>
  DB.use(SecondDB) {
  secondConnection =>

  // do transactional query between two DBs here
}
}

Note that DB.use nests such that the transaction will only be committed when
the last DB.use block for a given ConnectionIdentifier is exited.


On Thu, Jan 21, 2010 at 3:17 AM, Neil.Lv  wrote:

>
>  I have added the demo code on the Github now.
>  ( Mabye it's a bug with DB.runQuery and DB.use in the two db
> vender )
>
>  Here is the address:
>   http://github.com/anim510/two_db_demo
>
>   Thanks very much!
>
> Cheers,
>  Neil
>
> On Jan 21, 11:26 am, "Neil.Lv"  wrote:
> >   My email is :   anim...@gmail.com
> >
> > On Jan 21, 11:17 am, "Neil.Lv"  wrote:
> >
> > > Mabye it's a bug with DB.runQuery and DB.use in the two db vender 
> >
> > > Two question: (problem)
> >
> > > 1: I don't know why the HelloWorld snippet code will be execute 2
> > > times in this code. (See the HelloWorld.scala file.)
> > > 2: The dbDefaultConnectionIdentifier method in the Model that it works
> > > fine when using Mapper's method such as ModelName.findAll(),
> > > it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe it
> > > can't find the default db identifier)
> >
> > > The question 2 I test it many times that found this problem.
> >
> > > In the test app , the Hot.getHots2 and Hot.getHots3 method can't work.
> >
> > > I comment the code now in the HelloWorld.scala file, you can try it.
> >
> > > 
> >
> > >   I can push the code on the github, and get this errors "fatal:
> > > unable to fork"
> >
> > >   So If anyone know what's wrong with it and I can send the demo.tar
> > > file through the email.
> >
> > >   Thanks very much!
> >
> > > 
> >
> > > Cheers,
> > >   Neil
> >
> > > On Jan 21, 1:56 am, "Neil.Lv"  wrote:
> >
> > > >   The DB.runQuery can works now, but the DB.prepareStatement also
> > > > cant' work.
> >
> > > >   Here is the test app address:
> > > >  http://github.com/anim510/two_db_demo
> >
> > > > Cheers,
> > > >   Neil
> >
> > > > On Jan 21, 1:16 am, "Neil.Lv"  wrote:
> >
> > > > >Thank you very much,
> >
> > > > >But it doesn't work yet, maybe because of using two db
> connections.
> >
> > > > >I'll test it later again.
> >
> > > > > On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
> >
> > > > > > "Neil.Lv"  writes:
> > > > > > > Hi all,
> >
> > > > > > >   I use two db connections in my app, and I want to use
> > > > > > > DB.prepareStatement to select
> > > > > > > the records from the second db.
> >
> > > > > > >   It failed, Here is the code:
> > > > > > > ###
> > > > > > >   def getHotByTid(id : Long) =
> > > > > > > DB.use(bootstrap.liftweb.TwoDB) {
> > > > > > >   conn =>
> > > > > > >  DB.prepareStatement("SELECT * FROM hots WHERE id=? ",
> conn) {
> > > > > > >  stmt =>
> > > > > > >  stmt.setLong(1, id)
> > > > > > > Log.info("stmt :" + stmt)   // The information is correctly
> now, but
> > > > > > > after call executeUpdate method
> > > > > > >  stmt.executeUpdate()
> > > > > > >   }
> > > > > > >}
> >
> > > > > > Not sure what your problem is really, but I think you should use
> > > > > > DB.runQuery to execute a select statement
> >
> > > > > > Ie
> >
> > > > > >   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length
>  FROM "+
> > > > > > "vehicles_current v "+
> > > > > > "WHERE v.account_id=? "+
> > > > > > "GROUP BY contract_length "+
> > > > > > "ORDER BY contract_length",
> > > > > > List(42))
> >
> > > > > > /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
>


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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



Re: [Lift] Re: 1.1-M8 to 2.0-M1 behavior change

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 1:24 AM, aw  wrote:

> I think I discovered that my issue is related to the fact that the
> code is part of a CometActor/CometListener, and it sounds like S isn't
> fully functional from this perspective...  My clue was the
> inStatefulScope_? method documentation.
>
> I do think I managed to work around my specific issue, but I don't
> fully understand this, and I'm not sure if this change in behavior was
> intentional.
>

There is no HTTP request within the scope of a CometActor.  This is the
defined behavior.  If you were somehow able to access a Req or other part of
an HTTP request within the CometActor scope in a prior version of Lift, this
was a bug.


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


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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



[Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread Neil.Lv

  The users table in the OneDB, and the hots table in the TwoDB, they
are separated!

  I have changed the method that like this:
###
  # I specify the TwoDB for hots table.
  override def dbDefaultConnectionIdentifier = bootstrap.liftweb.TwoDB


  def getHots3(id : Long) = {
DB.use(bootstrap.liftweb.OneDB) {
  firstConn =>
 DB.use(bootstrap.liftweb.TwoDB) {
conn =>
 DB.prepareStatement("SELECT * FROM hots WHERE id>?", conn) {
 stmt =>
 stmt.setLong(1, id)
 stmt.executeUpdate()
}
}
}
  }
###

  But it doesn't work.

  Thanks very much!  :)

Cheers,
  Neil


On Jan 22, 12:49 am, David Pollak 
wrote:
> What is wrong with:
>
> DB.use(FirstDB) {
>   firstConnection =>
>   DB.use(SecondDB) {
>   secondConnection =>
>
>   // do transactional query between two DBs here
>
> }
> }
>
> Note that DB.use nests such that the transaction will only be committed when
> the last DB.use block for a given ConnectionIdentifier is exited.
>
>
>
> On Thu, Jan 21, 2010 at 3:17 AM, Neil.Lv  wrote:
>
> >  I have added the demo code on the Github now.
> >  ( Mabye it's a bug with DB.runQuery and DB.use in the two db
> > vender )
>
> >  Here is the address:
> >  http://github.com/anim510/two_db_demo
>
> >   Thanks very much!
>
> > Cheers,
> >  Neil
>
> > On Jan 21, 11:26 am, "Neil.Lv"  wrote:
> > >   My email is :   anim...@gmail.com
>
> > > On Jan 21, 11:17 am, "Neil.Lv"  wrote:
>
> > > > Mabye it's a bug with DB.runQuery and DB.use in the two db vender 
>
> > > > Two question: (problem)
>
> > > > 1: I don't know why the HelloWorld snippet code will be execute 2
> > > > times in this code. (See the HelloWorld.scala file.)
> > > > 2: The dbDefaultConnectionIdentifier method in the Model that it works
> > > > fine when using Mapper's method such as ModelName.findAll(),
> > > > it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe it
> > > > can't find the default db identifier)
>
> > > > The question 2 I test it many times that found this problem.
>
> > > > In the test app , the Hot.getHots2 and Hot.getHots3 method can't work.
>
> > > > I comment the code now in the HelloWorld.scala file, you can try it.
>
> > > > 
>
> > > >   I can push the code on the github, and get this errors "fatal:
> > > > unable to fork"
>
> > > >   So If anyone know what's wrong with it and I can send the demo.tar
> > > > file through the email.
>
> > > >   Thanks very much!
>
> > > > 
>
> > > > Cheers,
> > > >   Neil
>
> > > > On Jan 21, 1:56 am, "Neil.Lv"  wrote:
>
> > > > >   The DB.runQuery can works now, but the DB.prepareStatement also
> > > > > cant' work.
>
> > > > >   Here is the test app address:
> > > > >  http://github.com/anim510/two_db_demo
>
> > > > > Cheers,
> > > > >   Neil
>
> > > > > On Jan 21, 1:16 am, "Neil.Lv"  wrote:
>
> > > > > >    Thank you very much,
>
> > > > > >    But it doesn't work yet, maybe because of using two db
> > connections.
>
> > > > > >    I'll test it later again.
>
> > > > > > On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
>
> > > > > > > "Neil.Lv"  writes:
> > > > > > > > Hi all,
>
> > > > > > > >   I use two db connections in my app, and I want to use
> > > > > > > > DB.prepareStatement to select
> > > > > > > > the records from the second db.
>
> > > > > > > >   It failed, Here is the code:
> > > > > > > > ###
> > > > > > > >   def getHotByTid(id : Long) =
> > > > > > > >     DB.use(bootstrap.liftweb.TwoDB) {
> > > > > > > >       conn =>
> > > > > > > >      DB.prepareStatement("SELECT * FROM hots WHERE id=? ",
> > conn) {
> > > > > > > >              stmt =>
> > > > > > > >                      stmt.setLong(1, id)
> > > > > > > > Log.info("stmt :" + stmt)   // The information is correctly
> > now, but
> > > > > > > > after call executeUpdate method
> > > > > > > >                      stmt.executeUpdate()
> > > > > > > >       }
> > > > > > > >    }
>
> > > > > > > Not sure what your problem is really, but I think you should use
> > > > > > > DB.runQuery to execute a select statement
>
> > > > > > > Ie
>
> > > > > > >   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length
> >  FROM "+
> > > > > > >                     "vehicles_current v "+
> > > > > > >                     "WHERE v.account_id=? "+
> > > > > > >                     "GROUP BY contract_length "+
> > > > > > >                     "ORDER BY contract_length",
> > > > > > >                     List(42))
>
> > > > > > > /Jeppe
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scala

Re: [Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread Ross Mellgren
"It doesn't work" is not sufficient to diagnose. What behavior did you get, and 
what were you expecting? Were there any errors, log messages, exceptions, etc? 
If so, please copy them. Finally, if you have a reproducible test case please 
post it to github. I note earlier in the thread that you were fiddling with 
github, so if an older example is there, please make sure it's up to date with 
the most recent code.

Thanks,
-Ross

On Jan 21, 2010, at 12:29 PM, Neil.Lv wrote:

> 
>  The users table in the OneDB, and the hots table in the TwoDB, they
> are separated!
> 
>  I have changed the method that like this:
> ###
>  # I specify the TwoDB for hots table.
>  override def dbDefaultConnectionIdentifier = bootstrap.liftweb.TwoDB
> 
> 
>  def getHots3(id : Long) = {
>DB.use(bootstrap.liftweb.OneDB) {
>  firstConn =>
>DB.use(bootstrap.liftweb.TwoDB) {
>   conn =>
>DB.prepareStatement("SELECT * FROM hots WHERE id>?", conn) {
>stmt =>
>stmt.setLong(1, id)
>stmt.executeUpdate()
>   }
>   }
>}
>  }
> ###
> 
>  But it doesn't work.
> 
>  Thanks very much!  :)
> 
> Cheers,
>  Neil
> 
> 
> On Jan 22, 12:49 am, David Pollak 
> wrote:
>> What is wrong with:
>> 
>> DB.use(FirstDB) {
>>   firstConnection =>
>>   DB.use(SecondDB) {
>>   secondConnection =>
>> 
>>   // do transactional query between two DBs here
>> 
>> }
>> }
>> 
>> Note that DB.use nests such that the transaction will only be committed when
>> the last DB.use block for a given ConnectionIdentifier is exited.
>> 
>> 
>> 
>> On Thu, Jan 21, 2010 at 3:17 AM, Neil.Lv  wrote:
>> 
>>>  I have added the demo code on the Github now.
>>>  ( Mabye it's a bug with DB.runQuery and DB.use in the two db
>>> vender )
>> 
>>>  Here is the address:
>>>  http://github.com/anim510/two_db_demo
>> 
>>>   Thanks very much!
>> 
>>> Cheers,
>>>  Neil
>> 
>>> On Jan 21, 11:26 am, "Neil.Lv"  wrote:
   My email is :   anim...@gmail.com
>> 
 On Jan 21, 11:17 am, "Neil.Lv"  wrote:
>> 
> Mabye it's a bug with DB.runQuery and DB.use in the two db vender 
>> 
> Two question: (problem)
>> 
> 1: I don't know why the HelloWorld snippet code will be execute 2
> times in this code. (See the HelloWorld.scala file.)
> 2: The dbDefaultConnectionIdentifier method in the Model that it works
> fine when using Mapper's method such as ModelName.findAll(),
> it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe it
> can't find the default db identifier)
>> 
> The question 2 I test it many times that found this problem.
>> 
> In the test app , the Hot.getHots2 and Hot.getHots3 method can't work.
>> 
> I comment the code now in the HelloWorld.scala file, you can try it.
>> 
> 
>> 
>   I can push the code on the github, and get this errors "fatal:
> unable to fork"
>> 
>   So If anyone know what's wrong with it and I can send the demo.tar
> file through the email.
>> 
>   Thanks very much!
>> 
> 
>> 
> Cheers,
>   Neil
>> 
> On Jan 21, 1:56 am, "Neil.Lv"  wrote:
>> 
>>   The DB.runQuery can works now, but the DB.prepareStatement also
>> cant' work.
>> 
>>   Here is the test app address:
>>  http://github.com/anim510/two_db_demo
>> 
>> Cheers,
>>   Neil
>> 
>> On Jan 21, 1:16 am, "Neil.Lv"  wrote:
>> 
>>>Thank you very much,
>> 
>>>But it doesn't work yet, maybe because of using two db
>>> connections.
>> 
>>>I'll test it later again.
>> 
>>> On Jan 21, 12:44 am, Jeppe Nejsum Madsen  wrote:
>> 
 "Neil.Lv"  writes:
> Hi all,
>> 
>   I use two db connections in my app, and I want to use
> DB.prepareStatement to select
> the records from the second db.
>> 
>   It failed, Here is the code:
> ###
>   def getHotByTid(id : Long) =
> DB.use(bootstrap.liftweb.TwoDB) {
>   conn =>
>  DB.prepareStatement("SELECT * FROM hots WHERE id=? ",
>>> conn) {
>  stmt =>
>  stmt.setLong(1, id)
> Log.info("stmt :" + stmt)   // The information is correctly
>>> now, but
> after call executeUpdate method
>  stmt.executeUpdate()
>   }
>}
>> 
 Not sure what your problem is really, but I think you should use
 DB.runQuery to execute a select statement
>> 
 Ie
>> 
   val (_,result) = DB.runQuery("SELECT COUNT(*), contract_length
>>>  FROM "+
 "vehicles_current v "+
 "WHERE v.account_id=? "+
 "GROUP BY contract_length "+
 "ORDER BY contract_length",
 List(42))
>> 
 /Jeppe
>> 
>>> --
>>> You received this message because you are subscribed 

[Lift] Re: Embedding comet actor in ModalDialog

2010-01-21 Thread Marius
Right ... building progress bars should be quite easy but just have
your page contain the comet actor.So roughly the steps would be:

1. Include your comet in the page. In this state it renders nothing
visible
2. hen you open the dialog, send an ajax response
3. From your ajax scal function send a message to your comet actor to
"activate" the progress
4. From your comet actor I assume you would know the "progress of an
operation" and you'd send progress bar updates using partialUpdate.

... you got the idea.

I'm doing something similar with multiple progress bars monitoring the
progress of some backgroud server processes using comet but not really
inside of a dialog. Putting them inside a modal dialog would be very
easy.

Br's,
Marius

On Jan 21, 9:54 am, ced  wrote:
> @David: Thanks. Now the approach is clear.
>
> > Is that your use-case ?  so see async intems coming from server
> > only when the dialog is opened?
>
> @Marius: Yes, it is. I'd like to display a progressbar in the dialog.
> It seemed to me quite natural to deliver it (the comet component)
> along with the dialog, but as I now know that this is not possible,
> it's really no problem to have it prepared in the page and bring it to
> life when needed, i.e. make it visible. Another solution would be to
> redirect to a whole new page with the progressbar on it, but I wanted
> to look it more like a desktop application.
>
> Thanks,
> Chris
>
> On 20 Jan., 23:22, Marius  wrote:
>
> > I really don't see the need for such use-case. I mean if one wants to
> > see async stuff in a dialog only when the dialog is opened this could
> > be easily done via Ajax requests that will "activate"/"deactivate"
> > async messages to client by sending from the ajax functions messages
> > to the comet actor.
>
> > Is that your use-case ?  so see async intems coming from server
> > only when the dialog is opened?
>
> > Br's,
> > Marius
>
> > On Jan 20, 11:00 pm, ced  wrote:
>
> > > Hi all,
>
> > > I'm trying to create some sort of progress notification for a long
> > > lasting request. The idea is to answer an ajax request with a
> > > JqJsCmds.ModalDialog which embeds a comet actor like so:
>
> > > ajaxButton("Start process", () => ModalDialog(Progress > > div>))
>
> > > Unfortunately this doesn't work, the dialog doesn't get displayed.
> > > Embedding a "normal" snippet works just fine though.
>
> > > The code returned in the response to the button click seems ok also.
>
> > > As a workaround I place the comet actor in the page enclosed in a
> > > hidden .
> > > Then I return the ModalDialog(Progress) along with some JS-code that takes the "progress-
> > > actor" div, moves it into the "actor-goes-here" div and makes it
> > > visible.
>
> > > Does anyone tried something similar? Any help is appreciated...
>
> > > 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=en.




Re: [Lift] Re: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-21 Thread David Pollak
On Wed, Jan 20, 2010 at 9:28 PM, mark chance  wrote:

> I did post the project to drop.io - http://drop.io/memtest.
>

The project does not build:

  Path to dependency:
  1) com.peopledesigned:memtest:war:1.0-SNAPSHOT
  2) org.jfree:jcommon:jar:1.0.16


Looking at your code, each of the functions created/passed as part of the
SHtml.ajaxCall(), etc. calls are retained for the duration of the session.
Lift garbage collects these references if there's not seen on a page for 10
minutes.  However, if the GUIDs are created within the scope of a
CometActor, the function is retained until the CometActor is released (in
your case, for the length of the session).

There are a couple of ways to deal with this:

   - Create a single SHtml.ajaxCall instance as part of the CometActor
   (rather than on each partialUpdate).
   - Use the CometActor's built-in JSON handler to send a message from the
   browser to the server.  See CometActor.handleJson()

The latter is the best bet for handling rich interactions with the
CometActor from the client without creating lots and lots of functions.


>
>
> On Wed, Jan 20, 2010 at 10:06 PM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>>
>>
>> On Wed, Jan 20, 2010 at 9:03 PM, Java1Guy  wrote:
>>
>>> Ok - i've left my Jetty server up and running with one page open...
>>> The good news is Jetty hasn't crapped out.  It had 500MB of heap space
>>> used before a forced GC brought it down to 250MB.  The heap dump is
>>> interesting: http://twitpic.com/z0xnx almost 25MB of Text objects used
>>> by the almost 80K displayList partial function objects in my
>>> CometActor.
>>> To me that sounds like a lot of functions!
>>>
>>
>> Without your actual code, there's little we can do.
>>
>>
>>>
>>> Thanks in advance if you can have a look.
>>> Mark
>>>
>>> On Jan 18, 6:36 pm, Java1Guy  wrote:
>>> > Thanks for the response.  I have created a small project here:
>>> http://drop.io/memtest(btw  - the zip file
>>> is so big because there are
>>> > 3 heap dumps - before that it was only 21k!) which i believe does
>>> > exhibit the problem.  One comet actor page which gets updated every 20
>>> > sec. via tick.
>>> > So to run this, I've built the war file and installed it into a Jetty
>>> > 6.1.22 installation.  The file etc/memtest.xml goes in the jetty/
>>> > contexts dir.
>>> > I open my Firefox browser to the only page it shows and just leave it
>>> > open for about four hours now - so the session should still be active,
>>> > FWIW.
>>> > An additional thing I'm noticing now is that despite not much else
>>> > happening in the app, the comet responses are taking just under 20
>>> > sec.  That seems huge.
>>> > There are two things I notice in the heap dumps: one is the large
>>> > number of xml.Text objects and their Strings, but second the 5800
>>> > anonFuncs from the DatastreamActor which are being held by the S
>>> > $ProxtFuncHolder.  I guess I could look up the API on that to see if
>>> > there's a way to controls itsbehavior...  but there it is.
>>> > Thanks to anyone who takes a look at this, Mark
>>> >
>>> > The stdout:
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/2021921075/
>>> > p6s263zexmzz took 19513 Milliseconds
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/11287578067/
>>> > p6s263zexmzz took 19879 Milliseconds
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/26532853932/
>>> > p6s263zexmzz took 19868 Milliseconds
>>> > ConsoleActor.lowPriority.Tick...>>>DataStreamActor.lowPriority:
>>> HostAddMsg local
>>> >
>>> > ds count 4
>>> > DataStreamActor.refreshStreams: now we know about stream count: 8
>>> > INFO - Service request (GET) /memtest/comet_request/11619469749/
>>> > p6s263zexmzz took 19918 Milliseconds
>>> >
>>> > On Jan 16, 2:32 am, Marius  wrote:
>>> >
>>> > > Lift GC is likely keeping your functions to not expire but this is
>>> > > meant to be that way ... but this doesn't explain the large amount of
>>> > > functions. Can you post a minimalistic example of your app where you
>>> > > can reproduce thisbehavior?
>>> >
>>> > > Br's,
>>> > > Marius
>>>
>>> --
>>> 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 thi

Re: [Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 9:29 AM, Neil.Lv  wrote:

>
>  The users table in the OneDB, and the hots table in the TwoDB, they
> are separated!
>
>  I have changed the method that like this:
> ###
>  # I specify the TwoDB for hots table.
>  override def dbDefaultConnectionIdentifier = bootstrap.liftweb.TwoDB
>
>
>  def getHots3(id : Long) = {
>DB.use(bootstrap.liftweb.OneDB) {
>  firstConn =>
>  DB.use(bootstrap.liftweb.TwoDB) {
>conn =>
> DB.prepareStatement("SELECT * FROM hots WHERE id>?", conn)
> {
> stmt =>
> stmt.setLong(1, id)
>  stmt.executeUpdate()
>}
>}
>}
>  }
> ###
>
>  But it doesn't work.
>

What do "it doesn't work" mean?  Does it not compile, if not, what's the
compilation error?   If it's another error, what's the error?  In your
example, you are not using the firstConn connection.  Also, you will get an
exception if you do an executeUpdate with a SELECT statement (this is JDBC,
not Lift).  You must do an "executeQuery" for a SELECT.


>
>  Thanks very much!  :)
>
> Cheers,
>  Neil
>
>
> On Jan 22, 12:49 am, David Pollak 
> wrote:
> > What is wrong with:
> >
> > DB.use(FirstDB) {
> >   firstConnection =>
> >   DB.use(SecondDB) {
> >   secondConnection =>
> >
> >   // do transactional query between two DBs here
> >
> > }
> > }
> >
> > Note that DB.use nests such that the transaction will only be committed
> when
> > the last DB.use block for a given ConnectionIdentifier is exited.
> >
> >
> >
> > On Thu, Jan 21, 2010 at 3:17 AM, Neil.Lv  wrote:
> >
> > >  I have added the demo code on the Github now.
> > >  ( Mabye it's a bug with DB.runQuery and DB.use in the two db
> > > vender )
> >
> > >  Here is the address:
> > >  http://github.com/anim510/two_db_demo
> >
> > >   Thanks very much!
> >
> > > Cheers,
> > >  Neil
> >
> > > On Jan 21, 11:26 am, "Neil.Lv"  wrote:
> > > >   My email is :   anim...@gmail.com
> >
> > > > On Jan 21, 11:17 am, "Neil.Lv"  wrote:
> >
> > > > > Mabye it's a bug with DB.runQuery and DB.use in the two db vender
> 
> >
> > > > > Two question: (problem)
> >
> > > > > 1: I don't know why the HelloWorld snippet code will be execute 2
> > > > > times in this code. (See the HelloWorld.scala file.)
> > > > > 2: The dbDefaultConnectionIdentifier method in the Model that it
> works
> > > > > fine when using Mapper's method such as ModelName.findAll(),
> > > > > it doesn't work when using DB.runQuery and DB.use(...) --- (Maybe
> it
> > > > > can't find the default db identifier)
> >
> > > > > The question 2 I test it many times that found this problem.
> >
> > > > > In the test app , the Hot.getHots2 and Hot.getHots3 method can't
> work.
> >
> > > > > I comment the code now in the HelloWorld.scala file, you can try
> it.
> >
> > > > > 
> >
> > > > >   I can push the code on the github, and get this errors "fatal:
> > > > > unable to fork"
> >
> > > > >   So If anyone know what's wrong with it and I can send the
> demo.tar
> > > > > file through the email.
> >
> > > > >   Thanks very much!
> >
> > > > > 
> >
> > > > > Cheers,
> > > > >   Neil
> >
> > > > > On Jan 21, 1:56 am, "Neil.Lv"  wrote:
> >
> > > > > >   The DB.runQuery can works now, but the DB.prepareStatement also
> > > > > > cant' work.
> >
> > > > > >   Here is the test app address:
> > > > > >  http://github.com/anim510/two_db_demo
> >
> > > > > > Cheers,
> > > > > >   Neil
> >
> > > > > > On Jan 21, 1:16 am, "Neil.Lv"  wrote:
> >
> > > > > > >Thank you very much,
> >
> > > > > > >But it doesn't work yet, maybe because of using two db
> > > connections.
> >
> > > > > > >I'll test it later again.
> >
> > > > > > > On Jan 21, 12:44 am, Jeppe Nejsum Madsen 
> wrote:
> >
> > > > > > > > "Neil.Lv"  writes:
> > > > > > > > > Hi all,
> >
> > > > > > > > >   I use two db connections in my app, and I want to use
> > > > > > > > > DB.prepareStatement to select
> > > > > > > > > the records from the second db.
> >
> > > > > > > > >   It failed, Here is the code:
> > > > > > > > > ###
> > > > > > > > >   def getHotByTid(id : Long) =
> > > > > > > > > DB.use(bootstrap.liftweb.TwoDB) {
> > > > > > > > >   conn =>
> > > > > > > > >  DB.prepareStatement("SELECT * FROM hots WHERE id=? ",
> > > conn) {
> > > > > > > > >  stmt =>
> > > > > > > > >  stmt.setLong(1, id)
> > > > > > > > > Log.info("stmt :" + stmt)   // The information is correctly
> > > now, but
> > > > > > > > > after call executeUpdate method
> > > > > > > > >  stmt.executeUpdate()
> > > > > > > > >   }
> > > > > > > > >}
> >
> > > > > > > > Not sure what your problem is really, but I think you should
> use
> > > > > > > > DB.runQuery to execute a select statement
> >
> > > > > > > > Ie
> >
> > > > > > > >   val (_,result) = DB.runQuery("SELECT COUNT(*),
> contract_length
> > >  FROM "+
> > > > > > > > "vehic

[Lift] Re: Ideas for how to inject QueryParams into find() and findAll()

2010-01-21 Thread Franz Bettag
I will implement it into my own MetaMapper-sub-trait so all of my
models can share the code.

Thank you all for your input!

On Jan 21, 9:44 am, Jeppe Nejsum Madsen  wrote:
> Naftoli Gugenheim  writes:
> > Why not define a new method?
> > def findByCurUser(params: QueryParam*) = User.currentUser.flatMap(user=> 
> > find((Seq(By(User.username, user.username.is)) ++ params): _*))
> > find returns a Box and currentUser does too, so flatMap flattens them into 
> > one. Basically find takes a varargs and you're passing a Seq instead using 
> > : _*, and that Seq contains the user and other params.
> > You could probably write params + By(User.username, user.username.is) 
> > instead of the reverse order, as it's shorter than the previous version.
>
> The problem with this solution is that you cannot use any of Lift's
> builtin stuff such as CRUDify.
>
> If you wan't to create a multitenant service with only a single set of 
> tables, you wan't do make damn
> sure that each customer only sees his/her own data :-)
>
> /Jeppe
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: [scala-internals] RC8 candidate for the first 2.8.0 beta

2010-01-21 Thread David Pollak
I've written a work-around and am currently testing the code more in a
few minutes.

On Thu, Jan 21, 2010 at 11:20 AM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

> Okay... it looks like the VarArg stuff is messing with the compiler:
>
> case class Index[A <: Mapper[A]](columns: Seq[IndexItem[A]])
>
> works just fine, but:
>
> case class Index[A <: Mapper[A]](columns: IndexItem[A] *)
>
> Fails.
>
>
> On Thu, Jan 21, 2010 at 10:51 AM, Heiko Seeberger <
> heiko.seeber...@googlemail.com> wrote:
>
>> When updating from RC7 to RC8 we observe the following compiler error:
>>
>> [ERROR]
>> .../lift-mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala:1262:
>> error: type arguments [net.liftweb.mapper.IndexItem[A]] do not conform to
>> method sameElements's type parameter bounds [B >:
>> net.liftweb.mapper.IndexItem[Any]]
>> [INFO] case class Index[A <: Mapper[A]](indexColumns : IndexItem[A]*)
>> extends BaseIndex[A](indexColumns : _*)
>>
>> Any ideas what could be going wrong here?
>>
>> Attached you will find the full source file.
>>
>> Heiko
>>
>> 2010/1/18 Antonio Cunei 
>>
>> All,
>>>
>>> A new release candidate for 2.8.0.Beta1 is available for testing. You can
>>> obtain the new candidate from the links below, as well as from the
>>> scala-tools.org Maven repository:
>>>
>>>
>>> http://www.scala-lang.org/downloads/distrib/files/scala-2.8.0.Beta1-RC8.tgz
>>>
>>> http://www.scala-lang.org/downloads/distrib/files/scala-2.8.0.Beta1-RC8.zip
>>>
>>> http://www.scala-lang.org/downloads/distrib/files/scala-2.8.0.Beta1-RC8-installer.jar
>>>
>>> http://www.scala-lang.org/downloads/distrib/files/scala-2.8.0.Beta1-RC8-devel-docs.tgz
>>>
>>> http://www.scala-lang.org/downloads/distrib/files/scala-2.8.0.Beta1-RC8-sources.tgz
>>>
>>> http://www.scala-lang.org/downloads/distrib/files/scala.library_2.8.0.Beta1-RC8.jar
>>>
>>> This is a candidate for the first, preliminary beta release of 2.8.0: it
>>> is
>>> only intended to help developers port their code onto the new 2.8
>>> codebase,
>>> and it is not production-quality code.
>>>
>>> Developers: this version includes the very latest fixes and updates to
>>> the Scala 2.8 codebase. Kindly test this last RC as well, and let us know if
>>> you detect anything unusual.
>>>
>>> Thanks!
>>> Toni
>>>
>>>
>>
>>
>> --
>> Heiko Seeberger
>>
>> Work: weiglewilczek.com
>> Blog: heikoseeberger.name
>> Follow me: twitter.com/hseeberger
>> OSGi on Scala: scalamodules.org
>> Lift, the simply functional web framework: liftweb.net
>>
>
>
>
> --
> 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
>



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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



[Lift] Re: [scala-internals] RC8 candidate for the first 2.8.0 beta

2010-01-21 Thread martin odersky
(Un)fortunately I have an idea what the problem is. It's probably my
fix for #2867. I have now rolled back that fix in r20629. Can you
check again whether it works with that revision (should be in the
nightly tomorrow)? If it does we might be able to make an exception to
our RC = final rule, because this one just rolls back a non-critical
patch, so I fail to see how this could affect anything but the
original ticket.

Cheers

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




[Lift] Re: [scala-internals] RC8 candidate for the first 2.8.0 beta

2010-01-21 Thread martin odersky
On Thu, Jan 21, 2010 at 8:31 PM, David Pollak
 wrote:
> I've written a work-around and am currently testing the code more in a
> few minutes.
>
If you can make it work, so much the better. To give some info: The
original ticket had a vararg parameter of the form List[_]* in a case
class. This caused type inference for the synthetic equals method
(which uses sameElements for varargs) to fail, because the existential
in List[_] made the problem underconstrained. The patch passed the
argument type explicitly as the type parameter. In the lift case, it
seems that this explicit type parameter violated some type bound, so
the type inferencer should have chosen a more general type which would
not violate the bound. The easiest fix is probably to just roll back
and leave ticket #2867 open until we find a better solution. That's
what I have done.

Cheers

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




[Lift] Re: [scala-internals] RC8 candidate for the first 2.8.0 beta

2010-01-21 Thread David Pollak
Okay... the work-around is checked into the Lift repo.

I say, "Ship RC8 as the beta" and we'll work through this (and likely other)
issues during the beta period.

On Thu, Jan 21, 2010 at 11:36 AM, martin odersky wrote:

> On Thu, Jan 21, 2010 at 8:31 PM, David Pollak
>  wrote:
> > I've written a work-around and am currently testing the code more in
> a
> > few minutes.
> >
> If you can make it work, so much the better. To give some info: The
> original ticket had a vararg parameter of the form List[_]* in a case
> class. This caused type inference for the synthetic equals method
> (which uses sameElements for varargs) to fail, because the existential
> in List[_] made the problem underconstrained. The patch passed the
> argument type explicitly as the type parameter. In the lift case, it
> seems that this explicit type parameter violated some type bound, so
> the type inferencer should have chosen a more general type which would
> not violate the bound. The easiest fix is probably to just roll back
> and leave ticket #2867 open until we find a better solution. That's
> what I have done.
>
> Cheers
>
>  -- Martin
>



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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



[Lift] Re: [scala-internals] RC8 candidate for the first 2.8.0 beta

2010-01-21 Thread martin odersky
On Thu, Jan 21, 2010 at 8:37 PM, David Pollak
 wrote:
> Okay... the work-around is checked into the Lift repo.
>
> I say, "Ship RC8 as the beta" and we'll work through this (and likely other)
> issues during the beta period.
>
Sounds good. Thanks! -- Martin

> On Thu, Jan 21, 2010 at 11:36 AM, martin odersky 
> wrote:
>>
>> On Thu, Jan 21, 2010 at 8:31 PM, David Pollak
>>  wrote:
>> > I've written a work-around and am currently testing the code more in
>> > a
>> > few minutes.
>> >
>> If you can make it work, so much the better. To give some info: The
>> original ticket had a vararg parameter of the form List[_]* in a case
>> class. This caused type inference for the synthetic equals method
>> (which uses sameElements for varargs) to fail, because the existential
>> in List[_] made the problem underconstrained. The patch passed the
>> argument type explicitly as the type parameter. In the lift case, it
>> seems that this explicit type parameter violated some type bound, so
>> the type inferencer should have chosen a more general type which would
>> not violate the bound. The easiest fix is probably to just roll back
>> and leave ticket #2867 open until we find a better solution. That's
>> what I have done.
>>
>> Cheers
>>
>>  -- Martin
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Mapper FKs

2010-01-21 Thread David Pollak
I'm okay with making the flag optional (but on by default with a breaking
changes notice) for the H2 database.

On Wed, Jan 20, 2010 at 11:09 AM, Naftoli Gugenheim wrote:

> David and everone,
> Some time ago we discussed on this list what it would take to have
> Schemifier generate foreign key constraints. The obvious reason why it
> doesn't currently is because the relevant flag on all the DriverTypes is set
> to false.
> Derek was going to work on it but he got busy and didn't get far. Now, I
> personally, on my local repository, enabled foreign key generation for H2
> and it seems to have worked fine (although it gave me plenty of work
> manually fixing the integrity of my client's database so the keys could be
> generated successfully).
> In order for the tests to be successful, I had to change my ManyToManySpecs
> (if that's what it's called) to use a dummy DriverType with FK generation
> off, so it could test ManyToMany with broken joins.
> In any case, my quesion is, what criteria have to be fulfilled to push this
> (besides ReviewBoard approval obviously :) )?
> What level of testing?
> I assume it should be controllable with a flag that should, at least
> temporarily, be false. What form should this setting take?
> What other features should be supported? Different ON UPDATE/DELETE
> actions?
> Note that this is not the most immediate thing on my plate but I did
> already start as mentioned.
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>


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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



[Lift] Mindless work...

2010-01-21 Thread David Pollak
Folks,

It's looking like Scala 2.8 RC8 will become 2.8 Beta1 on Tuesday.

I'd like to get the Lift 2.8 branch up to date (and keep it up to date) with
the 2.0-SNAPSHOT branch as well as getting continuous builds on Hudson and
deployment in the scala-tools.org snapshots directory.

I think our best bet to get the 2.8 branch up to date with 2.0-SNAPSHOT is
to restart the port based on the work that Heiko is doing:
http://github.com/dpp/liftweb/issues#issue/292

I have time to do the mindless work of doing the port tonight (my brain will
explode if it has to think, but mindless is okay).

So:

   - Heiko -- how far along is the stuff in issue 292?  Is this code on the
   irc_issue_292 branch? Can I work on this branch tonight?
   - Indrajit -- Do you have the multi-thingy pom.xml stuff set up so we can
   build a 2.7.7 version and a 2.8 version with different names (2.0-SNAPSHOT
   and 2.0_S28-SNAPSHOT) from the same source tree?  What's the timing for
   getting Hudson all prepared?

Thanks,

David (who is very serious about making Lift on Scala 2.8 very successful)

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

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Naftoli Gugenheim
Those names seem counterintuitive to me. ajaxSubmit submits an ajax form but 
submitAjaxForm submits a non-ajax form? submitAjaxForm implies that it should 
be the reverse, no?

-
Marius wrote:

Instead of

 "submit" -> SHtml.submit("Parse", () => ())

use:

 "submit" -> SHtml.ajaxSubmit("Parse", () => ())

you can also send normal forms via ajax like:

SHtml.submitAjaxForm("formId", () => {

  /// Do your stuff here. This function will be called after form
field functions are executed.
 Noop
})


Br's,
Marius

On Jan 21, 9:03 pm, Kris Nuttycombe  wrote:
> *thump* *thump* Hello, is this thing on? :)
>
> On Wed, Jan 20, 2010 at 10:20 AM, Kris Nuttycombe
>
>  wrote:
> > On Wed, Jan 20, 2010 at 9:51 AM, Kris Nuttycombe
> >  wrote:
> >> On Wed, Jan 20, 2010 at 9:39 AM, Kris Nuttycombe
> >>  wrote:
> >>> Hi, all,
>
> >>> I'm working on an AJAX form and feel like I'm missing something:
> >>> namely, how to update the page based upon the result of the form
> >>> submission.
>
> >>> The three ajaxForm methods in SHtml have the following signatures:
>
> >>> def ajaxForm(body : NodeSeq)
> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)
>
> >>> In these signatures, onSubmit is called by the client prior to form
> >>> submission, and postSubmit is called by the client after successful
> >>> submission. My question is, why is there not a signature like this:
>
> >>> def ajaxForm(body: NodeSeq, result: () => JsCmd)
>
> >>> for which the specified result function will be called, and the JsCmd
> >>> returned to the browser for evaluation after processing of the form
> >>> contents on the server?
>
> >>> Right now, I'm using the following to achieve this effect, but it
> >>> seems really hacky:
>
> >>>        val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
> >>> After(20, SetHtml("results", parse(text
>
> >>>        ajaxForm(
> >>>            bind("plan", xhtml,
> >>>                 "dsl" -> SHtml.textarea("", s => (), "id" ->
> >>> "dsl_text", "rows" -> "40", "cols" -> "120"),
> >>>                 "submit" -> SHtml.submit("Parse", () => ())
> >>>            ),
> >>>            psJs.cmd
> >>>        )
>
> >>> Here, JsCmd is actually doing the heavy lifting prior to form
> >>> submission, with noop implementations for handling of the form
> >>> elements. Seems really hacky.
>
> >>> I feel like I've got to be missing something here, like there's got to
> >>> be a better way to implement this such that the parsing of the
> >>> textarea contents can be done by the closure passed to the
> >>> SHtml.textarea call. How can I do this?
>
> >>> Here's an idea I've been toying with for a while; it would be a
> >>> somewhat significant change to Lift but I feel like there would be
> >>> some benefits.
>
> >>> Instead of SHtml.* having signatures like (String, () => Any, (String,
> >>> String)*) => NodeSeq, imagine that there was a parameterized class
> >>> (call it FormElement) that all of the SHtml methods returned, and then
> >>> an implicit conversion from FormElement to NodeSeq. Might look
> >>> something like this:
>
> >>> trait FormElement[T] {
> >>>  def !: T
> >>>  def toNodeSeq: NodeSeq
> >>> }
>
> >> An addendum: there's an obvious extension available here:
>
> >> trait FormElement[T] { self =>
> >>  def !: T
>
> >>  def toNodeSeq: NodeSeq
>
> >>  def map[U](f: T => U): FormElement[U] = new FormElement[U] {
> >>    lazy val !: U = f(self!)
> >>    lazy val toNodeSeq: NodeSeq = self.toNodeSeq
> >>  }
>
> >>  def flatMap[U](f: T => FormElement[U]): FormElement[U] = new
> >> FormElement[U] {
> >>    private lazy val cache = f(self!)
> >>    lazy val !: U = cache!
> >>    lazy val toNodeSeq = self.toNodeSeq ++ cache.toNodeSeq
> >>  }
> >> }
>
> > On second thought, that FormElement implementation as a monad is wrong
> > because toNodeSeq would cause strict evaluation of the closure when
> > used in the SHtml.* case. Maybe FormElement just has to be a functor
> > and not a monad.
>
> > 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=en.


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




[Lift] Version of maven for lift

2010-01-21 Thread James Matlik
What is Lift's recommended version of Maven?  I am looking to create an sbaz
package for easy download and install for maven for newcomers (myself
included), and figure that having one that is compatible with lift would be
of prime interest.  Is the latest and greatest version compatible with 2.0?

Regards,
James
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

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



Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Kris Nuttycombe
On Thu, Jan 21, 2010 at 12:23 PM, Marius  wrote:
> Instead of
>
>  "submit" -> SHtml.submit("Parse", () => ())
>
> use:
>
>  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
>
> you can also send normal forms via ajax like:
>
> SHtml.submitAjaxForm("formId", () => {
>
>  /// Do your stuff here. This function will be called after form
> field functions are executed.
>  Noop
> })
>
>
> Br's,
> Marius

Thanks, Marius. I've just updated from M1 to the snapshot to get
ajaxSubmit; however, it doesn't address my question as to why the
function passed to AjaxSubmit doesn't return a JsCmd that can be used
to refresh the page.

Also, any thoughts on my proposal?

Kris


>
> On Jan 21, 9:03 pm, Kris Nuttycombe  wrote:
>> *thump* *thump* Hello, is this thing on? :)
>>
>> On Wed, Jan 20, 2010 at 10:20 AM, Kris Nuttycombe
>>
>>  wrote:
>> > On Wed, Jan 20, 2010 at 9:51 AM, Kris Nuttycombe
>> >  wrote:
>> >> On Wed, Jan 20, 2010 at 9:39 AM, Kris Nuttycombe
>> >>  wrote:
>> >>> Hi, all,
>>
>> >>> I'm working on an AJAX form and feel like I'm missing something:
>> >>> namely, how to update the page based upon the result of the form
>> >>> submission.
>>
>> >>> The three ajaxForm methods in SHtml have the following signatures:
>>
>> >>> def ajaxForm(body : NodeSeq)
>> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
>> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)
>>
>> >>> In these signatures, onSubmit is called by the client prior to form
>> >>> submission, and postSubmit is called by the client after successful
>> >>> submission. My question is, why is there not a signature like this:
>>
>> >>> def ajaxForm(body: NodeSeq, result: () => JsCmd)
>>
>> >>> for which the specified result function will be called, and the JsCmd
>> >>> returned to the browser for evaluation after processing of the form
>> >>> contents on the server?
>>
>> >>> Right now, I'm using the following to achieve this effect, but it
>> >>> seems really hacky:
>>
>> >>>        val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
>> >>> After(20, SetHtml("results", parse(text
>>
>> >>>        ajaxForm(
>> >>>            bind("plan", xhtml,
>> >>>                 "dsl" -> SHtml.textarea("", s => (), "id" ->
>> >>> "dsl_text", "rows" -> "40", "cols" -> "120"),
>> >>>                 "submit" -> SHtml.submit("Parse", () => ())
>> >>>            ),
>> >>>            psJs.cmd
>> >>>        )
>>
>> >>> Here, JsCmd is actually doing the heavy lifting prior to form
>> >>> submission, with noop implementations for handling of the form
>> >>> elements. Seems really hacky.
>>
>> >>> I feel like I've got to be missing something here, like there's got to
>> >>> be a better way to implement this such that the parsing of the
>> >>> textarea contents can be done by the closure passed to the
>> >>> SHtml.textarea call. How can I do this?
>>
>> >>> Here's an idea I've been toying with for a while; it would be a
>> >>> somewhat significant change to Lift but I feel like there would be
>> >>> some benefits.
>>
>> >>> Instead of SHtml.* having signatures like (String, () => Any, (String,
>> >>> String)*) => NodeSeq, imagine that there was a parameterized class
>> >>> (call it FormElement) that all of the SHtml methods returned, and then
>> >>> an implicit conversion from FormElement to NodeSeq. Might look
>> >>> something like this:
>>
>> >>> trait FormElement[T] {
>> >>>  def !: T
>> >>>  def toNodeSeq: NodeSeq
>> >>> }
>>
>> >> An addendum: there's an obvious extension available here:
>>
>> >> trait FormElement[T] { self =>
>> >>  def !: T
>>
>> >>  def toNodeSeq: NodeSeq
>>
>> >>  def map[U](f: T => U): FormElement[U] = new FormElement[U] {
>> >>    lazy val !: U = f(self!)
>> >>    lazy val toNodeSeq: NodeSeq = self.toNodeSeq
>> >>  }
>>
>> >>  def flatMap[U](f: T => FormElement[U]): FormElement[U] = new
>> >> FormElement[U] {
>> >>    private lazy val cache = f(self!)
>> >>    lazy val !: U = cache!
>> >>    lazy val toNodeSeq = self.toNodeSeq ++ cache.toNodeSeq
>> >>  }
>> >> }
>>
>> > On second thought, that FormElement implementation as a monad is wrong
>> > because toNodeSeq would cause strict evaluation of the closure when
>> > used in the SHtml.* case. Maybe FormElement just has to be a functor
>> > and not a monad.
>>
>> > 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=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: [lift] Version of maven for lift

2010-01-21 Thread Channing Walton

I use maven 2.2.1 without any problem. i prefer to use sbt these days which
still makes use of mvn repositories.


James Matlik wrote:
> 
> What is Lift's recommended version of Maven?  I am looking to create an
> sbaz
> package for easy download and install for maven for newcomers (myself
> included), and figure that having one that is compatible with lift would
> be
> of prime interest.  Is the latest and greatest version compatible with
> 2.0?
> 
> Regards,
> James
> 
> -- 
> 
> You received this message because you are subscribed to the Google Groups
> "Lift" group. 
> 
> To post to this group, send email to lift...@googlegroups.com. 
> 
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com. 
> 
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en. 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Version-of-maven-for-lift-tp27264662p27264918.html
Sent from the liftweb mailing list archive at Nabble.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=en.




[Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Marius


On Jan 21, 11:15 pm, Kris Nuttycombe 
wrote:
> On Thu, Jan 21, 2010 at 12:23 PM, Marius  wrote:
> > Instead of
>
> >  "submit" -> SHtml.submit("Parse", () => ())
>
> > use:
>
> >  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
>
> > you can also send normal forms via ajax like:
>
> > SHtml.submitAjaxForm("formId", () => {
>
> >  /// Do your stuff here. This function will be called after form
> > field functions are executed.
> >  Noop
> > })
>
> > Br's,
> > Marius
>
> Thanks, Marius. I've just updated from M1 to the snapshot to get
> ajaxSubmit; however, it doesn't address my question as to why the
> function passed to AjaxSubmit doesn't return a JsCmd that can be used
> to refresh the page.

The ajaxSubmit has the signature:

def ajaxSubmit(value: String, func: () => Any, attrs: (String, String)
*)

returns an Any because Lift looks for the following:

JsCmd,
NodeSeq
JsCommands
LiftResponse

however for consistency reasons I think I should change it to  func:
() => JsCmd

>
> Also, any thoughts on my proposal?

I don't really see the benefits in doing that.

>
> Kris
>
>
>
> > On Jan 21, 9:03 pm, Kris Nuttycombe  wrote:
> >> *thump* *thump* Hello, is this thing on? :)
>
> >> On Wed, Jan 20, 2010 at 10:20 AM, Kris Nuttycombe
>
> >>  wrote:
> >> > On Wed, Jan 20, 2010 at 9:51 AM, Kris Nuttycombe
> >> >  wrote:
> >> >> On Wed, Jan 20, 2010 at 9:39 AM, Kris Nuttycombe
> >> >>  wrote:
> >> >>> Hi, all,
>
> >> >>> I'm working on an AJAX form and feel like I'm missing something:
> >> >>> namely, how to update the page based upon the result of the form
> >> >>> submission.
>
> >> >>> The three ajaxForm methods in SHtml have the following signatures:
>
> >> >>> def ajaxForm(body : NodeSeq)
> >> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
> >> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)
>
> >> >>> In these signatures, onSubmit is called by the client prior to form
> >> >>> submission, and postSubmit is called by the client after successful
> >> >>> submission. My question is, why is there not a signature like this:
>
> >> >>> def ajaxForm(body: NodeSeq, result: () => JsCmd)
>
> >> >>> for which the specified result function will be called, and the JsCmd
> >> >>> returned to the browser for evaluation after processing of the form
> >> >>> contents on the server?
>
> >> >>> Right now, I'm using the following to achieve this effect, but it
> >> >>> seems really hacky:
>
> >> >>>        val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
> >> >>> After(20, SetHtml("results", parse(text
>
> >> >>>        ajaxForm(
> >> >>>            bind("plan", xhtml,
> >> >>>                 "dsl" -> SHtml.textarea("", s => (), "id" ->
> >> >>> "dsl_text", "rows" -> "40", "cols" -> "120"),
> >> >>>                 "submit" -> SHtml.submit("Parse", () => ())
> >> >>>            ),
> >> >>>            psJs.cmd
> >> >>>        )
>
> >> >>> Here, JsCmd is actually doing the heavy lifting prior to form
> >> >>> submission, with noop implementations for handling of the form
> >> >>> elements. Seems really hacky.
>
> >> >>> I feel like I've got to be missing something here, like there's got to
> >> >>> be a better way to implement this such that the parsing of the
> >> >>> textarea contents can be done by the closure passed to the
> >> >>> SHtml.textarea call. How can I do this?
>
> >> >>> Here's an idea I've been toying with for a while; it would be a
> >> >>> somewhat significant change to Lift but I feel like there would be
> >> >>> some benefits.
>
> >> >>> Instead of SHtml.* having signatures like (String, () => Any, (String,
> >> >>> String)*) => NodeSeq, imagine that there was a parameterized class
> >> >>> (call it FormElement) that all of the SHtml methods returned, and then
> >> >>> an implicit conversion from FormElement to NodeSeq. Might look
> >> >>> something like this:
>
> >> >>> trait FormElement[T] {
> >> >>>  def !: T
> >> >>>  def toNodeSeq: NodeSeq
> >> >>> }
>
> >> >> An addendum: there's an obvious extension available here:
>
> >> >> trait FormElement[T] { self =>
> >> >>  def !: T
>
> >> >>  def toNodeSeq: NodeSeq
>
> >> >>  def map[U](f: T => U): FormElement[U] = new FormElement[U] {
> >> >>    lazy val !: U = f(self!)
> >> >>    lazy val toNodeSeq: NodeSeq = self.toNodeSeq
> >> >>  }
>
> >> >>  def flatMap[U](f: T => FormElement[U]): FormElement[U] = new
> >> >> FormElement[U] {
> >> >>    private lazy val cache = f(self!)
> >> >>    lazy val !: U = cache!
> >> >>    lazy val toNodeSeq = self.toNodeSeq ++ cache.toNodeSeq
> >> >>  }
> >> >> }
>
> >> > On second thought, that FormElement implementation as a monad is wrong
> >> > because toNodeSeq would cause strict evaluation of the closure when
> >> > used in the SHtml.* case. Maybe FormElement just has to be a functor
> >> > and not a monad.
>
> >> > Kris
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegro

[Lift] Re: Snippet question

2010-01-21 Thread Franz Bettag
One last question, is there any way to give an ajaxText some kind of
style/class/id attribute? I looked at the source but it was really
hard to get the hang of it.

best regards.

On 21 Jan., 02:05, Franz Bettag  wrote:
> Ah, i was already wondering if that was a typo or what it does =)
> thank you very much.
>
> The project is coming along nicely. You really notice the performance
> difference between our old one (ruby based) and scala. Lift delivery
> the list of all subnets in 2.6 seconds. Merb needed almost 8 seconds
> for the same request.
>
> I must admit that the merb project used amqp to collect remote data
> and i use akka now, but the performance boost is kinda incredible.
> Also on the merb-implementation, i had most of the rendering done by
> JS since rendering everything with ruby slowed down everything for
> another few seconds, on lift it works even faster on the client side
> since it already does the output-generation in a nip of a second.
>
> Kudos!
>
> On 21 Jan., 01:24, Ross Mellgren  wrote:
>
> > Use & to combine JsCmd. e.g.
>
> > JsShowId("ajax-spinner") & SetHtml("subnet-1234", my awesome subnet 
> > contents)
>
> > -Ross
>
> > On Jan 20, 2010, at 7:16 PM, Franz Bettag wrote:
>
> > > Works like a charm now! Thanks!
>
> > > One last question tho, is it possible to get a client-Side-callback
> > > for net.liftweb.http.SHtml.a?
> > > I want to start showing a specific ajax spinner (have more than one on
> > > the page) upon pressing a special link.
>
> > > I don't get how i might "chain" them together. :)
>
> > > On 20 Jan., 22:15, Franz Bettag  wrote:
> > >> Of course i forgot to paste the snippet..http://pastie.org/787160
>
> > >> On 20 Jan., 21:44, Ross Mellgren  wrote:
>
> > >>> Scala can't figure out what type of parameter you mean, so you need to 
> > >>> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> > >>> Or use a separately named function with a type signature, e.g.
>
> > >>> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig);  > >>> /> }
>
> > >>> bind(..., "expand" -> doTheStuff _)
>
> > >>> -Ross
>
> > >>> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> >  "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> >  error: not a legal formal parameter (pointing at the => )
>
> >  On 20 Jan., 21:32, greekscala  wrote:
> > > Hello,
>
> > > yes a function that takes NodeSeq parameter and returns
> > > a NodeSeq :)
>
> > > "foo" -> (ns) => {function body} or
> > > "foo" -> theCalledFunction
>
> > > best regards
>
> > > On 20 Jan., 21:26, Franz Bettag  wrote:
>
> > >> How would that look like?
> > >> "foo" => nodeSeqMethod _ ?
>
> > >> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
> > >>> Meaning to the right of the -> arrow.
>
> > >>> -
>
> > >>> Franz Bettag wrote:
>
> > >>> Ah figured it out. Played long enough around to get the right way:
>
> > >>> () => {expand(trafficReply.subnet)}
>
> > >>> Another question though, would it be possible to use
> > >>>  and pass 
> > >>> the
> > >>> given NodeSeq over the bind into a function?
>
> > >>> On 20 Jan., 19:08, Franz Bettag  wrote:
>
> >  Sorry if i am asking a lot of questions lately, but i am trying to 
> >  get
> >  this project of mine working so i can write about the specific
> >  problems i ran into and how they got done.
>
> >          def subnets(xhtml: NodeSeq): NodeSeq = {
> >                  val content = IPnet.findAll(OrderBy(IPnet.name, 
> >  Ascending)).map(ip
> >  => {
>
> >                          /* Bind the xml */
> >                          bind("ip", xhtml,
> >                                  "subnet" -> Text(ip.name.toString),
> >                                  "action" -> 
> >  SHtml.a(expand(ip.subnet) _, "See all IPs")
> >                                  )
> >                  }).mkString
>
> >                  XML.loadString("%s".format(content))
> >          }
>
> >          def expand(subnet: String): JsCmd = {
> >                  Log.info("Requested subnet %s".format(subnet))
> >                  Alert("subnet %s was requested".format(subnet))
> >          }
>
> >  The Problem is the "action" that gets binded. I don't get how i 
> >  have
> >  to use SHtml.a to pass a value to the called function. Any hints?
>
> >  Thank you very much 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 
> > >>> athttp://groups.goo

Re: [Lift] Re: Snippet question

2010-01-21 Thread Ross Mellgren
The signature of ajaxText is:

def ajaxText(value : String, func : (String) => JsCmd, attrs : (String, 
String)*): Elem
def ajaxText(value : String, jsFunc : Call, func : (String) => JsCmd, attrs : 
(String, String)*): Elem

The attrs vararg is for this purpose, just pass in additional attributes you 
want there. Note that you should not pass the "name" attribute, as that is 
generated by Lift.

-Ross
 
On Jan 21, 2010, at 4:43 PM, Franz Bettag wrote:

> One last question, is there any way to give an ajaxText some kind of
> style/class/id attribute? I looked at the source but it was really
> hard to get the hang of it.
> 
> best regards.
> 
> On 21 Jan., 02:05, Franz Bettag  wrote:
>> Ah, i was already wondering if that was a typo or what it does =)
>> thank you very much.
>> 
>> The project is coming along nicely. You really notice the performance
>> difference between our old one (ruby based) and scala. Lift delivery
>> the list of all subnets in 2.6 seconds. Merb needed almost 8 seconds
>> for the same request.
>> 
>> I must admit that the merb project used amqp to collect remote data
>> and i use akka now, but the performance boost is kinda incredible.
>> Also on the merb-implementation, i had most of the rendering done by
>> JS since rendering everything with ruby slowed down everything for
>> another few seconds, on lift it works even faster on the client side
>> since it already does the output-generation in a nip of a second.
>> 
>> Kudos!
>> 
>> On 21 Jan., 01:24, Ross Mellgren  wrote:
>> 
>>> Use & to combine JsCmd. e.g.
>> 
>>> JsShowId("ajax-spinner") & SetHtml("subnet-1234", my awesome subnet 
>>> contents)
>> 
>>> -Ross
>> 
>>> On Jan 20, 2010, at 7:16 PM, Franz Bettag wrote:
>> 
 Works like a charm now! Thanks!
>> 
 One last question tho, is it possible to get a client-Side-callback
 for net.liftweb.http.SHtml.a?
 I want to start showing a specific ajax spinner (have more than one on
 the page) upon pressing a special link.
>> 
 I don't get how i might "chain" them together. :)
>> 
 On 20 Jan., 22:15, Franz Bettag  wrote:
> Of course i forgot to paste the snippet..http://pastie.org/787160
>> 
> On 20 Jan., 21:44, Ross Mellgren  wrote:
>> 
>> Scala can't figure out what type of parameter you mean, so you need to 
>> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>> 
>> Or use a separately named function with a type signature, e.g.
>> 
>> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig); > /> }
>> 
>> bind(..., "expand" -> doTheStuff _)
>> 
>> -Ross
>> 
>> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>> 
>>> "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>> 
>>> error: not a legal formal parameter (pointing at the => )
>> 
>>> On 20 Jan., 21:32, greekscala  wrote:
 Hello,
>> 
 yes a function that takes NodeSeq parameter and returns
 a NodeSeq :)
>> 
 "foo" -> (ns) => {function body} or
 "foo" -> theCalledFunction
>> 
 best regards
>> 
 On 20 Jan., 21:26, Franz Bettag  wrote:
>> 
> How would that look like?
> "foo" => nodeSeqMethod _ ?
>> 
> On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>> 
>> Meaning to the right of the -> arrow.
>> 
>> -
>> 
>> Franz Bettag wrote:
>> 
>> Ah figured it out. Played long enough around to get the right way:
>> 
>> () => {expand(trafficReply.subnet)}
>> 
>> Another question though, would it be possible to use
>>  and pass the
>> given NodeSeq over the bind into a function?
>> 
>> On 20 Jan., 19:08, Franz Bettag  wrote:
>> 
>>> Sorry if i am asking a lot of questions lately, but i am trying to 
>>> get
>>> this project of mine working so i can write about the specific
>>> problems i ran into and how they got done.
>> 
>>> def subnets(xhtml: NodeSeq): NodeSeq = {
>>> val content = IPnet.findAll(OrderBy(IPnet.name, 
>>> Ascending)).map(ip
>>> => {
>> 
>>> /* Bind the xml */
>>> bind("ip", xhtml,
>>> "subnet" -> Text(ip.name.toString),
>>> "action" -> 
>>> SHtml.a(expand(ip.subnet) _, "See all IPs")
>>> )
>>> }).mkString
>> 
>>> XML.loadString("%s".format(content))
>>> }
>> 
>>> def expand(subnet: String): JsCmd = {
>>> Log.info("Requested subnet %s".format(subnet))
>>> Alert("subnet %s was requested".format(subnet))
>>> }
>> 
>>> The Problem is the "action" that gets binded. I don't get how i have
>>> to use SHtml.a to pass a va

Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Kris Nuttycombe
On Thu, Jan 21, 2010 at 2:43 PM, Marius  wrote:
>
>
> On Jan 21, 11:15 pm, Kris Nuttycombe 
> wrote:
>> On Thu, Jan 21, 2010 at 12:23 PM, Marius  wrote:
>> > Instead of
>>
>> >  "submit" -> SHtml.submit("Parse", () => ())
>>
>> > use:
>>
>> >  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
>>
>> > you can also send normal forms via ajax like:
>>
>> > SHtml.submitAjaxForm("formId", () => {
>>
>> >  /// Do your stuff here. This function will be called after form
>> > field functions are executed.
>> >  Noop
>> > })
>>
>> > Br's,
>> > Marius
>>
>> Thanks, Marius. I've just updated from M1 to the snapshot to get
>> ajaxSubmit; however, it doesn't address my question as to why the
>> function passed to AjaxSubmit doesn't return a JsCmd that can be used
>> to refresh the page.
>
> The ajaxSubmit has the signature:
>
> def ajaxSubmit(value: String, func: () => Any, attrs: (String, String)
> *)
>
> returns an Any because Lift looks for the following:
>
> JsCmd,
> NodeSeq
> JsCommands
> LiftResponse
>
> however for consistency reasons I think I should change it to  func:
> () => JsCmd
>
>>
>> Also, any thoughts on my proposal?
>
> I don't really see the benefits in doing that.

The benefit is predictability; with the current functionality, as I
understand it, the order of evaluation of closures associated with
form elements is dependent upon the order in which those elements are
added to the form. What my proposal does is (1) eliminate the need to
close over local vars and (2) eliminate the dependence upon order of
declaration.

In essence, my proposal is to give the user the ability to, in
addition to having those closures invoked automatically on the
processing of a form, be able to explicitly invoke them during form
processing.

I really dislike the pattern:

def mySnippet(xhtml: NodeSeq) {
  var a: Option[String] = None

  bind("a", xhtml,
 "value" -> text("". s => a = Some(s)),
 "submit" -> submit("Submit", () => a.foreach(doSomething _)
  )
}

With my proposal, this would become:

def mySnippet(xhtml: NodeSeq) {
   val aField = text("s", s => s)

  bind("a", xhtml,
 "value" -> aField,
 "submit" -> submit("Submit", () => doSomething(a!))
  )
}

This becomes really advantageous, I think, when you're talking about
15 or 20 different form elements. The var solution in that case
becomes totally unwieldy because of the unwrapping of all of the
Options.

Kris


>>
>> Kris
>>
>>
>>
>> > On Jan 21, 9:03 pm, Kris Nuttycombe  wrote:
>> >> *thump* *thump* Hello, is this thing on? :)
>>
>> >> On Wed, Jan 20, 2010 at 10:20 AM, Kris Nuttycombe
>>
>> >>  wrote:
>> >> > On Wed, Jan 20, 2010 at 9:51 AM, Kris Nuttycombe
>> >> >  wrote:
>> >> >> On Wed, Jan 20, 2010 at 9:39 AM, Kris Nuttycombe
>> >> >>  wrote:
>> >> >>> Hi, all,
>>
>> >> >>> I'm working on an AJAX form and feel like I'm missing something:
>> >> >>> namely, how to update the page based upon the result of the form
>> >> >>> submission.
>>
>> >> >>> The three ajaxForm methods in SHtml have the following signatures:
>>
>> >> >>> def ajaxForm(body : NodeSeq)
>> >> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd)
>> >> >>> def ajaxForm(body : NodeSeq, onSubmit : JsCmd, postSubmit : JsCmd)
>>
>> >> >>> In these signatures, onSubmit is called by the client prior to form
>> >> >>> submission, and postSubmit is called by the client after successful
>> >> >>> submission. My question is, why is there not a signature like this:
>>
>> >> >>> def ajaxForm(body: NodeSeq, result: () => JsCmd)
>>
>> >> >>> for which the specified result function will be called, and the JsCmd
>> >> >>> returned to the browser for evaluation after processing of the form
>> >> >>> contents on the server?
>>
>> >> >>> Right now, I'm using the following to achieve this effect, but it
>> >> >>> seems really hacky:
>>
>> >> >>>        val (psId, psJs) = ajaxCall(JsRaw("dsl_text.value"), text =>
>> >> >>> After(20, SetHtml("results", parse(text
>>
>> >> >>>        ajaxForm(
>> >> >>>            bind("plan", xhtml,
>> >> >>>                 "dsl" -> SHtml.textarea("", s => (), "id" ->
>> >> >>> "dsl_text", "rows" -> "40", "cols" -> "120"),
>> >> >>>                 "submit" -> SHtml.submit("Parse", () => ())
>> >> >>>            ),
>> >> >>>            psJs.cmd
>> >> >>>        )
>>
>> >> >>> Here, JsCmd is actually doing the heavy lifting prior to form
>> >> >>> submission, with noop implementations for handling of the form
>> >> >>> elements. Seems really hacky.
>>
>> >> >>> I feel like I've got to be missing something here, like there's got to
>> >> >>> be a better way to implement this such that the parsing of the
>> >> >>> textarea contents can be done by the closure passed to the
>> >> >>> SHtml.textarea call. How can I do this?
>>
>> >> >>> Here's an idea I've been toying with for a while; it would be a
>> >> >>> somewhat significant change to Lift but I feel like there would be
>> >> >>> some benefits.
>>
>> >> >>> Instead of SHtml.* having signatures like (S

[Lift] Fwd: Re: Review Request: Ajax change from () => Any to () => JsCmd

2010-01-21 Thread Naftoli Gugenheim
I hope it's okay that I'm forwarding this to the list.
A suggestion, to allow all the alternatives in a type-safe and type-documenting 
way, would involve implicits. So you would have say
sealed trait AjaxResponse
case class JsCmdResponse(cmd: JsCmd)
...
object AjaxReponse {
  implicit def apply(cmd: JsCmd): AjaxResponse = JsCmdResponse(cmd)
  ...
}
Alternatively, define the implicit separate from the apply method (e.g., in 
SHtml).
Then you can either write AjaxResponse(myJsCmd), or import the implicits (if 
they're in SHtml you may not need a new import statement) and write it the old 
way.


-
From: Kris Nuttycombe
To: 
heiko.seeber...@googlemail.com;alex.boisv...@gmail.com;naftoli...@gmail.com;feeder.of.the.be...@gmail.com;jorge.or...@gmail.com;atsuhiko.yaman...@gmail.com;marius.dan...@gmail.com;joni.free...@reaktor.fi;dchenbec...@gmail.com;indraj...@gmail.com;kris.nuttyco...@gmail.com;char...@munat.com
Subject: Re: Review Request: Ajax change from () => Any to () => JsCmd
Date: Jan 21, 2:23 PM


---
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.liftweb.net/r/184/#review481
---


Since ajaxSubmit is brand-new, this makes sense to me. I was unaware that Lift 
explicitly attempted to match JsCmd, NodeSeq, JsCommands, and LiftResponse as 
you noted in your mail to the list. It would be helpful to add this to the 
documentation of the other methods that take functions returning Any; also, 
would it make sense to have these signatures return a common super-trait (not 
likely, because of NodeSeq) or else a standard sealed trait with concrete 
instances wrapping each one of those types?


- Kris


On 2010-01-21 14:08:12.907657, Marius Danciu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.liftweb.net/r/184/
> ---
> 
> (Updated 2010-01-21 14:08:12.907657)
> 
> 
> Review request for Derek Chen-Becker, David Pollak, Marius Danciu, Charles 
> Munat, Heiko Seeberger, Joni Freeman, Atsuhiko Yamanaka, Jorge Ortiz, Naftoli 
> Gugenheim, Kris Nuttycombe, Indrajit Raychaudhuri, and Alex Boisvert.
> 
> 
> Summary
> ---
> 
> It's more consistent for ajax functions to return JsCmd
> 
> 
> This addresses bug 295.
> http://github.com/dpp/liftweb/issues#issue/295
> 
> 
> Diffs
> -
> 
>   framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/SHtml.scala 
> 82949d1 
>   
> framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/MappedLong.scala
>  7655346 
> 
> Diff: http://reviewboard.liftweb.net/r/184/diff
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Marius
> 
>

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



Re: [Lift] Version of maven for lift

2010-01-21 Thread Naftoli Gugenheim
You want an sbaz package that will contain what exactly?

-
James Matlik wrote:

What is Lift's recommended version of Maven?  I am looking to create an sbaz
package for easy download and install for maven for newcomers (myself
included), and figure that having one that is compatible with lift would be
of prime interest.  Is the latest and greatest version compatible with 2.0?

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

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



[Lift] Re: Snippet question

2010-01-21 Thread Franz Bettag
Hm, i saw a method with attrs, but it was private. guess i overlooked
it. thanks.

On 21 Jan., 22:46, Ross Mellgren  wrote:
> The signature of ajaxText is:
>
> def ajaxText(value : String, func : (String) => JsCmd, attrs : (String, 
> String)*): Elem
> def ajaxText(value : String, jsFunc : Call, func : (String) => JsCmd, attrs : 
> (String, String)*): Elem
>
> The attrs vararg is for this purpose, just pass in additional attributes you 
> want there. Note that you should not pass the "name" attribute, as that is 
> generated by Lift.
>
> -Ross
>
> On Jan 21, 2010, at 4:43 PM, Franz Bettag wrote:
>
> > One last question, is there any way to give an ajaxText some kind of
> > style/class/id attribute? I looked at the source but it was really
> > hard to get the hang of it.
>
> > best regards.
>
> > On 21 Jan., 02:05, Franz Bettag  wrote:
> >> Ah, i was already wondering if that was a typo or what it does =)
> >> thank you very much.
>
> >> The project is coming along nicely. You really notice the performance
> >> difference between our old one (ruby based) and scala. Lift delivery
> >> the list of all subnets in 2.6 seconds. Merb needed almost 8 seconds
> >> for the same request.
>
> >> I must admit that the merb project used amqp to collect remote data
> >> and i use akka now, but the performance boost is kinda incredible.
> >> Also on the merb-implementation, i had most of the rendering done by
> >> JS since rendering everything with ruby slowed down everything for
> >> another few seconds, on lift it works even faster on the client side
> >> since it already does the output-generation in a nip of a second.
>
> >> Kudos!
>
> >> On 21 Jan., 01:24, Ross Mellgren  wrote:
>
> >>> Use & to combine JsCmd. e.g.
>
> >>> JsShowId("ajax-spinner") & SetHtml("subnet-1234", my awesome subnet 
> >>> contents)
>
> >>> -Ross
>
> >>> On Jan 20, 2010, at 7:16 PM, Franz Bettag wrote:
>
>  Works like a charm now! Thanks!
>
>  One last question tho, is it possible to get a client-Side-callback
>  for net.liftweb.http.SHtml.a?
>  I want to start showing a specific ajax spinner (have more than one on
>  the page) upon pressing a special link.
>
>  I don't get how i might "chain" them together. :)
>
>  On 20 Jan., 22:15, Franz Bettag  wrote:
> > Of course i forgot to paste the snippet..http://pastie.org/787160
>
> > On 20 Jan., 21:44, Ross Mellgren  wrote:
>
> >> Scala can't figure out what type of parameter you mean, so you need to 
> >> annotate it  -- "expand" -> (fooXhtml: NodeSeq) => {... }
>
> >> Or use a separately named function with a type signature, e.g.
>
> >> def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig); 
> >>  }
>
> >> bind(..., "expand" -> doTheStuff _)
>
> >> -Ross
>
> >> On Jan 20, 2010, at 3:41 PM, Franz Bettag wrote:
>
> >>> "expand" -> (fooXhtml) => { Log.error(fooXhtml.toString);  },
>
> >>> error: not a legal formal parameter (pointing at the => )
>
> >>> On 20 Jan., 21:32, greekscala  wrote:
>  Hello,
>
>  yes a function that takes NodeSeq parameter and returns
>  a NodeSeq :)
>
>  "foo" -> (ns) => {function body} or
>  "foo" -> theCalledFunction
>
>  best regards
>
>  On 20 Jan., 21:26, Franz Bettag  wrote:
>
> > How would that look like?
> > "foo" => nodeSeqMethod _ ?
>
> > On 20 Jan., 21:21, Naftoli Gugenheim  wrote:
>
> >> Meaning to the right of the -> arrow.
>
> >> -
>
> >> Franz Bettag wrote:
>
> >> Ah figured it out. Played long enough around to get the right way:
>
> >> () => {expand(trafficReply.subnet)}
>
> >> Another question though, would it be possible to use
> >>  and pass 
> >> the
> >> given NodeSeq over the bind into a function?
>
> >> On 20 Jan., 19:08, Franz Bettag  wrote:
>
> >>> Sorry if i am asking a lot of questions lately, but i am trying 
> >>> to get
> >>> this project of mine working so i can write about the specific
> >>> problems i ran into and how they got done.
>
> >>>         def subnets(xhtml: NodeSeq): NodeSeq = {
> >>>                 val content = IPnet.findAll(OrderBy(IPnet.name, 
> >>> Ascending)).map(ip
> >>> => {
>
> >>>                         /* Bind the xml */
> >>>                         bind("ip", xhtml,
> >>>                                 "subnet" -> 
> >>> Text(ip.name.toString),
> >>>                                 "action" -> 
> >>> SHtml.a(expand(ip.subnet) _, "See all IPs")
> >>>                                 )
> >>>                 }).mkString
>
> >>>                 XML.loadString("%s".format(content))
> >>>         }
>
> >>>         def expand(subnet: String): JsCmd = {
> >>>                 Log.info("

Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Kris Nuttycombe
On Thu, Jan 21, 2010 at 2:43 PM, Marius  wrote:
>
>
> On Jan 21, 11:15 pm, Kris Nuttycombe 
> wrote:
>> On Thu, Jan 21, 2010 at 12:23 PM, Marius  wrote:
>> > Instead of
>>
>> >  "submit" -> SHtml.submit("Parse", () => ())
>>
>> > use:
>>
>> >  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
>>
>> > you can also send normal forms via ajax like:
>>
>> > SHtml.submitAjaxForm("formId", () => {
>>
>> >  /// Do your stuff here. This function will be called after form
>> > field functions are executed.
>> >  Noop
>> > })
>>
>> > Br's,
>> > Marius
>>
>> Thanks, Marius. I've just updated from M1 to the snapshot to get
>> ajaxSubmit; however, it doesn't address my question as to why the
>> function passed to AjaxSubmit doesn't return a JsCmd that can be used
>> to refresh the page.
>
> The ajaxSubmit has the signature:
>
> def ajaxSubmit(value: String, func: () => Any, attrs: (String, String)
> *)
>
> returns an Any because Lift looks for the following:
>
> JsCmd,
> NodeSeq
> JsCommands
> LiftResponse

I think I must be misunderstanding something - should I expect the
following to work?

var text: Option[String] = None
ajaxForm(
bind("plan", xhtml,
 "dsl" -> textarea("", s => text = Some(s), "id" ->
"dsl_text", "rows" -> "40", "cols" -> "120"),
 "submit" -> ajaxSubmit("Create Plan", () =>
SetHtml("results", buildPlan(text.get)))
)
)

where there is  in the rendered page? I don't seem
to get the expected results back, though it's clear from logging that
this is being processed correctly.

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



Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Kris Nuttycombe
On Thu, Jan 21, 2010 at 4:36 PM, Kris Nuttycombe
 wrote:
> On Thu, Jan 21, 2010 at 2:43 PM, Marius  wrote:
>>
>>
>> On Jan 21, 11:15 pm, Kris Nuttycombe 
>> wrote:
>>> On Thu, Jan 21, 2010 at 12:23 PM, Marius  wrote:
>>> > Instead of
>>>
>>> >  "submit" -> SHtml.submit("Parse", () => ())
>>>
>>> > use:
>>>
>>> >  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
>>>
>>> > you can also send normal forms via ajax like:
>>>
>>> > SHtml.submitAjaxForm("formId", () => {
>>>
>>> >  /// Do your stuff here. This function will be called after form
>>> > field functions are executed.
>>> >  Noop
>>> > })
>>>
>>> > Br's,
>>> > Marius
>>>
>>> Thanks, Marius. I've just updated from M1 to the snapshot to get
>>> ajaxSubmit; however, it doesn't address my question as to why the
>>> function passed to AjaxSubmit doesn't return a JsCmd that can be used
>>> to refresh the page.
>>
>> The ajaxSubmit has the signature:
>>
>> def ajaxSubmit(value: String, func: () => Any, attrs: (String, String)
>> *)
>>
>> returns an Any because Lift looks for the following:
>>
>> JsCmd,
>> NodeSeq
>> JsCommands
>> LiftResponse
>
> I think I must be misunderstanding something - should I expect the
> following to work?
>
>        var text: Option[String] = None
>        ajaxForm(
>            bind("plan", xhtml,
>                 "dsl" -> textarea("", s => text = Some(s), "id" ->
> "dsl_text", "rows" -> "40", "cols" -> "120"),
>                 "submit" -> ajaxSubmit("Create Plan", () =>
> SetHtml("results", buildPlan(text.get)))
>            )
>        )
>
> where there is  in the rendered page? I don't seem
> to get the expected results back, though it's clear from logging that
> this is being processed correctly.
>
> Kris
>

A bit more, intriguing information: is SetHtml size-limited? It seems
to work fine if what I'm passing back is just a URL or something, but
if I pass back a 1.5k error message, the message never seems to
appear.

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



Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 4:04 PM, Kris Nuttycombe
wrote:

> On Thu, Jan 21, 2010 at 4:36 PM, Kris Nuttycombe
>  wrote:
> > On Thu, Jan 21, 2010 at 2:43 PM, Marius  wrote:
> >>
> >>
> >> On Jan 21, 11:15 pm, Kris Nuttycombe 
> >> wrote:
> >>> On Thu, Jan 21, 2010 at 12:23 PM, Marius 
> wrote:
> >>> > Instead of
> >>>
> >>> >  "submit" -> SHtml.submit("Parse", () => ())
> >>>
> >>> > use:
> >>>
> >>> >  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
> >>>
> >>> > you can also send normal forms via ajax like:
> >>>
> >>> > SHtml.submitAjaxForm("formId", () => {
> >>>
> >>> >  /// Do your stuff here. This function will be called after form
> >>> > field functions are executed.
> >>> >  Noop
> >>> > })
> >>>
> >>> > Br's,
> >>> > Marius
> >>>
> >>> Thanks, Marius. I've just updated from M1 to the snapshot to get
> >>> ajaxSubmit; however, it doesn't address my question as to why the
> >>> function passed to AjaxSubmit doesn't return a JsCmd that can be used
> >>> to refresh the page.
> >>
> >> The ajaxSubmit has the signature:
> >>
> >> def ajaxSubmit(value: String, func: () => Any, attrs: (String, String)
> >> *)
> >>
> >> returns an Any because Lift looks for the following:
> >>
> >> JsCmd,
> >> NodeSeq
> >> JsCommands
> >> LiftResponse
> >
> > I think I must be misunderstanding something - should I expect the
> > following to work?
> >
> >var text: Option[String] = None
> >ajaxForm(
> >bind("plan", xhtml,
> > "dsl" -> textarea("", s => text = Some(s), "id" ->
> > "dsl_text", "rows" -> "40", "cols" -> "120"),
> > "submit" -> ajaxSubmit("Create Plan", () =>
> > SetHtml("results", buildPlan(text.get)))
> >)
> >)
> >
> > where there is  in the rendered page? I don't seem
> > to get the expected results back, though it's clear from logging that
> > this is being processed correctly.
> >
> > Kris
> >
>
> A bit more, intriguing information: is SetHtml size-limited? It seems
> to work fine if what I'm passing back is just a URL or something, but
> if I pass back a 1.5k error message, the message never seems to
> appear.
>

It's not size limited AFAIK.  Some browsers may have a limit on String
length or the ability to parse super-long JavaScript, but you're probably
looking at 16M (24 bits).


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


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

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



[Lift] StatefulSnippet and -Xcheckinit

2010-01-21 Thread Naftoli Gugenheim
Strange. Using JRebel, I had a page open to a url which has a ? query parameter 
that trigger a call to registerThisSnippet on a StatefulSnippet (the url is 
from StatefulSnippet.link). Modifying the class and refreshing the page 
directly, resulted in an exception that registerThisSnippet was accessing 
_names which was not initialized. Then I navigated to the page by clicking a 
freshly generated link and it was fine. Seems as if reloading the same page 
reuses the same snippet instance whose class was updated via JRebel, and it now 
thinks it's not initialized.

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



Re: [Lift] Re: A better approach to ajax forms?

2010-01-21 Thread Kris Nuttycombe
Okay, I think I may have found a bug.

My returned content contains unescaped braces. In one failure case
(this is parsing a DSL) I was testing a parse of a missing end brace -
and part of the error message is the original text passed in (with
mismatched braces).

Figured it out by passing in content with a superfluous end brace -
that error returns fine. :)

Thought I was going nuts.

Kris

On Thu, Jan 21, 2010 at 5:08 PM, David Pollak
 wrote:
>
>
> On Thu, Jan 21, 2010 at 4:04 PM, Kris Nuttycombe 
> wrote:
>>
>> On Thu, Jan 21, 2010 at 4:36 PM, Kris Nuttycombe
>>  wrote:
>> > On Thu, Jan 21, 2010 at 2:43 PM, Marius  wrote:
>> >>
>> >>
>> >> On Jan 21, 11:15 pm, Kris Nuttycombe 
>> >> wrote:
>> >>> On Thu, Jan 21, 2010 at 12:23 PM, Marius 
>> >>> wrote:
>> >>> > Instead of
>> >>>
>> >>> >  "submit" -> SHtml.submit("Parse", () => ())
>> >>>
>> >>> > use:
>> >>>
>> >>> >  "submit" -> SHtml.ajaxSubmit("Parse", () => ())
>> >>>
>> >>> > you can also send normal forms via ajax like:
>> >>>
>> >>> > SHtml.submitAjaxForm("formId", () => {
>> >>>
>> >>> >  /// Do your stuff here. This function will be called after form
>> >>> > field functions are executed.
>> >>> >  Noop
>> >>> > })
>> >>>
>> >>> > Br's,
>> >>> > Marius
>> >>>
>> >>> Thanks, Marius. I've just updated from M1 to the snapshot to get
>> >>> ajaxSubmit; however, it doesn't address my question as to why the
>> >>> function passed to AjaxSubmit doesn't return a JsCmd that can be used
>> >>> to refresh the page.
>> >>
>> >> The ajaxSubmit has the signature:
>> >>
>> >> def ajaxSubmit(value: String, func: () => Any, attrs: (String, String)
>> >> *)
>> >>
>> >> returns an Any because Lift looks for the following:
>> >>
>> >> JsCmd,
>> >> NodeSeq
>> >> JsCommands
>> >> LiftResponse
>> >
>> > I think I must be misunderstanding something - should I expect the
>> > following to work?
>> >
>> >        var text: Option[String] = None
>> >        ajaxForm(
>> >            bind("plan", xhtml,
>> >                 "dsl" -> textarea("", s => text = Some(s), "id" ->
>> > "dsl_text", "rows" -> "40", "cols" -> "120"),
>> >                 "submit" -> ajaxSubmit("Create Plan", () =>
>> > SetHtml("results", buildPlan(text.get)))
>> >            )
>> >        )
>> >
>> > where there is  in the rendered page? I don't seem
>> > to get the expected results back, though it's clear from logging that
>> > this is being processed correctly.
>> >
>> > Kris
>> >
>>
>> A bit more, intriguing information: is SetHtml size-limited? It seems
>> to work fine if what I'm passing back is just a URL or something, but
>> if I pass back a 1.5k error message, the message never seems to
>> appear.
>
> It's not size limited AFAIK.  Some browsers may have a limit on String
> length or the ability to parse super-long JavaScript, but you're probably
> looking at 16M (24 bits).
>
>>
>> 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=en.
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>

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



[Lift] web site critique

2010-01-21 Thread Raoul Duke
http://liftweb.net/download.html

needs to tell me what (tf :-) to do next if i /do/ have mvn installed already.

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



[Lift] intro mvn critique

2010-01-21 Thread Raoul Duke
hi,

i think there should be a much shorter mvn command to get started. i
do not know maven, but would it not be possible to wrap up all of the
long-winded jiggery-pokery (below) into a shorter thing that expanded
/ downloaded something that ran that command? it is just not good user
experience for first time user who wants to dip their toe into see
this, imho.

mvn archetype:generate -U \
  -DarchetypeGroupId=net.liftweb \
  -DarchetypeArtifactId=lift-archetype-blank \
  -DarchetypeVersion=1.0 \
  -DremoteRepositories=http://scala-tools.org/repo-releases \
  -DgroupId=demo.helloworld \
  -DartifactId=helloworld \
  -Dversion=1.0-SNAPSHOT

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



Re: [Lift] web site critique

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 4:29 PM, Raoul Duke  wrote:

> http://liftweb.net/download.html
>
> needs to tell me what (tf :-) to do next if i /do/ have mvn installed
> already.
>

http://liftweb.net/docs/getting_started.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.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


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

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



Re: [Lift] intro mvn critique

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 4:31 PM, Raoul Duke  wrote:

> hi,
>
> i think there should be a much shorter mvn command to get started. i
> do not know maven, but would it not be possible to wrap up all of the
> long-winded jiggery-pokery (below) into a shorter thing that expanded
> / downloaded something that ran that command? it is just not good user
> experience for first time user who wants to dip their toe into see
> this, imho.
>

I wish, but no.  I've written my own shell script.


>
> mvn archetype:generate -U \
>  -DarchetypeGroupId=net.liftweb \
>  -DarchetypeArtifactId=lift-archetype-blank \
>  -DarchetypeVersion=1.0 \
>  -DremoteRepositories=http://scala-tools.org/repo-releases \
>  -DgroupId=demo.helloworld \
>  -DartifactId=helloworld \
>  -Dversion=1.0-SNAPSHOT
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


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

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



Re: [Lift] web site critique

2010-01-21 Thread Raoul Duke
hi,

On Thu, Jan 21, 2010 at 4:32 PM, David Pollak
 wrote:
> On Thu, Jan 21, 2010 at 4:29 PM, Raoul Duke  wrote:
>> http://liftweb.net/download.html
>> needs to tell me what (tf :-) to do next if i /do/ have mvn installed
>> already.
> http://liftweb.net/docs/getting_started.html

i sincerely believe this response hilights the problem: you see what
you know is already there, and fail to think like a total outsider
coming to use the site. the link should be in the 'if you already have
mvn installed' text in the body of the page as well as just at the top
in the 'menu'.

$0.02.

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



Re: [Lift] intro mvn critique

2010-01-21 Thread Raoul Duke
> I wish, but no.  I've written my own shell script.

ugh.

could the html verison perhaps be improved to not have extra blank
lines which prevent me from successfully copy and pasting it into my
shell? :-)

http://liftweb.net/docs/getting_started/mod_master.html#x1-40001.2

sincerely.

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



Re: [Lift] web site critique

2010-01-21 Thread Timothy Perrett
The site is not perfect, we know that... we are trying to work on it but 
progress is slow for a variety of reasons. 

On 22 Jan 2010, at 00:34, Raoul Duke wrote:

> hi,
> 
> On Thu, Jan 21, 2010 at 4:32 PM, David Pollak
>  wrote:
>> On Thu, Jan 21, 2010 at 4:29 PM, Raoul Duke  wrote:
>>> http://liftweb.net/download.html
>>> needs to tell me what (tf :-) to do next if i /do/ have mvn installed
>>> already.
>> http://liftweb.net/docs/getting_started.html
> 
> i sincerely believe this response hilights the problem: you see what
> you know is already there, and fail to think like a total outsider
> coming to use the site. the link should be in the 'if you already have
> mvn installed' text in the body of the page as well as just at the top
> in the 'menu'.
> 
> $0.02.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 
> 

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



[Lift] buildr?

2010-01-21 Thread Raoul Duke
whatever came of buildr for lift? i haven't stumbled across the answer
googling yet, but i'm still checking...

thanks.

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



Re: [Lift] buildr?

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 4:58 PM, Raoul Duke  wrote:

> whatever came of buildr for lift? i haven't stumbled across the answer
> googling yet, but i'm still checking...
>

We're not going to support Buildr for Lift.  Adding Ruby into the mix is a
non-starter from my perspective.  There is increasing sbt support for
Lift-based projects.


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


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

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



Re: [Lift] buildr?

2010-01-21 Thread Raoul Duke
hi,

>> whatever came of buildr for lift? i haven't stumbled across the answer
>> googling yet, but i'm still checking...
>
> We're not going to support Buildr for Lift.  Adding Ruby into the mix is a
> non-starter from my perspective.  There is increasing sbt support for
> Lift-based projects.

thanks for the info. i will go read up on sbt now!

[i saw your older response about disliking the ruby runtime -- i was
wondering if anybody else had done a buildr branch nevertheless :-)
e.g. http://github.com/aboisvert/liftweb# (and i wonder if jruby
mitigates your ruby runtime concerns at all).]

sincerely.

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



Re: [Lift] buildr?

2010-01-21 Thread David Pollak
On Thu, Jan 21, 2010 at 5:03 PM, Raoul Duke  wrote:

> hi,
>
> >> whatever came of buildr for lift? i haven't stumbled across the answer
> >> googling yet, but i'm still checking...
> >
> > We're not going to support Buildr for Lift.  Adding Ruby into the mix is
> a
> > non-starter from my perspective.  There is increasing sbt support for
> > Lift-based projects.
>
> thanks for the info. i will go read up on sbt now!
>
> [i saw your older response about disliking the ruby runtime -- i was
> wondering if anybody else had done a buildr branch nevertheless :-)
> e.g. http://github.com/aboisvert/liftweb# (and i wonder if jruby
> mitigates your ruby runtime concerns at all).]
>

Jruby is yet another download, install, configuration.  Making Lift as easy
as possible to get started with and keep going with is the priority.  Maven
gives us this.  Yes, the one line you have to copy/paste is a bear, but once
you've typed that, things work remarkably well with Maven.  Having to
install Jruby, is yet another barrier, yet another thing to support, etc.

At this point, we're official only supporting Lift with Maven.  We've got
limited resources and this is where we're putting them.  Maven is mature,
works well in most cases, and integrates with IDEs very effectively.  I
expect in 6-12 months, we'll deprecate Maven in favor of sbt, but not today.

There may be other folks on the list that have other build environments that
they use with Lift and I encourage them to share/help out.


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


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

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



Re: [Lift] buildr?

2010-01-21 Thread Raoul Duke
> At this point, we're official only supporting Lift with Maven.  We've got
> limited resources and this is where we're putting them.  Maven is mature,
> works well in most cases, and integrates with IDEs very effectively.  I
> expect in 6-12 months, we'll deprecate Maven in favor of sbt, but not today.
>
> There may be other folks on the list that have other build environments that
> they use with Lift and I encourage them to share/help out.

yeah, i think you are reading into what i was asking since i never
said / did not intend to imply that you ought to do anything about
supporting non-maven builds. i was asking the list in general to learn
about non-maven approaches. i am not trying to bonk the chip on your
shoulder about maven or not maven :-), apologies for not being more
clear about that to begin with.

sincerely.

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



Re: [Lift] Re: [lift] Version of maven for lift

2010-01-21 Thread James Matlik
Sbt is on the plan too, as well as svnkit which is a command line svn client
in Java.

On Jan 21, 2010 4:30 PM, "Channing Walton"  wrote:


I use maven 2.2.1 without any problem. i prefer to use sbt these days which
still makes use of mvn repositories.

James Matlik wrote: > > What is Lift's recommended version of Maven? I am
looking to create an >...
> --
>
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
>
> To post to this group, send email to lift...@googlegroups.com.
>
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
.
>
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>

--
View this message in context:
http://old.nabble.com/Version-of-maven-for-lift-tp27264662p27264918.html
Sent from the liftweb mailing list archive at Nabble.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=en.

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



Re: [Lift] Version of maven for lift

2010-01-21 Thread James Matlik
I will be creating a sbaz package containing a maven release. I realize that
lift generally doesn't use the scala distribution (which comes with sbaz ),
but it does seem a logical stepping stone for beginners and tinkerers. I
just want to make things readily accessible. Since 2.2.1 works, I'll run
with that.

On Jan 21, 2010 6:03 PM, "Naftoli Gugenheim"  wrote:

You want an sbaz package that will contain what exactly?

-

James Matlik wrote: What is Lift's recommended
version of Maven? I am look...

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



Re: [Lift] buildr?

2010-01-21 Thread Alex Boisvert
On Thu, Jan 21, 2010 at 5:17 PM, David Pollak  wrote:

>
>
> On Thu, Jan 21, 2010 at 5:03 PM, Raoul Duke  wrote:
>
>> hi,
>>
>> >> whatever came of buildr for lift? i haven't stumbled across the answer
>> >> googling yet, but i'm still checking...
>> >
>> > We're not going to support Buildr for Lift.  Adding Ruby into the mix is
>> a
>> > non-starter from my perspective.  There is increasing sbt support for
>> > Lift-based projects.
>>
>> thanks for the info. i will go read up on sbt now!
>>
>> [i saw your older response about disliking the ruby runtime -- i was
>> wondering if anybody else had done a buildr branch nevertheless :-)
>> e.g. http://github.com/aboisvert/liftweb# (and i wonder if jruby
>> mitigates your ruby runtime concerns at all).]
>>
>
> Jruby is yet another download, install, configuration.  Making Lift as easy
> as possible to get started with and keep going with is the priority.  Maven
> gives us this.  Yes, the one line you have to copy/paste is a bear, but once
> you've typed that, things work remarkably well with Maven.  Having to
> install Jruby, is yet another barrier, yet another thing to support, etc.
>

 i'm not arguing for use of buildr with lift, just providing
information 

buildr now has an all-in-one distribution (which uses jruby on the inside)
and requires no more install/configuration steps than maven.  granted, if
you already use maven, it's an extra step.

there's also an all-in-one-jar in the works which will make buildr even
easier to install and use.  this should be available soon after jruby 1.5.0
is out.

i use buildr + lift on a regular basis and find it a pleasant alternative to
maven.  if other people want to use buildr with lift, i'm happy to share and
help them out.

cheers,
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=en.



[Lift] Re: Memory behavior in Jetty with CometActor - 25MB of scala.xml.Text!

2010-01-21 Thread Java1Guy
David:
Thanks for having a look.  Curious about that missing dependency - i
guess it's in the pom.xml but not really used.

Anyway, I'll digest your recommendations and have a go at it.  The
scenario I have running right now is one page open (and therefore its
session) for a very long time.  While that's not a terribly realistic
scenario, it probably is an indicator of why it did run out of memory
and lock up in the real deployment.

Cheers, Mark

ps - did fix the project in drop.io.  I guess in reality the pom
should make sure to point to a repository where all the dependencies
exist, vs. just having installed locally.

On Jan 21, 10:38 am, David Pollak 
wrote:
> On Wed, Jan 20, 2010 at 9:28 PM, mark chance  wrote:
> > I did post the project to drop.io -http://drop.io/memtest.
>
> The project does not build:
>
>   Path to dependency:
>       1) com.peopledesigned:memtest:war:1.0-SNAPSHOT
>       2) org.jfree:jcommon:jar:1.0.16
>
> Looking at your code, each of the functions created/passed as part of the
> SHtml.ajaxCall(), etc. calls are retained for the duration of the session.
> Lift garbage collects these references if there's not seen on a page for 10
> minutes.  However, if the GUIDs are created within the scope of a
> CometActor, the function is retained until the CometActor is released (in
> your case, for the length of the session).
>
> There are a couple of ways to deal with this:
>
>    - Create a single SHtml.ajaxCall instance as part of the CometActor
>    (rather than on each partialUpdate).
>    - Use the CometActor's built-in JSON handler to send a message from the
>    browser to the server.  See CometActor.handleJson()
>
> The latter is the best bet for handling rich interactions with the
> CometActor from the client without creating lots and lots of functions.
>

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



[Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread Neil.Lv

  Thanks guys very very much!

  I'm using the Windows XP,  I  reset the height buffer for the CMD
now, and can see the full error message now.

  The code can work fine now ( it's so strange that I run this code on
the another computer , and it's all OK... )

  Maybe I need to delete all the target files.

  :)

Cheers,
  Neil

On Jan 22, 3:09 am, Naftoli Gugenheim  wrote:
> If you are using Windows and CMD.EXE does not hold enough lines to view the 
> error, click the control menu of the CMD window and click Properties, then on 
> the Layout tab you set the height of the screen buffer size.
>
> -
>
> Neil.Lv wrote:
>
> Here is the lastest code now, g...@github.com:anim510/two_db_demo.git
>
> start server and visit:http://localhost:8080/and get this error, In
> the cmd I can't see all the error message,
> here is the all the message on the cmd screen.
>
> 
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1$$an
> onfun$apply$72.apply(LiftSession.scala:1041)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1$$an
> onfun$apply$72.apply(LiftSession.scala:1041)
> at net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$
> $processOrD
> efer(LiftSession.scala:1026)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1040)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1034)
> at scala.Seq$class.flatMap(Seq.scala:294)
> at scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
> at net.liftweb.http.LiftSession.processSurroundAndInclude
> (LiftSession.sc
> ala:1033)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1054)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1034)
> at scala.Seq$class.flatMap(Seq.scala:294)
> at scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
> at net.liftweb.http.LiftSession.processSurroundAndInclude
> (LiftSession.sc
> ala:1033)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1$
> $anonfun$apply
> $2.apply(Surround.scala:37)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1$
> $anonfun$apply
> $2.apply(Surround.scala:34)
> at net.liftweb.common.Full.map(Box.scala:330)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply
> (Surround
> .scala:34)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply
> (Surround
> .scala:33)
> at net.liftweb.common.Full.flatMap(Box.scala:332)
> at net.liftweb.builtin.snippet.Surround$.render(Surround.scala:
> 33)
> at net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$
> $anonfun$app
> ly$1.apply(Surround.scala:29)
> at net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$
> $anonfun$app
> ly$1.apply(Surround.scala:29)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61$$anonfun$apply$63.apply(LiftSession.scala:846)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61$$anonfun$apply$63.apply(LiftSession.scala:830)
> at net.liftweb.common.EmptyBox.openOr(Box.scala:372)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61.apply(LiftSession.scala:830)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61.apply(LiftSession.scala:830)
> at net.liftweb.common.EmptyBox.openOr(Box.scala:372)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply
> $58.apply(Lift
> Session.scala:829)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply
> $58.apply(Lift
> Session.scala:829)
> at net.liftweb.http.S$.doSnippet(S.scala:1677)
> at net.liftweb.http.LiftSession$$anonfun$18.apply
> (LiftSession.scala:827)
>
> at net.liftweb.http.LiftSession$$anonfun$18.apply
> (LiftSession.scala:826)
>
> at net.liftweb.common.Full.map(Box.scala:330)
> at net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$
> $processSni
> ppet(LiftSession.scala:826)
> at net.liftweb.http.LiftSession$$anonfun
> $_defaultLiftTagProcessing$1.app
> ly(LiftSession.scala:942)
> at net.liftweb.http.LiftSession$$anonfun
> $_defaultLiftTagProcessing$1.app
> ly(LiftSession.scala:930)
> at net.liftweb.util.NamedPF.apply(NamedPartialFunction.scala:
> 33)
> at net.liftweb.util.NamedPF$.apply(NamedPartialFunction.scala:
> 79)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1$$an
> onfun$apply$72$$anonfun$apply$73$$anonfun$apply$74$$anonfun$apply
> $75.apply(LiftS
> ession.scala:1044)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundA

Re: [Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread Naftoli Gugenheim
'mvn clean' deletes them for you.

-
Neil.Lv wrote:


  Thanks guys very very much!

  I'm using the Windows XP,  I  reset the height buffer for the CMD
now, and can see the full error message now.

  The code can work fine now ( it's so strange that I run this code on
the another computer , and it's all OK... )

  Maybe I need to delete all the target files.

  :)

Cheers,
  Neil

On Jan 22, 3:09 am, Naftoli Gugenheim  wrote:
> If you are using Windows and CMD.EXE does not hold enough lines to view the 
> error, click the control menu of the CMD window and click Properties, then on 
> the Layout tab you set the height of the screen buffer size.
>
> -
>
> Neil.Lv wrote:
>
> Here is the lastest code now, g...@github.com:anim510/two_db_demo.git
>
> start server and visit:http://localhost:8080/and get this error, In
> the cmd I can't see all the error message,
> here is the all the message on the cmd screen.
>
> 
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1$$an
> onfun$apply$72.apply(LiftSession.scala:1041)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1$$an
> onfun$apply$72.apply(LiftSession.scala:1041)
> at net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$
> $processOrD
> efer(LiftSession.scala:1026)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1040)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1034)
> at scala.Seq$class.flatMap(Seq.scala:294)
> at scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
> at net.liftweb.http.LiftSession.processSurroundAndInclude
> (LiftSession.sc
> ala:1033)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1054)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1.app
> ly(LiftSession.scala:1034)
> at scala.Seq$class.flatMap(Seq.scala:294)
> at scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
> at net.liftweb.http.LiftSession.processSurroundAndInclude
> (LiftSession.sc
> ala:1033)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1$
> $anonfun$apply
> $2.apply(Surround.scala:37)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1$
> $anonfun$apply
> $2.apply(Surround.scala:34)
> at net.liftweb.common.Full.map(Box.scala:330)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply
> (Surround
> .scala:34)
> at net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply
> (Surround
> .scala:33)
> at net.liftweb.common.Full.flatMap(Box.scala:332)
> at net.liftweb.builtin.snippet.Surround$.render(Surround.scala:
> 33)
> at net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$
> $anonfun$app
> ly$1.apply(Surround.scala:29)
> at net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$
> $anonfun$app
> ly$1.apply(Surround.scala:29)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61$$anonfun$apply$63.apply(LiftSession.scala:846)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61$$anonfun$apply$63.apply(LiftSession.scala:830)
> at net.liftweb.common.EmptyBox.openOr(Box.scala:372)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61.apply(LiftSession.scala:830)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$58$
> $anonfun$a
> pply$61.apply(LiftSession.scala:830)
> at net.liftweb.common.EmptyBox.openOr(Box.scala:372)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply
> $58.apply(Lift
> Session.scala:829)
> at net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply
> $58.apply(Lift
> Session.scala:829)
> at net.liftweb.http.S$.doSnippet(S.scala:1677)
> at net.liftweb.http.LiftSession$$anonfun$18.apply
> (LiftSession.scala:827)
>
> at net.liftweb.http.LiftSession$$anonfun$18.apply
> (LiftSession.scala:826)
>
> at net.liftweb.common.Full.map(Box.scala:330)
> at net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$
> $processSni
> ppet(LiftSession.scala:826)
> at net.liftweb.http.LiftSession$$anonfun
> $_defaultLiftTagProcessing$1.app
> ly(LiftSession.scala:942)
> at net.liftweb.http.LiftSession$$anonfun
> $_defaultLiftTagProcessing$1.app
> ly(LiftSession.scala:930)
> at net.liftweb.util.NamedPF.apply(NamedPartialFunction.scala:
> 33)
> at net.liftweb.util.NamedPF$.apply(NamedPartialFunction.scala:
> 79)
> at net.liftweb.http.LiftSession$$anonfun
> $processSurroundAndInclude$1$$an
> onfun$apply$72$$anonfun$apply$73$$anonfun$apply$74$$anonfun$apply
> $75.apply(LiftS
> 

[Lift] Re: How to use prepareStatement to select *** from DB (two db vender)?

2010-01-21 Thread Neil.Lv


On Jan 22, 10:06 am, Naftoli Gugenheim  wrote:
> 'mvn clean' deletes them for you.
>
> -

 Got it, Thank you very much!

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



Re: [Lift] Re: Simple Ajax call to server side function

2010-01-21 Thread David Pollak
On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
felipero.maill...@gmail.com> wrote:

> That's a little better.. thanks
>
>
Originally, the function returned Any... and this led to problems (people
returning HTML, Strings, etc.)  It turns out that 95% of the time, you want
to do something to tell the user that the server did something (unless the
function sends a message to a CometActor), so using the type-system to make
sure Ajax functions returned JsCmds was the right answer.


>
> greekscala wrote:
>
>> Hello,
>>
>> know what you mean. You can use JsCmds._Noop to return "nohting" as
>> JsCmd.
>>
>> best regards
>>
>> On 18 Jan., 17:25, Felipe Rodrigues 
>> wrote:
>>
>>
>>> Here is how I made it, but seems ugly:
>>>
>>> SHtml.a(() => {serverSideFunction(t.text); Call("void", Num(0)).cmd}, t)
>>>
>>> It is awkward having to add a JsCmd even when I don't need it.
>>>
>>> Felipe
>>>
>>> Naftoli Gugenheim wrote:
>>>
>>>
 Never mind my question; I hadn't paid attention to the subject.
  -
 Felipe Rodrigues wrote:
  Hi all,
  I want to create a link which when clicked calls a server side
 function.
 No need for JavaScript callback.
 I tried with no success:
  SHtml.a(() => {serverSideFunction(t.text)}, t)
  Any idea how can I accomplish that will be appreciated.
  Thanks,
  Felipe


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


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

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



Re: [Lift] Mindless work...

2010-01-21 Thread Heiko Seeberger
>
> I have time to do the mindless work of doing the port tonight (my brain
> will explode if it has to think, but mindless is okay).
>

Sorry for the delay, but my night already started when you were having lunch
;-)

>
>- Heiko -- how far along is the stuff in issue 292?  Is this code on
>the irc_issue_292 branch? Can I work on this branch tonight?
>
> Good question: Indrajit told me to relax, because he was already working on
that. Let's ask him!

David (who is very serious about making Lift on Scala 2.8 very successful)
>

Very good!

Heiko

Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net

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