[Lift] Re: json extraction problem

2009-10-01 Thread Joni Freeman
Hi, I pasted this to scala console and it worked. I am pretty sure that the problem is that your case classes are inner classes. Inner classes get one extra implicit constructor parameter, a reference to the outer class (same way as in Java). You need to move those case classes away from

[Lift] Re: CometActor timeout problem

2009-10-01 Thread Jack Widman
Thanks Atsuhiko very much. I really appreciate your effort and this helps alot. Jack On Thu, Oct 1, 2009 at 4:11 AM, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com wrote: Hi, On Thu, Oct 1, 2009 at 1:11 PM, Jack Widman jack.wid...@gmail.com wrote: David, I have attached a (non) working

[Lift] Re: json extraction problem

2009-10-01 Thread Lincoln
Cool, thanks Joni. I'll give it a try. On Thu, Oct 1, 2009 at 2:36 AM, Joni Freeman freeman.j...@gmail.com wrote: Hi, I pasted this to scala console and it worked. I am pretty sure that the problem is that your case classes are inner classes. Inner classes get one extra implicit

[Lift] Re: CometActor timeout problem

2009-10-01 Thread Jack Widman
Atsuhiko, How would I make one small change? I would like each link to refresh only once and I would like that to happen as soon as the TSCatcher objects catch a package. Thanks in advance. Jack On Thu, Oct 1, 2009 at 4:11 AM, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com wrote: Hi, On Thu,

[Lift] Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread rintcius
Hi, I have started integrating Lift in a Scala + Spring example project (see http://code.google.com/p/scala-spring). This first integration just has a single template and snippet for now but should give an idea how Lift can be integrated. Before I go further with this I would like some Lift

[Lift] Re: Concurrent Web Service Requests?

2009-10-01 Thread marius d.
Well I said what I had to say. My problem is not really the prefix name but the existence of other prefixes then lift, that are interpreted by lift. It's just how I see things now and nothing on this thread provided sufficient arguments to convince me otherwise ... not much else for me to do if

[Lift] Re: Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread Timothy Perrett
Rintcius, Whilst I applaud the effort, what is your goal with integrating the two frameworks? What problem are you looking to solve? Cheers, Tim On 1 Oct 2009, at 10:14, rintcius wrote: Hi, I have started integrating Lift in a Scala + Spring example project (see

[Lift] Re: Javascript Commands

2009-10-01 Thread Derek Chen-Becker
If you have a javascript function foo(a, b) where a is a String and b is an integer then you can call that with JE.Call(foo, one, 2) for example. If you wanted to set some variable to the result of the function, you could do: JsCmds.CrVar(myVar, JE.Call(foo, one, 2)) Derek On Wed, Sep 30,

[Lift] Re: CometActor timeout problem

2009-10-01 Thread Jack Widman
Thanks so much Atsuhiko. You are very kind. On Thu, Oct 1, 2009 at 11:01 AM, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com wrote: Hi, On Thu, Oct 1, 2009 at 9:42 PM, Jack Widman jack.wid...@gmail.com wrote: Atsuhiko, How would I make one small change? I would like each link to refresh

[Lift] Re: CometActor timeout problem

2009-10-01 Thread David Pollak
Thanks! On Thu, Oct 1, 2009 at 1:11 AM, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com wrote: Hi, On Thu, Oct 1, 2009 at 1:11 PM, Jack Widman jack.wid...@gmail.com wrote: David, I have attached a (non) working example. It compiles and runs and does a part of what I want it to do but not

[Lift] Re: Help with using JSExp and JsCmd traits

2009-10-01 Thread glenn
David, Excellent. This is exactly what I was looking for. Thanks. Glenn On Sep 30, 4:54 pm, David Pollak feeder.of.the.be...@gmail.com wrote: JqHtml and JqEmptyAfter eagerly evaluate the NodeSeq on the server, so there's no way to get client-side JS execution in a NodeSeq. You can write

[Lift] Re: Help with using JSExp and JsCmd traits

2009-10-01 Thread David Pollak
On Thu, Oct 1, 2009 at 8:25 AM, glenn gl...@exmbly.com wrote: David, Excellent. This is exactly what I was looking for. Wow. I think this is the first time I've actually helped you. I'm sorry I'm bad at understanding what you ask for. More broadly, the JavaScript stuff in Lift is not

[Lift] Re: Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread David Pollak
A quick look at the code... you use open_! That's considered very bad practice. Any time you use open_!, you are saying I know this thing contains a value. It's like not doing null testing when the method you are calling is expected to return a null under certain circumstance. Put another way,

[Lift] Re: JE Abstractions

2009-10-01 Thread Derek Chen-Becker
See my reply to your other post. If that's not clear, please let me know. Derek On Wed, Sep 30, 2009 at 7:57 PM, sunanda sunanda.pa...@gmail.com wrote: Hi, Can any one provide a simple example to explain how to use JE abstractions (Call,JsFunc) in lift code . I am new to Lift Framework

[Lift] Re: Help with using JSExp and JsCmd traits

2009-10-01 Thread glenn
David, This is off topic, but you always are a help. Your thoughtful assistance on this discussion group either directly resolves issues I'm having with Lift, or leads me to rethink my strategy and explore new avenues I haven't thought of. At the very least, you force me to reframe many of my

[Lift] Re: Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread rintcius
Hi Tim, This project is meant as an example for people (like me) that maintain existing Spring architectures and are interested in using Scala and Lift. What I want to do now is port the existing jsp's and spring controllers to lift, so that people can compare jsp and lift-webkit with each other

[Lift] Testing snippets that depend on a user logged in

2009-10-01 Thread rstradling
I have a class called class Trainer { def showPeople(xhtml : Group) : NodeSeq = { val user : User = User.currentUser.open_! ... } } I then want to write a unit test to test that returns proper xml. The test is written as so def testValue() = { val xml = xml:group

[Lift] Re: Concurrent Web Service Requests?

2009-10-01 Thread David Pollak
Marius, I have a ton of respect for your opinion and I appreciate your analysis. I have been following this thread and thinking, what does the lift: prefix mean? In my mind, it means this thing will be changed based on evaluating some code. So, using the lift: prefix for something that also

[Lift] Re: Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread rintcius
Ok thanks David. What is the recommended way to get the ServletContext from a lift snippet (in 1.0.2)? Rintcius --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to

[Lift] Re: Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread David Pollak
On Thu, Oct 1, 2009 at 9:18 AM, rintcius rintc...@gmail.com wrote: Ok thanks David. What is the recommended way to get the ServletContext from a lift snippet (in 1.0.2)? Use the for comprehension to test if a Box is empty or not. See

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread David Pollak
Using Specs 1.6: object HelloWorldTestSpecs extends Specification { val session = new LiftSession(, randomString(20), Empty) val stableTime = now override def executeExpectations(ex: Examples, t: =Any): Any = { S.initIfUninitted(session) { ... put your User init here. The

[Lift] Re: Unwarranted dependencies in lift-record

2009-10-01 Thread David Pollak
On Tue, Sep 29, 2009 at 2:42 AM, Timothy Perrett timo...@getintheloop.euwrote: Guys, I just noticed that lift-record depends on lift-webket because of some calls to S... IMHO, we need to remove this because thats simply too tight a coupling between the webkit and an abstract persistence

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread Bill Venners
Hi Ryan, It looks like you're currently using a JUnit TestCase. If you want an easier port to something that would work you could use a ScalaTest Suite like this: import org.scalatest.Suite class YourSuite extends Suite { val session = new LiftSession(, randomString(20), Empty) val

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread David Pollak
Bill, Thanks for posting this. I am, by experience (I started using it, I can use it enough to write basic tests, I know no more) using Specs. I would welcome and encourage some sample tests in Lift archetypes that use ScalaTest. I want to make sure that folks who pick up Lift get to experience

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread Bill Venners
Hi David, Thanks. I appreciate that. I was actually already planning to request getting some ScalaTest examples in the Lift archetypes right after ScalaTest 1.0 comes out (on Oct 12, if all goes as planned), and have already arranged with David Bernard to put ScalaTest examples into

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread David Pollak
Bill, Cool. If you're going to be at Silicon Valley Code Camp on Saturday, let's talk more about any mechanics. Thanks, David On Thu, Oct 1, 2009 at 2:26 PM, Bill Venners b...@artima.com wrote: Hi David, Thanks. I appreciate that. I was actually already planning to request getting some

[Lift] Re: Started integrating lift in a scala+spring project. Feedback?

2009-10-01 Thread rintcius
Hmm, isn't there a direct way to get the ServletContext? I mean now that I think about it looks to me that it should be possible to obtain the ServletContext no matter if there's a session or not. --~--~-~--~~~---~--~~ You received this message because you are

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread rstradling
Awesome!!! Thanks guys for the help. It now works. I put a how-to wiki document up on github. For me this was one of those times where my google searches did not seem to turn up anything fruitful, so I thought this how-to would be helpful. If it is not helpful, then no hard feelings if the

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread David Pollak
On Thu, Oct 1, 2009 at 3:03 PM, rstradling ryanstradl...@gmail.com wrote: Awesome!!! Thanks guys for the help. It now works. I put a how-to wiki document up on github. For me this was one of those times where my google searches did not seem to turn up anything fruitful, so I thought this

[Lift] JsonResponse and Constructing a JsArray

2009-10-01 Thread Peter Robinett
Hi all, I'm getting the following error and I think I'm missing something very simple: error: type mismatch; found : List[net.liftweb.http.js.JsExp] required: net.liftweb.http.js.JsExp JsonResponse(JsObj(results - JsArray(packets.map(_.asJs I'm trying to transform packets, a

[Lift] Re: Javascript Commands

2009-10-01 Thread sunanda
Thanks Derek. But I get the following errors: found : net.liftweb.http.js.JE.Call required: java.lang.String x= JE.Call(foo,2) ^ C:\J\BrandNET\eclipse_workspace\GridXml_Lift2.0\src\main\scala\net \irisinteractive\lift\grid\snippet\CreateGridConfigTable.scala:47: error: value CrVar is not a

[Lift] JSONParse.parse and List[Any]

2009-10-01 Thread Peter Robinett
Hi all, Building off of a previous thread[1], I'm trying to parse a POST request that contains JSON data. Specifically, I expect a JSON array of JSON objects representing Packet model data and want to have a List [Packet] at the end. I am trying the following: val packets = for {

[Lift] Re: Removing Scala Actors from Lift

2009-10-01 Thread David Pollak
Martin and Philipp, My immediate problem is: http://groups.google.com/group/liftweb/browse_thread/thread/b3783e24b8417521/f89548ba1fa70319?hl=enlnk=gstq=oome# This has been a persistent problem with Scala Actors and I identified it last year in November or December. Philipp did the 2.7.4 release

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread etorreborre
Hi, I am working at the moment on a small lift demo app and I've added some enhancements to specs in order to ease the testing inside a session. To use those functionalities, you need specs-1.6.1-SNAPSHOT (http:// www.scala-tools.org/repo-snapshots/org/scala-tools/testing/specs/1.6.1-SNAPSHOT).

[Lift] a question about host based url rewriting

2009-10-01 Thread harryh
I want http://m.harryh.org to visit a mobile version of my site so I added the following rewrite rule: case RewriteRequest(path, _, req) if (req.serverName.toLowerCase.startsWith(m.)) = { RewriteResponse(ParsePath(mobile :: path.partPath, path.suffix, path.absolute, path.endSlash),

[Lift] Re: Concurrent Web Service Requests?

2009-10-01 Thread marius d.
David, Thank you very much for your kind words. Personally I don't see any reason why the lift prefix can not also have the semantic for enriching the context you described this thing will be changed based on evaluating some code.. These are after all attributes and attributes to me are about

[Lift] Using plain usernames for authentication

2009-10-01 Thread tommycli
Looking through the book and source for MegaProtoUser, it looks like the email address is used as the primary identifier for users in the built-in user system. What if you want to use plain usernames instead of emails? What do other people do - do they write their own user system from scratch?

[Lift] Re: Concurrent Web Service Requests?

2009-10-01 Thread Naftoli Gugenheim
Have we been misunderstanding each other? The lift prefix can be a snippet invocation as an attribute too. Thus the fact that it's an attribute does not separate reserved names from user space snippet names. - marius d.marius.dan...@gmail.com wrote: David,

[Lift] Re: Javascript Commands

2009-10-01 Thread Indrajit Raychaudhuri
That should read JsCmds.JsCrVar(...) Cheers, Indrajit On 02/10/09 4:39 AM, sunanda wrote: Thanks Derek. But I get the following errors: found : net.liftweb.http.js.JE.Call required: java.lang.String x= JE.Call(foo,2) ^ C:\J\BrandNET\eclipse_workspace\GridXml_Lift2.0\src\main\scala\net

[Lift] Re: Javascript Commands

2009-10-01 Thread Derek Chen-Becker
Oops, sorry about that. Also, can you show a little more of your code? I'm not sure what you're trying to do with the assignment to x. Derek On Thu, Oct 1, 2009 at 10:18 PM, Indrajit Raychaudhuri indraj...@gmail.comwrote: That should read JsCmds.JsCrVar(...) Cheers, Indrajit On 02/10/09

[Lift] Re: Testing snippets that depend on a user logged in

2009-10-01 Thread Bill Venners
Hi Ryan, David, Eric, I added a ScalaTest version to your wiki page: http://wiki.github.com/dpp/liftweb/how-to-unit-test-lift-snippets-with-a-logged-in-user Eric you may want to add a specs version. Bill On Thu, Oct 1, 2009 at 3:03 PM, rstradling ryanstradl...@gmail.com wrote: Awesome!!!