[Lift] Working with database views

2009-11-08 Thread GA

Hello guys,

I need to create a database view to create a very specific query from  
an API. I am planning the following steps:

1. Create the view in the database directly
2. Create a model without a primary key extending Mapper instead of  
Keymapper
3. I am not going to add the view to Schemifier since I am managing  
the creation and maintenance of the object manually

My problem is that I am having problems to compile the Mapper class.  
This is the code I am trying to create:

class SyncVW extends Mapper[SyncVW] {
 def getSingleton = SyncVW

 object field1 extends MappedLong(this, ContentSource)
 object field2 extends MappedString(this, 999)
 object field3 extends MappedString(this,255)
 object field4 extends MappedString(this,30)
}
object SyncVW extends SyncVW with Mapper[SyncVW]


The compilation error is in the def getSingleton line. The compiler  
is expecting a Mapper[SyncVW] object and it is receiving SyncVW. What  
am I doing wrong?

Thanks,

GA


--~--~-~--~~~---~--~~
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] CometActor and render

2009-11-08 Thread jack

I have a CometActor. render is called when it is supposed to be but I
don't see the changes. If I refresh the page at anytime, I do see the
changes. Any idea what might cause this?
--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-08 Thread jack

By the way, I know that when render is called, all the variables have
the right values. I just don't see it on the screen unless I refresh
it.

On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
 I have a CometActor. render is called when it is supposed to be but I
 don't see the changes. If I refresh the page at anytime, I do see the
 changes. Any idea what might cause this?
--~--~-~--~~~---~--~~
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: A little emacs help please

2009-11-08 Thread Marius

You guys are right. Thank you very much. Fixed.

Br's,
Marius

On Nov 8, 1:11 am, Derek Williams de...@nebvin.ca wrote:
 On Sat, Nov 7, 2009 at 3:29 PM, Marius marius.dan...@gmail.com wrote:
   (add-hook 'scala-mode-hook
             '(lambda ()
                (yas/minor-mode-on)

 Not sure if this is just an incomplete copy/paste, but looks like you are
 missing some closing parenthesis there

 --
 Derek Williams
--~--~-~--~~~---~--~~
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: Select multiple values

2009-11-08 Thread suls

Allright. This code does the trick:

bind(e, xhtml,
name - text(, name = _),
availableManagers- SHtml.multiSelect(
  User.findAvailableManagers.map(v =
(v.id.toString, v.email)),
  Nil,
  _.foreach { id = loadManager(id)},
  multiple - multiple,
  title - Click to assign managers to this
fund),
submit - SHtml.submit( Submit Form /*button name*/,
  processForm /*function to call*/))

So what did I change? SHtml.selectObj[User] to SHtml.multiSelect and
also the function executed after submit since a List[String] is now
passed to it.

Any comments?

On Nov 8, 3:05 am, suls s...@suls.org wrote:
 Hi,

 How can I access all the selected values from aselectbox? I am using
 the following code to generate theselectbox itself:

 availableManagers- SHtml.selectObj[User](
                       User.findAvailableManagers.map(v = (v,
 v.email)),
                       Empty,
                       selected = Log.info(selected),
                       multiple - multiple,
                       title - Click to assign managers to this
 fund)

 Is it possible to iterate over all selected options in the  selected
 =  bit?
 Any pointers how to solve this using different ways?

 Cheers, suls

--~--~-~--~~~---~--~~
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] MegaProtoUser + MappedPassword question

2009-11-08 Thread george

I'm using MegaProtoUser which has a MappedPassword field.

When the sign up form is displayed, the password field is pre-
populated to '***' which is proving very confusing for some users.

I would like to display the password field as a completely empty
field, but I can not see a way to override this behavior.

MegaProtoUser is mostly suiting my needs pretty well right now, so I
am reluctant to roll my own for the sake of such a small detail.

Does anyone have any ideas how I can achieve this?

thanks

george
--~--~-~--~~~---~--~~
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] MegaProtoUser + MappedPassword question

2009-11-08 Thread george

I'm using MegaProtoUser which has a MappedPassword field.

When the sign up form is displayed, the password field is pre-
populated to '***' which is proving very confusing for some users.

I would like to display the password field as a completely empty
field, but I can not see a way to override this behavior.

MegaProtoUser is mostly suiting my needs pretty well right now, so I
am reluctant to roll my own for the sake of such a small detail.

Does anyone have any ideas how I can achieve this?

thanks

george
--~--~-~--~~~---~--~~
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: Working with database views

2009-11-08 Thread GA

Yes, it just did the trick. It compiles now.

Why is it working now? Isn't it Mapper also a MetaMapper?


On Nov 8, 2009, at 12:27 PM, Jeppe Nejsum Madsen wrote:


 GA my_li...@me.com writes:

 Hello guys,

 I need to create a database view to create a very specific query from
 an API. I am planning the following steps:

 1. Create the view in the database directly
 2. Create a model without a primary key extending Mapper instead of
 Keymapper
 3. I am not going to add the view to Schemifier since I am managing
 the creation and maintenance of the object manually

 My problem is that I am having problems to compile the Mapper class.
 This is the code I am trying to create:

 class SyncVW extends Mapper[SyncVW] {
 def getSingleton = SyncVW

 object field1 extends MappedLong(this, ContentSource)
 object field2 extends MappedString(this, 999)
 object field3 extends MappedString(this,255)
 object field4 extends MappedString(this,30)
 }
 object SyncVW extends SyncVW with Mapper[SyncVW]

 I think this last line should read

 object SyncVW extends SyncVW with MetaMapper[SyncVW]

 /Jeppe

 


--~--~-~--~~~---~--~~
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: A little emacs help please

2009-11-08 Thread Marius

Do you guys know how to select text just with keyboard in emacs?
Something similar with  SHIFT + down-arrow etc.

Br's,
Marius

On Nov 8, 10:40 am, Marius marius.dan...@gmail.com wrote:
 You guys are right. Thank you very much. Fixed.

 Br's,
 Marius

 On Nov 8, 1:11 am, Derek Williams de...@nebvin.ca wrote:

  On Sat, Nov 7, 2009 at 3:29 PM, Marius marius.dan...@gmail.com wrote:
(add-hook 'scala-mode-hook
          '(lambda ()
             (yas/minor-mode-on)

  Not sure if this is just an incomplete copy/paste, but looks like you are
  missing some closing parenthesis there

  --
  Derek Williams
--~--~-~--~~~---~--~~
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: A little emacs help please

2009-11-08 Thread Ross Mellgren

Set transient mark mode (from options menu), then M-SPC (ESC then  
space, or alt+space) to set mark and move around with cursor. Then M-w  
(ESC then w, or alt+w) to copy region, C-w (ctrl+w) to kill (cut)  
region.

-Ross

On Nov 8, 2009, at 10:08 AM, Marius wrote:


 Do you guys know how to select text just with keyboard in emacs?
 Something similar with  SHIFT + down-arrow etc.

 Br's,
 Marius

 On Nov 8, 10:40 am, Marius marius.dan...@gmail.com wrote:
 You guys are right. Thank you very much. Fixed.

 Br's,
 Marius

 On Nov 8, 1:11 am, Derek Williams de...@nebvin.ca wrote:

 On Sat, Nov 7, 2009 at 3:29 PM, Marius marius.dan...@gmail.com  
 wrote:
 (add-hook 'scala-mode-hook
   '(lambda ()
  (yas/minor-mode-on)

 Not sure if this is just an incomplete copy/paste, but looks like  
 you are
 missing some closing parenthesis there

 --
 Derek Williams
 


--~--~-~--~~~---~--~~
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: A little emacs help please

2009-11-08 Thread Ross Mellgren

Acckkk whoops I said M-SPC, I meant C-SPC (ctrl+space) to set mark. M- 
SPC is reduce all surrounding whitespace to one space.

-Ross

On Nov 8, 2009, at 10:08 AM, Marius wrote:


 Do you guys know how to select text just with keyboard in emacs?
 Something similar with  SHIFT + down-arrow etc.

 Br's,
 Marius

 On Nov 8, 10:40 am, Marius marius.dan...@gmail.com wrote:
 You guys are right. Thank you very much. Fixed.

 Br's,
 Marius

 On Nov 8, 1:11 am, Derek Williams de...@nebvin.ca wrote:

 On Sat, Nov 7, 2009 at 3:29 PM, Marius marius.dan...@gmail.com  
 wrote:
 (add-hook 'scala-mode-hook
   '(lambda ()
  (yas/minor-mode-on)

 Not sure if this is just an incomplete copy/paste, but looks like  
 you are
 missing some closing parenthesis there

 --
 Derek Williams
 


--~--~-~--~~~---~--~~
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: A little emacs help please

2009-11-08 Thread Marius

Thanks a lot ! ... I just ran into C-SPC :)

Br's,
Marius

On Nov 8, 5:11 pm, Ross Mellgren dri...@gmail.com wrote:
 Acckkk whoops I said M-SPC, I meant C-SPC (ctrl+space) to set mark. M-
 SPC is reduce all surrounding whitespace to one space.

 -Ross

 On Nov 8, 2009, at 10:08 AM, Marius wrote:



  Do you guys know how to select text just with keyboard in emacs?
  Something similar with  SHIFT + down-arrow etc.

  Br's,
  Marius

  On Nov 8, 10:40 am, Marius marius.dan...@gmail.com wrote:
  You guys are right. Thank you very much. Fixed.

  Br's,
  Marius

  On Nov 8, 1:11 am, Derek Williams de...@nebvin.ca wrote:

  On Sat, Nov 7, 2009 at 3:29 PM, Marius marius.dan...@gmail.com  
  wrote:
  (add-hook 'scala-mode-hook
            '(lambda ()
               (yas/minor-mode-on)

  Not sure if this is just an incomplete copy/paste, but looks like  
  you are
  missing some closing parenthesis there

  --
  Derek Williams
--~--~-~--~~~---~--~~
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] Novell Pulse, front end by Lift

2009-11-08 Thread David Pollak
Folks,

Last week, Novell announced their new groupware product, Pulse:
http://www.novell.com/products/pulse/

Pulse's UI was built with Lift.  If you have time to watch the demo, it's
very impressive... quite frankly, I was blown away... I didn't think web
browsers could do that, Lift or no.

So, congrats to the Pulse team and congrats to the Lift community for giving
feedback that made Lift a platform that could build such an app and congrats
to the Lift committers to listening to community feedback and building the
Lift platform.

Thanks,

David

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: Build Broken?

2009-11-08 Thread aw

Build is working now.  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: Novell Pulse, front end by Lift

2009-11-08 Thread Timothy Perrett

Kudos everyone - the fact that organisations are building saleable  
products on Lift is a testament to the quality of the platform so  
early on in its life; as a team we should take real pride in this :-)

Cheers, Tim


On 8 Nov 2009, at 18:06, David Pollak wrote:

 Folks,

 Last week, Novell announced their new groupware product, Pulse: 
 http://www.novell.com/products/pulse/

 Pulse's UI was built with Lift.  If you have time to watch the demo,  
 it's very impressive... quite frankly, I was blown away... I didn't  
 think web browsers could do that, Lift or no.

 So, congrats to the Pulse team and congrats to the Lift community  
 for giving feedback that made Lift a platform that could build such  
 an app and congrats to the Lift committers to listening to community  
 feedback and building the Lift platform.

 Thanks,

 David

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

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: CometActor and render

2009-11-08 Thread Jack Widman
Sorry. Here it is:   As I said, I know that when render is called,
foo.getValue has the right value. But it does not show on the screen, unless
I refresh the browser.

package com.foo.comet

import net.liftweb._
import http._
import js._
import JsCmds._
import net.liftweb.util._
import net.liftweb.http._
import _root_.scala.xml._
import scala.actors._
import com.authoritude.snippet._
import scala.collection.mutable.Queue
import net.liftweb.http.SessionVar


class MyComet extends CometActor {

  override def defaultPrefix = Full(auth)

  private var foos = FooManager.getFoos

  def createDisplay(foos:List[Foo]):NodeSeq = {
span id=gotable
{
  for {foo - foos} yield trtd{foo.getValue}/td/tr
}

/table/span
  }

  def render = { bind(foo - createDisplay(foos)) }

  override def localSetup = {
super.localSetup
this ! Tick
  }

  var foo:Foo = null
  override def lowPriority = {
case Tick = {
  foo=FooQueue.getLatest
  if (foo!=null  foo.getValue  -1) {
blogs = FooManager.process(foo, foos)
  } else if (foo!=null){
foos = foos.remove((f:Foo)=(f.id==foo.id))
  }
  reRender(false)
  this ! Tick
}
  }
}

case class Tick


On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but I
  don't see the changes. If I refresh the page at anytime, I do see the
  changes. Any idea what might cause this?
  
 

 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: CometActor and render

2009-11-08 Thread jack

One more thing. 'foo's get added to the FooQueue periodically.

On Nov 8, 6:47 pm, Jack Widman jack.wid...@gmail.com wrote:
 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar

 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
     span id=gotable
     {
       for {foo - foos} yield trtd{foo.getValue}/td/tr
     }

     /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
     super.localSetup
     this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
     case Tick = {
       foo=FooQueue.getLatest
       if (foo!=null  foo.getValue  -1) {
     blogs = FooManager.process(foo, foos)
       } else if (foo!=null){
     foos = foos.remove((f:Foo)=(f.id==foo.id))
       }
       reRender(false)
       this ! Tick
     }
   }

 }

 case class Tick

 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:





  Without posting your code it's going to be tough to help you.

  Cheers, Tim

  Sent from my iPhone

  On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

   By the way, I know that when render is called, all the variables have
   the right values. I just don't see it on the screen unless I refresh
   it.

   On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
   I have a CometActor. render is called when it is supposed to be but I
   don't see the changes. If I refresh the page at anytime, I do see the
   changes. Any idea what might cause this?

 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: Select multiple values

2009-11-08 Thread David Pollak
On Sun, Nov 8, 2009 at 1:32 AM, suls s...@suls.org wrote:


 Allright. This code does the trick:

 bind(e, xhtml,
name - text(, name = _),
availableManagers- SHtml.multiSelect(
  User.findAvailableManagers.map(v =
 (v.id.toString, v.email)),
  Nil,
  _.foreach { id = loadManager(id)},
   multiple - multiple,
  title - Click to assign managers to this
 fund),
submit - SHtml.submit( Submit Form /*button name*/,
  processForm /*function to call*/))

 So what did I change? SHtml.selectObj[User] to SHtml.multiSelect and
 also the function executed after submit since a List[String] is now
 passed to it.

 Any comments?


Congratulations on finding the right method!

Also, note how, especially in this case, type-safety is your friend and your
guide.



 On Nov 8, 3:05 am, suls s...@suls.org wrote:
  Hi,
 
  How can I access all the selected values from aselectbox? I am using
  the following code to generate theselectbox itself:
 
  availableManagers- SHtml.selectObj[User](
User.findAvailableManagers.map(v = (v,
  v.email)),
Empty,
selected = Log.info(selected),
multiple - multiple,
title - Click to assign managers to this
  fund)
 
  Is it possible to iterate over all selected options in the  selected
  =  bit?
  Any pointers how to solve this using different ways?
 
  Cheers, suls

 



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

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

2009-11-08 Thread Oliver Lambert
Hi

Over the last couple of days I have been getting the following error on Lift
1.0 using scala 2.7.3 when I try to deploy an application to a Glassfish (or
Tomcat) server (Jetty works ok)

: Exception starting filter LiftFilter
java.lang.IncompatibleClassChangeError: Class scala.List$$anon$1 does not
implement the requested interface scala.Seq$Projection
at net.liftweb.util.ListHelpers$class.first(ListHelpers.scala:50)
at net.liftweb.util.Helpers$.first(Helpers.scala:29)
at net.liftweb.util.Props$.init(Props.scala:151)
at net.liftweb.util.Props$.clinit(Props.scala)
at net.liftweb.util.LogBoot$.findTheFile$1(Log.scala:115)
at net.liftweb.util.LogBoot$._log4JSetup(Log.scala:118)
at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
at net.liftweb.util.LogBoot$.checkConfig(Log.scala:94)
at
net.liftweb.util.LogBoot$.net$liftweb$util$LogBoot$$_logger(Log.scala:140)
at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
at net.liftweb.http.LiftRules$.init(LiftRules.scala:559)
at net.liftweb.http.LiftRules$.clinit(LiftRules.scala)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:546)
...


I think the application was deploying OK earlier in the week. Any ideas???

cheers
Oliver

--~--~-~--~~~---~--~~
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: broken app

2009-11-08 Thread David Pollak
Oliver,

Looks like a mixed scala version issue.  Please look in your WAR file to
make sure there's only 1 Scala JAR and also make sure you app server does
not have a Scala library in the /lib directory.

Thanks,

David

On Sun, Nov 8, 2009 at 5:22 PM, Oliver Lambert olambo...@gmail.com wrote:

 Hi

 Over the last couple of days I have been getting the following error on
 Lift 1.0 using scala 2.7.3 when I try to deploy an application to a
 Glassfish (or Tomcat) server (Jetty works ok)

 : Exception starting filter LiftFilter
 java.lang.IncompatibleClassChangeError: Class scala.List$$anon$1 does not
 implement the requested interface scala.Seq$Projection
 at net.liftweb.util.ListHelpers$class.first(ListHelpers.scala:50)
 at net.liftweb.util.Helpers$.first(Helpers.scala:29)
 at net.liftweb.util.Props$.init(Props.scala:151)
 at net.liftweb.util.Props$.clinit(Props.scala)
 at net.liftweb.util.LogBoot$.findTheFile$1(Log.scala:115)
 at net.liftweb.util.LogBoot$._log4JSetup(Log.scala:118)
 at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
 at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96)
 at net.liftweb.util.LogBoot$.checkConfig(Log.scala:94)
 at
 net.liftweb.util.LogBoot$.net$liftweb$util$LogBoot$$_logger(Log.scala:140)
 at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
 at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142)
 at net.liftweb.http.LiftRules$.init(LiftRules.scala:559)
 at net.liftweb.http.LiftRules$.clinit(LiftRules.scala)
 at net.liftweb.http.LiftFilter.init(LiftServlet.scala:546)
 ...


 I think the application was deploying OK earlier in the week. Any ideas???

 cheers
 Oliver

 



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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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] jetty/actors performance question tangentially related to lift

2009-11-08 Thread Lincoln

Hi,

Currently I have a jetty webapp that uses continuations and actors to
scale to many connections. While this isn't a lift question per se I
was hoping the folks on this list could help since it's my
understanding that Lift does similar stuff under certain setups.

Basically, the functionality that I'm testing receives a request,
suspends it via jetty continuations, and fires it off to an actor for
processing.  Once the work is done (some benchmark database requests,
usually on the order of 10 to 100ms) the continuation is resumed and
results are returned.

As I scale up to 1000+ concurrents in apache benchmark, I notice that
the vast majority of time from receipt of the request to response, is
between when the continuation is suspended and when my actor receives
the message.  This strikes me as bizarre since I'm monitoring the
mailbox and it never grows to a size larger than 1 or 2.  It gets to
the point where requests are taking 10 seconds to come back and 9.5 of
those seconds are my actor waiting to receive the work request.

Throughout the load test the database does not become stressed.

Any thoughts on this?  I guess I'm hoping there is something basic
that I'm doing wrong.  Just in case, I've tried creating an actor pool
to receive the work requests but that apparently has no effect on the
results.

My only speculation at this point is that perhaps the reason messages
are taking so long to get to my actor is because jetty itself is
overloaded trying to queue requests but that is just a guess.

Thanks,
Lincoln

--~--~-~--~~~---~--~~
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] How to bind the Map to View in the Snippet ?

2009-11-08 Thread Neil.Lv

Hi all,

   How to bind the Map to View in the Snippet ?

   This is the bind code
###
   scala.collection.mutable.Map[String,List[String]] =
Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7, 123,
da))

  var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello,
M7, 123, da))
  def doList(in : NodeSeq) : NodeSeq = {
data.foreach(d= {
  bind(data, in,
   time - Text({d._1}),
   list -  bindList(d._2)
  )
})

  def bindList(lists:List[String]) = {
  lists flatMap { l =
bind(sec, chooseTemplate(data, list, in),
  title - Text(l))
  }
###

   It always show this message:
 found   : Unit
 required: scala.xml.NodeSeq
data.foreach(d= {


Cheers,
  Neil



--~--~-~--~~~---~--~~
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: How to bind the Map to View in the Snippet ?

2009-11-08 Thread Naftoli Gugenheim

That should not be foreach but flatMap.
Foreach is like map but returns Unit, and flatMap is like map but it 
concatenates the resulting elements, which must be iterable (or iterators, 
depending).

-
Neil.Lvanim...@gmail.com wrote:


Hi all,

   How to bind the Map to View in the Snippet ?

   This is the bind code
###
   scala.collection.mutable.Map[String,List[String]] =
Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7, 123,
da))

  var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello,
M7, 123, da))
  def doList(in : NodeSeq) : NodeSeq = {
data.foreach(d= {
  bind(data, in,
   time - Text({d._1}),
   list -  bindList(d._2)
  )
})

  def bindList(lists:List[String]) = {
  lists flatMap { l =
bind(sec, chooseTemplate(data, list, in),
  title - Text(l))
  }
###

   It always show this message:
 found   : Unit
 required: scala.xml.NodeSeq
data.foreach(d= {


Cheers,
  Neil





--~--~-~--~~~---~--~~
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] My Sitemap Problem

2009-11-08 Thread Randinn

I made this sitemap but the User.sitemap is not showing up on the
site, it looks like it should work but is not, can someone point out
what I did wrong?

 val entries = Menu(Loc(Home, List(index), Home))::
Menu(Loc(Item, List(member, index) - false, Item),
 Menu(Loc(ItemList, List(member, list), Item List)),
 Menu(Loc(ItemCreate, List(member, create), Create
Item))) ::
Menu(Loc(Admin, List(admin, list) - true, Admin),
 Menu(Loc(AdminList, List(admin, list), Category
List)),
 Menu(Loc(UserCreate, List(admin, create), Create
Category))) ::
Menu(Loc(Auser, List(auser, list) - true, User),
 Menu(Loc(AuserList, List(auser, list), User
List))) :: Nil
User.sitemap :: Nil


LiftRules setSiteMap SiteMap(entries : _*)

LiftRules.rewrite.append {
  case RewriteRequest(
  ParsePath(List(member, action, id),_,_,_),_,_) =
RewriteResponse(member :: action :: Nil, Map(id - id))
  case RewriteRequest(
  ParsePath(List(admin, action, id),_,_,_),_,_) =
RewriteResponse(admin :: action :: Nil, Map(id - id))
  case RewriteRequest(
  ParsePath(List(auser, action, id),_,_,_),_,_) =
RewriteResponse(auser :: action :: Nil, Map(id - id))
}
--~--~-~--~~~---~--~~
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: How to bind the Map to View in the Snippet ?

2009-11-08 Thread Neil.Lv


  How should i write the bind code ?

 var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7,
123,da))
 

  data.flatMap(d= {
Log.info( *: + d)
 bind(data, in,
  date_title - Text(222)
 )
})

  Get this erors:
 found   : Iterable[scala.xml.Node]
 required: scala.xml.NodeSeq
data.flatMap(d= {

  I'm not familiar with this.

  I want the page show like this:
  date - 2009/10/09
 st1
  date - 2009/10/10
 Hello
 M7
 123
 da

Cheers,
  Neil


On Nov 9, 11:35 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 That should not be foreach but flatMap.
 Foreach is like map but returns Unit, and flatMap is like map but it 
 concatenates the resulting elements, which must be iterable (or iterators, 
 depending).

 -

 Neil.Lvanim...@gmail.com wrote:

 Hi all,

How to bind the Map to View in the Snippet ?

This is the bind code
 ###
scala.collection.mutable.Map[String,List[String]] =
 Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7, 123,
 da))

   var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello,
 M7, 123, da))
   def doList(in : NodeSeq) : NodeSeq = {
 data.foreach(d= {
   bind(data, in,
time - Text({d._1}),
list -  bindList(d._2)
   )
 })

   def bindList(lists:List[String]) = {
   lists flatMap { l =
 bind(sec, chooseTemplate(data, list, in),
   title - Text(l))
   }
 ###

It always show this message:
  found   : Unit
  required: scala.xml.NodeSeq
 data.foreach(d= {

 Cheers,
   Neil
--~--~-~--~~~---~--~~
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: jetty/actors performance question tangentially related to lift

2009-11-08 Thread David Pollak
If you have all your requests going to 1 actor, then you've reduced your
application to a single threaded app.

If you're using Scala Actors, there are all kinds of wacky things that
happen with the Fork-Join library that the Actors use for scheduling and a
whole lot of knobs to turn to get the scheduling right depending on your
number of CPUs, etc.

But, at the end of the day, if you're just pushing work from one thread (the
thread that the HTTP request comes in on) to another thread (the thread
that's waiting for the RDBMS request), you're not saving any time or
threads, in fact you're only increasing the amount of thrash between
scheduling the Actor, suspending the HTTP request thread, etc.

But, without seeing your code, it's hard to give you a better analysis.

On Sun, Nov 8, 2009 at 7:08 PM, Lincoln linxbet...@gmail.com wrote:


 Hi,

 Currently I have a jetty webapp that uses continuations and actors to
 scale to many connections. While this isn't a lift question per se I
 was hoping the folks on this list could help since it's my
 understanding that Lift does similar stuff under certain setups.

 Basically, the functionality that I'm testing receives a request,
 suspends it via jetty continuations, and fires it off to an actor for
 processing.  Once the work is done (some benchmark database requests,
 usually on the order of 10 to 100ms) the continuation is resumed and
 results are returned.

 As I scale up to 1000+ concurrents in apache benchmark, I notice that
 the vast majority of time from receipt of the request to response, is
 between when the continuation is suspended and when my actor receives
 the message.  This strikes me as bizarre since I'm monitoring the
 mailbox and it never grows to a size larger than 1 or 2.  It gets to
 the point where requests are taking 10 seconds to come back and 9.5 of
 those seconds are my actor waiting to receive the work request.

 Throughout the load test the database does not become stressed.

 Any thoughts on this?  I guess I'm hoping there is something basic
 that I'm doing wrong.  Just in case, I've tried creating an actor pool
 to receive the work requests but that apparently has no effect on the
 results.

 My only speculation at this point is that perhaps the reason messages
 are taking so long to get to my actor is because jetty itself is
 overloaded trying to queue requests but that is just a guess.

 Thanks,
 Lincoln

 



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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: How to bind the Map to View in the Snippet ?

2009-11-08 Thread David Pollak
On Sun, Nov 8, 2009 at 7:45 PM, Neil.Lv anim...@gmail.com wrote:



  How should i write the bind code ?

  var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7,
 123,da))
  

  data.flatMap(d= {

data.toList.flatMap(...)


 Log.info( *: + d)
 bind(data, in,
  date_title - Text(222)
 )
})

  Get this erors:
  found   : Iterable[scala.xml.Node]
  required: scala.xml.NodeSeq
data.flatMap(d= {

  I'm not familiar with this.

  I want the page show like this:
  date - 2009/10/09
 st1
  date - 2009/10/10
 Hello
 M7
 123
 da

 Cheers,
   Neil


 On Nov 9, 11:35 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  That should not be foreach but flatMap.
  Foreach is like map but returns Unit, and flatMap is like map but it
 concatenates the resulting elements, which must be iterable (or iterators,
 depending).
 
  -
 
  Neil.Lvanim...@gmail.com wrote:
 
  Hi all,
 
 How to bind the Map to View in the Snippet ?
 
 This is the bind code
  ###
 scala.collection.mutable.Map[String,List[String]] =
  Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7, 123,
  da))
 
var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello,
  M7, 123, da))
def doList(in : NodeSeq) : NodeSeq = {
  data.foreach(d= {
bind(data, in,
 time - Text({d._1}),
 list -  bindList(d._2)
)
  })
 
def bindList(lists:List[String]) = {
lists flatMap { l =
  bind(sec, chooseTemplate(data, list, in),
title - Text(l))
}
  ###
 
 It always show this message:
   found   : Unit
   required: scala.xml.NodeSeq
  data.foreach(d= {
 
  Cheers,
Neil
 



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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: Working with database views

2009-11-08 Thread David Pollak
On Sun, Nov 8, 2009 at 5:51 AM, GA my_li...@me.com wrote:


 Yes, it just did the trick. It compiles now.

 Why is it working now? Isn't it Mapper also a MetaMapper?


No.  A Mapper corresponds to a row in your table.  A MetaMapper corresponds
to the table itself.




 On Nov 8, 2009, at 12:27 PM, Jeppe Nejsum Madsen wrote:

 
  GA my_li...@me.com writes:
 
  Hello guys,
 
  I need to create a database view to create a very specific query from
  an API. I am planning the following steps:
 
  1. Create the view in the database directly
  2. Create a model without a primary key extending Mapper instead of
  Keymapper
  3. I am not going to add the view to Schemifier since I am managing
  the creation and maintenance of the object manually
 
  My problem is that I am having problems to compile the Mapper class.
  This is the code I am trying to create:
 
  class SyncVW extends Mapper[SyncVW] {
  def getSingleton = SyncVW
 
  object field1 extends MappedLong(this, ContentSource)
  object field2 extends MappedString(this, 999)
  object field3 extends MappedString(this,255)
  object field4 extends MappedString(this,30)
  }
  object SyncVW extends SyncVW with Mapper[SyncVW]
 
  I think this last line should read
 
  object SyncVW extends SyncVW with MetaMapper[SyncVW]
 
  /Jeppe
 
  


 



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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: jetty/actors performance question tangentially related to lift

2009-11-08 Thread Lincoln

Thanks for the feedback David... I have also created a pool of actors
and dispatch requests round-robin style to it.  Oddly enough, I see
absolutely no difference in the performance characteristics - in both
cases 95% of the time is spent between the suspend and the actor
receiving the request, but the mailbox never grows past a size of 1 or
2.  I will try and send along a simplified version of my code to
illustrate what I'm doing.

Thanks,
Lincoln

On Sun, Nov 8, 2009 at 11:02 PM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 If you have all your requests going to 1 actor, then you've reduced your
 application to a single threaded app.

 If you're using Scala Actors, there are all kinds of wacky things that
 happen with the Fork-Join library that the Actors use for scheduling and a
 whole lot of knobs to turn to get the scheduling right depending on your
 number of CPUs, etc.

 But, at the end of the day, if you're just pushing work from one thread (the
 thread that the HTTP request comes in on) to another thread (the thread
 that's waiting for the RDBMS request), you're not saving any time or
 threads, in fact you're only increasing the amount of thrash between
 scheduling the Actor, suspending the HTTP request thread, etc.

 But, without seeing your code, it's hard to give you a better analysis.

 On Sun, Nov 8, 2009 at 7:08 PM, Lincoln linxbet...@gmail.com wrote:

 Hi,

 Currently I have a jetty webapp that uses continuations and actors to
 scale to many connections. While this isn't a lift question per se I
 was hoping the folks on this list could help since it's my
 understanding that Lift does similar stuff under certain setups.

 Basically, the functionality that I'm testing receives a request,
 suspends it via jetty continuations, and fires it off to an actor for
 processing.  Once the work is done (some benchmark database requests,
 usually on the order of 10 to 100ms) the continuation is resumed and
 results are returned.

 As I scale up to 1000+ concurrents in apache benchmark, I notice that
 the vast majority of time from receipt of the request to response, is
 between when the continuation is suspended and when my actor receives
 the message.  This strikes me as bizarre since I'm monitoring the
 mailbox and it never grows to a size larger than 1 or 2.  It gets to
 the point where requests are taking 10 seconds to come back and 9.5 of
 those seconds are my actor waiting to receive the work request.

 Throughout the load test the database does not become stressed.

 Any thoughts on this?  I guess I'm hoping there is something basic
 that I'm doing wrong.  Just in case, I've tried creating an actor pool
 to receive the work requests but that apparently has no effect on the
 results.

 My only speculation at this point is that perhaps the reason messages
 are taking so long to get to my actor is because jetty itself is
 overloaded trying to queue requests but that is just a guess.

 Thanks,
 Lincoln





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

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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: CometActor and render

2009-11-08 Thread David Pollak
Jack,

I reproduced your code and it seems to work fine.  I've enclosed a working
copy.

Some comments about your code:

   - The foos variable and the foo variable may be getting confused in the
   code... the render method may be rendering the same thing based on the
   unchanging foos variable.
   - Doing null testing is a sign that you have logic errors in your code.
   I strongly recommend using either Box or Option for everything that can
   logically not contain a value/reference.  If you're bridging out to Java
   code and are expecting null from the Java code, write a small bridge that
   will wrapper the Java return values in Box/Option.
   - You have a case class (Tick) that contains no parameters.  Please use a
   case object instead.
   - Your Tick look is a spin loop.  You fire a Tick message as part of
   processing the Tick message.  I would suggest that if you're polling, that
   you have a reasonable poll interval, otherwise you'll starve your CPU.
   Further, having reRender on each loop through means that you're forcing a
   lot of bytes over the wire rather than only doing a reRender on changed
   values.

Thanks,

David

On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com wrote:

 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar


 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
 span id=gotable
 {
   for {foo - foos} yield trtd{foo.getValue}/td/tr
 }

 /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
 super.localSetup
 this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
 case Tick = {
   foo=FooQueue.getLatest
   if (foo!=null  foo.getValue  -1) {
 blogs = FooManager.process(foo, foos)
   } else if (foo!=null){
 foos = foos.remove((f:Foo)=(f.id==foo.id))
   }
   reRender(false)
   this ! Tick
 }
   }
 }

 case class Tick



 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but I
  don't see the changes. If I refresh the page at anytime, I do see the
  changes. Any idea what might cause this?
  
 





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355


 



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

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



yaker.tgz
Description: GNU Zip compressed data


[Lift] How quick is webdev with Lift?

2009-11-08 Thread Alex Siman

How quick is webdev with Lift? Is your Lift dev-cycle of webapp is the
same as with classic Java? I mean these steps:

1) code
2) compile
3) deploy
4) find error
...
n-2) re-compile
n-1) re-deploy
...

Such as Scala is compilable lang, every change made into the snippets
requires re-compile and re-deploy. This slows down development.

Are you using JRebel (formerly JavaRebel)? I have used this lib for
Java projects and it worked fine.

Are there any other tips to speed up webdev on JVM-Scala-Lift compared
to JVM-Java-XXX?

--~--~-~--~~~---~--~~
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: How quick is webdev with Lift?

2009-11-08 Thread harryh

I use JRebel and SBT (http://code.google.com/p/simple-build-tool/) and
very rarely have to restart my server when doing development.  It's a
very quick dev-cycle.  No big tips really.  I save the code and reload
the page and see the results of my work.

-harryh
--~--~-~--~~~---~--~~
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: How to bind the Map to View in the Snippet ?

2009-11-08 Thread Neil.Lv

David,

   Thanks very much!

   It works now and can be shown in the page !

Cheers,
  Neil

On Nov 9, 12:06 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Sun, Nov 8, 2009 at 7:45 PM, Neil.Lv anim...@gmail.com wrote:

   How should i write the bind code ?

   var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7,
  123,da))
   

   data.flatMap(d= {

 data.toList.flatMap(...)



  Log.info( *: + d)
  bind(data, in,
   date_title - Text(222)
  )
 })

   Get this erors:
   found   : Iterable[scala.xml.Node]
   required: scala.xml.NodeSeq
 data.flatMap(d= {

   I'm not familiar with this.

   I want the page show like this:
   date - 2009/10/09
  st1
   date - 2009/10/10
  Hello
  M7
  123
  da

  Cheers,
Neil

  On Nov 9, 11:35 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
   That should not be foreach but flatMap.
   Foreach is like map but returns Unit, and flatMap is like map but it
  concatenates the resulting elements, which must be iterable (or iterators,
  depending).

   -

   Neil.Lvanim...@gmail.com wrote:

   Hi all,

  How to bind the Map to View in the Snippet ?

  This is the bind code
   ###
  scala.collection.mutable.Map[String,List[String]] =
   Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello, M7, 123,
   da))

 var data = Map(2009/10/09 - List(St1), 2009/10/10 - List(Hello,
   M7, 123, da))
 def doList(in : NodeSeq) : NodeSeq = {
   data.foreach(d= {
 bind(data, in,
  time - Text({d._1}),
  list -  bindList(d._2)
 )
   })

 def bindList(lists:List[String]) = {
 lists flatMap { l =
   bind(sec, chooseTemplate(data, list, in),
 title - Text(l))
 }
   ###

  It always show this message:
found   : Unit
required: scala.xml.NodeSeq
   data.foreach(d= {

   Cheers,
 Neil

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Surf the harmonics
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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] How to specify the SELECT statement in the Mapper ?

2009-11-08 Thread Neil.Lv

Hi all,

  There is some example code:
###
SELECT id,  name, sex, created_at,  DAYOFWEEK(created_at,) as week,
(CURRENT_DATE) as t
FROM users
WHERE created_at  (CURRENT_DATE ) AND created_at  (CURRENT_DATE +
interval 2 day)
ORDER BY created_at ASC
###

  How can i specify the SELECT statement that i don't want all the
columns and i want add the column as week
in the example code ?

  Any help would be much appreciated!

Cheers,
  Neil

--~--~-~--~~~---~--~~
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: About the localization with lift:loc !

2009-11-08 Thread YING-KWANG TU
Neil,

Considering that we are both using the lift-core_xx_XX in our bundle.

   1. S.??(works seamlessly)

However, I am having same issue with you on:

lift:loc locid=loginDefault Value/lift:loc OR
lift:loc loc_id=loginDefault Value/lift:loc OR
lift:loclogin/lift:loc

I am not sure if it has to do with the bundle name we are using but no, we
can't get lift:loc/ to work.

On Sat, Nov 7, 2009 at 9:46 PM, Neil.Lv anim...@gmail.com wrote:


 yk,

  I use the code that you write.

  1:) I use this link to test the i18n
   http://localhost:8080/?locale=ms_MY

   S.??(login)  =  it works well !

  2:) But this code in the html page, it always doesn't work too, just
 show the Default value
  lift:loc locid=loginDefault value/lift:loc

  Thanks very much!

 Cheers,
  Neil

 On Nov 7, 8:29 pm, Timothy Perrett timo...@getintheloop.eu wrote:
  You should always be working with UTF-8 files for properties /
  localisation - I think the encoding reported by jetty is something
  different (that it reads from the system)... ensure your props files
  are UTF-8 and go from there.
 
  Cheers, Tim
 
  On Nov 7, 12:48 am, yk ying.kwang...@gmail.com wrote:
 
   Hi Tim,
 
   I've developed n tested localization on windows and it worked
   perfectly. however, localization of the same project placed on ubuntu
   server 9.10 did not.
 
   WinXP
   ---
   jdk1.6
   maven 2.2.1
   lifeweb 1.1-M7
   encoding=cp1252 (as reported by mvn jetty:run)
 
   Ubuntu 9.10 server
   ---
   openjdk OR sun-jdk6
   maven 2.2.1
   liftweb 1.1-M7
   encoding=UTF-8 (as reported by mvn jetty:run)
 
   I can't quite point my finger on why it worked on windows but not on
   linux. Do i have to convert all files that need to be deployed to
   UTF-8 encoding?
 
   Thank you in advance.
 
   Cheers,
 yk
 
   On Oct 26, 9:12 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 
The browser already knows the locale, you have it backward! Your
localeCalculator is so that the browser can get lift to return the
right content.
 
Take a look at:
 
   
 http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/...
 
I would start with just getting lift to explicitly set locale based
 on
a query string or something... it will help you understand how the
mechanism works.
 
Cheers, Tim
 
On 26 Oct 2009, at 12:34, Neil.Lv wrote:
 
  ...
 
  Where is the locale to be set that the browser can know the
 locale ?
 
  Thanks very much!
 
 Cheers,
  Neil
 
 On Oct 26, 7:50 pm, Timothy Perrett timo...@getintheloop.eu
 wrote:
 setLocale was a method created by me, specific to my application -
 it
 does not exist in Lift... hence why I removed it in my simplified
 example.
 
 Cheers, Tim
 
 On 26 Oct 2009, at 11:45, Neil.Lv wrote:
 
 I have a silly question ,  where is the setLocale method ?
 
 I don't know where the package located.
 
 src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found:
 value setLocale
   setLocale(selectedLocale)
 
 :)
 
 Cheers,
  Neil
 
 On Oct 26, 5:50 pm, Timothy Perrett timo...@getintheloop.eu
 wrote:
 Yes, your template code is right - your just seeing the default

 value
 because you have not told lift what resources to use when it
 gets
 the
 locale header from the browser.
 
 tryo() is like try/catch however, it will catch exceptions and
 returns
 Box[T]
 
 I would really suggest starting with something a lot simpler
 than
 the
 one i detailed that uses cookies and all sorts. Perhaps
 something
 like:
 
 def localeCalculator(request : Box[HTTPRequest]): Locale =
request.flatMap(r = {
tryo(r.locale) match {
  // your match here
}
 
 }).openOr(java.util.Locale.getDefault())
 
 Hope that helps
 
 Cheers, Tim
 
 On 26 Oct 2009, at 09:21, Neil.Lv wrote:
 
  lift:loc locid=loginLog in 222/lift:loc
  That means this code is correctly, the problem is that the
 browser
 doesn't know the locale?
 
  So we need to calculate the locale in the Boot.scala file ?
 
 Cheers,
  Neil
 
 On Oct 26, 5:09 pm, Neil.Lv anim...@gmail.com wrote:
 tryo(r.getParameter(locale)) match {
case Full(null) = workOutLocale
case Empty = workOutLocale
case Failure(_,_,_) = workOutLocale
case Full(selectedLocale) = {
  setLocale(selectedLocale)
  selectedLocale
}
  }
 
  In this code ,  what's the tryo ? is try ?
  tryo () match {}
 
  What's the changes about the HTTP container providers?
 
  Thanks very much!
 
 Cheers,
  Neil
 
 On Oct 26, 4:44 pm, Timothy Perrett timo...@getintheloop.eu
 wrote:
 
 Hmm - you posted a link to my article at the begining of this
 thread;
 in that article I explain lifts locale calculator. Without
 this,
 Lift
 has no idea how you 

[Lift] Re: My Sitemap Problem

2009-11-08 Thread Randinn

I just realized that it should be:

 Menu(Loc(AuserList, List(auser, list), User
List))) ::
User.sitemap

On Nov 9, 2:37 pm, Randinn rand...@gmail.com wrote:
 I made this sitemap but the User.sitemap is not showing up on the
 site, it looks like it should work but is not, can someone point out
 what I did wrong?

  val entries = Menu(Loc(Home, List(index), Home))::
     Menu(Loc(Item, List(member, index) - false, Item),
          Menu(Loc(ItemList, List(member, list), Item List)),
          Menu(Loc(ItemCreate, List(member, create), Create
 Item))) ::
     Menu(Loc(Admin, List(admin, list) - true, Admin),
          Menu(Loc(AdminList, List(admin, list), Category
 List)),
          Menu(Loc(UserCreate, List(admin, create), Create
 Category))) ::
     Menu(Loc(Auser, List(auser, list) - true, User),
          Menu(Loc(AuserList, List(auser, list), User
 List))) :: Nil
     User.sitemap :: Nil

     LiftRules setSiteMap SiteMap(entries : _*)

     LiftRules.rewrite.append {
       case RewriteRequest(
           ParsePath(List(member, action, id),_,_,_),_,_) =
         RewriteResponse(member :: action :: Nil, Map(id - id))
       case RewriteRequest(
           ParsePath(List(admin, action, id),_,_,_),_,_) =
         RewriteResponse(admin :: action :: Nil, Map(id - id))
       case RewriteRequest(
           ParsePath(List(auser, action, id),_,_,_),_,_) =
         RewriteResponse(auser :: action :: Nil, Map(id - id))
     }
--~--~-~--~~~---~--~~
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: CometActor and render

2009-11-08 Thread Jack Widman
Thanks David. This is a big help. Can you tell me exactly how lowPriority,
mediumPriorty and highPriority work? When are they called?

On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Jack,

 I reproduced your code and it seems to work fine.  I've enclosed a working
 copy.

 Some comments about your code:

- The foos variable and the foo variable may be getting confused in the
code... the render method may be rendering the same thing based on the
unchanging foos variable.
- Doing null testing is a sign that you have logic errors in your
code.  I strongly recommend using either Box or Option for everything that
can logically not contain a value/reference.  If you're bridging out to 
 Java
code and are expecting null from the Java code, write a small bridge that
will wrapper the Java return values in Box/Option.
- You have a case class (Tick) that contains no parameters.  Please use
a case object instead.
- Your Tick look is a spin loop.  You fire a Tick message as part of
processing the Tick message.  I would suggest that if you're polling, that
you have a reasonable poll interval, otherwise you'll starve your CPU.
Further, having reRender on each loop through means that you're forcing a
lot of bytes over the wire rather than only doing a reRender on changed
values.

 Thanks,

 David

 On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com wrote:

 Sorry. Here it is:   As I said, I know that when render is called,
 foo.getValue has the right value. But it does not show on the screen, unless
 I refresh the browser.

 package com.foo.comet

 import net.liftweb._
 import http._
 import js._
 import JsCmds._
 import net.liftweb.util._
 import net.liftweb.http._
 import _root_.scala.xml._
 import scala.actors._
 import com.authoritude.snippet._
 import scala.collection.mutable.Queue
 import net.liftweb.http.SessionVar


 class MyComet extends CometActor {

   override def defaultPrefix = Full(auth)

   private var foos = FooManager.getFoos

   def createDisplay(foos:List[Foo]):NodeSeq = {
 span id=gotable
 {
   for {foo - foos} yield trtd{foo.getValue}/td/tr
 }

 /table/span
   }

   def render = { bind(foo - createDisplay(foos)) }

   override def localSetup = {
 super.localSetup
 this ! Tick
   }

   var foo:Foo = null
   override def lowPriority = {
 case Tick = {
   foo=FooQueue.getLatest
   if (foo!=null  foo.getValue  -1) {
 blogs = FooManager.process(foo, foos)
   } else if (foo!=null){
 foos = foos.remove((f:Foo)=(f.id==foo.id))
   }
   reRender(false)
   this ! Tick
 }
   }
 }

 case class Tick



 On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:


 Without posting your code it's going to be tough to help you.

 Cheers, Tim

 Sent from my iPhone

 On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote:

 
  By the way, I know that when render is called, all the variables have
  the right values. I just don't see it on the screen unless I refresh
  it.
 
  On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote:
  I have a CometActor. render is called when it is supposed to be but I
  don't see the changes. If I refresh the page at anytime, I do see the
  changes. Any idea what might cause this?
  
 





 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355






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


 



-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to 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] Is there a Order Map in the lift ?

2009-11-08 Thread Neil.Lv

Hi all,

  Is there a Order Map in the lift ?

  Example:
   1- xx, 2 - yy, 3 - zz

   1:) add 1- xx
   Map(1- xx)

   2:) add 3 - zz
   Map(3 - zz, 1- xx)

   3:) add 2 - yy
   Map(2 - yy, 3 - zz, 1- xx)

   The result maybe: Map(2 - yy, 3 - zz, 1- xx)

But i want the structure(order by the number) is :  Map(1- xx,
2 - yy, 3 - zz)

   Any help would be much appreciated !

Cheers,
  Neil
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---