[Lift] Re: Tomcat css access problem
Hi, your suggestion didn't work for me because I'm using url-rewrite in my application. Something like http://...application/parameterA/ http://...application/parameterA/parameterB/ Therefore the relative path wouldn't match. The CSSHelper function fixes the absolute path. This is important because I can deploy the same package in development / and production /applicationFolder/ environment. On 26 Aug., 23:12, Jefken De Vleesetenden Boterham cultoftheholysquir...@gmail.com wrote: Hi, Then I guess my next question is: how do you define where your css is located? I have a function that gives the location of my css in the following way: def css = link href={ S.hostAndPath+/+scripts/cd.css} rel=stylesheet type=text/css/ You shouldn't need the S.hostAndPath+/ part unless you're using fancy redirecting like I'm doing. I call that function from my main template. In fact, you shouldn't even need a function and could just use link href=relativePathToFolderContainingCSS/cd.css rel=stylesheet type=text/css/ In your case, I'd think that the relativePathToFolderContainingCSS/cd.css would be css/kungleNext.css, but I might be mistaken. - Philippe On Wed, Aug 26, 2009 at 1:23 PM, Yousry Abdallahyous...@gmail.com wrote: Hi, you are absolutely right. I use mvn jetty:run in my development environment to test the application. Than I build a package with mvn package and copy it to the tomcat webapp directory. Thank you, Yousry On 26 Aug., 12:46, Jefken De Vleesetenden Boterham cultoftheholysquir...@gmail.com wrote: Hi, I'm assuming you mean deploying under jetty and tomcat. I only know derby to be a database. How exactly do you deploy under jetty and tomcat? Personally, I use jetty for testing and deploy with mvn jetty:run, while I use tomcat on the test and production servers in which case I just drop the war file under web-apps. Thanks, Philippe On Wed, Aug 26, 2009 at 11:47 AM, Yousry Abdallahyous...@gmail.com wrote: Hi, I'm working with 1.1 snapshot (latest) and have the following problem with a local css reference: If I deploy my webapp under derby the resulting html output looks fine: link media=screen rel=stylesheet type=text/css href=/KungleNext-0.1-SNAPSHOT/css/kungleNext.css / The same application deployed under tomcat produces this buggy reference: link media=screen rel=stylesheet type=text/css href=/css/kungleNext.css / My snippet defines the ling as follows: ... link href=/css/kungleNext.css type=text/css rel=stylesheet media=screen / .. --http://pmonnaie.blogspot.com/ --http://pmonnaie.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: 1.1-SNAPSHOT issue?
Ok here's the problem stripped down. The merge happens but the head node isn't being removed from the body Let me know if you'd like it in some other format. templates-hidden/outer.html: html head meta name=description content=Head Merge Test / /head body lift:bind name=content / /body /html inner.html: lift:surround with=outer at=content head titleInner/title /head /lift:surround renders: ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html head meta content=Head Merge Test name=description / titleInner/title script type=text/javascript src=/ajax_request/liftAjax.js/ script /head body head titleInner/title /head script type=text/javascript // ![CDATA[ jQuery(document).ready(function() {liftAjax.lift_successRegisterGC ();}); var lift_page = F9839766178183WH; // ]] /script/body /html On Aug 26, 9:58 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Aug 26, 2009 at 8:32 PM, E. Biggs tacoban...@gmail.com wrote: Thanks David! My pages now render - although broken... the cause appears to be a failed head merge between my template's head and the surrounding template's head. Can you post an example of the failing use case and I'll roll it into our tests and get it works? On Aug 26, 7:51 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I've just pushed a new version live that will behave more gracefully if the xsd cannot be loaded. On Wed, Aug 26, 2009 at 7:39 PM, Justin Reardon justin.rear...@gmail.comwrote: Probably caused by this if you're in a dev environment: http://groups.google.com/group/liftweb/t/90750187a6c29c2c On Aug 26, 9:36 pm, E. Biggs tacoban...@gmail.com wrote: Hi there, I just did a mvn -U jetty:run and my site that I know was working fine before is now broken with this error displayed in the browser for any url: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.w3.org/2002/08/xhtml/xhtml1- transitional.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE xception (ErrorHandlerWrapper.java:236) com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error (ErrorHandlerWrapper.java:172) com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java:382) com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java:316) com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSche maError (XSDHandler.java:2245) com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchema (XSDHandler.java:1590) com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchem a (XSDHandler.java:438) com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema (XMLSchemaLoader.java:556) com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar (XMLSchemaLoader.java:523) com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.new Schema (SchemaFactoryImpl.java:206) javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489) javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521) net.liftweb.http.GenericValidtor.schema(LiftRules.scala:1116) net.liftweb.http.GenericValidtor.apply(LiftRules.scala:1119) net.liftweb.http.GenericValidtor.apply(LiftRules.scala:1101) net.liftweb.http.LiftSession$$anonfun$8.apply(LiftSession.scala:607) net.liftweb.http.LiftSession$$anonfun$8.apply(LiftSession.scala:607) scala.List.flatMap(List.scala:1132) net.liftweb.http.LiftSession.net $liftweb$http$LiftSession$$merge (LiftSession.scala:607) net.liftweb.http.LiftSession$$anonfun$10$$anonfun$apply$30.apply (LiftSession.scala:717) net.liftweb.http.LiftSession$$anonfun$10$$anonfun$apply$30.apply (LiftSession.scala:714) net.liftweb.util.EmptyBox.or(Box.scala:374) net.liftweb.http.LiftSession$$anonfun$10.apply(LiftSession.scala:711) net.liftweb.http.LiftSession$$anonfun$10.apply(LiftSession.scala:704) net.liftweb.util.EmptyBox.or(Box.scala:374) net.liftweb.http.LiftSession.processRequest(LiftSession.scala:704) ---SNIP--- Anybody else getting this? Or know what the problem could be? -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning
[Lift] Re: Bug in MappedEmail: emailPattern is wrong
On Thu, Aug 27, 2009 at 10:27 AM, Marc Boschma marc+lift...@boschma.cxmarc%2blift...@boschma.cx wrote: Personally I use: ^(?:[a-z0-9!#$%'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%'*+/=?^_`{|}~-]+)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*)@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$ Impressive! It still doesn't tell you if the email is real or not ;) Marc On 27/08/2009, at 9:32 AM, David Pollak wrote: Thanks. Changed and pushed to GitHub. Allow 2 hours for Maven availability. On Wed, Aug 26, 2009 at 4:15 PM, harryh har...@gmail.com wrote: What's the change to the RegEx? val emailPattern = Pattern.compile(^[a-z0-9._%-+]+@(?:[a-z0-9-]+\\.)+ [a-z]{2,4}$) note the addition of the + to the allowed characters before the @ -harryh -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] about QueryParams
there are two kinds of QueryParams in Lift, one uses raw sql clauses and the other not. My question is, when using the raw sql clauses, the security must be checked by programmer self, and declare safety by IHaveValidatedThisSQL, but when using the now raw methods, does Lift framework checks safety for us? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] error in http authetication and openid
Hi all i am new to scala and lift. while trying to do a sample project i tried to use httpauthentication code given in liftbook (7.14 authentication example) and i am getting following errors a) while using import auth._ error: value auth not found if i try using _root_.net.liftweb.http.auth._ i get error: value auth is not a member of package net.liftweb.http import _root_.net.liftweb.http.auth._ any help is appreciated i am using scala 2.7.3 final and maven 2.0.9 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Bug in MappedEmail: emailPattern is wrong
Your right... I've been thinking about that and how the current mapper only does the regex check.. could always override the validate method... Marc On 27/08/2009, at 6:39 PM, Viktor Klang wrote: On Thu, Aug 27, 2009 at 10:27 AM, Marc Boschma marc+lift...@boschma.cx wrote: Personally I use: ^(?:[a-z0-9!#$%'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%'*+/=?^_`{|}~-] +)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01- \x09\x0b\x0c\x0e-\x7f])*)@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a- z0-9](?:[a-z0-9-]*[a-z0-9])?$ Impressive! It still doesn't tell you if the email is real or not ;) Marc On 27/08/2009, at 9:32 AM, David Pollak wrote: Thanks. Changed and pushed to GitHub. Allow 2 hours for Maven availability. On Wed, Aug 26, 2009 at 4:15 PM, harryh har...@gmail.com wrote: What's the change to the RegEx? val emailPattern = Pattern.compile(^[a-z0-9._%-+]+@(?:[a-z0-9-]+\ \.)+ [a-z]{2,4}$) note the addition of the + to the allowed characters before the @ -harryh -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] some questions on lift
I am totally new and interested in scala lift. what I have is a little Java knowledge. Aftering reading to-do application at the website, I got the following questions: 1) where and how to setup database? the tutorial never mentions database setup, 2) how does lift support database migration? the tutorial says to use Schemifier, but what I am thinking is if I remove a column, merge db columns, etc. how does lift handle? or, where may I find such instructiion? 3) internationalization support. how does lift support this? 4) how does lift compare to Grails? I have some experience on Grails. Developer may build an app in a extremely fast way. but, lift looks not as fast as Grails. The speed I mentioned is not app performance, I am talking about speed to build an app. Forgive me if above questions are dummies. but it is really helpful for a real beginner like me. Thanks for any help on these questions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: about QueryParams
On Thu, Aug 27, 2009 at 2:12 AM, XiaomingZheng xiaomingzhen...@gmail.comwrote: there are two kinds of QueryParams in Lift, one uses raw sql clauses and the other not. My question is, when using the raw sql clauses, the security must be checked by programmer self, and declare safety by IHaveValidatedThisSQL, but when using the now raw methods, does Lift framework checks safety for us? These queries use prepared statements and uses setString/setInt/etc. to set each of the parameters. This means that SQL injection attacks are impossible unless there is a bug in the underlying JDBC driver. When you create your own String for a query and do some thing like: select * from foo where name = '+name+', you've created a huge SQL injection hole. If someone entered their name as fred' or id = 33 or name = 'fred then they could fish for record 33. If the query is built using By() (e.g., By(Foo.name, name)), then no matter what the name, you're not going to get an SQL injection attack. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: some questions on lift
Tim has a magic articles bag :) On Aug 27, 4:20 pm, Timothy Perrett timo...@getintheloop.eu wrote: Checkout my article here on how to localize with Lift: http://is.gd/1NXGN Cheers, Tim On 27/08/2009 14:08, surfman chinasmile...@gmail.com wrote: 3) internationalization support. how does lift support this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: some questions on lift
Checkout my article here on how to localize with Lift: http://is.gd/1NXGN Cheers, Tim On 27/08/2009 14:08, surfman chinasmile...@gmail.com wrote: 3) internationalization support. how does lift support this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Props.userName minor minor minor suggestion
As Props.userName is public, it would be good if it didn't include a trailing . in the return value. I see why it does for use in toTry but as a user of Lift it was a surprise to ask for Props.userName and see the . on the end. The same applies for Props.hostName (even though there's S.hostName) and maybe Props.modeName. This came about because I was customizing a logging environment to use the SMTP Appender and I wanted to include a username and hostname as the sender of the SMTP error message. I was happy to spot Props.userName (thank you IDE code completion) but confused to get a value of richard. not richard as my username. It is, of course trivial to get the values without the . on the end, but just as a principle of least surprise it might be an idea to drop the trailing . on these methods. Or make them private? :-O Cheers Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] GAE (google apps engine) Lift Eclipse Setup
Hi, I have a working GAE Scala Eclipse setup based on: http://penguinparens.blogspot.com/2009/04/further-steps-scalagwtapp-engineeclipse.html How do I integrate the Lift framework from: http://github.com/ymnk/liftweb/tree/master thanks Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: some questions on lift
HAHA - indeed I do... I've written so many articles on lift now I forget what stuff is in the bag ;-) Perhaps this will also be helpful: http://is.gd/sfyT To be honest, ive not done a great deal with Mapper so someone else will have to help you there (I usually use JPA) Cheers, Tim On 27/08/2009 14:32, marius d. marius.dan...@gmail.com wrote: Tim has a magic articles bag :) On Aug 27, 4:20 pm, Timothy Perrett timo...@getintheloop.eu wrote: Checkout my article here on how to localize with Lift: http://is.gd/1NXGN Cheers, Tim On 27/08/2009 14:08, surfman chinasmile...@gmail.com wrote: 3) internationalization support. how does lift support this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Small wiki contribution for log4j configuration
What's the protocol for making a Wiki contribution: just go in and do it? Turns out I'm not that brave. I've pulled together the start of a logging wiki entry, just covering what is (for me) the common case. I've put it here for the moment... http://github.com/d6y/brightontide/wikis/configuring-logging ...because I wanted to experiment with the mark up language -- the project has nothing to do with Lift. The old wiki content isn't quite right for what I'm seeing in 1.1 these days w.r.t modeName (http://wiki.liftweb.net/index.php/HowTo_configure_logging) Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: some questions on lift
On Thu, Aug 27, 2009 at 6:08 AM, surfman chinasmile...@gmail.com wrote: I am totally new and interested in scala lift. what I have is a little Java knowledge. Aftering reading to-do application at the website, I got the following questions: 1) where and how to setup database? the tutorial never mentions database setup, Your DB is defined in the DBVendor object found in Boot.scala. By default, it uses Derby, but you can, via a properties file or changing the code in DBVendor, choose whatever RDBMS you want to point you Lift mapper classes to. Alternatively, you can use JPA or other existing persistence mechanisms. 2) how does lift support database migration? the tutorial says to use Schemifier, but what I am thinking is if I remove a column, merge db columns, etc. how does lift handle? or, where may I find such instructiion? Each table and field has callbacks that are invoked during schemification. Sorry... there's precious little documentation on Schemifier... care to contribute some? 3) internationalization support. how does lift support this? 4) how does lift compare to Grails? I have some experience on Grails. Developer may build an app in a extremely fast way. but, lift looks not as fast as Grails. The speed I mentioned is not app performance, I am talking about speed to build an app. I have little experience with Grails, but my Rails experience (2 years) led me to develop Lift. I find that building Lift apps (especially Ajax and Comet apps) is radically faster than with Rails. In terms of CRUD apps, I think Lift compares reasonably well with Rails, especially since Naftoli's recent contributions. Thanks, David Forgive me if above questions are dummies. but it is really helpful for a real beginner like me. Thanks for any help on these questions. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: GAE (google apps engine) Lift Eclipse Setup
On Thu, Aug 27, 2009 at 7:49 AM, Andreas andreas.heissenber...@gmail.comwrote: Hi, I have a working GAE Scala Eclipse setup based on: http://penguinparens.blogspot.com/2009/04/further-steps-scalagwtapp-engineeclipse.html How do I integrate the Lift framework from: http://github.com/ymnk/liftweb/tree/master Not in direct answer to your question, but please use the main Lift distribution at http://github.com/dpp/liftweb/tree/master No fork is officially supported and the latest fixes will be in the dpp/liftweb repository. thanks Andreas -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Props.userName minor minor minor suggestion
On Thu, Aug 27, 2009 at 7:07 AM, Richard Dallaway dalla...@gmail.comwrote: As Props.userName is public, it would be good if it didn't include a trailing . in the return value. I see why it does for use in toTry but as a user of Lift it was a surprise to ask for Props.userName and see the . on the end. The same applies for Props.hostName (even though there's S.hostName) and maybe Props.modeName. This came about because I was customizing a logging environment to use the SMTP Appender and I wanted to include a username and hostname as the sender of the SMTP error message. I was happy to spot Props.userName (thank you IDE code completion) but confused to get a value of richard. not richard as my username. It is, of course trivial to get the values without the . on the end, but just as a principle of least surprise it might be an idea to drop the trailing . on these methods. Or make them private? :-O Thanks for the suggestion. See http://github.com/dpp/liftweb/commit/10ff1518f66a15e4f4b06157c49acaacb3a4c9cb Cheers Richard -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] (beginner question) Liftweb View folder
Hello, *Problem* I'm new to Lift/Scala and trying to understand/experiment with Lift's View folder. I've not gotten past a 404 error on the browser (as it relates to the View folder; templates render fine). *Background/Environment* I've been reading Exploring Lift (~Section 3.7) along with What's the 'View' folder for? from http://wiki.liftweb.net/index.php/FAQ. Following are the URL and corresponding class (in the View Folder and adapted from http://github.com/dpp/liftweb/... herehttp://github.com/dpp/liftweb/blob/be8f0c4ea9eb0f145e0452cc6100943b7f4888cf/sites/example/src/main/scala/net/liftweb/example/view/XmlFun.scala). The server is maven/jetty. I'm struggling to find other reading materials/examples which highlight my error(s); any help is appreciated. Thanks! Dan ~~~ URL: http://localhost:8080/XmlFun/index package org.delreino.simplyLift.view import _root_.scala.xml.{Text, Node, NodeSeq} import _root_.net.liftweb.http._ import S._ import _root_.net.liftweb.util._ class XmlFun extends LiftView { def dispatch = Map(index - render _) def render = { println (XmlFun) Full( lift:surround with=default at=content pXMLFun/p /lift:surround) } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Newbie Question design pattern for ORM in Lift
I am using Lift 1.0 with the Mapper ORM module from Lift. I am a newbie to Scala and Lift. I have auto-generated my ORM classes from a .sql file. Given that these classes are auto-generated I would prefer not to edit them directly and provide additional functionality via inheritance. Say I have the following... class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK { def getSingleton = StatGenerated object errors extends MappedLong(this) object hits extends MappedLong(this) object AB extends MappedLong(this) } object StatGenerated extends StatGenerated with LongKeyedMetaMapper [StatGenerated] { override def fieldOrder = List(errors, hits) } class Statistics extends StatGenerated { def GetBattingAverage(id : Long) : float = { val stat = Stat.findByKey(id) stat.hits/stat.AB } } Now what I would like to do is work with the Statistics class as my ORM object... But I believe everything that is ORM related is actually of type StatGenerated rather than Statistics. i.e. findByKey will return me a StatGenerated rather than a Statistics class. Is there any clever way around this that I am missing without either modifying the generated class or duplicating code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Newbie Question design pattern for ORM in Lift
With a parser combinator I wrote to parse .sql and it outputs scala orm files. Please note it is very specific to my needs (i.e. only works with certain grammars (INSERTS) but that particular grammar is all I needed to process at the time) but is written in a way that could be extended to the full grammar (at least that was my intent :).. On Aug 27, 1:09 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: How do you auto-generate them? On Thu, Aug 27, 2009 at 1:03 PM, rstradling ryanstradl...@gmail.com wrote: I am using Lift 1.0 with the Mapper ORM module from Lift. I am a newbie to Scala and Lift. I have auto-generated my ORM classes from a .sql file. Given that these classes are auto-generated I would prefer not to edit them directly and provide additional functionality via inheritance. Say I have the following... class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK { def getSingleton = StatGenerated object errors extends MappedLong(this) object hits extends MappedLong(this) object AB extends MappedLong(this) } object StatGenerated extends StatGenerated with LongKeyedMetaMapper [StatGenerated] { override def fieldOrder = List(errors, hits) } class Statistics extends StatGenerated { def GetBattingAverage(id : Long) : float = { val stat = Stat.findByKey(id) stat.hits/stat.AB } } Now what I would like to do is work with the Statistics class as my ORM object... But I believe everything that is ORM related is actually of type StatGenerated rather than Statistics. i.e. findByKey will return me a StatGenerated rather than a Statistics class. Is there any clever way around this that I am missing without either modifying the generated class or duplicating code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ajax in ToDo application hanging
I'm running tests from Firefox running locally, Chrome running locally and Safari running remotely to see if I can reproduce the issue (I'm running against Lift 1.1-SNAPSHOT) On Thu, Aug 27, 2009 at 4:38 AM, Dorinel dorinel.munte...@gmail.com wrote: I was implementing application from http://liftweb.net/docs/getting_started/mod_master.html By the way,it's a great tutorial for lift much better than those which were before and it explains a lot of things in comments clearly, thank you for creating it. But when I left the todo application for about 2-3 hours, the ajax which allows editing of the ToDo items stopped working. When I click on checkbox it doesn't resort all items, the same it doesn't resort (or redraw) when I'm changing priority from dropdown menu. Also when I click desc to edit it - I can edit it but the result is not saved and it doesn't exit edit mode when I'm editing another item. When I do some actions, like checking a checkbox it seems that on server side I have new rows like these: INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1 Milliseconds Ajax starts working when I'm adding new todo item (because page reloads) or I'm logging of and on. I've replicated this bug by leaving todo application running for night and it was the same ajax not working when I wake up. Is this a known bug, or I have done something wrong when I typed ToDo application from tutorial? -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: SparkLines broken in 1.1-SNAPSHOT
Fixed. Thanks! On Wed, Aug 26, 2009 at 10:28 PM, jon jonhoff...@gmail.com wrote: Hi, Looks like the JS is being double escaped. Changed following methods to fix: def onLoad(id: String, graphStyle: SparklineStyle.Value, data: JsArray, opts: JsObj) : NodeSeq = { head script type=text/javascript src={/ + LiftRules.resourceServerPath + /sparklines/sparklines.min.js}/ { Script(OnLoad(sparkExp(id, graphStyle, data, opts))) } /head } def toJsExp(id: String, graphStyle: SparklineStyle.Value, data: JsArray, opts: JsObj): JsExp = JsRaw( new + graphStyle + ( + id.encJs + , + data.toJsCmd + , + opts.toJsCmd + ).draw()) - Jon -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Overriding widgets stylesheets
Someone encountered the problem where he couldn't override the stylesheet used by some widget. Damn I can't find any more that thread ... Anyways here it is: 1. Include the widget in your application say monthview. 2. The url to the stylesheet is: /classpath/calendars/monthview/ style.css 3. In order to override this put your changed style.css in WEB-INF/ classes/toserve/calendars/monthview/style.css This works for me. Br's, Marius --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: 1.1-SNAPSHOT issue?
Many thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modularization of Lift code
David, Returning menu items from your init function is OK, but forces the user of your module to guess on function-call order, or be forced to glean it from the source, which he should not be required to do. Putting code such as this, instead, in your init function helps, but does not eliminate that problem. val sitemap = LiftRules.siteMap match { case Full(sm) = LiftRules.setSiteMap(SiteMap(sm.menus ::: Role.menus:_* )) case _ = LiftRules.setSiteMap(SiteMap(Role.menus:_*)) } With it, you can sort of standardize your call-order, requiring that the init function be called immediately before S.addAround(DB.buildLoanWrapper) in Boot,scala. But, there is a larger issue at stake here, I fear, and that is that true modularization requires adherence to rules of encapsulation and complete documentation, two things that are problematic in Scala code (perhaps due to its power and complexity), unlike pure OOP. When I've written before on this subject in this group, I've gotten a lot of examples in the small purporting to dispute my contention, but falling short. If you know I'm wrong, fine ... let's see it. If you just think I am, well...think harder. This is not small potatoes There are plenty of languages on the dust heap precisely because of the extension problem. Glenn... On Aug 26, 2:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Aug 26, 2009 at 10:13 AM, glenn gl...@exmbly.com wrote: Timothy, I'm still not convinced that Lift applications can be modularized as simply as you suggest. Do you have any samples of your MyLib.init? How do you handle the non- PF's, like schemify and setSiteMap? I typically return my menu items from my init function. You can call schemifier from within your init function. As for templates, I've learned that you can use the templating mechanism in Loc to eliminate the need for html files, but that's only a small part of the problem. Glenn... On Jul 27, 4:01 pm, Timothy Perrett timo...@getintheloop.eu wrote: Hi Glen... I actually do a lot of this - we have a product at work and i've just written a bunch of abstractions for work which just require me to do: MyLib.init In the boot file of a new application and then everything wires up - I couldn't think of anything more straightforward? The vast majority of stuff in lift is done with PF's, so you can pretty much just write them in external jars, and import them - my 3rd part stuff usually has a lift-webkit dependency so that I can just do the LiftRules.disptach.append stuff directly in the init method, but its really no biggy and saves boilerplate. So given your example, this scheme should work right? Cheers, Tim On Jul 27, 11:52 pm, glenn gl...@exmbly.com wrote: I'm interested in abstracting out useful features from my Lift applications for ease of reuse, but I haven't found an easy way to do it. I find myself creating a new Lift aplication for each feature, with all the baggage (bootstrapping, etc.), and I then have to do a lot of code modification to the application I'm adding the feature to in order to get it to work. For example, suppose I want to add role-based user login to an application that already has a User model just by dropping in a jar file with the new feature. I don't see how to do it without some boostrapping modifications. Has anyone really tried to modularize their Lift development. I'd be very interested in some suggestions. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Small wiki contribution for log4j configuration
Richard, Our new wiki is at http://wiki.github.com/dpp/liftweb You're encouraged to copy stuff from the old wiki to the new wiki and update content that's out of date and enhance any content. Thanks, David On Thu, Aug 27, 2009 at 7:56 AM, Richard Dallaway dalla...@gmail.comwrote: What's the protocol for making a Wiki contribution: just go in and do it? Turns out I'm not that brave. I've pulled together the start of a logging wiki entry, just covering what is (for me) the common case. I've put it here for the moment... http://github.com/d6y/brightontide/wikis/configuring-logging ...because I wanted to experiment with the mark up language -- the project has nothing to do with Lift. The old wiki content isn't quite right for what I'm seeing in 1.1 these days w.r.t modeName (http://wiki.liftweb.net/index.php/HowTo_configure_logging) Richard -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Small wiki contribution for log4j configuration
Looks great to me! Add it to the lift wiki with the prefix How To: as that follows our convention. Cheers, Tim On 27/08/2009 15:56, Richard Dallaway dalla...@gmail.com wrote: What's the protocol for making a Wiki contribution: just go in and do it? Turns out I'm not that brave. I've pulled together the start of a logging wiki entry, just covering what is (for me) the common case. I've put it here for the moment... http://github.com/d6y/brightontide/wikis/configuring-logging ...because I wanted to experiment with the mark up language -- the project has nothing to do with Lift. The old wiki content isn't quite right for what I'm seeing in 1.1 these days w.r.t modeName (http://wiki.liftweb.net/index.php/HowTo_configure_logging) Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ajax in ToDo application hanging
I've reproduced and fixed this issue. Thanks for reporting it. On Thu, Aug 27, 2009 at 9:13 AM, David Pollak feeder.of.the.be...@gmail.com wrote: I'm running tests from Firefox running locally, Chrome running locally and Safari running remotely to see if I can reproduce the issue (I'm running against Lift 1.1-SNAPSHOT) On Thu, Aug 27, 2009 at 4:38 AM, Dorinel dorinel.munte...@gmail.comwrote: I was implementing application from http://liftweb.net/docs/getting_started/mod_master.html By the way,it's a great tutorial for lift much better than those which were before and it explains a lot of things in comments clearly, thank you for creating it. But when I left the todo application for about 2-3 hours, the ajax which allows editing of the ToDo items stopped working. When I click on checkbox it doesn't resort all items, the same it doesn't resort (or redraw) when I'm changing priority from dropdown menu. Also when I click desc to edit it - I can edit it but the result is not saved and it doesn't exit edit mode when I'm editing another item. When I do some actions, like checking a checkbox it seems that on server side I have new rows like these: INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1 Milliseconds Ajax starts working when I'm adding new todo item (because page reloads) or I'm logging of and on. I've replicated this bug by leaving todo application running for night and it was the same ajax not working when I wake up. Is this a known bug, or I have done something wrong when I typed ToDo application from tutorial? -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modularization of Lift code
On Thu, Aug 27, 2009 at 11:22 AM, glenn gl...@exmbly.com wrote: David, Returning menu items from your init function is OK, but forces the user of your module to guess on function-call order I don't understand... what function call order are you talking about? The order in which the modules are initialized? Something else? , or be forced to glean it from the source, which he should not be required to do. Putting code such as this, instead, in your init function helps, but does not eliminate that problem. What particular problem? val sitemap = LiftRules.siteMap match { case Full(sm) = LiftRules.setSiteMap(SiteMap(sm.menus ::: Role.menus:_* )) case _ = LiftRules.setSiteMap(SiteMap(Role.menus:_*)) } Where are you proposing to put this code? With it, you can sort of standardize your call-order, requiring that the init function be called immediately before Just to be precise, init() is a method on your module. It's not a function. S.addAround(DB.buildLoanWrapper) in Boot,scala. But, there is a larger issue at stake here, I fear, and that is that true modularization requires adherence to rules of encapsulation and complete documentation, two things that are problematic in Scala code (perhaps due to its power and complexity), unlike pure OOP. Ummm... as far as I know, Scala is a pure OO language. Everything in Scala is either the instance of a class (and object, but object is overloaded with Scala's use of it as a keyword for singleton) or a method. There is nothing else in Scala. In this way, Scala is like Smalltalk and Ruby. It's not like Java where things exist in Java that are neither an instance nor a method (static methods, primitive types, etc.) There is nothing that we can't do in Scala to encapsulate anything... the issue that I see is what do you want to encapsulate? When I've written before on this subject in this group, I've gotten a lot of examples in the small purporting to dispute my contention, but falling short. If you know I'm wrong, fine ... let's see it. If you just think I am, well...think harder. Let's separate Lift from Scala the language for a moment. I'm no expert in PLT so I'm not going to argue encapsulation in Scala. I can argue about Lift's modularization and what its limitations are. The following things in Lift I know to be non-modular: - Mapper: because one cannot subclass Mapper definitions, it's not really modular. Yes, I've built (and subclassed) ProtoUser, but it's a huge hack and anything serious (e.g., subclassing an existing mapper and *changing* the behavior of one on the fields) is not doable with Mapper. This is basically because I've never meant Mapper to be a serious OR mapping tool, but more of an ActiveRecord clone where you can create a mapping between an RDBMS and some sort of record. I use Mapper very successfully, but it's not meant for the same things OO is meant for (subclassing) or what Mixins are meant for. - SiteMap: SiteMap is frozen at boot time. This means that OSGi modules can't load and unload themselves and mutate the sitemap. Because the sitemap is fixed at boot time, it's also not possible for a module to insert menu items at an appropriate place in the menu hierarchy. - LiftRules: like SiteMap, the LiftRules are fixed at boot time. It's not possible for modules to load/unload dynamically and change the various PFs dynamically. I have a plan for fixing the LiftRules stuff so we can fully support OSGi modules. I will likely extend that to supporting more dynamic sitemaps. More broadly, every time I've had Scala code that's concrete and needed to be made more runtime dynamic, the process has been simple, quick, and painless. Breaking classes into traits and composing those traits into different runtime configurations has by and large been a few minute to few hour project. Yeah, it may be considered poor mans DI to use traits and the cake pattern, but I find that the type safety that Scala offers makes the small extract Scala coding effort to be worth it vs. writing more tests/configuring more runtime stuff/the weird errors that creep into the code despite tests. This is not small potatoes There are plenty of languages on the dust heap precisely because of the extension problem. Can you be very detailed about what kind of problems you're seeing. Maybe the folks on this list can help you work through them and maybe we'll all discover new Scala patterns. Thanks, David Glenn... On Aug 26, 2:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Aug 26, 2009 at 10:13 AM, glenn gl...@exmbly.com wrote: Timothy, I'm still not convinced that Lift applications can be modularized as simply as you suggest. Do you have any samples of your MyLib.init? How do you handle the non- PF's, like schemify and setSiteMap? I typically return my menu items from my init
[Lift] has anyone seen this exception?
Has anyone seen this error? I get it while transforming a Stream into a String. The stream is from an http request I just made. Message: java.io.IOException: Premature EOF sun.net.www.http.ChunkedInputStream.readAheadBlocking (ChunkedInputStream.java:556) sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java: 600) sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) java.io.FilterInputStream.read(FilterInputStream.java:133) sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read (HttpURLConnection.java:2419) sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) java.io.InputStreamReader.read(InputStreamReader.java:184) java.io.BufferedReader.fill(BufferedReader.java:153) java.io.BufferedReader.readLine(BufferedReader.java:316) java.io.BufferedReader.readLine(BufferedReader.java:379) com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Newbie Question design pattern for ORM in Lift
Thanks for the answers everyone. What David hit upon about wanting objects to be subclassible is the conclusion I came to that would work..if it existed. I was hoping there was a way. :(. Well, I guess Naftoli has provided a possible solution but seems more involved than I have the experience for. I will resort to putting the stuff on the generated classes and let merge tools do the rest. Regarding sharing the codeI should be more specific in that it parses ddl. To be honest, I hope you all are not hoping for muchbut I will get it up on github and when I do will reply to this thread with the location. On Aug 27, 1:35 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Aug 27, 2009 at 10:26 AM, rstradling ryanstradl...@gmail.comwrote: With a parser combinator I wrote to parse .sql and it outputs scala orm files. Care to share? That'd be a pretty darned useful utility! Please note it is very specific to my needs (i.e. only works with certain grammars (INSERTS) but that particular grammar is all I needed to process at the time) but is written in a way that could be extended to the full grammar (at least that was my intent :).. So... the problem is that objects in Scala are not subclassible. What does this mean? For example: trait Foo { object bar extends AnyRef } trait MyFoo extends Foo { override object bar { def cantDoIt = sigh } } Back in the Scala 2.5 days, there was some talk about allowing this to happen, but it never did. So, unfortunately, I can't think of a way for your sql generator to create a superclass that could be subclassed and have the effect that you want. Sorry/ On Aug 27, 1:09 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: How do you auto-generate them? On Thu, Aug 27, 2009 at 1:03 PM, rstradling ryanstradl...@gmail.com wrote: I am using Lift 1.0 with the Mapper ORM module from Lift. I am a newbie to Scala and Lift. I have auto-generated my ORM classes from a .sql file. Given that these classes are auto-generated I would prefer not to edit them directly and provide additional functionality via inheritance. Say I have the following... class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK { def getSingleton = StatGenerated object errors extends MappedLong(this) object hits extends MappedLong(this) object AB extends MappedLong(this) } object StatGenerated extends StatGenerated with LongKeyedMetaMapper [StatGenerated] { override def fieldOrder = List(errors, hits) } class Statistics extends StatGenerated { def GetBattingAverage(id : Long) : float = { val stat = Stat.findByKey(id) stat.hits/stat.AB } } Now what I would like to do is work with the Statistics class as my ORM object... But I believe everything that is ORM related is actually of type StatGenerated rather than Statistics. i.e. findByKey will return me a StatGenerated rather than a Statistics class. Is there any clever way around this that I am missing without either modifying the generated class or duplicating code? -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift transactions
On Wed, Aug 26, 2009 at 4:03 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Hi, I'm using POJT (plain old JDBC transactions :-) with a single db. I would like to: 1) Manually rollback changes if some validations fail 2) Have the tx rolled back if an error happens I think 1) can be achieved by DB.rollback(DefaultConnectionIdentifier), but in general, how do I get the current connection active for the request? DB.use(DefaultConnectionIdentifier) { superConn = } 2) I think can be implemented by adding a handler to LiftRules.exceptionHandler and perform the steps in 1). Actually, this used to be done automatically... and somehow the code that did it went away... sigh. Lemme see if I can check something in that'll fix the situation. Are there any better ways to handle this? /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Contributing to Lift
Hi all, I am a Smalltalker, looking to transition into Scala and Lift. How can I contribute to Lift? Thanks, Tim Dion http://www.linkedin.com/pub/tim-dion-csdp/1/785/208 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: has anyone seen this exception?
This happens sometimes when the client disconnects before the communications with the server is complete. I see them from time to time and they indicate to me that the Internet is a random place. On Thu, Aug 27, 2009 at 12:06 PM, jack jack.wid...@gmail.com wrote: Has anyone seen this error? I get it while transforming a Stream into a String. The stream is from an http request I just made. Message: java.io.IOException: Premature EOF sun.net.www.http.ChunkedInputStream.readAheadBlocking (ChunkedInputStream.java:556) sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java: 600) sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) java.io.FilterInputStream.read(FilterInputStream.java:133) sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read (HttpURLConnection.java:2419) sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) java.io.InputStreamReader.read(InputStreamReader.java:184) java.io.BufferedReader.fill(BufferedReader.java:153) java.io.BufferedReader.readLine(BufferedReader.java:316) java.io.BufferedReader.readLine(BufferedReader.java:379) com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12) -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Something you might find useful: easy lazy loading of page sections
Nice! David Pollak wrote: This is nifty... I think it's worthy of inclusion in Lift. Thanks for the suggestion! On Wed, Aug 26, 2009 at 2:44 PM, harryh har...@gmail.com mailto:har...@gmail.com wrote: Let's say you have a bit of a page like so: lift:SomeSnippet.section foo:name/ lift:SomeSnippet.section Now, let's assume that computing whatever is bound to foo:name/ takes a long time (maybe it takes a network call, or a long database query, or whatever). You don't want to hold up your entire page view on that so. lift:Util.lazyLoad lift:SomeSnippet.section foo:name/ lift:SomeSnippet.section /lift:Util.lazyLoad Then in your Util snippet: def lazyLoad(xhtml: NodeSeq) = { val id = lazy+System.currentTimeMillis() val (name, exp) = ajaxInvoke(() = { SetHtml(id, xhtml) }) div id={id} img src=/img/ajax_spinner.gif height=32 width=32 alt=wait/ {Script(OnLoad(exp.cmd))} /div } Feel free to critique if there is a better way of doing this. It's working pretty good for me so far though. -harryh -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Multiple sites, same login
This is good to know about. Thanks! Marc Boschma wrote: Maybe https://opensso.dev.java.net/ might be of interest? Might also be a bit of work... Marc On 26/08/2009, at 2:53 AM, Charles F. Munat wrote: Now this is an interesting idea. I'll think about it... Thanks! Chas. David Pollak wrote: On Mon, Aug 24, 2009 at 3:23 PM, Charles F. Munat c...@munat.com mailto:c...@munat.com wrote: I'm building two Lift applications that access the same back end database -- one is for the public site, and the other, which will use a subdomain, is for administration of the public site. A third application will access a separate database, but will be related to the previous two sites. Any suggestions as to how I might have one login that keeps the user logged in across all these sites? Obviously, OpenID would work, and there's complex stuff involving LDAP servers, etc., but I'd like to keep it fairly simple. Ideas? You could put a cookie at the top level for the domain that's an encrypted mix of the user's primary key and the current time. If the user comes to another one of the sites, it could examine the cookie and see if it should create a session for the user. Thanks! Chas. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: (beginner question) Liftweb View folder
On Thu, Aug 27, 2009 at 9:49 AM, Daniel Nelson dpn53...@gmail.com wrote: Hello, *Problem* I'm new to Lift/Scala and trying to understand/experiment with Lift's View folder. I've not gotten past a 404 error on the browser (as it relates to the View folder; templates render fine). I'd suggest using Lift 1.1-SNAPSHOT... you would have likely gotten a polite error message. In this case, I believe you have to add XmlFun/index to your sitemap in Boot.scala *Background/Environment* I've been reading Exploring Lift (~Section 3.7) along with What's the 'View' folder for? from http://wiki.liftweb.net/index.php/FAQ. Following are the URL and corresponding class (in the View Folder and adapted from http://github.com/dpp/liftweb/... herehttp://github.com/dpp/liftweb/blob/be8f0c4ea9eb0f145e0452cc6100943b7f4888cf/sites/example/src/main/scala/net/liftweb/example/view/XmlFun.scala). The server is maven/jetty. I'm struggling to find other reading materials/examples which highlight my error(s); any help is appreciated. Thanks! Dan ~~~ URL: http://localhost:8080/XmlFun/index package org.delreino.simplyLift.view import _root_.scala.xml.{Text, Node, NodeSeq} import _root_.net.liftweb.http._ import S._ import _root_.net.liftweb.util._ class XmlFun extends LiftView { def dispatch = Map(index - render _) def render = { println (XmlFun) Full( lift:surround with=default at=content pXMLFun/p /lift:surround) } } -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] lift request param
For the laboratory website I am building I need to keep track of batches of samples as they are being processed, and would like to do so with a request parameter in the URL. Right now, I am manually adding this parameter to every link: object batch extends MappedLong(this) { override def displayName = Batch override def asHtml: Node = a href={/analysis/ipbatchsamples? batch=+batch.is}Batch {is}/a } There must be a way with lift to pass this batch information along without having to store it on the server, but being new to lift I haven't been able to find it. Can someone point me in the right direction? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Newbie Question design pattern for ORM in Lift
How do you auto-generate them? On Thu, Aug 27, 2009 at 1:03 PM, rstradling ryanstradl...@gmail.com wrote: I am using Lift 1.0 with the Mapper ORM module from Lift. I am a newbie to Scala and Lift. I have auto-generated my ORM classes from a .sql file. Given that these classes are auto-generated I would prefer not to edit them directly and provide additional functionality via inheritance. Say I have the following... class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK { def getSingleton = StatGenerated object errors extends MappedLong(this) object hits extends MappedLong(this) object AB extends MappedLong(this) } object StatGenerated extends StatGenerated with LongKeyedMetaMapper [StatGenerated] { override def fieldOrder = List(errors, hits) } class Statistics extends StatGenerated { def GetBattingAverage(id : Long) : float = { val stat = Stat.findByKey(id) stat.hits/stat.AB } } Now what I would like to do is work with the Statistics class as my ORM object... But I believe everything that is ORM related is actually of type StatGenerated rather than Statistics. i.e. findByKey will return me a StatGenerated rather than a Statistics class. Is there any clever way around this that I am missing without either modifying the generated class or duplicating code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift Record Documentation
On Thu, Aug 27, 2009 at 11:48 AM, inca incarn...@whiteants.net wrote: Ok, thanks. Another question then. As far as I can see from sources, basic KeyedRecord trait depends on some Mapper classes. Does Record use Mapper for JDBC operations under the covers? Yes. On 27 авг, 01:25, Timothy Perrett timo...@getintheloop.eu wrote: Its not the primary ORM at the moment. Although, its developing, and its still simply awesome if you are not using JDBC storage. If you just need regular JDBC style connectivity, then use Mapper for now. Cheers, Tim On 26/08/2009 19:01, inca incarn...@whiteants.net wrote: Is there any documentation available for Lift Record Framework? From liftbook: The Record framework is relatively new to Lift. The plan is to move to Record as the primary ORM framework for Lift sometime after version 1.0. Is it the primary ORM now? -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Contributing to Lift
On Thu, Aug 27, 2009 at 9:41 AM, Tim Dion tim_d...@yahoo.com wrote: Hi all, I am a Smalltalker, looking to transition into Scala and Lift. Welcome. How can I contribute to Lift? Initially by asking questions and then helping to document the answers on the wiki. Then by answering the questions of others on this mailing list. We place a premium on helping newbies become productive with Lift. Let's take that as a starter. Also, it looks like you're San Francisco based... I rarely say, No to folks who offer to by me lunch. ;-) Thanks, Tim Dion http://www.linkedin.com/pub/tim-dion-csdp/1/785/208 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modularization of Lift code
David, Besides the very detailed discussion here about the problems of Boot initialization and the immutability of sitemap and liftrules, that strikes me as a sufficient barrier to real modularization. I hadn't thought about turning reuseable code into traits and assigning those around in jar files until you mentioned it. Not a bad idea. But I wouldn't feel comfortable incorporating third-party traits in my code unless I had the source to fall back on. Example of poor encapsulation - just the fact that you can encapsulate snippets and templates. Without the source, how can a user ever hope to incorporate those. And then, to make them private, which is done...that's turning a headache into a nightmare. Yeah, as long as you work at the source-level, there is no problem. But that, in-and-of itself, is the problem. As you suggest, some, as yet unilluminated patterns, would be most helpful. Glenn... On Aug 27, 12:11 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Aug 27, 2009 at 11:22 AM, glenn gl...@exmbly.com wrote: David, Returning menu items from your init function is OK, but forces the user of your module to guess on function-call order I don't understand... what function call order are you talking about? The order in which the modules are initialized? Something else? , or be forced to glean it from the source, which he should not be required to do. Putting code such as this, instead, in your init function helps, but does not eliminate that problem. What particular problem? val sitemap = LiftRules.siteMap match { case Full(sm) = LiftRules.setSiteMap(SiteMap(sm.menus ::: Role.menus:_* )) case _ = LiftRules.setSiteMap(SiteMap(Role.menus:_*)) } Where are you proposing to put this code? With it, you can sort of standardize your call-order, requiring that the init function be called immediately before Just to be precise, init() is a method on your module. It's not a function. S.addAround(DB.buildLoanWrapper) in Boot,scala. But, there is a larger issue at stake here, I fear, and that is that true modularization requires adherence to rules of encapsulation and complete documentation, two things that are problematic in Scala code (perhaps due to its power and complexity), unlike pure OOP. Ummm... as far as I know, Scala is a pure OO language. Everything in Scala is either the instance of a class (and object, but object is overloaded with Scala's use of it as a keyword for singleton) or a method. There is nothing else in Scala. In this way, Scala is like Smalltalk and Ruby. It's not like Java where things exist in Java that are neither an instance nor a method (static methods, primitive types, etc.) There is nothing that we can't do in Scala to encapsulate anything... the issue that I see is what do you want to encapsulate? When I've written before on this subject in this group, I've gotten a lot of examples in the small purporting to dispute my contention, but falling short. If you know I'm wrong, fine ... let's see it. If you just think I am, well...think harder. Let's separate Lift from Scala the language for a moment. I'm no expert in PLT so I'm not going to argue encapsulation in Scala. I can argue about Lift's modularization and what its limitations are. The following things in Lift I know to be non-modular: - Mapper: because one cannot subclass Mapper definitions, it's not really modular. Yes, I've built (and subclassed) ProtoUser, but it's a huge hack and anything serious (e.g., subclassing an existing mapper and *changing* the behavior of one on the fields) is not doable with Mapper. This is basically because I've never meant Mapper to be a serious OR mapping tool, but more of an ActiveRecord clone where you can create a mapping between an RDBMS and some sort of record. I use Mapper very successfully, but it's not meant for the same things OO is meant for (subclassing) or what Mixins are meant for. - SiteMap: SiteMap is frozen at boot time. This means that OSGi modules can't load and unload themselves and mutate the sitemap. Because the sitemap is fixed at boot time, it's also not possible for a module to insert menu items at an appropriate place in the menu hierarchy. - LiftRules: like SiteMap, the LiftRules are fixed at boot time. It's not possible for modules to load/unload dynamically and change the various PFs dynamically. I have a plan for fixing the LiftRules stuff so we can fully support OSGi modules. I will likely extend that to supporting more dynamic sitemaps. More broadly, every time I've had Scala code that's concrete and needed to be made more runtime dynamic, the process has been simple, quick, and painless. Breaking classes into traits and composing those traits into different runtime configurations has by and large been a few minute to few hour project. Yeah,
[Lift] weirdness with stateful snippets and multiple forms on the page
Are stateful snippets considered a good way to do multi-step wizard like interfaces? They seem like a good fit, but I'm running into 1 annoying problem. I'm seeting things up so in my .html file I have something like this: lift:MyPage.stepOne form=POST // HTML for step 1 /lift:MyPage.stepOne lift:MyPage.stepTwo // HTML for step 2 /lift:MyPage.stepTwo Then in the MyPage StatefulSnippet I return NodeSeq.Empty for 1 step, and actual contents for the other. The only issue is that for the inactive steps HTML like the following gets sent to the browser: form action=/my_page method=postinput name=F110858803410EI0 type=hidden value=true //form This isn't a huge deal really, but it's kind of annoying. It almost seems like that a lift: element with a form attribute shouldn't generate the form if the snippet function returns NodeSeq.Empty -harryh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Contributing to Lift
Without doubt the most accesible way would be with writing wiki articles... We really lack documentation. Provided you have a github account you can get cracking straight away :-) Cheers, Tim Sent from my iPhone On 27 Aug 2009, at 17:41, Tim Dion tim_d...@yahoo.com wrote: Hi all, I am a Smalltalker, looking to transition into Scala and Lift. How can I contribute to Lift? Thanks, Tim Dion http://www.linkedin.com/pub/tim-dion-csdp/1/785/208 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ajax in ToDo application hanging
On Thu, Aug 27, 2009 at 3:19 PM, Dorinel dorinel.munte...@gmail.com wrote: It's great! By the way, by default ToDo application runs on 1.1-SNAPSHOT? I think it uses 1.0 by default... but I prefer 1.1-SNAPSHOT because it's got the most developer-friend features. On Aug 27, 9:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I've reproduced and fixed this issue. Thanks for reporting it. On Thu, Aug 27, 2009 at 9:13 AM, David Pollak feeder.of.the.be...@gmail.com wrote: I'm running tests from Firefox running locally, Chrome running locally and Safari running remotely to see if I can reproduce the issue (I'm running against Lift 1.1-SNAPSHOT) On Thu, Aug 27, 2009 at 4:38 AM, Dorinel dorinel.munte...@gmail.com wrote: I was implementing application from http://liftweb.net/docs/getting_started/mod_master.html By the way,it's a great tutorial for lift much better than those which were before and it explains a lot of things in comments clearly, thank you for creating it. But when I left the todo application for about 2-3 hours, the ajax which allows editing of the ToDo items stopped working. When I click on checkbox it doesn't resort all items, the same it doesn't resort (or redraw) when I'm changing priority from dropdown menu. Also when I click desc to edit it - I can edit it but the result is not saved and it doesn't exit edit mode when I'm editing another item. When I do some actions, like checking a checkbox it seems that on server side I have new rows like these: INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1 Milliseconds Ajax starts working when I'm adding new todo item (because page reloads) or I'm logging of and on. I've replicated this bug by leaving todo application running for night and it was the same ajax not working when I wake up. Is this a known bug, or I have done something wrong when I typed ToDo application from tutorial? -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Small wiki contribution for log4j configuration
Thanks David, Thanks Tim I've added the page, and also copied over what appears to be relevant from the old wiki page. http://wiki.github.com/dpp/liftweb/how-to-configure-logging Right: back to some coding now... Cheers Richard On Thu, Aug 27, 2009 at 5:34 PM, Timothy Perretttimo...@getintheloop.eu wrote: Looks great to me! Add it to the lift wiki with the prefix How To: as that follows our convention. Cheers, Tim On 27/08/2009 15:56, Richard Dallaway dalla...@gmail.com wrote: What's the protocol for making a Wiki contribution: just go in and do it? Turns out I'm not that brave. I've pulled together the start of a logging wiki entry, just covering what is (for me) the common case. I've put it here for the moment... http://github.com/d6y/brightontide/wikis/configuring-logging ...because I wanted to experiment with the mark up language -- the project has nothing to do with Lift. The old wiki content isn't quite right for what I'm seeing in 1.1 these days w.r.t modeName (http://wiki.liftweb.net/index.php/HowTo_configure_logging) Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Scope issues with CometActors
Hey all, I'm trying to build an app that takes advantage of the Comet support in Lift. This is a simple app that displays all messages from a given person and shows new messages as they are added. At first, I struggled with trying to pull the request parameter (the url looks like this - /person/1) into my CometActor, and then I found a message on the lift board that talked about the scope mismatch between the request scope and a CometActor, and recommends setting a session variable that the CometActor then reads. The scope mismatch makes sense to me, so I tried the suggested way of doing it, which worked. However, now when I go back to the home page and select another person to view messages for, I still see the the old messages. After some testing, it appears that CometActors on the same page are not re-created if there is one already active. I can't seem to find any method that gets called on it when the page is rendered either, and I am not sure how to update the state of the CometActor so that it retrieves the proper messages. Is there any documentation or examples for using CometActors in conjunction with a request parameter like that? Or is there a better way altogether for me to be doing this? Thank you, - Spencer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Modularization of Lift code
On Thu, Aug 27, 2009 at 2:00 PM, glenn gl...@exmbly.com wrote: David, Besides the very detailed discussion here about the problems of Boot initialization and the immutability of sitemap and liftrules, that strikes me as a sufficient barrier to real modularization. Are you talking about modularization of web apps? Are you talking about being able to plop in a JAR file and do one or two bits of configuration and have that JAR's features be part of your app? If you are, with the exception of the where do my menu items go issue, as long as you can do the configuration in Boot, Lift allows for fully modular apps. Rather than complaining the Lift doesn't offer what you need, please define what you need in very specific terms (I need to intercept a GET request to a URL, I need to intercept requests to a URL if certain conditions are met, I need to include a tag in view code that invokes code in my module, etc.) or point to another framework that allows for this plugin modularization. I hadn't thought about turning reuseable code into traits and assigning those around in jar files until you mentioned it. Not a bad idea. But I wouldn't feel comfortable incorporating third-party traits in my code unless I had the source to fall back on. Why are traits any different than objects that you subclass? As far as I can tell, traits simply give you nearly multiple inheritance without the headaches. Why would you be any less willing to mix in a trait than to subclass a class provided by another library? Example of poor encapsulation - just the fact that you can encapsulate snippets and templates. Without the source, how can a user ever hope to incorporate those. I think that snippets are a near perfect encapsulation mechanism. They are simply a transformation of XHTML - XHTML. What could be more straight forward? What could be more encapsulated? Further, Lift's mechanism of associating HTML elements with functions means that there's no need to have special URLs to handle forms or anything else. My snippet can generate a form that will be processed if it is submitted back to the server, no matter what URL the form is submitted to. In Rails and other MVC frameworks, the POST/GET must be done to a specific controller in order for the parameters to be correctly processed. Why does this matter? Well, in the ESME codebase, I just created an authentication plugin mechanism that allows a plugin to define a part of a form that is to be filled in as part of the signup process. The signup process doesn't know anything about the plugin or what fields the plugin needs. The snippet that handles the signup simply binds one element to the plugins part of the sign-up. The plugin manages its own portion of the form, manages its own validation, manages its own saving, all without having to register as being part of the controller. This is highly modular. And then, to make them private, which is done...that's turning a headache into a nightmare. Can you give me an example of a private snippet or a private template and how you would use one? Yeah, as long as you work at the source-level, there is no problem. But that, in-and-of itself, is the problem. As you suggest, some, as yet unilluminated patterns, would be most helpful. If I understood what you were trying to do, I could help you with patterns. Code works best for me. If you could put together templates and stubbed Scala and make clear what you're trying to do and what Lift is not letting you do, I could help you out. Thanks, David Glenn... On Aug 27, 12:11 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Aug 27, 2009 at 11:22 AM, glenn gl...@exmbly.com wrote: David, Returning menu items from your init function is OK, but forces the user of your module to guess on function-call order I don't understand... what function call order are you talking about? The order in which the modules are initialized? Something else? , or be forced to glean it from the source, which he should not be required to do. Putting code such as this, instead, in your init function helps, but does not eliminate that problem. What particular problem? val sitemap = LiftRules.siteMap match { case Full(sm) = LiftRules.setSiteMap(SiteMap(sm.menus ::: Role.menus:_* )) case _ = LiftRules.setSiteMap(SiteMap(Role.menus:_*)) } Where are you proposing to put this code? With it, you can sort of standardize your call-order, requiring that the init function be called immediately before Just to be precise, init() is a method on your module. It's not a function. S.addAround(DB.buildLoanWrapper) in Boot,scala. But, there is a larger issue at stake here, I fear, and that is that true modularization requires adherence to rules of encapsulation and complete documentation, two things that are problematic in
[Lift] Fwd: [dpp/liftweb] 4bc64d: Stateful snippets work correctly with empty result...
Fix to the empty stateful snippet form issue. -- Forwarded message -- From: nore...@github.com Date: Thu, Aug 27, 2009 at 8:06 PM Subject: [dpp/liftweb] 4bc64d: Stateful snippets work correctly with empty result... To: feeder.of.the.be...@gmail.com Branch: refs/heads/master Home: http://github.com/dpp/liftweb Commit: 4bc64d86fe7f01b603255d04ca18687fc732320b http://github.com/dpp/liftweb/commit/4bc64d86fe7f01b603255d04ca18687fc732320b Author: David Pollak d...@pony.local Date: 2009-08-27 (Thu, 27 Aug 2009) Changed paths: M lift/src/main/scala/net/liftweb/http/LiftSession.scala Log Message: --- Stateful snippets work correctly with empty results and forms -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Scope issues with CometActors
lift:comet type=YourCometClass name={person_number} / The optional name attribute allows you to have different comet actor names (e.g., one per person). You can retrieve the CometActor's name via the name method, which returns a Box[String]. In your CometActor, make sure to: override def lifespan = Full(5 minutes) This will make the particular CometActor go away if it does not appear on a page for a 5 minute span. This lets you have a different CometActor per person, but allows you to share a single CometActor instance for a given session for a given name across browser windows/tabs. I hope this helps and I'd suggest against using SessionVars for passing setup information to CometActors. On Thu, Aug 27, 2009 at 7:28 PM, Spencer Uresk sur...@gmail.com wrote: Hey all, I'm trying to build an app that takes advantage of the Comet support in Lift. This is a simple app that displays all messages from a given person and shows new messages as they are added. At first, I struggled with trying to pull the request parameter (the url looks like this - /person/1) into my CometActor, and then I found a message on the lift board that talked about the scope mismatch between the request scope and a CometActor, and recommends setting a session variable that the CometActor then reads. The scope mismatch makes sense to me, so I tried the suggested way of doing it, which worked. However, now when I go back to the home page and select another person to view messages for, I still see the the old messages. After some testing, it appears that CometActors on the same page are not re-created if there is one already active. I can't seem to find any method that gets called on it when the page is rendered either, and I am not sure how to update the state of the CometActor so that it retrieves the proper messages. Is there any documentation or examples for using CometActors in conjunction with a request parameter like that? Or is there a better way altogether for me to be doing this? Thank you, - Spencer -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Newbie Question design pattern for ORM in Lift
git clone git://github.com/rstradling/DDLtoLiftORM.git is the location of the git code. http://github.com/rstradling/DDLtoLiftORM is the web address I hope this is helpful to others. On Aug 27, 3:13 pm, rstradling ryanstradl...@gmail.com wrote: Thanks for the answers everyone. What David hit upon about wanting objects to be subclassible is the conclusion I came to that would work..if it existed. I was hoping there was a way. :(. Well, I guess Naftoli has provided a possible solution but seems more involved than I have the experience for. I will resort to putting the stuff on the generated classes and let merge tools do the rest. Regarding sharing the codeI should be more specific in that it parses ddl. To be honest, I hope you all are not hoping for muchbut I will get it up on github and when I do will reply to this thread with the location. On Aug 27, 1:35 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Aug 27, 2009 at 10:26 AM, rstradling ryanstradl...@gmail.comwrote: With a parser combinator I wrote to parse .sql and it outputs scala orm files. Care to share? That'd be a pretty darned useful utility! Please note it is very specific to my needs (i.e. only works with certain grammars (INSERTS) but that particular grammar is all I needed to process at the time) but is written in a way that could be extended to the full grammar (at least that was my intent :).. So... the problem is that objects in Scala are not subclassible. What does this mean? For example: trait Foo { object bar extends AnyRef } trait MyFoo extends Foo { override object bar { def cantDoIt = sigh } } Back in the Scala 2.5 days, there was some talk about allowing this to happen, but it never did. So, unfortunately, I can't think of a way for your sql generator to create a superclass that could be subclassed and have the effect that you want. Sorry/ On Aug 27, 1:09 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: How do you auto-generate them? On Thu, Aug 27, 2009 at 1:03 PM, rstradling ryanstradl...@gmail.com wrote: I am using Lift 1.0 with the Mapper ORM module from Lift. I am a newbie to Scala and Lift. I have auto-generated my ORM classes from a .sql file. Given that these classes are auto-generated I would prefer not to edit them directly and provide additional functionality via inheritance. Say I have the following... class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK { def getSingleton = StatGenerated object errors extends MappedLong(this) object hits extends MappedLong(this) object AB extends MappedLong(this) } object StatGenerated extends StatGenerated with LongKeyedMetaMapper [StatGenerated] { override def fieldOrder = List(errors, hits) } class Statistics extends StatGenerated { def GetBattingAverage(id : Long) : float = { val stat = Stat.findByKey(id) stat.hits/stat.AB } } Now what I would like to do is work with the Statistics class as my ORM object... But I believe everything that is ORM related is actually of type StatGenerated rather than Statistics. i.e. findByKey will return me a StatGenerated rather than a Statistics class. Is there any clever way around this that I am missing without either modifying the generated class or duplicating code? -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] authentication and access control
Lift users, I'm curious what you all are using for user access control (Mapper users excluded). I'm seriously evaluating lift for a project that will use JPA. My full time job uses Spring Security, which while nice in that it stays out of the way, is too clunky for my tastes. I haven't dissected how lift implements it with Mapper, but wanted to ask the group first. Thanks! chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Using Lift to build a Web Service and the PUT HTTP method??
I'm trying to use PUT with Lift and it seems to be working, except I can't find the content I put. I'm using jQuery on the front end (a custom front-end) and firebug seems to think the data gets sent. Although it doesn't show me the raw request, it adds a PUT tab that shows the key and value(I couldn't get PUT in jQuery to work without a key/value pair). So where should I look for this data in the req? I've used POST and GET before without problem, but I need to use PUT here. I looked in the body field and in the xml field (it is an xml string being PUT). BTW, I'm using Lift .11 and scala 2.7.2. So anyone doing this? If so where is the PUT data? Oh also should I upgrade Lift? Last time I did (from .9 to .11) it was a lot of work. Alan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: has anyone seen this exception?
Here is the code I am using. The exception is happening at line 12, the line that goes line = br.readLine() The exception is happening alot. Any ideas? package com.authoritude.snippet import java.io.{InputStreamReader, BufferedInputStream, BufferedReader, OutputStreamWriter, InputStream} object StreamUtil { def streamToString(stream: InputStream): String = { val buf = new StringBuilder val br = new BufferedReader(new InputStreamReader(stream)) var line: String = null var eof = false while (! eof) { line = br.readLine() if (line == null) eof = true else buf.append(line).append(\n) } buf.toString } } On Thu, Aug 27, 2009 at 5:49 PM, David Pollak feeder.of.the.be...@gmail.com wrote: This happens sometimes when the client disconnects before the communications with the server is complete. I see them from time to time and they indicate to me that the Internet is a random place. On Thu, Aug 27, 2009 at 12:06 PM, jack jack.wid...@gmail.com wrote: Has anyone seen this error? I get it while transforming a Stream into a String. The stream is from an http request I just made. Message: java.io.IOException: Premature EOF sun.net.www.http.ChunkedInputStream.readAheadBlocking (ChunkedInputStream.java:556) sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java: 600) sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) java.io.FilterInputStream.read(FilterInputStream.java:133) sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read (HttpURLConnection.java:2419) sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) java.io.InputStreamReader.read(InputStreamReader.java:184) java.io.BufferedReader.fill(BufferedReader.java:153) java.io.BufferedReader.readLine(BufferedReader.java:316) java.io.BufferedReader.readLine(BufferedReader.java:379) com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12) -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ajax in ToDo application hanging
Is there a way to update ToDo application to use 1.1-SNAPSHOT? On Aug 28, 1:38 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Aug 27, 2009 at 3:19 PM, Dorinel dorinel.munte...@gmail.com wrote: It's great! By the way, by default ToDo application runs on 1.1-SNAPSHOT? I think it uses 1.0 by default... but I prefer 1.1-SNAPSHOT because it's got the most developer-friend features. On Aug 27, 9:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I've reproduced and fixed this issue. Thanks for reporting it. On Thu, Aug 27, 2009 at 9:13 AM, David Pollak feeder.of.the.be...@gmail.com wrote: I'm running tests from Firefox running locally, Chrome running locally and Safari running remotely to see if I can reproduce the issue (I'm running against Lift 1.1-SNAPSHOT) On Thu, Aug 27, 2009 at 4:38 AM, Dorinel dorinel.munte...@gmail.com wrote: I was implementing application from http://liftweb.net/docs/getting_started/mod_master.html By the way,it's a great tutorial for lift much better than those which were before and it explains a lot of things in comments clearly, thank you for creating it. But when I left the todo application for about 2-3 hours, the ajax which allows editing of the ToDo items stopped working. When I click on checkbox it doesn't resort all items, the same it doesn't resort (or redraw) when I'm changing priority from dropdown menu. Also when I click desc to edit it - I can edit it but the result is not saved and it doesn't exit edit mode when I'm editing another item. When I do some actions, like checking a checkbox it seems that on server side I have new rows like these: INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1 Milliseconds Ajax starts working when I'm adding new todo item (because page reloads) or I'm logging of and on. I've replicated this bug by leaving todo application running for night and it was the same ajax not working when I wake up. Is this a known bug, or I have done something wrong when I typed ToDo application from tutorial? -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: has anyone seen this exception?
I'd suggest that you use import net.liftweb.util.Helpers._ def streamToString(stream: InputStream) = new String(readWholeStream(stream), UTF-8) See if that makes things better. On Thu, Aug 27, 2009 at 4:28 PM, Jack Widman jack.wid...@gmail.com wrote: Here is the code I am using. The exception is happening at line 12, the line that goes line = br.readLine() The exception is happening alot. Any ideas? package com.authoritude.snippet import java.io.{InputStreamReader, BufferedInputStream, BufferedReader, OutputStreamWriter, InputStream} object StreamUtil { def streamToString(stream: InputStream): String = { val buf = new StringBuilder val br = new BufferedReader(new InputStreamReader(stream)) var line: String = null var eof = false while (! eof) { line = br.readLine() if (line == null) eof = true else buf.append(line).append(\n) } buf.toString } } On Thu, Aug 27, 2009 at 5:49 PM, David Pollak feeder.of.the.be...@gmail.com wrote: This happens sometimes when the client disconnects before the communications with the server is complete. I see them from time to time and they indicate to me that the Internet is a random place. On Thu, Aug 27, 2009 at 12:06 PM, jack jack.wid...@gmail.com wrote: Has anyone seen this error? I get it while transforming a Stream into a String. The stream is from an http request I just made. Message: java.io.IOException: Premature EOF sun.net.www.http.ChunkedInputStream.readAheadBlocking (ChunkedInputStream.java:556) sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java: 600) sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) java.io.FilterInputStream.read(FilterInputStream.java:133) sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read (HttpURLConnection.java:2419) sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) java.io.InputStreamReader.read(InputStreamReader.java:184) java.io.BufferedReader.fill(BufferedReader.java:153) java.io.BufferedReader.readLine(BufferedReader.java:316) java.io.BufferedReader.readLine(BufferedReader.java:379) com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12) -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ajax in ToDo application hanging
On Thu, Aug 27, 2009 at 6:24 PM, Dorinel dorinel.munte...@gmail.com wrote: Is there a way to update ToDo application to use 1.1-SNAPSHOT? Edit your pom.xml file. Change the Scala version to 2.7.5. Change the net.liftweb dependencies to 1.1-SNAPSHOT and make sure the repositories tag contains: repository idscala-tools.org.snapshots/id nameScala-Tools Maven2 Repository for Snapshots/name urlhttp://scala-tools.org/repo-snapshots/url snapshots / /repository On Aug 28, 1:38 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Aug 27, 2009 at 3:19 PM, Dorinel dorinel.munte...@gmail.com wrote: It's great! By the way, by default ToDo application runs on 1.1-SNAPSHOT? I think it uses 1.0 by default... but I prefer 1.1-SNAPSHOT because it's got the most developer-friend features. On Aug 27, 9:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I've reproduced and fixed this issue. Thanks for reporting it. On Thu, Aug 27, 2009 at 9:13 AM, David Pollak feeder.of.the.be...@gmail.com wrote: I'm running tests from Firefox running locally, Chrome running locally and Safari running remotely to see if I can reproduce the issue (I'm running against Lift 1.1-SNAPSHOT) On Thu, Aug 27, 2009 at 4:38 AM, Dorinel dorinel.munte...@gmail.com wrote: I was implementing application from http://liftweb.net/docs/getting_started/mod_master.html By the way,it's a great tutorial for lift much better than those which were before and it explains a lot of things in comments clearly, thank you for creating it. But when I left the todo application for about 2-3 hours, the ajax which allows editing of the ToDo items stopped working. When I click on checkbox it doesn't resort all items, the same it doesn't resort (or redraw) when I'm changing priority from dropdown menu. Also when I click desc to edit it - I can edit it but the result is not saved and it doesn't exit edit mode when I'm editing another item. When I do some actions, like checking a checkbox it seems that on server side I have new rows like these: INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1 Milliseconds Ajax starts working when I'm adding new todo item (because page reloads) or I'm logging of and on. I've replicated this bug by leaving todo application running for night and it was the same ajax not working when I wake up. Is this a known bug, or I have done something wrong when I typed ToDo application from tutorial? -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: has anyone seen this exception?
Great. Thanks David. I'll try that. On Fri, Aug 28, 2009 at 12:27 AM, David Pollak feeder.of.the.be...@gmail.com wrote: I'd suggest that you use import net.liftweb.util.Helpers._ def streamToString(stream: InputStream) = new String(readWholeStream(stream), UTF-8) See if that makes things better. On Thu, Aug 27, 2009 at 4:28 PM, Jack Widman jack.wid...@gmail.comwrote: Here is the code I am using. The exception is happening at line 12, the line that goes line = br.readLine() The exception is happening alot. Any ideas? package com.authoritude.snippet import java.io.{InputStreamReader, BufferedInputStream, BufferedReader, OutputStreamWriter, InputStream} object StreamUtil { def streamToString(stream: InputStream): String = { val buf = new StringBuilder val br = new BufferedReader(new InputStreamReader(stream)) var line: String = null var eof = false while (! eof) { line = br.readLine() if (line == null) eof = true else buf.append(line).append(\n) } buf.toString } } On Thu, Aug 27, 2009 at 5:49 PM, David Pollak feeder.of.the.be...@gmail.com wrote: This happens sometimes when the client disconnects before the communications with the server is complete. I see them from time to time and they indicate to me that the Internet is a random place. On Thu, Aug 27, 2009 at 12:06 PM, jack jack.wid...@gmail.com wrote: Has anyone seen this error? I get it while transforming a Stream into a String. The stream is from an http request I just made. Message: java.io.IOException: Premature EOF sun.net.www.http.ChunkedInputStream.readAheadBlocking (ChunkedInputStream.java:556) sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java: 600) sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687) java.io.FilterInputStream.read(FilterInputStream.java:133) sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read (HttpURLConnection.java:2419) sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) java.io.InputStreamReader.read(InputStreamReader.java:184) java.io.BufferedReader.fill(BufferedReader.java:153) java.io.BufferedReader.readLine(BufferedReader.java:316) java.io.BufferedReader.readLine(BufferedReader.java:379) com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12) -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: weirdness with stateful snippets and multiple forms on the page
Lift's multi-step wizard support is less than optimal. I'm working with some folks to improve the situation and it's part of the 1.1 roadmap. On Thu, Aug 27, 2009 at 1:40 PM, harryh har...@gmail.com wrote: Are stateful snippets considered a good way to do multi-step wizard like interfaces? They seem like a good fit, but I'm running into 1 annoying problem. I'm seeting things up so in my .html file I have something like this: lift:MyPage.stepOne form=POST // HTML for step 1 /lift:MyPage.stepOne lift:MyPage.stepTwo // HTML for step 2 /lift:MyPage.stepTwo Then in the MyPage StatefulSnippet I return NodeSeq.Empty for 1 step, and actual contents for the other. The only issue is that for the inactive steps HTML like the following gets sent to the browser: form action=/my_page method=postinput name=F110858803410EI0 type=hidden value=true //form Yeah... that's a bug. I'll have a fix committed up in a few. This isn't a huge deal really, but it's kind of annoying. It almost seems like that a lift: element with a form attribute shouldn't generate the form if the snippet function returns NodeSeq.Empty That's defined behavior and it will be that way in just a minute. -harryh -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---