[Lift] Re: Is CometActor the right tool for this job?
1) I assume each page get their own instance of the actor so they can hold their own data. Is this correct? Yes. No, it's not correct. There's one CometActor of a given type/name per session. Sorry for this. I just hat the relation one page - user (== session) in mind... -- 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] JUnit test using Selenium RC
Hi, I'm writting Selenium tests with Scala JUnit. The problem is when i try to put value in SHtml.ajaxText field. Selenium RC doesn't call my js function from this ajaxText. I would really appreciate any help. best regards, Darek -- 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] JUnit test using Selenium RC
On Wed, Mar 3, 2010 at 10:30 AM, Tweek d.sztwio...@gmail.com wrote: Hi, I'm writting Selenium tests with Scala JUnit. The problem is when i try to put value in SHtml.ajaxText field. Selenium RC doesn't call my js function from this ajaxText. Not sure exactly what you mean by the above, but IIRC, the ajax request is not triggered by simply setting a value in a field but when you exit the field (onBlur). Also note that the fields usually get a unique id for each new page view. To get stable identifiers you should run in test mode (see the list for details) I'll be interested in your results as we probably have to do something similar soon :-) /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.
Re: [Lift] The role of LiftRules
See David's last post on this thread, and the updated diff on RB. - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Naftoli Gugenheim naftoli...@gmail.com writes: Would it be a bad idea to use java.util.Date for now, and if and when support is added for JodaTime, change it to a DateHolder (which would be added then)? Haven't looked in detail, but wouldn't this require two changes to client code? 1) One to use the new ConversionRules 2) One when DateHolder is introduced If so, I suggest we take the hit now to allow for a seamless (if such a thing exists :-) change to JodaTime /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. -- 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] The role of LiftRules
When are the implicits on a companion object invoked without needing to be imported? - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Naftoli Gugenheim naftoli...@gmail.com writes: Would it be a bad idea to use java.util.Date for now, and if and when support is added for JodaTime, change it to a DateHolder (which would be added then)? Haven't looked in detail, but wouldn't this require two changes to client code? 1) One to use the new ConversionRules 2) One when DateHolder is introduced If so, I suggest we take the hit now to allow for a seamless (if such a thing exists :-) change to JodaTime /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. -- 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: JUnit test using Selenium RC
okej, so: i've got code like this: var testStr : String = def set(s : String) : JsCmd ={ println(s) testStr = s JsRaw() } def render(ns : NodeSeq) : NodeSeq ={ bind(fields, ns, name - SHtml.ajaxText(testStr, (s : String) = setName(s) ) % (id - name), ... } and JUnit test with Selenium like this: class FirstSeleniumTest extends SeleneseTestCase { //@Before override def setUp: Unit = { super.setUp(http://localhost:8080/;, *firefox) selenium.windowMaximize() } //@After override def tearDown: Unit = { selenium.close } //@Test def testFirst = { selenium.open(/) selenium.waitForPageToLoad(3) selenium.`type`(name,new value) ... } } finally i'm running it from maven by: mvn test - Dtest=FirstSeleniumTest (jetty is running in other console) all of this is looking fine, selenium is working, new value is put in my ajaxText field, but the setName function is not call - i'm not get any log in console where jetty is running On 3 Mar, 10:40, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On Wed, Mar 3, 2010 at 10:30 AM, Tweek d.sztwio...@gmail.com wrote: Hi, I'm writting Selenium tests with Scala JUnit. The problem is when i try to put value in SHtml.ajaxText field. Selenium RC doesn't call my js function from this ajaxText. Not sure exactly what you mean by the above, but IIRC, the ajax request is not triggered by simply setting a value in a field but when you exit the field (onBlur). Also note that the fields usually get a unique id for each new page view. To get stable identifiers you should run in test mode (see the list for details) I'll be interested in your results as we probably have to do something similar soon :-) /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.
Re: [Lift] Re: JUnit test using Selenium RC
Ok, What happens if you, manually, type in new value in the field (only the text, don't press enter, dont click etc)?? My guess is nothing (unless you've added your own keyboard event handlers). And this is what your selenium test does. If so take a look here http://www.eviltester.com/index.php/2009/01/24/how-i-learned-to-love-seleniums-fireevent/ I think you need to add something like this to the test to trigger the ajax call: selSession.fireEvent(edit_field_1, blur); /Jeppe On Wed, Mar 3, 2010 at 12:48 PM, Tweek d.sztwio...@gmail.com wrote: okej, so: i've got code like this: var testStr : String = def set(s : String) : JsCmd ={ println(s) testStr = s JsRaw() } def render(ns : NodeSeq) : NodeSeq ={ bind(fields, ns, name - SHtml.ajaxText(testStr, (s : String) = setName(s) ) % (id - name), ... } and JUnit test with Selenium like this: class FirstSeleniumTest extends SeleneseTestCase { // �...@before override def setUp: Unit = { super.setUp(http://localhost:8080/;, *firefox) selenium.windowMaximize() } // �...@after override def tearDown: Unit = { selenium.close } // �...@test def testFirst = { selenium.open(/) selenium.waitForPageToLoad(3) selenium.`type`(name,new value) ... } } finally i'm running it from maven by: mvn test - Dtest=FirstSeleniumTest (jetty is running in other console) all of this is looking fine, selenium is working, new value is put in my ajaxText field, but the setName function is not call - i'm not get any log in console where jetty is running On 3 Mar, 10:40, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On Wed, Mar 3, 2010 at 10:30 AM, Tweek d.sztwio...@gmail.com wrote: Hi, I'm writting Selenium tests with Scala JUnit. The problem is when i try to put value in SHtml.ajaxText field. Selenium RC doesn't call my js function from this ajaxText. Not sure exactly what you mean by the above, but IIRC, the ajax request is not triggered by simply setting a value in a field but when you exit the field (onBlur). Also note that the fields usually get a unique id for each new page view. To get stable identifiers you should run in test mode (see the list for details) I'll be interested in your results as we probably have to do something similar soon :-) /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. -- 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: JUnit test using Selenium RC
thanks a lot Jeppe, selSession.fireEvent(edit_field_1, blur) works it was really helpful. best regards, Darek On 3 Mar, 13:11, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: Ok, What happens if you, manually, type in new value in the field (only the text, don't press enter, dont click etc)?? My guess is nothing (unless you've added your own keyboard event handlers). And this is what your selenium test does. If so take a look herehttp://www.eviltester.com/index.php/2009/01/24/how-i-learned-to-love-... I think you need to add something like this to the test to trigger the ajax call: selSession.fireEvent(edit_field_1, blur); /Jeppe On Wed, Mar 3, 2010 at 12:48 PM, Tweek d.sztwio...@gmail.com wrote: okej, so: i've got code like this: var testStr : String = def set(s : String) : JsCmd ={ println(s) testStr = s JsRaw() } def render(ns : NodeSeq) : NodeSeq ={ bind(fields, ns, name - SHtml.ajaxText(testStr, (s : String) = setName(s) ) % (id - name), ... } and JUnit test with Selenium like this: class FirstSeleniumTest extends SeleneseTestCase { // �...@before override def setUp: Unit = { super.setUp(http://localhost:8080/;, *firefox) selenium.windowMaximize() } // �...@after override def tearDown: Unit = { selenium.close } // �...@test def testFirst = { selenium.open(/) selenium.waitForPageToLoad(3) selenium.`type`(name,new value) ... } } finally i'm running it from maven by: mvn test - Dtest=FirstSeleniumTest (jetty is running in other console) all of this is looking fine, selenium is working, new value is put in my ajaxText field, but the setName function is not call - i'm not get any log in console where jetty is running On 3 Mar, 10:40, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On Wed, Mar 3, 2010 at 10:30 AM, Tweek d.sztwio...@gmail.com wrote: Hi, I'm writting Selenium tests with Scala JUnit. The problem is when i try to put value in SHtml.ajaxText field. Selenium RC doesn't call my js function from this ajaxText. Not sure exactly what you mean by the above, but IIRC, the ajax request is not triggered by simply setting a value in a field but when you exit the field (onBlur). Also note that the fields usually get a unique id for each new page view. To get stable identifiers you should run in test mode (see the list for details) I'll be interested in your results as we probably have to do something similar soon :-) /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 athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Converting a rails application to lift
Thank your the code snippet. It's a lot cleaner than what I have. I'll wait for the official implementation so as not to get into an IP / copyright issues. Thanks again for posting. Cheers, Achint On Mar 2, 8:32 pm, Jonathan Hoffman jonhoff...@gmail.com wrote: I'm sure you've got this covered, but I've also had this requirement and used something like this:http://gist.github.com/320200 On Mar 2, 2010, at 4:01 PM, Achint Sandhu wrote: Ticket created - https://liftweb.assembla.com/spaces/liftweb/tickets/390-request-for-t... Thank You. Cheers, Achint On Mar 2, 3:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You can assign the ticket to me because I have code for such fields that I can contribute. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 11:56 AM, Achint Sandhu achint.san...@gmail.comwrote: Hi, I'm new to scala (2.7.7) and lift (2.0-M2) and as a learning exercise have taken on the translation of an existing rails project into a lift application. There are two things I have run into that I'm hoping the more experienced members of the list can give me a hand with: 1) Is there a trait in lift that creates and manages an equivalent of the createdAt and updatedAt fields that rails provides? I'm thinking something along the lines of IdPK, but have been unable to find anything. There's nothing right now. Feel encouraged to open a ticket athttps://liftweb.assembla.com/spaces/liftweb/ticketsfora feature request. 2) I've been following the wiki article on setting up One-to-Many relationships (http://wiki.github.com/dpp/liftweb/how-to-work-with-one- to-many-relationshipshttp://wiki.github.com/dpp/liftweb/how-to-work-with-one-%0Ato-many-re...) and am running into a difference in behaviour. Following the example, if I look at anAuthor.books, I get back a List of Book objects, however when I look at aBook.author, I get back a Long with the ID of the Author. I would expect aBook.author to return an Author object. I've copied and pasted the example in the wiki, to make sure that it wasn't my implementation. Other than that, so far, it's gone extremely well and I was able to get something up and running very quickly which really is a testament to the design of the framework. Thanks. Cheers, Achint -- 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 athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Converting a rails application to lift
There is no problem with the .obj syntax, just that I found it a little un-natural given how it works in the other direction (anAuthor.books). I've raised a ticket as per David's request. On Mar 2, 8:19 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Yes, because, as in the database, essentially it's a MappedLong (for example), with support built on top of it (via trait mixins) to lookup and cache the referenced entity. Is there a problem with the .obj syntax? - Achint Sandhuachint.san...@gmail.com wrote: Hi, Is there any reason why aBook.author would not simply return a Box instead of requiring aBook.author.obj to get the Box ? I'm sure there is a really good reason for this and I'm just trying to get an understanding of the underlying reasoning. Thanks. Cheers, Achint On Mar 2, 3:26 pm, Mads Hartmann Jensen mads...@gmail.com wrote: On 02/03/2010, at 20.56, Achint Sandhu wrote: Hi, I'm new to scala (2.7.7) and lift (2.0-M2) and as a learning exercise have taken on the translation of an existing rails project into a lift application. There are two things I have run into that I'm hoping the more experienced members of the list can give me a hand with: 1) Is there a trait in lift that creates and manages an equivalent of the createdAt and updatedAt fields that rails provides? I'm thinking something along the lines of IdPK, but have been unable to find anything. 2) I've been following the wiki article on setting up One-to-Many relationships (http://wiki.github.com/dpp/liftweb/how-to-work-with-one- to-many-relationships) and am running into a difference in behaviour. Following the example, if I look at anAuthor.books, I get back a List of Book objects, however when I look at aBook.author, I get back a Long with the ID of the Author. I would expect aBook.author to return an Author object. I've copied and pasted the example in the wiki, to make sure that it wasn't my implementation. You should be able to get the object by calling aBook.author.obj - this should return a Box[Author] so you could get it like this aBook.author.obj match { case Full(a) = a // do something with the autor case Empty = // if the box is empty, handle it somehow case _ = // should cover everyhting else, Failure etc } Hope it helps Other than that, so far, it's gone extremely well and I was able to get something up and running very quickly which really is a testament to the design of the framework. Thanks. Cheers, Achint -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] minified js artifacts (was Re: Re-opened #363)
A quick followup on this minified js concern... The initial reason why I reopened still holds [1] Marius and I had a quick chat on this point over IM where we agreed to take it up separate from this particular ticket and see if we can arrive at a consensus. Conventionally, Lift keeps the un-minified js artifacts in the git repository and yuicompressor minifies them at build time. The templates still keep on referring to the un-minfied form (json2.js, jquery.js etc.) but ResourceServer/JSArtifact does the magic of rewriting the request path to serve the minified js created at build time. While JQuery13Artifacts follows this convention (references jquery-1.3.2-min.js generated at build time), JQuery14Artifacts doesn't (reference jquery-1.4.2.min.js as distributed from jQuery.com). Consequently, src/main/resources/toserve contains jquery-1.3.2.js (the un-minified form) but jquery-1.4.2.min.js (the minified form) [2]. This is clearly inconsistent and confusing unless one is aware of the build-time trick. So the question is, should we: 1. Continue using yuicompressor (to compress js files at build time) and apply the strategy universally to all toserve/**/*.js OR 2. Include the minified version of the js artifacts and get rid of the build time compression trick While #1 has the clear advantage of having human-readable js files in the repository, it is critically dependent on build time compression. Exact opposite set of argument holds for #2. And since we are debating on this, the other option could be: 3. Keep both the form (un-minified and minified) available in resources/toserve and serve the un-minified form via gzip filter if user-agent has support for it (most does nowadays) or resort to minified form if user-agent doesn't. The behavior could be controlled via LiftRules even. Of course, this assumes that most production sites would be behind reverse proxies with proper cache control etc. and the overhead of gzip-ing is marginal. Bringing the decision (of minifying) in the framework realm also opens up the possibility of lazily creating one big js (synthetic or cached) and serving the entire stuff as one single response minified or otherwise depending on run.mode. Thoughts? - Indrajit [1] http://www.assembla.com/spaces/liftweb/tickets/363?page=1#comment%3A2 [2] It still contains the vestigial jquery-1.4.1.js which needs to be removed after today's release On 01/03/10 3:00 AM, Indrajit Raychaudhuri wrote: I reopened #363 because according to Lift convention, JQuery14Artifacts should actually refer to the compressed version of jquery-1.4.2 min that is generated by yuicompressor-maven-plugin (and not minified version available for download). Marius, let me know if you agree to this, if not we should actually go the other way round for the other bundled js (like jquery 1.3) as well to be consistent. Cheers, Indrajit -- 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] minified js artifacts (was Re: Re-opened #363)
Indrajit Raychaudhuri indraj...@gmail.com writes: A quick followup on this minified js concern... [...] So the question is, should we: 1. Continue using yuicompressor (to compress js files at build time) and apply the strategy universally to all toserve/**/*.js OR 2. Include the minified version of the js artifacts and get rid of the build time compression trick While #1 has the clear advantage of having human-readable js files in the repository, it is critically dependent on build time compression. Exact opposite set of argument holds for #2. Or 2.5: use 1. for the js artifacts included with Lift and let the user decide how to handle their own js files. I would hate to be forced into using the yui compressor for my own files that I put in toserve (not that it isn't a good idea :-) And since we are debating on this, the other option could be: 3. Keep both the form (un-minified and minified) available in resources/toserve and serve the un-minified form via gzip filter if user-agent has support for it (most does nowadays) or resort to minified form if user-agent doesn't. But gzip doesn't remove the need for minify. Gzipped minified jQuery is 40% smaller than gzipped jQuery: http://stackoverflow.com/questions/807119/gzip-versus-minify The behavior could be controlled via LiftRules even. Of course, this assumes that most production sites would be behind reverse proxies with proper cache control etc. and the overhead of gzip-ing is marginal. Bringing the decision (of minifying) in the framework realm also opens up the possibility of lazily creating one big js (synthetic or cached) and serving the entire stuff as one single response minified or otherwise depending on run.mode. Yes this would be the ideal and has been discussed on the list recently. /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.
Re: [Lift] Transactions with Mapper
Probally worth sticking this on the wiki Cheers, Tim Sent from my iPhone On 2 Mar 2010, at 14:37, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: ced docpom...@googlemail.com writes: When I use Mapper outside a request, say in an actor, how do I wrap it in a transaction? I know that I do a S.addAround(DB.buildLoanWrapper) to have transactions within a request. Can anyone provide a simple code snippet? You can use use :-) DB.use(DefaultConnectionIdenfifier) {connection = User.findAll } /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 . -- 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] minified js artifacts (was Re: Re-opened #363)
On 03/03/10 9:21 PM, Jeppe Nejsum Madsen wrote: Indrajit Raychaudhuriindraj...@gmail.com writes: A quick followup on this minified js concern... [...] So the question is, should we: 1. Continue using yuicompressor (to compress js files at build time) and apply the strategy universally to all toserve/**/*.js OR 2. Include the minified version of the js artifacts and get rid of the build time compression trick While #1 has the clear advantage of having human-readable js files in the repository, it is critically dependent on build time compression. Exact opposite set of argument holds for #2. Or 2.5: use 1. for the js artifacts included with Lift and let the user decide how to handle their own js files. I would hate to be forced into using the yui compressor for my own files that I put in toserve (not that it isn't a good idea :-) Yep, just disable yui compressor in your application pom.xml and this would be quite the case (because lift-webkit-version.jar has already being created by now with the minified js either using #1 or #2). My interest in the current context, is to have consistent behavior in the js artifacts bundled with Lift. To me (and Marius) #2 is also worth consideration. True that you'd have a compressed (IDE unfriendly) js in the codebase but you'd also be able to remove build-time dependency on yui compressor. (one less dependency, one less step etc.) And since we are debating on this, the other option could be: 3. Keep both the form (un-minified and minified) available in resources/toserve and serve the un-minified form via gzip filter if user-agent has support for it (most does nowadays) or resort to minified form if user-agent doesn't. But gzip doesn't remove the need for minify. Gzipped minified jQuery is 40% smaller than gzipped jQuery: http://stackoverflow.com/questions/807119/gzip-versus-minify I learned this today, thank you! The behavior could be controlled via LiftRules even. Of course, this assumes that most production sites would be behind reverse proxies with proper cache control etc. and the overhead of gzip-ing is marginal. Bringing the decision (of minifying) in the framework realm also opens up the possibility of lazily creating one big js (synthetic or cached) and serving the entire stuff as one single response minified or otherwise depending on run.mode. Yes this would be the ideal and has been discussed on the list recently. I realize I have to catch up with the recent discussions, am way out of sync :( /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.
Re: [Lift] Snippets in subpackages?
On Tue, Mar 2, 2010 at 11:42 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: On 3 March 2010 00:03, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 1:05 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi, Isn't it possible to put snippets in subpackages of xxx.snippet? Something like lift:snippet type=com.acme.snippet.subpackage.SnippetClass? If not, what's the best way to deal with a large number of snippets? Explicitly registering the snippet dispatch in LiftRules is the way I'd recommend doing it. If this is less than 100% optimal for your use case, let's learn more about your use case and see if we have to expand how Snippets are looked up. Well, registering quite a lot of snippets is indeed less than 100% optimal. OK, I have got a not-so-small website with about 100 templates and snippets. The templates are organized as a tree, e.g. /login/signup/seeker, /login/signup/offerer, etc. There is not a perfect 1:1 relationship between templates and snippets, but for sake of simplicity let's assume so. Hence I would like to organize my snippets in packages according to the templates, e.g. ...snippet.login.signup.Seeker, ...snippet.login.signup.Offerer, etc. One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) But it might also be interesting to explore a model like Wickets: foo/bar/page.html - look in snippets.foo.bar in addition to the normal snippets package... would that help? Thank you, Heiko Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=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] Snippets in subpackages?
On Mar 3, 2010, at 11:25 AM, David Pollak wrote: On Tue, Mar 2, 2010 at 11:42 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: On 3 March 2010 00:03, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 1:05 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi, Isn't it possible to put snippets in subpackages of xxx.snippet? Something like lift:snippet type=com.acme.snippet.subpackage.SnippetClass? If not, what's the best way to deal with a large number of snippets? Explicitly registering the snippet dispatch in LiftRules is the way I'd recommend doing it. If this is less than 100% optimal for your use case, let's learn more about your use case and see if we have to expand how Snippets are looked up. Well, registering quite a lot of snippets is indeed less than 100% optimal. OK, I have got a not-so-small website with about 100 templates and snippets. The templates are organized as a tree, e.g. /login/signup/seeker, /login/signup/offerer, etc. There is not a perfect 1:1 relationship between templates and snippets, but for sake of simplicity let's assume so. Hence I would like to organize my snippets in packages according to the templates, e.g. ...snippet.login.signup.Seeker, ...snippet.login.signup.Offerer, etc. One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) But it might also be interesting to explore a model like Wickets: foo/bar/page.html - look in snippets.foo.bar in addition to the normal snippets package... would that help? I have wanted this for a while, I think it would be great. -Ross -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Transactions with Mapper
On Tue, Mar 2, 2010 at 5:53 AM, Timothy Perrett timo...@getintheloop.euwrote: Probally worth sticking this on the wiki Cheers, Tim Sent from my iPhone Wait... you've got a broken hand and you can still type on your iPhone?!?! :-) On 2 Mar 2010, at 14:37, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: ced docpom...@googlemail.com writes: When I use Mapper outside a request, say in an actor, how do I wrap it in a transaction? I know that I do a S.addAround(DB.buildLoanWrapper) to have transactions within a request. Can anyone provide a simple code snippet? You can use use :-) DB.use(DefaultConnectionIdenfifier) {connection = User.findAll } /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. -- 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] Snippets in subpackages?
On Wed, Mar 3, 2010 at 8:27 AM, Ross Mellgren dri...@gmail.com wrote: On Mar 3, 2010, at 11:25 AM, David Pollak wrote: On Tue, Mar 2, 2010 at 11:42 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: On 3 March 2010 00:03, David Pollak feeder.of.the.be...@gmail.comwrote: On Tue, Mar 2, 2010 at 1:05 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi, Isn't it possible to put snippets in subpackages of xxx.snippet? Something like lift:snippet type=com.acme.snippet.subpackage.SnippetClass? If not, what's the best way to deal with a large number of snippets? Explicitly registering the snippet dispatch in LiftRules is the way I'd recommend doing it. If this is less than 100% optimal for your use case, let's learn more about your use case and see if we have to expand how Snippets are looked up. Well, registering quite a lot of snippets is indeed less than 100% optimal. OK, I have got a not-so-small website with about 100 templates and snippets. The templates are organized as a tree, e.g. /login/signup/seeker, /login/signup/offerer, etc. There is not a perfect 1:1 relationship between templates and snippets, but for sake of simplicity let's assume so. Hence I would like to organize my snippets in packages according to the templates, e.g. ...snippet.login.signup.Seeker, ...snippet.login.signup.Offerer, etc. One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) But it might also be interesting to explore a model like Wickets: foo/bar/page.html - look in snippets.foo.bar in addition to the normal snippets package... would that help? I have wanted this for a while, I think it would be great. Does that mean you just signed up to write it? ;-) -Ross -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=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] Transactions with Mapper
On 03/03/10 9:58 PM, David Pollak wrote: On Tue, Mar 2, 2010 at 5:53 AM, Timothy Perrett timo...@getintheloop.eu mailto:timo...@getintheloop.eu wrote: Probally worth sticking this on the wiki Cheers, Tim Sent from my iPhone Wait... you've got a broken hand and you can still type on your iPhone?!?! :-) Guess Tim types one handed and he is not a lefty :-) On 2 Mar 2010, at 14:37, Jeppe Nejsum Madsen je...@ingolfs.dk mailto:je...@ingolfs.dk wrote: ced docpom...@googlemail.com mailto:docpom...@googlemail.com writes: When I use Mapper outside a request, say in an actor, how do I wrap it in a transaction? I know that I do a S.addAround(DB.buildLoanWrapper) to have transactions within a request. Can anyone provide a simple code snippet? You can use use :-) DB.use(DefaultConnectionIdenfifier) {connection = User.findAll } /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. -- 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.
[Lift] Re: Converting a rails application to lift
Thank you for the explanation David. I've raised a ticket as requested: http://www.assembla.com/spaces/liftweb/tickets/394-request-for-convenience-conversion-on-mappedlongforeignkey-fields Cheers, Achint On Mar 2, 8:21 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 5:09 PM, Achint Sandhu achint.san...@gmail.comwrote: Hi, Is there any reason why aBook.author would not simply return a Box instead of requiring aBook.author.obj to get the Box ? For some background, seehttp://blog.lostlake.org/index.php?/archives/19-Keeping-the-meaning-w... In Lift's Mapper fields are not flat collections of bytes like in ActiveRecord, but entities that can control access, format, etc. their values. aBook.author is the field. The field is a MappedLongForeignKey. It has lots and lots of methods on it to get, set, validate, generate forms, etc. To make things a little more convenient, the fields know how to convert themselves to their raw byte values. So a MappedLongForeignKey is a MappedField[Long] and knows how to convert itself into a Long. For example: val x: Long = aBook.author // legal But MappedLongForeignKey fields need to be explicitly converted into the object that they are keys to via the .obj method: val author: Box[Author] = aBook.author.obj I guess it would be nice to write a convenience conversion to make: val author: Box[Author] = aBook.author legal. Feel free to open a ticket on this. I'm sure there is a really good reason for this and I'm just trying to get an understanding of the underlying reasoning. Thanks. Cheers, Achint On Mar 2, 3:26 pm, Mads Hartmann Jensen mads...@gmail.com wrote: On 02/03/2010, at 20.56, Achint Sandhu wrote: Hi, I'm new to scala (2.7.7) and lift (2.0-M2) and as a learning exercise have taken on the translation of an existing rails project into a lift application. There are two things I have run into that I'm hoping the more experienced members of the list can give me a hand with: 1) Is there a trait in lift that creates and manages an equivalent of the createdAt and updatedAt fields that rails provides? I'm thinking something along the lines of IdPK, but have been unable to find anything. 2) I've been following the wiki article on setting up One-to-Many relationships ( http://wiki.github.com/dpp/liftweb/how-to-work-with-one- to-many-relationships) and am running into a difference in behaviour. Following the example, if I look at anAuthor.books, I get back a List of Book objects, however when I look at aBook.author, I get back a Long with the ID of the Author. I would expect aBook.author to return an Author object. I've copied and pasted the example in the wiki, to make sure that it wasn't my implementation. You should be able to get the object by calling aBook.author.obj - this should return a Box[Author] so you could get it like this aBook.author.obj match { case Full(a) = a // do something with the autor case Empty = // if the box is empty, handle it somehow case _ = // should cover everyhting else, Failure etc } Hope it helps Other than that, so far, it's gone extremely well and I was able to get something up and running very quickly which really is a testament to the design of the framework. Thanks. Cheers, Achint -- 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. -- 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] minified js artifacts (was Re: Re-opened #363)
Info about yuicompressor-maven-plugin : * could aggregate js * could be configured to avoid minified some files * could generate minified under src with suffix (default -min) * could generate the gzip version and avoid doing it at runtime * could be invoked only in a profile (for release) or from command line when you want to minified (without being attached to a phase) * also compress/minified css * also check js validity (jslint) Disclaimer : * I'm the guy who introduce yuicompressor into lift build * I'm the guy who wrap yuicompressor into a maven plugin, to have unminified into my source and minified into war. see http://alchim.sourceforge.net/yuicompressor-maven-plugin/ /davidB On Wed, Mar 3, 2010 at 17:23, Indrajit Raychaudhuri indraj...@gmail.com wrote: On 03/03/10 9:21 PM, Jeppe Nejsum Madsen wrote: Indrajit Raychaudhuriindraj...@gmail.com writes: A quick followup on this minified js concern... [...] So the question is, should we: 1. Continue using yuicompressor (to compress js files at build time) and apply the strategy universally to all toserve/**/*.js OR 2. Include the minified version of the js artifacts and get rid of the build time compression trick While #1 has the clear advantage of having human-readable js files in the repository, it is critically dependent on build time compression. Exact opposite set of argument holds for #2. Or 2.5: use 1. for the js artifacts included with Lift and let the user decide how to handle their own js files. I would hate to be forced into using the yui compressor for my own files that I put in toserve (not that it isn't a good idea :-) Yep, just disable yui compressor in your application pom.xml and this would be quite the case (because lift-webkit-version.jar has already being created by now with the minified js either using #1 or #2). My interest in the current context, is to have consistent behavior in the js artifacts bundled with Lift. To me (and Marius) #2 is also worth consideration. True that you'd have a compressed (IDE unfriendly) js in the codebase but you'd also be able to remove build-time dependency on yui compressor. (one less dependency, one less step etc.) And since we are debating on this, the other option could be: 3. Keep both the form (un-minified and minified) available in resources/toserve and serve the un-minified form via gzip filter if user-agent has support for it (most does nowadays) or resort to minified form if user-agent doesn't. But gzip doesn't remove the need for minify. Gzipped minified jQuery is 40% smaller than gzipped jQuery: http://stackoverflow.com/questions/807119/gzip-versus-minify I learned this today, thank you! The behavior could be controlled via LiftRules even. Of course, this assumes that most production sites would be behind reverse proxies with proper cache control etc. and the overhead of gzip-ing is marginal. Bringing the decision (of minifying) in the framework realm also opens up the possibility of lazily creating one big js (synthetic or cached) and serving the entire stuff as one single response minified or otherwise depending on run.mode. Yes this would be the ideal and has been discussed on the list recently. I realize I have to catch up with the recent discussions, am way out of sync :( /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. -- 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] minified js artifacts (was Re: Re-opened #363)
Indrajit Raychaudhuri indraj...@gmail.com writes: [...] My interest in the current context, is to have consistent behavior in the js artifacts bundled with Lift. To me (and Marius) #2 is also worth consideration. True that you'd have a compressed (IDE unfriendly) js in the codebase but you'd also be able to remove build-time dependency on yui compressor. (one less dependency, one less step etc.) But why is it a problem with the build-time dependency on yui compressor if it only concerns the building of the lift-*.jar? Or am I missing something? Ideally the lift jars should contain both, and the non-minified used in development. /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.
Re: [Lift] Snippets in subpackages?
David Pollak feeder.of.the.be...@gmail.com writes: [...] One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) That's actually a neat trick! I've been using this as well, but more in a CRUDify style way. I'm still trying to come up with some good ways to organize this in a modular fashion... /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.
Re: [Lift] minified js artifacts (was Re: Re-opened #363)
On 03/03/10 10:21 PM, Jeppe Nejsum Madsen wrote: Indrajit Raychaudhuriindraj...@gmail.com writes: [...] My interest in the current context, is to have consistent behavior in the js artifacts bundled with Lift. To me (and Marius) #2 is also worth consideration. True that you'd have a compressed (IDE unfriendly) js in the codebase but you'd also be able to remove build-time dependency on yui compressor. (one less dependency, one less step etc.) But why is it a problem with the build-time dependency on yui compressor if it only concerns the building of the lift-*.jar? Or am I missing something? No question with the worthiness of yui-compressor as such, it does the job perfectly and great for the purpose :) It about when to use it. If we are using it to minify the set of third party js files (jquery, json etc.) repeatedly which never change we might as well consider keeping the minified form directly. Hence the worthiness behind consideration. Note that Lift's internal js files (e.g., jlift.js) are fine going the yui-compressor route. But more than anything, we need to be consistently following either of these (particularly for the 3rd party js artifacts). Ideally the lift jars should contain both, and the non-minified used in development. Yes, better. Which actually led to the other thought (#3). But git should contain only one form in that case (the un-minified one). /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] Re: Snippets in subpackages?
Yep, that would help a lot! Heiko On Wednesday, March 3, 2010, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 11:42 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: On 3 March 2010 00:03, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 1:05 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi, Isn't it possible to put snippets in subpackages of xxx.snippet?Something like lift:snippet type=com.acme.snippet.subpackage.SnippetClass? If not, what's the best way to deal with a large number of snippets? Explicitly registering the snippet dispatch in LiftRules is the way I'd recommend doing it. If this is less than 100% optimal for your use case, let's learn more about your use case and see if we have to expand how Snippets are looked up. Well, registering quite a lot of snippets is indeed less than 100% optimal. OK, I have got a not-so-small website with about 100 templates and snippets. The templates are organized as a tree, e.g. /login/signup/seeker, /login/signup/offerer, etc. There is not a perfect 1:1 relationship between templates and snippets, but for sake of simplicity let's assume so. Hence I would like to organize my snippets in packages according to the templates, e.g. ...snippet.login.signup.Seeker, ...snippet.login.signup.Offerer, etc. One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) But it might also be interesting to explore a model like Wickets: foo/bar/page.html - look in snippets.foo.bar in addition to the normal snippets package... would that help? Thank you, Heiko Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=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. -- Heiko Seeberger Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Snippets in subpackages?
On Wed, Mar 3, 2010 at 9:30 AM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Yep, that would help a lot! Cool. Please open a ticket and assign it to Ross... if he wants, he can assign it to me or you. ;-) Heiko On Wednesday, March 3, 2010, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 11:42 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: On 3 March 2010 00:03, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 1:05 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi, Isn't it possible to put snippets in subpackages of xxx.snippet?Something like lift:snippet type=com.acme.snippet.subpackage.SnippetClass? If not, what's the best way to deal with a large number of snippets? Explicitly registering the snippet dispatch in LiftRules is the way I'd recommend doing it. If this is less than 100% optimal for your use case, let's learn more about your use case and see if we have to expand how Snippets are looked up. Well, registering quite a lot of snippets is indeed less than 100% optimal. OK, I have got a not-so-small website with about 100 templates and snippets. The templates are organized as a tree, e.g. /login/signup/seeker, /login/signup/offerer, etc. There is not a perfect 1:1 relationship between templates and snippets, but for sake of simplicity let's assume so. Hence I would like to organize my snippets in packages according to the templates, e.g. ...snippet.login.signup.Seeker, ...snippet.login.signup.Offerer, etc. One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) But it might also be interesting to explore a model like Wickets: foo/bar/page.html - look in snippets.foo.bar in addition to the normal snippets package... would that help? Thank you, Heiko Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=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. -- Heiko Seeberger Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=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: Snippets in subpackages?
On Wed, Mar 3, 2010 at 10:08 AM, Ross Mellgren dri...@gmail.com wrote: Haha okay okay I'll write it, but *you* have to review it ;-) Will do. -Ross On Mar 3, 2010, at 12:37 PM, David Pollak wrote: On Wed, Mar 3, 2010 at 9:30 AM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Yep, that would help a lot! Cool. Please open a ticket and assign it to Ross... if he wants, he can assign it to me or you. ;-) Heiko On Wednesday, March 3, 2010, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 11:42 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: On 3 March 2010 00:03, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 1:05 PM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Hi, Isn't it possible to put snippets in subpackages of xxx.snippet?Something like lift:snippet type=com.acme.snippet.subpackage.SnippetClass? If not, what's the best way to deal with a large number of snippets? Explicitly registering the snippet dispatch in LiftRules is the way I'd recommend doing it. If this is less than 100% optimal for your use case, let's learn more about your use case and see if we have to expand how Snippets are looked up. Well, registering quite a lot of snippets is indeed less than 100% optimal. OK, I have got a not-so-small website with about 100 templates and snippets. The templates are organized as a tree, e.g. /login/signup/seeker, /login/signup/offerer, etc. There is not a perfect 1:1 relationship between templates and snippets, but for sake of simplicity let's assume so. Hence I would like to organize my snippets in packages according to the templates, e.g. ...snippet.login.signup.Seeker, ...snippet.login.signup.Offerer, etc. One of the things I do with page-specific snippets is call them out in SiteMap: Loc(..., Snippet(foo, snipetFunc)) But it might also be interesting to explore a model like Wickets: foo/bar/page.html - look in snippets.foo.bar in addition to the normal snippets package... would that help? Thank you, Heiko Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=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. -- Heiko Seeberger Company: weiglewilczek.com Blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=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.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
[Lift] Re: minified js artifacts (was Re: Re-opened #363)
I like Jeppe's option: Or 2.5: use 1. for the js artifacts included with Lift and let the user decide how to handle their own js files. I would hate to be forced into using the yui compressor for my own files that I put in toserve (not that it isn't a good idea :-) This lets us keep plain js source in Lift (makes upgrading included js artifacts easier and gives nicer diffs) while giving the user complete control over their own files (e.g. perhaps they don't want a file minified in test mode so that they can more easily track method calls via Firebug). Peter On Mar 3, 9:19 am, Indrajit Raychaudhuri indraj...@gmail.com wrote: On 03/03/10 10:21 PM, Jeppe Nejsum Madsen wrote: Indrajit Raychaudhuriindraj...@gmail.com writes: [...] My interest in the current context, is to have consistent behavior in the js artifacts bundled with Lift. To me (and Marius) #2 is also worth consideration. True that you'd have a compressed (IDE unfriendly) js in the codebase but you'd also be able to remove build-time dependency on yui compressor. (one less dependency, one less step etc.) But why is it a problem with the build-time dependency on yui compressor if it only concerns the building of the lift-*.jar? Or am I missing something? No question with the worthiness of yui-compressor as such, it does the job perfectly and great for the purpose :) It about when to use it. If we are using it to minify the set of third party js files (jquery, json etc.) repeatedly which never change we might as well consider keeping the minified form directly. Hence the worthiness behind consideration. Note that Lift's internal js files (e.g., jlift.js) are fine going the yui-compressor route. But more than anything, we need to be consistently following either of these (particularly for the 3rd party js artifacts). Ideally the lift jars should contain both, and the non-minified used in development. Yes, better. Which actually led to the other thought (#3). But git should contain only one form in that case (the un-minified one). /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] Re: Specs not finding classes in tests from maven
Just wanted to share the cause of this in case anyone else bangs their head against it for several days like me. I had several issues: 1. The surefire plugin definition was in my reporting node in my pom (d'oh!) 2. It wasn't set to always fork -- setting configuration/forkMode to always All is well now, but I've switched to scalatest from specs -- seems to be cleaner and more like the rspec world I love in rails. Hope that helps someone On Mar 2, 2:47 pm, sdillard spencer.dill...@gmail.com wrote: I am thoroughly confused on this one, so any help is greatly appreciated. I am using eclipse and my directory structure looks like this: src/main/scala - com.xxx.web.model Client.scala src/test/scala - com.xxx.web.model ClientSpecs.scala I can run the specs when I run the project as a JUnit test, but if I run it as maven test, I am getting NoClassDefFoundError exceptions (partial stacktrace below). Obviously maven is not finding the output from the classes to execute the tests, but I can't figure out why, since JUnit is doing fine with it. They ran fine 2 days ago but I did a massive overhaul of my project namespacing and upgrading dependencies, and now I am getting this. I am using scala 2.7.7, junit 4.7, lift 2.0 M2, and specs 1.6.2. And what's odd is that I have 2 libraries that I build separately (jar file targets, not war files) that run fine with maven test. Any ideas are hugely appreciated! --- Test set: com.sharperfinancial.web.model.PeriodResultSpecsAsTest --- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.513 sec FAILURE! PeriodResult should Store values Time elapsed: 0.01 sec ERROR! org.specs.runner.UserError: java.lang.NoClassDefFoundError: com/ sharperfinancial/web/model/PeriodResult at com.sharperfinancial.web.model.PeriodResultSpecs$$anonfun$1$ $anonfun$apply$1.apply(PeriodResultSpecs.scala:26) at com.sharperfinancial.web.model.PeriodResultSpecs$$anonfun$1$ $anonfun$apply$1.apply(PeriodResultSpecs.scala:25) at org.specs.specification.LifeCycle $class.withCurrent(ExampleLifeCycle.scala:60) at org.specs.specification.Examples.withCurrent(Examples.scala:52) at org.specs.specification.Examples$$anonfun$specifyExample $1.apply(Examples.scala:108) at org.specs.specification.Examples$$anonfun$specifyExample $1.apply(Examples.scala:108) at org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply $5.apply(ExampleLifeCycle.scala:212) at scala.Option.getOrElse(Option.scala:61) at org.specs.specification.LifeCycle $class.executeExpectations(ExampleLifeCycle.scala:82) at org.specs.specification.BaseSpecification.executeExpectations(BaseSpecification.scala: 56) at org.specs.specification.ExampleContext$$anonfun$executeExpectations $2$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:73) at org.specs.specification.ExampleContext$$anonfun$executeExpectations $2$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:73) at scala.Option.map(Option.scala:70) -- 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] Converting a rails application to lift
Is a syntax like this okay (inside an Author mapper)? object created extends MappedDateTime(this) with CreatedTimestamp[Author] Although if we say that timestamps are always a date-time (not date only or time only) this could be shortened to object created extends CreatedTimestamp(this) - Achint Sandhuachint.san...@gmail.com wrote: Hi, I'm new to scala (2.7.7) and lift (2.0-M2) and as a learning exercise have taken on the translation of an existing rails project into a lift application. There are two things I have run into that I'm hoping the more experienced members of the list can give me a hand with: 1) Is there a trait in lift that creates and manages an equivalent of the createdAt and updatedAt fields that rails provides? I'm thinking something along the lines of IdPK, but have been unable to find anything. 2) I've been following the wiki article on setting up One-to-Many relationships (http://wiki.github.com/dpp/liftweb/how-to-work-with-one- to-many-relationships) and am running into a difference in behaviour. Following the example, if I look at anAuthor.books, I get back a List of Book objects, however when I look at aBook.author, I get back a Long with the ID of the Author. I would expect aBook.author to return an Author object. I've copied and pasted the example in the wiki, to make sure that it wasn't my implementation. Other than that, so far, it's gone extremely well and I was able to get something up and running very quickly which really is a testament to the design of the framework. Thanks. Cheers, Achint -- 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: minified js artifacts (was Re: Re-opened #363)
Folks let's keep in mind that even now users can decide whichever version they want for the underlying js script framework. Just override override def pathRewriter: PartialFunction[List[String], List[String]] from the JsArtifacts. JQuery13Artifacts and JQuery14Artifacts are just helpers and IMHO these should point to the minified versions. Br's, Marius On 3 mar., 20:39, Peter Robinett pe...@bubblefoundry.com wrote: I like Jeppe's option: Or 2.5: use 1. for the js artifacts included with Lift and let the user decide how to handle their own js files. I would hate to be forced into using the yui compressor for my own files that I put in toserve (not that it isn't a good idea :-) This lets us keep plain js source in Lift (makes upgrading included js artifacts easier and gives nicer diffs) while giving the user complete control over their own files (e.g. perhaps they don't want a file minified in test mode so that they can more easily track method calls via Firebug). Peter On Mar 3, 9:19 am, Indrajit Raychaudhuri indraj...@gmail.com wrote: On 03/03/10 10:21 PM, Jeppe Nejsum Madsen wrote: Indrajit Raychaudhuriindraj...@gmail.com writes: [...] My interest in the current context, is to have consistent behavior in the js artifacts bundled with Lift. To me (and Marius) #2 is also worth consideration. True that you'd have a compressed (IDE unfriendly) js in the codebase but you'd also be able to remove build-time dependency on yui compressor. (one less dependency, one less step etc.) But why is it a problem with the build-time dependency on yui compressor if it only concerns the building of the lift-*.jar? Or am I missing something? No question with the worthiness of yui-compressor as such, it does the job perfectly and great for the purpose :) It about when to use it. If we are using it to minify the set of third party js files (jquery, json etc.) repeatedly which never change we might as well consider keeping the minified form directly. Hence the worthiness behind consideration. Note that Lift's internal js files (e.g., jlift.js) are fine going the yui-compressor route. But more than anything, we need to be consistently following either of these (particularly for the 3rd party js artifacts). Ideally the lift jars should contain both, and the non-minified used in development. Yes, better. Which actually led to the other thought (#3). But git should contain only one form in that case (the un-minified one). /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] Set Expires headers for certain pages, files, etc
I asked about this before: http://groups.google.com/group/liftweb/browse_thread/thread/9daa4692acbfce6/00be519d77901fb0 Can anyone suggest a good way to set Expires headers? - I'd like our images, JS and CSS to have expires headers perhaps 1 month in the future - I'd like to set certain pages' expires headers perhaps 1 day in the future This way browsers can avoid re-fetching resources (pages, images, css files etc) over and over again when they haven't changed. I managed to do this using LiftRules.defaultHeaders, but it doesn't seem to have any effect on images (we're serving them out of a /images folder). any ideas? thx - Alex -- 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] Trouble with lift-couchdb
Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING] val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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] Textmate bundle with codecompletion (beta)
Ok, This is the last time I'll bump this (I promise) - anyone using TextMate can follow the bundle on github. I improved the bundle and it's fairly usable now, check out a teaser video here: http://www.sidewayscoding.com/2010/03/textmate-lift-bundle-v02.html Thanks On 23/02/2010, at 19.08, Mads Hartmann Jensen wrote: Duh, I comittet a wrong version of the bundle to git! The right version is up now if you wan't to give it a try Indrajit :) I would appreciate the feedback: http://github.com/mads379/Lift-TextMate-Bundle On 22/02/2010, at 13.12, Mads Hartmann Jensen wrote: Don't get too excited, it's very beta right now ;) Sent from my iPhone On 22/02/2010, at 13.04, Indrajit Raychaudhuri indraj...@gmail.com wrote: Heavens! Need to give this a shot. On 22/02/10 4:55 PM, Mads Hartmann wrote: Hello everyone, I've been working a bit on a TextMate bundle for Lift projects that has codecompletion. It's still very beta but I'm sure someone would find it helpfull :) If you're interested you can read a bit more about it here: http://www.sidewayscoding.com/2010/02/lift-textmate-bundle-now-with-primitive.html NB: It's nowhere near as good as what I've seen in intelliJ (haven't tried netbeans or eclipse) but that doesn't mean it isn't helpful :) If you want to help out, please fork me on github http://github.com/mads379 -- 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] ParamFailure : why a subtype ?
Hello, I really like the use of Box (perhaps one of the best thing in lift :), safe for how it handles ParamFailure - so I'm wondering why ParamFailure is a subclass of Failure, and not a full case of Box ? Or why Failure does not have (always) an option param, like its option exception/chain ? Thanks, PS: if the answer was already given, I'm sorry, I didn't find it in ml archive -- 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.
Re: [Lift] ParamFailure : why a subtype ?
The short answer is that sometimes inheritance is better than a flat ADT. A Box can be full or empty: Full or EmptyBox An empty box can contain no additional information as to why it's empty (the Empty singleton) or it can contain more information as to why the Box is empty: Failure. Now, a Failure could have subclasses such as Failure with exception and chained Failure, but it seemed to me that there would be an explosion of subclasses, so I just chose Failure with the various parameters. Then someone pointed out that it'd be nice to carry around an HTTP response code or other data about the Failure which led to ParamFailure. Because ParamFailure is a subclass of Failure, you can pattern match on Failure and it will catch ParamFailure, but you lose the information about the parameter (just like you can match against EmptyBox if you don't care why the Box is empty) The code: implicit def handleFailure[T](value: Box[T])(implicit cvt: T = LiftResponse): Box[LiftResponse] = { value match { case ParamFailure(msg, _, _, code: Int) = Full(InMemoryResponse(msg.getBytes(UTF-8), (Content-Type - text/plain; charset=utf-8) :: Nil, Nil, code)) case Failure(msg, _, _) = Full(NotFoundResponse(msg)) case Empty = Empty case Full(x) = Full(cvt(x)) } } Gives you a good indication of how various subclasses of Box can work together to give you a nice way to write REST calls. On Wed, Mar 3, 2010 at 3:42 PM, Francois fan...@gmail.com wrote: Hello, I really like the use of Box (perhaps one of the best thing in lift :), safe for how it handles ParamFailure - so I'm wondering why ParamFailure is a subclass of Failure, and not a full case of Box ? Or why Failure does not have (always) an option param, like its option exception/chain ? Thanks, PS: if the answer was already given, I'm sorry, I didn't find it in ml archive -- 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.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] Trouble with lift-couchdb
Yep, that seems to be better. Sorry for the noise, I don't know why I didn't think to check that. Thanks for the quick answer. Craig On Mar 3, 2010, at 4:44 PM, Ross Mellgren wrote: Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING]val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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] Trouble with lift-couchdb
It's no problem, as I mentioned the compiler error is practically useless. Hope you get along well, let me know if you have any other issues. -Ross On Mar 3, 2010, at 7:29 PM, Craig Blake wrote: Yep, that seems to be better. Sorry for the noise, I don't know why I didn't think to check that. Thanks for the quick answer. Craig On Mar 3, 2010, at 4:44 PM, Ross Mellgren wrote: Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING] val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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. -- 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] Trouble with lift-couchdb
Sure, will do. The only thing I think I'll need to figure out is how to persist an enumeration by name rather than ordinal value, but I imagine that it should be pretty straight-forward to add a new field type in my app to handle it. Thanks, Craig On Mar 3, 2010, at 7:45 PM, Ross Mellgren wrote: It's no problem, as I mentioned the compiler error is practically useless. Hope you get along well, let me know if you have any other issues. -Ross On Mar 3, 2010, at 7:29 PM, Craig Blake wrote: Yep, that seems to be better. Sorry for the noise, I don't know why I didn't think to check that. Thanks for the quick answer. Craig On Mar 3, 2010, at 4:44 PM, Ross Mellgren wrote: Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING] val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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. -- 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] Trouble with lift-couchdb
Try this: /** Enum data field for JSON records. Encodes as JString */ class JSONEnumNameField[OwnerType : JSONRecord[OwnerType], EnumType : Enumeration] (rec: OwnerType, enum: EnumType)(implicit enumValueType: Manifest[EnumType#Value]) extends EnumField[OwnerType, EnumType](rec, enum) with JSONField { def this(rec: OwnerType, enum: EnumType, value: EnumType#Value)(implicit enumValueType: Manifest[EnumType#Value]) = { this(rec, enum) set(value) } def this(rec: OwnerType, enum: EnumType, value: Box[EnumType#Value])(implicit enumValueType: Manifest[EnumType#Value]) = { this(rec, enum) setBox(value) } def asJValue: JValue = valueBox.map(v = JString(v.toString)) openOr (JNothing: JValue) def fromJValue(jvalue: JValue): Box[EnumType#Value] = jvalue match { case JNothing|JNull if optional_? = setBox(Empty) case JString(s) = setBox(enum.valueOf(s) ?~ (Unknown value \ + s + \)) case other= setBox(expectedA(JString, other)) } } Let me know if it works for you. If so, I'll start the process of getting it into master as soon as I can. -Ross On Mar 3, 2010, at 8:12 PM, Craig Blake wrote: Sure, will do. The only thing I think I'll need to figure out is how to persist an enumeration by name rather than ordinal value, but I imagine that it should be pretty straight-forward to add a new field type in my app to handle it. Thanks, Craig On Mar 3, 2010, at 7:45 PM, Ross Mellgren wrote: It's no problem, as I mentioned the compiler error is practically useless. Hope you get along well, let me know if you have any other issues. -Ross On Mar 3, 2010, at 7:29 PM, Craig Blake wrote: Yep, that seems to be better. Sorry for the noise, I don't know why I didn't think to check that. Thanks for the quick answer. Craig On Mar 3, 2010, at 4:44 PM, Ross Mellgren wrote: Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING] val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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. -- 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
Re: [Lift] Trouble with lift-couchdb
Just took a minor change to compile (didn't like ?~) and I'll let you know how it goes soon. I'm running into one more problem, this time a runtime exception saving a document: java.lang.AbstractMethodError: test.Settings$updated$.encode(Ljava/lang/Object;)Ljava/lang/String; at net.liftweb.couchdb.JSONEncodedStringFieldMixin$$anonfun$asJValue$6.apply(JSONRecord.scala:319) at net.liftweb.couchdb.JSONEncodedStringFieldMixin$$anonfun$asJValue$6.apply(JSONRecord.scala:319) at net.liftweb.common.Full.map(Box.scala:330) at net.liftweb.couchd... The field is defined as: object updated extends JSONDateTimeField( this) Surely something else I missed? Craig On Mar 3, 2010, at 8:39 PM, Ross Mellgren wrote: Try this: /** Enum data field for JSON records. Encodes as JString */ class JSONEnumNameField[OwnerType : JSONRecord[OwnerType], EnumType : Enumeration] (rec: OwnerType, enum: EnumType)(implicit enumValueType: Manifest[EnumType#Value]) extends EnumField[OwnerType, EnumType](rec, enum) with JSONField { def this(rec: OwnerType, enum: EnumType, value: EnumType#Value)(implicit enumValueType: Manifest[EnumType#Value]) = { this(rec, enum) set(value) } def this(rec: OwnerType, enum: EnumType, value: Box[EnumType#Value])(implicit enumValueType: Manifest[EnumType#Value]) = { this(rec, enum) setBox(value) } def asJValue: JValue = valueBox.map(v = JString(v.toString)) openOr (JNothing: JValue) def fromJValue(jvalue: JValue): Box[EnumType#Value] = jvalue match { case JNothing|JNull if optional_? = setBox(Empty) case JString(s) = setBox(enum.valueOf(s) ?~ (Unknown value \ + s + \)) case other= setBox(expectedA(JString, other)) } } Let me know if it works for you. If so, I'll start the process of getting it into master as soon as I can. -Ross On Mar 3, 2010, at 8:12 PM, Craig Blake wrote: Sure, will do. The only thing I think I'll need to figure out is how to persist an enumeration by name rather than ordinal value, but I imagine that it should be pretty straight-forward to add a new field type in my app to handle it. Thanks, Craig On Mar 3, 2010, at 7:45 PM, Ross Mellgren wrote: It's no problem, as I mentioned the compiler error is practically useless. Hope you get along well, let me know if you have any other issues. -Ross On Mar 3, 2010, at 7:29 PM, Craig Blake wrote: Yep, that seems to be better. Sorry for the noise, I don't know why I didn't think to check that. Thanks for the quick answer. Craig On Mar 3, 2010, at 4:44 PM, Ross Mellgren wrote: Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING]val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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
Re: [Lift] Trouble with lift-couchdb
AbstractMethodError means you need to do a clean build and make sure you don't have multiple scala versions. - Craig Blakecraigwbl...@gmail.com wrote: Just took a minor change to compile (didn't like ?~) and I'll let you know how it goes soon. I'm running into one more problem, this time a runtime exception saving a document: java.lang.AbstractMethodError: test.Settings$updated$.encode(Ljava/lang/Object;)Ljava/lang/String; at net.liftweb.couchdb.JSONEncodedStringFieldMixin$$anonfun$asJValue$6.apply(JSONRecord.scala:319) at net.liftweb.couchdb.JSONEncodedStringFieldMixin$$anonfun$asJValue$6.apply(JSONRecord.scala:319) at net.liftweb.common.Full.map(Box.scala:330) at net.liftweb.couchd... The field is defined as: object updated extends JSONDateTimeField( this) Surely something else I missed? Craig On Mar 3, 2010, at 8:39 PM, Ross Mellgren wrote: Try this: /** Enum data field for JSON records. Encodes as JString */ class JSONEnumNameField[OwnerType : JSONRecord[OwnerType], EnumType : Enumeration] (rec: OwnerType, enum: EnumType)(implicit enumValueType: Manifest[EnumType#Value]) extends EnumField[OwnerType, EnumType](rec, enum) with JSONField { def this(rec: OwnerType, enum: EnumType, value: EnumType#Value)(implicit enumValueType: Manifest[EnumType#Value]) = { this(rec, enum) set(value) } def this(rec: OwnerType, enum: EnumType, value: Box[EnumType#Value])(implicit enumValueType: Manifest[EnumType#Value]) = { this(rec, enum) setBox(value) } def asJValue: JValue = valueBox.map(v = JString(v.toString)) openOr (JNothing: JValue) def fromJValue(jvalue: JValue): Box[EnumType#Value] = jvalue match { case JNothing|JNull if optional_? = setBox(Empty) case JString(s) = setBox(enum.valueOf(s) ?~ (Unknown value \ + s + \)) case other= setBox(expectedA(JString, other)) } } Let me know if it works for you. If so, I'll start the process of getting it into master as soon as I can. -Ross On Mar 3, 2010, at 8:12 PM, Craig Blake wrote: Sure, will do. The only thing I think I'll need to figure out is how to persist an enumeration by name rather than ordinal value, but I imagine that it should be pretty straight-forward to add a new field type in my app to handle it. Thanks, Craig On Mar 3, 2010, at 7:45 PM, Ross Mellgren wrote: It's no problem, as I mentioned the compiler error is practically useless. Hope you get along well, let me know if you have any other issues. -Ross On Mar 3, 2010, at 7:29 PM, Craig Blake wrote: Yep, that seems to be better. Sorry for the noise, I don't know why I didn't think to check that. Thanks for the quick answer. Craig On Mar 3, 2010, at 4:44 PM, Ross Mellgren wrote: Unfortunately the compiler error is bizarre (due to some of the type shuffling involved), but the underlying problem you're experiencing is that DateTimeFields (and therefore JSONDateTimeFields) have a storage type of Calendar, and you're trying to assign a Date to them. Try Calendar.getInstance instead of new Date() and see if that resolves it for you? -Ross On Mar 3, 2010, at 4:32 PM, Craig Blake wrote: Hi, I am getting familiar with the lift-couchdb module, and trying to put together a sample based on the tests in the module. Trying to create a record, based on this test code: def testRec1: Person = Person.createRecord.name(Alice).age(25) this is what I have: class Account extends CouchRecord[Account] { def meta = Account object created extends JSONDateTimeField(this) } object Account extends Account with CouchMetaRecord[Account] ... val account = Account.createRecord.created(new Date()) I get a compilation error: [WARNING] Test.scala:44: error: overloaded method value apply with alternatives ((net.liftweb.common.Box[_12.MyType])test.Account) forSome { val _12: object test.Account#created } and ((_13.MyType)test.Account) forSome { val _13: object test.Account#created } cannot be applied to (java.util.Date) [WARNING]val account = Account.createRecord.created( new Date()) I'm sure that I am just missing something obvious. Any ideas what? Thanks, Craig -- 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
[Lift] Newbie Q: can I manually create a LiftSession?
I'm new to Lift and am trying to use Lift within a subpath of my web application. For example, http://domain.com is an existing webapp, but my LiftFilter handles the user_mgt subpath (http://domain.com/ user_mgt/*). My existing webapp already handles user authentication, but I want to use the lost/change password functionality of Lift's MegaProtoUser. How do I create a LiftSession from my existing webapp so that I can call User.logUserIn(my_user)? I am embedding my User.logUserIn call within S.initIfUninitted like this: S.initIfUninitted(my_lift_session.openOr(** SOMETHING? **)) { User.logUserIn(user) } If a LiftSession exists, I can retrieve it and it works fine: val my_lift_session = SessionMaster.getSession(current_session_id, Empty) However, when my_lift_session is Empty, I have tried: LiftRules.sessionCreator(new provider.servlet.HTTPServletSession(current_session), )) which appears to create a new LiftSession, but when I actually navigate to a page in the subpath http://domain.com/user_mgt/change_password it doesn't recognize that I've logged in. Perhaps when I load the page http://domain.com/user_mgt/change_password it is creating a new LiftSession even though one already exists? I've been banging my head on this for a while. Any help would be greatly appreciated! dave -- 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 Web Framework 2.0 Milestone 3 released
The Lift Web Framework team is pleased to announce the framework-2.0- M3 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. NOTE: The potential *breaking changes* have been specifically marked for your reference. Please take a look at the specific issue at http://www.assembla.com/spaces/liftweb/tickets and the Lift announcement list for further details. Changes in this version include: New features: o A flag for disabling the onblur stuff for ajax calls Issue: 117. o Added toHtml method to Mapper/MetaMapper Issue: 350. o Added support for area tags Issue: 70. o Added NOT IN to Mapper query builder Issue: 353. o Enhancements to LiftActors and LRU to support Goat Rodeo Issue: 335. o ByList is uniqued before the query is built Issue: 298. o Added linkToSelf option to Menu.build snippet Issue: 343. o xxxMenuLoc methods now delegate to protected xxxMenuLocParams methods in order to get their LocParams. Issue: 251. o Extend Comet (ListenerManager) to selectively update subscribers Issue: 326. o Add DataBinding types and traits to lift-webkit Issue: 212. o Add CouchDB support (lift-couchdb) Issue: 306. o Integrate Image manipulation code to lift Issue: 285. o Add support to extract primitive values from JSON Issue: 360. o ItemsListEditor (and thus TableEditor) should warn when leaving page with unsaved changes Issue: 339. o ItemsListEditor should display items pending removal, albeit in strikeout font Issue: 302. o ItemsList.save unremoves removed unsaved items Issue: 300. o ItemsList should be have refresh method to clear added/removed without requerying database Issue: 299. o ItemsListEditor should allow custom columns Issue: 301. o ItemsListEditor should catch SQLException in ItemsList.save Issue: 340. Fixed Bugs: o Fixed a stack overflow on non-tail recursive method Issue: 393. o Allow Foreign Key support to be optional in PostgreSQL driver Issue: 387. o Scope attributes duplicated in certain cases. Fixed those cases. Issue: 373. o Better support for exceptions in DB Logging Issue: 369. o Further work to make sure control characters don't show up in XML output. Issue: 319. o Fix runtime errors in a couple of example programs Issue: 342. o Issues with template cache updating incorrectly Issue: 367. o Fixed a comparison bug in ReplaceOption (wishing for type-safety in ==) Issue: 296. o Support for Scala 2.8 deltas in the way Nodes are compared Issue: 357. o 304 responses should not include Content-Type headers Issue: 239. o Fixed misspelled keys for resource bundles: *pasword* and reset.password.confirmarion Issue: 112. o Optional fields in JSONRecord do not work without setting needAllJSONFields to false Issue: 359. o JSON deserialization fails for null value Issue: 358. o Type hints are needed in JSON serialization for non-polymorphic Map Issue: 341. o Do not serialize the internal state of a case class (JSON) Issue: 352. o Forcing Authentication not working Issue: 337. o Autocomplete never submit value Issue: 27. o Javascript DSL inconsistencies Issue: 287. o Solve CSS/JS unwanted caching Issue: 346. Changes: o Support for enhancing foreign key references in PostgreSQL 8.3+ Issue: 224. o Have minimal support for archetype:create telling user to use archetype:generate instead Issue: 238. o Internationalizing missing strings in ProtoUser Issue: 320. Thanks to Adam Warski. o Enforce Maven version 2.2.1 or higher, but lower than 3.0. Issue: 344. o lift-flot has been updated to Flot 0.6 Issue: 322. o Make OpenID support more extensible Issue: 329. o [BREAKING CHANGE] Lift Mapper (Record) camelCase to snake_case for case insensitive databases Issue: 155. o [BREAKING CHANGE] Improved logging facilities Issue: 309. o Deprecate old logging code Issue: 374. o Enhance Facebook Connect utilities and example code Issue: 336. o Add ability to use doc result of query, not just value Issue: 356. o [BREAKING CHANGE] Add Optional variants of the basic record fields Issue: 305. o Update lift-couchdb to use dispatch 0.7.1 once released Issue: 351. o [BREAKING CHANGE] LiftRules.jQueryVersion should not be there. Issue: 363. Have fun! -Lift Web Framework 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.
[Lift] Re: [Lift Announce] Lift Web Framework 2.0 Milestone 3 released
Awesome work team! A special thanks to Charles and Indrajit for spinning the build! On Wed, Mar 3, 2010 at 8:10 PM, Indrajit Raychaudhuri indraj...@gmail.comwrote: The Lift Web Framework team is pleased to announce the framework-2.0- M3 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. NOTE: The potential *breaking changes* have been specifically marked for your reference. Please take a look at the specific issue at http://www.assembla.com/spaces/liftweb/tickets and the Lift announcement list for further details. Changes in this version include: New features: o A flag for disabling the onblur stuff for ajax calls Issue: 117. o Added toHtml method to Mapper/MetaMapper Issue: 350. o Added support for area tags Issue: 70. o Added NOT IN to Mapper query builder Issue: 353. o Enhancements to LiftActors and LRU to support Goat Rodeo Issue: 335. o ByList is uniqued before the query is built Issue: 298. o Added linkToSelf option to Menu.build snippet Issue: 343. o xxxMenuLoc methods now delegate to protected xxxMenuLocParams methods in order to get their LocParams. Issue: 251. o Extend Comet (ListenerManager) to selectively update subscribers Issue: 326. o Add DataBinding types and traits to lift-webkit Issue: 212. o Add CouchDB support (lift-couchdb) Issue: 306. o Integrate Image manipulation code to lift Issue: 285. o Add support to extract primitive values from JSON Issue: 360. o ItemsListEditor (and thus TableEditor) should warn when leaving page with unsaved changes Issue: 339. o ItemsListEditor should display items pending removal, albeit in strikeout font Issue: 302. o ItemsList.save unremoves removed unsaved items Issue: 300. o ItemsList should be have refresh method to clear added/removed without requerying database Issue: 299. o ItemsListEditor should allow custom columns Issue: 301. o ItemsListEditor should catch SQLException in ItemsList.save Issue: 340. Fixed Bugs: o Fixed a stack overflow on non-tail recursive method Issue: 393. o Allow Foreign Key support to be optional in PostgreSQL driver Issue: 387. o Scope attributes duplicated in certain cases. Fixed those cases. Issue: 373. o Better support for exceptions in DB Logging Issue: 369. o Further work to make sure control characters don't show up in XML output. Issue: 319. o Fix runtime errors in a couple of example programs Issue: 342. o Issues with template cache updating incorrectly Issue: 367. o Fixed a comparison bug in ReplaceOption (wishing for type-safety in ==) Issue: 296. o Support for Scala 2.8 deltas in the way Nodes are compared Issue: 357. o 304 responses should not include Content-Type headers Issue: 239. o Fixed misspelled keys for resource bundles: *pasword* and reset.password.confirmarion Issue: 112. o Optional fields in JSONRecord do not work without setting needAllJSONFields to false Issue: 359. o JSON deserialization fails for null value Issue: 358. o Type hints are needed in JSON serialization for non-polymorphic Map Issue: 341. o Do not serialize the internal state of a case class (JSON) Issue: 352. o Forcing Authentication not working Issue: 337. o Autocomplete never submit value Issue: 27. o Javascript DSL inconsistencies Issue: 287. o Solve CSS/JS unwanted caching Issue: 346. Changes: o Support for enhancing foreign key references in PostgreSQL 8.3+ Issue: 224. o Have minimal support for archetype:create telling user to use archetype:generate instead Issue: 238. o Internationalizing missing strings in ProtoUser Issue: 320. Thanks to Adam Warski. o Enforce Maven version 2.2.1 or higher, but lower than 3.0. Issue: 344. o lift-flot has been updated to Flot 0.6 Issue: 322. o Make OpenID support more extensible Issue: 329. o [BREAKING CHANGE] Lift Mapper (Record) camelCase to snake_case for case insensitive databases Issue: 155. o [BREAKING CHANGE] Improved logging facilities Issue: 309. o Deprecate old logging code Issue: 374. o Enhance Facebook Connect utilities and example code Issue: 336. o Add ability to use doc result of query, not just value Issue: 356. o [BREAKING CHANGE] Add Optional variants of the basic record fields Issue: 305. o Update lift-couchdb to use dispatch 0.7.1 once released Issue: 351. o [BREAKING CHANGE] LiftRules.jQueryVersion should not be there. Issue: 363. Have fun! -Lift Web Framework team -- 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
[Lift] Response Optimizations too aggressive
After fielding calls as to why my UI doesn't look correctly on IE, I discovered that Lift is doing an optimization in production mode that is effectively breaking my application's compatibility for IE... To get around IE6 deficiencies, I am leveraging JQuery. For example, if I have a CSS style that uses attribute selectors, like input[type=checkbox], IE6 ignores them, but I can get JQuery to apply the style. Since this JavaScript applies to IE only, I wrap them in comments like: !--[if IE 6] script type=text/javascript id=ie6fix ... / script ![endif]-- Firefox and Chrome will ignore these, which is perfect, and only IE will pay attention (and suffer the overhead). All was working fine in dev, then came time to roll out to production and I naturally specified -Drun.mode=production. Surprisingly, production mode has an optimization that strips HTML comments from the output. Generally, I think this is a great idea -- EXCEPT if we have IE specific comments responding to an IE browser. Is there a way to modify the optimization so that IE specific comments are retained? Alternatively, can I simply disable this optimization feature so that my IE users are OK? How can I find out more about these production mode optimizations? Is there a list? I have drilled into Props.scala and I read it very carefully. I think of my environments as Dev/QA/Prod, but I think this translates best to Test/Staging/Production in Lift-speak. I am expecting that production mode optimizations are applied to both Staging (aka QA) as well as Production -- because I need to validate actual production behavior. Note that I am running 2.0-M2. -- 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] Response Optimizations too aggressive
There's a FactoryMaker in LiftRules that looks like it may do what you want -- try: LiftRules.stripComments.default = () = false -Ross On Mar 4, 2010, at 1:38 AM, aw wrote: After fielding calls as to why my UI doesn't look correctly on IE, I discovered that Lift is doing an optimization in production mode that is effectively breaking my application's compatibility for IE... To get around IE6 deficiencies, I am leveraging JQuery. For example, if I have a CSS style that uses attribute selectors, like input[type=checkbox], IE6 ignores them, but I can get JQuery to apply the style. Since this JavaScript applies to IE only, I wrap them in comments like: !--[if IE 6] script type=text/javascript id=ie6fix ... / script ![endif]-- Firefox and Chrome will ignore these, which is perfect, and only IE will pay attention (and suffer the overhead). All was working fine in dev, then came time to roll out to production and I naturally specified -Drun.mode=production. Surprisingly, production mode has an optimization that strips HTML comments from the output. Generally, I think this is a great idea -- EXCEPT if we have IE specific comments responding to an IE browser. Is there a way to modify the optimization so that IE specific comments are retained? Alternatively, can I simply disable this optimization feature so that my IE users are OK? How can I find out more about these production mode optimizations? Is there a list? I have drilled into Props.scala and I read it very carefully. I think of my environments as Dev/QA/Prod, but I think this translates best to Test/Staging/Production in Lift-speak. I am expecting that production mode optimizations are applied to both Staging (aka QA) as well as Production -- because I need to validate actual production behavior. Note that I am running 2.0-M2. -- 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] Response Optimizations too aggressive
I don't know the answer, but did you look through LiftRules to see if there's any setting about comments? - awanth...@whitford.com wrote: After fielding calls as to why my UI doesn't look correctly on IE, I discovered that Lift is doing an optimization in production mode that is effectively breaking my application's compatibility for IE... To get around IE6 deficiencies, I am leveraging JQuery. For example, if I have a CSS style that uses attribute selectors, like input[type=checkbox], IE6 ignores them, but I can get JQuery to apply the style. Since this JavaScript applies to IE only, I wrap them in comments like: !--[if IE 6] script type=text/javascript id=ie6fix ... / script ![endif]-- Firefox and Chrome will ignore these, which is perfect, and only IE will pay attention (and suffer the overhead). All was working fine in dev, then came time to roll out to production and I naturally specified -Drun.mode=production. Surprisingly, production mode has an optimization that strips HTML comments from the output. Generally, I think this is a great idea -- EXCEPT if we have IE specific comments responding to an IE browser. Is there a way to modify the optimization so that IE specific comments are retained? Alternatively, can I simply disable this optimization feature so that my IE users are OK? How can I find out more about these production mode optimizations? Is there a list? I have drilled into Props.scala and I read it very carefully. I think of my environments as Dev/QA/Prod, but I think this translates best to Test/Staging/Production in Lift-speak. I am expecting that production mode optimizations are applied to both Staging (aka QA) as well as Production -- because I need to validate actual production behavior. Note that I am running 2.0-M2. -- 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: Response Optimizations too aggressive
On Mar 3, 10:56 pm, Ross Mellgren dri...@gmail.com wrote: There's a FactoryMaker in LiftRules that looks like it may do what you want -- try: LiftRules.stripComments.default = () = false -Ross This looks promising. Alas: error: reassignment to val (I'm not familiar with FactoryMaker.) I see that LiftRules.stripComments is a val, not a var... It's unclear to me how to override this. -- 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.