[Lift] Re: Thoughts on file streaming
It is not about dropping Lift, it is about starting to use it. I want it very much but i need to consider all pluses and minuses before we jump in. External server for uploading could be a solution but it will not be in Scala and will require some other tools to be involved. I am still looking for solutions how i can do it with Lift. Frankly out there i do not see anything to replace Scala/Lift. On Jul 1, 1:08 am, Naftoli Gugenhem naftoli...@gmail.com wrote: I'm not too familiar with the topic but instead of dropping lift, as a temporary workaround can't you have the upload be handled by another servlet which will save it and then redirect? - Vlad Seryakovvserya...@gmail.com wrote: I am also contemplating to use Lift but lack of big file upload is the showstopper. We need to upload images, and big video files and currently there i snot way to do it in Lift, i need something else to handle that which makes the whole stuff more complex than needed. Spooling into temp file and doing async upload of multiple files at the same time is what needed. Nowadays media uploads is normal and those files are getting bigger and bigger. On Jun 30, 5:58 pm, Timothy Perrett timo...@getintheloop.eu wrote: This has been hurting me for quite a while now (raised it on list about 2 months ago) and could really do with getting it fixed. As derek points out, it's not a small change which is why I've done nothing about it to date - a little too much core hacking to feel happy If you think your able to do something about it that would be absolutly brilliant! Cheers Tim Sent from my iPhone On 30 Jun 2009, at 22:33, David Pollak feeder.of.the.be...@gmail.com wrote: What kind of priority is this issue? I think I can abstract things in such a way that it works correctly, but it'll take a couple of days. On Tue, Jun 30, 2009 at 2:08 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, as usual something that seemed simple at first glance is now looking somewhat complex. I'm thinking of reworking the fileUpload handling to allow a user to register either a (String, String, Array [Byte]) = Any or (String, String, InputStream) = Any function, which would then be executed during request processing. The issue is that form field processing (ParamHolders) takes place in Req, befor e LiftSession has been set up, and the act of parsing the request fo r form data, particularly for large upload streams (the target of th ese changes) precludes holding on to any data for later processing ( the servlet container cannot be expected to hold the entire request in memory). On the other hand, users should reasonably expect that t heir form handling functions are stateful, so I'm trying to think of some way to meet in the middle on form processing. Ideas? Derek -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Maven License Expired
Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Thoughts on file streaming
On Tue, Jun 30, 2009 at 11:32 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Jun 30, 2009 at 2:22 PM, Viktor Klang viktor.kl...@gmail.comwrote: Create a tmp-file, store the localpath in S.param and register a delete on request done will be more streamlined than potentially monkeypatching it in Thoughts? Huge hack Yes, and I apologize for suggesting it, it was inappropriate. As we all know, the problem is that if you want to have access to the _full_ current state of the client (S) at the time of parsing the request (the parsing of the file likely not the last item in the request) in order to be able to process the file in a stream, unless some other solution is found, the stream parsing of the file has to rely on not having current client side state (S) available. Now, I've made such solutions in the past, and the impression I've had from API users have been that they actually expected client state to be available at file parse time. So in order to solve this you'd have to either guarantee that the file(s) present in the multipart request is always located _after_ any and all other form fields/parameters and the issue the callback at the time of each file item being encountered (at the time of calling openStream()) Also, so far in the thread different behaviors of file uploads are mentioned: 1) Process one or many files in a streaming fashion 2) Multiple file upload (store on server and process when user says he's done) As we've all said in this thread: The problem is not trivial to solve in a satisfactory way, but I think we all can agree that you, David, will most likely be able to solve it, as usual, very cleanly. One possible solution that I can imagine is to have a multiple request solution: On the client, before every file upload, send the current client state as a separate request and wait for a 200/OK before sending a request containing one or more files. This way you can rely on the client state being fresh when processing the files, and lift would invoke the input stream processor associated with the file field in question. -- Viktor On Jun 30, 2009 11:08 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, as usual something that seemed simple at first glance is now looking somewhat complex. I'm thinking of reworking the fileUpload handling to allow a user to register either a (String, String, Array[Byte]) = Any or (String, String, InputStream) = Any function, which would then be executed during request processing. The issue is that form field processing (ParamHolders) takes place in Req, before LiftSession has been set up, and the act of parsing the request for form data, particularly for large upload streams (the target of these changes) precludes holding on to any data for later processing (the servlet container cannot be expected to hold the entire request in memory). On the other hand, users should reasonably expect that their form handling functions are stateful, so I'm trying to think of some way to meet in the middle on form processing. Ideas? Derek -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Viktor Klang Scala Loudmouth --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] net.liftweb.util.ActorPingException: ActorBug could not be scheduled
For the last couple of weeks I have been getting the following exception when saving causing a jetty reload. Seems it was raised in May in this group with a suggested work around of setting the jetty scan interval to 0 seconds - is this the only way? I guess I'm only now seeing as I recently added a SessionVar. net.liftweb.util.ActorPingException: ActorBug could not be scheduled on net.liftweb.http.pointlessactortoworkaroundb...@557f45 at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:53) at net.liftweb.http.PointlessActorToWorkAroundBug$.net$liftweb$http $PointlessActorToWorkAroundBug$$ping(LiftServlet.scala:764) at net.liftweb.http.PointlessActorToWorkAroundBug$$anonfun$act$1$ $anonfun$apply$1.apply(LiftServlet.scala:751) at net.liftweb.http.PointlessActorToWorkAroundBug$$anonfun$act$1$ $anonfun$apply$1.apply(LiftServlet.scala:707) at scala.actors.Reaction.run(Reaction.scala:78) at net.liftweb.http.ActorSchedulerFixer$$anon$1$$anonfun$execute $1.apply(LiftServlet.scala:668) at net.liftweb.http.ActorSchedulerFixer$$anon$1$$anonfun$execute $1.apply(LiftServlet.scala:668) at net.liftweb.http.ActorSchedulerFixer$$anonfun$20$$anon$2.run (LiftServlet.scala:626) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask (ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:613) Caused by: java.util.concurrent.RejectedExecutionException at java.util.concurrent.ThreadPoolExecutor $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1478) at java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:384) at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute (ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor.schedule (ScheduledThreadPoolExecutor.java:338) at java.util.concurrent.Executors $DelegatedScheduledExecutorService.schedule(Executors.java:647) at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51) ... 10 more -- Ewan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
You're using an old version, grab 2.0.1 and try that. 1.X may have expired. On Jul 1, 3:46 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
The way we are handling it in the installer is all JR users have a .lic file for the license... The actual JAR for javarebel is separate so I think it would still persist to be an issue. Either way, I've gotten in touch with Jevgeni to see what he says. Cheers, Tim On 01/07/2009 11:19, TylerWeir tyler.w...@gmail.com wrote: You're using an old version, grab 2.0.1 and try that. 1.X may have expired. On Jul 1, 3:46 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Setting Session Timeout?
I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
Thanks Marius I basically wound the session timeout down to 5 mins in the web.xml and left it for about 30 mins but the sessionVar was still full. Even after some hours of no use it was the same. There is this constant ajax_request pinging going on - related? -- Ewan On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote: LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
You answered your own question :) ... Yes that is Lift GC mechanism. You can of course turn it off in Boot by calling LiftRules.enableLiftGC=false but I would not recommend it. Is there a real use case why you need this or just tying to figure out how Lift works ? Br's, Marius On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote: Thanks Marius I basically wound the session timeout down to 5 mins in the web.xml and left it for about 30 mins but the sessionVar was still full. Even after some hours of no use it was the same. There is this constant ajax_request pinging going on - related? -- Ewan On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote: LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
Well I think I can commit something very simple that could help you, Currently session expiration mechanism considered only the time threshold ... but the lift GC is keeping it alive. So we can have LiftSession#terminateHint function that just marks a flag on this LiftSession. SessionMaster can consider this and purge the session properly at the next sessions scan. So you can have an actor where you're sending messages via ActorPing such as: ActorPing schedule(MyActor, Purge(S.session), 120 seconds) When you receive the Purg message on the received LiftSession just call session.terminateHint. (Note that S.session is a Box [LiftSession]) The questions would be when am I going to do this scheduling? ... Well probably right after you are setting a value on your SessionVar. If someone has any objections about this please do let me know. Otherwise I could probably commit this today. Br's, Marius On Jul 1, 3:08 pm, Ewan ehar...@gmail.com wrote: My use case is that I want to save anonymous users' (users that have not logged on or registered) baskets in the session and don't care if they are removed after a period of inactivity. In fact I would like the session to be expired after a while to encourage the user to sign up which if they do they get the benefit that the basket is persisted. --Ewan On Jul 1, 12:59 pm, marius d. marius.dan...@gmail.com wrote: You answered your own question :) ... Yes that is Lift GC mechanism. You can of course turn it off in Boot by calling LiftRules.enableLiftGC=false but I would not recommend it. Is there a real use case why you need this or just tying to figure out how Lift works ? Br's, Marius On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote: Thanks Marius I basically wound the session timeout down to 5 mins in the web.xml and left it for about 30 mins but the sessionVar was still full. Even after some hours of no use it was the same. There is this constant ajax_request pinging going on - related? -- Ewan On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote: LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
Yep, in /Applications/liftweb-1.0/java-rebel/ I have both a javarebel.jar and a javarebel.lic. Removing both of those 1.2.2 files and copying in the 2.0.1 jar works, though it says it's only licensed for a 30 day trial. Timothy, if you can get a longer license that would be awesome. Thanks! Peter On Jul 1, 3:25 am, Timothy Perrett timo...@getintheloop.eu wrote: The way we are handling it in the installer is all JR users have a .lic file for the license... The actual JAR for javarebel is separate so I think it would still persist to be an issue. Either way, I've gotten in touch with Jevgeni to see what he says. Cheers, Tim On 01/07/2009 11:19, TylerWeir tyler.w...@gmail.com wrote: You're using an old version, grab 2.0.1 and try that. 1.X may have expired. On Jul 1, 3:46 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
I've mailed Jevgeni (at javarebel), so will see what's what. If he doesn't come back in a day or two I'll try to get in touch with him again. Cheers, Tim On 01/07/2009 16:18, Peter Robinett pe...@bubblefoundry.com wrote: Yep, in /Applications/liftweb-1.0/java-rebel/ I have both a javarebel.jar and a javarebel.lic. Removing both of those 1.2.2 files and copying in the 2.0.1 jar works, though it says it's only licensed for a 30 day trial. Timothy, if you can get a longer license that would be awesome. Thanks! Peter On Jul 1, 3:25 am, Timothy Perrett timo...@getintheloop.eu wrote: The way we are handling it in the installer is all JR users have a .lic file for the license... The actual JAR for javarebel is separate so I think it would still persist to be an issue. Either way, I've gotten in touch with Jevgeni to see what he says. Cheers, Tim On 01/07/2009 11:19, TylerWeir tyler.w...@gmail.com wrote: You're using an old version, grab 2.0.1 and try that. 1.X may have expired. On Jul 1, 3:46 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Thoughts on file streaming
It would also be nice to be able to provide progress feedback. The page returned after the form submission can then use comet to display a progress bar or something like that. (The media upload at Vimeo comes to mind as a good example of this!) Also, I would suggest some smarts when creating temporary files. It might be good to abstract the cache so that small files don't get put on disk. --Andrew Vlad Seryakov wrote: I am also contemplating to use Lift but lack of big file upload is the showstopper. We need to upload images, and big video files and currently there i snot way to do it in Lift, i need something else to handle that which makes the whole stuff more complex than needed. Spooling into temp file and doing async upload of multiple files at the same time is what needed. Nowadays media uploads is normal and those files are getting bigger and bigger. On Jun 30, 5:58 pm, Timothy Perrett timo...@getintheloop.eu wrote: This has been hurting me for quite a while now (raised it on list about 2 months ago) and could really do with getting it fixed. As derek points out, it's not a small change which is why I've done nothing about it to date - a little too much core hacking to feel happy If you think your able to do something about it that would be absolutly brilliant! Cheers Tim Sent from my iPhone On 30 Jun 2009, at 22:33, David Pollak feeder.of.the.be...@gmail.com wrote: What kind of priority is this issue? I think I can abstract things in such a way that it works correctly, but it'll take a couple of days. On Tue, Jun 30, 2009 at 2:08 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, as usual something that seemed simple at first glance is now looking somewhat complex. I'm thinking of reworking the fileUpload handling to allow a user to register either a (String, String, Array [Byte]) = Any or (String, String, InputStream) = Any function, which would then be executed during request processing. The issue is that form field processing (ParamHolders) takes place in Req, befor e LiftSession has been set up, and the act of parsing the request fo r form data, particularly for large upload streams (the target of th ese changes) precludes holding on to any data for later processing ( the servlet container cannot be expected to hold the entire request in memory). On the other hand, users should reasonably expect that t heir form handling functions are stateful, so I'm trying to think of some way to meet in the middle on form processing. Ideas? Derek -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
Ewan, It seems that you've done your tests with a browser open to a page in your Lift app. It seems to me that you don't want to time out a session unless the user's browser is no longer looking at a page in the app. Is this in line with your expectations/use case? Thanks, David On Wed, Jul 1, 2009 at 5:08 AM, Ewan ehar...@gmail.com wrote: My use case is that I want to save anonymous users' (users that have not logged on or registered) baskets in the session and don't care if they are removed after a period of inactivity. In fact I would like the session to be expired after a while to encourage the user to sign up which if they do they get the benefit that the basket is persisted. --Ewan On Jul 1, 12:59 pm, marius d. marius.dan...@gmail.com wrote: You answered your own question :) ... Yes that is Lift GC mechanism. You can of course turn it off in Boot by calling LiftRules.enableLiftGC=false but I would not recommend it. Is there a real use case why you need this or just tying to figure out how Lift works ? Br's, Marius On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote: Thanks Marius I basically wound the session timeout down to 5 mins in the web.xml and left it for about 30 mins but the sessionVar was still full. Even after some hours of no use it was the same. There is this constant ajax_request pinging going on - related? -- Ewan On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote: LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
On a related note, I recently posted that JavaRebel in its latest version does not even seem to be working properly http://groups.google.com/group/liftweb/browse_thread/thread/58b81c09e409d9d7# Seems like a great tool, but not of much value with the 2.0.1 jar. Mark Lynn On Jul 1, 2009, at 11:49 AM, Timothy Perrett wrote: I've mailed Jevgeni (at javarebel), so will see what's what. If he doesn't come back in a day or two I'll try to get in touch with him again. Cheers, Tim On 01/07/2009 16:18, Peter Robinett pe...@bubblefoundry.com wrote: Yep, in /Applications/liftweb-1.0/java-rebel/ I have both a javarebel.jar and a javarebel.lic. Removing both of those 1.2.2 files and copying in the 2.0.1 jar works, though it says it's only licensed for a 30 day trial. Timothy, if you can get a longer license that would be awesome. Thanks! Peter On Jul 1, 3:25 am, Timothy Perrett timo...@getintheloop.eu wrote: The way we are handling it in the installer is all JR users have a .lic file for the license... The actual JAR for javarebel is separate so I think it would still persist to be an issue. Either way, I've gotten in touch with Jevgeni to see what he says. Cheers, Tim On 01/07/2009 11:19, TylerWeir tyler.w...@gmail.com wrote: You're using an old version, grab 2.0.1 and try that. 1.X may have expired. On Jul 1, 3:46 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Maven License Expired
Interestingly enough I didn't get an email from Tim yet, but I got a google alert for this message :) The original free Scala license was given for a limited period to be prolonged (or not) later. We knew that the current license is ending on 30th June and have already decided to prolong it. However we also decided to do it differently from the current setup (one license issued to the community). Instead we'll give free personal annual JavaRebel for Scala licenses individually through a website. This will give us a better sense of the current JavaRebel/Scala community :) But (and here comes the embarrassing part) the ZeroTurnaround team was so overworked lately that we didn't get to implementing the actual infrastructure yet. We have most of the stuff ready, and hopefully next week we'll send the announcement to the list. Until then I can recommend to download 2.0.1 from ZeroTurnaround.com and delete the current javarebel.lic so you can use the 30 day evaluation. Or just buy the personal license, it's worth it :) Sorry for the hassle! Jevgeni Kabanov ZeroTurnaround On Jul 1, 6:49 pm, Timothy Perrett timo...@getintheloop.eu wrote: I've mailed Jevgeni (at javarebel), so will see what's what. If he doesn't come back in a day or two I'll try to get in touch with him again. Cheers, Tim On 01/07/2009 16:18, Peter Robinett pe...@bubblefoundry.com wrote: Yep, in /Applications/liftweb-1.0/java-rebel/ I have both a javarebel.jar and a javarebel.lic. Removing both of those 1.2.2 files and copying in the 2.0.1 jar works, though it says it's only licensed for a 30 day trial. Timothy, if you can get a longer license that would be awesome. Thanks! Peter On Jul 1, 3:25 am, Timothy Perrett timo...@getintheloop.eu wrote: The way we are handling it in the installer is all JR users have a .lic file for the license... The actual JAR for javarebel is separate so I think it would still persist to be an issue. Either way, I've gotten in touch with Jevgeni to see what he says. Cheers, Tim On 01/07/2009 11:19, TylerWeir tyler.w...@gmail.com wrote: You're using an old version, grab 2.0.1 and try that. 1.X may have expired. On Jul 1, 3:46 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey Peter, That is odd! I'll speak with the folk at javarebel and get them to give us a new license file for the comunity. Cheers Tim Sent from my iPhone On 1 Jul 2009, at 08:28, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I just launched Maven and got the following error: $ mvn jetty:run ## ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until June 30, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## I got Maven via the Lift Mac OS X .dmg installer. Any idea how I can address this licensing issue and continue developing? Thanks! Peter Robinett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Thoughts on file streaming
K... I'll check some code in later today. On Wed, Jul 1, 2009 at 9:05 AM, Andrew Scherpbier and...@scherpbier.orgwrote: It would also be nice to be able to provide progress feedback. The page returned after the form submission can then use comet to display a progress bar or something like that. (The media upload at Vimeo comes to mind as a good example of this!) Also, I would suggest some smarts when creating temporary files. It might be good to abstract the cache so that small files don't get put on disk. --Andrew Vlad Seryakov wrote: I am also contemplating to use Lift but lack of big file upload is the showstopper. We need to upload images, and big video files and currently there i snot way to do it in Lift, i need something else to handle that which makes the whole stuff more complex than needed. Spooling into temp file and doing async upload of multiple files at the same time is what needed. Nowadays media uploads is normal and those files are getting bigger and bigger. On Jun 30, 5:58 pm, Timothy Perrett timo...@getintheloop.eu wrote: This has been hurting me for quite a while now (raised it on list about 2 months ago) and could really do with getting it fixed. As derek points out, it's not a small change which is why I've done nothing about it to date - a little too much core hacking to feel happy If you think your able to do something about it that would be absolutly brilliant! Cheers Tim Sent from my iPhone On 30 Jun 2009, at 22:33, David Pollak feeder.of.the.be...@gmail.com wrote: What kind of priority is this issue? I think I can abstract things in such a way that it works correctly, but it'll take a couple of days. On Tue, Jun 30, 2009 at 2:08 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, as usual something that seemed simple at first glance is now looking somewhat complex. I'm thinking of reworking the fileUpload handling to allow a user to register either a (String, String, Array [Byte]) = Any or (String, String, InputStream) = Any function, which would then be executed during request processing. The issue is that form field processing (ParamHolders) takes place in Req, befor e LiftSession has been set up, and the act of parsing the request fo r form data, particularly for large upload streams (the target of th ese changes) precludes holding on to any data for later processing ( the servlet container cannot be expected to hold the entire request in memory). On the other hand, users should reasonably expect that t heir form handling functions are stateful, so I'm trying to think of some way to meet in the middle on form processing. Ideas? Derek -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Thoughts on file streaming
Okay... I've checked in new code. In LiftRules, there's: /** * The function that converts a fieldName, contentType, fileName and an InputStream into * a FileParamHolder. By default, create an in-memory instance. Use OnDiskFileParamHolder * to create an on-disk version */ var handleMimeFile: (String, String, String, InputStream) = FileParamHolder = (fieldName, contentType, fileName, inputStream) = new InMemFileParamHolder(fieldName, contentType, fileName, Helpers.readWholeStream(inputStream)) You can change handleMimeFile to use OnDiskFileParamHolder. There's a companion object that has a helper that'll allow you to create an instance out of the parameters. By default, the OnDiskFileParamHolder deletes the temporary file when it is finalized. If you want to monitor the progress of an upload, use LiftRules: /** * The global multipart progress listener: * pBytesRead - The total number of bytes, which have been read so far. *pContentLength - The total number of bytes, which are being read. May be -1, if this number is unknown. *pItems - The number of the field, which is currently being read. (0 = no item so far, 1 = first item is being read, ...) */ var progessListener: (Long, Long, Int) = Unit = (_, _, _) = () By default, it does nothing, but you can put in a function that'll look for a session-specific CometActor and send it messages. If the above does not satisfy all your needs, you can subclass FileParamHolder and do whatever you want. Thanks, David On Wed, Jul 1, 2009 at 10:31 AM, David Pollak feeder.of.the.be...@gmail.com wrote: K... I'll check some code in later today. On Wed, Jul 1, 2009 at 9:05 AM, Andrew Scherpbier and...@scherpbier.orgwrote: It would also be nice to be able to provide progress feedback. The page returned after the form submission can then use comet to display a progress bar or something like that. (The media upload at Vimeo comes to mind as a good example of this!) Also, I would suggest some smarts when creating temporary files. It might be good to abstract the cache so that small files don't get put on disk. --Andrew Vlad Seryakov wrote: I am also contemplating to use Lift but lack of big file upload is the showstopper. We need to upload images, and big video files and currently there i snot way to do it in Lift, i need something else to handle that which makes the whole stuff more complex than needed. Spooling into temp file and doing async upload of multiple files at the same time is what needed. Nowadays media uploads is normal and those files are getting bigger and bigger. On Jun 30, 5:58 pm, Timothy Perrett timo...@getintheloop.eu wrote: This has been hurting me for quite a while now (raised it on list about 2 months ago) and could really do with getting it fixed. As derek points out, it's not a small change which is why I've done nothing about it to date - a little too much core hacking to feel happy If you think your able to do something about it that would be absolutly brilliant! Cheers Tim Sent from my iPhone On 30 Jun 2009, at 22:33, David Pollak feeder.of.the.be...@gmail.com wrote: What kind of priority is this issue? I think I can abstract things in such a way that it works correctly, but it'll take a couple of days. On Tue, Jun 30, 2009 at 2:08 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, as usual something that seemed simple at first glance is now looking somewhat complex. I'm thinking of reworking the fileUpload handling to allow a user to register either a (String, String, Array [Byte]) = Any or (String, String, InputStream) = Any function, which would then be executed during request processing. The issue is that form field processing (ParamHolders) takes place in Req, befor e LiftSession has been set up, and the act of parsing the request fo r form data, particularly for large upload streams (the target of th ese changes) precludes holding on to any data for later processing ( the servlet container cannot be expected to hold the entire request in memory). On the other hand, users should reasonably expect that t heir form handling functions are stateful, so I'm trying to think of some way to meet in the middle on form processing. Ideas? Derek -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp
[Lift] Lift Design
Hi, I just started using Lift. Somehow, I got the feeling that Lift is over lean. In a Model Class, you can define every thing, from which validation to which field should appear in UI. Isn't it contradiction with the concept of separation of concern Regards, Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift Design
On Wed, Jul 1, 2009 at 12:04 PM, sjtirtha sjtir...@gmail.com wrote: Hi, I just started using Lift. Somehow, I got the feeling that Lift is over lean. In a Model Class, you can define every thing, from which validation to which field should appear in UI. Isn't it contradiction with the concept of separation of concern You're assuming the separation of concerns is a good thing. In my 14+ years of writing web apps, I've found that 99% of the time, the model should have the validation rules for fields as part of the model. 80%+ of the time, the model and fields should have a reasonable default for display and user interaction. There's nothing that forces the use of the default display or user interaction methods, but having them close is very, very helpful. Also, please see http://blog.lostlake.org/index.php?/archives/19-Keeping-the-meaning-with-the-bytes.html Regards, Steve -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
H I understand the issue/feature now... where by if the page remains open then the session is kept alive by the ajax request which is a feature and it could be argued that for almost all cases this would be what is required. I believe there is a use case for wanting the session to expire after a predefined interval though - thinking secure apps such as banking or email. I know my bank irritates the hell out of me by logging me off after a period of inactivity though this might not be implemented via HttpSession but instead they persist a timestamp of the last request and compare with the current request time. My app requirements can be changed to fit the current method but I can imagine that there would be need for other projects to implement expiration as defined above. --Ewan On Jul 1, 5:20 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Ewan, It seems that you've done your tests with a browser open to a page in your Lift app. It seems to me that you don't want to time out a session unless the user's browser is no longer looking at a page in the app. Is this in line with your expectations/use case? Thanks, David On Wed, Jul 1, 2009 at 5:08 AM, Ewan ehar...@gmail.com wrote: My use case is that I want to save anonymous users' (users that have not logged on or registered) baskets in the session and don't care if they are removed after a period of inactivity. In fact I would like the session to be expired after a while to encourage the user to sign up which if they do they get the benefit that the basket is persisted. --Ewan On Jul 1, 12:59 pm, marius d. marius.dan...@gmail.com wrote: You answered your own question :) ... Yes that is Lift GC mechanism. You can of course turn it off in Boot by calling LiftRules.enableLiftGC=false but I would not recommend it. Is there a real use case why you need this or just tying to figure out how Lift works ? Br's, Marius On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote: Thanks Marius I basically wound the session timeout down to 5 mins in the web.xml and left it for about 30 mins but the sessionVar was still full. Even after some hours of no use it was the same. There is this constant ajax_request pinging going on - related? -- Ewan On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote: LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Setting Session Timeout?
On Wed, Jul 1, 2009 at 12:24 PM, Ewan ehar...@gmail.com wrote: H I understand the issue/feature now... where by if the page remains open then the session is kept alive by the ajax request which is a feature and it could be argued that for almost all cases this would be what is required. I believe there is a use case for wanting the session to expire after a predefined interval though - thinking secure apps such as banking or email. I know my bank irritates the hell out of me by logging me off after a period of inactivity though this might not be implemented via HttpSession but instead they persist a timestamp of the last request and compare with the current request time. There are ways to do this in Lift (both with client-side JavaScript which would be my preference and with some server-side interception of requests along-side a timer). At least BofA does it with a client-side timer that pops up a JS window. Anyway, if you wanted to explicitly time out a session due to inactivity, it's possible and not overly difficult. My app requirements can be changed to fit the current method but I can imagine that there would be need for other projects to implement expiration as defined above. --Ewan On Jul 1, 5:20 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Ewan, It seems that you've done your tests with a browser open to a page in your Lift app. It seems to me that you don't want to time out a session unless the user's browser is no longer looking at a page in the app. Is this in line with your expectations/use case? Thanks, David On Wed, Jul 1, 2009 at 5:08 AM, Ewan ehar...@gmail.com wrote: My use case is that I want to save anonymous users' (users that have not logged on or registered) baskets in the session and don't care if they are removed after a period of inactivity. In fact I would like the session to be expired after a while to encourage the user to sign up which if they do they get the benefit that the basket is persisted. --Ewan On Jul 1, 12:59 pm, marius d. marius.dan...@gmail.com wrote: You answered your own question :) ... Yes that is Lift GC mechanism. You can of course turn it off in Boot by calling LiftRules.enableLiftGC=false but I would not recommend it. Is there a real use case why you need this or just tying to figure out how Lift works ? Br's, Marius On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote: Thanks Marius I basically wound the session timeout down to 5 mins in the web.xml and left it for about 30 mins but the sessionVar was still full. Even after some hours of no use it was the same. There is this constant ajax_request pinging going on - related? -- Ewan On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote: LiftSession is bound to HttpSession through HttpSessionBindingListener and HttpSessionActivationListener This means that when the HTTP session terminates LiftSession will also terminate. To verify your SessionVar that the session was purged you can implement override protected def onShutdown(session: CleanUpParam): Unit = { ... } where in case of SessionVar the session parameter is really a LiftSession. The LiftSession timeout is given by HttpSession.getMaxInactiveInterval ... if that period is exceeded the LiftSession is unbound from the HttpSession. Does not necessary means that the HttpSession is removed by container ust that LiftSession is terminated. But is the problem the fact that HttpSession expired but you still had the context in the SessionVar? Br's, Marius On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote: I have recently started using a SessionVar and am quite happy to have the session wiped after some predefined interval. As an experiment I changed the session timeout in the web.xml a la Java Servlets but this had no effect running on jetty and since I have read that a SessionVar is not just a wrapper around javax.servlet.http.HttpSession. My question is then how can I configure the timeout interval? -- Ewan -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to
[Lift] Re: Thoughts on file streaming
Wow! This is very cool. Can't wait to try it out. --Andrew David Pollak wrote: Okay... I've checked in new code. In LiftRules, there's: /** * The function that converts a fieldName, contentType, fileName and an InputStream into * a FileParamHolder. By default, create an in-memory instance. Use OnDiskFileParamHolder * to create an on-disk version */ var handleMimeFile: (String, String, String, InputStream) = FileParamHolder = (fieldName, contentType, fileName, inputStream) = new InMemFileParamHolder(fieldName, contentType, fileName, Helpers.readWholeStream(inputStream)) You can change handleMimeFile to use OnDiskFileParamHolder. There's a companion object that has a helper that'll allow you to create an instance out of the parameters. By default, the OnDiskFileParamHolder deletes the temporary file when it is finalized. If you want to monitor the progress of an upload, use LiftRules: /** * The global multipart progress listener: * pBytesRead - The total number of bytes, which have been read so far. * pContentLength - The total number of bytes, which are being read. May be -1, if this number is unknown. * pItems - The number of the field, which is currently being read. (0 = no item so far, 1 = first item is being read, ...) */ var progessListener: (Long, Long, Int) = Unit = (_, _, _) = () By default, it does nothing, but you can put in a function that'll look for a session-specific CometActor and send it messages. If the above does not satisfy all your needs, you can subclass FileParamHolder and do whatever you want. Thanks, David On Wed, Jul 1, 2009 at 10:31 AM, David Pollak feeder.of.the.be...@gmail.com wrote: K... I'll check some code in later today. On Wed, Jul 1, 2009 at 9:05 AM, Andrew Scherpbier and...@scherpbier.org wrote: It would also be nice to be able to provide progress feedback. The page returned after the form submission can then use comet to display a progress bar or something like that. (The media upload at Vimeo comes to mind as a good example of this!) Also, I would suggest some smarts when creating temporary files. It might be good to abstract the cache so that small files don't get put on disk. --Andrew Vlad Seryakov wrote: I am also contemplating to use Lift but lack of big file upload is the showstopper. We need to upload images, and big video files and currently there i snot way to do it in Lift, i need something else to handle that which makes the whole stuff more complex than needed. Spooling into temp file and doing async upload of multiple files at the same time is what needed. Nowadays media uploads is normal and those files are getting bigger and bigger. On Jun 30, 5:58 pm, Timothy Perrett timo...@getintheloop.eu wrote: This has been hurting me for quite a while now (raised it on list about 2 months ago) and could really do with getting it fixed. As derek points out, it's not a small change which is why I've done nothing about it to date - a little too much core hacking to feel happy If you think your able to do something about it that would be absolutly brilliant! Cheers Tim Sent from my iPhone On 30 Jun 2009, at 22:33, David Pollak feeder.of.the.be...@gmail.com wrote: What kind of priority is this issue? I think I can abstract things in such a way that it works correctly, but it'll take a couple of days. On Tue, Jun 30, 2009 at 2:08 PM, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, as usual something that seemed simple at first glance is now looking somewhat complex. I'm thinking of reworking the fileUpload handling to allow a user to register either a (String, String, Array [Byte]) = Any or (String, String, InputStream) = Any function, which would then be executed during request processing. The issue is that form field processing (ParamHolders) takes place in Req, befor e LiftSession has been set up, and the act of parsing the request fo r form data, particularly for large upload streams (the target of th ese changes) precludes holding on to any data for later processing ( the servlet container cannot be expected to hold the entire request in memory). On the other hand, users should reasonably expect that t heir form handling functions are stateful, so I'm trying to think of some way to meet in the middle on form processing. Ideas? Derek -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework
[Lift] Re: Modify CRUDify XHTML
Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
Well if the box is empty l will be a String so of course you can't access foundParam. - Peter Robinettpe...@bubblefoundry.com wrote: Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
Instead of yielding loc which is taking it out of the box and putting it back in, access foundParam inside the for loop. - Peter Robinettpe...@bubblefoundry.com wrote: Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: grabbing rss or other type of feeds within lift
Thanks David. I'm going with some direct calls for simplicity (along the path you suggested). along the lines of: val rssFeed = XML.load( (new URL (feedUrl)).openConnection.getInputStream ) One more oddity, I'm getting problems compiling normal scala code but I can build lift projects (with scala inside them). Something that I need to add in the config file like a path to the scala binaries? (installed it in windows default spot) for netbeans.conf the netbeans_default_options var, adding -J-Dscala.home=SCALA_HOME where's SCALA_HOME supposed to point to? I tried: -D\c:\Users\Dude Jones\.netbeans\6.7rc3\scala\scala-2.7.3.final\\ where the binaries are no luck Getting the error: init: deps-jar: Compiling 1 source file to C:\Mark\misc\EntrepreneurInfo \IntelligentAdvertisingSoftware\testo\build\classes Could not connect to compilation daemon. org.netbeans.core.execution.ExitSecurityException: Exit from within execution engine, normal at org.netbeans.core.execution.SecMan.checkExitImpl (SecMan.java:85) at org.netbeans.core.execution.SecMan$PrivilegedCheck.run (SecMan.java:160) at java.security.AccessController.doPrivileged(Native Method) at org.netbeans.core.execution.SecMan$PrivilegedCheck.check (SecMan.java:175) at org.netbeans.core.execution.SecMan$PrivilegedCheck.checkExit (SecMan.java:170) at org.netbeans.core.execution.SecMan.checkExit(SecMan.java: 69) at org.netbeans.TopSecurityManager.checkExit (TopSecurityManager.java:149) at java.lang.Runtime.exit(Runtime.java:88) at java.lang.System.exit(System.java:904) at scala.Predef$.exit(Predef.scala:81) at scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:53) at scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala: 175) at scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala: 206) at scala.tools.nsc.CompileSocket.getOrCreateSocket (CompileSocket.scala:227) at scala.tools.nsc.StandardCompileClient.main0 (CompileClient.scala:94) at scala.tools.ant.FastScalac.execute(FastScalac.scala:96) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute (Sequential.java:62) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute (MacroInstance.java:394) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets (Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java: 1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java: 1189) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run (BridgeImpl.java:278) at org.apache.tools.ant.module.run.TargetExecutor.run (TargetExecutor.java:497) at org.netbeans.core.execution.RunClassThread.run (RunClassThread.java:151) C:\Mark\misc\EntrepreneurInfo\IntelligentAdvertisingSoftware\testo \nbproject\build-impl.xml:405: The following error occurred while executing this line: C:\Mark\misc\EntrepreneurInfo\IntelligentAdvertisingSoftware\testo \nbproject\build-impl.xml:229: Compile failed because of an internal compiler error (Exit from within execution engine, normal); see the error output for details. BUILD FAILED (total time: 2 seconds) On Jun 30, 10:09 am, David Pollak feeder.of.the.be...@gmail.com wrote: Personally, I'd use Scala's XML parsing to parse the feed... skip the external library. You may also want to look at
[Lift] Re: grabbing rss or other type of feeds within lift
On Wed, Jul 1, 2009 at 2:16 PM, Mark Essel mes...@gmail.com wrote: Thanks David. I'm going with some direct calls for simplicity (along the path you suggested). along the lines of: val rssFeed = XML.load( (new URL (feedUrl)).openConnection.getInputStream ) One more oddity, I'm getting problems compiling normal scala code but I can build lift projects (with scala inside them). No clue about this... sorry. Something that I need to add in the config file like a path to the scala binaries? (installed it in windows default spot) for netbeans.conf the netbeans_default_options var, adding -J-Dscala.home=SCALA_HOME where's SCALA_HOME supposed to point to? I tried: -D\c:\Users\Dude Jones\.netbeans\6.7rc3\scala\scala-2.7.3.final\\ where the binaries are no luck Getting the error: init: deps-jar: Compiling 1 source file to C:\Mark\misc\EntrepreneurInfo \IntelligentAdvertisingSoftware\testo\build\classes Could not connect to compilation daemon. org.netbeans.core.execution.ExitSecurityException: Exit from within execution engine, normal at org.netbeans.core.execution.SecMan.checkExitImpl (SecMan.java:85) at org.netbeans.core.execution.SecMan$PrivilegedCheck.run (SecMan.java:160) at java.security.AccessController.doPrivileged(Native Method) at org.netbeans.core.execution.SecMan$PrivilegedCheck.check (SecMan.java:175) at org.netbeans.core.execution.SecMan$PrivilegedCheck.checkExit (SecMan.java:170) at org.netbeans.core.execution.SecMan.checkExit(SecMan.java: 69) at org.netbeans.TopSecurityManager.checkExit (TopSecurityManager.java:149) at java.lang.Runtime.exit(Runtime.java:88) at java.lang.System.exit(System.java:904) at scala.Predef$.exit(Predef.scala:81) at scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:53) at scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala: 175) at scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala: 206) at scala.tools.nsc.CompileSocket.getOrCreateSocket (CompileSocket.scala:227) at scala.tools.nsc.StandardCompileClient.main0 (CompileClient.scala:94) at scala.tools.ant.FastScalac.execute(FastScalac.scala:96) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute (Sequential.java:62) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute (MacroInstance.java:394) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets (Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java: 1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java: 1189) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run (BridgeImpl.java:278) at org.apache.tools.ant.module.run.TargetExecutor.run (TargetExecutor.java:497) at org.netbeans.core.execution.RunClassThread.run (RunClassThread.java:151) C:\Mark\misc\EntrepreneurInfo\IntelligentAdvertisingSoftware\testo \nbproject\build-impl.xml:405: The following error occurred while executing this line: C:\Mark\misc\EntrepreneurInfo\IntelligentAdvertisingSoftware\testo \nbproject\build-impl.xml:229: Compile failed because of an internal compiler error (Exit from within execution engine, normal); see the error output for details. BUILD FAILED (total time: 2 seconds) On Jun 30, 10:09 am, David
[Lift] Re: can a Snippet call a Snippet?
I will look into the nested snippets. For expediency, I folded all the snippets that interact with my template into one file, so I can concentrate on the business logic. For my Todo app enhancement, I need to pass the id of my selected Tag (which I have confirmed is correctly gathered from the page request) in to the TD.list method, so that the filtered Todos (those bearing the required Tag) will be found and rendered. My problem is that if I try to pass an additional argument (tagId: Long), the TD.list method is not happy and will not even render the template. I have tried both paired (html: NodeSeq, tagId: Long) as well as curried style (html: NodeSeq)(tagId: Long), but neither works. There must be a simple way to accomplish such a common task! Thanks to all the members for commenting... On Jun 29, 11:25 pm, marius d. marius.dan...@gmail.com wrote: Or you can use S.locateMappedSnippet ... but first try to see if nested snippet won't do the trick for you ... On Jun 30, 10:17 am, marius d. marius.dan...@gmail.com wrote: Can you paste some code? Essentially we support nested snippets so your snippet can simply return a markup containing another snippet and it will be invoked. If you really want to manually invoke a snippet from another snippet and if you are not using StatefulSnippets you can just instantiate the class and call your function and pass it the right NodeSeq. Br's, Marius On Jun 30, 5:36 am, g-man gregor...@gmail.com wrote: I am enhancing the Todo app by adding tags. I have retained the TD.scala snippet to manage the Todos on my page, and added a TG.scala snippet to handle tags on the same page, which works well for creating new and listing in both cases. Now I want to filter my Todos list by a Tag instance I select from my list, and therefore need to pass the id of the selected tag over from the TG snippet to the TD snippet, where it can be used as a filter argument for a find method. The problem is that scala says it cannot find snippet TD, whose method I am calling as TD.list from the TG.scala snippet. I have tried all kinds of explicit importing, but no luck. So, can a snippet call a snippet, or is that controlled only from the web page?- 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 liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Changes to ajax handling?
Hi, all, Have there been recent changes made to liftAjax.js? I am encountering new errors from an ajaxSelect() today that were not present yesterday. Firebug complains: Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible. [Break on this error] undefined liftAjax.js (line 111) aboutToSend.responseType is null lift_doAjaxCycle()()liftAjax.js (line 111) lift_ajaxHandler()()liftAjax.js (line 21) onchange(change )add_trig...Gyw%3D%3D (line 2) [Break on this error] if (aboutToSend.responseType.toLowerCase() === json) { Thanks, Kris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Changes to ajax handling?
To answer my own question, looking over the commit log 28595307 looks extremely suspicious. I can revert it locally but would prefer a mainline fix, and don't want to attempt it myself. Marius? Kris On Wed, Jul 1, 2009 at 3:33 PM, Kris Nuttycombekris.nuttyco...@gmail.com wrote: Hi, all, Have there been recent changes made to liftAjax.js? I am encountering new errors from an ajaxSelect() today that were not present yesterday. Firebug complains: Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible. [Break on this error] undefined liftAjax.js (line 111) aboutToSend.responseType is null lift_doAjaxCycle()()liftAjax.js (line 111) lift_ajaxHandler()()liftAjax.js (line 21) onchange(change )add_trig...Gyw%3D%3D (line 2) [Break on this error] if (aboutToSend.responseType.toLowerCase() === json) { Thanks, Kris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: can a Snippet call a Snippet?
On Wed, Jul 1, 2009 at 2:28 PM, g-man gregor...@gmail.com wrote: I will look into the nested snippets. For expediency, I folded all the snippets that interact with my template into one file, so I can concentrate on the business logic. For my Todo app enhancement, I need to pass the id of my selected Tag (which I have confirmed is correctly gathered from the page request) in to the TD.list method, so that the filtered Todos (those bearing the required Tag) will be found and rendered. My problem is that if I try to pass an additional argument (tagId: Long), the TD.list method is not happy and will not even render the template. I have tried both paired (html: NodeSeq, tagId: Long) as well as curried style (html: NodeSeq)(tagId: Long), but neither works. Try: list(tagId: Long)(html: NodeSeq): NodeSeq That way list(44L) _ becomes a NodeSeq = NodeSeq There must be a simple way to accomplish such a common task! Thanks to all the members for commenting... On Jun 29, 11:25 pm, marius d. marius.dan...@gmail.com wrote: Or you can use S.locateMappedSnippet ... but first try to see if nested snippet won't do the trick for you ... On Jun 30, 10:17 am, marius d. marius.dan...@gmail.com wrote: Can you paste some code? Essentially we support nested snippets so your snippet can simply return a markup containing another snippet and it will be invoked. If you really want to manually invoke a snippet from another snippet and if you are not using StatefulSnippets you can just instantiate the class and call your function and pass it the right NodeSeq. Br's, Marius On Jun 30, 5:36 am, g-man gregor...@gmail.com wrote: I am enhancing the Todo app by adding tags. I have retained the TD.scala snippet to manage the Todos on my page, and added a TG.scala snippet to handle tags on the same page, which works well for creating new and listing in both cases. Now I want to filter my Todos list by a Tag instance I select from my list, and therefore need to pass the id of the selected tag over from the TG snippet to the TD snippet, where it can be used as a filter argument for a find method. The problem is that scala says it cannot find snippet TD, whose method I am calling as TD.list from the TG.scala snippet. I have tried all kinds of explicit importing, but no luck. So, can a snippet call a snippet, or is that controlled only from the web page?- Hide quoted text - - Show quoted text - -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
On Wed, Jul 1, 2009 at 2:02 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open When in doubt, specify a type explicitly: val l: Loc[_] = loc openOr Couldn't open This will fail because you've got a Box[Loc[_]] and you're doing an openOr with a String... the only common class between the two is Object. As another post suggested, do the foundParam.is inside the yield println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: grabbing rss or other type of feeds within lift
Thanks think I'm making progress following this: http://wiki.netbeans.org/Scala after the install of 6.7RC3, jdk, scala plugin, lift, maven (used it to get a test lift project) my lift project worked with scala code inside the project but what I didn't do was set SCALA_HOME, my class path appended with that SCALA_HOME\bin and finally add that option -J-Dscala.home=SCALA_HOME to the netbeans.conf hoping that does it. Not for nothing but I wonder why all the hoops to get a compiler + IDE has so many little steps. Eclipse I tried something similar with but never even got the lift project or maven working. I come from an old makefile /command line library background, and recently .NET libraries, mains (various languages). Netbeans is still new to me (used once before for gcc in cygwin). On Jul 1, 5:24 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:16 PM, Mark Essel mes...@gmail.com wrote: Thanks David. I'm going with some direct calls for simplicity (along the path you suggested). along the lines of: val rssFeed = XML.load( (new URL (feedUrl)).openConnection.getInputStream ) One more oddity, I'm getting problems compiling normal scala code but I can build lift projects (with scala inside them). No clue about this... sorry. Something that I need to add in the config file like a path to the scala binaries? (installed it in windows default spot) for netbeans.conf the netbeans_default_options var, adding -J-Dscala.home=SCALA_HOME where's SCALA_HOME supposed to point to? I tried: -D\c:\Users\Dude Jones\.netbeans\6.7rc3\scala\scala-2.7.3.final\\ where the binaries are no luck Getting the error: init: deps-jar: Compiling 1 source file to C:\Mark\misc\EntrepreneurInfo \IntelligentAdvertisingSoftware\testo\build\classes Could not connect to compilation daemon. org.netbeans.core.execution.ExitSecurityException: Exit from within execution engine, normal at org.netbeans.core.execution.SecMan.checkExitImpl (SecMan.java:85) at org.netbeans.core.execution.SecMan$PrivilegedCheck.run (SecMan.java:160) at java.security.AccessController.doPrivileged(Native Method) at org.netbeans.core.execution.SecMan$PrivilegedCheck.check (SecMan.java:175) at org.netbeans.core.execution.SecMan$PrivilegedCheck.checkExit (SecMan.java:170) at org.netbeans.core.execution.SecMan.checkExit(SecMan.java: 69) at org.netbeans.TopSecurityManager.checkExit (TopSecurityManager.java:149) at java.lang.Runtime.exit(Runtime.java:88) at java.lang.System.exit(System.java:904) at scala.Predef$.exit(Predef.scala:81) at scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:53) at scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala: 175) at scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala: 206) at scala.tools.nsc.CompileSocket.getOrCreateSocket (CompileSocket.scala:227) at scala.tools.nsc.StandardCompileClient.main0 (CompileClient.scala:94) at scala.tools.ant.FastScalac.execute(FastScalac.scala:96) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute (Sequential.java:62) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute (MacroInstance.java:394) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets (Project.java:1337)
[Lift] unit test framework
This question might be obvious to most of the people here, but since I new to Scala and Java I'm not clear Maven generates 2 different unit test files: MySpec specs AppTest junit running mvn test invokes AppTest (and other test cases with annotation @Test) running from Eclipse project as JUnit invokes MySpec I'm trying to figure out what unit test framework to use in my project. I'd prefer to have JUnit compatible output as continuous build system will, probably, understand it. Are both test frameworks generate JUnit-compatible output? How to make maven invoke specs test when running mvn test? Why is it 2 different test frameworks used? Are they complimentary? If yes when use which? I will probably use Hudson for continuous builds and also invoke unit tests from script and or command line and will need parse result and generate reports. What framework is better for these purposes? Or maybe use both in defferent cases? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: grabbing rss or other type of feeds within lift
Which maven plugin did you try for eclipse? M2eclipse works for me... - Mark Esselmes...@gmail.com wrote: Thanks think I'm making progress following this: http://wiki.netbeans.org/Scala after the install of 6.7RC3, jdk, scala plugin, lift, maven (used it to get a test lift project) my lift project worked with scala code inside the project but what I didn't do was set SCALA_HOME, my class path appended with that SCALA_HOME\bin and finally add that option -J-Dscala.home=SCALA_HOME to the netbeans.conf hoping that does it. Not for nothing but I wonder why all the hoops to get a compiler + IDE has so many little steps. Eclipse I tried something similar with but never even got the lift project or maven working. I come from an old makefile /command line library background, and recently .NET libraries, mains (various languages). Netbeans is still new to me (used once before for gcc in cygwin). On Jul 1, 5:24 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:16 PM, Mark Essel mes...@gmail.com wrote: Thanks David. I'm going with some direct calls for simplicity (along the path you suggested). along the lines of: val rssFeed = XML.load( (new URL (feedUrl)).openConnection.getInputStream ) One more oddity, I'm getting problems compiling normal scala code but I can build lift projects (with scala inside them). No clue about this... sorry. Something that I need to add in the config file like a path to the scala binaries? (installed it in windows default spot) for netbeans.conf the netbeans_default_options var, adding -J-Dscala.home=SCALA_HOME where's SCALA_HOME supposed to point to? I tried: -D\c:\Users\Dude Jones\.netbeans\6.7rc3\scala\scala-2.7.3.final\\ where the binaries are no luck Getting the error: init: deps-jar: Compiling 1 source file to C:\Mark\misc\EntrepreneurInfo \IntelligentAdvertisingSoftware\testo\build\classes Could not connect to compilation daemon. org.netbeans.core.execution.ExitSecurityException: Exit from within execution engine, normal at org.netbeans.core.execution.SecMan.checkExitImpl (SecMan.java:85) at org.netbeans.core.execution.SecMan$PrivilegedCheck.run (SecMan.java:160) at java.security.AccessController.doPrivileged(Native Method) at org.netbeans.core.execution.SecMan$PrivilegedCheck.check (SecMan.java:175) at org.netbeans.core.execution.SecMan$PrivilegedCheck.checkExit (SecMan.java:170) at org.netbeans.core.execution.SecMan.checkExit(SecMan.java: 69) at org.netbeans.TopSecurityManager.checkExit (TopSecurityManager.java:149) at java.lang.Runtime.exit(Runtime.java:88) at java.lang.System.exit(System.java:904) at scala.Predef$.exit(Predef.scala:81) at scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:53) at scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala: 175) at scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala: 206) at scala.tools.nsc.CompileSocket.getOrCreateSocket (CompileSocket.scala:227) at scala.tools.nsc.StandardCompileClient.main0 (CompileClient.scala:94) at scala.tools.ant.FastScalac.execute(FastScalac.scala:96) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute (Sequential.java:62) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute (MacroInstance.java:394) at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at
[Lift] Re: Modify CRUDify XHTML
Thanks Naftoli and David, I'm starting to understand what I need to do. However, the solution has revealed a gap in my beginner's knowledge of Scala: why was my code printing out the Loc instead of Couldn't open? Second, even with foundParam.is within the for comprehension, I still need to get the the value out of the comprehension – the rest of my snippet is based upon it. So, I still need to openOr the Box, no? If so, how? Is there a more functional and Scalarific way to do this? Thanks for your help, Peter On Jul 1, 2:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:02 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open When in doubt, specify a type explicitly: val l: Loc[_] = loc openOr Couldn't open This will fail because you've got a Box[Loc[_]] and you're doing an openOr with a String... the only common class between the two is Object. As another post suggested, do the foundParam.is inside the yield println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
On Wed, Jul 1, 2009 at 3:34 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks Naftoli and David, I'm starting to understand what I need to do. However, the solution has revealed a gap in my beginner's knowledge of Scala: why was my code printing out the Loc instead of Couldn't open? Are you coming from Java/C# or Ruby/Python? Second, even with foundParam.is within the for comprehension, I still need to get the the value out of the comprehension – the rest of my snippet is based upon it. So, I still need to openOr the Box, no? If so, how? Is there a more functional and Scalarific way to do this? I don't think you have to pull the value out of the for comprehension... do all the work inside the for comprehension. When you're doing your design, think about transformation. You'll transforming input to output. In this particular instance, what kind of transformation are you performing? Thanks for your help, Peter On Jul 1, 2:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:02 PM, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open When in doubt, specify a type explicitly: val l: Loc[_] = loc openOr Couldn't open This will fail because you've got a Box[Loc[_]] and you're doing an openOr with a String... the only common class between the two is Object. As another post suggested, do the foundParam.is inside the yield println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --
[Lift] Re: Modify CRUDify XHTML
A Box is a container that holds 0 or 1 elements(s). openOr means if the Box is Full return the element; otherwise return the parameter--my default value. One alternative approach would be to specify a default Loc. - Peter Robinettpe...@bubblefoundry.com wrote: Thanks Naftoli and David, I'm starting to understand what I need to do. However, the solution has revealed a gap in my beginner's knowledge of Scala: why was my code printing out the Loc instead of Couldn't open? Second, even with foundParam.is within the for comprehension, I still need to get the the value out of the comprehension – the rest of my snippet is based upon it. So, I still need to openOr the Box, no? If so, how? Is there a more functional and Scalarific way to do this? Thanks for your help, Peter On Jul 1, 2:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:02 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, David. Unfortunately I'm having a hard time figuring out how to get the foundParam. Using your code, I have: val loc = for {req - S.request; loc - req.location} yield loc val l = loc openOr Couldn't open When in doubt, specify a type explicitly: val l: Loc[_] = loc openOr Couldn't open This will fail because you've got a Box[Loc[_]] and you're doing an openOr with a String... the only common class between the two is Object. As another post suggested, do the foundParam.is inside the yield println(loc) println(l) The first println give me: Full(Loc(View List(nodes), function, LinkText(function), List())) While the second shows that I am opening the Box: Loc(View List(nodes), function, LinkText(function), List()) If I try to access my Loc object, I get compilation errors. For example, val p = l.foundParam leads to the error value foundParam is not a member of java.lang.Object. The toString method works, while the title parameter gives me the same error. I believe I am using the latest Lift code (I ran mvn -U jetty:run) and feel I must be missing something very simple here. Any advice is much appreciated! Peter On Jun 29, 10:05 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 26, 2009 at 6:39 PM, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, Derek and Jeppe, your responses were very helpful. I implemented Jeppe's solution and added my own snippet tag within _viewTemplate. Unfortunately, I spent the whole day trying to figure out how pass the current CRUDified object to my snippet. Do I retrieve it in _viewTemplate from S.params and add an attribute to the snippet tag? Or just retrieve it from S in the snippet? I've just made Loc.foundParam public. If you get the Loc from the Req from S (for {req - S.request; loc - req.location}) you can access foundParam which contains the current crudified object. Thanks, David I think I'm missing something fundamental with the S object and snippets. As you can tell, I'm very new to Lift! Any advice is much appreciated. Peter On Jun 24, 11:01 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On 24 Jun 2009, Peter Robinett wrote: Hi all, I'm using CRUDify on one of my models and I'd like to display some additional data on the view template. I believe that I need to override one of the model definitions with some sort of reference to my own XHTML file. Which one? _viewTemplate? Or perhaps the viewTemplate method? If you look at the source to CRUDify, you'll see def viewTemplate(): NodeSeq = pageWrapper(_viewTemplate) where def pageWrapper(body: NodeSeq): NodeSeq = lift:surround with=default at=content { body } /lift:surround def _viewTemplate = lift:crud.view table id={viewId} class={viewClass} crud:row tr tdcrud:name//td tdcrud:value//td /tr /crud:row /table /lift:crud.view So the simplest thing is to override _viewTemplate with something similar to the above. This should be done on the companion objects where CRUDify is mixed in /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com
[Lift] Re: unit test framework
Hi, My understanding is that historically the first tests for lift were proposed as JUnit tests. Then I implemented a few tests using specs (which I created), mostly for the lift-util module. Now, to answer your question, specs is compatible with JUnit, so you can write specs and make them runnable with JUnit by writing: class MySpec extends SpecificationWithJUnit { } [note1: that this is with specs-1.5.1-SNAPSHOT, with 1.5.0 you would write extends Specification with JUnit. This was changed to remove junit dependencies on the Specification class]. [note2: the other, more verbose way, of doing the same thing is to declare: class MySpecTest extend org.specs.runner.JUnit(MySpec) object MySpec extends Specification ] Then you can also run this specification from the command line with: scala -cp ... run MySpec So I would say that eventually this comes down to a matter of taste when writing tests, whether you prefer the junit or specs syntax. Eric. On Jul 2, 8:07 am, ph pkirsa...@gmail.com wrote: This question might be obvious to most of the people here, but since I new to Scala and Java I'm not clear Maven generates 2 different unit test files: MySpec specs AppTest junit running mvn test invokes AppTest (and other test cases with annotation @Test) running from Eclipse project as JUnit invokes MySpec I'm trying to figure out what unit test framework to use in my project. I'd prefer to have JUnit compatible output as continuous build system will, probably, understand it. Are both test frameworks generate JUnit-compatible output? How to make maven invoke specs test when running mvn test? Why is it 2 different test frameworks used? Are they complimentary? If yes when use which? I will probably use Hudson for continuous builds and also invoke unit tests from script and or command line and will need parse result and generate reports. What framework is better for these purposes? Or maybe use both in defferent cases? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
On Jul 1, 3:38 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Are you coming from Java/C# or Ruby/Python? PHP, Python and Javascript I don't think you have to pull the value out of the for comprehension... do all the work inside the for comprehension. When you're doing your design, think about transformation. You'll transforming input to output. In this particular instance, what kind of transformation are you performing? To the extent that you can call it transformation, I'm trying to transform the Node the user selected (via clicking on a link in the format /nodes/view/some node id) to a Flot graph of the Node's Packets. So, I'm writing a snippet to display a Flot graph of all the recent Packets of a Node. This snippet is called in the viewTemplate of the CRUDified Node model (hence the title of this thread). So based upon the Flot examples I have been seeking to have my snippet be something of the format: def time (xhtml: NodeSeq) = { def graph () = { val node = the Node the user requested val s = new FlotSerie () { override val data = Packet.findAll(By(Packet.node, node.id), OrderBy (Packet.dt, Descending), MaxRows(1000)).map(p = (p.dt.getTime.toDouble, p.temp.is)) } ... various Flot code, including adding the s FlotSerie to options FlotOptions ... Flot.render(ph_graph, s :: Nil, options, Flot.script(xhtml), overview) } bind (flot, xhtml, graph - graph) } Am I going about this in the correct way? Again, thanks for the help, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
On Wed, Jul 1, 2009 at 4:00 PM, Peter Robinett pe...@bubblefoundry.comwrote: On Jul 1, 3:38 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Are you coming from Java/C# or Ruby/Python? PHP, Python and Javascript Okay... makes sense. Yes, the reference contained a Loc, but the compiler could not verify that it contained a Loc. At compile time, the compiler knows the common superclass between Loc[_] and String is Object. Thus the type of l in your code was Object and Object doesn't have the foundParam method. I don't think you have to pull the value out of the for comprehension... do all the work inside the for comprehension. When you're doing your design, think about transformation. You'll transforming input to output. In this particular instance, what kind of transformation are you performing? To the extent that you can call it transformation, I'm trying to transform the Node the user selected (via clicking on a link in the format /nodes/view/some node id) to a Flot graph of the Node's Packets. So, I'm writing a snippet to display a Flot graph of all the recent Packets of a Node. This snippet is called in the viewTemplate of the CRUDified Node model (hence the title of this thread). So based upon the Flot examples I have been seeking to have my snippet I'd put your snippet in your Loc. That way you have access to the foundParam. Loc.Snippet(time, time) And then in your Loc, you put the time method below. In that case, you'll have direct access to foundParam without any goofiness. be something of the format: def time (xhtml: NodeSeq) = { def graph () = { val node = the Node the user requested val s = new FlotSerie () { override val data = Packet.findAll(By(Packet.node, node.id), OrderBy You could also write this as: override val data = Packet.findAll(By(Packet.node, for (req - S.request; loc - req.location) yield loc.asInstanceOf[Loc[Node]].foundParam.is), MaxRows(1000) (Packet.dt, Descending), MaxRows(1000)).map(p = (p.dt.getTime.toDouble, p.temp.is)) } ... various Flot code, including adding the s FlotSerie to options FlotOptions ... Flot.render(ph_graph, s :: Nil, options, Flot.script(xhtml), overview) } bind (flot, xhtml, graph - graph) } Am I going about this in the correct way? Again, thanks for the help, Peter -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
Everyone, I apologize for monopolizing the list but this has been very helpful for me. I've learned a bunch from similar, old entries in the list and hope this thread will help future Lift beginners. On to my reply to David: On Jul 1, 4:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Yes, the reference contained a Loc, but the compiler could not verify that it contained a Loc. At compile time, the compiler knows the common superclass between Loc[_] and String is Object. Thus the type of l in your code was Object and Object doesn't have the foundParam method. O! Ok, that makes a lot of sense. I'd put your snippet in your Loc. That way you have access to the foundParam. Loc.Snippet(time, time) And then in your Loc, you put the time method below. In that case, you'll have direct access to foundParam without any goofiness. To be honest, this doesn't make a lot of sense to me. I assume you mean a Loc in the Menus of my SiteMap that I assemble in Boot.scala. I'm using the Locs created by the CRUDify trait added to my Node model so I guess I would have to override the Node.menus method. I think I'll delve into this more later when it's necessary... You could also write this as: override val data = Packet.findAll(By(Packet.node, for (req - S.request; loc - req.location) yield loc.asInstanceOf[Loc[Node]].foundParam.is), MaxRows(1000) Ok, this makes sense but unfortunately the value yielded by the for comprehension is all boxed up and so I get an error: error: no implicit argument matching parameter type (net.liftweb.util.Box[net.liftweb.util.Box [com.equalnetworks.model.Node]]) = Long was found. override val data = Packet.findAll(By(Packet.node, for (req - S.request; What would be the best way to unbox things to get the actual Node object so I can have a Long to put in my By() call? Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
If you know the Box is full you can write open_! (you'll get a runtime error if it wasn't). Otherwise openOr a default, e.g., an invalid id. You have first answer the question, what _should_ happen if it's Empty after all? :) - Peter Robinettpe...@bubblefoundry.com wrote: Everyone, I apologize for monopolizing the list but this has been very helpful for me. I've learned a bunch from similar, old entries in the list and hope this thread will help future Lift beginners. On to my reply to David: On Jul 1, 4:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Yes, the reference contained a Loc, but the compiler could not verify that it contained a Loc. At compile time, the compiler knows the common superclass between Loc[_] and String is Object. Thus the type of l in your code was Object and Object doesn't have the foundParam method. O! Ok, that makes a lot of sense. I'd put your snippet in your Loc. That way you have access to the foundParam. Loc.Snippet(time, time) And then in your Loc, you put the time method below. In that case, you'll have direct access to foundParam without any goofiness. To be honest, this doesn't make a lot of sense to me. I assume you mean a Loc in the Menus of my SiteMap that I assemble in Boot.scala. I'm using the Locs created by the CRUDify trait added to my Node model so I guess I would have to override the Node.menus method. I think I'll delve into this more later when it's necessary... You could also write this as: override val data = Packet.findAll(By(Packet.node, for (req - S.request; loc - req.location) yield loc.asInstanceOf[Loc[Node]].foundParam.is), MaxRows(1000) Ok, this makes sense but unfortunately the value yielded by the for comprehension is all boxed up and so I get an error: error: no implicit argument matching parameter type (net.liftweb.util.Box[net.liftweb.util.Box [com.equalnetworks.model.Node]]) = Long was found. override val data = Packet.findAll(By(Packet.node, for (req - S.request; What would be the best way to unbox things to get the actual Node object so I can have a Long to put in my By() call? Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
Thanks, Naftoli. For now open_! does the trick for me. Peter On Jul 1, 5:55 pm, Naftoli Gugenhem naftoli...@gmail.com wrote: If you know the Box is full you can write open_! (you'll get a runtime error if it wasn't). Otherwise openOr a default, e.g., an invalid id. You have first answer the question, what _should_ happen if it's Empty after all? :) - Peter Robinettpe...@bubblefoundry.com wrote: Everyone, I apologize for monopolizing the list but this has been very helpful for me. I've learned a bunch from similar, old entries in the list and hope this thread will help future Lift beginners. On to my reply to David: On Jul 1, 4:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Yes, the reference contained a Loc, but the compiler could not verify that it contained a Loc. At compile time, the compiler knows the common superclass between Loc[_] and String is Object. Thus the type of l in your code was Object and Object doesn't have the foundParam method. O! Ok, that makes a lot of sense. I'd put your snippet in your Loc. That way you have access to the foundParam. Loc.Snippet(time, time) And then in your Loc, you put the time method below. In that case, you'll have direct access to foundParam without any goofiness. To be honest, this doesn't make a lot of sense to me. I assume you mean a Loc in the Menus of my SiteMap that I assemble in Boot.scala. I'm using the Locs created by the CRUDify trait added to my Node model so I guess I would have to override the Node.menus method. I think I'll delve into this more later when it's necessary... You could also write this as: override val data = Packet.findAll(By(Packet.node, for (req - S.request; loc - req.location) yield loc.asInstanceOf[Loc[Node]].foundParam.is), MaxRows(1000) Ok, this makes sense but unfortunately the value yielded by the for comprehension is all boxed up and so I get an error: error: no implicit argument matching parameter type (net.liftweb.util.Box[net.liftweb.util.Box [com.equalnetworks.model.Node]]) = Long was found. override val data = Packet.findAll(By(Packet.node, for (req - S.request; What would be the best way to unbox things to get the actual Node object so I can have a Long to put in my By() call? Thanks, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Building from source - error importing _root_.org.specs
Hi, I'm trying to build Lift from the source. I pulled the latest source from git, and ran cd liftweb mvn install as suggested in the wiki (http://wiki.liftweb.net/index.php/ Source_code) When I did this, I got a large number of warnings like the following: [WARNING] /home/cpenning/work/scala/lift/liftweb-cpenning/lift-util/ src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala:18: error: value specs is not a member of package org [WARNING] import _root_.org.specs._ The lift-util/pom.xml includes the dependency dependency groupIdorg.scala-tools.testing/groupId artifactIdspecs/artifactId version1.5.0/version /dependency as expected, and looking at my ~/.m2/repository/org/scala-tools/ testing/specs/1.5.0/ contains a pom and a jar. Anyone know why lift-utils isn't able to import specs? Thanks -Cale --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Building from source - error importing _root_.org.specs
I've built Lift from source on Windows, Linux and Mac OS X within the last 2 days without incident. What OS are you running, what version of Maven and what version of Java? On Wed, Jul 1, 2009 at 8:00 PM, Calen Pennington calen.penning...@gmail.com wrote: Hi, I'm trying to build Lift from the source. I pulled the latest source from git, and ran cd liftweb mvn install as suggested in the wiki (http://wiki.liftweb.net/index.php/ Source_code) When I did this, I got a large number of warnings like the following: [WARNING] /home/cpenning/work/scala/lift/liftweb-cpenning/lift-util/ src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala:18: error: value specs is not a member of package org [WARNING] import _root_.org.specs._ The lift-util/pom.xml includes the dependency dependency groupIdorg.scala-tools.testing/groupId artifactIdspecs/artifactId version1.5.0/version /dependency as expected, and looking at my ~/.m2/repository/org/scala-tools/ testing/specs/1.5.0/ contains a pom and a jar. Anyone know why lift-utils isn't able to import specs? Thanks -Cale -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modify CRUDify XHTML
On Wed, Jul 1, 2009 at 7:39 PM, Peter Robinett pe...@bubblefoundry.comwrote: Thanks, Naftoli. For now open_! does the trick for me. Please do not use open_! The ! is there for a reason... it means use this at your peril. Either use openOr and have the expression on the right side of the openOr return the same type as the expression on the left (Loc[Node]) or alternatively, do pattern matching: thing match { case Full(x) = // do something case _ = // some fallback } Using open_! is super duper dangerous and generally very, very bad practice. Peter On Jul 1, 5:55 pm, Naftoli Gugenhem naftoli...@gmail.com wrote: If you know the Box is full you can write open_! (you'll get a runtime error if it wasn't). Otherwise openOr a default, e.g., an invalid id. You have first answer the question, what _should_ happen if it's Empty after all? :) - Peter Robinettpe...@bubblefoundry.com wrote: Everyone, I apologize for monopolizing the list but this has been very helpful for me. I've learned a bunch from similar, old entries in the list and hope this thread will help future Lift beginners. On to my reply to David: On Jul 1, 4:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Yes, the reference contained a Loc, but the compiler could not verify that it contained a Loc. At compile time, the compiler knows the common superclass between Loc[_] and String is Object. Thus the type of l in your code was Object and Object doesn't have the foundParam method. O! Ok, that makes a lot of sense. I'd put your snippet in your Loc. That way you have access to the foundParam. Loc.Snippet(time, time) And then in your Loc, you put the time method below. In that case, you'll have direct access to foundParam without any goofiness. To be honest, this doesn't make a lot of sense to me. I assume you mean a Loc in the Menus of my SiteMap that I assemble in Boot.scala. I'm using the Locs created by the CRUDify trait added to my Node model so I guess I would have to override the Node.menus method. I think I'll delve into this more later when it's necessary... You could also write this as: override val data = Packet.findAll(By(Packet.node, for (req - S.request; loc - req.location) yield loc.asInstanceOf[Loc[Node]].foundParam.is), MaxRows(1000) Ok, this makes sense but unfortunately the value yielded by the for comprehension is all boxed up and so I get an error: error: no implicit argument matching parameter type (net.liftweb.util.Box[net.liftweb.util.Box [com.equalnetworks.model.Node]]) = Long was found. override val data = Packet.findAll(By(Packet.node, for (req - S.request; What would be the best way to unbox things to get the actual Node object so I can have a Long to put in my By() call? Thanks, Peter -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: can a Snippet call a Snippet?
I'm getting a Null Pointer: 'Trying to open an empty box', from S.attr (todos).open_! Here's my layout: todo.html template lift:TD.listTodos todos=todos --- Todo list table stuff --- lift:TD.listTags tags=tags --- Tag list table stuff (where the selection to filter comes from) --- TD.scala snippet = // this arity is for the default 'show all Todos' condition def list(html: NodeSeq) = { val id = S.attr(todos).open_! // this arity is for the 'filter by Tag' case def list(filterTag: Long)(html: NodeSeq) = { val id = S.attr(todos).open_! The two snippet methods could probably be combined with a (param: Long*) signature, but Scala does not seem to care right now. The default works perfectly, but when a Tag is selected to filter by, the 'todos' id Box cannot be seen when attempting to open. Is this because it is probably out of scope? I am using an ajaxbutton to make the call and pass in the tag.id, but it is hard to see how an S.attr could exist for one request, then be gone for the next, unless I am confusing this with a stateful attribute. On Jul 1, 2:42 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:28 PM, g-man gregor...@gmail.com wrote: I will look into the nested snippets. For expediency, I folded all the snippets that interact with my template into one file, so I can concentrate on the business logic. For my Todo app enhancement, I need to pass the id of my selected Tag (which I have confirmed is correctly gathered from the page request) in to the TD.list method, so that the filtered Todos (those bearing the required Tag) will be found and rendered. My problem is that if I try to pass an additional argument (tagId: Long), the TD.list method is not happy and will not even render the template. I have tried both paired (html: NodeSeq, tagId: Long) as well as curried style (html: NodeSeq)(tagId: Long), but neither works. Try: list(tagId: Long)(html: NodeSeq): NodeSeq That way list(44L) _ becomes a NodeSeq = NodeSeq There must be a simple way to accomplish such a common task! Thanks to all the members for commenting... On Jun 29, 11:25 pm, marius d. marius.dan...@gmail.com wrote: Or you can use S.locateMappedSnippet ... but first try to see if nested snippet won't do the trick for you ... On Jun 30, 10:17 am, marius d. marius.dan...@gmail.com wrote: Can you paste some code? Essentially we support nested snippets so your snippet can simply return a markup containing another snippet and it will be invoked. If you really want to manually invoke a snippet from another snippet and if you are not using StatefulSnippets you can just instantiate the class and call your function and pass it the right NodeSeq. Br's, Marius On Jun 30, 5:36 am, g-man gregor...@gmail.com wrote: I am enhancing the Todo app by adding tags. I have retained the TD.scala snippet to manage the Todos on my page, and added a TG.scala snippet to handle tags on the same page, which works well for creating new and listing in both cases. Now I want to filter my Todos list by a Tag instance I select from my list, and therefore need to pass the id of the selected tag over from the TG snippet to the TD snippet, where it can be used as a filter argument for a find method. The problem is that scala says it cannot find snippet TD, whose method I am calling as TD.list from the TG.scala snippet. I have tried all kinds of explicit importing, but no luck. So, can a snippet call a snippet, or is that controlled only from the web page?- Hide quoted text - - Show quoted text - -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: can a Snippet call a Snippet?
Where is the second list getting called from? Code? - g-mangregor...@gmail.com wrote: I'm getting a Null Pointer: 'Trying to open an empty box', from S.attr (todos).open_! Here's my layout: todo.html template lift:TD.listTodos todos=todos --- Todo list table stuff --- lift:TD.listTags tags=tags --- Tag list table stuff (where the selection to filter comes from) --- TD.scala snippet = // this arity is for the default 'show all Todos' condition def list(html: NodeSeq) = { val id = S.attr(todos).open_! // this arity is for the 'filter by Tag' case def list(filterTag: Long)(html: NodeSeq) = { val id = S.attr(todos).open_! The two snippet methods could probably be combined with a (param: Long*) signature, but Scala does not seem to care right now. The default works perfectly, but when a Tag is selected to filter by, the 'todos' id Box cannot be seen when attempting to open. Is this because it is probably out of scope? I am using an ajaxbutton to make the call and pass in the tag.id, but it is hard to see how an S.attr could exist for one request, then be gone for the next, unless I am confusing this with a stateful attribute. On Jul 1, 2:42 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Jul 1, 2009 at 2:28 PM, g-man gregor...@gmail.com wrote: I will look into the nested snippets. For expediency, I folded all the snippets that interact with my template into one file, so I can concentrate on the business logic. For my Todo app enhancement, I need to pass the id of my selected Tag (which I have confirmed is correctly gathered from the page request) in to the TD.list method, so that the filtered Todos (those bearing the required Tag) will be found and rendered. My problem is that if I try to pass an additional argument (tagId: Long), the TD.list method is not happy and will not even render the template. I have tried both paired (html: NodeSeq, tagId: Long) as well as curried style (html: NodeSeq)(tagId: Long), but neither works. Try: list(tagId: Long)(html: NodeSeq): NodeSeq That way list(44L) _ becomes a NodeSeq = NodeSeq There must be a simple way to accomplish such a common task! Thanks to all the members for commenting... On Jun 29, 11:25 pm, marius d. marius.dan...@gmail.com wrote: Or you can use S.locateMappedSnippet ... but first try to see if nested snippet won't do the trick for you ... On Jun 30, 10:17 am, marius d. marius.dan...@gmail.com wrote: Can you paste some code? Essentially we support nested snippets so your snippet can simply return a markup containing another snippet and it will be invoked. If you really want to manually invoke a snippet from another snippet and if you are not using StatefulSnippets you can just instantiate the class and call your function and pass it the right NodeSeq. Br's, Marius On Jun 30, 5:36 am, g-man gregor...@gmail.com wrote: I am enhancing the Todo app by adding tags. I have retained the TD.scala snippet to manage the Todos on my page, and added a TG.scala snippet to handle tags on the same page, which works well for creating new and listing in both cases. Now I want to filter my Todos list by a Tag instance I select from my list, and therefore need to pass the id of the selected tag over from the TG snippet to the TD snippet, where it can be used as a filter argument for a find method. The problem is that scala says it cannot find snippet TD, whose method I am calling as TD.list from the TG.scala snippet. I have tried all kinds of explicit importing, but no luck. So, can a snippet call a snippet, or is that controlled only from the web page?- Hide quoted text - - Show quoted text - -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Changes to ajax handling?
On Jul 2, 12:40 am, Kris Nuttycombe kris.nuttyco...@gmail.com wrote: To answer my own question, looking over the commit log 28595307 looks extremely suspicious. I can revert it locally but would prefer a mainline fix, and don't want to attempt it myself. Marius? Kris On Wed, Jul 1, 2009 at 3:33 PM, Kris Nuttycombekris.nuttyco...@gmail.com wrote: Hi, all, Have there been recent changes made to liftAjax.js? I am encountering new errors from an ajaxSelect() today that were not present yesterday. Firebug complains: Use of getBoxObjectFor() is deprecated. Try to use element.getBoundingClientRect() if possible. [Break on this error] undefined liftAjax.js (line 111) aboutToSend.responseType is null lift_doAjaxCycle()()liftAjax.js (line 111) lift_ajaxHandler()()liftAjax.js (line 21) onchange(change )add_trig...Gyw%3D%3D (line 2) [Break on this error] if (aboutToSend.responseType.toLowerCase() === json) That is my commt but right now I don,t see how it affects other things ... But I,ll definitely look on it today. Note that there is no intent for ajax behavior changes .. Just an augmentation ... Thanks, Kris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---