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

2009-11-23 Thread monty chen
I am uging lift develop a  projectI, I want to deploy my project using
jetty instead of tomcat, so i test jetty 6.1.22.

my notebook: lenovo Y330(cpu: Core2 Duo p7350 2GHz, mem: 3G)
my os: debian lenny for amd64
jdk: Java(TM) SE Runtime Environment (build 1.6.0_17-b04)

step 1: download jetty 6.1.22 from  
http://dist.codehaus.org/jetty/jetty-6.1.22/jetty-6.1.22.zip

step 2: unzip jetty 6.1.22 in my home dir.

setp3: set environment var
export JAVA_OPTS=-Drun.mode=production -server -Xmx2048

setp3: run jetty (cd jetty-6.1.22/ ; java -jar start.jar  )

test 1: start -

test the Hello World Servlet  example  of jetty-6.1.22,
the example url: http://localhost:8080/hello/

mo...@den:~/jetty-6.1.22$ ab -n 1 -c 300 http://localhost:8080/hello/
This is ApacheBench, Version 2.3 $Revision: 655654 $
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 1 requests
Finished 1 requests


Server Software:Jetty(6.1.22)
Server Hostname:localhost
Server Port:8080

Document Path:  /hello/
Document Length:39 bytes

Concurrency Level:  300
Time taken for tests:   10.344 seconds
Complete requests:  1
Failed requests:0
Write errors:   0
Total transferred:  1060212 bytes
HTML transferred:   390078 bytes
Requests per second:966.72 [#/sec] (mean)
Time per request:   310.329 [ms] (mean)
Time per request:   1.034 [ms] (mean, across all concurrent
requests)
Transfer rate:  100.09 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:0   12 152.7  23000
Processing:   200  293  53.0266 566
Waiting:1   93  53.6 65 364
Total:206  305 159.12713251

Percentage of the requests served within a certain time (ms)
  50%271
  66%338
  75%345
  80%350
  90%359
  95%366
  98%378
  99%434
 100%   3251 (longest request)

===the test1 result is good!  =
Failed requests:0
Requests per second:966.72 [#/sec] (mean)

test 1: end 

test 2: start -
test the Request Dump JSP exmaple of jetty-6.1.22,
the example url: http://localhost:8080/snoop.jsp

mo...@den:~/jetty-6.1.22$ ab -n 50 -c 3 http://localhost:8080/snoop.jsp
This is ApacheBench, Version 2.3 $Revision: 655654 $
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).done


Server Software:Jetty(6.1.22)
Server Hostname:localhost
Server Port:8080

Document Path:  /snoop.jsp
Document Length:2249 bytes

Concurrency Level:  3
Time taken for tests:   0.044 seconds
Complete requests:  50
Failed requests:23
   (Connect: 0, Receive: 0, Length: 23, Exceptions: 0)
Write errors:   0
Total transferred:  124547 bytes
HTML transferred:   114676 bytes
Requests per second:1132.76 [#/sec] (mean)
Time per request:   2.648 [ms] (mean)
Time per request:   0.883 [ms] (mean, across all concurrent
requests)
Transfer rate:  2755.50 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing: 13   2.9  1  12
Waiting:12   2.9  1  12
Total:  13   2.9  1  12

Percentage of the requests served within a certain time (ms)
  50%  1
  66%  3
  75%  3
  80%  3
  90%  9
  95% 10
  98% 12
  99% 12
 100% 12 (longest request)

===the test2  result is bad!  =
Failed requests:23
   (Connect: 0, Receive: 0, Length: 23, Exceptions: 0)
Requests per second:1132.76 [#/sec] (mean)

why the Request Dump JSP exmaple testing result is failed, so less
Number of requests(50) and less concurrency (3),

--

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




[Lift] Re: todo tutorial compile problem

2009-11-23 Thread Jean-Adrien
Seems more than your User class is not implemented or not visible. Is
it ? Does your model classes declare the same package ?

On Nov 20, 6:42 am, adamp adam.perrypellet...@gmail.com wrote:
 I'm brand new to Lift and Scala, but an old hand to Java.  I'm trying
 to work through the 'todo' example and get the following compile
 error.

 [INFO] excludes = []
 [INFO] Compiling 3 source files to C:\eclipse_workspaces\ws_riojas\todo
 \target\c
 lasses
 C:\eclipse_workspaces\ws_riojas\todo\src\main\scala\liftworkshop\model
 \ToDo.scal
 a:13: error: not found: value User
  object owner extends MappedLongForeignKey(this, User)
                                                  ^
 C:\eclipse_workspaces\ws_riojas\todo\src\main\scala\liftworkshop\model
 \ToDo.scal
 a:13: error: wrong number of arguments for constructor Object: ()
 java.lang.Objec
 t
  object owner extends MappedLongForeignKey(this, User)
                       ^
 two errors found
 [INFO]
 

 In java, I know exactly what this means and can usually figure it
 out.  But with Scala, I'm struggling.  The User object doesn't show up
 on the classpath and I'm wondering what jar/dependency I'm missing to
 get this to compile.

 Thanks in advance for any help.
 Adam

--

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




[Lift] early execution of snippet

2009-11-23 Thread iboy
I am developing an application in which i need to do url rewriting  so
that all the request of type /document/id gets directed to webpage
display.html which calls a snippet in which i am trying to do some
processing by capturing the parameter passed during
urlrewriting,everything works fine but i am facing a problem here that
every time  i run lift and click on any link in menu the snippet
called in display.html  gets executed itself.

my urlrewriting code is :
case RewriteRequest(ParsePath(document :: id  :: Nil,_,_,_ ), _,_) =
RewriteResponse(display :: Nil, Map(id -id ))
Can somebody help me out pointing where am i  wrong and how can i
solve this problem.



--

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




Re: [Lift] early execution of snippet

2009-11-23 Thread Timothy Perrett
Have a read of my article here: http://is.gd/wq4K

Cheers, Tim

On 23 Nov 2009, at 10:50, iboy wrote:

 I am developing an application in which i need to do url rewriting  so
 that all the request of type /document/id gets directed to webpage
 display.html which calls a snippet in which i am trying to do some
 processing by capturing the parameter passed during
 urlrewriting,everything works fine but i am facing a problem here that
 every time  i run lift and click on any link in menu the snippet
 called in display.html  gets executed itself.
 
 my urlrewriting code is :
 case RewriteRequest(ParsePath(document :: id  :: Nil,_,_,_ ), _,_) =
 RewriteResponse(display :: Nil, Map(id -id ))
 Can somebody help me out pointing where am i  wrong and how can i
 solve this problem.
 
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 

--

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




Re: [Lift] Re: Call it Lift 2.0

2009-11-23 Thread Timothy Perrett
Interesting - this is something i've not actually thought about: If we were to 
compile a list of all the breaking changes in 1.1, perhaps that would give some 
focus to this discussion... as josh points out, there are most likely quite a 
few now and 1.0 - 1.1 is a fairly short jump.

Loc and LocParam
Actor - LiftActor
Full,Box etc have moved packages
JSON parsing alterations and changes in JsExp

Im probably missing a number of others, but we are talking about some fairly 
significant breaks here, right? 

Cheers, Tim

On 23 Nov 2009, at 07:09, Heiko Seeberger wrote:

 Josh,
 
 Thank you for your brilliant elaboration of compatibility issues!
 
 2009/11/22 Josh Suereth joshua.suer...@gmail.com
 The real question is, with all these breaking changes in lift 1.1, has any 
 attempt been made at source-compatability?   If not, I would argue a bigger 
 version jump than 1.1.
 
 The current Lift is not source compatible with 1.0.x, just consider Box moved 
 from ...util to ...common.
 Hence you would go for 2.0, right?
  
 Also, there is the possibility of taking the version system and adding a 
 functionality milestone version at the begginning.  In this case, you can 
 use that number for marketting purposes (e.g. Lift goes 1.0!).   Your 
 version number would then be   Marketing.SourceCompatability.All but 
 Trait BinaryCompatability.Binary Compatibility.  
 
 I am all against using versioning policy for marketing!
 
 Heiko Seeberger
 
 My job: weiglewilczek.com
 My blog: heikoseeberger.name
 Follow me: twitter.com/hseeberger
 OSGi on Scala: scalamodules.org
 Lift, the simply functional web framework: liftweb.net
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.

--

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




[Lift] Re: problem defining a snippet - Method Not Found reported.

2009-11-23 Thread Anatoli
Thanks. It helped.

On Nov 23, 3:03 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Sun, Nov 22, 2009 at 3:36 AM, Anatoli anatoli...@gmail.com wrote:
  I get following problem when trying to access a testOps.list method
  from a template
  WARN - Snippet Failure: SnippetFailure(/ - ParsePath(List
  (index),,true,false),Full(testOps.list),Method Not Found)

  I checked that LiftRules.addToPackages correctly names the package and
  other snippets work. Strangely enough during testing and trying dummy
  methods I discovered that if the method defined like this:

   def list(html: NodeSeq) = {
     val items = Item.findAll()
     items.flatMap(item =
     bind(item, html,
       title -- Text(Lala))
       )
   }

  it does not work but if it is defined like this

   def list(html: NodeSeq) = {
     val items = Item.findAll()
     bind(item, html,
       title -- Text(Lala))
   }

  the snippet is found correctly. What am I doing wrong? Please help, I
  wasted almost the whole day on it.

 First, please use Lift 1.1-M6 or 1.1-SNAPSHOT.  You'll get much more
 developer friendly error messages... some even come with diagnostics.

 Second, the signature of a snippet is NodeSeq = NodeSeq, so it's best to
 declare a return type:

 def list(html: NodeSeq): NodeSeq = 

 Thanks,

 David



  --

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

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

--

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




Re: [Lift] labels for inputs

2009-11-23 Thread Chris Lewis
Thanks Naftoli, that did it. I wonder, why use a new method -% for 
attribute preservation?

Naftoli Gugenheim wrote:
 This was changed. Instead, with the regular arrow - attributes are not 
 preserved at all, and a new arrow was introduced -% that preserves all 
 attributes from the template as is.
 This is in addition to being able to pass attributes to many SHtml methods; 
 being able to add attributes to the returned NodeSeq; binding on attributes; 
 and attribute snippets.
 
 -
 Chris Lewisburningodzi...@gmail.com wrote:
 
 Hello list,
 
 I was looking for a way to attach label elements to form inputs (via 
 DOM id), and I came across this thread:
 
 http://www.mail-archive.com/liftweb@googlegroups.com/msg04821.html
 
 This suggests that bind points, when expanded, result in elements that 
 have any attribute under the bind point namespace merged into the result 
 element. This isn't working in 1.1-M7, unless I'm misunderstanding 
 something.
 
 Given this template code:
 
  lift:Order.allOrders
tr
  tdorder:status order:id=status//td
/tr
  /lift:Order.allOrders
 
 
 I should see a DOM id of status on the resulting element, right? Instead 
 it's just ignored. Am I doing something wrong?
 
 thanks!
 chris
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 

--

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




[Lift] Re: Where are the dragons hiding?

2009-11-23 Thread ngocdaothanh
Is Lift suitable for web for mobiles?

Generally web for mobiles (especially in Japan) has some
characteristics:
* No JavaScript support
* No cookie support
* Non standard HTML tags

Thanks

 I think this thread contains the key dragons in Lift.  Basically, it boils
 down to: Lift is highly stateful... that has its pluses and minuses.  We're
 working on mitigating the minuses (session replication and persistence).

--

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




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

2009-11-23 Thread Paul Phillips
On Fri, Nov 20, 2009 at 06:21:09AM +, Ismael Juma wrote:
 I was looking at the fix[1] and it doesn't seem to me like it's the 
 correct fix (although it does fix the infinite loop). If I call 
 ensureCapacity and the internal array length is 0, I still want the 
 method to do what I asked, right?

It was a race against time over here, every second counts when you are 
trying to head off a bug which leaks INFINITY CYCLES.  Oh sure, you 
monday morning quarterbacks can make your air quotes around 
correctness but statistically speaking my decisive action must have 
saved some very small but finite positive number of people from hitting 
that loop, and that number * infinity == infinity, so therefore not only 
was it the right thing to do, it was INFINITELY RIGHT.

And now that I have infinite karma you better watch out because I no 
longer need abide by society's constraints.

-- 
Paul Phillips  | Every normal man must be tempted at times
Everyman   | to spit on his hands, hoist the black flag,
Empiricist | and begin to slit throats.
pp: i haul pills   | -- H. L. Mencken

--

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




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

2009-11-23 Thread David Bernard
To run maven without compiling+running test from commandline :

mvn  -Dmaven.test.skip=true

To fully disable test without commenting them :
edit pom.xml
properties
  maven.test.skiptrue/maven.test.skip
/properties

(I prefer using the property instead of directly configure surfire because :
* don't require to add a surfire section if it doesn't already exists
* some profile (eg : integration test) are enabled only if maven.test.skip
!= true (include false, not-define,...)
)

On Fri, Nov 20, 2009 at 01:31, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Folks,

 The 280_port of Lift properly compiles and runs the Lift demo application
 against the Scala 2.8.0 nightly.

 I spent most of today tracking down a bug that I can't reproduce in
 isolation, but it seems that the ensureCapacity method in Scala's
 StringBuilder method has an infinite:

 def ensureCapacity(n: Int) { 
 117http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L117
   if (n  array.length) { 
 118http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L118
 var newsize = array.length * 2 
 119http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L119
 while (n  newsize) 
 120http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L120
   newsize = newsize * 2 
 121http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L121
 val newar = new Array[Char](newsize) 
 122http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L122
 arraycopy(array, 0, newar, 0, count) 
 123http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L123
 array = newar 
 124http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L124
   } 
 125http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L125
 }
 I saw an infinite loop in lines 119/120 (it was line 115 in the version I
 was testing against).  I replaced Scala's StringBuilder with the Java native
 code and all worked just fine.  It might be worth a gander at the byte-code
 for StringBuilder to see how an infinite loop could happen.

 Anyway, I'm looking forward to the next drop of a stable 2.8.0 so I can
 compile against Specs and get a more complete (read: passes tests... right
 now the tests are commented out because I don't have the
 Specs/ScalaCheck/etc. chain in the 2.8.0 nightly).

 Thanks,

 David

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

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


--

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




[Lift] Re: session variable question

2009-11-23 Thread jack
To give more information, I have two questions.
1) I want to define and set a  session  variable in Class A and read
it in Class B. What is the code?
2) Can A and B be arbitrary classes or do they have to be snippets?


On Nov 22, 9:14 pm, jack jack.wid...@gmail.com wrote:
 I defined a session variable like this

 object isAdminVar extends SessionVar[Box[Boolean]](Empty)

 in a class. I set it to true in that same class upon successful login
 and then access it in another class but it is coming out false.

 I am accessing it with

 isAdminVar.is.openOr(false)

 Am I missing something obvious?

--

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




Re: [Lift] Re: session variable question

2009-11-23 Thread Timothy Perrett
Jack,

1.
object MyThing extends SessionVar[Box[String]](Empty)

Im using Box[String] here, but you can use whatever types you want...

2. They can be anything (classes, actors, objects), provided they are in 
session scope (that is, S.init has been called)

Cheers, Tim

On 23 Nov 2009, at 13:15, jack wrote:

 To give more information, I have two questions.
 1) I want to define and set a  session  variable in Class A and read
 it in Class B. What is the code?
 2) Can A and B be arbitrary classes or do they have to be snippets?
 
 
 On Nov 22, 9:14 pm, jack jack.wid...@gmail.com wrote:
 I defined a session variable like this
 
 object isAdminVar extends SessionVar[Box[Boolean]](Empty)
 
 in a class. I set it to true in that same class upon successful login
 and then access it in another class but it is coming out false.
 
 I am accessing it with
 
 isAdminVar.is.openOr(false)
 
 Am I missing something obvious?
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 

--

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




Re: [Lift] Re: session variable question

2009-11-23 Thread Jack Widman
Thanks Tim. I didn't know S.init has to be called explicitly. This can be
called from anywhere?

On Mon, Nov 23, 2009 at 8:19 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Jack,

 1.
 object MyThing extends SessionVar[Box[String]](Empty)

 Im using Box[String] here, but you can use whatever types you want...

 2. They can be anything (classes, actors, objects), provided they are in
 session scope (that is, S.init has been called)

 Cheers, Tim

 On 23 Nov 2009, at 13:15, jack wrote:

  To give more information, I have two questions.
  1) I want to define and set a  session  variable in Class A and read
  it in Class B. What is the code?
  2) Can A and B be arbitrary classes or do they have to be snippets?
 
 
  On Nov 22, 9:14 pm, jack jack.wid...@gmail.com wrote:
  I defined a session variable like this
 
  object isAdminVar extends SessionVar[Box[Boolean]](Empty)
 
  in a class. I set it to true in that same class upon successful login
  and then access it in another class but it is coming out false.
 
  I am accessing it with
 
  isAdminVar.is.openOr(false)
 
  Am I missing something obvious?
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.
 
 
 

 --

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





-- 
Jack Widman

co-founder / cto,  Authoritude, Inc.

203-641-9355

--

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




[Lift] Re: session variable question

2009-11-23 Thread Marius
Do not call S.init on your own. Lift does that automatically.

object MyThing extends SessionVar[Box[String]](Empty)


set value:

MyThing.set(Full(my value))

get the value:

MyThing.get

Br's,
Marius

On Nov 23, 3:26 pm, Jack Widman jack.wid...@gmail.com wrote:
 Thanks Tim. I didn't know S.init has to be called explicitly. This can be
 called from anywhere?

 On Mon, Nov 23, 2009 at 8:19 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:



  Jack,

  1.
  object MyThing extends SessionVar[Box[String]](Empty)

  Im using Box[String] here, but you can use whatever types you want...

  2. They can be anything (classes, actors, objects), provided they are in
  session scope (that is, S.init has been called)

  Cheers, Tim

  On 23 Nov 2009, at 13:15, jack wrote:

   To give more information, I have two questions.
   1) I want to define and set a  session  variable in Class A and read
   it in Class B. What is the code?
   2) Can A and B be arbitrary classes or do they have to be snippets?

   On Nov 22, 9:14 pm, jack jack.wid...@gmail.com wrote:
   I defined a session variable like this

   object isAdminVar extends SessionVar[Box[Boolean]](Empty)

   in a class. I set it to true in that same class upon successful login
   and then access it in another class but it is coming out false.

   I am accessing it with

   isAdminVar.is.openOr(false)

   Am I missing something obvious?

   --

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

  --

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

 --
 Jack Widman

 co-founder / cto,  Authoritude, Inc.

 203-641-9355

--

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




Re: [Lift] Re: session variable question

2009-11-23 Thread Timothy Perrett
Jack,

No, you don't call that yourself - I was meaning that Lift initiates the 
session for you, thats not your worry :-)
My point really was that comet actors and other lift infrastructure initiate 
the session, but normal scala actors would require you to start the session 
scope manually using S.initIfUninited ;-)

Basically, dont worry about it - just use the SessionVar extension and you 
should be good to go.

Cheers, Tim

On 23 Nov 2009, at 13:26, Jack Widman wrote:

 Thanks Tim. I didn't know S.init has to be called explicitly. This can be 
 called from anywhere?
 
 On Mon, Nov 23, 2009 at 8:19 AM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Jack,
 
 1.
 object MyThing extends SessionVar[Box[String]](Empty)
 
 Im using Box[String] here, but you can use whatever types you want...
 
 2. They can be anything (classes, actors, objects), provided they are in 
 session scope (that is, S.init has been called)
 
 Cheers, Tim
 
 On 23 Nov 2009, at 13:15, jack wrote:
 
  To give more information, I have two questions.
  1) I want to define and set a  session  variable in Class A and read
  it in Class B. What is the code?
  2) Can A and B be arbitrary classes or do they have to be snippets?
 
 
  On Nov 22, 9:14 pm, jack jack.wid...@gmail.com wrote:
  I defined a session variable like this
 
  object isAdminVar extends SessionVar[Box[Boolean]](Empty)
 
  in a class. I set it to true in that same class upon successful login
  and then access it in another class but it is coming out false.
 
  I am accessing it with
 
  isAdminVar.is.openOr(false)
 
  Am I missing something obvious?
 
  --
 
  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=.
 
 
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 
 
 
 -- 
 Jack Widman
 
 co-founder / cto,  Authoritude, Inc.
 
 203-641-9355
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.

--

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




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

2009-11-23 Thread Eric Bowman
Some people consider it slightly evil, but you can also just do mvn ...
-Dtest=false.  Less typing.

David Bernard wrote:
 To run maven without compiling+running test from commandline :

 mvn  -Dmaven.test.skip=true

 To fully disable test without commenting them :
 edit pom.xml
 properties
   maven.test.skiptrue/maven.test.skip
 /properties

 (I prefer using the property instead of directly configure surfire
 because :
 * don't require to add a surfire section if it doesn't already exists
 * some profile (eg : integration test) are enabled only if
 maven.test.skip != true (include false, not-define,...)
 )

 On Fri, Nov 20, 2009 at 01:31, David Pollak
 feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com
 wrote:

 Folks,

 The 280_port of Lift properly compiles and runs the Lift demo
 application against the Scala 2.8.0 nightly.

 I spent most of today tracking down a bug that I can't reproduce
 in isolation, but it seems that the ensureCapacity method in
 Scala's StringBuilder method has an infinite:

 def ensureCapacity(n: Int) {
 117
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L117
   if (n  array.length) {
 118
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L118
 var newsize = array.length * 2
 119
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L119
 while (n  newsize)
 120
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L120
   newsize = newsize * 2
 121
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L121
 val newar = new Array[Char](newsize)
 122
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L122
 arraycopy(array, 0, newar, 0, count)
 123
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L123
 array = newar
 124
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L124
   }
 125
 
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L125
 }


 I saw an infinite loop in lines 119/120 (it was line 115 in the
 version I was testing against).  I replaced Scala's StringBuilder
 with the Java native code and all worked just fine.  It might be
 worth a gander at the byte-code for StringBuilder to see how an
 infinite loop could happen.

 Anyway, I'm looking forward to the next drop of a stable 2.8.0 so
 I can compile against Specs and get a more complete (read: passes
 tests... right now the tests are commented out because I don't
 have the Specs/ScalaCheck/etc. chain in the 2.8.0 nightly).

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


 --

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


-- 
Eric Bowman
Boboco Ltd
ebow...@boboco.ie
http://www.boboco.ie/ebowman/pubkey.pgp
+35318394189/+353872801532

--

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




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

2009-11-23 Thread David Bernard
I agree skipping test is BAD, but in the case of 2.8 for lift or when
running test is long and you need to run install (eg to check compilation on
a multi-module project).

-Dtest=false less typing but not the same result : -Dtest=false == avoid
running test not compiling them and generate this

[INFO] [surefire:test]
[INFO] Surefire report directory:
/home/dwayne/work/./target/surefire-reports

---
 T E S T S
---
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] No tests were executed!  (Set -DfailIfNoTests=false to ignore this
error.)


/davidB

On Mon, Nov 23, 2009 at 14:59, Eric Bowman ebow...@boboco.ie wrote:

 Some people consider it slightly evil, but you can also just do mvn ...
 -Dtest=false.  Less typing.

 David Bernard wrote:
  To run maven without compiling+running test from commandline :
 
  mvn  -Dmaven.test.skip=true
 
  To fully disable test without commenting them :
  edit pom.xml
  properties
maven.test.skiptrue/maven.test.skip
  /properties
 
  (I prefer using the property instead of directly configure surfire
  because :
  * don't require to add a surfire section if it doesn't already exists
  * some profile (eg : integration test) are enabled only if
  maven.test.skip != true (include false, not-define,...)
  )
 
  On Fri, Nov 20, 2009 at 01:31, David Pollak
  feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com
  wrote:
 
  Folks,
 
  The 280_port of Lift properly compiles and runs the Lift demo
  application against the Scala 2.8.0 nightly.
 
  I spent most of today tracking down a bug that I can't reproduce
  in isolation, but it seems that the ensureCapacity method in
  Scala's StringBuilder method has an infinite:
 
  def ensureCapacity(n: Int) {
  117
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L117
 
if (n  array.length) {
  118
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L118
 
  var newsize = array.length * 2
  119
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L119
 
  while (n  newsize)
  120
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L120
 
newsize = newsize * 2
  121
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L121
 
  val newar = new Array[Char](newsize)
  122
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L122
 
  arraycopy(array, 0, newar, 0, count)
  123
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L123
 
  array = newar
  124
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L124
 
}
  125
  
 http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/collection/mutable/StringBuilder.scala?view=markup#L125
 
  }
 
 
  I saw an infinite loop in lines 119/120 (it was line 115 in the
  version I was testing against).  I replaced Scala's StringBuilder
  with the Java native code and all worked just fine.  It might be
  worth a gander at the byte-code for StringBuilder to see how an
  infinite loop could happen.
 
  Anyway, I'm looking forward to the next drop of a stable 2.8.0 so
  I can compile against Specs and get a more complete (read: passes
  tests... right now the tests are commented out because I don't
  have the Specs/ScalaCheck/etc. chain in the 2.8.0 nightly).
 
  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
  mailto:liftweb@googlegroups.com.
  To unsubscribe from this group, send email to
  
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
  
  

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

2009-11-23 Thread Jeremy Day
All,

I'm admittedly quite a n00b here and I have  very little Maven experience.
Can someone provide a POM for the Nginx + Jetty configuration?  I think that
I would find it quite helpful.  Thanks.

Jeremy

2009/11/20 Timothy Perrett timo...@getintheloop.eu

 Your missing a trick here - there is a fork of nginx done by Ezra that
 includes a fair load balencer.

 Google for it and you'll find the link as I don't have it handy - this
 version would remove the need for your intermediate proxy.

 Cheers, Tim

 Sent from my iPhone

 On 20 Nov 2009, at 06:59, monty chen montyc...@qq.com wrote:

  Hi,David Pollk!
 
  Nginx only comes with a round-robin balancer and a hash-based
  balancer, so if a request takes a while to load, Nginx will start
  routing requests to backends that are already processing requests --
  as
  a result, some backends will be queueing up requests while some
  backends will remain idle. You will get an uneven load distribution,
  and the unevenness will increase with the amount of load subject to
  the load-balancer.
 
  Haproxy as a LB can:
  1: Plenty of load-balancing algorithms, including a least
  connections strategy that picks the backend with the fewest pending
  connections. Which happens to be just what we want.
 
  2:  Backends can be sanity- and health-checked by URL to avoid routing
  requests to brain-damaged backends. (It can even stagger these checks
  to avoid spikes.)
 
  3: Requests can be routed based on all sorts of things: cookies, URL
  substrings, client IP, etc.
 
  So, I use nginx + haproxy + tomcat(jetty).
 
 
  On 11月20日, 上午11时27分, David Pollak
  feeder.of.the.be...@gmail.com
  wrote:
  I recommend Nginx + Jetty.
 
  Apache is the worst front end for this situation... it can only
  support a
  few hundred simultaneous connections before it falls over.  Ngnix
  on the
  other hand can proxy tens of thousands.
 
  Jetty's continuations make it a much better choice than Tomcat.
  You can
  have thousands of open Comet request to a Jetty instance where
  Tomcat is
  capped at a couple of hundred.
 
  Once the Servlet 3.0 spec in implemented in Glassfish, etc., Lift
  will
  support 3.0 continuations and any 3.0 container will have the same
  scaling
  characteristics that Jetty currently does.
 
 
 
  On Thu, Nov 19, 2009 at 5:35 PM, Neil.Lv anim...@gmail.com wrote:
  Hi all,
 
  I have a silly question about the deploy.
 
  Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?
 
  I want to use the Comet to push the data in the app.
 
  * Apache + Tomcat ?
  * Apache + what  ?
  * Nginx + what ?
 
  Thanks for any suggestion !
 
  Cheers,
  Neil
 
  --
 
  You received this message because you are subscribed to the Google
  Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb
  %2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics
 
  --
 
  You received this message because you are subscribed to the Google
  Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=
  .
 
 
 

 --

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




--

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




[Lift] Re: Where are the dragons hiding?

2009-11-23 Thread Marius
It should be just fine.

You can tell lift to not use Ajax or any JS at all. There are some
flags in LiftRules to do that.

LiftRules.setAutoIncludeComet = false;
LiftRules.setAutoIncludeAjax = false;


Besides that just don't use JS in your markup or don't use Lift's ajax
stuff.

Lift works with no cookies. Turning off cookies from container would
automatically make Lift to use url-rewriting and put jsessionid in
urls.

You should be able to use XHTML MP with no problems.

Br's,
Marius

On Nov 20, 6:28 am, ngocdaothanh ngocdaoth...@gmail.com wrote:
 Is Lift suitable for web for mobiles?

 Generally web for mobiles (especially in Japan) has some
 characteristics:
 * No JavaScript support
 * No cookie support
 * Non standard HTML tags

 Thanks

  I think this thread contains the key dragons in Lift.  Basically, it boils
  down to: Lift is highly stateful... that has its pluses and minuses.  We're
  working on mitigating the minuses (session replication and persistence).

--

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




[Lift] Combined primary key?

2009-11-23 Thread Arthur
Hi all

I can't seem to find a way to use a combined primary key. The use case
I'm looking at would be something like a bug tracker where you can
comment on each bug. Each comment would have a number (only unique
within each bug report). In SQL I'd write something like:

CREATE TABLE bug_comments (
  bugid integer REFERENCES bugs (id),
  number integer,
  comment text,
  PRIMARY KEY (bugid, number)
)

I've seen that I can enforce the uniqueness of (bugid, number) with
def dbIndexes = Index (bugid, number) :: super.dbIndexes

I'd like to have the comments numbered 1..n in each bug so they can be
easily referenced. What is the common way to do this in Lift? Should I
try to go that way or would you abandon the combined primary key and
simply use a synthetic primary key with LongKeyedMapper with IdPK?

Thanks for any input.

Yours

Arthur

--

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




Re: [Lift] Re: Where are the dragons hiding?

2009-11-23 Thread Jeppe Nejsum Madsen
Marius marius.dan...@gmail.com writes:

 It should be just fine.

 You can tell lift to not use Ajax or any JS at all. There are some
 flags in LiftRules to do that.

 LiftRules.setAutoIncludeComet = false;
 LiftRules.setAutoIncludeAjax = false;


 Besides that just don't use JS in your markup or don't use Lift's ajax
 stuff.

Even if you don't explicitly use any Ajax, I believe Lift will store
callback mappings in the session? How does Lift's GC work if there's no
JS support? 

/Jeppe

--

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




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

2009-11-23 Thread Timothy Perrett
Ummm, there is no pom for this - its not that kind of thing. 

NGINX is a front end C application - if you want the fair load balencer, just 
download the module and compile into your NGINX build.

Cheers, Tim 

On 20 Nov 2009, at 10:59, Jeremy Day wrote:

 All,
 
 I'm admittedly quite a n00b here and I have  very little Maven experience.  
 Can someone provide a POM for the Nginx + Jetty configuration?  I think that 
 I would find it quite helpful.  Thanks.
 
 Jeremy
 
 2009/11/20 Timothy Perrett timo...@getintheloop.eu
 Your missing a trick here - there is a fork of nginx done by Ezra that
 includes a fair load balencer.
 
 Google for it and you'll find the link as I don't have it handy - this
 version would remove the need for your intermediate proxy.
 
 Cheers, Tim
 
 Sent from my iPhone
 
 On 20 Nov 2009, at 06:59, monty chen montyc...@qq.com wrote:
 
  Hi,David Pollk!
 
  Nginx only comes with a round-robin balancer and a hash-based
  balancer, so if a request takes a while to load, Nginx will start
  routing requests to backends that are already processing requests --
  as
  a result, some backends will be queueing up requests while some
  backends will remain idle. You will get an uneven load distribution,
  and the unevenness will increase with the amount of load subject to
  the load-balancer.
 
  Haproxy as a LB can:
  1: Plenty of load-balancing algorithms, including a least
  connections strategy that picks the backend with the fewest pending
  connections. Which happens to be just what we want.
 
  2:  Backends can be sanity- and health-checked by URL to avoid routing
  requests to brain-damaged backends. (It can even stagger these checks
  to avoid spikes.)
 
  3: Requests can be routed based on all sorts of things: cookies, URL
  substrings, client IP, etc.
 
  So, I use nginx + haproxy + tomcat(jetty).
 
 
  On 11月20日, 上午11时27分, David Pollak
  feeder.of.the.be...@gmail.com
  wrote:
  I recommend Nginx + Jetty.
 
  Apache is the worst front end for this situation... it can only
  support a
  few hundred simultaneous connections before it falls over.  Ngnix
  on the
  other hand can proxy tens of thousands.
 
  Jetty's continuations make it a much better choice than Tomcat.
  You can
  have thousands of open Comet request to a Jetty instance where
  Tomcat is
  capped at a couple of hundred.
 
  Once the Servlet 3.0 spec in implemented in Glassfish, etc., Lift
  will
  support 3.0 continuations and any 3.0 container will have the same
  scaling
  characteristics that Jetty currently does.
 
 
 
  On Thu, Nov 19, 2009 at 5:35 PM, Neil.Lv anim...@gmail.com wrote:
  Hi all,
 
  I have a silly question about the deploy.
 
  Which web container is recommended to use to deploy the Lift app ?
  Jetty or Tomcat ?
 
  I want to use the Comet to push the data in the app.
 
  * Apache + Tomcat ?
  * Apache + what  ?
  * Nginx + what ?
 
  Thanks for any suggestion !
 
  Cheers,
  Neil
 
  --
 
  You received this message because you are subscribed to the Google
  Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb
  %2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics
 
  --
 
  You received this message because you are subscribed to the Google
  Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com
  .
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=
  .
 
 
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.

--

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




Re: [Lift] Re: Call it Lift 2.0

2009-11-23 Thread Josh Suereth
The real question is could you still keep source compatibility if you made
use of some interesting implict and @deprecated annotations?   I believe
those are acceptable.

- Josh

On Mon, Nov 23, 2009 at 6:05 AM, Timothy Perrett timo...@getintheloop.euwrote:

 Interesting - this is something i've not actually thought about: If we were
 to compile a list of all the breaking changes in 1.1, perhaps that would
 give some focus to this discussion... as josh points out, there are most
 likely quite a few now and 1.0 - 1.1 is a fairly short jump.

 Loc and LocParam
 Actor - LiftActor
 Full,Box etc have moved packages
 JSON parsing alterations and changes in JsExp

 Im probably missing a number of others, but we are talking about some
 fairly significant breaks here, right?

 Cheers, Tim

 On 23 Nov 2009, at 07:09, Heiko Seeberger wrote:

  Josh,
 
  Thank you for your brilliant elaboration of compatibility issues!
 
  2009/11/22 Josh Suereth joshua.suer...@gmail.com
  The real question is, with all these breaking changes in lift 1.1, has
 any attempt been made at source-compatability?   If not, I would argue a
 bigger version jump than 1.1.
 
  The current Lift is not source compatible with 1.0.x, just consider Box
 moved from ...util to ...common.
  Hence you would go for 2.0, right?
 
  Also, there is the possibility of taking the version system and adding a
 functionality milestone version at the begginning.  In this case, you can
 use that number for marketting purposes (e.g. Lift goes 1.0!).   Your
 version number would then be   Marketing.SourceCompatability.All but
 Trait BinaryCompatability.Binary Compatibility.
 
  I am all against using versioning policy for marketing!
 
  Heiko Seeberger
 
  My job: weiglewilczek.com
  My blog: heikoseeberger.name
  Follow me: twitter.com/hseeberger
  OSGi on Scala: scalamodules.org
  Lift, the simply functional web framework: liftweb.net
 
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.

 --

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




--

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




Re: [Lift] Re: Call it Lift 2.0

2009-11-23 Thread Josh Suereth
On Mon, Nov 23, 2009 at 2:09 AM, Heiko Seeberger 
seeber...@weiglewilczek.com wrote:

 Josh,

 Thank you for your brilliant elaboration of compatibility issues!

 [snip/]


 Also, there is the possibility of taking the version system and adding a
 functionality milestone version at the begginning.  In this case, you can
 use that number for marketting purposes (e.g. Lift goes 1.0!).   Your
 version number would then be   Marketing.SourceCompatability.All but
 Trait BinaryCompatability.Binary Compatibility.


 I am all against using versioning policy for marketing!




Ah, but this is the real world.  Providing a means for marketing to use the
first version number and still letting engineering have some control seems a
better world to me than what I currently have ;)

- Josh

--

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




Re: [Lift] Re: Where are the dragons hiding?

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 7:24 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:

 Marius marius.dan...@gmail.com writes:

  It should be just fine.
 
  You can tell lift to not use Ajax or any JS at all. There are some
  flags in LiftRules to do that.
 
  LiftRules.setAutoIncludeComet = false;
  LiftRules.setAutoIncludeAjax = false;
 
 
  Besides that just don't use JS in your markup or don't use Lift's ajax
  stuff.

 Even if you don't explicitly use any Ajax, I believe Lift will store
 callback mappings in the session? How does Lift's GC work if there's no
 JS support?


The functions are retained for the duration of the session.  This will not
likely cause an issue on mobiles and the usage is not likely to produce a
lot of pages/forms during a given session.



 /Jeppe

 --

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





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

--

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




Re: [Lift] Re: How to make Ajax call from onLoad/onResize?

2009-11-23 Thread Ross Mellgren
If those other issues are with lift and you're stuck, of course feel  
free to post to the list for help.

-Ross

On Nov 20, 2009, at 9:31 AM, jhonig wrote:

 Hi Ross,

 I haven't been able to test your solution yet, still struggling with
 several other
 issues.  I seldom feel this unproductive, I'm afraid, the lack of
 documentation
 and issues of what documentation are up to date are both troubling me.

 Thanks for your help and I will definitely post back once I was
 successful.

 Job H.

 PS: maybe I will now be someone else: google groups wanted me to re-
 register to this group with a new nickname...

 On Nov 18, 10:18 pm, Ross Mellgren dri...@gmail.com wrote:
 Yes, jsonCall is an extension of ajaxCall that automatically does the
 JSON conversion for you, which why you get an immutable.Map out of it
 rather than a blob of text. Let me know how it works out.

 -Ross

 On Nov 18, 2009, at 4:16 PM, jhonig wrote:

 Hi Ross,

 Thanks for your suggestion!  So I can actually use any jsonCall as  
 if
 it were
 Ajax and deal with the result...  OK, nice.  Will try it out  
 tomorrow!

 Job

 On Nov 18, 6:24 pm, Ross Mellgren dri...@gmail.com wrote:
 (n.b. not compiled or tested, and there might be an easier way:)

 class MySnippet {
def handlers(ns: NodeSeq): NodeSeq = {
val handleResize = SHtml.jsonCall(JE.JsObj(width -
 JE.JsVar
 (window, screen, width),
   height -
 JE.JsVar(window, screen, height)),
  obj = {
val result = for {
   m - (Box!!obj).asA[scala.collection.immutable.Map
 [String, Any]]
   width  - m.get(width).asA[Int]
   height - m.get(height).asA[Int]
} yield {
   // do stuff with the width and height

   // some JS command to send back to the browser
   JsCmds.Noop
}

result.openOr(/* JS command to send back to browser if  
 we
 failed to get arguments and so on */ JsCmds.Noop)
})._2

head{ Script {
Function(handleResize, Nil, handleResize)
} }/head
}

 }

 Then in your template say onResize=handleResize()

 Hope that gives you some pointers,
 -Ross

 On Nov 18, 2009, at 4:19 AM, jhonig wrote:

 Hi All,

 Yet another question: I need to make Ajax calls when a page is
 loaded
 or resized.  The call would need to pass some local client
 information
 (browser size).  The return should be javascript code that
 populates a
 div on that page (in particular: an image that is scaled on the
 server
 to match the browser size).   Actually, local js code is in place
 that
 makes the call only after the user has stopped resizing (using a
 timeout).

 I guess I have to use AjaxCall, providing an expression that puts
 the
 window dimensions in an array or list, then return the  
 javascript to
 add an img tag that downloads the scaled image from a generated
 url.

 Given the level of success I achieved so far, I thought I better  
 ask
 if this would work our before I start trying endlessly.

 Thanks for any suggestions,

 Job

 --

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

 --

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

 --

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



--

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




Re: [Lift] Combined primary key?

2009-11-23 Thread Ross Mellgren
I have heard on the list previously that compound primary keys are not  
supported by mapper.

-Ross

On Nov 23, 2009, at 10:18 AM, Arthur wrote:

 Hi all

 I can't seem to find a way to use a combined primary key. The use case
 I'm looking at would be something like a bug tracker where you can
 comment on each bug. Each comment would have a number (only unique
 within each bug report). In SQL I'd write something like:

 CREATE TABLE bug_comments (
  bugid integer REFERENCES bugs (id),
  number integer,
  comment text,
  PRIMARY KEY (bugid, number)
 )

 I've seen that I can enforce the uniqueness of (bugid, number) with
 def dbIndexes = Index (bugid, number) :: super.dbIndexes

 I'd like to have the comments numbered 1..n in each bug so they can be
 easily referenced. What is the common way to do this in Lift? Should I
 try to go that way or would you abandon the combined primary key and
 simply use a synthetic primary key with LongKeyedMapper with IdPK?

 Thanks for any input.

 Yours

 Arthur

 --

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



--

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




Re: [Lift] labels for inputs

2009-11-23 Thread Naftoli Gugenheim
One reason is that the regular arrow takes a NodeSeq which can't necessarily 
have attributes; for example it might be a few Elems. The new arrow takes Elem 
which can.

-
Chris Lewisburningodzi...@gmail.com wrote:

Thanks Naftoli, that did it. I wonder, why use a new method -% for 
attribute preservation?

Naftoli Gugenheim wrote:
 This was changed. Instead, with the regular arrow - attributes are not 
 preserved at all, and a new arrow was introduced -% that preserves all 
 attributes from the template as is.
 This is in addition to being able to pass attributes to many SHtml methods; 
 being able to add attributes to the returned NodeSeq; binding on attributes; 
 and attribute snippets.
 
 -
 Chris Lewisburningodzi...@gmail.com wrote:
 
 Hello list,
 
 I was looking for a way to attach label elements to form inputs (via 
 DOM id), and I came across this thread:
 
 http://www.mail-archive.com/liftweb@googlegroups.com/msg04821.html
 
 This suggests that bind points, when expanded, result in elements that 
 have any attribute under the bind point namespace merged into the result 
 element. This isn't working in 1.1-M7, unless I'm misunderstanding 
 something.
 
 Given this template code:
 
  lift:Order.allOrders
tr
  tdorder:status order:id=status//td
/tr
  /lift:Order.allOrders
 
 
 I should see a DOM id of status on the resulting element, right? Instead 
 it's just ignored. Am I doing something wrong?
 
 thanks!
 chris
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 

--

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


--

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




Re: [Lift] Working with legacy databases

2009-11-23 Thread Jim Barrows
On Sat, Nov 21, 2009 at 8:16 PM, Donald McLean dmclea...@gmail.com wrote:

 We are considering porting an existing Java desktop app to a
 Scala/lift web app. The application works with a Sybase DB. I'm still
 pretty new to Scala and Lift so I'm probably overlooking something
 obvious but could someone recommend a technology that is know to work
 for this environment? I have used Hibernate in the past and will use
 it again if necessary but I would be interested to know if there are
 other options.


You have Record and Mapper, which are a part of lift.  You have Scala QL.
Since Lift is written in Scala you have a plethora of Java based ORM's and
DB acccess libraries as well.

It's your choice, really.



 Thank you,

 Donald

 --
 Family photographs are a critical legacy for
 ourselves and our descendants. Protect that
 legacy with a digital backup and recovery plan.

 Join the photo preservation advocacy Facebook group:
 http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

 --

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





-- 
James A Barrows

--

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




Re: [Lift] Working with legacy databases

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 8:38 AM, Jim Barrows jim.barr...@gmail.com wrote:



 On Sat, Nov 21, 2009 at 8:16 PM, Donald McLean dmclea...@gmail.comwrote:

 We are considering porting an existing Java desktop app to a
 Scala/lift web app. The application works with a Sybase DB. I'm still
 pretty new to Scala and Lift so I'm probably overlooking something
 obvious but could someone recommend a technology that is know to work
 for this environment? I have used Hibernate in the past and will use
 it again if necessary but I would be interested to know if there are
 other options.


 You have Record and Mapper, which are a part of lift.  You have Scala QL.
 Since Lift is written in Scala you have a plethora of Java based ORM's and
 DB acccess libraries as well.


Neither Mapper or Record supports Sybase... I think a JPA solution or even
using the existing Java-based model classes might be the best bet.

Thanks,

David



 It's your choice, really.



 Thank you,

 Donald

 --
 Family photographs are a critical legacy for
 ourselves and our descendants. Protect that
 legacy with a digital backup and recovery plan.

 Join the photo preservation advocacy Facebook group:
 http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

 --

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





 --
 James A Barrows


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




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

--

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




Re: [Lift] Combined primary key?

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 8:30 AM, Ross Mellgren dri...@gmail.com wrote:

 I have heard on the list previously that compound primary keys are not
 supported by mapper.


That'd be correct.  Please use JPA.



 -Ross

 On Nov 23, 2009, at 10:18 AM, Arthur wrote:

  Hi all
 
  I can't seem to find a way to use a combined primary key. The use case
  I'm looking at would be something like a bug tracker where you can
  comment on each bug. Each comment would have a number (only unique
  within each bug report). In SQL I'd write something like:
 
  CREATE TABLE bug_comments (
   bugid integer REFERENCES bugs (id),
   number integer,
   comment text,
   PRIMARY KEY (bugid, number)
  )
 
  I've seen that I can enforce the uniqueness of (bugid, number) with
  def dbIndexes = Index (bugid, number) :: super.dbIndexes
 
  I'd like to have the comments numbered 1..n in each bug so they can be
  easily referenced. What is the common way to do this in Lift? Should I
  try to go that way or would you abandon the combined primary key and
  simply use a synthetic primary key with LongKeyedMapper with IdPK?
 
  Thanks for any input.
 
  Yours
 
  Arthur
 
  --
 
  You received this message because you are subscribed to the Google
  Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=
  .
 
 

 --

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





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

--

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




Re: [Lift] Re: Call it Lift 2.0

2009-11-23 Thread Timothy Perrett
I guess this conversation should have taken place before we started doing 
milestone releases etc - stuff thats broken will have to stay broken now 
otherwise we'll be making more breaking changes just to un-break previous 
stuff... 

Cheers, Tim

On 23 Nov 2009, at 16:18, Josh Suereth wrote:

 The real question is could you still keep source compatibility if you made 
 use of some interesting implict and @deprecated annotations?   I believe 
 those are acceptable.
 
 - Josh
 
 On Mon, Nov 23, 2009 at 6:05 AM, Timothy Perrett timo...@getintheloop.eu 
 wrote:
 Interesting - this is something i've not actually thought about: If we were 
 to compile a list of all the breaking changes in 1.1, perhaps that would give 
 some focus to this discussion... as josh points out, there are most likely 
 quite a few now and 1.0 - 1.1 is a fairly short jump.
 
 Loc and LocParam
 Actor - LiftActor
 Full,Box etc have moved packages
 JSON parsing alterations and changes in JsExp
 
 Im probably missing a number of others, but we are talking about some fairly 
 significant breaks here, right?
 
 Cheers, Tim
 
 On 23 Nov 2009, at 07:09, Heiko Seeberger wrote:
 
  Josh,
 
  Thank you for your brilliant elaboration of compatibility issues!
 
  2009/11/22 Josh Suereth joshua.suer...@gmail.com
  The real question is, with all these breaking changes in lift 1.1, has any 
  attempt been made at source-compatability?   If not, I would argue a bigger 
  version jump than 1.1.
 
  The current Lift is not source compatible with 1.0.x, just consider Box 
  moved from ...util to ...common.
  Hence you would go for 2.0, right?
 
  Also, there is the possibility of taking the version system and adding a 
  functionality milestone version at the begginning.  In this case, you can 
  use that number for marketting purposes (e.g. Lift goes 1.0!).   Your 
  version number would then be   Marketing.SourceCompatability.All but 
  Trait BinaryCompatability.Binary Compatibility.
 
  I am all against using versioning policy for marketing!
 
  Heiko Seeberger
 
  My job: weiglewilczek.com
  My blog: heikoseeberger.name
  Follow me: twitter.com/hseeberger
  OSGi on Scala: scalamodules.org
  Lift, the simply functional web framework: liftweb.net
 
 
  --
 
  You received this message because you are subscribed to the Google Groups 
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to 
  liftweb+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/liftweb?hl=.
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 
 
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.

--

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




Re: [Lift] todo tutorial compile problem

2009-11-23 Thread David Pollak
What command line command did you use to create the project?

Is there a User.scala file in your model package/directory?

On Thu, Nov 19, 2009 at 9:42 PM, adamp adam.perrypellet...@gmail.comwrote:

 I'm brand new to Lift and Scala, but an old hand to Java.  I'm trying
 to work through the 'todo' example and get the following compile
 error.

 [INFO] excludes = []
 [INFO] Compiling 3 source files to C:\eclipse_workspaces\ws_riojas\todo
 \target\c
 lasses
 C:\eclipse_workspaces\ws_riojas\todo\src\main\scala\liftworkshop\model
 \ToDo.scal
 a:13: error: not found: value User
  object owner extends MappedLongForeignKey(this, User)
 ^
 C:\eclipse_workspaces\ws_riojas\todo\src\main\scala\liftworkshop\model
 \ToDo.scal
 a:13: error: wrong number of arguments for constructor Object: ()
 java.lang.Objec
 t
  object owner extends MappedLongForeignKey(this, User)
  ^
 two errors found
 [INFO]
 

 In java, I know exactly what this means and can usually figure it
 out.  But with Scala, I'm struggling.  The User object doesn't show up
 on the classpath and I'm wondering what jar/dependency I'm missing to
 get this to compile.

 Thanks in advance for any help.
 Adam

 --

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





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

--

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




Re: [Lift] url problem

2009-11-23 Thread David Pollak
On Sun, Nov 22, 2009 at 11:36 PM, mr najmi mnajm...@gmail.com wrote:

 dear all,

 i have one problem in url rewriting..what i want is something like
 this guest/view?branch=?date=?...or guest/view/branch/date.

 my code as below:

 LiftRules.rewrite.append {
case RewriteRequest(
ParsePath(List(guest, view, branch, date),_,_,_),_,_) =
RewriteResponse(List(guest,view), Map(branch -
 branch,date - date))
}

 val entries = Menu(Loc(Home, List(index), Home))::
Menu(Loc(View, guest::view::Nil, View)):: User.sitemap
LiftRules.setSiteMap(SiteMap(entries:_*))

 and my error is

 The Requested URL guest/view/Full(1)/Full(11/17/2009) was not found on


the above URL will parse to:

List(guest, view, Full(1), Full(11, 17, 2009))

This does not match

List(guest, view, branch, date)

When you generate your URL, please make sure the URL Encode each path
element (see Helpers.urlEncode)

Thanks,

David

this server..can anyone help me..is it my code wrong. for your info
 view.html is in the guest folder


 --

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





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

--

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




[Lift] Wicked slow compilation speed

2009-11-23 Thread David Pollak
Folks,

In the last week, the compile-time for the Textile module has gone from 35
seconds to 55 seconds for me.  Does anyone have any idea of changes to
pom.xml files or maven-scala plugin that could have led to this slowdown?

Thanks,

David

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

--

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




[Lift] Lift archetypes broken

2009-11-23 Thread Timothy Perrett
Guys (IRC specifically),

The archetypes in master are broken:

[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Error creating from archetype

Embedded error: The META-INF/maven/archetype.xml descriptor cannot be
found.

Can someone please address this.

Thanks, Tim

--

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




[Lift] Re: Call it Lift 2.0

2009-11-23 Thread Heiko Seeberger
Please let's not widen this discussion into something else but the question
which versioning policy we are to apply. Building some kind of
compatibility layer could be done regardless of the next Lift version
number.

Do we have a consensus, that there are several substantial changes breaking
source and binary compatibility? And do we have a consensus, that this is
something which requires increasing the major version number?

Heiko

2009/11/23 Josh Suereth joshua.suer...@gmail.com

 The real question is could you still keep source compatibility if you made
 use of some interesting implict and @deprecated annotations?   I believe
 those are acceptable.

 - Josh


 On Mon, Nov 23, 2009 at 6:05 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:

 Interesting - this is something i've not actually thought about: If we
 were to compile a list of all the breaking changes in 1.1, perhaps that
 would give some focus to this discussion... as josh points out, there are
 most likely quite a few now and 1.0 - 1.1 is a fairly short jump.

 Loc and LocParam
 Actor - LiftActor
 Full,Box etc have moved packages
 JSON parsing alterations and changes in JsExp

 Im probably missing a number of others, but we are talking about some
 fairly significant breaks here, right?

 Cheers, Tim

 On 23 Nov 2009, at 07:09, Heiko Seeberger wrote:

  Josh,
 
  Thank you for your brilliant elaboration of compatibility issues!
 
  2009/11/22 Josh Suereth joshua.suer...@gmail.com
  The real question is, with all these breaking changes in lift 1.1, has
 any attempt been made at source-compatability?   If not, I would argue a
 bigger version jump than 1.1.
 
  The current Lift is not source compatible with 1.0.x, just consider Box
 moved from ...util to ...common.
  Hence you would go for 2.0, right?
 
  Also, there is the possibility of taking the version system and adding a
 functionality milestone version at the begginning.  In this case, you can
 use that number for marketting purposes (e.g. Lift goes 1.0!).   Your
 version number would then be   Marketing.SourceCompatability.All but
 Trait BinaryCompatability.Binary Compatibility.
 
  I am all against using versioning policy for marketing!
 
  Heiko Seeberger
 
  My job: weiglewilczek.com
  My blog: heikoseeberger.name
  Follow me: twitter.com/hseeberger
  OSGi on Scala: scalamodules.org
  Lift, the simply functional web framework: liftweb.net
 
 
  --
 
  You received this message because you are subscribed to the Google
 Groups Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.

 --

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



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




-- 
Heiko Seeberger

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



-- 
Heiko Seeberger
Managing Director Technology

Besuchen Sie unser Eclipse Demo Camp am 26.11. in Stuttgart
http://wiki.eclipse.org/Eclipse_DemoCamps_November_2009/Stuttgart

Weigle Wilczek GmbH
Martinstraße 42-44
73728 Esslingen
Deutschland

T (+49) 711 46050250
F (+49) 711 45999829
www.weiglewilczek.com

Geschäftsführer / Managing Directors: Dr. Jörn Weigle, Dr. Stephan Wilczek,
Heiko Seeberger
Sitz der Gesellschaft / Domicile: Esslingen a. N.
Amtsgericht / Register Court: Stuttgart, HRB 214442
USt-Ident.-Nr. / VAT ID: DE 213 472 880

--

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




[Lift] Re: Combined primary key?

2009-11-23 Thread Arthur
On 23 Nov., 17:42, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Mon, Nov 23, 2009 at 8:30 AM, Ross Mellgren dri...@gmail.com wrote:
  I have heard on the list previously that compound primary keys are not
  supported by mapper.

 That'd be correct.  Please use JPA.

Thanks Ross and David. Compound primary key, not combined primary key,
that's why I haven't found much. :) In that case I go with a synthetic
primary key.

Regards

Arthur

  On Nov 23, 2009, at 10:18 AM, Arthur wrote:

   Hi all

   I can't seem to find a way to use a combined primary key. The use case
   I'm looking at would be something like a bug tracker where you can
   comment on each bug. Each comment would have a number (only unique
   within each bug report). In SQL I'd write something like:

   CREATE TABLE bug_comments (
    bugid integer REFERENCES bugs (id),
    number integer,
    comment text,
    PRIMARY KEY (bugid, number)
   )

   I've seen that I can enforce the uniqueness of (bugid, number) with
   def dbIndexes = Index (bugid, number) :: super.dbIndexes

   I'd like to have the comments numbered 1..n in each bug so they can be
   easily referenced. What is the common way to do this in Lift? Should I
   try to go that way or would you abandon the combined primary key and
   simply use a synthetic primary key with LongKeyedMapper with IdPK?

   Thanks for any input.

   Yours

   Arthur

   --

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

  --

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

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

--

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




Re: [Lift] NPE in S.?! if used outside a request

2009-11-23 Thread David Pollak
I am okay with an NPE thrown from using S outside a request.  Yeah, it'd be
nicer to have a more polite error message, but there should be no creep
towards being able to call S outside a request/session scope.

Also, except for tests or actors, one should never think about initializing
S.



On Sat, Nov 21, 2009 at 3:28 PM, Ross Mellgren dri...@gmail.com wrote:

 Hmm, you raise an interesting point. So I guess the situation is more
 variegated:

 1) If you have a locale calculator that works per-request and does not have
 an app default, then it is definitely incorrect to call S.? out of a request
 context,
 2) but if you have one that works app-wide then it should work -- but
 doesn't, unless you call S.init or one of those by yourself,
 3) so my proposed error is not good.

 It would be nice to catch uses of S.? outside of a request context when
 your intended behavior is that you only have per-request locales, so I guess
 if that is the desire then one should make their locale calculator log the
 error text, and the change to lift should be something more like:

   def resourceBundles: List[ResourceBundle] = {
 -_resBundle.value match {
 -  case Nil = {
 +_resBundle.box match {
 +  case Full(bundles) if !bundles.isEmpty = bundles
 +  case _ = {
 _resBundle.set(LiftRules.resourceNames.flatMap(name = tryo(
   List(ResourceBundle.getBundle(name, locale))
   ).openOr(
   NamedPF.applyBox((name, locale),
 LiftRules.resourceBundleFactories.toList).map(List(_)) openOr Nil
   )))
 _resBundle.value
   }
 -  case bundles = bundles
 }
   }

 That is, if the _resBundle ThreadGlobal has not been initialized yet, or
 it's been initialized with the empty list, then do resource bundle loading.
 If it has been initialized with a non-empty list then use that.

 I don't think this should interact badly with S.init, since S.init uses
 _resBundle.doWith(Nil) ... which will both overwrite any loaded app-level
 bundles with the empty list, but also restore them upon completion of the S
 scope.

 -Ross


 On Nov 21, 2009, at 6:15 PM, Timothy Perrett wrote:

  I agree that getting an NPE is less than desirable!
 
  I'm not sure things are wrong per-say; the defualt locale calculator
  has an app wide setting and there is nothing to say that that a user
  must implement their locale calculator in a particular way... This is
  one of the great things about lift ;-)
 
  So the issue here seems to be the lazy / eager evaluation of bald
  rather than localization out of request context? I'm all for getting
  rid of these NPE scenarios though :-)
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 22 Nov 2009, at 00:02, Ross Mellgren dri...@gmail.com wrote:
 
  It's being called to provide the link text for menus during sitemap
  creation at boot time, as well as during class initialization time
  to make some vals that contain error text. I believe initializing
  these at Boot time to be incorrect since the correct locale cannot
  be known until a request is made (unless you force one locale for
  the entire site, I guess), but the NPE seems uglier than providing
  an error log explaining the problem.
 
  -Ross
 
 
  On Nov 21, 2009, at 5:57 PM, Timothy Perrett wrote:
 
  Ross,
 
  Where in your code are you calling this method? What I'd the context
  that puts it outside of a request?
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 21 Nov 2009, at 23:03, Ross Mellgren dri...@gmail.com wrote:
 
  I'm poking around the LiftTicket codebase, and currently it suffers
  from an NPE on Boot:
 
  ERROR - Failed to Boot
  java.lang.ExceptionInInitializerError
  at org.liftticket.liftticket.snippet.UserAdmin$.menus
  (UserAdmin.scala:41)
  at bootstrap.liftweb.Boot.buildMenus(Boot.scala:74)
  at bootstrap.liftweb.Boot.boot(Boot.scala:67)
  ...
  Caused by: java.lang.NullPointerException
  at net.liftweb.http.S$.$qmark$bang(S.scala:675)
  at net.liftweb.http.S$.$qmark(S.scala:636)
  at org.liftticket.liftticket.snippet.RoleAdmin$.init
  (RoleAdmin.scala:94)
  at org.liftticket.liftticket.snippet.RoleAdmin$.clinit
  (RoleAdmin.scala)
  ... 57 more
 
  This is apparently due to S._resBundle being null because S.init has
  not yet been entered, so S._resBundle.doWith(Nil) is not in the
  enclosing scope, and so:
 
  private def ?!(str: String, resBundle: List[ResourceBundle]):
  String = resBundle.flatMap(r = tryo(r.getObject(str) match {
 
  Blows up with NPE. resBundle is passed in from S.? by calling
  S.resourceBundles, which is defined thus:
 
  def resourceBundles: List[ResourceBundle] = {
  _resBundle.value match {
case Nil = {
   // loads the resource bundles here
}
case bundles = bundles
  }
  }
 
  I don't think the resource bundles can be reasonably loaded outside
  a request since no locale can be computed -- the call site should
  lazily compute the menu text at request time using LinkText rather
  than eagerly using S.?, but the error case is 

Re: [Lift] Working with legacy databases

2009-11-23 Thread Jean-Luc
I think scalajpa is a very good option if your database is supported by the
underlying jpa provider.
- according to https://www.hibernate.org/80.html, the hibernate / sybase
supported version is Sybase 12.5 (JConnect 5.5)
- according to https://www.hibernate.org/120.html, there is some Batch
update issue with Sybase

If you have another database version, you can customize the generated sql
writing your own custom Dialect class.

A few issues I had :
- hibernate + cglib + scala : using a lot of permgen memory, exhausted
PermGen memory can cause OutOfMemoryException (solution : add some more
PermGen memory with -XX:MaxPermSize)
- hibernate + c3po + mysql : issue with connection pool, connections with
timeout are reused and issue errors (solution : review code and always call
cleanup when necessary)

Maybe someone else will provide some info about other JPA providers.

You can generate your first scala/jpa web application using the
lift-archetype-jpa-basic / 1.1-SNAPSHOT archetype. Don't forget to use
http://scala-tools.org/repo-snapshots repository.

If you have any problem, just ask !

Jean-Luc
jlcane...@gmail.com


2009/11/23 David Pollak feeder.of.the.be...@gmail.com



 On Mon, Nov 23, 2009 at 8:38 AM, Jim Barrows jim.barr...@gmail.comwrote:



 On Sat, Nov 21, 2009 at 8:16 PM, Donald McLean dmclea...@gmail.comwrote:

 We are considering porting an existing Java desktop app to a
 Scala/lift web app. The application works with a Sybase DB. I'm still
 pretty new to Scala and Lift so I'm probably overlooking something
 obvious but could someone recommend a technology that is know to work
 for this environment? I have used Hibernate in the past and will use
 it again if necessary but I would be interested to know if there are
 other options.


 You have Record and Mapper, which are a part of lift.  You have Scala QL.
 Since Lift is written in Scala you have a plethora of Java based ORM's and
 DB acccess libraries as well.


 Neither Mapper or Record supports Sybase... I think a JPA solution or even
 using the existing Java-based model classes might be the best bet.

 Thanks,

 David



 It's your choice, really.



 Thank you,

 Donald

 --
 Family photographs are a critical legacy for
 ourselves and our descendants. Protect that
 legacy with a digital backup and recovery plan.

 Join the photo preservation advocacy Facebook group:
 http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

 --

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





 --
 James A Barrows


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




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

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

 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.




-- 
Jean-Luc Canela
jlcane...@gmail.com

--

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




Re: [Lift] NPE in S.?! if used outside a request

2009-11-23 Thread Ross Mellgren
So would you prefer no change or change to have better error message?

-Ross

On Nov 23, 2009, at 1:55 PM, David Pollak wrote:

 I am okay with an NPE thrown from using S outside a request.  Yeah,  
 it'd be nicer to have a more polite error message, but there should  
 be no creep towards being able to call S outside a request/session  
 scope.

 Also, except for tests or actors, one should never think about  
 initializing S.



 On Sat, Nov 21, 2009 at 3:28 PM, Ross Mellgren dri...@gmail.com  
 wrote:
 Hmm, you raise an interesting point. So I guess the situation is  
 more variegated:

 1) If you have a locale calculator that works per-request and does  
 not have an app default, then it is definitely incorrect to call S.?  
 out of a request context,
 2) but if you have one that works app-wide then it should work --  
 but doesn't, unless you call S.init or one of those by yourself,
 3) so my proposed error is not good.

 It would be nice to catch uses of S.? outside of a request context  
 when your intended behavior is that you only have per-request  
 locales, so I guess if that is the desire then one should make their  
 locale calculator log the error text, and the change to lift should  
 be something more like:

   def resourceBundles: List[ResourceBundle] = {
 -_resBundle.value match {
 -  case Nil = {
 +_resBundle.box match {
 +  case Full(bundles) if !bundles.isEmpty = bundles
 +  case _ = {
 _resBundle.set(LiftRules.resourceNames.flatMap(name = tryo(
   List(ResourceBundle.getBundle(name, locale))
   ).openOr(
   NamedPF.applyBox((name, locale),  
 LiftRules.resourceBundleFactories.toList).map(List(_)) openOr Nil
   )))
 _resBundle.value
   }
 -  case bundles = bundles
 }
   }

 That is, if the _resBundle ThreadGlobal has not been initialized  
 yet, or it's been initialized with the empty list, then do resource  
 bundle loading. If it has been initialized with a non-empty list  
 then use that.

 I don't think this should interact badly with S.init, since S.init  
 uses _resBundle.doWith(Nil) ... which will both overwrite any loaded  
 app-level bundles with the empty list, but also restore them upon  
 completion of the S scope.

 -Ross


 On Nov 21, 2009, at 6:15 PM, Timothy Perrett wrote:

  I agree that getting an NPE is less than desirable!
 
  I'm not sure things are wrong per-say; the defualt locale calculator
  has an app wide setting and there is nothing to say that that a user
  must implement their locale calculator in a particular way... This  
 is
  one of the great things about lift ;-)
 
  So the issue here seems to be the lazy / eager evaluation of bald
  rather than localization out of request context? I'm all for getting
  rid of these NPE scenarios though :-)
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 22 Nov 2009, at 00:02, Ross Mellgren dri...@gmail.com wrote:
 
  It's being called to provide the link text for menus during sitemap
  creation at boot time, as well as during class initialization time
  to make some vals that contain error text. I believe initializing
  these at Boot time to be incorrect since the correct locale cannot
  be known until a request is made (unless you force one locale for
  the entire site, I guess), but the NPE seems uglier than providing
  an error log explaining the problem.
 
  -Ross
 
 
  On Nov 21, 2009, at 5:57 PM, Timothy Perrett wrote:
 
  Ross,
 
  Where in your code are you calling this method? What I'd the  
 context
  that puts it outside of a request?
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 21 Nov 2009, at 23:03, Ross Mellgren dri...@gmail.com wrote:
 
  I'm poking around the LiftTicket codebase, and currently it  
 suffers
  from an NPE on Boot:
 
  ERROR - Failed to Boot
  java.lang.ExceptionInInitializerError
  at org.liftticket.liftticket.snippet.UserAdmin$.menus
  (UserAdmin.scala:41)
  at bootstrap.liftweb.Boot.buildMenus(Boot.scala:74)
  at bootstrap.liftweb.Boot.boot(Boot.scala:67)
  ...
  Caused by: java.lang.NullPointerException
  at net.liftweb.http.S$.$qmark$bang(S.scala:675)
  at net.liftweb.http.S$.$qmark(S.scala:636)
  at org.liftticket.liftticket.snippet.RoleAdmin$.init
  (RoleAdmin.scala:94)
  at org.liftticket.liftticket.snippet.RoleAdmin$.clinit
  (RoleAdmin.scala)
  ... 57 more
 
  This is apparently due to S._resBundle being null because  
 S.init has
  not yet been entered, so S._resBundle.doWith(Nil) is not in the
  enclosing scope, and so:
 
  private def ?!(str: String, resBundle: List[ResourceBundle]):
  String = resBundle.flatMap(r = tryo(r.getObject(str) match {
 
  Blows up with NPE. resBundle is passed in from S.? by calling
  S.resourceBundles, which is defined thus:
 
  def resourceBundles: List[ResourceBundle] = {
  _resBundle.value match {
case Nil = {
   // loads the resource bundles here
}
case bundles = bundles
  }
  }
 
  I don't think the resource bundles can be reasonably loaded  
 

Re: [Lift] NPE in S.?! if used outside a request

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 11:01 AM, Ross Mellgren dri...@gmail.com wrote:

 So would you prefer no change or change to have better error message?


Change to have a better error message



 -Ross

 On Nov 23, 2009, at 1:55 PM, David Pollak wrote:

 I am okay with an NPE thrown from using S outside a request.  Yeah, it'd be
 nicer to have a more polite error message, but there should be no creep
 towards being able to call S outside a request/session scope.

 Also, except for tests or actors, one should never think about initializing
 S.



 On Sat, Nov 21, 2009 at 3:28 PM, Ross Mellgren dri...@gmail.com wrote:

 Hmm, you raise an interesting point. So I guess the situation is more
 variegated:

 1) If you have a locale calculator that works per-request and does not
 have an app default, then it is definitely incorrect to call S.? out of a
 request context,
 2) but if you have one that works app-wide then it should work -- but
 doesn't, unless you call S.init or one of those by yourself,
 3) so my proposed error is not good.

 It would be nice to catch uses of S.? outside of a request context when
 your intended behavior is that you only have per-request locales, so I guess
 if that is the desire then one should make their locale calculator log the
 error text, and the change to lift should be something more like:

   def resourceBundles: List[ResourceBundle] = {
 -_resBundle.value match {
 -  case Nil = {
 +_resBundle.box match {
 +  case Full(bundles) if !bundles.isEmpty = bundles
 +  case _ = {
 _resBundle.set(LiftRules.resourceNames.flatMap(name = tryo(
   List(ResourceBundle.getBundle(name, locale))
   ).openOr(
   NamedPF.applyBox((name, locale),
 LiftRules.resourceBundleFactories.toList).map(List(_)) openOr Nil
   )))
 _resBundle.value
   }
 -  case bundles = bundles
 }
   }

 That is, if the _resBundle ThreadGlobal has not been initialized yet, or
 it's been initialized with the empty list, then do resource bundle loading.
 If it has been initialized with a non-empty list then use that.

 I don't think this should interact badly with S.init, since S.init uses
 _resBundle.doWith(Nil) ... which will both overwrite any loaded app-level
 bundles with the empty list, but also restore them upon completion of the S
 scope.

 -Ross


 On Nov 21, 2009, at 6:15 PM, Timothy Perrett wrote:

  I agree that getting an NPE is less than desirable!
 
  I'm not sure things are wrong per-say; the defualt locale calculator
  has an app wide setting and there is nothing to say that that a user
  must implement their locale calculator in a particular way... This is
  one of the great things about lift ;-)
 
  So the issue here seems to be the lazy / eager evaluation of bald
  rather than localization out of request context? I'm all for getting
  rid of these NPE scenarios though :-)
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 22 Nov 2009, at 00:02, Ross Mellgren dri...@gmail.com wrote:
 
  It's being called to provide the link text for menus during sitemap
  creation at boot time, as well as during class initialization time
  to make some vals that contain error text. I believe initializing
  these at Boot time to be incorrect since the correct locale cannot
  be known until a request is made (unless you force one locale for
  the entire site, I guess), but the NPE seems uglier than providing
  an error log explaining the problem.
 
  -Ross
 
 
  On Nov 21, 2009, at 5:57 PM, Timothy Perrett wrote:
 
  Ross,
 
  Where in your code are you calling this method? What I'd the context
  that puts it outside of a request?
 
  Cheers, Tim
 
  Sent from my iPhone
 
  On 21 Nov 2009, at 23:03, Ross Mellgren dri...@gmail.com wrote:
 
  I'm poking around the LiftTicket codebase, and currently it suffers
  from an NPE on Boot:
 
  ERROR - Failed to Boot
  java.lang.ExceptionInInitializerError
  at org.liftticket.liftticket.snippet.UserAdmin$.menus
  (UserAdmin.scala:41)
  at bootstrap.liftweb.Boot.buildMenus(Boot.scala:74)
  at bootstrap.liftweb.Boot.boot(Boot.scala:67)
  ...
  Caused by: java.lang.NullPointerException
  at net.liftweb.http.S$.$qmark$bang(S.scala:675)
  at net.liftweb.http.S$.$qmark(S.scala:636)
  at org.liftticket.liftticket.snippet.RoleAdmin$.init
  (RoleAdmin.scala:94)
  at org.liftticket.liftticket.snippet.RoleAdmin$.clinit
  (RoleAdmin.scala)
  ... 57 more
 
  This is apparently due to S._resBundle being null because S.init has
  not yet been entered, so S._resBundle.doWith(Nil) is not in the
  enclosing scope, and so:
 
  private def ?!(str: String, resBundle: List[ResourceBundle]):
  String = resBundle.flatMap(r = tryo(r.getObject(str) match {
 
  Blows up with NPE. resBundle is passed in from S.? by calling
  S.resourceBundles, which is defined thus:
 
  def resourceBundles: List[ResourceBundle] = {
  _resBundle.value match {
case Nil = {
   // loads the resource bundles here
}
case bundles = bundles
  }
  }
 
  

Re: [Lift] Okay... part of the slow problem is javax.script

2009-11-23 Thread Ross Mellgren
mvn dependency:tree

-Ross

On Nov 23, 2009, at 2:55 PM, David Pollak wrote:

 Folks,

 I've narrowed down part of the slowness problem.  There's a  
 reference to javax.script:script-js that's never satisfied.

 How can I track down what is including this reference or  
 alternatively blacklist the particular reference?\

 Thanks,

 David


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

 --

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

--

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




[Lift] Re: Okay... part of the slow problem is javax.script

2009-11-23 Thread Joni Freeman
David, it's probably a broken Specs 1.6.1 which causes this. Please
see this:

http://github.com/robey/xrayspecs/issues/closed/#issue/1

Cheers Joni

On 23 marras, 22:06, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Mon, Nov 23, 2009 at 12:02 PM, Ross Mellgren dri...@gmail.com wrote:
  mvn dependency:tree

 Cool.  Thanks!





  -Ross

  On Nov 23, 2009, at 2:55 PM, David Pollak wrote:

  Folks,

  I've narrowed down part of the slowness problem.  There's a reference to
  javax.script:script-js that's never satisfied.

  How can I track down what is including this reference or alternatively
  blacklist the particular reference?\

  Thanks,

  David

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

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

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

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

--

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




Re: [Lift] Re: Okay... part of the slow problem is javax.script

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 12:56 PM, Joni Freeman freeman.j...@gmail.comwrote:

 David, it's probably a broken Specs 1.6.1 which causes this. Please
 see this:

 http://github.com/robey/xrayspecs/issues/closed/#issue/1


Tnx!


 Cheers Joni

 On 23 marras, 22:06, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Mon, Nov 23, 2009 at 12:02 PM, Ross Mellgren dri...@gmail.com
 wrote:
   mvn dependency:tree
 
  Cool.  Thanks!
 
 
 
 
 
   -Ross
 
   On Nov 23, 2009, at 2:55 PM, David Pollak wrote:
 
   Folks,
 
   I've narrowed down part of the slowness problem.  There's a reference
 to
   javax.script:script-js that's never satisfied.
 
   How can I track down what is including this reference or alternatively
   blacklist the particular reference?\
 
   Thanks,
 
   David
 
   --
   Lift, the simply functional web frameworkhttp://liftweb.net
   Beginning Scalahttp://www.apress.com/book/view/1430219890
   Follow me:http://twitter.com/dpp
   Surf the harmonics
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
   liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
   liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics

 --

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





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

--

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




[Lift] Improving lift-flot

2009-11-23 Thread Peter Robinett
I've been working with lift-flot a lot recently and I'd like to share
some thoughts and suggest some improvements. It's a very useful
interface to a great Javascript plotting library, so consider these as
small suggestions from a fan.

First, the fact that FlotSerie's data property is a List[Pair[Double,
Double]] means that detail about what you're charting can get lost. If
you're plotting more than one line and want to refer to a certain
FlotSerie later, you have to rely upon the FlotSerie's label and the
order of the List[FlotSerie] used by Flot.render and JsFlotAppendData.
This can be addressed either by having a parallel list of your own
more expressive data instances, which is what I'm doing, or by only
having this more expressive list and having an implicit conversion to
a Pair[Double, Double] (I just thought of this and haven't tested it).
I can't think of a better way to do this, since everyone's data source
will be different and so the generic Pair[Double, Double] is needed –
this is just a comment on how the library works.

There is a general reliance on List[Pair[Double, Double]] throughout
lift-flot and it is an actual annoyance when you are updating an
existing graph, for instance via a Comet actor. Speaking of the List
[FlotSerie] I mentioned earlier, if you are updating your chart you
need to keep this list of series around and update it as you have new
data to plot. This is fine except for the fact that JsFlotAppendData
requires you to pass it both the updated List[FlotSerie] and a List
[Pair[Double, Double]] with one and only one new data point for each
FlotSerie. This means that you need to hard-code the list order so
that the order of the List[Pair[Double, Double]] matches that of the
List[FlotSerie], so that the correct series is updated with the
correct new point. I assume you need to give it the new data twice so
it knows which FlotSeries have new points and which don't, but this is
something the library could do behind the scenes to make the
developers' lives easier. More importantly, I don't like the fact that
the method replies upon two lists being in the exact same order.

So, what would I like to see with lift-flot? Mainly I'd like to see
the whole situation with the List[Pair[Double, Double]]'s improved. I
don't know if another Flot class, such as a FlotPoint, would help or
maybe just making better use of the List[FlotSeries], but I think
there definitely is room for improvement. If someone else has been
using lift-flot I'd love to hear their suggestions, as perhaps I've
been making it more complicated than it actually is.

I think a lot of the annoyances I described only crop up when using
the JsFlotAppendData method, so I don't won't to propose anything that
ends up being a regression for the majority of the library's users.
Please let me know if you're doing static charts and anything
suggested would make your work more complicated.

Since I am using lift-flot a lot (perhaps more than anyone else,
seeing how little it's been discussed here recently), I'm more than
happy to take the lead and contribute some code if others agree that
my suggestions are reasonable (please convince me otherwise!). I guess
that the first thing I could do would be to write a tutorial on using
the library. Would that be appreciated?

Peter Robinett

PS I've been working with 1.1-M5 and 1.1-M6, but I don't think there
have been any changes to lift-flot since then, let alone any that
would invalidate my comments.

--

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




Re: [Lift] Lift on Azure

2009-11-23 Thread Derek Chen-Becker
I really thought that you were talking about Azul, which is something I
would *love* to run Lift on :)

http://www.azulsystems.com/

Derek

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



 On Thu, Nov 19, 2009 at 1:51 PM, Matt Harrington mbh.li...@gmail.comwrote:

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

 http://microsoftpdc.com/Sessions/SVC50


 Cool!


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


 But maybe the Record stuff could work.


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


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



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

 --

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





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

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

 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.


--

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




Re: [Lift] Problem with issue 182

2009-11-23 Thread Derek Chen-Becker
OK, thinking about this a little further, technically it would be a breaking
change to remove the menus method from MetaMegaProtoUser. Would it be better
to simply introduce a MenuGenerator trait, a la

trait MenuGenerator {
  def menus : List[Menu]
}

And add that to CRUDify and MetaMegaProtoUser?



On Thu, Nov 19, 2009 at 3:36 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:

 Derek Chen-Becker dchenbec...@gmail.com writes:

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

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

 /Jeppe

 --

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




--

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




[Lift] Re: Configuring web.xml

2009-11-23 Thread sunanda
I get the HTTP  Status  404 Error: The requested resource () is not
available


On Nov 24, 11:21 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Mon, Nov 23, 2009 at 4:13 PM, sunanda sunanda.pa...@gmail.com wrote:
  Hi,
  I need the url pattern for my application to be /grid/*.

  I configured the web.xml file like this:
  web-app
  filter
   filter-nameLiftFilter/filter-name
   display-nameLift Filter/display-name
   descriptionThe Filter that intercepts lift calls/description
   filter-classnet.liftweb.http.LiftFilter/filter-class
  /filter

  filter-mapping
   filter-nameLiftFilter/filter-name
   url-pattern/grid/*/url-pattern
  /filter-mapping

  /web-app

  But my application does not run with this pattern (e.g.
 http://localhost:8080/SortableGridViewApp-0.0.1/grid/).
  What other seetings I need to make?

 What do you mean by does not run?







  Regards,
  Sunanda

  --

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

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

 - Show quoted text -- Hide quoted text -

 - Show quoted text -

--

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




Re: [Lift] Re: Configuring web.xml

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 4:27 PM, sunanda sunanda.pa...@gmail.com wrote:

 I get the HTTP  Status  404 Error: The requested resource () is not
 available


Do you have items and SiteMap entries for
/grid/index
/grid/

?



 On Nov 24, 11:21 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Mon, Nov 23, 2009 at 4:13 PM, sunanda sunanda.pa...@gmail.com
 wrote:
   Hi,
   I need the url pattern for my application to be /grid/*.
 
   I configured the web.xml file like this:
   web-app
   filter
filter-nameLiftFilter/filter-name
display-nameLift Filter/display-name
descriptionThe Filter that intercepts lift calls/description
filter-classnet.liftweb.http.LiftFilter/filter-class
   /filter
 
   filter-mapping
filter-nameLiftFilter/filter-name
url-pattern/grid/*/url-pattern
   /filter-mapping
 
   /web-app
 
   But my application does not run with this pattern (e.g.
  http://localhost:8080/SortableGridViewApp-0.0.1/grid/).
   What other seetings I need to make?
 
  What do you mean by does not run?
 
 
 
 
 
 
 
   Regards,
   Sunanda
 
   --
 
   You received this message because you are subscribed to the Google
 Groups
   Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
   liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 ­
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics- Hide quoted text -
 
  - Show quoted text -- Hide quoted text -
 
  - Show quoted text -

 --

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





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

--

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




[Lift] Re: Configuring web.xml

2009-11-23 Thread sunanda
No I don't have.
 Do I need to have this.

On Nov 24, 11:49 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Mon, Nov 23, 2009 at 4:27 PM, sunanda sunanda.pa...@gmail.com wrote:
  I get the HTTP  Status  404 Error: The requested resource () is not
  available

 Do you have items and SiteMap entries for
 /grid/index
 /grid/

 ?







  On Nov 24, 11:21 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   On Mon, Nov 23, 2009 at 4:13 PM, sunanda sunanda.pa...@gmail.com
  wrote:
Hi,
I need the url pattern for my application to be /grid/*.

I configured the web.xml file like this:
web-app
filter
 filter-nameLiftFilter/filter-name
 display-nameLift Filter/display-name
 descriptionThe Filter that intercepts lift calls/description
 filter-classnet.liftweb.http.LiftFilter/filter-class
/filter

filter-mapping
 filter-nameLiftFilter/filter-name
 url-pattern/grid/*/url-pattern
/filter-mapping

/web-app

But my application does not run with this pattern (e.g.
   http://localhost:8080/SortableGridViewApp-0.0.1/grid/).
What other seetings I need to make?

   What do you mean by does not run?

Regards,
Sunanda

--

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

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

   - Show quoted text -- Hide quoted text -

   - Show quoted text -

  --

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

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

 - Show quoted text -

--

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




Re: [Lift] Re: Change to support dynamic top level menu items

2009-11-23 Thread Ross Mellgren
As much as I subscribe to the a lack of dissent is implicit assent policy, 
I'm hoping somebody deeply familiar with SiteMap can comment on whether this 
change seems like a bad idea? I guess if I don't hear anything I'll create an 
issue and submit the patch for review, but I'd feel better with a bit more 
discussion.

-Ross

On Nov 22, 2009, at 9:28 PM, philip wrote:

 
 Essential for the CMS I am programming as the user needs to be able to
 define the menu structure.
 
 On 11月22日, 上午4時46分, Ross Mellgren dri...@gmail.com wrote:
 In the recent thread, a couple people asked for the ability to create 
 dynamic menu items per request from the database. David suggested 
 Loc.supplimentalKidMenuItems which works fine for dynamic children of a 
 static menu, but doesn't support the ability to make the top level menu 
 dynamic.
 
 Menu has a method called makeMenuItem which gives a Box of MenuItem. What 
 about a new method makeMenuItems that gives a possible plurality of 
 MenuItems whose default implementation deferred to the existing makeMenuItem 
 in the case where it's not overridden? I made this change to my local copy 
 of lift and it seems to work alright.
 
 Example Menu:
 
 case class DynMenu() extends Menu(Loc(dynmenu, Link(List(dynmenu), true, 
 /dynmenu), Dynamic Menu)) {
 override def makeMenuItems(path: List[Loc[_]]): Iterable[MenuItem] =
 DynMenuItem.findAll.map(dmi = {
 MenuItem(Text(dmi.label.is), Text(dmi.link.is), Nil, false, 
 false, Nil)
 })
 
 }
 
 That is, a Menu can generate 0 or more MenuItems when the menu is being 
 generated. The disadvantage I see is similar to the one with 
 supplimentalKidMenuItems -- that is, you have to manually compute the 
 attributes of MenuItem such as current. However, it does give you the full 
 power to make whatever kind of menu items you want.
 
 I looked briefly at seeing if it would be feasible to use a function 
 Box[Req] = SiteMap on LiftRules, but I think the RewritePF auto detection 
 thing in LiftRules.setSiteMap prevents this from being the right thing.
 
 The change to lift-webkit:
 
 diff --git 
 a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala 
 b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
 index d33d1dc..79194f5 100644
 --- a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
 +++ b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
 @@ -61,8 +61,10 @@ case class Menu(loc: Loc[_], kids: Menu*) extends HasKids 
 {
}
// def buildChildLine: List[MenuItem] = kids.toList.flatMap(m = 
 m.loc.buildItem(Nil, false, false))
 
 +  def makeMenuItems(path: List[Loc[_]]): Iterable[MenuItem] = 
 makeMenuItem(path)
 +
def makeMenuItem(path: List[Loc[_]]): Box[MenuItem] =
 -  loc.buildItem(loc.buildKidMenuItems(kids), _lastInPath(path), 
 _inPath(path))
 +loc.buildItem(loc.buildKidMenuItems(kids), _lastInPath(path), 
 _inPath(path))
 
private def _inPath(in: List[Loc[_]]): Boolean = in match {
  case Nil = false
 diff --git 
 a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala 
 b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
 index 7939938..f8fa307 100644
 --- a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
 +++ b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
 @@ -66,7 +66,7 @@ case class SiteMap(globalParamFuncs: 
 List[PartialFunction[Box[Req], Loc.AnyLocPa
case Full(loc) = loc.breadCrumbs
case _ = Nil
  }
 -CompleteMenu(kids.flatMap(_.makeMenuItem(path)))
 +CompleteMenu(kids.flatMap(_.makeMenuItems(path)))
}
  }
 
 Thoughts?
 
 -Ross
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=.
 
 

--

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




Re: [Lift] Re: Configuring web.xml

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 4:54 PM, sunanda sunanda.pa...@gmail.com wrote:

 No I don't have.
  Do I need to have this.


If you don't define the pages, then you'll get a 404.



 On Nov 24, 11:49 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Mon, Nov 23, 2009 at 4:27 PM, sunanda sunanda.pa...@gmail.com
 wrote:
   I get the HTTP  Status  404 Error: The requested resource () is not
   available
 
  Do you have items and SiteMap entries for
  /grid/index
  /grid/
 
  ?
 
 
 
 
 
 
 
   On Nov 24, 11:21 am, David Pollak feeder.of.the.be...@gmail.com
   wrote:
On Mon, Nov 23, 2009 at 4:13 PM, sunanda sunanda.pa...@gmail.com
   wrote:
 Hi,
 I need the url pattern for my application to be /grid/*.
 
 I configured the web.xml file like this:
 web-app
 filter
  filter-nameLiftFilter/filter-name
  display-nameLift Filter/display-name
  descriptionThe Filter that intercepts lift calls/description
  filter-classnet.liftweb.http.LiftFilter/filter-class
 /filter
 
 filter-mapping
  filter-nameLiftFilter/filter-name
  url-pattern/grid/*/url-pattern
 /filter-mapping
 
 /web-app
 
 But my application does not run with this pattern (e.g.
http://localhost:8080/SortableGridViewApp-0.0.1/grid/).
 What other seetings I need to make?
 
What do you mean by does not run?
 
 Regards,
 Sunanda
 
 --
 
 You received this message because you are subscribed to the Google
   Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 ­
   liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 liftweb%252bunsubscr...@googlegroup­s.com
   ­
 .
 For more options, visit this group at
http://groups.google.com/group/liftweb?hl=.
 
--
Lift, the simply functional web frameworkhttp://liftweb.net
Beginning Scalahttp://www.apress.com/book/view/1430219890
Follow me:http://twitter.com/dpp
Surf the harmonics- Hide quoted text -
 
- Show quoted text -- Hide quoted text -
 
- Show quoted text -
 
   --
 
   You received this message because you are subscribed to the Google
 Groups
   Lift group.
   To post to this group, send email to lift...@googlegroups.com.
   To unsubscribe from this group, send email to
   liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 ­
   .
   For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=.
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Surf the harmonics- Hide quoted text -
 
  - Show quoted text -

 --

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





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

--

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




Re: [Lift] Re: Change to support dynamic top level menu items

2009-11-23 Thread David Pollak
On Mon, Nov 23, 2009 at 4:55 PM, Ross Mellgren dri...@gmail.com wrote:

 As much as I subscribe to the a lack of dissent is implicit assent
 policy, I'm hoping somebody deeply familiar with SiteMap can comment on
 whether this change seems like a bad idea? I guess if I don't hear anything
 I'll create an issue and submit the patch for review, but I'd feel better
 with a bit more discussion.


Give me a few days to respond please.



 -Ross

 On Nov 22, 2009, at 9:28 PM, philip wrote:

 
  Essential for the CMS I am programming as the user needs to be able to
  define the menu structure.
 
  On 11月22日, 上午4時46分, Ross Mellgren dri...@gmail.com wrote:
  In the recent thread, a couple people asked for the ability to create
 dynamic menu items per request from the database. David suggested
 Loc.supplimentalKidMenuItems which works fine for dynamic children of a
 static menu, but doesn't support the ability to make the top level menu
 dynamic.
 
  Menu has a method called makeMenuItem which gives a Box of MenuItem.
 What about a new method makeMenuItems that gives a possible plurality of
 MenuItems whose default implementation deferred to the existing makeMenuItem
 in the case where it's not overridden? I made this change to my local copy
 of lift and it seems to work alright.
 
  Example Menu:
 
  case class DynMenu() extends Menu(Loc(dynmenu, Link(List(dynmenu),
 true, /dynmenu), Dynamic Menu)) {
  override def makeMenuItems(path: List[Loc[_]]): Iterable[MenuItem] =
  DynMenuItem.findAll.map(dmi = {
  MenuItem(Text(dmi.label.is), Text(dmi.link.is), Nil, false,
 false, Nil)
  })
 
  }
 
  That is, a Menu can generate 0 or more MenuItems when the menu is being
 generated. The disadvantage I see is similar to the one with
 supplimentalKidMenuItems -- that is, you have to manually compute the
 attributes of MenuItem such as current. However, it does give you the full
 power to make whatever kind of menu items you want.
 
  I looked briefly at seeing if it would be feasible to use a function
 Box[Req] = SiteMap on LiftRules, but I think the RewritePF auto detection
 thing in LiftRules.setSiteMap prevents this from being the right thing.
 
  The change to lift-webkit:
 
  diff --git
 a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
 b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
  index d33d1dc..79194f5 100644
  ---
 a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
  +++
 b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/Menu.scala
  @@ -61,8 +61,10 @@ case class Menu(loc: Loc[_], kids: Menu*) extends
 HasKids {
 }
 // def buildChildLine: List[MenuItem] = kids.toList.flatMap(m =
 m.loc.buildItem(Nil, false, false))
 
  +  def makeMenuItems(path: List[Loc[_]]): Iterable[MenuItem] =
 makeMenuItem(path)
  +
 def makeMenuItem(path: List[Loc[_]]): Box[MenuItem] =
  -  loc.buildItem(loc.buildKidMenuItems(kids), _lastInPath(path),
 _inPath(path))
  +loc.buildItem(loc.buildKidMenuItems(kids), _lastInPath(path),
 _inPath(path))
 
 private def _inPath(in: List[Loc[_]]): Boolean = in match {
   case Nil = false
  diff --git
 a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
 b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
  index 7939938..f8fa307 100644
  ---
 a/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
  +++
 b/lift-base/lift-webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
  @@ -66,7 +66,7 @@ case class SiteMap(globalParamFuncs:
 List[PartialFunction[Box[Req], Loc.AnyLocPa
 case Full(loc) = loc.breadCrumbs
 case _ = Nil
   }
  -CompleteMenu(kids.flatMap(_.makeMenuItem(path)))
  +CompleteMenu(kids.flatMap(_.makeMenuItems(path)))
 }
   }
 
  Thoughts?
 
  -Ross
 
  --
 
  You received this message because you are subscribed to the Google Groups
 Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=.
 
 

 --

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





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

--

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

Re: [Lift] Re: Can we deploy lift webapp on Google App Engine?

2009-11-23 Thread jlist9
Hi,

Is this the easiest/simplest instructions/setup to deploy a Lift app on GAE?
It seems to involve datanucleus-enhancer, which I know nothing about.
I'm not sure what other dependency it has. Is it required?

Thanks
Jack

On Tue, Sep 29, 2009 at 8:16 PM, Randinn rand...@gmail.com wrote:

 Try http://github.com/ymnk/lift-gae-jdo for a example, personally I
 don't care for the limited approach GEA gives you, but that's me

--

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




[Lift] Re: early execution of snippet

2009-11-23 Thread iboy
Thanx tim and Jean .
Suggestion by jean solved my problem and thanx Tim for writing such a
simple and wonderful tutorial.

I would also like to seek suggestions on  one more doubts :
a) I have a situation in which the number of  fields and their values
in Form are decided at run time based on the values in the database .i
know how to work with forms with fixed fields and bind them  but in
this case i am clueless  how to do  binding and display them in a
tabular form.


On Nov 24, 1:30 am, Jean-Luc jlcane...@gmail.com wrote:
 If you do not use the quotes , your string document will be considered as
 a variable and your RewriteRequest will match /something/somethingElse

 Is it better with this code ?
 case RewriteRequest(ParsePath(document :: id  :: Nil,_,_,_ ), _,_) =
 RewriteResponse(display :: Nil, Map(id -id ))

 Jean-Luc

 2009/11/23 iboy iboy1...@gmail.com



  I am developing an application in which i need to do url rewriting  so
  that all the request of type /document/id gets directed to webpage
  display.html which calls a snippet in which i am trying to do some
  processing by capturing the parameter passed during
  urlrewriting,everything works fine but i am facing a problem here that
  every time  i run lift and click on any link in menu the snippet
  called in display.html  gets executed itself.

  my urlrewriting code is :
  case RewriteRequest(ParsePath(document :: id  :: Nil,_,_,_ ), _,_) =
  RewriteResponse(display :: Nil, Map(id -id ))
  Can somebody help me out pointing where am i  wrong and how can i
  solve this problem.

  --

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

 --
 Jean-Luc Canela
 jlcane...@gmail.com

--

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




[Lift] Re: early execution of snippet

2009-11-23 Thread iboy
Thanx tim and Jean .
Suggestion by jean solved my problem and thanx Tim for writing such a
simple and wonderful tutorial.

I would also like to seek suggestions on  one more doubts :
a) I have a situation in which the number of  fields and their values
in Form are decided at run time based on the values in the database .i
know how to work with forms with fixed fields and bind them  but in
this case i am clueless  how to do  binding and display them in a
tabular form.


On Nov 24, 1:30 am, Jean-Luc jlcane...@gmail.com wrote:
 If you do not use the quotes , your string document will be considered as
 a variable and your RewriteRequest will match /something/somethingElse

 Is it better with this code ?
 case RewriteRequest(ParsePath(document :: id  :: Nil,_,_,_ ), _,_) =
 RewriteResponse(display :: Nil, Map(id -id ))

 Jean-Luc

 2009/11/23 iboy iboy1...@gmail.com



  I am developing an application in which i need to do url rewriting  so
  that all the request of type /document/id gets directed to webpage
  display.html which calls a snippet in which i am trying to do some
  processing by capturing the parameter passed during
  urlrewriting,everything works fine but i am facing a problem here that
  every time  i run lift and click on any link in menu the snippet
  called in display.html  gets executed itself.

  my urlrewriting code is :
  case RewriteRequest(ParsePath(document :: id  :: Nil,_,_,_ ), _,_) =
  RewriteResponse(display :: Nil, Map(id -id ))
  Can somebody help me out pointing where am i  wrong and how can i
  solve this problem.

  --

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

 --
 Jean-Luc Canela
 jlcane...@gmail.com

--

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




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

2009-11-23 Thread sunanda
Hi David,

Thank for all the help so far.

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


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

--

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




Re: [Lift] Feature Request: deleteMenuLocParams in CRUDify

2009-11-23 Thread Ross Mellgren
Added an issue for you:
http://github.com/dpp/liftweb/issues#issue/205
and it's on review board:
http://reviewboard.liftweb.net/r/121/

So it will (probably) be in 1.1-SNAPSHOT in a day or two, assuming the change 
isn't unacceptable for whatever reason.

-Ross

On Nov 23, 2009, at 11:50 PM, tommycli wrote:

 Add deleteMenuLocParams to CRUDify.
 
 Patch below. (I tried github, but you guys don't pull apparently).
 
 pre
 diff --git a/lift-persistence/lift-mapper/src/main/scala/net/liftweb/
 mapper/CRUDify.scala b/lift-persistence/lift-mapper/src/main/scala/net/
 liftweb/mapper/CR
 index 21e5a3b..5aae123 100644
 --- a/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/
 CRUDify.scala
 +++ b/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/
 CRUDify.scala
 @@ -265,7 +265,7 @@ trait CRUDify[KeyType, CrudType : KeyedMapper
 [KeyType, CrudType]] {
 
   def defaultValue = Empty
 
 -  def params = Nil
 +  def params = deleteMenuLocParams
 
   /**
* What's the text of the link?
 @@ -297,6 +297,11 @@ trait CRUDify[KeyType, CrudType : KeyedMapper
 [KeyType, CrudType]] {
 }))
   }
 
 +  /**
 +   * Override to include new Params for the show all menu
 +   */
 +  def deleteMenuLocParams: List[Loc.AnyLocParam] = Nil
 +
   def deleteMenuName = S.??(Delete)+ +displayName
 
   def deleteTemplate(): NodeSeq = pageWrapper(_deleteTemplate)
 /pre
 
 --
 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

--

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




Re: [Lift] Controlling fields in form generation

2009-11-23 Thread Oscar Picasso
Thanks, that's what I was looking for.

On Tue, Nov 24, 2009 at 12:40 AM, Ross Mellgren dri...@gmail.com wrote:

 It looks like you can override dbIncludeInForm_? to suppress fields from
 showing up in the form:

 ...
 object myField extends MappedString(this, 32) {
  override def dbIncludeInForm_? = false
 }
 ...

 -Ross

 On Nov 23, 2009, at 11:38 PM, Oscar Picasso wrote:

 HI,

 I generate a form with .toForm and want some fields to not appear in the
 form.
 I have tried to subclass fieldOrder in the MetaMapper but while it controls
 the order, all the fields keep appearing in the form even if they are not in
 the list returned by the overrided fieldOrder methods.

 I have tried other methods but with no luck.

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


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


--

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