[Lift] Re: Object Relationships and the .obj method

2009-07-28 Thread Grant Wood

Derek,

Just want to thank you for your attention to this thread, and your
quick update of the master.pdf, I know this will clear things up for
others as well!  I will absolutely provide any other feedback I can.

Thank You for all your work on Exploring Lift!

- Grant Wood

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



[Lift] Re: Help on Build from source

2009-07-28 Thread nile black
why i cann't see my post at group?


On Tue, Jul 28, 2009 at 11:48 AM, Nile Black nile.bl...@gmail.com wrote:

 [INFO] Building Lift Utils
 [INFO]task-segment: [install]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [INFO] [yuicompressor:compress {execution: default}]
 [INFO] nb warnings: 0, nb errors: 0
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [scala:compile {execution: default}]
 [INFO] Checking for multiple versions of scala
 [INFO] Compiling 37 source files to D:\user\liftweb\lift-util\target
 \classes
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \ConcurrentLock.scala:16: error: value util is not a member of package
 net.java
 [WARNING] import java.util.concurrent.locks._
 [WARNING] ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \CurrencyZone.scala:69: error: value lang is not a member of package
 net.java
 [WARNING] } catch { case e: java.lang.NumberFormatException =
 {
 [WARNING]^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \CurrencyZone.scala:72: error: value text is not a member of package
 net.java
 [WARNING] } catch { case e:
 java.text.ParseException = {
 [WARNING]^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \CurrencyZone.scala:103: error: value math is not a member of package
 net.java
 [WARNING] make(new BigDecimal(this.amount.bigDecimal.divide
 (that.amount.bigDecimal, scale, java.math.BigDecimal.ROUND_HALF_UP)) )
 [WARNING]
 ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \IOHelpers.scala:104: error: value io is not a member of package
 net.java
 [WARNING]   def doClose[T](is: java.io.Closeable*)(f : = T): T = {
 [WARNING]   ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \Mailer.scala:84: error: value util is not a member of package
 net.java
 [WARNING]   import java.util.Properties
 [WARNING]   ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \PCDataMarkupParser.scala:187: error: value io is not a member of
 package net.java
 [WARNING] import java.io.ByteArrayInputStream
 [WARNING] ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \Props.scala:178: error: value io is not a member of package net.java
 [WARNING] import java.io.{ByteArrayInputStream}
 [WARNING] ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \Props.scala:179: error: value util is not a member of package
 net.java
 [WARNING] import java.util.InvalidPropertiesFormatException
 [WARNING] ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \SoftReferenceCache.scala:3: error: value lang is not a member of
 package net.java
 [WARNING] import java.lang.ref.{ReferenceQueue,SoftReference};
 [WARNING] ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \SoftReferenceCache.scala:4: error: value util is not a member of
 package net.java
 [WARNING] import java.util._
 [WARNING] ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \SoftReferenceCache.scala:147: error: wrong number of arguments for
 constructor Object: ()jav
 a.lang.Object
 [WARNING]   queue: ReferenceQueue[Any]) extends
 SoftReference[V](v, queue) {
 [WARNING]   ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \TemplateCache.scala:17: error: value util is not a member of package
 net.java
 [WARNING] import java.util.{Locale}
 [WARNING] ^
 [WARNING] 13 errors found
 [INFO]
 
 [ERROR] BUILD FAILURE
 [INFO]
 
 [INFO] command line returned non-zero value:1
 [INFO]
 
 [INFO] For more information, run Maven with the -e switch
 [INFO]
 
 [INFO] Total time: 1 minute 15 seconds
 [INFO] Finished at: Tue Jul 28 11:47:44 CST 2009
 [INFO] Final Memory: 22M/39M
 [INFO]
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 

[Lift] Re: Hear podcast interview with David Pollack about Lift

2009-07-28 Thread Terry J. Leach

As a newbie who is already onboard with Lift and Scala, this was a
very good podcast for me.

Thanks,
Terry

On Jul 27, 7:12 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Sweet link

 Cheers, Tim

 On Jul 27, 7:40 pm, Goldfish gregt...@mindspring.com wrote:



  Visithttp://pondjumpers.com/2009/07/27/episode-2-interview-about-lift/
  to hear a podcast interview with David Pollack about Lift.

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



[Lift] Re: the question abount HelloForm2 of example darwin

2009-07-28 Thread koji

Thank you Tim,
That helps me.

koji

On 7月28日, 上午6時40分, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey Koji,

 So I took  a look at your problem and made an example, please check
 the code here under basic-forms:

 http://github.com/timperrett/lift-examples/tree/master

 I have a feeling that S.param used to work differently... lift assigns
 random names to the inputs at runtime for security, so doing S.param
 (whoField) wont get you anywhere anyways; IMHO this is a bug in the
 example, not your code. You might want to check my examples anyway
 though as i've made some changes and added comments you might find
 helpful.

 Cheers, Tim


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



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread Timothy Perrett

What version of Lift are you using? Are you using scala.actors code
within your application at all?

Cheers, Tim

On Jul 28, 2:47 am, Peter Robinett pe...@bubblefoundry.com wrote:
 Hi all,

 I'm running Lift on the smallest Slicehost VPS available (256 mb RAM,
 plus 512 mb swap) and I've recently run into some memory issues. I'm
 also running Apache and MySQL on the machine, so Lift and its
 environment is by no means the only cause, but I'd like to ask you all
 about how Lift uses memory and whether I can make more efficient use
 of the little memory I currently have.

 I was just doing a quick-and-dirty test, so I ran Lift under jetty:
 nohup mvn jetty:run 

 Before I launched jetty and Lift I was using approximately 150 mb of
 RAM and little if any swap space. Twelve hours later all physical and
 swap memory was used up. During those twelve hours I was receiving a
 POSTed message approximately every second, creating a model and then
 in its createdRow method sending the new object to a singleton object
 which sent it on to the appropriate actor (there being around 20 and
 all of them being launched in Lift's boot method). Very rarely these
 actors would have a few Comet listeners.

 Looking at the nohup log I see that lots of sessions started expiring
 maybe 8 hours from launch and continued in waves until I killed the
 process. I also see some stack traces about Comet requests,
 doContinuation, and Bail.

 Does this suggest that I'm using Actors incorrectly? Do I have too
 long a session timeout? Or do I just need more memory? Assuming the
 latter, how would you suggest figuring out a reasonable amount?

 Thanks for your help,
 Peter Robinett

 PS Some additional system details:
 cat /proc/system
 Linux version 2.6.24-19-xen (bui...@king) (gcc version 4.2.3 (Ubuntu
 4.2.3-2ubuntu7)) #1 SMP Sat Jul 12 00:15:59 UTC 2008

 java -version
 java version 1.6.0_0
 IcedTea6 1.3.1 (6b12-0ubuntu6.4) Runtime Environment (build 1.6.0_0-
 b12)
 OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Help on Build from source

2009-07-28 Thread Timothy Perrett

Can you provide some enviroment details What version of maven are
you using? What JDK?

What maven command did you run?

Cheers, Tim

On Jul 28, 4:48 am, Nile Black nile.bl...@gmail.com wrote:
 [INFO] Building Lift Utils
 [INFO]    task-segment: [install]
 [INFO]
 
 [INFO] [resources:resources]
 [INFO] Using default encoding to copy filtered resources.
 [INFO] [yuicompressor:compress {execution: default}]
 [INFO] nb warnings: 0, nb errors: 0
 [INFO] [compiler:compile]
 [INFO] Nothing to compile - all classes are up to date
 [INFO] [scala:compile {execution: default}]
 [INFO] Checking for multiple versions of scala
 [INFO] Compiling 37 source files to D:\user\liftweb\lift-util\target
 \classes
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \ConcurrentLock.scala:16: error: value util is not a member of package
 net.java
 [WARNING] import java.util.concurrent.locks._
 [WARNING]             ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \CurrencyZone.scala:69: error: value lang is not a member of package
 net.java
 [WARNING]         } catch { case e: java.lang.NumberFormatException =
 {
 [WARNING]                                ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \CurrencyZone.scala:72: error: value text is not a member of package
 net.java
 [WARNING]                     } catch { case e:
 java.text.ParseException = {
 [WARNING]                                            ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \CurrencyZone.scala:103: error: value math is not a member of package
 net.java
 [WARNING]         make(new BigDecimal(this.amount.bigDecimal.divide
 (that.amount.bigDecimal, scale, java.math.BigDecimal.ROUND_HALF_UP)) )
 [WARNING]
 ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \IOHelpers.scala:104: error: value io is not a member of package
 net.java
 [WARNING]   def doClose[T](is: java.io.Closeable*)(f : = T): T = {
 [WARNING]                           ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \Mailer.scala:84: error: value util is not a member of package
 net.java
 [WARNING]   import java.util.Properties
 [WARNING]               ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \PCDataMarkupParser.scala:187: error: value io is not a member of
 package net.java
 [WARNING]     import java.io.ByteArrayInputStream
 [WARNING]                 ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \Props.scala:178: error: value io is not a member of package net.java
 [WARNING]     import java.io.{ByteArrayInputStream}
 [WARNING]                 ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \Props.scala:179: error: value util is not a member of package
 net.java
 [WARNING]     import java.util.InvalidPropertiesFormatException
 [WARNING]                 ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \SoftReferenceCache.scala:3: error: value lang is not a member of
 package net.java
 [WARNING] import java.lang.ref.{ReferenceQueue,SoftReference};
 [WARNING]             ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \SoftReferenceCache.scala:4: error: value util is not a member of
 package net.java
 [WARNING] import java.util._
 [WARNING]             ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \SoftReferenceCache.scala:147: error: wrong number of arguments for
 constructor Object: ()jav
 a.lang.Object
 [WARNING]                       queue: ReferenceQueue[Any]) extends
 SoftReference[V](v, queue) {
 [WARNING]                                                           ^
 [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
 \TemplateCache.scala:17: error: value util is not a member of package
 net.java
 [WARNING] import java.util.{Locale}
 [WARNING]             ^
 [WARNING] 13 errors found
 [INFO]
 
 [ERROR] BUILD FAILURE
 [INFO]
 
 [INFO] command line returned non-zero value:1
 [INFO]
 
 [INFO] For more information, run Maven with the -e switch
 [INFO]
 
 [INFO] Total time: 1 minute 15 seconds
 [INFO] Finished at: Tue Jul 28 11:47:44 CST 2009
 [INFO] Final Memory: 22M/39M
 [INFO]
 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 

[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread marius d.

So the machine has 256 mb of RAM but did you configure the JVM max
heap size? .. How much MySql eats up out of 256 mb ? (let's live the
swap out for a bit) Are you running the JVM with -server option?

BTW 256mb seems to me ridiculous small for a server side application.

Br's,
Marius

On Jul 28, 4:47 am, Peter Robinett pe...@bubblefoundry.com wrote:
 Hi all,

 I'm running Lift on the smallest Slicehost VPS available (256 mb RAM,
 plus 512 mb swap) and I've recently run into some memory issues. I'm
 also running Apache and MySQL on the machine, so Lift and its
 environment is by no means the only cause, but I'd like to ask you all
 about how Lift uses memory and whether I can make more efficient use
 of the little memory I currently have.

 I was just doing a quick-and-dirty test, so I ran Lift under jetty:
 nohup mvn jetty:run 

 Before I launched jetty and Lift I was using approximately 150 mb of
 RAM and little if any swap space. Twelve hours later all physical and
 swap memory was used up. During those twelve hours I was receiving a
 POSTed message approximately every second, creating a model and then
 in its createdRow method sending the new object to a singleton object
 which sent it on to the appropriate actor (there being around 20 and
 all of them being launched in Lift's boot method). Very rarely these
 actors would have a few Comet listeners.

 Looking at the nohup log I see that lots of sessions started expiring
 maybe 8 hours from launch and continued in waves until I killed the
 process. I also see some stack traces about Comet requests,
 doContinuation, and Bail.

 Does this suggest that I'm using Actors incorrectly? Do I have too
 long a session timeout? Or do I just need more memory? Assuming the
 latter, how would you suggest figuring out a reasonable amount?

 Thanks for your help,
 Peter Robinett

 PS Some additional system details:
 cat /proc/system
 Linux version 2.6.24-19-xen (bui...@king) (gcc version 4.2.3 (Ubuntu
 4.2.3-2ubuntu7)) #1 SMP Sat Jul 12 00:15:59 UTC 2008

 java -version
 java version 1.6.0_0
 IcedTea6 1.3.1 (6b12-0ubuntu6.4) Runtime Environment (build 1.6.0_0-
 b12)
 OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread Timothy Perrett

Agreed; its pretty light to run all those services. I have a lift based app
that's been running for quite some time and its using around 250mb of RAM on
average. A raw lift app will probably use 128mb RAM as minimum.

Cheers, Tim

On 28/07/2009 10:08, marius d. marius.dan...@gmail.com wrote:
 BTW 256mb seems to me ridiculous small for a server side application.



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



[Lift] Re: Help on Build from source

2009-07-28 Thread TylerWeir

why i cann't see my post at group?

All new members are moderated to start with.


On Jul 27, 11:56 pm, nile black nile.bl...@gmail.com wrote:
 why i cann't see my post at group?



 On Tue, Jul 28, 2009 at 11:48 AM, Nile Black nile.bl...@gmail.com wrote:
  [INFO] Building Lift Utils
  [INFO]    task-segment: [install]
  [INFO]
  
  [INFO] [resources:resources]
  [INFO] Using default encoding to copy filtered resources.
  [INFO] [yuicompressor:compress {execution: default}]
  [INFO] nb warnings: 0, nb errors: 0
  [INFO] [compiler:compile]
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [scala:compile {execution: default}]
  [INFO] Checking for multiple versions of scala
  [INFO] Compiling 37 source files to D:\user\liftweb\lift-util\target
  \classes
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \ConcurrentLock.scala:16: error: value util is not a member of package
  net.java
  [WARNING] import java.util.concurrent.locks._
  [WARNING]             ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \CurrencyZone.scala:69: error: value lang is not a member of package
  net.java
  [WARNING]         } catch { case e: java.lang.NumberFormatException =
  {
  [WARNING]                                ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \CurrencyZone.scala:72: error: value text is not a member of package
  net.java
  [WARNING]                     } catch { case e:
  java.text.ParseException = {
  [WARNING]                                            ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \CurrencyZone.scala:103: error: value math is not a member of package
  net.java
  [WARNING]         make(new BigDecimal(this.amount.bigDecimal.divide
  (that.amount.bigDecimal, scale, java.math.BigDecimal.ROUND_HALF_UP)) )
  [WARNING]
  ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \IOHelpers.scala:104: error: value io is not a member of package
  net.java
  [WARNING]   def doClose[T](is: java.io.Closeable*)(f : = T): T = {
  [WARNING]                           ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \Mailer.scala:84: error: value util is not a member of package
  net.java
  [WARNING]   import java.util.Properties
  [WARNING]               ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \PCDataMarkupParser.scala:187: error: value io is not a member of
  package net.java
  [WARNING]     import java.io.ByteArrayInputStream
  [WARNING]                 ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \Props.scala:178: error: value io is not a member of package net.java
  [WARNING]     import java.io.{ByteArrayInputStream}
  [WARNING]                 ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \Props.scala:179: error: value util is not a member of package
  net.java
  [WARNING]     import java.util.InvalidPropertiesFormatException
  [WARNING]                 ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \SoftReferenceCache.scala:3: error: value lang is not a member of
  package net.java
  [WARNING] import java.lang.ref.{ReferenceQueue,SoftReference};
  [WARNING]             ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \SoftReferenceCache.scala:4: error: value util is not a member of
  package net.java
  [WARNING] import java.util._
  [WARNING]             ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \SoftReferenceCache.scala:147: error: wrong number of arguments for
  constructor Object: ()jav
  a.lang.Object
  [WARNING]                       queue: ReferenceQueue[Any]) extends
  SoftReference[V](v, queue) {
  [WARNING]                                                           ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \TemplateCache.scala:17: error: value util is not a member of package
  net.java
  [WARNING] import java.util.{Locale}
  [WARNING]             ^
  [WARNING] 13 errors found
  [INFO]
  
  [ERROR] BUILD FAILURE
  [INFO]
  
  [INFO] command line returned non-zero value:1
  [INFO]
  
  [INFO] For more information, run Maven with the -e switch
  [INFO]
  
  [INFO] Total time: 1 minute 15 seconds
  [INFO] Finished at: Tue Jul 28 11:47:44 CST 2009
  [INFO] Final Memory: 22M/39M
  [INFO]
  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google 

[Lift] Re: Object Relationships and the .obj method

2009-07-28 Thread Derek Chen-Becker
My pleasure. I'll be the first to admit that the book still needs a lot of
work, so anyone with feedback is more than welcome to submit it. I've slowly
been working through the backlog of feedback that we've already received, so
the quality, breadth and depth of the book should continue to improve. My
goal is to have it age like wine and not like milk ;)

Derek

On Tue, Jul 28, 2009 at 12:14 AM, Grant Wood smackt...@gmail.com wrote:


 Derek,

 Just want to thank you for your attention to this thread, and your
 quick update of the master.pdf, I know this will clear things up for
 others as well!  I will absolutely provide any other feedback I can.

 Thank You for all your work on Exploring Lift!

 - Grant Wood

 


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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread Timothy Perrett


Glenn, 

You have my full attention - this is something I've been sitting on for
quite some time but just not quite sure what the best route forward is.

When im creating these modules, I essentially just build a normal jar
project with maven, and as you say, if I have JS or whatever that I need to
use I just specify that with ResourceServer (in the module JAR init).

To date I've not actually needed to pull a template from another JAR, but
looking at ResourceServer.findResourceInClasspath I think it could do it...
If memory serves DPP checked in a change to make this work about 2 weeks
ago...

In terms of having a defined loading pattern, its possible, but would need
outlining with some very specific details... IMO, adding one line of code to
Boot.scala is not a big deal so we would really need a good reason to add a
bunch of reflection which can sometime feel like voodoo because its not
clear what its loading and why (one of the reasons I went off ruby).

Cheers, tim
 

On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:

 
 Hi, Tim,
 
 So, what you do is put all new LiftRules, Schemifier and
 ResourceServer stuff
 in an init function and run it after the Boot.scala defaults. Sounds
 simple enough.
 
 When creating your modules, do you just strip out all the stock webapp
 files (those
 that come with the maven lift archetypes), and put all your new
 resources in a
 toserve directory, then just jar it up?
 
 And what about any new template files? Where do those go in you module
 jars?
 You can't put them in the toserver directory. My understanding is
 that that would
 install them in the WEB-INF/classes directory of your final war file,
 when they
 need to go into the root webapp.
 
 I still see loose ends here.
 
 Also, what if you didn't have to modify Bool.scala for every
 module you add. Some hook function in an object that Boot.scala runs
 each time that
 would iterate through all your init functions that followed a pre-
 defined
 signature, would be a nice feature to add to Lift.
 
 
 Glenn...
 
 
 On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hi Glen...
 
 I actually do a lot of this - we have a product at work and i've just
 written a bunch of abstractions for work which just require me to do:
 
 MyLib.init
 
 In the boot file of a new application and then everything wires up - I
 couldn't think of anything more straightforward?
 
 The vast majority of stuff in lift is done with PF's, so you can
 pretty much just write them in external jars, and import them - my 3rd
 part stuff usually has a lift-webkit dependency so that I can just do
 the LiftRules.disptach.append stuff directly in the init method, but
 its really no biggy and saves boilerplate.
 
 So given your example, this scheme should work right?
 
 Cheers, Tim
 
 On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:
 
 I'm interested in abstracting out useful features from my Lift
 applications for ease of reuse, but I haven't found an easy way to do
 it. I find myself creating a new Lift aplication for each feature,
 with all the baggage (bootstrapping, etc.), and I then have to do a
 lot of code modification to the application I'm adding the feature to
 in order to get it to work.
 
 For example, suppose I want to add role-based user login to an
 application that already has a User model just by dropping in a jar
 file with the new feature. I don't see how to do it without some
 boostrapping modifications.
 
 Has anyone really tried to modularize their Lift development. I'd be
 very interested in some suggestions.
  
 



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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread Ross Mellgren


http://github.com/dpp/liftweb/commit/0f60807dd64b7fe1430919738b46f2ebe1758f22 
  ...

From:   feeder.of.the.be...@gmail.com
Subject:[Lift] Re: ResourceServer problem
Date:   July 22, 2009 12:07:14 PM EDT
To: liftweb@googlegroups.com
Reply-To:   liftweb@googlegroups.com

On Tue, Jul 21, 2009 at 9:55 PM, Naftoli Gugenheim  
naftoli...@gmail.com wrote:
  Now a direct call to ResourceServer does work, but the template is  
still not being found. Any ideas?

Templates are looked up simply by using the ServletContainer Context's  
resource locator.  I've expanded the lookup process so that stuff in  
JAR files will be found.  I'll commit the changes up in 10 minutes or  
so.



-Ross

On Jul 28, 2009, at 12:36 PM, Timothy Perrett wrote:



 Glenn,

 You have my full attention - this is something I've been sitting on  
 for
 quite some time but just not quite sure what the best route forward  
 is.

 When im creating these modules, I essentially just build a normal jar
 project with maven, and as you say, if I have JS or whatever that I  
 need to
 use I just specify that with ResourceServer (in the module JAR init).

 To date I've not actually needed to pull a template from another  
 JAR, but
 looking at ResourceServer.findResourceInClasspath I think it could  
 do it...
 If memory serves DPP checked in a change to make this work about 2  
 weeks
 ago...

 In terms of having a defined loading pattern, its possible, but  
 would need
 outlining with some very specific details... IMO, adding one line of  
 code to
 Boot.scala is not a big deal so we would really need a good reason  
 to add a
 bunch of reflection which can sometime feel like voodoo because its  
 not
 clear what its loading and why (one of the reasons I went off ruby).

 Cheers, tim


 On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:


 Hi, Tim,

 So, what you do is put all new LiftRules, Schemifier and
 ResourceServer stuff
 in an init function and run it after the Boot.scala defaults. Sounds
 simple enough.

 When creating your modules, do you just strip out all the stock  
 webapp
 files (those
 that come with the maven lift archetypes), and put all your new
 resources in a
 toserve directory, then just jar it up?

 And what about any new template files? Where do those go in you  
 module
 jars?
 You can't put them in the toserver directory. My understanding is
 that that would
 install them in the WEB-INF/classes directory of your final war file,
 when they
 need to go into the root webapp.

 I still see loose ends here.

 Also, what if you didn't have to modify Bool.scala for every
 module you add. Some hook function in an object that Boot.scala runs
 each time that
 would iterate through all your init functions that followed a pre-
 defined
 signature, would be a nice feature to add to Lift.


 Glenn...


 On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hi Glen...

 I actually do a lot of this - we have a product at work and i've  
 just
 written a bunch of abstractions for work which just require me to  
 do:

 MyLib.init

 In the boot file of a new application and then everything wires up  
 - I
 couldn't think of anything more straightforward?

 The vast majority of stuff in lift is done with PF's, so you can
 pretty much just write them in external jars, and import them - my  
 3rd
 part stuff usually has a lift-webkit dependency so that I can just  
 do
 the LiftRules.disptach.append stuff directly in the init method, but
 its really no biggy and saves boilerplate.

 So given your example, this scheme should work right?

 Cheers, Tim

 On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

 I'm interested in abstracting out useful features from my Lift
 applications for ease of reuse, but I haven't found an easy way  
 to do
 it. I find myself creating a new Lift aplication for each feature,
 with all the baggage (bootstrapping, etc.), and I then have to do a
 lot of code modification to the application I'm adding the  
 feature to
 in order to get it to work.

 For example, suppose I want to add role-based user login to an
 application that already has a User model just by dropping in a jar
 file with the new feature. I don't see how to do it without some
 boostrapping modifications.

 Has anyone really tried to modularize their Lift development. I'd  
 be
 very interested in some suggestions.





 


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



[Lift] Re: Custom login

2009-07-28 Thread David Pollak
On Mon, Jul 27, 2009 at 3:12 AM, MrWHO fabb...@gmail.com wrote:



  Hi all!

  Again a probably silly question, but I haven't been able to find a
 clue anywhere.

  I'd like to use my own login page for an application. I can get as
 far as creating my own form - and posting to /user_mgt/login and if
 the login goes right there is no problem. But if the login fails I'm
 sent back to /user_mgt/login - the default page of Lift.

  I tried overriding the value of login page in the User class, but
 with no luck.


Can you post the code you used to override the MegaProtoUser login page?




  What's the proper way of defining my own login page?

  Cheers,

  Fabio

 



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

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



[Lift] Re: erro: MappedDouble is not mapped to 'double precision' datatype in PostgreSQL?

2009-07-28 Thread JanWillem Tulp

Hi Derek,

I am using liftweb version 1.0

Thanks!



On Jul 27, 10:27 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 This looks like an issue with PostgreSQLDriver. The type should be DOUBLE
 PRECISION. What version of Lift are you using? Let me know and I'll put a
 fix in the proper place.

 Derek

 On Sun, Jul 26, 2009 at 5:59 AM, JanWillem Tulp 
 janwillem.t...@gmail.comwrote:





  Still looking to find a solution for this, or at least what causes
  this behavior. I am looking at the Liftweb source code, and see in the
  BaseMetaMapper trait a function called buildMapper that does some
  pattern matching on SQL column types (colType). Just for my
  understanding, why is there a match for almost any of the basic SQL
  types, but not for Types.DOUBLE?

  Has anyone else run into this problem?

  On Jul 26, 1:34 am, JanWillem Tulp janwillem.t...@gmail.com wrote:
   Hi all,

   I'm not sure that I am missing something here, but the Schemifier
   cannot create a table for a model class that contains an object that
   extends from MappedDouble.

   This is the Lift code:

   class MeasureValue extends LongKeyedMapper[MeasureValue] with IdPK {
     def getSingleton = MeasureValue

     object value extends MappedDouble(this)
     object measure extends MappedLongForeignKey(this, Measure)

   }

   object MeasureValue extends MeasureValue with LongKeyedMetaMapper
   [MeasureValue]

   I added MeasureValue to the Schemifier so that it will create a table
   when boot is executed. However, this is the stacktrace I get when I
   start the application:

   main INFO  lift - CREATE TABLE measurevalue (measure BIGINT , value
   DOUBLE , id BIGSERIAL)
   main ERROR lift - Failed to Boot
   org.postgresql.util.PSQLException: ERROR: type double does not exist
           at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse
   (QueryExecutorImpl.java:1592)
           at org.postgresql.core.v3.QueryExecutorImpl.processResults
   (QueryExecutorImpl.java:1327)
           at org.postgresql.core.v3.QueryExecutorImpl.execute
   (QueryExecutorImpl.java:192)
           at org.postgresql.jdbc2.AbstractJdbc2Statement.execute
   (AbstractJdbc2Statement.java:451)
           at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags
   (AbstractJdbc2Statement.java:336)
           at org.postgresql.jdbc2.AbstractJdbc2Statement.execute
   (AbstractJdbc2Statement.java:328)
           at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$
   $maybeWrite(Schemifier.scala:150)
           at net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$
   $ensureTable(Schemifier.scala:160)
           at
  net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$1.apply
   (Schemifier.scala:60)
           at
  net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$1.apply
   (Schemifier.scala:60)
           at scala.List.foldLeft(List.scala:1066)
           at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply
   (Schemifier.scala:60)
           at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply
   (Schemifier.scala:54)
           at net.liftweb.mapper.DB$.use(DB.scala:305)
           at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:53)
           at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:36)
           at bootstrap.liftweb.Boot.boot(Boot.scala:26)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke
   (NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke
   (DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply
   (ClassHelpers.scala:392)
           at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply
   (ClassHelpers.scala:390)
           at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply
   (LiftRules.scala:909)
           at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply
   (LiftRules.scala:909)
           at net.liftweb.util.Full.map(Box.scala:330)
           at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:909)
           at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:573)
           at net.liftweb.http.LiftFilter.init(LiftServlet.scala:548)
           at org.apache.catalina.core.ApplicationFilterConfig.getFilter
   (ApplicationFilterConfig.java:275)
           at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef
   (ApplicationFilterConfig.java:397)
           at org.apache.catalina.core.ApplicationFilterConfig.init
   (ApplicationFilterConfig.java:108)
           at org.apache.catalina.core.StandardContext.filterStart
   (StandardContext.java:3800)
           at org.apache.catalina.core.StandardContext.start
   (StandardContext.java:4450)
           at org.apache.catalina.core.ContainerBase.addChildInternal
   (ContainerBase.java:791)
           at
  

[Lift] Automatic background AJAX: best way to do it?

2009-07-28 Thread Nolan Darilek

I have a project that will use the geolocation API in Firefox 3.5, 
Google Gears and other JS frameworks. It will need to keep the user's 
position updated using the watchPosition API, fetching nearby POIs and 
such whenever the position changes.

I'm actually fairly new to AJAX, and am trying to figure out the best 
way to do this. Most of the AJAX examples I've seen involve user 
interaction, such as entering into a text field than removing focus, or 
waiting on state updates, as with comet. In this case, there's state 
that may update often or never, and those updates will be triggered by a 
callback function in the background, with no user interaction into which 
I can hook. I also don't want to leave a Comet connection open to the 
app waiting on updates, since the app may see mobile use, and I can't 
imagine holding open a connection being great for battery life.

I'm wondering what the best way to do this would be, while staying 
fairly close to what Lift offers? Thus far I have two options.

1. Create a REST API and have the Javascript call a specified URL 
whenever the position changes, inserting the resulting JSON into the 
page at appropriate places. This works, but seems like it'd involve lots 
of extra effort, as well as straying away from Lift/Scala's added 
benefits into the dynamicity of JS, which I'm not entirely comfortable with.

2. Create a hidden JSON form on the page. When the position changes, the 
JS callback function fills out and submits the form in the background. 
This seems a bit hackish, with the hidden form and all, but this makes 
the problem one that is on a bit less shaky Lift ground. I can then use 
Lift's provided functionality to generate JS for replacing page contents 
with the results of evaluating the form submission.

I'm basically going from the Lift book here. Most ideal, I'd think, 
would be if there was some way to have my callback function call a 
snippet directly and be handed back the JS needed, without having to 
create a separate web service API for this one call. Is the JSON form 
method the best option here? Or is there some new shiny in 1.1 that 
isn't documented in the Lift book yet? (or perhaps it *is* documented 
and I'm just missing it. :)

Thanks.



-- 
Nolan Darilek
http://thewordnerd.info


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



[Lift] Re: Custom login

2009-07-28 Thread Naftoli Gugenheim

I think you have to override loginXhtml and/or screenWrap.

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

On Mon, Jul 27, 2009 at 3:12 AM, MrWHO fabb...@gmail.com wrote:



  Hi all!

  Again a probably silly question, but I haven't been able to find a
 clue anywhere.

  I'd like to use my own login page for an application. I can get as
 far as creating my own form - and posting to /user_mgt/login and if
 the login goes right there is no problem. But if the login fails I'm
 sent back to /user_mgt/login - the default page of Lift.

  I tried overriding the value of login page in the User class, but
 with no luck.


Can you post the code you used to override the MegaProtoUser login page?




  What's the proper way of defining my own login page?

  Cheers,

  Fabio

 



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



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



[Lift] Re: Help on Build from source

2009-07-28 Thread Naftoli Gugenheim

If it thinks import java.xxx is a relative import of net.java.xxx, then it must 
be you're somehow building it with a net.java package in the classpath.
The question is why maven is building it with a different classpath than it 
uses for everyone else, and why those imports don't start with _root_.

-
TylerWeirtyler.w...@gmail.com wrote:


why i cann't see my post at group?

All new members are moderated to start with.


On Jul 27, 11:56 pm, nile black nile.bl...@gmail.com wrote:
 why i cann't see my post at group?



 On Tue, Jul 28, 2009 at 11:48 AM, Nile Black nile.bl...@gmail.com wrote:
  [INFO] Building Lift Utils
  [INFO]    task-segment: [install]
  [INFO]
  
  [INFO] [resources:resources]
  [INFO] Using default encoding to copy filtered resources.
  [INFO] [yuicompressor:compress {execution: default}]
  [INFO] nb warnings: 0, nb errors: 0
  [INFO] [compiler:compile]
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [scala:compile {execution: default}]
  [INFO] Checking for multiple versions of scala
  [INFO] Compiling 37 source files to D:\user\liftweb\lift-util\target
  \classes
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \ConcurrentLock.scala:16: error: value util is not a member of package
  net.java
  [WARNING] import java.util.concurrent.locks._
  [WARNING]             ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \CurrencyZone.scala:69: error: value lang is not a member of package
  net.java
  [WARNING]         } catch { case e: java.lang.NumberFormatException =
  {
  [WARNING]                                ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \CurrencyZone.scala:72: error: value text is not a member of package
  net.java
  [WARNING]                     } catch { case e:
  java.text.ParseException = {
  [WARNING]                                            ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \CurrencyZone.scala:103: error: value math is not a member of package
  net.java
  [WARNING]         make(new BigDecimal(this.amount.bigDecimal.divide
  (that.amount.bigDecimal, scale, java.math.BigDecimal.ROUND_HALF_UP)) )
  [WARNING]
  ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \IOHelpers.scala:104: error: value io is not a member of package
  net.java
  [WARNING]   def doClose[T](is: java.io.Closeable*)(f : = T): T = {
  [WARNING]                           ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \Mailer.scala:84: error: value util is not a member of package
  net.java
  [WARNING]   import java.util.Properties
  [WARNING]               ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \PCDataMarkupParser.scala:187: error: value io is not a member of
  package net.java
  [WARNING]     import java.io.ByteArrayInputStream
  [WARNING]                 ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \Props.scala:178: error: value io is not a member of package net.java
  [WARNING]     import java.io.{ByteArrayInputStream}
  [WARNING]                 ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \Props.scala:179: error: value util is not a member of package
  net.java
  [WARNING]     import java.util.InvalidPropertiesFormatException
  [WARNING]                 ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \SoftReferenceCache.scala:3: error: value lang is not a member of
  package net.java
  [WARNING] import java.lang.ref.{ReferenceQueue,SoftReference};
  [WARNING]             ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \SoftReferenceCache.scala:4: error: value util is not a member of
  package net.java
  [WARNING] import java.util._
  [WARNING]             ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \SoftReferenceCache.scala:147: error: wrong number of arguments for
  constructor Object: ()jav
  a.lang.Object
  [WARNING]                       queue: ReferenceQueue[Any]) extends
  SoftReference[V](v, queue) {
  [WARNING]                                                           ^
  [WARNING] D:\user\liftweb\lift-util\src\main\scala\net\liftweb\util
  \TemplateCache.scala:17: error: value util is not a member of package
  net.java
  [WARNING] import java.util.{Locale}
  [WARNING]             ^
  [WARNING] 13 errors found
  [INFO]
  
  [ERROR] BUILD FAILURE
  [INFO]
  
  [INFO] command line returned non-zero value:1
  [INFO]
  
  [INFO] For more information, run Maven with the -e switch
  [INFO]
  

[Lift] scala+maven

2009-07-28 Thread ph

Is there a good recourse on how to setup/use scala project with maven?

I've installed maven that comes with lift. Project is created with
Eclipse maven plugin (q4e http://code.google.com/p/q4e/). I build and
install scala project to local repository fine.
I can also run project using mvn scala:run command from project
folder.
Now I need to run project from repository and I cannot figure out how
to do so. Would I need to use mvn scala:run? This will resolve
dependencies and install all required libraries...
Scala plugin is not recognized as it declared only in pom. I'm
trying to update maven's settings.xml, adding this:

profile
idenv-dev/id
repositories
repository
idscala-tools.org/id
nameScala-tools Maven2 Repository/name
urlhttp://scala-tools.org/repo-releases/url
/repository
/repositories
pluginRepositories
pluginRepository
idorg.scala-tools/id
nameScala-tools Maven2 Repository/name
urlhttp://scala-tools.org/repo-releases/url
/pluginRepository
/pluginRepositories
/profile

  /profiles

  activeProfiles
activeProfileenv-dev/activeProfile
  /activeProfiles


now if I run mvn scala:run -DmainClass=... it gives me error:
[ERROR] BUILD ERROR
[INFO]

[INFO] The plugin 'org.apache.maven.plugins:maven-scala-plugin' does
not exist or no valid version could be found

Maybe there is another way to run project from maven repository?

Next step for me will be installing artifact into private remote
repository (Artifactory) and run project from that remote
repository... Any suggestions?

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



[Lift] Re: Hear podcast interview with David Pollack about Lift

2009-07-28 Thread David Pollak
I had a great time on the podcast... the pondjumpers are a cool pair of
dudes.

On Mon, Jul 27, 2009 at 11:40 AM, Goldfish gregt...@mindspring.com wrote:


 Visit http://pondjumpers.com/2009/07/27/episode-2-interview-about-lift/
 to hear a podcast interview with David Pollack about Lift.

 



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

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



Re: Lift + Scala 2.8 (Was: Re: [Lift] Re: Is there any eclipse setup that actually works for lift?)

2009-07-28 Thread David Pollak
After we get the next milestone out the door, we'll focus more on the 2.8
parallel branch.  I had a chat with Martin and it doesn't look like 2.8 is
going to be out in September, so we've got time.

On Fri, Jul 24, 2009 at 12:40 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:


 The reason I asked is that paulp recently said he was going to try again to
 get scalacheck to work.

 -
 Jorge Ortizjorge.or...@gmail.com wrote:

 No, sorry. I haven't spent any more time on this.

 --j

 On Thu, Jul 23, 2009 at 10:13 PM, Naftoli Gugenheim naftoli...@gmail.com
 wrote:

  Any update on this?
 
 
  On Mon, Jun 22, 2009 at 10:55 PM, David Pollak 
  feeder.of.the.be...@gmail.com wrote:
 
 
 
  On Mon, Jun 22, 2009 at 7:51 PM, Jorge Ortiz jorge.or...@gmail.com
 wrote:
 
  I just spent all afternoon trying to get stuff to compile with Scala
 2.8.
 
  Since Lift depends on Specs, and Specs depends on Scalacheck, I started
  trying to port Scalacheck to 2.8 so I could port Specs to 2.8 so I
 could
  port Lift. It was unable to get Scalacheck to compile due to bugs which
  cause the compiler to choke and throw an exception. Apparently both
 paulp
  and Iulian have tried to compile Scalacheck with 2.8 before and failed.
 
  Giving up on Specs and Scalacheck, I decided to try to compile Lift
 (sans
  tests) with 2.8. After fixing some of the breaking changes that 2.8
  introduces, I again ran into compiler troubles. In principle, with a
 lot of
  sleuthing I could figure out what code is causing the compiler to choke
 and
  give the compiler more type hints or whatever. Unfortunately this
 requires
  more work than I can put in today.
 
  Conclusion: 2.8 is basically unusable right now.
 
  (I'll check in my progress to GitHub later tonight or tomorrow.)
 
 
  Thanks for your hard work!
 
 
 
 
  --j
 
  On Mon, Jun 22, 2009 at 11:35 AM, David Pollak 
  feeder.of.the.be...@gmail.com wrote:
 
 
 
  On Mon, Jun 22, 2009 at 11:25 AM, Ellis ellis.whiteh...@gmail.com
 wrote:
 
 
  Hello David,
 
  Thanks for your reply.  Do you know whether lift *should* work with
  scala 2.8 when we pull it from the maven repositories?
 
 
  Lift currently only works with Scala 2.7.4.  You can use Eclipse and
  2.7.5 to edit Lift files, but Lift must be deployed against 2.7.4.
 
  We will have a branch of Lift (Jorge... you got this running yet)
  building against 2.8, but it will be experimental.
 
  I have experienced a fair number of suboptimalities with Lift and
  Eclipse in the last 3 weeks with the 2.7.5 stable plugin.  I have had
  success recently with NetBeans, IntelliJ, and emacs.
 
 
   If so, then
  I'll try deleting my ~/.m2 as Tim suggested.
 
  Thanks,
  Ellis
 
 
  On Jun 22, 8:14 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   Ellis,
   Miles will be back online in a few days, but I suspect that the
  answer is
   that the 2.8 plugin is the new generation and the 2.7.5 stuff is
  going to
   have bugs. :-(
  
   Sorry.
  
   David
  
  
  
   On Mon, Jun 22, 2009 at 11:08 AM, Ellis ellis.whiteh...@gmail.com
 
  wrote:
  
Hello everyone,
  
Does anyone have a setup for eclipse that works like it should?
  By
like it should, I mostly mean that the scala plugin doesn't
 crash
regularly AND it works with lift/maven.  If so, which versions of
which plugins are you using?
  
The nightly build of the scala plugin seems to work better than
2.7.4/2.7.5 in some ways, but I couldn't get it working with
 lift/
maven due to signature differences between the scala libraries.
  
Best regards,
Ellis
  
   --
   Lift, the simply functional web frameworkhttp://liftweb.net
   Beginning Scalahttp://www.apress.com/book/view/1430219890
   Follow me:http://twitter.com/dpp
   Git some:http://github.com/dpp
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
 
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
 
 
 
 
 
 
 
  --
  Lift, the simply functional web framework http://liftweb.net
  Beginning Scala http://www.apress.com/book/view/1430219890
  Follow me: http://twitter.com/dpp
  Git some: http://github.com/dpp
 
 
 
 
  
 



 



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

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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread glenn

Tim,

Here's a thought. GWT uses entry-point class=some fully qualified
class name / to
identify and initialize modules. Perhaps something similar could be
hooked into LiftFilter and an entry point
class identified in web.xml. There should be little objection to xml
configuration, as opposed to using Java reflection.

Glenn...


On Jul 28, 9:36 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Glenn,

 You have my full attention - this is something I've been sitting on for
 quite some time but just not quite sure what the best route forward is.

 When im creating these modules, I essentially just build a normal jar
 project with maven, and as you say, if I have JS or whatever that I need to
 use I just specify that with ResourceServer (in the module JAR init).

 To date I've not actually needed to pull a template from another JAR, but
 looking at ResourceServer.findResourceInClasspath I think it could do it...
 If memory serves DPP checked in a change to make this work about 2 weeks
 ago...

 In terms of having a defined loading pattern, its possible, but would need
 outlining with some very specific details... IMO, adding one line of code to
 Boot.scala is not a big deal so we would really need a good reason to add a
 bunch of reflection which can sometime feel like voodoo because its not
 clear what its loading and why (one of the reasons I went off ruby).

 Cheers, tim

 On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:



  Hi, Tim,

  So, what you do is put all new LiftRules, Schemifier and
  ResourceServer stuff
  in an init function and run it after the Boot.scala defaults. Sounds
  simple enough.

  When creating your modules, do you just strip out all the stock webapp
  files (those
  that come with the maven lift archetypes), and put all your new
  resources in a
  toserve directory, then just jar it up?

  And what about any new template files? Where do those go in you module
  jars?
  You can't put them in the toserver directory. My understanding is
  that that would
  install them in the WEB-INF/classes directory of your final war file,
  when they
  need to go into the root webapp.

  I still see loose ends here.

  Also, what if you didn't have to modify Bool.scala for every
  module you add. Some hook function in an object that Boot.scala runs
  each time that
  would iterate through all your init functions that followed a pre-
  defined
  signature, would be a nice feature to add to Lift.

  Glenn...

  On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Hi Glen...

  I actually do a lot of this - we have a product at work and i've just
  written a bunch of abstractions for work which just require me to do:

  MyLib.init

  In the boot file of a new application and then everything wires up - I
  couldn't think of anything more straightforward?

  The vast majority of stuff in lift is done with PF's, so you can
  pretty much just write them in external jars, and import them - my 3rd
  part stuff usually has a lift-webkit dependency so that I can just do
  the LiftRules.disptach.append stuff directly in the init method, but
  its really no biggy and saves boilerplate.

  So given your example, this scheme should work right?

  Cheers, Tim

  On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

  I'm interested in abstracting out useful features from my Lift
  applications for ease of reuse, but I haven't found an easy way to do
  it. I find myself creating a new Lift aplication for each feature,
  with all the baggage (bootstrapping, etc.), and I then have to do a
  lot of code modification to the application I'm adding the feature to
  in order to get it to work.

  For example, suppose I want to add role-based user login to an
  application that already has a User model just by dropping in a jar
  file with the new feature. I don't see how to do it without some
  boostrapping modifications.

  Has anyone really tried to modularize their Lift development. I'd be
  very interested in some suggestions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Modularization of Lift code

2009-07-28 Thread glenn

Tim,

My last post may be dismissed as adding more complication than simply
editing Boot.scala. But keep in mind that a consistent, uniform and
robust
procedure for modularization across the Lift universe is to be favored
over the
ad-hoc approach, as exists now. In my view, opening a project and
editing
source files should always be a last-resort option.

Glenn...

On Jul 28, 9:36 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Glenn,

 You have my full attention - this is something I've been sitting on for
 quite some time but just not quite sure what the best route forward is.

 When im creating these modules, I essentially just build a normal jar
 project with maven, and as you say, if I have JS or whatever that I need to
 use I just specify that with ResourceServer (in the module JAR init).

 To date I've not actually needed to pull a template from another JAR, but
 looking at ResourceServer.findResourceInClasspath I think it could do it...
 If memory serves DPP checked in a change to make this work about 2 weeks
 ago...

 In terms of having a defined loading pattern, its possible, but would need
 outlining with some very specific details... IMO, adding one line of code to
 Boot.scala is not a big deal so we would really need a good reason to add a
 bunch of reflection which can sometime feel like voodoo because its not
 clear what its loading and why (one of the reasons I went off ruby).

 Cheers, tim

 On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:



  Hi, Tim,

  So, what you do is put all new LiftRules, Schemifier and
  ResourceServer stuff
  in an init function and run it after the Boot.scala defaults. Sounds
  simple enough.

  When creating your modules, do you just strip out all the stock webapp
  files (those
  that come with the maven lift archetypes), and put all your new
  resources in a
  toserve directory, then just jar it up?

  And what about any new template files? Where do those go in you module
  jars?
  You can't put them in the toserver directory. My understanding is
  that that would
  install them in the WEB-INF/classes directory of your final war file,
  when they
  need to go into the root webapp.

  I still see loose ends here.

  Also, what if you didn't have to modify Bool.scala for every
  module you add. Some hook function in an object that Boot.scala runs
  each time that
  would iterate through all your init functions that followed a pre-
  defined
  signature, would be a nice feature to add to Lift.

  Glenn...

  On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Hi Glen...

  I actually do a lot of this - we have a product at work and i've just
  written a bunch of abstractions for work which just require me to do:

  MyLib.init

  In the boot file of a new application and then everything wires up - I
  couldn't think of anything more straightforward?

  The vast majority of stuff in lift is done with PF's, so you can
  pretty much just write them in external jars, and import them - my 3rd
  part stuff usually has a lift-webkit dependency so that I can just do
  the LiftRules.disptach.append stuff directly in the init method, but
  its really no biggy and saves boilerplate.

  So given your example, this scheme should work right?

  Cheers, Tim

  On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

  I'm interested in abstracting out useful features from my Lift
  applications for ease of reuse, but I haven't found an easy way to do
  it. I find myself creating a new Lift aplication for each feature,
  with all the baggage (bootstrapping, etc.), and I then have to do a
  lot of code modification to the application I'm adding the feature to
  in order to get it to work.

  For example, suppose I want to add role-based user login to an
  application that already has a User model just by dropping in a jar
  file with the new feature. I don't see how to do it without some
  boostrapping modifications.

  Has anyone really tried to modularize their Lift development. I'd be
  very interested in some suggestions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Modularization of Lift code

2009-07-28 Thread glenn

Hi, Ross,

So, with the changes, where would templates need to be placed in jar
files in
order to be found - or can they be put in any directory as long as the
resource
is noted in ResourceServer?

Glenn...

On Jul 28, 9:39 am, Ross Mellgren dri...@gmail.com wrote:
 http://github.com/dpp/liftweb/commit/0f60807dd64b7fe1430919738b46f2eb...
   ...

 From:   feeder.of.the.be...@gmail.com
 Subject:        [Lift] Re: ResourceServer problem
 Date:   July 22, 2009 12:07:14 PM EDT
 To:     liftweb@googlegroups.com
 Reply-To:       liftweb@googlegroups.com

 On Tue, Jul 21, 2009 at 9:55 PM, Naftoli Gugenheim  naftoli...@gmail.com 
 wrote:

   Now a direct call to ResourceServer does work, but the template is  
 still not being found. Any ideas?

 Templates are looked up simply by using the ServletContainer Context's  
 resource locator.  I've expanded the lookup process so that stuff in  
 JAR files will be found.  I'll commit the changes up in 10 minutes or  
 so.

 -Ross

 On Jul 28, 2009, at 12:36 PM, Timothy Perrett wrote:



  Glenn,

  You have my full attention - this is something I've been sitting on  
  for
  quite some time but just not quite sure what the best route forward  
  is.

  When im creating these modules, I essentially just build a normal jar
  project with maven, and as you say, if I have JS or whatever that I  
  need to
  use I just specify that with ResourceServer (in the module JAR init).

  To date I've not actually needed to pull a template from another  
  JAR, but
  looking at ResourceServer.findResourceInClasspath I think it could  
  do it...
  If memory serves DPP checked in a change to make this work about 2  
  weeks
  ago...

  In terms of having a defined loading pattern, its possible, but  
  would need
  outlining with some very specific details... IMO, adding one line of  
  code to
  Boot.scala is not a big deal so we would really need a good reason  
  to add a
  bunch of reflection which can sometime feel like voodoo because its  
  not
  clear what its loading and why (one of the reasons I went off ruby).

  Cheers, tim

  On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:

  Hi, Tim,

  So, what you do is put all new LiftRules, Schemifier and
  ResourceServer stuff
  in an init function and run it after the Boot.scala defaults. Sounds
  simple enough.

  When creating your modules, do you just strip out all the stock  
  webapp
  files (those
  that come with the maven lift archetypes), and put all your new
  resources in a
  toserve directory, then just jar it up?

  And what about any new template files? Where do those go in you  
  module
  jars?
  You can't put them in the toserver directory. My understanding is
  that that would
  install them in the WEB-INF/classes directory of your final war file,
  when they
  need to go into the root webapp.

  I still see loose ends here.

  Also, what if you didn't have to modify Bool.scala for every
  module you add. Some hook function in an object that Boot.scala runs
  each time that
  would iterate through all your init functions that followed a pre-
  defined
  signature, would be a nice feature to add to Lift.

  Glenn...

  On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Hi Glen...

  I actually do a lot of this - we have a product at work and i've  
  just
  written a bunch of abstractions for work which just require me to  
  do:

  MyLib.init

  In the boot file of a new application and then everything wires up  
  - I
  couldn't think of anything more straightforward?

  The vast majority of stuff in lift is done with PF's, so you can
  pretty much just write them in external jars, and import them - my  
  3rd
  part stuff usually has a lift-webkit dependency so that I can just  
  do
  the LiftRules.disptach.append stuff directly in the init method, but
  its really no biggy and saves boilerplate.

  So given your example, this scheme should work right?

  Cheers, Tim

  On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

  I'm interested in abstracting out useful features from my Lift
  applications for ease of reuse, but I haven't found an easy way  
  to do
  it. I find myself creating a new Lift aplication for each feature,
  with all the baggage (bootstrapping, etc.), and I then have to do a
  lot of code modification to the application I'm adding the  
  feature to
  in order to get it to work.

  For example, suppose I want to add role-based user login to an
  application that already has a User model just by dropping in a jar
  file with the new feature. I don't see how to do it without some
  boostrapping modifications.

  Has anyone really tried to modularize their Lift development. I'd  
  be
  very interested in some suggestions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 

[Lift] Re: Modularization of Lift code

2009-07-28 Thread Timothy Perrett


I've been having a think about this, and are we overlooking something stupid
here? Perhaps OSGi could yield a good solution?

Thoughts?

Cheers, Tim

On 28/07/2009 20:04, glenn gl...@exmbly.com wrote:

 
 Tim,
 
 My last post may be dismissed as adding more complication than simply
 editing Boot.scala. But keep in mind that a consistent, uniform and
 robust
 procedure for modularization across the Lift universe is to be favored
 over the
 ad-hoc approach, as exists now. In my view, opening a project and
 editing
 source files should always be a last-resort option.
 
 Glenn...
 
 On Jul 28, 9:36 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Glenn,
 
 You have my full attention - this is something I've been sitting on for
 quite some time but just not quite sure what the best route forward is.
 
 When im creating these modules, I essentially just build a normal jar
 project with maven, and as you say, if I have JS or whatever that I need to
 use I just specify that with ResourceServer (in the module JAR init).
 
 To date I've not actually needed to pull a template from another JAR, but
 looking at ResourceServer.findResourceInClasspath I think it could do it...
 If memory serves DPP checked in a change to make this work about 2 weeks
 ago...
 
 In terms of having a defined loading pattern, its possible, but would need
 outlining with some very specific details... IMO, adding one line of code to
 Boot.scala is not a big deal so we would really need a good reason to add a
 bunch of reflection which can sometime feel like voodoo because its not
 clear what its loading and why (one of the reasons I went off ruby).
 
 Cheers, tim
 
 On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:
 
 
 
 Hi, Tim,
 
 So, what you do is put all new LiftRules, Schemifier and
 ResourceServer stuff
 in an init function and run it after the Boot.scala defaults. Sounds
 simple enough.
 
 When creating your modules, do you just strip out all the stock webapp
 files (those
 that come with the maven lift archetypes), and put all your new
 resources in a
 toserve directory, then just jar it up?
 
 And what about any new template files? Where do those go in you module
 jars?
 You can't put them in the toserver directory. My understanding is
 that that would
 install them in the WEB-INF/classes directory of your final war file,
 when they
 need to go into the root webapp.
 
 I still see loose ends here.
 
 Also, what if you didn't have to modify Bool.scala for every
 module you add. Some hook function in an object that Boot.scala runs
 each time that
 would iterate through all your init functions that followed a pre-
 defined
 signature, would be a nice feature to add to Lift.
 
 Glenn...
 
 On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hi Glen...
 
 I actually do a lot of this - we have a product at work and i've just
 written a bunch of abstractions for work which just require me to do:
 
 MyLib.init
 
 In the boot file of a new application and then everything wires up - I
 couldn't think of anything more straightforward?
 
 The vast majority of stuff in lift is done with PF's, so you can
 pretty much just write them in external jars, and import them - my 3rd
 part stuff usually has a lift-webkit dependency so that I can just do
 the LiftRules.disptach.append stuff directly in the init method, but
 its really no biggy and saves boilerplate.
 
 So given your example, this scheme should work right?
 
 Cheers, Tim
 
 On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:
 
 I'm interested in abstracting out useful features from my Lift
 applications for ease of reuse, but I haven't found an easy way to do
 it. I find myself creating a new Lift aplication for each feature,
 with all the baggage (bootstrapping, etc.), and I then have to do a
 lot of code modification to the application I'm adding the feature to
 in order to get it to work.
 
 For example, suppose I want to add role-based user login to an
 application that already has a User model just by dropping in a jar
 file with the new feature. I don't see how to do it without some
 boostrapping modifications.
 
 Has anyone really tried to modularize their Lift development. I'd be
 very interested in some suggestions.
  
 



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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread Naftoli Gugenheim

If the xml is in the jar file then it would only require the user of the 
library to drop thr jar in. It would only be an extra step for the library 
author.
The question is whether the extra line saved in Boot is worth the time it takes 
for Lift to search the jars whenever you deploy.


-
glenngl...@exmbly.com wrote:


Tim,

My last post may be dismissed as adding more complication than simply
editing Boot.scala. But keep in mind that a consistent, uniform and
robust
procedure for modularization across the Lift universe is to be favored
over the
ad-hoc approach, as exists now. In my view, opening a project and
editing
source files should always be a last-resort option.

Glenn...

On Jul 28, 9:36 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Glenn,

 You have my full attention - this is something I've been sitting on for
 quite some time but just not quite sure what the best route forward is.

 When im creating these modules, I essentially just build a normal jar
 project with maven, and as you say, if I have JS or whatever that I need to
 use I just specify that with ResourceServer (in the module JAR init).

 To date I've not actually needed to pull a template from another JAR, but
 looking at ResourceServer.findResourceInClasspath I think it could do it...
 If memory serves DPP checked in a change to make this work about 2 weeks
 ago...

 In terms of having a defined loading pattern, its possible, but would need
 outlining with some very specific details... IMO, adding one line of code to
 Boot.scala is not a big deal so we would really need a good reason to add a
 bunch of reflection which can sometime feel like voodoo because its not
 clear what its loading and why (one of the reasons I went off ruby).

 Cheers, tim

 On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:



  Hi, Tim,

  So, what you do is put all new LiftRules, Schemifier and
  ResourceServer stuff
  in an init function and run it after the Boot.scala defaults. Sounds
  simple enough.

  When creating your modules, do you just strip out all the stock webapp
  files (those
  that come with the maven lift archetypes), and put all your new
  resources in a
  toserve directory, then just jar it up?

  And what about any new template files? Where do those go in you module
  jars?
  You can't put them in the toserver directory. My understanding is
  that that would
  install them in the WEB-INF/classes directory of your final war file,
  when they
  need to go into the root webapp.

  I still see loose ends here.

  Also, what if you didn't have to modify Bool.scala for every
  module you add. Some hook function in an object that Boot.scala runs
  each time that
  would iterate through all your init functions that followed a pre-
  defined
  signature, would be a nice feature to add to Lift.

  Glenn...

  On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Hi Glen...

  I actually do a lot of this - we have a product at work and i've just
  written a bunch of abstractions for work which just require me to do:

  MyLib.init

  In the boot file of a new application and then everything wires up - I
  couldn't think of anything more straightforward?

  The vast majority of stuff in lift is done with PF's, so you can
  pretty much just write them in external jars, and import them - my 3rd
  part stuff usually has a lift-webkit dependency so that I can just do
  the LiftRules.disptach.append stuff directly in the init method, but
  its really no biggy and saves boilerplate.

  So given your example, this scheme should work right?

  Cheers, Tim

  On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

  I'm interested in abstracting out useful features from my Lift
  applications for ease of reuse, but I haven't found an easy way to do
  it. I find myself creating a new Lift aplication for each feature,
  with all the baggage (bootstrapping, etc.), and I then have to do a
  lot of code modification to the application I'm adding the feature to
  in order to get it to work.

  For example, suppose I want to add role-based user login to an
  application that already has a User model just by dropping in a jar
  file with the new feature. I don't see how to do it without some
  boostrapping modifications.

  Has anyone really tried to modularize their Lift development. I'd be
  very interested in some suggestions.


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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread Naftoli Gugenheim

It's not related to ResourceServer. Just use the jar-relative path in the embed 
tag etc.

-
glenngl...@exmbly.com wrote:


Hi, Ross,

So, with the changes, where would templates need to be placed in jar
files in
order to be found - or can they be put in any directory as long as the
resource
is noted in ResourceServer?

Glenn...

On Jul 28, 9:39 am, Ross Mellgren dri...@gmail.com wrote:
 http://github.com/dpp/liftweb/commit/0f60807dd64b7fe1430919738b46f2eb...
   ...

 From:   feeder.of.the.be...@gmail.com
 Subject:        [Lift] Re: ResourceServer problem
 Date:   July 22, 2009 12:07:14 PM EDT
 To:     liftweb@googlegroups.com
 Reply-To:       liftweb@googlegroups.com

 On Tue, Jul 21, 2009 at 9:55 PM, Naftoli Gugenheim  naftoli...@gmail.com 
 wrote:

   Now a direct call to ResourceServer does work, but the template is  
 still not being found. Any ideas?

 Templates are looked up simply by using the ServletContainer Context's  
 resource locator.  I've expanded the lookup process so that stuff in  
 JAR files will be found.  I'll commit the changes up in 10 minutes or  
 so.

 -Ross

 On Jul 28, 2009, at 12:36 PM, Timothy Perrett wrote:



  Glenn,

  You have my full attention - this is something I've been sitting on  
  for
  quite some time but just not quite sure what the best route forward  
  is.

  When im creating these modules, I essentially just build a normal jar
  project with maven, and as you say, if I have JS or whatever that I  
  need to
  use I just specify that with ResourceServer (in the module JAR init).

  To date I've not actually needed to pull a template from another  
  JAR, but
  looking at ResourceServer.findResourceInClasspath I think it could  
  do it...
  If memory serves DPP checked in a change to make this work about 2  
  weeks
  ago...

  In terms of having a defined loading pattern, its possible, but  
  would need
  outlining with some very specific details... IMO, adding one line of  
  code to
  Boot.scala is not a big deal so we would really need a good reason  
  to add a
  bunch of reflection which can sometime feel like voodoo because its  
  not
  clear what its loading and why (one of the reasons I went off ruby).

  Cheers, tim

  On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:

  Hi, Tim,

  So, what you do is put all new LiftRules, Schemifier and
  ResourceServer stuff
  in an init function and run it after the Boot.scala defaults. Sounds
  simple enough.

  When creating your modules, do you just strip out all the stock  
  webapp
  files (those
  that come with the maven lift archetypes), and put all your new
  resources in a
  toserve directory, then just jar it up?

  And what about any new template files? Where do those go in you  
  module
  jars?
  You can't put them in the toserver directory. My understanding is
  that that would
  install them in the WEB-INF/classes directory of your final war file,
  when they
  need to go into the root webapp.

  I still see loose ends here.

  Also, what if you didn't have to modify Bool.scala for every
  module you add. Some hook function in an object that Boot.scala runs
  each time that
  would iterate through all your init functions that followed a pre-
  defined
  signature, would be a nice feature to add to Lift.

  Glenn...

  On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Hi Glen...

  I actually do a lot of this - we have a product at work and i've  
  just
  written a bunch of abstractions for work which just require me to  
  do:

  MyLib.init

  In the boot file of a new application and then everything wires up  
  - I
  couldn't think of anything more straightforward?

  The vast majority of stuff in lift is done with PF's, so you can
  pretty much just write them in external jars, and import them - my  
  3rd
  part stuff usually has a lift-webkit dependency so that I can just  
  do
  the LiftRules.disptach.append stuff directly in the init method, but
  its really no biggy and saves boilerplate.

  So given your example, this scheme should work right?

  Cheers, Tim

  On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

  I'm interested in abstracting out useful features from my Lift
  applications for ease of reuse, but I haven't found an easy way  
  to do
  it. I find myself creating a new Lift aplication for each feature,
  with all the baggage (bootstrapping, etc.), and I then have to do a
  lot of code modification to the application I'm adding the  
  feature to
  in order to get it to work.

  For example, suppose I want to add role-based user login to an
  application that already has a User model just by dropping in a jar
  file with the new feature. I don't see how to do it without some
  boostrapping modifications.

  Has anyone really tried to modularize their Lift development. I'd  
  be
  very interested in some suggestions.


--~--~-~--~~~---~--~~
You received this message because you 

[Lift] Re: Modularization of Lift code

2009-07-28 Thread Timothy Perrett

Im just spitballing - I knew Heiko was working on a bunch of modules
and such for Lift so wondered if it was possibly a route forward (im
not really up to speed with OSGi)

Cheers, Tim

On Jul 28, 8:20 pm, glenn gl...@exmbly.com wrote:
 My understanding about OSGi is that is allows for dynamic classpath
 dependencies through a jar's META-INF file. But wouldn't that require
 launching an OSGi implementation with your main Lift application.

 Glenn...

 On Jul 28, 12:11 pm, Timothy Perrett timo...@getintheloop.eu wrote:



  I've been having a think about this, and are we overlooking something stupid
  here? Perhaps OSGi could yield a good solution?

  Thoughts?

  Cheers, Tim

  On 28/07/2009 20:04, glenn gl...@exmbly.com wrote:

   Tim,

   My last post may be dismissed as adding more complication than simply
   editing Boot.scala. But keep in mind that a consistent, uniform and
   robust
   procedure for modularization across the Lift universe is to be favored
   over the
   ad-hoc approach, as exists now. In my view, opening a project and
   editing
   source files should always be a last-resort option.

   Glenn...

   On Jul 28, 9:36 am, Timothy Perrett timo...@getintheloop.eu wrote:
   Glenn,

   You have my full attention - this is something I've been sitting on for
   quite some time but just not quite sure what the best route forward is.

   When im creating these modules, I essentially just build a normal jar
   project with maven, and as you say, if I have JS or whatever that I need 
   to
   use I just specify that with ResourceServer (in the module JAR init).

   To date I've not actually needed to pull a template from another JAR, but
   looking at ResourceServer.findResourceInClasspath I think it could do 
   it...
   If memory serves DPP checked in a change to make this work about 2 weeks
   ago...

   In terms of having a defined loading pattern, its possible, but would 
   need
   outlining with some very specific details... IMO, adding one line of 
   code to
   Boot.scala is not a big deal so we would really need a good reason to 
   add a
   bunch of reflection which can sometime feel like voodoo because its not
   clear what its loading and why (one of the reasons I went off ruby).

   Cheers, tim

   On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:

   Hi, Tim,

   So, what you do is put all new LiftRules, Schemifier and
   ResourceServer stuff
   in an init function and run it after the Boot.scala defaults. Sounds
   simple enough.

   When creating your modules, do you just strip out all the stock webapp
   files (those
   that come with the maven lift archetypes), and put all your new
   resources in a
   toserve directory, then just jar it up?

   And what about any new template files? Where do those go in you module
   jars?
   You can't put them in the toserver directory. My understanding is
   that that would
   install them in the WEB-INF/classes directory of your final war file,
   when they
   need to go into the root webapp.

   I still see loose ends here.

   Also, what if you didn't have to modify Bool.scala for every
   module you add. Some hook function in an object that Boot.scala runs
   each time that
   would iterate through all your init functions that followed a pre-
   defined
   signature, would be a nice feature to add to Lift.

   Glenn...

   On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
   Hi Glen...

   I actually do a lot of this - we have a product at work and i've just
   written a bunch of abstractions for work which just require me to do:

   MyLib.init

   In the boot file of a new application and then everything wires up - I
   couldn't think of anything more straightforward?

   The vast majority of stuff in lift is done with PF's, so you can
   pretty much just write them in external jars, and import them - my 3rd
   part stuff usually has a lift-webkit dependency so that I can just do
   the LiftRules.disptach.append stuff directly in the init method, but
   its really no biggy and saves boilerplate.

   So given your example, this scheme should work right?

   Cheers, Tim

   On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

   I'm interested in abstracting out useful features from my Lift
   applications for ease of reuse, but I haven't found an easy way to do
   it. I find myself creating a new Lift aplication for each feature,
   with all the baggage (bootstrapping, etc.), and I then have to do a
   lot of code modification to the application I'm adding the feature to
   in order to get it to work.

   For example, suppose I want to add role-based user login to an
   application that already has a User model just by dropping in a jar
   file with the new feature. I don't see how to do it without some
   boostrapping modifications.

   Has anyone really tried to modularize their Lift development. I'd be
   very interested in some suggestions.
--~--~-~--~~~---~--~~
You received this 

[Lift] Re: scala+maven

2009-07-28 Thread Timothy Perrett

Hey there,

I wrote an article previously about how to use launchers with maven-
scala-plugin, find it here: http://is.gd/1RuLQ

Does that help?

Cheers, Tim

On Jul 28, 7:32 pm, ph pkirsa...@gmail.com wrote:
 Is there a good recourse on how to setup/use scala project with maven?

 I've installed maven that comes with lift. Project is created with
 Eclipse maven plugin (q4ehttp://code.google.com/p/q4e/). I build and
 install scala project to local repository fine.
 I can also run project using mvn scala:run command from project
 folder.
 Now I need to run project from repository and I cannot figure out how
 to do so. Would I need to use mvn scala:run? This will resolve
 dependencies and install all required libraries...
 Scala plugin is not recognized as it declared only in pom. I'm
 trying to update maven's settings.xml, adding this:

         profile
                 idenv-dev/id
                 repositories
                         repository
                                 idscala-tools.org/id
                                 nameScala-tools Maven2 Repository/name
                                 
 urlhttp://scala-tools.org/repo-releases/url
                         /repository
                 /repositories
                 pluginRepositories
                         pluginRepository
                                 idorg.scala-tools/id
                                 nameScala-tools Maven2 Repository/name
                                 
 urlhttp://scala-tools.org/repo-releases/url
                         /pluginRepository
                 /pluginRepositories
         /profile

   /profiles

   activeProfiles
     activeProfileenv-dev/activeProfile
   /activeProfiles

 now if I run mvn scala:run -DmainClass=... it gives me error:
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] The plugin 'org.apache.maven.plugins:maven-scala-plugin' does
 not exist or no valid version could be found

 Maybe there is another way to run project from maven repository?

 Next step for me will be installing artifact into private remote
 repository (Artifactory) and run project from that remote
 repository... Any suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Modularization of Lift code

2009-07-28 Thread Naftoli Gugenheim

The jar should be in lib I guess, and use the path relative to the jar file 
(the path in the jar).
I added /tableeditor/default.html to lift-mapper.jar, so you would include it 
with lift:embed what=/tableeditor/default .

-
glenngl...@exmbly.com wrote:

Say I just wanted to open the template, tmpl.html in my module's jar file. 
Since it's not in the webapp directory, what would the link have to look like 
in my sitemap menu?

Glenn
Sent from my Verizon Wireless BlackBerry

-Original Message-
From: Naftoli Gugenheim naftoli...@gmail.com

Date: Tue, 28 Jul 2009 12:17:44 
To: gl...@exmbly.com; liftweb@googlegroups.com
Subject: Re: [Lift] Re: Modularization of Lift code


It's not related to ResourceServer. Just use the jar-relative path in the embed 
tag etc.

-
glenngl...@exmbly.com wrote:


Hi, Ross,

So, with the changes, where would templates need to be placed in jar
files in
order to be found - or can they be put in any directory as long as the
resource
is noted in ResourceServer?

Glenn...

On Jul 28, 9:39 am, Ross Mellgren dri...@gmail.com wrote:
 http://github.com/dpp/liftweb/commit/0f60807dd64b7fe1430919738b46f2eb...
   ...

 From:   feeder.of.the.be...@gmail.com
 Subject:        [Lift] Re: ResourceServer problem
 Date:   July 22, 2009 12:07:14 PM EDT
 To:     liftweb@googlegroups.com
 Reply-To:       liftweb@googlegroups.com

 On Tue, Jul 21, 2009 at 9:55 PM, Naftoli Gugenheim  naftoli...@gmail.com 
 wrote:

   Now a direct call to ResourceServer does work, but the template is  
 still not being found. Any ideas?

 Templates are looked up simply by using the ServletContainer Context's  
 resource locator.  I've expanded the lookup process so that stuff in  
 JAR files will be found.  I'll commit the changes up in 10 minutes or  
 so.

 -Ross

 On Jul 28, 2009, at 12:36 PM, Timothy Perrett wrote:



  Glenn,

  You have my full attention - this is something I've been sitting on  
  for
  quite some time but just not quite sure what the best route forward  
  is.

  When im creating these modules, I essentially just build a normal jar
  project with maven, and as you say, if I have JS or whatever that I  
  need to
  use I just specify that with ResourceServer (in the module JAR init).

  To date I've not actually needed to pull a template from another  
  JAR, but
  looking at ResourceServer.findResourceInClasspath I think it could  
  do it...
  If memory serves DPP checked in a change to make this work about 2  
  weeks
  ago...

  In terms of having a defined loading pattern, its possible, but  
  would need
  outlining with some very specific details... IMO, adding one line of  
  code to
  Boot.scala is not a big deal so we would really need a good reason  
  to add a
  bunch of reflection which can sometime feel like voodoo because its  
  not
  clear what its loading and why (one of the reasons I went off ruby).

  Cheers, tim

  On 28/07/2009 17:00, glenn gl...@exmbly.com wrote:

  Hi, Tim,

  So, what you do is put all new LiftRules, Schemifier and
  ResourceServer stuff
  in an init function and run it after the Boot.scala defaults. Sounds
  simple enough.

  When creating your modules, do you just strip out all the stock  
  webapp
  files (those
  that come with the maven lift archetypes), and put all your new
  resources in a
  toserve directory, then just jar it up?

  And what about any new template files? Where do those go in you  
  module
  jars?
  You can't put them in the toserver directory. My understanding is
  that that would
  install them in the WEB-INF/classes directory of your final war file,
  when they
  need to go into the root webapp.

  I still see loose ends here.

  Also, what if you didn't have to modify Bool.scala for every
  module you add. Some hook function in an object that Boot.scala runs
  each time that
  would iterate through all your init functions that followed a pre-
  defined
  signature, would be a nice feature to add to Lift.

  Glenn...

  On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  Hi Glen...

  I actually do a lot of this - we have a product at work and i've  
  just
  written a bunch of abstractions for work which just require me to  
  do:

  MyLib.init

  In the boot file of a new application and then everything wires up  
  - I
  couldn't think of anything more straightforward?

  The vast majority of stuff in lift is done with PF's, so you can
  pretty much just write them in external jars, and import them - my  
  3rd
  part stuff usually has a lift-webkit dependency so that I can just  
  do
  the LiftRules.disptach.append stuff directly in the init method, but
  its really no biggy and saves boilerplate.

  So given your example, this scheme should work right?

  Cheers, Tim

  On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote:

  I'm interested in abstracting out useful features from my Lift
  applications for ease of reuse, but I 

[Lift] Re: New features

2009-07-28 Thread Naftoli Gugenheim

In the meantime, if there are any scaladoc comments that could be improved or 
clarified, please tell me!

-
marius d.marius.dan...@gmail.com wrote:


Would you please add some examples on the wiki so that people can
actually visualize how these things can be used?


As far as XmlMenu goes why do we want to express menus as xml ?

Br's,
Marius

On Jul 27, 10:57 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 I committed some code last night, which can help building mapper-based view 
 snippets, with G-d's help. It includes the following classes:
 (1-2) net.liftweb.mapper.OneToMany, ManyToMany: Gives a more object-oriented 
 approach to managing related entites. You can manage the many side of a 1-n 
 and n-n as a mutable collection of children, and the parent of a child can be 
 set directly, instead of via its id. And the children are not saved to the 
 database when you add them until you call save on it or its parent, nor 
 deleted when you remove tem until you call delete_!, which is very helpful 
 when you need to keep track of adds/removes through multiple requests. For 
 example, if you are displaying a list and you can click delete, but it 
 shouldn't be permanently deleted until you click save.
 There is a new package, ...mapper.view, which contains a number of utilities 
 for mapper-based views:
 (3-4) ModelView and ModelSnippet provide a number of building blocks for 
 views that are too complex to CRUDify. Inherit ModelSnippet (which extends 
 StatefulSnippet) and wrap your entities in ModelView (view is used in the 
 sense of a wrapper).
 (5) Util provides some more building blocks that just be imported, without 
 needing a ModelSnippet context.
 (6-7) Paginator makes it easy to create paginated, user sortable listings. 
 You can use PaginatedSnippet instead of ModelSnippet to help.
 (8-10) ItemsList lets you manage a list of entities with pending additions 
 and deletions. It's used by TableEditor, which is a very easy to use and 
 customizable snippet to edit tables directly. It's useful for editing short 
 lists, e.g., a lookup table like cities. Don't forget to register the table 
 in Boot.
 (11) Then there's the experimental FormProcessor, if you need your form to be 
 processed in one block instead of separate closures, e.g., to surround with 
 try.
 (12) Also experimental is sitemap.XmlMenu which lets you write menus in xml.
 (13) I may add CaseEnum, which lets you write case classes that automatically 
 double as an Enumeration.
 Questions, comments, suggestions, and constructive criticism are more than 
 welcome!
 Thanks.


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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread Timothy Perrett

Hey Naftoli,

Lift has a general aversion to xml configs... Is there another route?

Cheers, Tim


On 28/07/2009 20:47, Naftoli Gugenheim naftoli...@gmail.com wrote:

 
 What I was suggesting is that instead of having to write Lib.init in Boot,
 Lift should look in Lib.jar for say /boot.xml which would tell Lift to execute
 Lib.init for you on startup. I think that would accomplish what you want, at
 the cost of lift searching through the jars.



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



[Lift] Moving the wiki...

2009-07-28 Thread Timothy Perrett

Hey guys,

We had a discussion within the team and taken the decision to move to
the github wiki - a fresh start for a fresh new wiki with lots of up-
to-date information to replace our legacy wiki / documentation.

I've started to move stuff across and supply some brand new
documentation, do take a look and let us know what you think - Xavi
has very kindly volunteered to be the wiki gardener so kudos for him
giving us a kick to actually fix the documentation and make the
learning curve for Lift far smoother.

http://wiki.github.com/dpp/liftweb

Cheers

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



[Lift] User validation by admin

2009-07-28 Thread Naftoli Gugenheim

Hi. I would like to customize the way that user registration is validated by 
email. For example, require the admin to validate users.
Here are some possible approaches:
1. Set skipEmailValidation to true and build the mechanism from scratch in the 
subclass.
2. Override signup, and implement it similar but different.
3. Add a flag to lift to leave the user NOT validated, but not to send the 
email. Then either send the email manually, or provide a way for the admin to 
validate users.
4. Provide a hook to directly specify who the email should go to.
What do people think?

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



[Lift] Re: Hear podcast interview with David Pollack about Lift

2009-07-28 Thread DFectuoso

Cheers! That was a great podcast!



On Jul 28, 11:48 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 I had a great time on the podcast... the pondjumpers are a cool pair of
 dudes.

 On Mon, Jul 27, 2009 at 11:40 AM, Goldfish gregt...@mindspring.com wrote:

  Visithttp://pondjumpers.com/2009/07/27/episode-2-interview-about-lift/
  to hear a podcast interview with David Pollack about Lift.

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

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



[Lift] Re: Automatic background AJAX: best way to do it?

2009-07-28 Thread Peter Robinett

I would do the first option, which I don't see as 'unLifty', but
perhaps someone who knows Lift better than I do can comment on your
options.

Peter Robinett

On Jul 28, 10:57 am, Nolan Darilek no...@thewordnerd.info wrote:
 I have a project that will use the geolocation API in Firefox 3.5,
 Google Gears and other JS frameworks. It will need to keep the user's
 position updated using the watchPosition API, fetching nearby POIs and
 such whenever the position changes.

 I'm actually fairly new to AJAX, and am trying to figure out the best
 way to do this. Most of the AJAX examples I've seen involve user
 interaction, such as entering into a text field than removing focus, or
 waiting on state updates, as with comet. In this case, there's state
 that may update often or never, and those updates will be triggered by a
 callback function in the background, with no user interaction into which
 I can hook. I also don't want to leave a Comet connection open to the
 app waiting on updates, since the app may see mobile use, and I can't
 imagine holding open a connection being great for battery life.

 I'm wondering what the best way to do this would be, while staying
 fairly close to what Lift offers? Thus far I have two options.

 1. Create a REST API and have the Javascript call a specified URL
 whenever the position changes, inserting the resulting JSON into the
 page at appropriate places. This works, but seems like it'd involve lots
 of extra effort, as well as straying away from Lift/Scala's added
 benefits into the dynamicity of JS, which I'm not entirely comfortable with.

 2. Create a hidden JSON form on the page. When the position changes, the
 JS callback function fills out and submits the form in the background.
 This seems a bit hackish, with the hidden form and all, but this makes
 the problem one that is on a bit less shaky Lift ground. I can then use
 Lift's provided functionality to generate JS for replacing page contents
 with the results of evaluating the form submission.

 I'm basically going from the Lift book here. Most ideal, I'd think,
 would be if there was some way to have my callback function call a
 snippet directly and be handed back the JS needed, without having to
 create a separate web service API for this one call. Is the JSON form
 method the best option here? Or is there some new shiny in 1.1 that
 isn't documented in the Lift book yet? (or perhaps it *is* documented
 and I'm just missing it. :)

 Thanks.

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



[Lift] Re: Mapper and Primary Keys

2009-07-28 Thread Peter Robinett

Sorry to bump this, but does anyone have any idea why my mac column is
not being saved to the database, despite the save method returning
true?

On Jul 22, 9:19 am, Peter Robinett pe...@bubblefoundry.com wrote:
 Because it's unique across systems and maps directly to hardware I'm
 tracking. But thanks for the equations!

 Peter

 On Jul 21, 7:20 pm, jon jonhoff...@gmail.com wrote:

  This doesn't address your question, so I'll apologize in advance, but
  why do you want to use a mac address as a primary key?   Also, a mac
  address represents six bytes, why not pack into a long?  This probably
  isn't the most efficient or prettiest way:

    def macToLong(mac: String) = java.lang.Long.parseLong(mac.replace
  (:,),16)

    def longToMac(mac: Long) = (0 to 5).reverse.map( i = (mac  ((0xff)
   (i * 8).asInstanceOf[Long]))  (i * 8)).
      map( l = String.format(%02x,l.asInstanceOf[Object])).mkString
  (:)

    println( longToMac(macToLong(00:1d:c9:00:04:9f)))

  On Jul 21, 4:19 pm, Peter Robinett pe...@bubblefoundry.com wrote:

   I should add that I believe this is because the field isn't being
   marked as dirty and so isn't saved. This is in MappedField:
   def dirty_? = !dbPrimaryKey_?  _dirty_?

   How would I overload it in my object mac definition?

   Thanks,
   Peter

   On Jul 21, 12:30 pm, Peter Robinett pe...@bubblefoundry.com wrote:

Thanks Derek, but unfortunately it only works halfway: I am able to
set MAC address of my new Node and save it (returning true) and my
MySQL database row is created, but the mac column is null.

Peter

On Jul 21, 7:58 am, Derek Chen-Becker dchenbec...@gmail.com wrote:

 I think that this should work, but I haven't tested it:

 class Node extends KeyedMapper[String, Node] {
  def getSingleton = Node
  /* MAC address as primary key */
  def primaryKeyField = mac
  object mac extends MappedStringIndex(this, 17) {
         override def writePermission_? = true
         override def dbDisplay_? = true
  }

 }

 Note that primaryKey_? is already set to true in MappedStringIndex.
 writePermission_? is set to false by default...

 Derek

 On Mon, Jul 20, 2009 at 7:30 PM, Peter Robinett 
 pe...@bubblefoundry.comwrote:

  Hi all,

  I'm using Mapper with MAC addresses as my primary keys:
  class Node extends KeyedMapper[String, Node] {
   def getSingleton = Node
   /* MAC address as primary key */
   def primaryKeyField = mac
   object mac extends MappedStringIndex(this, 17) {
          override def dbPrimaryKey_? = true
          override def dbDisplay_? = true
   }
  }

  Unfortunately, if I try to create a new Node and assign a MAC 
  address,
  I get an error saying that I don't have permission:
  scala Node.create.mac(00:1d:c9:00:04:9f)
  java.lang.Exception: Do not have permissions to set this field
         at 
  net.liftweb.mapper.MappedField$class.set(MappedField.scala:425)
         at net.liftweb.mapper.MappedString.set(MappedString.scala:38)
         at net.liftweb.mapper.MappedString$$anonfun$apply$6.apply
  (MappedString.scala:121)
         at net.liftweb.mapper.MappedString$$anonfun$apply$6.apply
  (MappedString.scala:121)
         at net.liftweb.util.Full.f...

  How do I go about creating a new Node with the mac address – the
  primary key – of my choosing?

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



[Lift] Re: scala+maven

2009-07-28 Thread ph

Maybe better question would be:
How to run scala artifact from maven repository (local and/or private
remote)?

On Jul 28, 3:28 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey there,

 I wrote an article previously about how to use launchers with maven-
 scala-plugin, find it here:http://is.gd/1RuLQ

 Does that help?

 Cheers, Tim

 On Jul 28, 7:32 pm, ph pkirsa...@gmail.com wrote:



  Is there a good recourse on how to setup/use scala project with maven?

  I've installed maven that comes with lift. Project is created with
  Eclipse maven plugin (q4ehttp://code.google.com/p/q4e/). I build and
  install scala project to local repository fine.
  I can also run project using mvn scala:run command from project
  folder.
  Now I need to run project from repository and I cannot figure out how
  to do so. Would I need to use mvn scala:run? This will resolve
  dependencies and install all required libraries...
  Scala plugin is not recognized as it declared only in pom. I'm
  trying to update maven's settings.xml, adding this:

          profile
                  idenv-dev/id
                  repositories
                          repository
                                  idscala-tools.org/id
                                  nameScala-tools Maven2 Repository/name
                                  
  urlhttp://scala-tools.org/repo-releases/url
                          /repository
                  /repositories
                  pluginRepositories
                          pluginRepository
                                  idorg.scala-tools/id
                                  nameScala-tools Maven2 Repository/name
                                  
  urlhttp://scala-tools.org/repo-releases/url
                          /pluginRepository
                  /pluginRepositories
          /profile

    /profiles

    activeProfiles
      activeProfileenv-dev/activeProfile
    /activeProfiles

  now if I run mvn scala:run -DmainClass=... it gives me error:
  [ERROR] BUILD ERROR
  [INFO]
  
  [INFO] The plugin 'org.apache.maven.plugins:maven-scala-plugin' does
  not exist or no valid version could be found

  Maybe there is another way to run project from maven repository?

  Next step for me will be installing artifact into private remote
  repository (Artifactory) and run project from that remote
  repository... Any suggestions?

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



[Lift] Re: New features

2009-07-28 Thread glenn

Naftoli,

The ManyToMany class is in the new lift-mapper jar, but the source is
not available in 1.1-SNAPSHOT-sources. Could you provide?
Thanks,

Glenn...

On Jul 27, 3:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 I committed it last night, so I think it should be there.
 To use many-to-many, simply mix ManyToMany to your mapper, then create a 
 MappedManyToMany field like any other field. See the scaladocs for specifics.
 Then in your view you can use the field like a collection, e.g., remove an 
 element with -=, and save the mapper to apply the changes.

 -

 glenngl...@exmbly.com wrote:

 Sounds great. I've been using hacks such as adding code like this to
 my mapper classes just to create a Many-to-Many
 relationship between say, tag and content tables (using an
 intermediary ContentTag table). Similarly, I've done User/Roles
 relationships.

  private object _dbTags extends HasManyThrough(this, Tag, ContentTag,
 ContentTag.content, ContentTag.tag)

   private[model] var _tags : List[Tag] = _

   private val locker = new Object

   def tags : List[Tag] = locker.synchronized {
     if(_tags eq null){
       _tags = _dbTags()
     }
     _tags
   }

   def tags(newTags:String) = locker.synchronized {
     _tags = newTags.roboSplit(,).map(Tag.byName(_))
     this
   }

   def tags(newTags:List[Tag]) = locker.synchronized {
     _tags = newTags
     this
   }

   def tagsToo:List[Tag] = ContentTag.findAll(By(ContentTag.content,
 this.id)).map(_.tag.obj.open_!)

   def showTags = Text(tags.map(_.name.is).mkString(, ))

 But, then I have to add code like this to the meta-mapper objects:

  def addTags(entry: Content) {
     if(entry._tags ne null){
        entry._tags.foreach(ContentTag.join(_, entry))
     }
   }

   def delTags(entry:Content) =
     ContentTag.findAll(By(ContentTag.content, entry)).foreach
 (_.delete_!)

 It's not very pretty. Nor easy to duplicate.

 I hope your new code is considerably less messy.

 Is it in the repo-snapshot repository yet.

 On Jul 27, 12:57 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:

  I committed some code last night, which can help building mapper-based view 
  snippets, with G-d's help. It includes the following classes:
  (1-2) net.liftweb.mapper.OneToMany, ManyToMany: Gives a more 
  object-oriented approach to managing related entites. You can manage the 
  many side of a 1-n and n-n as a mutable collection of children, and the 
  parent of a child can be set directly, instead of via its id. And the 
  children are not saved to the database when you add them until you call 
  save on it or its parent, nor deleted when you remove tem until you call 
  delete_!, which is very helpful when you need to keep track of adds/removes 
  through multiple requests. For example, if you are displaying a list and 
  you can click delete, but it shouldn't be permanently deleted until you 
  click save.
  There is a new package, ...mapper.view, which contains a number of 
  utilities for mapper-based views:
  (3-4) ModelView and ModelSnippet provide a number of building blocks for 
  views that are too complex to CRUDify. Inherit ModelSnippet (which extends 
  StatefulSnippet) and wrap your entities in ModelView (view is used in the 
  sense of a wrapper).
  (5) Util provides some more building blocks that just be imported, without 
  needing a ModelSnippet context.
  (6-7) Paginator makes it easy to create paginated, user sortable listings. 
  You can use PaginatedSnippet instead of ModelSnippet to help.
  (8-10) ItemsList lets you manage a list of entities with pending additions 
  and deletions. It's used by TableEditor, which is a very easy to use and 
  customizable snippet to edit tables directly. It's useful for editing short 
  lists, e.g., a lookup table like cities. Don't forget to register the table 
  in Boot.
  (11) Then there's the experimental FormProcessor, if you need your form to 
  be processed in one block instead of separate closures, e.g., to surround 
  with try.
  (12) Also experimental is sitemap.XmlMenu which lets you write menus in xml.
  (13) I may add CaseEnum, which lets you write case classes that 
  automatically double as an Enumeration.
  Questions, comments, suggestions, and constructive criticism are more than 
  welcome!
  Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Hear podcast interview with David Pollack about Lift

2009-07-28 Thread Peter Bliznak
Truly enjoyed that one!





From: DFectuoso santiago1...@gmail.com
To: Lift liftweb@googlegroups.com
Sent: Tuesday, July 28, 2009 4:31:05 PM
Subject: [Lift] Re: Hear podcast interview with David Pollack about Lift


Cheers! That was a great podcast!



On Jul 28, 11:48 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 I had a great time on the podcast... the pondjumpers are a cool pair of
 dudes.

 On Mon, Jul 27, 2009 at 11:40 AM, Goldfish gregt...@mindspring.com wrote:

  Visithttp://pondjumpers.com/2009/07/27/episode-2-interview-about-lift/
  to hear a podcast interview with David Pollack about Lift.

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


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



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread Naftoli Gugenheim

It would redeploy if you were using mvn jetty:run and you changed files in the 
webapp.
Do the increases correspond to (specific) requests?

-
Peter Robinettpe...@bubblefoundry.com wrote:


Thanks, Naftoli. After running for an hour the app is using 45-60% of
my (very little) memory. It appears that memory is being used in a
sawtooth pattern, with the baseline gradually creeping upwards.[1] I
don't see any mention in the logs of any redeployments.

Peter

[1]: http://www.bubblefoundry.com/lift/jconsole-overview.jpg

On Jul 28, 2:15 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 You can monitor it with jconsole.
 Is the memory building up gradually and not being garbage collected? Is it 
 being redeployed without restarting jetty?

 -

 Peter Robinettpe...@bubblefoundry.com wrote:

 Thanks all for the comments and suggestions. I'm totally new to the
 Java world, so thanks for mentioning all these various options.

 First, my system: MySQL is the database I'm using with my Lift app
 (and some other very low traffic apps) and is tuned pretty
 aggressively to use little memory. It seems to only use tens of
 megabytes. My Lift app is based upon 1.1-SNAPSHOT and archetype lift-
 archetype-basic.

 Second, JVM options and analysis: how should I pass options to the JVM
 when launching jetty and Lift with 'mvn jetty:run'? What heap size
 should I use? How do I monitor a JVM process? My actors being notified
 of the REST POSTs are scala.actors, as I understood them to be
 sufficient[1]: class NodeActor extends Actor with ListenerManager. The
 CometActors that listen to the NodeActors are defined like: class
 NodeGraph extends CometActor.

 Thanks for your help,
 Peter

 [1]:http://groups.google.com/group/liftweb/msg/86d518b0c44b1b58?hl=en

 On Jul 28, 10:31 am, Spencer Uresk sur...@gmail.com wrote:

  I'm not sure about how much overhead Jetty adds to the mix (I'd assume it
  would be small, but I could be wrong), but on my production server, a small
  Lift app added only 30 - 40 mb or so to the memory usage of my Tomcat
  instance. Based on my experience with running Java and Groovy based
  applications on a VPS, a 256 mb slice should be plenty unless you have lots
  of concurrent sessions and/or big sessions. If people are having a different
  experience with Lift-based apps, I'd be interested in hearing that (and
  why).

  Peter, Have you tried running jmap on your box to generate a heap dump and
  then analyzing that to see what is using up all the memory? Using something
  like MAT (www.eclipse.org/mat/) makes it pretty easy to see what the likely
  culprits are, and then you can go from there.

  - Spencer

  On Tue, Jul 28, 2009 at 3:55 AM, Timothy Perrett 
  timo...@getintheloop.euwrote:

   Agreed; its pretty light to run all those services. I have a lift based 
   app
   that's been running for quite some time and its using around 250mb of RAM
   on
   average. A raw lift app will probably use 128mb RAM as minimum.

   Cheers, Tim

   On 28/07/2009 10:08, marius d. marius.dan...@gmail.com wrote:
BTW 256mb seems to me ridiculous small for a server side application.


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



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread Peter Robinett

Nope, haven't touched any of the files. As for the increases, they do
not appear to, since requests happen approximately every second and
the length of each spike is around one minute.

Peter

On Jul 28, 3:16 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 It would redeploy if you were using mvn jetty:run and you changed files in 
 the webapp.
 Do the increases correspond to (specific) requests?

 -

 Peter Robinettpe...@bubblefoundry.com wrote:

 Thanks, Naftoli. After running for an hour the app is using 45-60% of
 my (very little) memory. It appears that memory is being used in a
 sawtooth pattern, with the baseline gradually creeping upwards.[1] I
 don't see any mention in the logs of any redeployments.

 Peter

 [1]:http://www.bubblefoundry.com/lift/jconsole-overview.jpg

 On Jul 28, 2:15 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:

  You can monitor it with jconsole.
  Is the memory building up gradually and not being garbage collected? Is it 
  being redeployed without restarting jetty?

  -

  Peter Robinettpe...@bubblefoundry.com wrote:

  Thanks all for the comments and suggestions. I'm totally new to the
  Java world, so thanks for mentioning all these various options.

  First, my system: MySQL is the database I'm using with my Lift app
  (and some other very low traffic apps) and is tuned pretty
  aggressively to use little memory. It seems to only use tens of
  megabytes. My Lift app is based upon 1.1-SNAPSHOT and archetype lift-
  archetype-basic.

  Second, JVM options and analysis: how should I pass options to the JVM
  when launching jetty and Lift with 'mvn jetty:run'? What heap size
  should I use? How do I monitor a JVM process? My actors being notified
  of the REST POSTs are scala.actors, as I understood them to be
  sufficient[1]: class NodeActor extends Actor with ListenerManager. The
  CometActors that listen to the NodeActors are defined like: class
  NodeGraph extends CometActor.

  Thanks for your help,
  Peter

  [1]:http://groups.google.com/group/liftweb/msg/86d518b0c44b1b58?hl=en

  On Jul 28, 10:31 am, Spencer Uresk sur...@gmail.com wrote:

   I'm not sure about how much overhead Jetty adds to the mix (I'd assume it
   would be small, but I could be wrong), but on my production server, a 
   small
   Lift app added only 30 - 40 mb or so to the memory usage of my Tomcat
   instance. Based on my experience with running Java and Groovy based
   applications on a VPS, a 256 mb slice should be plenty unless you have 
   lots
   of concurrent sessions and/or big sessions. If people are having a 
   different
   experience with Lift-based apps, I'd be interested in hearing that (and
   why).

   Peter, Have you tried running jmap on your box to generate a heap dump and
   then analyzing that to see what is using up all the memory? Using 
   something
   like MAT (www.eclipse.org/mat/) makes it pretty easy to see what the 
   likely
   culprits are, and then you can go from there.

   - Spencer

   On Tue, Jul 28, 2009 at 3:55 AM, Timothy Perrett 
   timo...@getintheloop.euwrote:

Agreed; its pretty light to run all those services. I have a lift based 
app
that's been running for quite some time and its using around 250mb of 
RAM
on
average. A raw lift app will probably use 128mb RAM as minimum.

Cheers, Tim

On 28/07/2009 10:08, marius d. marius.dan...@gmail.com wrote:
 BTW 256mb seems to me ridiculous small for a server side application.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: erro: MappedDouble is not mapped to 'double precision' datatype in PostgreSQL?

2009-07-28 Thread Derek Chen-Becker
OK, I've pushed 1.0.1-SNAPSHOT to the repo with something that should fix
the PostgreSQL stuff. Can you update your POM to 1.0.1-SNAPSHOT and try it?

Thanks,

Derek

On Tue, Jul 28, 2009 at 11:40 AM, JanWillem Tulp
janwillem.t...@gmail.comwrote:


 Hi Derek,

 I am using liftweb version 1.0

 Thanks!



 On Jul 27, 10:27 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
  This looks like an issue with PostgreSQLDriver. The type should be
 DOUBLE
  PRECISION. What version of Lift are you using? Let me know and I'll put
 a
  fix in the proper place.
 
  Derek
 
  On Sun, Jul 26, 2009 at 5:59 AM, JanWillem Tulp 
 janwillem.t...@gmail.comwrote:
 
 
 
 
 
   Still looking to find a solution for this, or at least what causes
   this behavior. I am looking at the Liftweb source code, and see in the
   BaseMetaMapper trait a function called buildMapper that does some
   pattern matching on SQL column types (colType). Just for my
   understanding, why is there a match for almost any of the basic SQL
   types, but not for Types.DOUBLE?
 
   Has anyone else run into this problem?
 
   On Jul 26, 1:34 am, JanWillem Tulp janwillem.t...@gmail.com wrote:
Hi all,
 
I'm not sure that I am missing something here, but the Schemifier
cannot create a table for a model class that contains an object that
extends from MappedDouble.
 
This is the Lift code:
 
class MeasureValue extends LongKeyedMapper[MeasureValue] with IdPK {
  def getSingleton = MeasureValue
 
  object value extends MappedDouble(this)
  object measure extends MappedLongForeignKey(this, Measure)
 
}
 
object MeasureValue extends MeasureValue with LongKeyedMetaMapper
[MeasureValue]
 
I added MeasureValue to the Schemifier so that it will create a table
when boot is executed. However, this is the stacktrace I get when I
start the application:
 
main INFO  lift - CREATE TABLE measurevalue (measure BIGINT , value
DOUBLE , id BIGSERIAL)
main ERROR lift - Failed to Boot
org.postgresql.util.PSQLException: ERROR: type double does not
 exist
at
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse
(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults
(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute
(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute
(AbstractJdbc2Statement.java:451)
at
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags
(AbstractJdbc2Statement.java:336)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute
(AbstractJdbc2Statement.java:328)
at
 net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$
$maybeWrite(Schemifier.scala:150)
at
 net.liftweb.mapper.Schemifier$.net$liftweb$mapper$Schemifier$
$ensureTable(Schemifier.scala:160)
at
   net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$1.apply
(Schemifier.scala:60)
at
   net.liftweb.mapper.Schemifier$$anonfun$schemify$1$$anonfun$1.apply
(Schemifier.scala:60)
at scala.List.foldLeft(List.scala:1066)
at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply
(Schemifier.scala:60)
at net.liftweb.mapper.Schemifier$$anonfun$schemify$1.apply
(Schemifier.scala:54)
at net.liftweb.mapper.DB$.use(DB.scala:305)
at
 net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:53)
at
 net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:36)
at bootstrap.liftweb.Boot.boot(Boot.scala:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply
(ClassHelpers.scala:392)
at
 net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply
(ClassHelpers.scala:390)
at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply
(LiftRules.scala:909)
at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply
(LiftRules.scala:909)
at net.liftweb.util.Full.map(Box.scala:330)
at
 net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:909)
at
 net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:573)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:548)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter
(ApplicationFilterConfig.java:275)
at
 org.apache.catalina.core.ApplicationFilterConfig.setFilterDef
(ApplicationFilterConfig.java:397)
at 

[Lift] Re: Mapper and Primary Keys

2009-07-28 Thread Derek Chen-Becker
Did you override the dirty_? def?

Derek

On Tue, Jul 28, 2009 at 3:09 PM, Peter Robinett pe...@bubblefoundry.comwrote:


 Sorry to bump this, but does anyone have any idea why my mac column is
 not being saved to the database, despite the save method returning
 true?

 On Jul 22, 9:19 am, Peter Robinett pe...@bubblefoundry.com wrote:
  Because it's unique across systems and maps directly to hardware I'm
  tracking. But thanks for the equations!
 
  Peter
 
  On Jul 21, 7:20 pm, jon jonhoff...@gmail.com wrote:
 
   This doesn't address your question, so I'll apologize in advance, but
   why do you want to use a mac address as a primary key?   Also, a mac
   address represents six bytes, why not pack into a long?  This probably
   isn't the most efficient or prettiest way:
 
 def macToLong(mac: String) = java.lang.Long.parseLong(mac.replace
   (:,),16)
 
 def longToMac(mac: Long) = (0 to 5).reverse.map( i = (mac  ((0xff)
(i * 8).asInstanceOf[Long]))  (i * 8)).
   map( l = String.format(%02x,l.asInstanceOf[Object])).mkString
   (:)
 
 println( longToMac(macToLong(00:1d:c9:00:04:9f)))
 
   On Jul 21, 4:19 pm, Peter Robinett pe...@bubblefoundry.com wrote:
 
I should add that I believe this is because the field isn't being
marked as dirty and so isn't saved. This is in MappedField:
def dirty_? = !dbPrimaryKey_?  _dirty_?
 
How would I overload it in my object mac definition?
 
Thanks,
Peter
 
On Jul 21, 12:30 pm, Peter Robinett pe...@bubblefoundry.com wrote:
 
 Thanks Derek, but unfortunately it only works halfway: I am able to
 set MAC address of my new Node and save it (returning true) and my
 MySQL database row is created, but the mac column is null.
 
 Peter
 
 On Jul 21, 7:58 am, Derek Chen-Becker dchenbec...@gmail.com
 wrote:
 
  I think that this should work, but I haven't tested it:
 
  class Node extends KeyedMapper[String, Node] {
   def getSingleton = Node
   /* MAC address as primary key */
   def primaryKeyField = mac
   object mac extends MappedStringIndex(this, 17) {
  override def writePermission_? = true
  override def dbDisplay_? = true
   }
 
  }
 
  Note that primaryKey_? is already set to true in
 MappedStringIndex.
  writePermission_? is set to false by default...
 
  Derek
 
  On Mon, Jul 20, 2009 at 7:30 PM, Peter Robinett 
 pe...@bubblefoundry.comwrote:
 
   Hi all,
 
   I'm using Mapper with MAC addresses as my primary keys:
   class Node extends KeyedMapper[String, Node] {
def getSingleton = Node
/* MAC address as primary key */
def primaryKeyField = mac
object mac extends MappedStringIndex(this, 17) {
   override def dbPrimaryKey_? = true
   override def dbDisplay_? = true
}
   }
 
   Unfortunately, if I try to create a new Node and assign a MAC
 address,
   I get an error saying that I don't have permission:
   scala Node.create.mac(00:1d:c9:00:04:9f)
   java.lang.Exception: Do not have permissions to set this field
  at
 net.liftweb.mapper.MappedField$class.set(MappedField.scala:425)
  at
 net.liftweb.mapper.MappedString.set(MappedString.scala:38)
  at
 net.liftweb.mapper.MappedString$$anonfun$apply$6.apply
   (MappedString.scala:121)
  at
 net.liftweb.mapper.MappedString$$anonfun$apply$6.apply
   (MappedString.scala:121)
  at net.liftweb.util.Full.f...
 
   How do I go about creating a new Node with the mac address –
 the
   primary key – of my choosing?
 
   Thanks,
   Peter Robinett
 


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



[Lift] Re: Modularization of Lift code

2009-07-28 Thread stephen goldbaum

Classpath management is one of OSGi's features.  Another is dynamic
service registry and dependency management.  So following that route,
the Lift framework would define an interface that exposes much of what
is currently found in Boot.  Modules (OSGi bundles) would create
implementations of that interface and register them during startup
(fortunately the details are usually handled automatically).  Lift
would also define a manager class that listens to the registry and
does whatever bookkeeping is required when modules come and go.
Eclipse RCP is a great example of this in action.  Note that defining
a framework on top OSGi can also be a slippery slope.  RCP is a good
example of that as well; it's an extensive framework on top of OSGi.
So, the question is whether it's worth turning what is currently a
straightforward boot process into something that is more modular
though more complicated.  If so, a good first step would be to define
that manager class and interface since these could be wired together
by any means (Scala, OSGi, Spring, etc.) without necessarily branching
too far.  I can take a look if you all think it's worth it (and if
Heiko hasn't already).

-Stephen

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



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread Peter Robinett

Yep, that's what I figured. I should add the memory usage seems to
have stabilized at approximately 55% of all memory. Looking at the
logs I see that starting about an hour and a half from launch lots of
sessions regularly expire. I assume a session is being created per
POST and then expires some time later. Since all the POSTs are coming
from the same source, is it possible to make more efficient use of
sessions (ie have fewer of them)? Do I need to change something in the
source (I have control over it) or in the Lift app?

Thanks,
Peter

On Jul 28, 3:28 pm, Ross Mellgren dri...@gmail.com wrote:
 If it's a left-to-right sawtooth (e.g. increasing linearly over time  
 and then sharply dropping) then that's probably garbage accumulating  
 then the GC running.

 -Ross

 On Jul 28, 2009, at 6:23 PM, Peter Robinett wrote:



  Nope, haven't touched any of the files. As for the increases, they do
  not appear to, since requests happen approximately every second and
  the length of each spike is around one minute.

  Peter

  On Jul 28, 3:16 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
  It would redeploy if you were using mvn jetty:run and you changed  
  files in the webapp.
  Do the increases correspond to (specific) requests?

  -

  Peter Robinettpe...@bubblefoundry.com wrote:

  Thanks, Naftoli. After running for an hour the app is using 45-60% of
  my (very little) memory. It appears that memory is being used in a
  sawtooth pattern, with the baseline gradually creeping upwards.[1] I
  don't see any mention in the logs of any redeployments.

  Peter

  [1]:http://www.bubblefoundry.com/lift/jconsole-overview.jpg

  On Jul 28, 2:15 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:

  You can monitor it with jconsole.
  Is the memory building up gradually and not being garbage  
  collected? Is it being redeployed without restarting jetty?

  -

  Peter Robinettpe...@bubblefoundry.com wrote:

  Thanks all for the comments and suggestions. I'm totally new to the
  Java world, so thanks for mentioning all these various options.

  First, my system: MySQL is the database I'm using with my Lift app
  (and some other very low traffic apps) and is tuned pretty
  aggressively to use little memory. It seems to only use tens of
  megabytes. My Lift app is based upon 1.1-SNAPSHOT and archetype  
  lift-
  archetype-basic.

  Second, JVM options and analysis: how should I pass options to the  
  JVM
  when launching jetty and Lift with 'mvn jetty:run'? What heap size
  should I use? How do I monitor a JVM process? My actors being  
  notified
  of the REST POSTs are scala.actors, as I understood them to be
  sufficient[1]: class NodeActor extends Actor with ListenerManager.  
  The
  CometActors that listen to the NodeActors are defined like: class
  NodeGraph extends CometActor.

  Thanks for your help,
  Peter

  [1]:http://groups.google.com/group/liftweb/msg/86d518b0c44b1b58?
  hl=en

  On Jul 28, 10:31 am, Spencer Uresk sur...@gmail.com wrote:

  I'm not sure about how much overhead Jetty adds to the mix (I'd  
  assume it
  would be small, but I could be wrong), but on my production  
  server, a small
  Lift app added only 30 - 40 mb or so to the memory usage of my  
  Tomcat
  instance. Based on my experience with running Java and Groovy based
  applications on a VPS, a 256 mb slice should be plenty unless you  
  have lots
  of concurrent sessions and/or big sessions. If people are having  
  a different
  experience with Lift-based apps, I'd be interested in hearing  
  that (and
  why).

  Peter, Have you tried running jmap on your box to generate a heap  
  dump and
  then analyzing that to see what is using up all the memory? Using  
  something
  like MAT (www.eclipse.org/mat/) makes it pretty easy to see what  
  the likely
  culprits are, and then you can go from there.

  - Spencer

  On Tue, Jul 28, 2009 at 3:55 AM, Timothy Perrett  
  timo...@getintheloop.euwrote:

  Agreed; its pretty light to run all those services. I have a  
  lift based app
  that's been running for quite some time and its using around  
  250mb of RAM
  on
  average. A raw lift app will probably use 128mb RAM as minimum.

  Cheers, Tim

  On 28/07/2009 10:08, marius d. marius.dan...@gmail.com wrote:
  BTW 256mb seems to me ridiculous small for a server side  
  application.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Stamped Trait question

2009-07-28 Thread fbettag

So far it looks like this:


trait Stamped[OwnerType : Stamped[OwnerType] with LongKeyedMapper
[OwnerType] with IdPK] {
this: OwnerType =

private val thisTyped = this.asInstanceOf[MapperType]

override def afterSave {
createActionLog(create, this.getClass.toString, this.id)
}

def afterUpdate {
createActionLog(update, this.getClass.toString, this.id)
}

def beforeDelete {
createActionLog(delete, this.getClass.toString, this.id)
}


private def createActionLog(action: String, klass: String, obj: Long)
{
val log = new ActionLog
log.action(action).klass(klass).record(obj).save
}

}

Now i ensured that the OwnerType class has a LongKeyedMapper with
IdPK.

The final problem is:

afterSave is supposed to return a List(Any) meaning List(OwnerType)..
how can i find out what the OwnerType class is?
And what is it supposed to return? Simply the unmodified record in my
case?

best regards

On 27 Jul., 05:07, fbettag fr...@bett.ag wrote:
 Hey guys,

 i#ve gotten this together, to get a log of who's editing what. The
 trait will give you the idea:

 import java.util.Date
 import model._
 import net.liftweb.mapper._

 trait Stamped[OwnerType : Stamped[OwnerType]] extends LongKeyedMapper
 [OwnerType] with IdPK {
         this: OwnerType =

         private val thisTyped = this.asInstanceOf[MapperType]

         def afterSave {
                 createActionLog(create, this.getClass.toString, this.id)
         }

         def afterUpdate {
                 createActionLog(update, this.getClass.toString, this.id)
         }

         def beforeDelete {
                 createActionLog(delete, this.getClass.toString, this.id)
         }

         private def createActionLog(action: String, klass: String, obj: Long)
 {
                 val log = new ActionLog
                 log.action(action).klass(klass).record(obj).save
         }

 }

 On every action i create a log. It's better than having only createdAt/
 On which only idicates only the last change, but to have a history.

 My only problem is, the extends LongKeyedMapper is the only way to
 make it compile with this.id as last parameter of createActionLog().

 The question is, how can i find out if the supplied OwnerType Model is
 extended with LongKeyedMapper?

 Is it possible to supply some kinda subclass check on the supplied
 OwnerType.

 Btw, i forgot what : does (like in Stamped[OwnerType : Stamped
 [OwnerType]]).

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



[Lift] Re: Lift runtime stats snippet

2009-07-28 Thread David Pollak
This snippet is located in the sites/example code, not in Lift itself.  Look
for the RuntimeStats.scala file.

On Tue, Jul 28, 2009 at 3:47 PM, Ewan ehar...@gmail.com wrote:


 Just finally noticed the runtime stats on the demo site and have tried
 to include them in my own using the following tags which are copied
 from the example default template except the snippets don't exist in
 lift/src/main/scala/net/liftweb/builtin/snippet.

Stats: Total Memory: lift:runtime_stats:total_mem/
Free Memory: lift:runtime_stats:free_mem/
Open Sessions: lift:runtime_stats:sessions/
Updated At: lift:runtime_stats:updated_at/


 I am currently running Liftversion1.1-SNAPSHOT built on Mon Jul 27
 04:38:37 BST 2009

 Which dependency do I need to add to my POM to get this to work?

 -- Ewan

 



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

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



[Lift] Re: New features

2009-07-28 Thread David Pollak
THis is all very good stuff.  Thanks for contributing this excellent stuff
to Lift!

On Mon, Jul 27, 2009 at 12:57 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:


 I committed some code last night, which can help building mapper-based view
 snippets, with G-d's help. It includes the following classes:
 (1-2) net.liftweb.mapper.OneToMany, ManyToMany: Gives a more
 object-oriented approach to managing related entites. You can manage the
 many side of a 1-n and n-n as a mutable collection of children, and the
 parent of a child can be set directly, instead of via its id. And the
 children are not saved to the database when you add them until you call save
 on it or its parent, nor deleted when you remove tem until you call
 delete_!, which is very helpful when you need to keep track of adds/removes
 through multiple requests. For example, if you are displaying a list and you
 can click delete, but it shouldn't be permanently deleted until you click
 save.
 There is a new package, ...mapper.view, which contains a number of
 utilities for mapper-based views:
 (3-4) ModelView and ModelSnippet provide a number of building blocks for
 views that are too complex to CRUDify. Inherit ModelSnippet (which extends
 StatefulSnippet) and wrap your entities in ModelView (view is used in the
 sense of a wrapper).
 (5) Util provides some more building blocks that just be imported, without
 needing a ModelSnippet context.
 (6-7) Paginator makes it easy to create paginated, user sortable listings.
 You can use PaginatedSnippet instead of ModelSnippet to help.
 (8-10) ItemsList lets you manage a list of entities with pending additions
 and deletions. It's used by TableEditor, which is a very easy to use and
 customizable snippet to edit tables directly. It's useful for editing short
 lists, e.g., a lookup table like cities. Don't forget to register the table
 in Boot.
 (11) Then there's the experimental FormProcessor, if you need your form to
 be processed in one block instead of separate closures, e.g., to surround
 with try.
 (12) Also experimental is sitemap.XmlMenu which lets you write menus in
 xml.
 (13) I may add CaseEnum, which lets you write case classes that
 automatically double as an Enumeration.
 Questions, comments, suggestions, and constructive criticism are more than
 welcome!
 Thanks.


 



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

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



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread David Pollak
Peter,

I was running demo.liftweb.net with a heap size of 32MB.  I am using the
jetty_instance found in http://github.com/dpp/lift-samples/tree/master

32MB for the heap size is just fine except every once in a while, we get
2,000 new sessions opened up and that pushed the heap past the 32MB level,
so I'm currently running with a max 128MB heap.

On Tue, Jul 28, 2009 at 4:36 PM, Peter Robinett pe...@bubblefoundry.comwrote:


 Yep, that's what I figured. I should add the memory usage seems to
 have stabilized at approximately 55% of all memory. Looking at the
 logs I see that starting about an hour and a half from launch lots of
 sessions regularly expire. I assume a session is being created per
 POST and then expires some time later. Since all the POSTs are coming
 from the same source, is it possible to make more efficient use of
 sessions (ie have fewer of them)? Do I need to change something in the
 source (I have control over it) or in the Lift app?


If the POSTs are going to a Custom Dispatch (DispatchPF), you can change the
code to be a stateless (LiftRules.statelessDispatchTable instead of
LiftRules.dispatch)  No session will be generated as part of handling the
request.

Thanks,

David




 Thanks,
 Peter

 On Jul 28, 3:28 pm, Ross Mellgren dri...@gmail.com wrote:
  If it's a left-to-right sawtooth (e.g. increasing linearly over time
  and then sharply dropping) then that's probably garbage accumulating
  then the GC running.
 
  -Ross
 
  On Jul 28, 2009, at 6:23 PM, Peter Robinett wrote:
 
 
 
   Nope, haven't touched any of the files. As for the increases, they do
   not appear to, since requests happen approximately every second and
   the length of each spike is around one minute.
 
   Peter
 
   On Jul 28, 3:16 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   It would redeploy if you were using mvn jetty:run and you changed
   files in the webapp.
   Do the increases correspond to (specific) requests?
 
   -
 
   Peter Robinettpe...@bubblefoundry.com wrote:
 
   Thanks, Naftoli. After running for an hour the app is using 45-60% of
   my (very little) memory. It appears that memory is being used in a
   sawtooth pattern, with the baseline gradually creeping upwards.[1] I
   don't see any mention in the logs of any redeployments.
 
   Peter
 
   [1]:http://www.bubblefoundry.com/lift/jconsole-overview.jpg
 
   On Jul 28, 2:15 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 
   You can monitor it with jconsole.
   Is the memory building up gradually and not being garbage
   collected? Is it being redeployed without restarting jetty?
 
   -
 
   Peter Robinettpe...@bubblefoundry.com wrote:
 
   Thanks all for the comments and suggestions. I'm totally new to the
   Java world, so thanks for mentioning all these various options.
 
   First, my system: MySQL is the database I'm using with my Lift app
   (and some other very low traffic apps) and is tuned pretty
   aggressively to use little memory. It seems to only use tens of
   megabytes. My Lift app is based upon 1.1-SNAPSHOT and archetype
   lift-
   archetype-basic.
 
   Second, JVM options and analysis: how should I pass options to the
   JVM
   when launching jetty and Lift with 'mvn jetty:run'? What heap size
   should I use? How do I monitor a JVM process? My actors being
   notified
   of the REST POSTs are scala.actors, as I understood them to be
   sufficient[1]: class NodeActor extends Actor with ListenerManager.
   The
   CometActors that listen to the NodeActors are defined like: class
   NodeGraph extends CometActor.
 
   Thanks for your help,
   Peter
 
   [1]:http://groups.google.com/group/liftweb/msg/86d518b0c44b1b58?
   hl=en
 
   On Jul 28, 10:31 am, Spencer Uresk sur...@gmail.com wrote:
 
   I'm not sure about how much overhead Jetty adds to the mix (I'd
   assume it
   would be small, but I could be wrong), but on my production
   server, a small
   Lift app added only 30 - 40 mb or so to the memory usage of my
   Tomcat
   instance. Based on my experience with running Java and Groovy based
   applications on a VPS, a 256 mb slice should be plenty unless you
   have lots
   of concurrent sessions and/or big sessions. If people are having
   a different
   experience with Lift-based apps, I'd be interested in hearing
   that (and
   why).
 
   Peter, Have you tried running jmap on your box to generate a heap
   dump and
   then analyzing that to see what is using up all the memory? Using
   something
   like MAT (www.eclipse.org/mat/) makes it pretty easy to see what
   the likely
   culprits are, and then you can go from there.
 
   - Spencer
 
   On Tue, Jul 28, 2009 at 3:55 AM, Timothy Perrett
   timo...@getintheloop.euwrote:
 
   Agreed; its pretty light to run all those services. I have a
   lift based app
   that's been running for quite some time and its using around
   250mb of RAM
   on
   average. A raw lift app will probably use 128mb 

[Lift] Re: Automatic background AJAX: best way to do it?

2009-07-28 Thread David Pollak
I'd do the REST API thing.  The mechanisms that Lift has for handling API
calls from the browser are numerous, but they are associated with a session
(you can do ajaxCall or a S.buildJsonFunc).  If your client is going to be
disconnected, periodically wake up, make an HTTP call on your app and then
go back to sleep, the best thing to use is a statelessDispatch and some
authentication mechanism as part of the call (truly RESTful and stateless).

Also, there's very little that's non Liftish.  Lift is about allowing you
to focus on the business logic at hand, but sometimes the business logic is
update this and REST is good for update this.

On Tue, Jul 28, 2009 at 10:57 AM, Nolan Darilek no...@thewordnerd.infowrote:


 I have a project that will use the geolocation API in Firefox 3.5,
 Google Gears and other JS frameworks. It will need to keep the user's
 position updated using the watchPosition API, fetching nearby POIs and
 such whenever the position changes.

 I'm actually fairly new to AJAX, and am trying to figure out the best
 way to do this. Most of the AJAX examples I've seen involve user
 interaction, such as entering into a text field than removing focus, or
 waiting on state updates, as with comet. In this case, there's state
 that may update often or never, and those updates will be triggered by a
 callback function in the background, with no user interaction into which
 I can hook. I also don't want to leave a Comet connection open to the
 app waiting on updates, since the app may see mobile use, and I can't
 imagine holding open a connection being great for battery life.

 I'm wondering what the best way to do this would be, while staying
 fairly close to what Lift offers? Thus far I have two options.

 1. Create a REST API and have the Javascript call a specified URL
 whenever the position changes, inserting the resulting JSON into the
 page at appropriate places. This works, but seems like it'd involve lots
 of extra effort, as well as straying away from Lift/Scala's added
 benefits into the dynamicity of JS, which I'm not entirely comfortable
 with.

 2. Create a hidden JSON form on the page. When the position changes, the
 JS callback function fills out and submits the form in the background.
 This seems a bit hackish, with the hidden form and all, but this makes
 the problem one that is on a bit less shaky Lift ground. I can then use
 Lift's provided functionality to generate JS for replacing page contents
 with the results of evaluating the form submission.

 I'm basically going from the Lift book here. Most ideal, I'd think,
 would be if there was some way to have my callback function call a
 snippet directly and be handed back the JS needed, without having to
 create a separate web service API for this one call. Is the JSON form
 method the best option here? Or is there some new shiny in 1.1 that
 isn't documented in the Lift book yet? (or perhaps it *is* documented
 and I'm just missing it. :)

 Thanks.



 --
 Nolan Darilek
 http://thewordnerd.info


 



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

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



[Lift] Re: Minimizing Memory Usage

2009-07-28 Thread Naftoli Gugenheim

You might get a clearer picture of memory usage by calling System.gc after each 
request, so you can see if there is a memory leak somewhere.

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

Peter,

I was running demo.liftweb.net with a heap size of 32MB.  I am using the
jetty_instance found in http://github.com/dpp/lift-samples/tree/master

32MB for the heap size is just fine except every once in a while, we get
2,000 new sessions opened up and that pushed the heap past the 32MB level,
so I'm currently running with a max 128MB heap.

On Tue, Jul 28, 2009 at 4:36 PM, Peter Robinett pe...@bubblefoundry.comwrote:


 Yep, that's what I figured. I should add the memory usage seems to
 have stabilized at approximately 55% of all memory. Looking at the
 logs I see that starting about an hour and a half from launch lots of
 sessions regularly expire. I assume a session is being created per
 POST and then expires some time later. Since all the POSTs are coming
 from the same source, is it possible to make more efficient use of
 sessions (ie have fewer of them)? Do I need to change something in the
 source (I have control over it) or in the Lift app?


If the POSTs are going to a Custom Dispatch (DispatchPF), you can change the
code to be a stateless (LiftRules.statelessDispatchTable instead of
LiftRules.dispatch)  No session will be generated as part of handling the
request.

Thanks,

David




 Thanks,
 Peter

 On Jul 28, 3:28 pm, Ross Mellgren dri...@gmail.com wrote:
  If it's a left-to-right sawtooth (e.g. increasing linearly over time
  and then sharply dropping) then that's probably garbage accumulating
  then the GC running.
 
  -Ross
 
  On Jul 28, 2009, at 6:23 PM, Peter Robinett wrote:
 
 
 
   Nope, haven't touched any of the files. As for the increases, they do
   not appear to, since requests happen approximately every second and
   the length of each spike is around one minute.
 
   Peter
 
   On Jul 28, 3:16 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   It would redeploy if you were using mvn jetty:run and you changed
   files in the webapp.
   Do the increases correspond to (specific) requests?
 
   -
 
   Peter Robinettpe...@bubblefoundry.com wrote:
 
   Thanks, Naftoli. After running for an hour the app is using 45-60% of
   my (very little) memory. It appears that memory is being used in a
   sawtooth pattern, with the baseline gradually creeping upwards.[1] I
   don't see any mention in the logs of any redeployments.
 
   Peter
 
   [1]:http://www.bubblefoundry.com/lift/jconsole-overview.jpg
 
   On Jul 28, 2:15 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 
   You can monitor it with jconsole.
   Is the memory building up gradually and not being garbage
   collected? Is it being redeployed without restarting jetty?
 
   -
 
   Peter Robinettpe...@bubblefoundry.com wrote:
 
   Thanks all for the comments and suggestions. I'm totally new to the
   Java world, so thanks for mentioning all these various options.
 
   First, my system: MySQL is the database I'm using with my Lift app
   (and some other very low traffic apps) and is tuned pretty
   aggressively to use little memory. It seems to only use tens of
   megabytes. My Lift app is based upon 1.1-SNAPSHOT and archetype
   lift-
   archetype-basic.
 
   Second, JVM options and analysis: how should I pass options to the
   JVM
   when launching jetty and Lift with 'mvn jetty:run'? What heap size
   should I use? How do I monitor a JVM process? My actors being
   notified
   of the REST POSTs are scala.actors, as I understood them to be
   sufficient[1]: class NodeActor extends Actor with ListenerManager.
   The
   CometActors that listen to the NodeActors are defined like: class
   NodeGraph extends CometActor.
 
   Thanks for your help,
   Peter
 
   [1]:http://groups.google.com/group/liftweb/msg/86d518b0c44b1b58?
   hl=en
 
   On Jul 28, 10:31 am, Spencer Uresk sur...@gmail.com wrote:
 
   I'm not sure about how much overhead Jetty adds to the mix (I'd
   assume it
   would be small, but I could be wrong), but on my production
   server, a small
   Lift app added only 30 - 40 mb or so to the memory usage of my
   Tomcat
   instance. Based on my experience with running Java and Groovy based
   applications on a VPS, a 256 mb slice should be plenty unless you
   have lots
   of concurrent sessions and/or big sessions. If people are having
   a different
   experience with Lift-based apps, I'd be interested in hearing
   that (and
   why).
 
   Peter, Have you tried running jmap on your box to generate a heap
   dump and
   then analyzing that to see what is using up all the memory? Using
   something
   like MAT (www.eclipse.org/mat/) makes it pretty easy to see what
   the likely
   culprits are, and then you can go from there.
 
   - Spencer
 
   On Tue, Jul 28, 2009 at 3:55 AM, Timothy Perrett
   

[Lift] Re: Lift runtime stats snippet

2009-07-28 Thread DFectuoso

Funny thing to display in a website

Mixing that with the runmode and displaying a div with that
information could be useful for development(im doing this with twitter
api request limit status, i will add it there =) )


On Jul 28, 5:18 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 This snippet is located in the sites/example code, not in Lift itself.  Look
 for the RuntimeStats.scala file.



 On Tue, Jul 28, 2009 at 3:47 PM, Ewan ehar...@gmail.com wrote:

  Just finally noticed the runtime stats on the demo site and have tried
  to include them in my own using the following tags which are copied
  from the example default template except the snippets don't exist in
  lift/src/main/scala/net/liftweb/builtin/snippet.

             Stats: Total Memory: lift:runtime_stats:total_mem/
         Free Memory: lift:runtime_stats:free_mem/
         Open Sessions: lift:runtime_stats:sessions/
         Updated At: lift:runtime_stats:updated_at/

  I am currently running Liftversion1.1-SNAPSHOT built on Mon Jul 27
  04:38:37 BST 2009

  Which dependency do I need to add to my POM to get this to work?

  -- Ewan

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---