Re: [Lift] Re: Passing attributes to bound elements
Hello, This was considered later on a defect, and not a feature. To preserve markup attributes in your bind use -% instead of - thanks, although the -% is missing support for the .toForm, as it returns a Box[NodeSeq]. And for % you need an Elem. Any ideas how to deal with that? :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Always log through Slf4j?
I am not sure you need to add yet another adapter on top of slf4j for MDC support. Enhancing the existing slf4j wrapper for the purpsoe might be worth an attempt instead. Slf4j supports MDC (org.slf4j.MDC) and automatically delegates MDC functionality to the underlying logging framework if it has support for such. It's a facade after all. That said, I think there is room (and opportunity) for defaulting to lightweight wrapper over slf4j and letting users choose any underlying framework (simple, log4j, logback, jul) at build/deploy time. I am optimistic this would be doable without any code change on existing Lift applications. And keep OSGi happiness in the way. As such, I thing we should be careful and avoid duplicating (very similar impl of) MDC enhancement to both Log4JLogger and Slf4JLogger. I would be inclined to consider: - Zero code change in application for switching log implementations (nothing should be necessary to be put in Boot.scala) - Tuck in everything behind the helper object(s) - Log for the root logger or other objects introduced because of the Loggable trait - Have MDC and other enhancements aligned to slf4j. Per design slf4j-api expects a real logging framework behind it (bundled or otherwise). - In Lift, for guaranteed compatibility, default to log4j (by using log4j wrapper of slf4j) - but still allow using logback, jul etc. just by flipping the dependency during build. Bonus, slf4j would fallback to simple logger if none of the dependencies are available. - Existing applications can just add log4j bridge for the existing behavior. - New applications (generated from archetype) mark slf4j-api as compile scope dependency and have one of the implementations (simple,log4j,logback etc.) added as either compile scope or provided scope (to cover for log4j in container classpath). This can even be offered as choice during archetype:generate! Thoughts? Cheers, Indrajit On 29/01/10 4:04 AM, David Pollak wrote: On Thu, Jan 28, 2010 at 2:11 PM, Jeppe Nejsum Madsen je...@ingolfs.dk mailto:je...@ingolfs.dk wrote: Last logging question, I promise! I'm about to implement MDC in Lift's logging, but it seems more and more layers are introduced. So before adding another adapter on top of e.g. Slf4j which is already an adapter on top of e.g. logback I thought I would see if there are any objections to making Lift always log through Slf4j? Yes. I object. There is a way to log through slf4j right now. It's a one-line addition to boot.scala. I have a very strong preference for not changing any APIs or defaults. If you want to add or enhance the mechanics, cool. There wouldn't be any API changes and Log4j could still be the default backend, with the config settings as we currently have, only there wouldn't be any Log4JLogger. On the positive side, Lift's logging is simpler: only interface to Slf4j (we would keep the log4j config stuff) Downside is two more jars if you're using log4j: slf4j-api slf4j-log4j12 Thoughts? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com mailto:liftweb@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com mailto:liftweb%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Lift and Scala 2.8 Beta1
Le 29/01/2010 06:04, Indrajit Raychaudhuri a écrit : You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Amazing :) -- Francois ARMAND http://fanf42.blogspot.com -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: [lift] Issue with my first Lift project
I tried,but nothing change. mvn jetty:run -U [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-jetty-plugin: checking for updates from central [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 3 seconds [INFO] Finished at: Fri Jan 29 17:47:33 CST 2010 [INFO] Final Memory: 1M/4M [INFO] David Bernard-3 wrote: I suppose it's your first run of mvn jetty:run. try : mvn jetty:run -U to force download of jetty. see http://wiki.github.com/dpp/liftweb/about-maven-mini-guide /davidB On Fri, Jan 29, 2010 at 04:04, tomLee tomcatl...@gmail.com wrote: Got error when I run it: D:\MySource\oterh\myliftmvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] artifact org.apache.maven.plugins:maven-jetty-plugin: checking for updates from central [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 second [INFO] Finished at: Fri Jan 29 10:53:33 CST 2010 [INFO] Final Memory: 1M/4M [INFO] thanks -- View this message in context: http://old.nabble.com/Issue-with-my-first-Lift-project-tp27366670p27366670.html Sent from the liftweb mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- View this message in context: http://old.nabble.com/Issue-with-my-first-Lift-project-tp27366670p27369669.html Sent from the liftweb mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: [lift] Issue with my first Lift project
Most certainly, the groupId for maven-jetty-plugin is missing. The minimal configuration for jetty plugin would be: plugin groupIdorg.mortbay.jetty/groupId artifactIdmaven-jetty-plugin/artifactId version6.1.22/version /plugin Cheers, Indrajit On 29/01/10 3:18 PM, tomLee wrote: I tried,but nothing change. mvn jetty:run -U [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-jetty-plugin: checking for updates from central [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 3 seconds [INFO] Finished at: Fri Jan 29 17:47:33 CST 2010 [INFO] Final Memory: 1M/4M [INFO] David Bernard-3 wrote: I suppose it's your first run of mvn jetty:run. try : mvn jetty:run -U to force download of jetty. see http://wiki.github.com/dpp/liftweb/about-maven-mini-guide /davidB On Fri, Jan 29, 2010 at 04:04, tomLeetomcatl...@gmail.com wrote: Got error when I run it: D:\MySource\oterh\myliftmvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] artifact org.apache.maven.plugins:maven-jetty-plugin: checking for updates from central [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 second [INFO] Finished at: Fri Jan 29 10:53:33 CST 2010 [INFO] Final Memory: 1M/4M [INFO] thanks -- View this message in context: http://old.nabble.com/Issue-with-my-first-Lift-project-tp27366670p27366670.html Sent from the liftweb mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Always log through Slf4j?
Indrajit Raychaudhuri indraj...@gmail.com writes: I am not sure you need to add yet another adapter on top of slf4j for MDC support. Enhancing the existing slf4j wrapper for the purpsoe might be worth an attempt instead. Yes but if we introduce a Lift MDC it would need to delegate to either Log4j or Slf4j (which already has MDC wrapped for logback log4j) That said, I think there is room (and opportunity) for defaulting to lightweight wrapper over slf4j and letting users choose any underlying framework (simple, log4j, logback, jul) at build/deploy time. I am optimistic this would be doable without any code change on existing Lift applications. And keep OSGi happiness in the way. That was my proposal As such, I thing we should be careful and avoid duplicating (very similar impl of) MDC enhancement to both Log4JLogger and Slf4JLogger. I agree and this was what caused me to write the email in the first place :-) I would be inclined to consider: - Zero code change in application for switching log implementations (nothing should be necessary to be put in Boot.scala) As long as you don't want to tweak the backend config. I think you still need to configure the underlying logging framework in order to support reading (dev|prod|test) config files. - Tuck in everything behind the helper object(s) - Log for the root logger or other objects introduced because of the Loggable trait - Have MDC and other enhancements aligned to slf4j. Per design slf4j-api expects a real logging framework behind it (bundled or otherwise). - In Lift, for guaranteed compatibility, default to log4j (by using log4j wrapper of slf4j) - but still allow using logback, jul etc. just by flipping the dependency during build. Bonus, slf4j would fallback to simple logger if none of the dependencies are available. - Existing applications can just add log4j bridge for the existing behavior. - New applications (generated from archetype) mark slf4j-api as compile scope dependency and have one of the implementations (simple,log4j,logback etc.) added as either compile scope or provided scope (to cover for log4j in container classpath). This can even be offered as choice during archetype:generate! Thoughts? That was pretty much what I had in mind, but probably didn't articulate too well :-) I'll wait for David to chime in since he had objections. In the meantime, I've pushed the changes (keeping the Log4j logger) to http://github.com/dpp/liftweb/tree/jnm_issue_309 I've updated the hellolift example to use Slf4j over logback. /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Lift + UTF-8
Hello, maybe you have some ideas. I'm trying to make my lift app able to store polish characters, and I'm slowly running out of ideas. I think it's something with mapper configuration, but I'm not sure. When I submit a form with an ą character, I get the following exception: Message: java.sql.SQLException: Incorrect string value: '\xC4\x85' for column 'title' at row 1 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) What I did so far: - the mysql table encoding is utf-8 - the connection string contains useUnicode=truecharacterEncoding=UTF-8 - LiftRules.early.append(_.setCharacterEncoding(UTF-8)) When the String is set on the model field it still is correct, so something happens when trying to persist the value. Is there a way in lift to configure jdbc so that it accepts utf-8 characters? Or am I missing something else? -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Lift + UTF-8
Heh, sorry, I knew the moment I write a post here I'll find the answer ;) Forgot that when converting a table in mysql you not only need to set the character encoding for the table but also for the individual columns. Sorry again for the spam. On Jan 29, 2010, at 3:01 PM, Adam Warski wrote: Hello, maybe you have some ideas. I'm trying to make my lift app able to store polish characters, and I'm slowly running out of ideas. I think it's something with mapper configuration, but I'm not sure. When I submit a form with an ą character, I get the following exception: Message: java.sql.SQLException: Incorrect string value: '\xC4\x85' for column 'title' at row 1 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) What I did so far: - the mysql table encoding is utf-8 - the connection string contains useUnicode=truecharacterEncoding=UTF-8 - LiftRules.early.append(_.setCharacterEncoding(UTF-8)) When the String is set on the model field it still is correct, so something happens when trying to persist the value. Is there a way in lift to configure jdbc so that it accepts utf-8 characters? Or am I missing something else? -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Lift and Scala 2.8 Beta1
Works for me. Only code that i had to change was in snippet where new compiler couldn't infer types for functions arguments when using palceholder syntax. Simple project without rocket science. Thanks for release as new eclipse plugin is much much better. On Jan 29, 10:23 am, Francois fan...@gmail.com wrote: Le 29/01/2010 06:04, Indrajit Raychaudhuri a écrit : You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Amazing :) -- Francois ARMANDhttp://fanf42.blogspot.com -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Using Stateful Snippets
User[ id=0 email=, username = , created on=Fri Jan 29 10:57:27 MST 2010 role=Basic] This value I get On Jan 28, 10:44 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You didn't answer my question. At the time the closure passed to redirectTo is executed, what is the value of 'user'? - Jay Caincain@gmail.com wrote: it appears that the user still creates a new User. it is because I tell it to do that each time a new request is made. // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) So I guess my question is how prevent it from doing that and still pass a User object to the RequestVar I tried a RequestVar[User] but no bueno below is the snippet code for registering a user user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) S.redirectTo(thank_you, () = { println(user); userVar(user);} In the mean time I'm going to just extract the email and fullname from the user and pass it as a request param user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) val email = user.email val fullName = user.userProfile.fullName println(email + email) S.redirectTo(thank_you, () = {S.set(email, email); S.set (fullName, fullName);}) Thanks for helping out On Jan 27, 10:20 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Can you put a trace in that closure to see if 'user' has the correct value? S.redirectTo(thank_you, () = {println(user); userVar(user);}) etc. On Wed, Jan 27, 2010 at 11:51 PM, Jay Cain cain@gmail.com wrote: I think that this would work // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) S.redirectTo(thank_you, () = {userVar(user);}) but no bueno. On Jan 27, 4:56 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: When you redirect you start a new request, so RequestVars are fresh. redirectTo has an overload that take additionally a function to execute in the new request. Set the RequestVar there. - Jay Caincain@gmail.com wrote: I am a newbie to Lift and Scala. I'm registering users and once they have entered the information in successfully. I want to redirect to a thank_you page that will display a snippet lift:UserOps.thanksMessage p entry:fullname/ thanks for joining Echo. The confirmation instructions for completing the signup process have been sent to your email address, entry:email/ /p /lift:UserOps.thanksMessage I assume that when I redirect it doesn't hold the state of the user information. On submit I invoke signup def signup(xhtml: NodeSeq) : NodeSeq = { S.redirectTo(thank_you) } ThanksMessage function def thanksMessage(xhtml: NodeSeq) : NodeSeq = { print(Username: + user.username) bind(entry, xhtml, fullname - Text(user.userProfile.fullName), email - Text(user.email)) } I have declared a RequestVar object ** object userVar extends RequestVar(new User()) ** but I'm sure that it is creating an empty user object in my RequestVar userVar when I redirect. Is a StatefulSnippet the solution for this? I just think that there's a much simpler solution that I'm overlooking. Jay -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group,
Re: [Lift] Re: Using Stateful Snippets
And user is not a RequestVar, correct? So this is not a RequestVar problem then? What is user? A JPA entity? Could this be a JPA issue? If you like you can use System.identityHashcode to demonstrate that the same user instance is losing its data. - Jay Caincain@gmail.com wrote: User[ id=0 email=, username = , created on=Fri Jan 29 10:57:27 MST 2010 role=Basic] This value I get On Jan 28, 10:44 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You didn't answer my question. At the time the closure passed to redirectTo is executed, what is the value of 'user'? - Jay Caincain@gmail.com wrote: it appears that the user still creates a new User. it is because I tell it to do that each time a new request is made. // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) So I guess my question is how prevent it from doing that and still pass a User object to the RequestVar I tried a RequestVar[User] but no bueno below is the snippet code for registering a user user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) S.redirectTo(thank_you, () = { println(user); userVar(user);} In the mean time I'm going to just extract the email and fullname from the user and pass it as a request param user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) val email = user.email val fullName = user.userProfile.fullName println(email + email) S.redirectTo(thank_you, () = {S.set(email, email); S.set (fullName, fullName);}) Thanks for helping out On Jan 27, 10:20 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Can you put a trace in that closure to see if 'user' has the correct value? S.redirectTo(thank_you, () = {println(user); userVar(user);}) etc. On Wed, Jan 27, 2010 at 11:51 PM, Jay Cain cain@gmail.com wrote: I think that this would work // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) S.redirectTo(thank_you, () = {userVar(user);}) but no bueno. On Jan 27, 4:56 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: When you redirect you start a new request, so RequestVars are fresh. redirectTo has an overload that take additionally a function to execute in the new request. Set the RequestVar there. - Jay Caincain@gmail.com wrote: I am a newbie to Lift and Scala. I'm registering users and once they have entered the information in successfully. I want to redirect to a thank_you page that will display a snippet lift:UserOps.thanksMessage p entry:fullname/ thanks for joining Echo. The confirmation instructions for completing the signup process have been sent to your email address, entry:email/ /p /lift:UserOps.thanksMessage I assume that when I redirect it doesn't hold the state of the user information. On submit I invoke signup def signup(xhtml: NodeSeq) : NodeSeq = { S.redirectTo(thank_you) } ThanksMessage function def thanksMessage(xhtml: NodeSeq) : NodeSeq = { print(Username: + user.username) bind(entry, xhtml, fullname - Text(user.userProfile.fullName), email - Text(user.email)) } I have declared a RequestVar object ** object userVar extends RequestVar(new User()) ** but I'm sure that it is creating an empty user object in my RequestVar userVar when I redirect. Is a StatefulSnippet the solution for this? I just think that there's a much simpler solution that I'm overlooking. Jay -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send
Re: [Lift] Lift and Scala 2.8 Beta1
Dear Indrajit, Thanks for your diligence on this effort! However, i'm not having a lot of luck. Here's my methodology. - i would like to test using an archetype generated project before i test with my project code -- which is likely to be so stupid and error-ridden as to cause all kinds of problems. i've got a feeling that the archetype i'm getting is out of sync (please see the script i use and the trace it generates). - After generating the project from the archetype i change the lift version as you indicate and the lift jars cannot be resolved. This may have to do with the problem above. Best wishes, --greg - Script #! /bin/sh mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=1.0 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=$1 -DartifactId=$2 - Trace bash-3.2$ bin/mklift.sh com.biosimilarity.identity testLift280 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/1.0/lift-archetype-basic-1.0.jar 15K downloaded Define value for version: 1.0-SNAPSHOT: : Confirm properties configuration: groupId: com.biosimilarity.identity artifactId: testLift280 version: 1.0-SNAPSHOT package: com.biosimilarity.identity Y: : [INFO] [INFO] Using following parameters for creating OldArchetype: lift-archetype-basic:1.0 [INFO] [INFO] Parameter: groupId, Value: com.biosimilarity.identity [INFO] Parameter: packageName, Value: com.biosimilarity.identity [INFO] Parameter: basedir, Value: /Users/lgm/work/src/projex/biosimilarity [INFO] Parameter: package, Value: com.biosimilarity.identity [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: testLift280 [INFO] * End of debug info from resources from generated POM *** [INFO] OldArchetype created in dir: /Users/lgm/work/src/projex/biosimilarity/testLift280 [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 12 seconds [INFO] Finished at: Fri Jan 29 10:28:16 PST 2010 [INFO] Final Memory: 8M/15M [INFO] bash-3.2$ cd testLift280/ bash-3.2$ mvn -U clean compile [INFO] Scanning for projects... [INFO] [INFO] Building testLift280 [INFO]task-segment: [clean, compile] [INFO] [INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from scala-tools.org [INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from central [INFO] artifact org.mortbay.jetty:maven-jetty-plugin: checking for updates from scala-tools.org [INFO] artifact org.mortbay.jetty:maven-jetty-plugin: checking for updates from central [INFO] artifact net.sf.alchim:yuicompressor-maven-plugin: checking for updates from scala-tools.org [INFO] artifact net.sf.alchim:yuicompressor-maven-plugin: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from scala-tools.org [INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from central [INFO] [clean:clean] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources.
Re: [Lift] Lift + UTF-8
On Fri, Jan 29, 2010 at 6:06 AM, Adam Warski a...@warski.org wrote: Heh, sorry, I knew the moment I write a post here I'll find the answer ;) Forgot that when converting a table in mysql you not only need to set the character encoding for the table but also for the individual columns. My experience has been that PostgreSQL doesn't have these kind of issues and is generally faster and more stable than MySQL. FYI. Sorry again for the spam. On Jan 29, 2010, at 3:01 PM, Adam Warski wrote: Hello, maybe you have some ideas. I'm trying to make my lift app able to store polish characters, and I'm slowly running out of ideas. I think it's something with mapper configuration, but I'm not sure. When I submit a form with an ą character, I get the following exception: Message: java.sql.SQLException: Incorrect string value: '\xC4\x85' for column 'title' at row 1 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) What I did so far: - the mysql table encoding is utf-8 - the connection string contains useUnicode=truecharacterEncoding=UTF-8 - LiftRules.early.append(_.setCharacterEncoding(UTF-8)) When the String is set on the model field it still is correct, so something happens when trying to persist the value. Is there a way in lift to configure jdbc so that it accepts utf-8 characters? Or am I missing something else? -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Lift and Scala 2.8 Beta1
Dear Indrajit, i have a lot better luck with this way of testing before plunging if i change my archetype generation script to use -DarchetypeVersion=2.0-M1. Best wishes, --greg On Fri, Jan 29, 2010 at 10:37 AM, Meredith Gregory lgreg.mered...@gmail.com wrote: Dear Indrajit, Thanks for your diligence on this effort! However, i'm not having a lot of luck. Here's my methodology. - i would like to test using an archetype generated project before i test with my project code -- which is likely to be so stupid and error-ridden as to cause all kinds of problems. i've got a feeling that the archetype i'm getting is out of sync (please see the script i use and the trace it generates). - After generating the project from the archetype i change the lift version as you indicate and the lift jars cannot be resolved. This may have to do with the problem above. Best wishes, --greg - Script #! /bin/sh mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=1.0 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=$1 -DartifactId=$2 - Trace bash-3.2$ bin/mklift.sh com.biosimilarity.identity testLift280 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/1.0/lift-archetype-basic-1.0.jar 15K downloaded Define value for version: 1.0-SNAPSHOT: : Confirm properties configuration: groupId: com.biosimilarity.identity artifactId: testLift280 version: 1.0-SNAPSHOT package: com.biosimilarity.identity Y: : [INFO] [INFO] Using following parameters for creating OldArchetype: lift-archetype-basic:1.0 [INFO] [INFO] Parameter: groupId, Value: com.biosimilarity.identity [INFO] Parameter: packageName, Value: com.biosimilarity.identity [INFO] Parameter: basedir, Value: /Users/lgm/work/src/projex/biosimilarity [INFO] Parameter: package, Value: com.biosimilarity.identity [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: testLift280 [INFO] * End of debug info from resources from generated POM *** [INFO] OldArchetype created in dir: /Users/lgm/work/src/projex/biosimilarity/testLift280 [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 12 seconds [INFO] Finished at: Fri Jan 29 10:28:16 PST 2010 [INFO] Final Memory: 8M/15M [INFO] bash-3.2$ cd testLift280/ bash-3.2$ mvn -U clean compile [INFO] Scanning for projects... [INFO] [INFO] Building testLift280 [INFO]task-segment: [clean, compile] [INFO] [INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from scala-tools.org [INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from central [INFO] artifact org.mortbay.jetty:maven-jetty-plugin: checking for updates from scala-tools.org [INFO] artifact org.mortbay.jetty:maven-jetty-plugin: checking for updates from central [INFO] artifact net.sf.alchim:yuicompressor-maven-plugin: checking for updates from scala-tools.org [INFO] artifact
Re: [Lift] Lift and Scala 2.8 Beta1
Hmm, mklift.sh needs a 'lift' :) Something like this should work: mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=2.0-scala280-SNAPSHOT \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DremoteRepositories=http://scala-tools.org/repo-snapshots \ -DgroupId=$1 -DartifactId=$2 You also might need to add -DinteractiveMode=false for batch-mode. Cheers, Indrajit On 30/01/10 12:07 AM, Meredith Gregory wrote: Dear Indrajit, Thanks for your diligence on this effort! However, i'm not having a lot of luck. Here's my methodology. * i would like to test using an archetype generated project before i test with my project code -- which is likely to be so stupid and error-ridden as to cause all kinds of problems. i've got a feeling that the archetype i'm getting is out of sync (please see the script i use and the trace it generates). * After generating the project from the archetype i change the lift version as you indicate and the lift jars cannot be resolved. This may have to do with the problem above. Best wishes, --greg * Script #! /bin/sh mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=1.0 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=$1 -DartifactId=$2 * Trace bash-3.2$ bin/mklift.sh com.biosimilarity.identity testLift280 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/1.0/lift-archetype-basic-1.0.jar 15K downloaded Define value for version: 1.0-SNAPSHOT: : Confirm properties configuration: groupId: com.biosimilarity.identity artifactId: testLift280 version: 1.0-SNAPSHOT package: com.biosimilarity.identity Y: : [INFO] [INFO] Using following parameters for creating OldArchetype: lift-archetype-basic:1.0 [INFO] [INFO] Parameter: groupId, Value: com.biosimilarity.identity [INFO] Parameter: packageName, Value: com.biosimilarity.identity [INFO] Parameter: basedir, Value: /Users/lgm/work/src/projex/biosimilarity [INFO] Parameter: package, Value: com.biosimilarity.identity [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: testLift280 [INFO] * End of debug info from resources from generated POM *** [INFO] OldArchetype created in dir: /Users/lgm/work/src/projex/biosimilarity/testLift280 [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 12 seconds [INFO] Finished at: Fri Jan 29 10:28:16 PST 2010 [INFO] Final Memory: 8M/15M [INFO] bash-3.2$ cd testLift280/ bash-3.2$ mvn -U clean compile [INFO] Scanning for projects... [INFO] [INFO] Building testLift280 [INFO]task-segment: [clean, compile] [INFO] [INFO]
Re: [Lift] Lift and Scala 2.8 Beta1
Dear Greg, Yes, -DarchetypeVersion=2.0-M1 should pretty much be close. However, you'll need to adjust some dependency versions after generating the project. And, you might need to add the snapshot repositories in the pom. Instead, just use -DarchetypeVersion=2.0-scala280-SNAPSHOT and let archetype generate take care of the rest :) Cheers, Indrajit On 30/01/10 12:25 AM, Meredith Gregory wrote: Dear Indrajit, i have a lot better luck with this way of testing before plunging if i change my archetype generation script to use -DarchetypeVersion=2.0-M1. Best wishes, --greg On Fri, Jan 29, 2010 at 10:37 AM, Meredith Gregory lgreg.mered...@gmail.com mailto:lgreg.mered...@gmail.com wrote: Dear Indrajit, Thanks for your diligence on this effort! However, i'm not having a lot of luck. Here's my methodology. * i would like to test using an archetype generated project before i test with my project code -- which is likely to be so stupid and error-ridden as to cause all kinds of problems. i've got a feeling that the archetype i'm getting is out of sync (please see the script i use and the trace it generates). * After generating the project from the archetype i change the lift version as you indicate and the lift jars cannot be resolved. This may have to do with the problem above. Best wishes, --greg * Script #! /bin/sh mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=1.0 \ -DremoteRepositories=http://scala-tools.org/repo-releases \ -DgroupId=$1 -DartifactId=$2 * Trace bash-3.2$ bin/mklift.sh com.biosimilarity.identity testLift280 [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/1.0/lift-archetype-basic-1.0.jar 15K downloaded Define value for version: 1.0-SNAPSHOT: : Confirm properties configuration: groupId: com.biosimilarity.identity artifactId: testLift280 version: 1.0-SNAPSHOT package: com.biosimilarity.identity Y: : [INFO] [INFO] Using following parameters for creating OldArchetype: lift-archetype-basic:1.0 [INFO] [INFO] Parameter: groupId, Value: com.biosimilarity.identity [INFO] Parameter: packageName, Value: com.biosimilarity.identity [INFO] Parameter: basedir, Value: /Users/lgm/work/src/projex/biosimilarity [INFO] Parameter: package, Value: com.biosimilarity.identity [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: testLift280 [INFO] * End of debug info from resources from generated POM *** [INFO] OldArchetype created in dir: /Users/lgm/work/src/projex/biosimilarity/testLift280 [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 12 seconds [INFO] Finished at:
[Lift] Re: Using Stateful Snippets
It seems that you are correct. My user object is a JPA entity and when it enters the closure it has a different identityHash 10749831 vs. 21737589. This will probably be one of many issues that I will have to deal with if I'm going to continue with JPA? It's like the entityManager loses reference to the entity object I persisted to the db. That's no good. I'm starting this project from scratch and have a java background is it easier to just pick up with Scala's persistent architecture then continue with these little bumps in the road. On Jan 29, 11:06 am, Naftoli Gugenheim naftoli...@gmail.com wrote: And user is not a RequestVar, correct? So this is not a RequestVar problem then? What is user? A JPA entity? Could this be a JPA issue? If you like you can use System.identityHashcode to demonstrate that the same user instance is losing its data. - Jay Caincain@gmail.com wrote: User[ id=0 email=, username = , created on=Fri Jan 29 10:57:27 MST 2010 role=Basic] This value I get On Jan 28, 10:44 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You didn't answer my question. At the time the closure passed to redirectTo is executed, what is the value of 'user'? - Jay Caincain@gmail.com wrote: it appears that the user still creates a new User. it is because I tell it to do that each time a new request is made. // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) So I guess my question is how prevent it from doing that and still pass a User object to the RequestVar I tried a RequestVar[User] but no bueno below is the snippet code for registering a user user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) S.redirectTo(thank_you, () = { println(user); userVar(user);} In the mean time I'm going to just extract the email and fullname from the user and pass it as a request param user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) val email = user.email val fullName = user.userProfile.fullName println(email + email) S.redirectTo(thank_you, () = {S.set(email, email); S.set (fullName, fullName);}) Thanks for helping out On Jan 27, 10:20 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Can you put a trace in that closure to see if 'user' has the correct value? S.redirectTo(thank_you, () = {println(user); userVar(user);}) etc. On Wed, Jan 27, 2010 at 11:51 PM, Jay Cain cain@gmail.com wrote: I think that this would work // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) S.redirectTo(thank_you, () = {userVar(user);}) but no bueno. On Jan 27, 4:56 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: When you redirect you start a new request, so RequestVars are fresh. redirectTo has an overload that take additionally a function to execute in the new request. Set the RequestVar there. - Jay Caincain@gmail.com wrote: I am a newbie to Lift and Scala. I'm registering users and once they have entered the information in successfully. I want to redirect to a thank_you page that will display a snippet lift:UserOps.thanksMessage p entry:fullname/ thanks for joining Echo. The confirmation instructions for completing the signup process have been sent to your email address, entry:email/ /p /lift:UserOps.thanksMessage I assume that when I redirect it doesn't hold the state of the user information. On submit I invoke signup def signup(xhtml: NodeSeq) : NodeSeq = { S.redirectTo(thank_you) } ThanksMessage function def thanksMessage(xhtml: NodeSeq) : NodeSeq = { print(Username: + user.username) bind(entry, xhtml, fullname - Text(user.userProfile.fullName), email - Text(user.email)) } I have declared a RequestVar object ** object userVar extends RequestVar(new User()) ** but I'm sure that it is creating an empty user object in my RequestVar userVar when I redirect. Is a StatefulSnippet the solution for this? I just think that there's a much simpler solution that I'm overlooking. Jay -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To
Re: [Lift Announce] Re: [Lift] Lift and Scala 2.8 Beta1
On Thu, Jan 28, 2010 at 9:04 PM, Indrajit Raychaudhuri indraj...@gmail.comwrote: The Lift 2.0 snapshot jars for Scala 2.8 are now available on scala-tools Maven repository. Feel free to try your Lift application against 2.0-scala280-SNAPSHOT jars. You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Awesome! Let the Lift on Scala 2.8 Beta1 testing and feedback commence. Cheers, Indrajit On 28/01/10 2:31 AM, David Pollak wrote: Folks, Lift is currently building against Scala 2.8 Beta1 and currently runs the examples/example app (the app that's at http://demo.liftweb.net). We have disabled many of the tests during the automated build because as of last night, not all the test frameworks (ScalaTest, Specs, and ScalaCheck) were compiled against 2.8 Beta1. We are doing continuous builds of Lift against the 280_port_refresh branch at http://hudson.scala-tools.org/job/lift-scala280/ And will be publishing to the scala-tools.org http://scala-tools.org Maven repository very soon now (today or tomorrow). Once we get the JAR files publishing to the Scala-tools.org Maven repository, we will open up the Lift list to report of problems running Lift apps against 2.8 Beta 1. Please do not file tickets until there's been a discussion on the Lift list. Thanks, David -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift Announce] Re: [Lift] Lift and Scala 2.8 Beta1
Dear Indrajit, -DarchetypeVersion=2.0-scala280-SNAPSHOT was the first thing i tried and that failed. ;-( Best wishes, --greg On Fri, Jan 29, 2010 at 11:15 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Jan 28, 2010 at 9:04 PM, Indrajit Raychaudhuri indraj...@gmail.com wrote: The Lift 2.0 snapshot jars for Scala 2.8 are now available on scala-tools Maven repository. Feel free to try your Lift application against 2.0-scala280-SNAPSHOT jars. You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Awesome! Let the Lift on Scala 2.8 Beta1 testing and feedback commence. Cheers, Indrajit On 28/01/10 2:31 AM, David Pollak wrote: Folks, Lift is currently building against Scala 2.8 Beta1 and currently runs the examples/example app (the app that's at http://demo.liftweb.net). We have disabled many of the tests during the automated build because as of last night, not all the test frameworks (ScalaTest, Specs, and ScalaCheck) were compiled against 2.8 Beta1. We are doing continuous builds of Lift against the 280_port_refresh branch at http://hudson.scala-tools.org/job/lift-scala280/ And will be publishing to the scala-tools.org http://scala-tools.org Maven repository very soon now (today or tomorrow). Once we get the JAR files publishing to the Scala-tools.org Maven repository, we will open up the Lift list to report of problems running Lift apps against 2.8 Beta 1. Please do not file tickets until there's been a discussion on the Lift list. Thanks, David -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift Announce] Re: [Lift] Lift and Scala 2.8 Beta1
Dear Indrajit, See the trace below with the archetypeVersion set as you suggest. Best wishes, --greg bash-3.2$ bin/mklift.sh com.biosimilarity.identity WhiteRabbit [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal [INFO] snapshot net.liftweb:lift-archetype-basic:2.0-scala280-SNAPSHOT: checking for updates from lift-archetype-basic-repo Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/2.0-scala280-SNAPSHOT/lift-archetype-basic-2.0-scala280-SNAPSHOT.jar [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] The desired archetype does not exist (net.liftweb:lift-archetype-basic:2.0-scala280-SNAPSHOT) [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jan 29 11:19:16 PST 2010 [INFO] Final Memory: 8M/15M [INFO] bash-3.2$ On Fri, Jan 29, 2010 at 11:16 AM, Meredith Gregory lgreg.mered...@gmail.com wrote: Dear Indrajit, -DarchetypeVersion=2.0-scala280-SNAPSHOT was the first thing i tried and that failed. ;-( Best wishes, --greg On Fri, Jan 29, 2010 at 11:15 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Jan 28, 2010 at 9:04 PM, Indrajit Raychaudhuri indraj...@gmail.com wrote: The Lift 2.0 snapshot jars for Scala 2.8 are now available on scala-tools Maven repository. Feel free to try your Lift application against 2.0-scala280-SNAPSHOT jars. You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Awesome! Let the Lift on Scala 2.8 Beta1 testing and feedback commence. Cheers, Indrajit On 28/01/10 2:31 AM, David Pollak wrote: Folks, Lift is currently building against Scala 2.8 Beta1 and currently runs the examples/example app (the app that's at http://demo.liftweb.net). We have disabled many of the tests during the automated build because as of last night, not all the test frameworks (ScalaTest, Specs, and ScalaCheck) were compiled against 2.8 Beta1. We are doing continuous builds of Lift against the 280_port_refresh branch at http://hudson.scala-tools.org/job/lift-scala280/ And will be publishing to the scala-tools.org http://scala-tools.org Maven repository very soon now (today or tomorrow). Once we get the JAR files publishing to the Scala-tools.org Maven repository, we will open up the Lift list to report of problems running Lift apps against 2.8 Beta 1. Please do not file tickets until there's been a discussion on the Lift list. Thanks, David -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to
Re: [Lift Announce] Re: [Lift] Lift and Scala 2.8 Beta1
For SNAPSHOTs, you need to add the SNAPSHOT repo explicitly. Try this command: mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=2.0-scala280-SNAPSHOT \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DremoteRepositories=http://scala-tools.org/repo-snapshots \ -DgroupId=$1 -DartifactId=$2 NB: My previous reply was a supplement of this one: http://groups.google.com/group/liftweb/msg/0734a3a1b7d0424d Cheers, Indrajit On 30/01/10 12:50 AM, Meredith Gregory wrote: Dear Indrajit, See the trace below with the archetypeVersion set as you suggest. Best wishes, --greg bash-3.2$ bin/mklift.sh com.biosimilarity.identity WhiteRabbit [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal [INFO] snapshot net.liftweb:lift-archetype-basic:2.0-scala280-SNAPSHOT: checking for updates from lift-archetype-basic-repo Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/2.0-scala280-SNAPSHOT/lift-archetype-basic-2.0-scala280-SNAPSHOT.jar [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] The desired archetype does not exist (net.liftweb:lift-archetype-basic:2.0-scala280-SNAPSHOT) [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jan 29 11:19:16 PST 2010 [INFO] Final Memory: 8M/15M [INFO] bash-3.2$ On Fri, Jan 29, 2010 at 11:16 AM, Meredith Gregory lgreg.mered...@gmail.com mailto:lgreg.mered...@gmail.com wrote: Dear Indrajit, -DarchetypeVersion=2.0-scala280-SNAPSHOT was the first thing i tried and that failed. ;-( Best wishes, --greg On Fri, Jan 29, 2010 at 11:15 AM, David Pollak feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com wrote: On Thu, Jan 28, 2010 at 9:04 PM, Indrajit Raychaudhuri indraj...@gmail.com mailto:indraj...@gmail.com wrote: The Lift 2.0 snapshot jars for Scala 2.8 are now available on scala-tools Maven repository. Feel free to try your Lift application against 2.0-scala280-SNAPSHOT jars. You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Awesome! Let the Lift on Scala 2.8 Beta1 testing and feedback commence. Cheers, Indrajit On 28/01/10 2:31 AM, David Pollak wrote: Folks, Lift is currently building against Scala 2.8 Beta1 and currently runs the examples/example app (the app that's at http://demo.liftweb.net). We have disabled many of the tests during the automated build because as of last night, not all the test frameworks (ScalaTest, Specs, and ScalaCheck) were compiled against 2.8 Beta1. We are doing continuous builds of Lift against the 280_port_refresh branch at http://hudson.scala-tools.org/job/lift-scala280/ And will be publishing to the scala-tools.org http://scala-tools.org http://scala-tools.org Maven repository very soon now (today or tomorrow). Once we get the JAR files publishing to the Scala-tools.org
Re: [Lift] MetaMapper.foreach
On Thu, Jan 28, 2010 at 5:23 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: Neat. So it's a flatMap? No, it's not flatMap. It has some of the characteristics of flatMap, but the function returns a Box[T], not an Iterable[T] Should we replace the pattern used often in binding lists Author.findAll.flatMap { a = bind ... } with Author.findMap() { a = bind ... } when the list is large or its elements are big? I don't think so. - David Pollakfeeder.of.the.be...@gmail.com wrote: def findMap[T](by: QueryParam[A]*)(f: A = Box[T]) Your function, f, will be called as each row is pulled back from the database. If your function returns Empty, the row will not be included in the final result. You can also do fun stuff like: MyModel.findMap(){ row - row.name.is match { case x if x.length 4 = Full(x) case _ = Empty }} This will return a List[String] for all the people with short names. Your function is called as each row is processed, so the whole list is not loaded into memory. If you wanted to simulate a foreach here, you'd just return Empty from the function every time. On Wed, Jan 27, 2010 at 9:58 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: MetaMapper has a findAll method, which creates a statement based on its parameters, and then iterates over the ResultSet creating Mappers and putting them into a List. It would be neat if it was possible to process the generated Mappers one by one instead of loading them into a list. This way large ResultSets don't need to result in a big List in memory. Is such a thing possible today? If not, what would it take to implement? One approach would be foreach/map/flatMap methods. Another would be a find method that returns a lazy list or an Iterator. Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Exception notification?
You can also play extractor tricks here: object MyExceptionLogger { def unapply(in: (Props.RunModes.Value, Req, Throwable)): Option[(Props.RunModes.Value, Req, Throwable)] = { Mailer.sendMail(From(y...@yaks.com), Subject(You've got exception), To(firefight...@yaks.com), PlainMailBodyType(in._3.getMessage)) None } } LiftRules.exceptionHandler.prepend{ case MyExceptionLogger(_, _, t) = throw t // this will never happen } What this does is it calls the unapply method on MyExceptionLogger which has the side effect of sending email about the exception, but it returns None so the case is not applied and the testing continues. On Thu, Jan 28, 2010 at 11:42 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Yu-Shan Fung ambivale...@gmail.com writes: Hi All, A bit of a shot in the dark, but is there an easy way to setup email notification on an lift app whenever an uncaught exception occurs? Seems like a common enough use-case, just wonder if there's a standard way to do it before I roll my own. I have it setup so that all unhandled exceptions are logged with an error: private def setupGlobalErrorHandler() { val currentHandler = LiftRules.exceptionHandler.toList.first LiftRules.exceptionHandler.prepend { case (Props.RunModes.Development, r, e) = Log.error(Exception occurred during processing of %s. UserId=%s.format(r,User.currentUserId), e) currentHandler((Props.RunModes.Development, r, e)) case (Props.RunModes.Production, r, e) = Log.error(Exception occurred during processing of %s. UserId=%s.format(r,User.currentUserId), e) RedirectResponse(/error.html) } } } I then (in production) configure logback to send me emails on errors: appender name=EMAIL class=ch.qos.logback.classic.net.SMTPAppender SMTPHostlocalhost/SMTPHost Tox...@xxx/To Fromy...@fyyy/From layout class=ch.qos.logback.classic.html.HTMLLayout / /appender /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift Announce] Re: [Lift] Lift and Scala 2.8 Beta1
Dear Indrajit, Thanks! That works. Best wishes, --greg On Fri, Jan 29, 2010 at 11:27 AM, Indrajit Raychaudhuri indraj...@gmail.com wrote: For SNAPSHOTs, you need to add the SNAPSHOT repo explicitly. Try this command: mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=2.0-scala280-SNAPSHOT \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DremoteRepositories=http://scala-tools.org/repo-snapshots \ -DgroupId=$1 -DartifactId=$2 NB: My previous reply was a supplement of this one: http://groups.google.com/group/liftweb/msg/0734a3a1b7d0424d Cheers, Indrajit On 30/01/10 12:50 AM, Meredith Gregory wrote: Dear Indrajit, See the trace below with the archetypeVersion set as you suggest. Best wishes, --greg bash-3.2$ bin/mklift.sh com.biosimilarity.identity WhiteRabbit [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] [archetype:generate] [INFO] Generating project in Interactive mode [INFO] Archetype repository missing. Using the one from [net.liftweb:lift-archetype-basic:RELEASE - http://scala-tools.org/repo-releases] found in catalog internal [INFO] snapshot net.liftweb:lift-archetype-basic:2.0-scala280-SNAPSHOT: checking for updates from lift-archetype-basic-repo Downloading: http://scala-tools.org/repo-releases/net/liftweb/lift-archetype-basic/2.0-scala280-SNAPSHOT/lift-archetype-basic-2.0-scala280-SNAPSHOT.jar [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] The desired archetype does not exist (net.liftweb:lift-archetype-basic:2.0-scala280-SNAPSHOT) [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jan 29 11:19:16 PST 2010 [INFO] Final Memory: 8M/15M [INFO] bash-3.2$ On Fri, Jan 29, 2010 at 11:16 AM, Meredith Gregory lgreg.mered...@gmail.com mailto:lgreg.mered...@gmail.com wrote: Dear Indrajit, -DarchetypeVersion=2.0-scala280-SNAPSHOT was the first thing i tried and that failed. ;-( Best wishes, --greg On Fri, Jan 29, 2010 at 11:15 AM, David Pollak feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com wrote: On Thu, Jan 28, 2010 at 9:04 PM, Indrajit Raychaudhuri indraj...@gmail.com mailto:indraj...@gmail.com wrote: The Lift 2.0 snapshot jars for Scala 2.8 are now available on scala-tools Maven repository. Feel free to try your Lift application against 2.0-scala280-SNAPSHOT jars. You can change Lift artifact dependencies version to 2.0-scala280-SNAPSHOT in you application pom and proceed to build as usual. Awesome! Let the Lift on Scala 2.8 Beta1 testing and feedback commence. Cheers, Indrajit On 28/01/10 2:31 AM, David Pollak wrote: Folks, Lift is currently building against Scala 2.8 Beta1 and currently runs the examples/example app (the app that's at http://demo.liftweb.net). We have disabled many of the tests during the automated build because as of last night, not all the test frameworks (ScalaTest, Specs, and ScalaCheck) were compiled against 2.8 Beta1. We are doing continuous builds of Lift against the 280_port_refresh branch at http://hudson.scala-tools.org/job/lift-scala280/ And will be publishing to the scala-tools.org
Re: [Lift] Re: Using Stateful Snippets
On Fri, Jan 29, 2010 at 12:05 PM, Jay Cain cain@gmail.com wrote: It seems that you are correct. My user object is a JPA entity and when it enters the closure it has a different identityHash 10749831 vs. 21737589. This will probably be one of many issues that I will have to deal with if I'm going to continue with JPA? It's like the entityManager loses reference to the entity object I persisted to the db. That's no good. I'm starting this project from scratch and have a java background is it easier to just pick up with Scala's persistent architecture then continue with these little bumps in the road. Yes, JTA transactions and EntityManager instances are scoped to the request by the container, so your entities will become detached and will need to be merged before the closure can manipulate them. I've been fighting this issue for over a year, and haven't really been able to come up with a good solution. There's just a fundamental mismatch between the models. This wouldn't be so bad if there were a reattach to persistence context method on EntityManager in the EJB spec, but merge is the closest thing and it comes with a huge host of pitfalls, not the least of which is the fact that merge returns a proxy which cannot *itself* be attached to a persistence context (if detached) at all. If you're on a fresh project, I would not recommend using JPA with Lift. There are just too many sharp corners. Kris On Jan 29, 11:06 am, Naftoli Gugenheim naftoli...@gmail.com wrote: And user is not a RequestVar, correct? So this is not a RequestVar problem then? What is user? A JPA entity? Could this be a JPA issue? If you like you can use System.identityHashcode to demonstrate that the same user instance is losing its data. - Jay Caincain@gmail.com wrote: User[ id=0 email=, username = , created on=Fri Jan 29 10:57:27 MST 2010 role=Basic] This value I get On Jan 28, 10:44 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You didn't answer my question. At the time the closure passed to redirectTo is executed, what is the value of 'user'? - Jay Caincain@gmail.com wrote: it appears that the user still creates a new User. it is because I tell it to do that each time a new request is made. // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) So I guess my question is how prevent it from doing that and still pass a User object to the RequestVar I tried a RequestVar[User] but no bueno below is the snippet code for registering a user user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) S.redirectTo(thank_you, () = { println(user); userVar(user);} In the mean time I'm going to just extract the email and fullname from the user and pass it as a request param user.password = passwordHashed user.activationCode = activationCode user.userProfile.user = user user.userPreferences.user = user Model.mergeAndFlush(user) MailUtils.mailConfirmationLetter(user) val email = user.email val fullName = user.userProfile.fullName println(email + email) S.redirectTo(thank_you, () = {S.set(email, email); S.set (fullName, fullName);}) Thanks for helping out On Jan 27, 10:20 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Can you put a trace in that closure to see if 'user' has the correct value? S.redirectTo(thank_you, () = {println(user); userVar(user);}) etc. On Wed, Jan 27, 2010 at 11:51 PM, Jay Cain cain@gmail.com wrote: I think that this would work // Set up a requestVar to track the user object object userVar extends RequestVar(new User()) S.redirectTo(thank_you, () = {userVar(user);}) but no bueno. On Jan 27, 4:56 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: When you redirect you start a new request, so RequestVars are fresh. redirectTo has an overload that take additionally a function to execute in the new request. Set the RequestVar there. - Jay Caincain@gmail.com wrote: I am a newbie to Lift and Scala. I'm registering users and once they have entered the information in successfully. I want to redirect to a thank_you page that will display a snippet lift:UserOps.thanksMessage p entry:fullname/ thanks for joining Echo. The confirmation instructions for completing the signup process have been sent to your email address, entry:email/ /p /lift:UserOps.thanksMessage I assume that when I redirect it doesn't hold the state of the user information. On submit I invoke signup def
Re: [Lift] Always log through Slf4j?
On Fri, Jan 29, 2010 at 2:40 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Indrajit Raychaudhuri indraj...@gmail.com writes: I am not sure you need to add yet another adapter on top of slf4j for MDC support. Enhancing the existing slf4j wrapper for the purpsoe might be worth an attempt instead. Yes but if we introduce a Lift MDC it would need to delegate to either Log4j or Slf4j (which already has MDC wrapped for logback log4j) Looking at the way the Java frameworks do MDC, I'm not keen on it. I'd much rather see some kind of doWith mechanism: Log.doWith(name - value, otherName - otherValue) { } That way, you can clearly delineate the custom log information. It might also be interesting to see log levels changed in the same way. I'd like to apply Scala and Lift constructs to Logging rather than just borrow existing paradigms. In terms of slf4j, I have a generic allergic reaction to it. There was a thread 2 years ago on Slf4j that seemed to me to be a bunch of zealots demanding it as the default without giving any reasons other than it's better (think emacs vs vi.) If there are real reasons to insert it into the mix, I'll listen to them, but I'd rather start at a design that's Scala and Lift-like and move down the implementation stack to see why it's a win to insert slf4j. Thanks, David That said, I think there is room (and opportunity) for defaulting to lightweight wrapper over slf4j and letting users choose any underlying framework (simple, log4j, logback, jul) at build/deploy time. I am optimistic this would be doable without any code change on existing Lift applications. And keep OSGi happiness in the way. That was my proposal As such, I thing we should be careful and avoid duplicating (very similar impl of) MDC enhancement to both Log4JLogger and Slf4JLogger. I agree and this was what caused me to write the email in the first place :-) I would be inclined to consider: - Zero code change in application for switching log implementations (nothing should be necessary to be put in Boot.scala) As long as you don't want to tweak the backend config. I think you still need to configure the underlying logging framework in order to support reading (dev|prod|test) config files. - Tuck in everything behind the helper object(s) - Log for the root logger or other objects introduced because of the Loggable trait - Have MDC and other enhancements aligned to slf4j. Per design slf4j-api expects a real logging framework behind it (bundled or otherwise). - In Lift, for guaranteed compatibility, default to log4j (by using log4j wrapper of slf4j) - but still allow using logback, jul etc. just by flipping the dependency during build. Bonus, slf4j would fallback to simple logger if none of the dependencies are available. - Existing applications can just add log4j bridge for the existing behavior. - New applications (generated from archetype) mark slf4j-api as compile scope dependency and have one of the implementations (simple,log4j,logback etc.) added as either compile scope or provided scope (to cover for log4j in container classpath). This can even be offered as choice during archetype:generate! Thoughts? That was pretty much what I had in mind, but probably didn't articulate too well :-) I'll wait for David to chime in since he had objections. In the meantime, I've pushed the changes (keeping the Log4j logger) to http://github.com/dpp/liftweb/tree/jnm_issue_309 I've updated the hellolift example to use Slf4j over logback. /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Communication between snippet and comet actor via RequestVar
Hi all, I've got the following scenario: A comet actor renders a link like this: SHtml.link(myURL, handleClick, Text(linkText), target - new_window) The handleClick function then stores some information in a RequestVar. Embedded into the page referenced by myURL, is a snippet that accesses the RequestVar. My problem now is that the RequestVar, when accessed by the snippet is always empty. What I know is that the handleClick really stores something into the RequestVar. What am I doing wrong? Any help is appreciated. Thanks, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Communication between snippet and comet actor via RequestVar
CometActors do not have a request context and thus do not support request vars. The function generated during the execution of a CometActor is run in the context of the CometActor. This is an interesting and novel use case... Let me think about it for a little while. On Fri, Jan 29, 2010 at 12:31 PM, ced docpom...@googlemail.com wrote: Hi all, I've got the following scenario: A comet actor renders a link like this: SHtml.link(myURL, handleClick, Text(linkText), target - new_window) The handleClick function then stores some information in a RequestVar. Embedded into the page referenced by myURL, is a snippet that accesses the RequestVar. My problem now is that the RequestVar, when accessed by the snippet is always empty. What I know is that the handleClick really stores something into the RequestVar. What am I doing wrong? Any help is appreciated. Thanks, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Upgrade to Flot 0.6
Hello all, I needed to use some of the recent functionality in the Flot jQuery plugin which is version 0.6. The Flot lift-widget is currently at 0.4. So I upgraded it to use the new version and I've posted the commit on github: http://github.com/avalade/liftweb/commit/fa3d76fb72a7f74d13265e4039f034b4ada39492 Version 0.6 of Flot does make one breaking change which requires some of the options which were previously described as a top level attributes on the FlotOptions object to be pushed inside of a new attribute called FlotSeriesOptions. I've made the appropriate changes to the various example Flot charts which were included in the flotDemo module. Would it be possible to get this change upstream? - Aaron -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Communication between snippet and comet actor via RequestVar
David, thanks for the explanation! Let me explain my use case in more depth. Maybe another solution would be suitable that I don't see. I use the comet actor to display a list of files which is sent by an actor object monitoring a directory in turn. This is done via comet because changes of the monitored directory can happen frequently and it's not suitable for the user to reload the page to look for new files having arrived. Each file should be displayed as a link so you can click on it to get some detailed information. Another approach, which seems not so elegant to me, would be to render links that take the file's name or some sort of file id as a parameter, so that the snippet can resolve it to the file again. - Chris On 29 Jan., 21:40, David Pollak feeder.of.the.be...@gmail.com wrote: CometActors do not have a request context and thus do not support request vars. The function generated during the execution of a CometActor is run in the context of the CometActor. This is an interesting and novel use case... Let me think about it for a little while. On Fri, Jan 29, 2010 at 12:31 PM, ced docpom...@googlemail.com wrote: Hi all, I've got the following scenario: A comet actor renders a link like this: SHtml.link(myURL, handleClick, Text(linkText), target - new_window) The handleClick function then stores some information in a RequestVar. Embedded into the page referenced by myURL, is a snippet that accesses the RequestVar. My problem now is that the RequestVar, when accessed by the snippet is always empty. What I know is that the handleClick really stores something into the RequestVar. What am I doing wrong? Any help is appreciated. Thanks, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Always log through Slf4j?
David Pollak feeder.of.the.be...@gmail.com writes: On Fri, Jan 29, 2010 at 2:40 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Indrajit Raychaudhuri indraj...@gmail.com writes: I am not sure you need to add yet another adapter on top of slf4j for MDC support. Enhancing the existing slf4j wrapper for the purpsoe might be worth an attempt instead. Yes but if we introduce a Lift MDC it would need to delegate to either Log4j or Slf4j (which already has MDC wrapped for logback log4j) Looking at the way the Java frameworks do MDC, I'm not keen on it. I'd much rather see some kind of doWith mechanism: Log.doWith(name - value, otherName - otherValue) { } Exactly. I was about to implement something along these lines. But if we would still support native log4j as well as slf4j, it would mean that I'd have to implement two different MDC implementations (ala Log4jLogger and Slf4jLogger). And this is exactly the problem Slf4j solves, hence the original mail :-) [...] I'd like to apply Scala and Lift constructs to Logging rather than just borrow existing paradigms. I agree on the interface part. I think there's good value in leveraging existing logging frameworks for the actual logging as long as there's not too big of an impedance mismatch. In terms of slf4j, I have a generic allergic reaction to it. Fair enough :-) It is also non-trivial to get these things right in all scenarios with different containers etc (Seems like Slf4j has succeeded where commons-logging has failed though. Just look at the commons-logging classloader problems). There was a thread 2 years ago on Slf4j that seemed to me to be a bunch of zealots demanding it as the default without giving any reasons other than it's better (think emacs vs vi.) But clearly emacs is better :-) If there are real reasons to insert it into the mix, I'll listen to them, but I'd rather start at a design that's Scala and Lift-like and move down the implementation stack to see why it's a win to insert slf4j. The real benefit, as I see it, is that the Lift code can concentrate on providing a Scala/Lift interface to logging, programmed against a single well defined (imho) API while still giving the user full flexibility on the actual logging backend (log4j, JDK, logback etc) But we've already spent quite some time back and forth on this (minor) issue, so I'll just implement MDC in the same way as the current loggers. If we keep a sane interface, we can always change the implementation later if deemed necessary. /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Single log in for three contexts
I have three lift sites at different domain names (different apps) but all pulling data from the same database (using the same JPA persistence jar). I'd like my users to be able to log in on one site, and have it apply to all three sites. Clearly, I need some way to share the lift session across three servlet contexts. What is the simplest way to do this in lift? Avoiding installing some external app that I have to learn is a priority. All three sites are running in one instance of Tomcat 6 (as virtual domains)... something like example.com, this.example.com, and that.example.com. Any and all suggestions welcome! Chas. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Always log through Slf4j?
On Fri, Jan 29, 2010 at 1:53 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: David Pollak feeder.of.the.be...@gmail.com writes: On Fri, Jan 29, 2010 at 2:40 AM, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: Indrajit Raychaudhuri indraj...@gmail.com writes: I am not sure you need to add yet another adapter on top of slf4j for MDC support. Enhancing the existing slf4j wrapper for the purpsoe might be worth an attempt instead. Yes but if we introduce a Lift MDC it would need to delegate to either Log4j or Slf4j (which already has MDC wrapped for logback log4j) Looking at the way the Java frameworks do MDC, I'm not keen on it. I'd much rather see some kind of doWith mechanism: Log.doWith(name - value, otherName - otherValue) { } Exactly. I was about to implement something along these lines. But if we would still support native log4j as well as slf4j, it would mean that I'd have to implement two different MDC implementations (ala Log4jLogger and Slf4jLogger). And this is exactly the problem Slf4j solves, hence the original mail :-) [...] I'd like to apply Scala and Lift constructs to Logging rather than just borrow existing paradigms. I agree on the interface part. I think there's good value in leveraging existing logging frameworks for the actual logging as long as there's not too big of an impedance mismatch. In terms of slf4j, I have a generic allergic reaction to it. Fair enough :-) It is also non-trivial to get these things right in all scenarios with different containers etc (Seems like Slf4j has succeeded where commons-logging has failed though. Just look at the commons-logging classloader problems). There was a thread 2 years ago on Slf4j that seemed to me to be a bunch of zealots demanding it as the default without giving any reasons other than it's better (think emacs vs vi.) But clearly emacs is better :-) I agree. Clearly a man of superior taste and programming skillz. ;-) If there are real reasons to insert it into the mix, I'll listen to them, but I'd rather start at a design that's Scala and Lift-like and move down the implementation stack to see why it's a win to insert slf4j. The real benefit, as I see it, is that the Lift code can concentrate on providing a Scala/Lift interface to logging, programmed against a single well defined (imho) API while still giving the user full flexibility on the actual logging backend (log4j, JDK, logback etc) But we've already spent quite some time back and forth on this (minor) issue, so I'll just implement MDC in the same way as the current loggers. If we keep a sane interface, we can always change the implementation later if deemed necessary. If you're 100% sure that nothing will break, go for the slf4j-based approach. Thanks, David /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Upgrade to Flot 0.6
Peter, What do you think of the upgrade (given that you're the most Flot-ish Lift committer)? Thanks, David On Fri, Jan 29, 2010 at 12:32 PM, Aaron Valade a...@alum.mit.edu wrote: Hello all, I needed to use some of the recent functionality in the Flot jQuery plugin which is version 0.6. The Flot lift-widget is currently at 0.4. So I upgraded it to use the new version and I've posted the commit on github: http://github.com/avalade/liftweb/commit/fa3d76fb72a7f74d13265e4039f034b4ada39492 Version 0.6 of Flot does make one breaking change which requires some of the options which were previously described as a top level attributes on the FlotOptions object to be pushed inside of a new attribute called FlotSeriesOptions. I've made the appropriate changes to the various example Flot charts which were included in the flotDemo module. Would it be possible to get this change upstream? - Aaron -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Communication between snippet and comet actor via RequestVar
On Fri, Jan 29, 2010 at 12:56 PM, ced docpom...@googlemail.com wrote: David, thanks for the explanation! Let me explain my use case in more depth. Maybe another solution would be suitable that I don't see. I use the comet actor to display a list of files which is sent by an actor object monitoring a directory in turn. This is done via comet because changes of the monitored directory can happen frequently and it's not suitable for the user to reload the page to look for new files having arrived. Each file should be displayed as a link so you can click on it to get some detailed information. Another approach, which seems not so elegant to me, would be to render links that take the file's name or some sort of file id as a parameter, so that the snippet can resolve it to the file again. This is one approach and likely to be the easiest in the short run... basically, have a SessionVar that maps GUID to file name and just include the GUID as a query param for the new window. We will have to come up with a longer term solution to this issue. The big problem is that Actors are guaranteed to only execute code in one thread. If you have a function that's bound to an Actor's instance variables, having that function execute code on another thread can have catastrophic impact. And there's no way to figure out if the function passed to the SHtml.link() method closed over CometActor instance variables. If it did, the function has to be executed in the context of the CometActor and can't have access to RequestVars. So, my first two ideas will not work: - Have functions passed to link always execute in the Request context rather than the context based on where they were created. - Have functions executed during a full page load (rather than during an Ajax operation) execute in the Request context What we could do is execute the functions synchronously on the CometActor and capture the RequestVar scope from the CometActor and merge that RequestVar context back into the main RequestVar context of the main request servicing thread. Marius -- do you have any thoughts on this issue? - Chris On 29 Jan., 21:40, David Pollak feeder.of.the.be...@gmail.com wrote: CometActors do not have a request context and thus do not support request vars. The function generated during the execution of a CometActor is run in the context of the CometActor. This is an interesting and novel use case... Let me think about it for a little while. On Fri, Jan 29, 2010 at 12:31 PM, ced docpom...@googlemail.com wrote: Hi all, I've got the following scenario: A comet actor renders a link like this: SHtml.link(myURL, handleClick, Text(linkText), target - new_window) The handleClick function then stores some information in a RequestVar. Embedded into the page referenced by myURL, is a snippet that accesses the RequestVar. My problem now is that the RequestVar, when accessed by the snippet is always empty. What I know is that the handleClick really stores something into the RequestVar. What am I doing wrong? Any help is appreciated. Thanks, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Upgrade to Flot 0.6
There is one break that my commit made which I just realized after I had sent this email in that I deleted the excanvas.pack.js file and dropped in the excanvas.js that was included with the Flot 0.6 distribution but didn't rename it to be excanvas.pack.js and didn't change the path in the Flot.scala file. I can make an additional commit that fixes this, if it pleases the court. :-) - A On Fri, Jan 29, 2010 at 6:15 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Peter, What do you think of the upgrade (given that you're the most Flot-ish Lift committer)? Thanks, David On Fri, Jan 29, 2010 at 12:32 PM, Aaron Valade a...@alum.mit.edu wrote: Hello all, I needed to use some of the recent functionality in the Flot jQuery plugin which is version 0.6. The Flot lift-widget is currently at 0.4. So I upgraded it to use the new version and I've posted the commit on github: http://github.com/avalade/liftweb/commit/fa3d76fb72a7f74d13265e4039f034b4ada39492 Version 0.6 of Flot does make one breaking change which requires some of the options which were previously described as a top level attributes on the FlotOptions object to be pushed inside of a new attribute called FlotSeriesOptions. I've made the appropriate changes to the various example Flot charts which were included in the flotDemo module. Would it be possible to get this change upstream? - Aaron -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Passing attributes to bound elements
On Fri, Jan 29, 2010 at 12:15 AM, Adam Warski a...@warski.org wrote: Hello, This was considered later on a defect, and not a feature. To preserve markup attributes in your bind use -% instead of - thanks, although the -% is missing support for the .toForm, as it returns a Box[NodeSeq]. And for % you need an Elem. Any ideas how to deal with that? :) What are you applying toForm to? -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Communication between snippet and comet actor via RequestVar
David, thanks for taking your time to give such an in-depth explanation. That gave me/all some valuable insights. - Chris On 30 Jan., 00:24, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jan 29, 2010 at 12:56 PM, ced docpom...@googlemail.com wrote: David, thanks for the explanation! Let me explain my use case in more depth. Maybe another solution would be suitable that I don't see. I use the comet actor to display a list of files which is sent by an actor object monitoring a directory in turn. This is done via comet because changes of the monitored directory can happen frequently and it's not suitable for the user to reload the page to look for new files having arrived. Each file should be displayed as a link so you can click on it to get some detailed information. Another approach, which seems not so elegant to me, would be to render links that take the file's name or some sort of file id as a parameter, so that the snippet can resolve it to the file again. This is one approach and likely to be the easiest in the short run... basically, have a SessionVar that maps GUID to file name and just include the GUID as a query param for the new window. We will have to come up with a longer term solution to this issue. The big problem is that Actors are guaranteed to only execute code in one thread. If you have a function that's bound to an Actor's instance variables, having that function execute code on another thread can have catastrophic impact. And there's no way to figure out if the function passed to the SHtml.link() method closed over CometActor instance variables. If it did, the function has to be executed in the context of the CometActor and can't have access to RequestVars. So, my first two ideas will not work: - Have functions passed to link always execute in the Request context rather than the context based on where they were created. - Have functions executed during a full page load (rather than during an Ajax operation) execute in the Request context What we could do is execute the functions synchronously on the CometActor and capture the RequestVar scope from the CometActor and merge that RequestVar context back into the main RequestVar context of the main request servicing thread. Marius -- do you have any thoughts on this issue? - Chris On 29 Jan., 21:40, David Pollak feeder.of.the.be...@gmail.com wrote: CometActors do not have a request context and thus do not support request vars. The function generated during the execution of a CometActor is run in the context of the CometActor. This is an interesting and novel use case... Let me think about it for a little while. On Fri, Jan 29, 2010 at 12:31 PM, ced docpom...@googlemail.com wrote: Hi all, I've got the following scenario: A comet actor renders a link like this: SHtml.link(myURL, handleClick, Text(linkText), target - new_window) The handleClick function then stores some information in a RequestVar. Embedded into the page referenced by myURL, is a snippet that accesses the RequestVar. My problem now is that the RequestVar, when accessed by the snippet is always empty. What I know is that the handleClick really stores something into the RequestVar. What am I doing wrong? Any help is appreciated. Thanks, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroup s.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Upgrade to Flot 0.6
Aaron, thanks so much for taking the initiative to upgrade Flot, it's something that I've been meaning to do. Just skimming over your changes, everything looks good. As for not using the packed excanvas file, that should be ok since Lift runs the YUI compressor by default on all Javascript files (correct, David?). Of course, broken URLs need to be fixed. David, how do we go about merging these changes? Peter On Jan 29, 3:32 pm, Aaron Valade a...@alum.mit.edu wrote: There is one break that my commit made which I just realized after I had sent this email in that I deleted the excanvas.pack.js file and dropped in the excanvas.js that was included with the Flot 0.6 distribution but didn't rename it to be excanvas.pack.js and didn't change the path in the Flot.scala file. I can make an additional commit that fixes this, if it pleases the court. :-) - A On Fri, Jan 29, 2010 at 6:15 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Peter, What do you think of the upgrade (given that you're the most Flot-ish Lift committer)? Thanks, David On Fri, Jan 29, 2010 at 12:32 PM, Aaron Valade a...@alum.mit.edu wrote: Hello all, I needed to use some of the recent functionality in the Flot jQuery plugin which is version 0.6. The Flot lift-widget is currently at 0.4. So I upgraded it to use the new version and I've posted the commit on github: http://github.com/avalade/liftweb/commit/fa3d76fb72a7f74d13265e4039f0... Version 0.6 of Flot does make one breaking change which requires some of the options which were previously described as a top level attributes on the FlotOptions object to be pushed inside of a new attribute called FlotSeriesOptions. I've made the appropriate changes to the various example Flot charts which were included in the flotDemo module. Would it be possible to get this change upstream? - Aaron -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Lift + UTF-8
I would like to switch from MySQL to PostgreSQL but have no experience with PostgreSQL's way of master/slave replication. What tool do you recommend? Thanks. On Jan 30, 3:48 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jan 29, 2010 at 6:06 AM, Adam Warski a...@warski.org wrote: Heh, sorry, I knew the moment I write a post here I'll find the answer ;) Forgot that when converting a table in mysql you not only need to set the character encoding for the table but also for the individual columns. My experience has been that PostgreSQL doesn't have these kind of issues and is generally faster and more stable than MySQL. FYI. Sorry again for the spam. On Jan 29, 2010, at 3:01 PM, Adam Warski wrote: Hello, maybe you have some ideas. I'm trying to make my lift app able to store polish characters, and I'm slowly running out of ideas. I think it's something with mapper configuration, but I'm not sure. When I submit a form with an ą character, I get the following exception: Message: java.sql.SQLException: Incorrect string value: '\xC4\x85' for column 'title' at row 1 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) What I did so far: - the mysql table encoding is utf-8 - the connection string contains useUnicode=truecharacterEncoding=UTF-8 - LiftRules.early.append(_.setCharacterEncoding(UTF-8)) When the String is set on the model field it still is correct, so something happens when trying to persist the value. Is there a way in lift to configure jdbc so that it accepts utf-8 characters? Or am I missing something else? -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] (ISSUE) How to use the sbt with lift project ?
Hi all, How to use the sbt with lift project ? I try to use the sbt and get this errors, Does anybody know what's wrong with it ? Maybe i missing something else ? Here is the log: # I create this file like this in the build directory. G:\project\test\project\build\TestProject.scala import sbt._ class TestProject(info: ProjectInfo) extends DefaultWebProject(info) { override lazy val jetty = org.mortbay.jetty % jetty % 6.1.22 % test-default } # G:\project\testsbt G:\project\testset SCRIPT_DIR=G:\cygwin\home\ G:\project\testjava -Xmx64M -jar G:\cygwin\home\sbt- launcher-0.5.6.jar Project does not exist, create new project? (y/N/s) : y Name: test Organization []: Version [1.0]: Scala version [2.7.7]: sbt version [0.5.6]: :: retrieving :: sbt#boot confs: [default] 2 artifacts copied, 0 already retrieved (9911kB/625ms) :: retrieving :: sbt#boot confs: [default] 3 artifacts copied, 0 already retrieved (3409kB/547ms) [success] Successfully initialized directory structure. [info] Building project test 1.0 using sbt.DefaultProject [info]with sbt 0.5.6 and Scala 2.7.7 [info] No actions specified, interactive session started. Execute 'help' for more information. 1: Get this error when use sbt update command G:\project\testsbt update G:\project\testset SCRIPT_DIR=G:\cygwin\home\ G:\project\testjava -Xmx64M -jar G:\cygwin\home\sbt- launcher-0.5.6.jar update [error] G:\project\test\project\build\TestProject.scala:5: error overriding lazy value jetty in class BasicWebScalaP roject of type TestProject.this.Task; [error] value jetty needs `override' modifier [error] val jetty = org.mortbay.jetty % jetty % 6.1.22 % test- default - 2: When I add the override in the definition, and get this error. [error] G:\project\test\project\build\TestProject.scala:5: error overriding lazy value jetty in class BasicWebScalaP roject of type TestProject.this.Task; [error] value jetty must be declared lazy to override a concrete lazy value [error] override val jetty = org.mortbay.jetty % jetty % 6.1.22 % test-default [error]^ [error] one error found Compilation unsuccessful. - 3: Add lazy into the statement and get this error. [error] G:\project\test\project\build\TestProject.scala:5: error overriding lazy value jetty in class BasicWebScalaP roject of type TestProject.this.Task; [error] lazy value jetty has incompatible type sbt.ModuleID [error] override lazy val jetty = org.mortbay.jetty % jetty % 6.1.22 % test-default # Thanks for any help! Cheers, Neil -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Lift 1.0.3 released
The Lift team is pleased to announce the lift-1.0.3 release! Lift is an expressive and elegant framework for writing web applications. Lift stresses the importance of security, maintainability, scalability and performance while allowing for high levels of developer productivity. Lift is a scala web framework. Changes in this version include: Fixed Bugs: o Upgrade to Scala 2.7.7 o Add user presence heartbeat support Have fun! -Lift team -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.