[Lift] Re: Facebook Application
FYI, this is now in master. The client defaults to XML (Node), but if you want to use JSON you can create a client like this: def jsonClient(session:FacebookSession) = new FacebookClient[JValue] (session, is = { JsonParser.parse(new BufferedReader(new InputStreamReader(is))) }, FacebookFormat.json) for (client - FacebookConnect.session.map(jsonClient)){ val jsonUser = client !? GetUser } On Feb 10, 2:08 pm, Jonathan Hoffman jonhoff...@gmail.com wrote: With connect you can also get a client: for (client - FacebookConnect.client){ client !? ... } On Feb 9, 2010, at 8:56 AM, Leo Lännenmäki wrote: Hi, I'll definitely take a look. But I think FB connect is not applicable for our use.. Here a simple version of the use: - We have a Lift application providing a RESTfull JSON API for our clients. Through that API a client application can share a photo to Facebook - We have a Web client for the API provided by the Lift server looming on a different machine. That client does the FB login in order to get a token for the user. - That token is sent to the Lift server which uses it to create a new client (val client = FacebookClient.fromAuthToken(authToken).get) - When the user shares a photo through our API that fb client is used to upload the photo toFacebook On Feb 9, 6:06 am, Jonathan Hoffman jonhoff...@gmail.com wrote: Hi All, I just created issue #336 to provide aFacebookConnect helper and example application. You can take a look at what I've got here:http://github.com/dpp/liftweb/commit/3b6686201e3b7f22100e52a04734fd4c... Leo, if you're trying to use fb connect, hopefully this will help you out (I would suggest using connect rather than redirecting to FB) Will push out to master pending your comments and RB. - Jon On Feb 5, 2010, at 10:35 AM, Leo Lännenmäki wrote: Hi, I have only tried to do a couple of things with theFacebookmodule (I'm using 2.0-M1) and I have gotten some of the stuff to actually work :) Photo upload would be something like this: import java.io.File import org.apache.commons.io.FileUtils import net.liftweb.ext_api.facebook._ import scala.xml._ FacebookRestApi.apiKey = your api key FacebookRestApi.secret = secret // Get a user to login toFacebookwith a link like http://www.facebook.com/login.php?v=1.0api_key=your api key // If you mess around with theFacebooksettings you will get FB to // redirect the user back to your app with a token as a query param val authToken = as described previously val client = FacebookClient.fromAuthToken(authToken).get val photo = new File(...) val bytes = FileUtils.readFileToByteArray(photo) val resp = client !? UploadPhoto(test.jpg, jpg, bytes) val photoUrl = (resp \\ link).text Getting a list of friends: val resp = client !? GetFriends() Some real documentation and examples sure would be nice! Leo On Feb 3, 9:00 am, celestocalculus celestocalcu...@yahoo.co.uk wrote: Hello, I'm an intermediate lift developer. Suddenly, it has become my first choice framework for web applications. I really think it's a nice framework you guys are doing a great job. I'm new onfacebookapplication development and I have been looking at the liftwebfacebookAPI. I really don't know how to put this but I'm just blank, I don't know where to start. I would really appreciate it if I get a step by step explanation. All the book I got onfacebook apps are on php and I find it difficult to match the php codes to their corresponding lift counterparts. Please I'll also appreciate sample codes, please let it be step by step and on point. Thanks in advance. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: liftAjax jQuery 1.4.1 problem
It's my app that's returning the function On Feb 3, 3:08 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Feb 3, 2010 at 11:55 AM, Jonathan Hoffman jonhoff...@gmail.comwrote: I was able to find the root cause. jQuery 1.4.1 does not consider javascript objects that contain functions to be be valid JSON. According the to JSON spec, a function is not valid JSON. This is ok: {foo:bar} This is bad: {foo:function(){alert('hello')} jquery-1.4.1.js:491 -- parseJSON jquery 1.3.2 simply eval'd strings to created json objects, so there was no problem. I think it's kind of nice to be able to return JSON objects via ajax calls with embedded functions, but please feel free to educate me if you think that's a bad idea. I think it's a nifty trick, but I'm not sure it's optimal. Is it a Lift thing or your app that's returning the function as part of the JSON response? I'll also try to get some feedback from the jQuery forum. Thanks, Jon On Feb 3, 2010, at 2:21 PM, Jonathan Hoffman wrote: Hi, There is a problem with making jsonCalls which return JSON with anonymous functions. I've created a very simple reproducible example, but have not been able to track down the root cause. Take a look at jsonCallBug in: http://github.com/hoffrocket/lift_1_1_sample/blob/master/src/main/sca... The project should run in mvn or sbt. Thanks, Jon -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: liftAjax jQuery 1.4.1 problem
That's a very simple example, but imagine a more complex situation where you want to have polymorphic functions on a list of results. Or where the functions are lift ajax calls. Like this: [{name:marius, poke:function(){liftAjax...}}, {name:dpp, poke:function(){liftAjax...}}] - Jon On Feb 3, 3:46 pm, Marius marius.dan...@gmail.com wrote: Hmmm ... in Lift we do use JSON structures with functions (but not with JSON mime type). For instance ScriptRenderer.scala defines a JSON with functions. jlift.js also defines a JSON with functions. But looking at your example app, you're using JSON mimetype in the response and that JSON has a function which I don't think it is correct. So why do you need the jsonCall stuff with AjaxContext.json ? Br's, Marius On 3 feb., 22:08, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Feb 3, 2010 at 11:55 AM, Jonathan Hoffman jonhoff...@gmail.comwrote: I was able to find the root cause. jQuery 1.4.1 does not consider javascript objects that contain functions to be be valid JSON. According the to JSON spec, a function is not valid JSON. This is ok: {foo:bar} This is bad: {foo:function(){alert('hello')} jquery-1.4.1.js:491 -- parseJSON jquery 1.3.2 simply eval'd strings to created json objects, so there was no problem. I think it's kind of nice to be able to return JSON objects via ajax calls with embedded functions, but please feel free to educate me if you think that's a bad idea. I think it's a nifty trick, but I'm not sure it's optimal. Is it a Lift thing or your app that's returning the function as part of the JSON response? I'll also try to get some feedback from the jQuery forum. Thanks, Jon On Feb 3, 2010, at 2:21 PM, Jonathan Hoffman wrote: Hi, There is a problem with making jsonCalls which return JSON with anonymous functions. I've created a very simple reproducible example, but have not been able to track down the root cause. Take a look at jsonCallBug in: http://github.com/hoffrocket/lift_1_1_sample/blob/master/src/main/sca... The project should run in mvn or sbt. Thanks, Jon -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Filtering of script tags from ajax replies and executing the javascript
Hi, It would be cool if when I did something like this: SHtml.a(()= SetHtml(id, findAnyTemplate(List(foo)).open_!)) The script tags within the foo template were filtered out and the the contained JavaScript were executed. I created my own SetHtml to achieve that, but I'm wondering if this would be interesting enough to add to Lift in a more comprehensive way (so that it works for all JsCmds that render NodeSeqs)? Here's what I got so far: http://gist.github.com/247425 - Jon -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Filtering of script tags from ajax replies and executing the javascript
Comments below. On Dec 2, 2:00 pm, Marius marius.dan...@gmail.com wrote: Personally I have reservations about this. If you want to include templates in this manner why use script tags in those templates ? ... I have existing templates which load as static pages and want to convert to ajaxy style page transitions without changing too many things. Also, I'm using something similar to the LazyLoad, which harryh shared a few months ago, which looks like this: lift:LazyLoad div id=foo lift:SomeSnippet/ /div script type=text/javascript //![CDATA[ alert('loaded'); //do something with foo //]] /script /lift:LazyLoad I get your point though, perhaps these are esoteric use cases. Furthermore in some cases one may want Script tags preserved. And having multiple SetHtml is not something I'd like to see (but others could). Besides stripping nodes out is a pretty trivial task using pattern matching or Scala's RuleTransformer. I also explored creating a trait that can be mixed into JqSetHtml to achieve the same goal: http://gist.github.com/247557 But I think it's too brittle to be generally useful. Last but not least I would avoid using open_! in such contexts. Try using openOr for graceful degradation. Under most circumstances I wouldn't use open_!, but for the case of hard coded template paths, I want things to fail in as loud a way as possible if I were to rename or fatfinger a path and that somehow made it into production (I have a top level catch all for exceptions which shoots out notifications and displays a nice error message). I realize that it would be hard to quickly parse the error cause, so I'm using something like this instead: def findTemplate_!(path:List[String]) = findAnyTemplate(path) openOr (throw new Exception(Template not found: + path.mkString(/))) Br's, Marius On Dec 2, 8:40 pm, jon jonhoff...@gmail.com wrote: Hi, It would be cool if when I did something like this: SHtml.a(()= SetHtml(id, findAnyTemplate(List(foo)).open_!)) The script tags within the foo template were filtered out and the the contained JavaScript were executed. I created my own SetHtml to achieve that, but I'm wondering if this would be interesting enough to add to Lift in a more comprehensive way (so that it works for all JsCmds that render NodeSeqs)? Here's what I got so far:http://gist.github.com/247425 - Jon -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Please welcome Jon Hoffman to the Lift committers
Thanks for the warm welcome! Lift's been super productive for me and I'm happy to have the oppurtunity to give back. On Dec 2, 6:56 pm, Timothy Perrett timo...@getintheloop.eu wrote: Welcome Jon! Its new-committer-o-rama!! I need to get on top of the current team list to revise the site etc Cheers, Tim On 2 Dec 2009, at 23:25, David Pollak wrote: Folks, It may or may not be true that for Jon Hoffman that Martin Odersky praises [his] valuable contributions. [He] can read APIs in the dark. But Jon's made a valuable contribution to Lift as part of the community. Now, he's a committer. Please join me in welcoming Jon. I'm looking forward to his S3-related additions to Lift and any other goodies he wants to toss into Lift. Jon, welcome and I'm looking forward to the grandeur of your contributions! Thanks, David PS -- Derek please add Jon to the review board. PPS -- My wife loves the Udorse jobs page. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Maper SQL stored procedures
I think you could do: User.findAllByInsecureSql(exec dbo.GET_USERS, IHaveValidatedThisSQL(me, 19 Nov 2009)). That would return a List [User] On Nov 19, 6:23 am, Marcin Jurczuk mjurc...@gmail.com wrote: Hi group, Is there a way for nice support for stored procedures in Mapper Framework. Let assume that I have database where only way to get data is stored procedure for example Instead SELECT * from user I must execute exec dbo.GET_USERS How connect Mapper fields with access to them by stored procedures ? A can of cource use raw/insecure SQL but then I'm loosing all Mapper features .. Thanks in advance -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=.
[Lift] Re: scala eclipse plugin with lift
I share Chris's sentiment. The 2.7.x eclipse plugin has been unusably unstable in my experience. My current dev setup: text editor with syntax highlighting and two terminals running sbt term one: sbt, then ~prepare-webapp (continuous compilation and deployment) term two: sbt-rebel jetty (start jetty and dynamically reload classes with java rebel) my sbt-rebel script looks like: java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -noverify - javaagent:/path/to/jrebel.jar -Xmx512m -jar ~/bin/sbt-launcher.jar $@ get sbt: http://code.google.com/p/simple-build-tool/wiki/Setup create project: http://code.google.com/p/simple-build-tool/wiki/WebApplicationExample get your free javarebel license here: http://www.zeroturnaround.com/scala-license/ - Jon On Nov 17, 10:53 pm, Chris Lewis burningodzi...@gmail.com wrote: I can't say I enjoy eclipse for scala code, but did you make sure your project has the Scala Nature? Oscar Picasso wrote: Hi, I did import a new created lift project in a eclipse as a maven project. The project is recognized as a scala project but there is neither syntax syntax highlighting nor auto completion while it works fine, in the same workspace when I create directly a scala project with the scala eclipse plugin. Any idea? -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=.
[Lift] Re: Minor Bug? MappedString.valUnique should return one FieldError
http://github.com/dpp/liftweb/issues/#issue/179 On Nov 12, 6:16 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Could you open a ticket for it? On Wed, Nov 11, 2009 at 11:53 AM, jon jonhoff...@gmail.com wrote: Hi, I'm currently adding a uniqueness requirement to a field, but there are duplicate entries (for empty string) in my database already. Currently valUnique maps each match it found to a FieldError, but should probably return one FieldError regardless of how many matches it finds. - Jon -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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] Minor Bug? MappedString.valUnique should return one FieldError
Hi, I'm currently adding a uniqueness requirement to a field, but there are duplicate entries (for empty string) in my database already. Currently valUnique maps each match it found to a FieldError, but should probably return one FieldError regardless of how many matches it finds. - Jon --~--~-~--~~~---~--~~ 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 In() with OrderBy mapper bug
I just verified that the newer h2 fixes the problem. Thanks for investigating! On Nov 5, 6:33 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Nov 4, 2009 at 10:02 AM, jon jonhoff...@gmail.com wrote: Hi, I just noticed OrderBy statements cause Inner selects to break in h2: I query such as: User.findAll(In(User.id, Dog.owner, OrderBy(Dog.name, Ascending)), MaxRows(5)) Produces: Message: org.h2.jdbc.JdbcSQLException: Order by expression NAME must be in the result list in this case; SQL statement: SELECT DISTINCT OWNER AS _0 FROM PUBLIC.DOG /* PUBLIC.DOG_TABLE_SCAN */ ORDER BY =NAME [90068-117] This is an issue in H2 1.1. Please upgrade to 1.2.121 and the problem goes away. If it's not possible for you to upgrade to 1.2.121, let's discuss by phone or privately. Code to duplicate here: http://github.com/hoffrocket/lift_1_1_sample/commit/0093e2585e0d9d799... This works in M5. Any chance a workaround or fix could be put out before M7? Sorry, I didn't notice until today. Thanks, Jon -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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] 1.1-SNAPSHOT In() with OrderBy mapper bug
Hi, I just noticed OrderBy statements cause Inner selects to break in h2: I query such as: User.findAll(In(User.id, Dog.owner, OrderBy(Dog.name, Ascending)), MaxRows(5)) Produces: Message: org.h2.jdbc.JdbcSQLException: Order by expression NAME must be in the result list in this case; SQL statement: SELECT DISTINCT OWNER AS _0 FROM PUBLIC.DOG /* PUBLIC.DOG_TABLE_SCAN */ ORDER BY =NAME [90068-117] Code to duplicate here: http://github.com/hoffrocket/lift_1_1_sample/commit/0093e2585e0d9d799b503f32da7496e212efd873 This works in M5. Any chance a workaround or fix could be put out before M7? Sorry, I didn't notice until today. Thanks, Jon --~--~-~--~~~---~--~~ 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 In() with OrderBy mapper bug
That would be great. Would it also be published to the scala-tools repo? On Nov 4, 1:18 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Nov 4, 2009 at 10:02 AM, jon jonhoff...@gmail.com wrote: Hi, I just noticed OrderBy statements cause Inner selects to break in h2: I query such as: User.findAll(In(User.id, Dog.owner, OrderBy(Dog.name, Ascending)), MaxRows(5)) Produces: Message: org.h2.jdbc.JdbcSQLException: Order by expression NAME must be in the result list in this case; SQL statement: SELECT DISTINCT OWNER AS _0 FROM PUBLIC.DOG /* PUBLIC.DOG_TABLE_SCAN */ ORDER BY =NAME [90068-117] Code to duplicate here: http://github.com/hoffrocket/lift_1_1_sample/commit/0093e2585e0d9d799... This works in M5. Any chance a workaround or fix could be put out before M7? Sorry, I didn't notice until today. How about a branch off M7 that fixes this one bug? Thanks, Jon -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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 In() with OrderBy mapper bug
Wow, congrats! On Nov 4, 1:46 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Nov 4, 2009 at 10:36 AM, jon jonhoff...@gmail.com wrote: That would be great. Would it also be published to the scala-tools repo? Dunno. Got to figure out how to get it published. But we can work on that tomorrow (today's release day, plus I turn into a dad @ 1pm PST) On Nov 4, 1:18 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Nov 4, 2009 at 10:02 AM, jon jonhoff...@gmail.com wrote: Hi, I just noticed OrderBy statements cause Inner selects to break in h2: I query such as: User.findAll(In(User.id, Dog.owner, OrderBy(Dog.name, Ascending)), MaxRows(5)) Produces: Message: org.h2.jdbc.JdbcSQLException: Order by expression NAME must be in the result list in this case; SQL statement: SELECT DISTINCT OWNER AS _0 FROM PUBLIC.DOG /* PUBLIC.DOG_TABLE_SCAN */ ORDER BY =NAME [90068-117] Code to duplicate here: http://github.com/hoffrocket/lift_1_1_sample/commit/0093e2585e0d9d799. .. This works in M5. Any chance a workaround or fix could be put out before M7? Sorry, I didn't notice until today. How about a branch off M7 that fixes this one bug? Thanks, Jon -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Sending a XML message to a Lift server
this should work: def post(url:URL, toPost:String):String = url.openConnection match { case conn: HttpURLConnection = { conn.setRequestMethod(POST) conn.setDoOutput(true) conn.connect conn.getOutputStream.write(toPost.getBytes()) scala.io.Source.fromInputStream (conn.getInputStream).getLines.mkString } } On Oct 14, 2:22 pm, GA my_li...@me.com wrote: Hello guys, I have created a small web service in Lift. It has two services: One reads a row from a table in a database and the other writes one. To test the API I am writing a small client application in scala to read and write from the Lift API. Since I am new to scala and lift, I am thinking the code in Java and writing in scala, and of course I am having some problems because of that. When I read from the Lift service, the service answers correctly, but my client method reads one line and ends the loop. I believe that the syntax of my for comprehension is not correct. This is my reader code: import java.net._ import java.io._ def read { val url = new URL(http://localhost:8080/api/getPerson/myrow;) var connection = url.openConnection connection.setDoOutput(true); var in = new BufferedReader(new InputStreamReader (connection.getInputStream())); var incomingMsg = **Loop with the problem*** for (decodedString - in.readLine) { incomingMsg = incomingMsg + decodedString } in.close(); println(incomingMsg) } My second problem is when i try to send a message to the API i receive the following java error: java.io.FileNotFoundException:http://localhost:8080/api/getPerson The error happens when the method tries to read the answers from the API. This is the code: def send { val message = root action/action person userNameJose/userName firstNameJose/firstName lastNamePerez/lastName passworda/password emaila...@.com/email createdon10/12/2009/createdon createdbyJose/createdby updatedon10/12/2009/updatedon updatedbyJose/updatedby /person /root val url = new URL(http://localhost:8080/api/getPerson;) var connection = url.openConnection connection.setDoOutput(true); var outgoingMsg = message.toString var out = new OutputStreamWriter(connection.getOutputStream()); out.write(string= + outgoingMsg); out.close(); ***The error happens in the next line** var in = new BufferedReader(new InputStreamReader (connection.getInputStream())); // var decodedString = for (decodedString - in.readLine) println(decodedString) in.close(); } Any ideas? and, by the way, are there scala packages to replace java.net and java.io? Thanks in advance, GA --~--~-~--~~~---~--~~ 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: Sending a XML message to a Lift server
oh, if you want to parse directly into xml replace Source.fromInputStream(conn.getInputStream).getLines.mkString with XML.load(conn.getInputStream) On Oct 14, 2:32 pm, jon jonhoff...@gmail.com wrote: this should work: def post(url:URL, toPost:String):String = url.openConnection match { case conn: HttpURLConnection = { conn.setRequestMethod(POST) conn.setDoOutput(true) conn.connect conn.getOutputStream.write(toPost.getBytes()) scala.io.Source.fromInputStream (conn.getInputStream).getLines.mkString } } On Oct 14, 2:22 pm, GA my_li...@me.com wrote: Hello guys, I have created a small web service in Lift. It has two services: One reads a row from a table in a database and the other writes one. To test the API I am writing a small client application in scala to read and write from the Lift API. Since I am new to scala and lift, I am thinking the code in Java and writing in scala, and of course I am having some problems because of that. When I read from the Lift service, the service answers correctly, but my client method reads one line and ends the loop. I believe that the syntax of my for comprehension is not correct. This is my reader code: import java.net._ import java.io._ def read { val url = new URL(http://localhost:8080/api/getPerson/myrow;) var connection = url.openConnection connection.setDoOutput(true); var in = new BufferedReader(new InputStreamReader (connection.getInputStream())); var incomingMsg = **Loop with the problem*** for (decodedString - in.readLine) { incomingMsg = incomingMsg + decodedString } in.close(); println(incomingMsg) } My second problem is when i try to send a message to the API i receive the following java error: java.io.FileNotFoundException:http://localhost:8080/api/getPerson The error happens when the method tries to read the answers from the API. This is the code: def send { val message = root action/action person userNameJose/userName firstNameJose/firstName lastNamePerez/lastName passworda/password emaila...@.com/email createdon10/12/2009/createdon createdbyJose/createdby updatedon10/12/2009/updatedon updatedbyJose/updatedby /person /root val url = new URL(http://localhost:8080/api/getPerson;) var connection = url.openConnection connection.setDoOutput(true); var outgoingMsg = message.toString var out = new OutputStreamWriter(connection.getOutputStream()); out.write(string= + outgoingMsg); out.close(); ***The error happens in the next line** var in = new BufferedReader(new InputStreamReader (connection.getInputStream())); // var decodedString = for (decodedString - in.readLine) println(decodedString) in.close(); } Any ideas? and, by the way, are there scala packages to replace java.net and java.io? Thanks in advance, GA --~--~-~--~~~---~--~~ 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: SQL query logging
what version of Lift are you using? query was a string until fairly recently on 1.1-SNAPSHOT On Oct 14, 11:57 am, Marcin Jurczuk mjurc...@gmail.com wrote: Hello, I'm trying to dump SQL queries because I have weird error when using SQLServer (syntax error near 'LIMIT') using following code in Boot.scala DB.addLogFunc { case (query, time) = { Log.info(Total queries took + time + ms: ) //query.allEntries.foreach(q = Log.info(q.toString)) query.allEntries.foreach({ case DBLogEntry(stmt, duration) = Log.info(stmt + took + duration + ms)}) Log.info(End queries) } } However I got error while running that query is String type and there is no method allEntries. This code is from this group however I can't find DBLogEntry class/ trait. Here is error from run: I:\devel\liftlab\src\main\scala\bootstrap\liftweb\Boot.scala:29: error: value allEntries is not a me mber of String query.allEntries.foreach({ case DBLogEntry(stmt, duration) = ^ Best regards, --~--~-~--~~~---~--~~ 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: java.lang.OutOfMemoryError: PermGen space, Could't start SessionMaster ping
Hi, Is this error occurring after a context reload? You may want to turn off context reloading in your mvn jetty configuration because, as far as i can tell, that has always been a completely broken feature. Do this by adding scanIntervalSeconds0/scanIntervalSeconds to the org.mortbay.jetty configuration/ You can setup javarebel if you want to avoid restarting the container for minor code changes. You may still run into permgen issues as javarebel reloads classes too. But, these JVM flags will help reduce the frequency further: -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=128m (add to your MAVEN_OPTS env variable) I would also suggest looking into sbt as the continuous compilation is much more robust than scala:cc (it keeps track of dependencies and will recompile the entire tree). The only downside is there's no yui compressor plugin, yet. - Jon On Oct 8, 2:16 pm, Timothy Perrett timo...@getintheloop.eu wrote: Alex, Any reason your running the install goal? You really don't need to. Regarding the permgen: Can you show your maven options? You can improve the situation by setting a larger heap size, however this is an unfortunate thing that just goes along with jetty and maven. HTH Cheers, Tim On Oct 8, 7:10 pm, Alex Black a...@alexblack.ca wrote: I've encountered this error 3 times, running Jetty and Maven, just trying out Lift scala with a hello-world like website. I have to kill the JVM with kill -9 and restart things to fix it, any ideas? - Command line: mvn install jetty:run - I'm using Lift 1.0, Scala 2.7.6 final, 64bit JDK1.6.0_16, on Ubuntu Desktop x64. - My app is trivial, no comet or actors or mapping, one view, one class, lists records out of a postgres database table (which has 2 records in it, 2 columns) Here are the errors from the terminal running jetty, I am not sure if the actor/SessionMaster errors are related to the memory errors. ERROR - Couldn't start SessionMaster ping net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster $checkandpur...@7130bd0a could not be scheduled on net.liftweb.http.sessionmast...@36cb1594 at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51) at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$ $doPing(LiftSession.scala:209) at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply $1.apply(LiftSession.scala:200) at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply $1.apply(LiftSession.scala:169) at scala.actors.Reaction.run(Reaction.scala:78) at scala.actors.FJTask$Wrap.run(Unknown Source) at scala.actors.FJTaskRunner.scanWhileIdling(Unknown Source) at scala.actors.FJTaskRunner.run(Unknown Source) Caused by: java.util.concurrent.RejectedExecutionException at java.util.concurrent.ThreadPoolExecutor $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760) at java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:767) at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute (ScheduledThreadPoolExecutor.java:216) at java.util.concurrent.ScheduledThreadPoolExecutor.schedule (ScheduledThreadPoolExecutor.java:379) at java.util.concurrent.Executors $DelegatedScheduledExecutorService.schedule(Executors.java:654) at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49) ... 7 more INFO - Service request (GET) / took 1411 Milliseconds INFO - Service request (GET) /classpath/jquery.js took 7 Milliseconds [INFO] restarting org.mortbay.jetty.plugin.jetty6pluginwebappcont...@5dbb6a69{/,/home/ alex/dev/poc/src/main/webapp} 2009-10-08 14:06:44.221::WARN: Error for /ajax_request/liftAjax.js java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:47.424::WARN: failed LiftFilter: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: failed servlethand...@4838ddcc: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: failed securityhand...@d69a11f: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: failed sessionhand...@11d1011a: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: failed org.mortbay.jetty.plugin.jetty6pluginwebappcont...@5dbb6a69{/,/home/ alex/dev/poc/src/main/webapp}: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: EXCEPTION java.lang.OutOfMemoryError: PermGen space Exception in thread Timer-1 java.lang.OutOfMemoryError: PermGen space --~--~-~--~~~---~--~~ 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
[Lift] YUI Compressor plugin for SBT
Hi all, I've created a plugin hosted here: http://github.com/hoffrocket/sbt-yui Thank you to David Bernard for paving the way with his maven version and to Mark Harrah for creating sbt and providing guidance. I'm working on getting this up on the scala-tools repo, but until then you can build from source. Thanks, Jon --~--~-~--~~~---~--~~ 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: Milestone 6 Released!
Woo! Updating now... On Oct 8, 8:25 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Charles, Thanks for spinning another build. I owe you a beverage or three. The rest of you committers, it's time to dump all those pent-up, review-board approved changes on master. Thanks, David On Thu, Oct 8, 2009 at 5:13 PM, Charles F. Munat c...@munat.com wrote: The Lift team is pleased to announce the lift-1.1-M6 release! Lift is an expressive and elegant framework for writing web applications. Lift stresses the importance of security, maintainability, scalability and performance while allowing for high levels of developer productivity. Lift is a scala web framework. No changes defined in this version. Have fun! -Lift team -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Milestone 6 Released!
Uh, oh, I just updated to M6 from M5 and it Seems that PreCache is broken under H2 when there is an OrderBy: org.h2.jdbc.JdbcSQLException: Order by expression CREATED_AT must be in the result list in this case; SQL statement: SELECT DISTINCT foos.id, foos.name FROM foos WHERE id IN (SELECT foo_id FROM bars WHERE (created_by = ?) ORDER BY created_at DESC LIMIT 100 ) [90068-117] at org.h2.message.Message.getSQLException(Message.java:105) at org.h2.message.Message.getSQLException(Message.java:116) at org.h2.message.Message.getSQLException(Message.java:75) at org.h2.command.dml.Query.initOrder(Query.java:323) at org.h2.command.dml.Select.init(Select.java:637) at org.h2.command.Parser.parseSelect(Parser.java:1343) at org.h2.command.Parser.parsePrepared(Parser.java:394) at org.h2.command.Parser.parse(Parser.java:290) at org.h2.command.Parser.parse(Parser.java:262) at org.h2.command.Parser.prepare(Parser.java:204) at org.h2.engine.Session.prepare(Session.java:400) at org.h2.engine.Session.prepare(Session.java:387) at org.h2.table.TableView.recompileQuery(TableView.java:70) at org.h2.table.TableView.initColumnsAndTables(TableView.java:83) at org.h2.table.TableView.init(TableView.java:60) at org.h2.table.TableView.createTempView(TableView.java:340) at org.h2.expression.ConditionInSelect.optimizeInJoin (ConditionInSelect.java:150) at org.h2.command.dml.Select.prepare(Select.java:725) at org.h2.command.CommandContainer.recompileIfRequired (CommandContainer.java:62) at org.h2.command.CommandContainer.query(CommandContainer.java:78) at org.h2.command.Command.executeQueryLocal(Command.java:142) at org.h2.command.Command.executeQuery(Command.java:123) at org.h2.jdbc.JdbcPreparedStatement.executeQuery (JdbcPreparedStatement.java:99) at net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:295) at net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:294) at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241) at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29) at net.liftweb.mapper.DB$.exec(DB.scala:294) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun $apply$9.apply(MetaMapper.scala:317) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun $apply$9.apply(MetaMapper.scala:315) at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$1.apply (DB.scala:375) at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$1.apply (DB.scala:372) at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241) at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29) at net.liftweb.mapper.DB$.runPreparedStatement(DB.scala:372) at net.liftweb.mapper.DB$.prepareStatement(DB.scala:316) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply (MetaMapper.scala:314) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply (MetaMapper.scala:306) at net.liftweb.mapper.DB$.use(DB.scala:389) at net.liftweb.mapper.MetaMapper$class.findMapFieldDb (MetaMapper.scala:305) at me.model.foo$.findMapFieldDb(foo.scala:17) at net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala: 301) at me.model.foo$.findMapDb(foo.scala:17) at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:267) at me.model.foo$.findAll(foo.scala:17) at net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply (MetaMapper.scala:235) at net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply (MetaMapper.scala:228) at scala.List.foreach(List.scala:841) at net.liftweb.mapper.MetaMapper$class.dealWithPrecache (MetaMapper.scala:228) at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:267) On Oct 8, 9:22 pm, jon jonhoff...@gmail.com wrote: Woo! Updating now... On Oct 8, 8:25 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Charles, Thanks for spinning another build. I owe you a beverage or three. The rest of you committers, it's time to dump all those pent-up, review-board approved changes on master. Thanks, David On Thu, Oct 8, 2009 at 5:13 PM, Charles F. Munat c...@munat.com wrote: The Lift team is pleased to announce the lift-1.1-M6 release! Lift is an expressive and elegant framework for writing web applications. Lift stresses the importance of security, maintainability, scalability and performance while allowing for high levels of developer productivity. Lift is a scala web framework. No changes defined in this version. Have fun! -Lift team -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf
[Lift] Re: Milestone 6 Released!
thanks: http://github.com/dpp/liftweb/issues/#issue/91 On Oct 8, 10:21 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Oct 8, 2009 at 7:01 PM, jon jonhoff...@gmail.com wrote: Uh, oh, Crud. Can you open a ticket with a repro case and I'll add it to the test suite and make sure it gets fixed. I just updated to M6 from M5 and it Seems that PreCache is broken under H2 when there is an OrderBy: org.h2.jdbc.JdbcSQLException: Order by expression CREATED_AT must be in the result list in this case; SQL statement: SELECT DISTINCT foos.id, foos.name FROM foos WHERE id IN (SELECT foo_id FROM bars WHERE (created_by = ?) ORDER BY created_at DESC LIMIT 100 ) [90068-117] at org.h2.message.Message.getSQLException(Message.java:105) at org.h2.message.Message.getSQLException(Message.java:116) at org.h2.message.Message.getSQLException(Message.java:75) at org.h2.command.dml.Query.initOrder(Query.java:323) at org.h2.command.dml.Select.init(Select.java:637) at org.h2.command.Parser.parseSelect(Parser.java:1343) at org.h2.command.Parser.parsePrepared(Parser.java:394) at org.h2.command.Parser.parse(Parser.java:290) at org.h2.command.Parser.parse(Parser.java:262) at org.h2.command.Parser.prepare(Parser.java:204) at org.h2.engine.Session.prepare(Session.java:400) at org.h2.engine.Session.prepare(Session.java:387) at org.h2.table.TableView.recompileQuery(TableView.java:70) at org.h2.table.TableView.initColumnsAndTables(TableView.java:83) at org.h2.table.TableView.init(TableView.java:60) at org.h2.table.TableView.createTempView(TableView.java:340) at org.h2.expression.ConditionInSelect.optimizeInJoin (ConditionInSelect.java:150) at org.h2.command.dml.Select.prepare(Select.java:725) at org.h2.command.CommandContainer.recompileIfRequired (CommandContainer.java:62) at org.h2.command.CommandContainer.query(CommandContainer.java:78) at org.h2.command.Command.executeQueryLocal(Command.java:142) at org.h2.command.Command.executeQuery(Command.java:123) at org.h2.jdbc.JdbcPreparedStatement.executeQuery (JdbcPreparedStatement.java:99) at net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:295) at net.liftweb.mapper.DB$$anonfun$exec$3.apply(DB.scala:294) at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241) at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29) at net.liftweb.mapper.DB$.exec(DB.scala:294) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun $apply$9.apply(MetaMapper.scala:317) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1$$anonfun $apply$9.apply(MetaMapper.scala:315) at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$1.apply (DB.scala:375) at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$1.apply (DB.scala:372) at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241) at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29) at net.liftweb.mapper.DB$.runPreparedStatement(DB.scala:372) at net.liftweb.mapper.DB$.prepareStatement(DB.scala:316) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply (MetaMapper.scala:314) at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply (MetaMapper.scala:306) at net.liftweb.mapper.DB$.use(DB.scala:389) at net.liftweb.mapper.MetaMapper$class.findMapFieldDb (MetaMapper.scala:305) at me.model.foo$.findMapFieldDb(foo.scala:17) at net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala: 301) at me.model.foo$.findMapDb(foo.scala:17) at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:267) at me.model.foo$.findAll(foo.scala:17) at net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply (MetaMapper.scala:235) at net.liftweb.mapper.MetaMapper$$anonfun$dealWithPrecache$1.apply (MetaMapper.scala:228) at scala.List.foreach(List.scala:841) at net.liftweb.mapper.MetaMapper$class.dealWithPrecache (MetaMapper.scala:228) at net.liftweb.mapper.MetaMapper$class.findAll(MetaMapper.scala:267) On Oct 8, 9:22 pm, jon jonhoff...@gmail.com wrote: Woo! Updating now... On Oct 8, 8:25 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Charles, Thanks for spinning another build. I owe you a beverage or three. The rest of you committers, it's time to dump all those pent-up, review-board approved changes on master. Thanks, David On Thu, Oct 8, 2009 at 5:13 PM, Charles F. Munat c...@munat.com wrote: The Lift team is pleased to announce the lift-1.1-M6 release! Lift is an expressive and elegant framework for writing web
[Lift] Re: java.lang.OutOfMemoryError: PermGen space, Could't start SessionMaster ping
Yes, I think this will get you going with javarebel: MAVEN_OPTS=-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=128m - Xmx512m -noverify -javaagent:/path/to/jrebel-2.1/jrebel.jar mvn jetty:run in another terminal window mvn scala:cc get a free license here: http://www.zeroturnaround.com/scala-license/ - Jon On Oct 8, 10:18 pm, Alex Black a...@alexblack.ca wrote: Hi Jon, I haven't narrowed it down to being after a context reload or not. I'll try what you suggested and turn off jetty's reload and use javaRebel instead. Where would I set those JVM flags, should those go in MAVEN_OPTS? I'll keep SBT in mind... - ALex On Oct 8, 4:37 pm, jon jonhoff...@gmail.com wrote: Hi, Is this error occurring after a context reload? You may want to turn off context reloading in your mvn jetty configuration because, as far as i can tell, that has always been a completely broken feature. Do this by adding scanIntervalSeconds0/scanIntervalSeconds to the org.mortbay.jetty configuration/ You can setup javarebel if you want to avoid restarting the container for minor code changes. You may still run into permgen issues as javarebel reloads classes too. But, these JVM flags will help reduce the frequency further: -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=128m (add to your MAVEN_OPTS env variable) I would also suggest looking into sbt as the continuous compilation is much more robust than scala:cc (it keeps track of dependencies and will recompile the entire tree). The only downside is there's no yui compressor plugin, yet. - Jon On Oct 8, 2:16 pm, Timothy Perrett timo...@getintheloop.eu wrote: Alex, Any reason your running the install goal? You really don't need to. Regarding the permgen: Can you show your maven options? You can improve the situation by setting a larger heap size, however this is an unfortunate thing that just goes along with jetty and maven. HTH Cheers, Tim On Oct 8, 7:10 pm, Alex Black a...@alexblack.ca wrote: I've encountered this error 3 times, running Jetty and Maven, just trying out Lift scala with a hello-world like website. I have to kill the JVM with kill -9 and restart things to fix it, any ideas? - Command line: mvn install jetty:run - I'm using Lift 1.0, Scala 2.7.6 final, 64bit JDK1.6.0_16, on Ubuntu Desktop x64. - My app is trivial, no comet or actors or mapping, one view, one class, lists records out of a postgres database table (which has 2 records in it, 2 columns) Here are the errors from the terminal running jetty, I am not sure if the actor/SessionMaster errors are related to the memory errors. ERROR - Couldn't start SessionMaster ping net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster $checkandpur...@7130bd0a could not be scheduled on net.liftweb.http.sessionmast...@36cb1594 at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:51) at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$ $doPing(LiftSession.scala:209) at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply $1.apply(LiftSession.scala:200) at net.liftweb.http.SessionMaster$$anonfun$act$1$$anonfun$apply $1.apply(LiftSession.scala:169) at scala.actors.Reaction.run(Reaction.scala:78) at scala.actors.FJTask$Wrap.run(Unknown Source) at scala.actors.FJTaskRunner.scanWhileIdling(Unknown Source) at scala.actors.FJTaskRunner.run(Unknown Source) Caused by: java.util.concurrent.RejectedExecutionException at java.util.concurrent.ThreadPoolExecutor $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760) at java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:767) at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute (ScheduledThreadPoolExecutor.java:216) at java.util.concurrent.ScheduledThreadPoolExecutor.schedule (ScheduledThreadPoolExecutor.java:379) at java.util.concurrent.Executors $DelegatedScheduledExecutorService.schedule(Executors.java:654) at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:49) ... 7 more INFO - Service request (GET) / took 1411 Milliseconds INFO - Service request (GET) /classpath/jquery.js took 7 Milliseconds [INFO] restarting org.mortbay.jetty.plugin.jetty6pluginwebappcont...@5dbb6a69{/,/home/ alex/dev/poc/src/main/webapp} 2009-10-08 14:06:44.221::WARN: Error for /ajax_request/liftAjax.js java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:47.424::WARN: failed LiftFilter: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: failed servlethand...@4838ddcc: java.lang.OutOfMemoryError: PermGen space 2009-10-08 14:06:48.053::WARN: failed securityhand...@d69a11f
[Lift] Re: YUI Compressor Fatal Error
Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO] task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Mon Oct 05 17:18:57 UTC 2009 [INFO] Final Memory: 27M/66M [INFO] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to
[Lift] Re: apache proxy_balancer
I was able to get things working and am now fairly confident that I have enough power on my front end to completely melt my database. I think the real benefits will be failover and the ability to stage releases. Btw, as far as I can tell, apache proxy_balancer is the only open source choice for load balancing with sticky sessions. Is anyone aware of other options? I would much rather be using nginx. I'm aware that there's a third party module for session stickyness, but not sure if it's at a usable stage: http://code.google.com/p/nginx-upstream-jvm-route/ I'm actually not sure what the problem was with the config below, though the duplicate ProxyPass / balancer://cluster/ was probably not helping - Jon On Sep 16, 7:05 pm, jon jonhoff...@gmail.com wrote: Hi, Is anyone running lift behind apache with proxy_balancer? I'm trying to get that setup, but seeing a really odd problem where the javascript on the page seems to cause continuous reloading on some pages. I haven't yet fully investigated the problem, but am wondering if anyone has some pointers for getting that setup correctly. Here's what I'm doing: In my apache config: ProxyPass /balancer ! ProxyPass / balancer://cluster/ stickysession=jsessionid|JSESSIONID nofailover=On Proxy balancer://cluster BalancerMemberhttp://serveroneloadfactor=50 route=n2 BalancerMemberhttp://servertwoloadfactor=50 route=n1 /Proxy ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy ProxyPreserveHost On ProxyPass / balancer://cluster/ And in each of my jetty.xml files, something like this: Set name=sessionIdManager New class=org.mortbay.jetty.servlet.HashSessionIdManager Set name=workerNamen2/Set /New /Set --~--~-~--~~~---~--~~ 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: FacebookRestApi examples?
Hi Keith, You're missing a step in the process. The auth_token needs to be authenticated with facebook before you request a session. You would do this by visiting a url like http://www.facebook.com/login.php?api_key=KEYauth_token=TOKEN in a web browser. I am using the FB API in a connect application, but have forked to speak json and added a few extra calls. - Jon On Sep 15, 8:02 pm, Keith K quasike...@gmail.com wrote: I don't see any thing obviously wrong in the facebook package's method def genSignature(allParams: List[(String, Any)], secret: String). Wish I did! -Keith On Sep 15, 3:34 pm, Keith K quasike...@gmail.com wrote: Hello, I am able to get a certain distance, to the point where FB gives me back an authToken. Here is my code. println(FacebookRestApi.apiKey = + FacebookRestApi.apiKey); val respNode: Node = FacebookClient !? (AuthCreateToken); val authToken = respNode.text; println(authToken = + authToken); val fbSession: Option[FacebookSession] = FacebookSession.fromAuthToken(authToken) println(fbSession = + fbSession.toString); This doesn't include the code for the apiKey and secret. I see the following output: FacebookRestApi.apiKey = 25548077c8db93252a947a525d93be02 authToken = cd86be265bfcacf96a2dc392ffed874c fbSession = None Maybe as a scala newbie, I'm not handling the fbSession code properly, but it's coming back with None, which seems weird to me. On Sep 15, 2:02 pm, TylerWeir tyler.w...@gmail.com wrote: I believe Jorge did the original implementation. I'm not sure if anyone else is using it. I'd suggest starting on your own app and post when you hit a stumbling block. Someone on the list will take a look. On Sep 15, 4:46 pm, Keith K quasike...@gmail.com wrote: Hello, Are there any code examples that use the Lift Facebook package? I encountered one in the Lift Book, but it is incomplete. I have spent a lot of time searching, but am only able to find the implementation of it, not any unit test or some sample code to set up a session, facebook client, etc. Thanks, -Keith --~--~-~--~~~---~--~~ 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] apache proxy_balancer
Hi, Is anyone running lift behind apache with proxy_balancer? I'm trying to get that setup, but seeing a really odd problem where the javascript on the page seems to cause continuous reloading on some pages. I haven't yet fully investigated the problem, but am wondering if anyone has some pointers for getting that setup correctly. Here's what I'm doing: In my apache config: ProxyPass /balancer ! ProxyPass / balancer://cluster/ stickysession=jsessionid|JSESSIONID nofailover=On Proxy balancer://cluster BalancerMember http://serverone loadfactor=50 route=n2 BalancerMember http://servertwo loadfactor=50 route=n1 /Proxy ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy ProxyPreserveHost On ProxyPass / balancer://cluster/ And in each of my jetty.xml files, something like this: Set name=sessionIdManager New class=org.mortbay.jetty.servlet.HashSessionIdManager Set name=workerNamen2/Set /New /Set --~--~-~--~~~---~--~~ 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] Expires: header value set two times in response header?
Is this ok? $ curl -I demo.liftweb.net HTTP/1.1 200 OK Server: nginx/0.6.32 Date: Tue, 15 Sep 2009 06:37:32 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: JSESSIONID=4ybw6k5861ab;Path=/ Content-Length: 8061 Expires: Tue, 15 Sep 2009 06:37:32 UTC Cache-Control: no-cache; private; no-store; must-revalidate; max- stale=0; post-check=0; pre-check=0; max-age=0 Pragma: no-cache X-Lift-Version: 1.1-SNAPSHOT --~--~-~--~~~---~--~~ 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] mvn war has no love for yui compressor
Hi, I have my js and css in my webapp directory and for a long time I had been blissfully assuming that everything was nicely minified in my deployed wars. So, I was very shocked to notice that although yui compressor appears to be doing its magic during the compile stage, its output is overwritten by mvn during the war stage. Grrr. I believe that this is not a problem if js css are put in the resources directory? but that seems less than ideal. I played around a bit with the pom and got to this working solution: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId configuration webResources resource directory${project.build.directory}/minimized/ directory targetPath//targetPath filteringfalse/filtering /resource /webResources /configuration /plugin plugin groupIdnet.sf.alchim/groupId artifactIdyuicompressor-maven-plugin/artifactId executions execution goals goalcompress/goal /goals /execution /executions configuration webappDirectory${project.build.directory}/minimized/ webappDirectory nosuffixtrue/nosuffix /configuration /plugin --~--~-~--~~~---~--~~ 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 XML special chars rendered by lift, others not in 1.1-SNAPSHOT
Hi, I've noticed that some special char xml tags are being interpreted by lift rather than passing through to the browser. source code in my template: div amp; copy; quot; raquo; lt; gt; /div result from curl http://localhost:8080/ div amp; © quot; » lt; gt; /div The rendered characters are problematic in IE7. A fix or workaround would be much appreciated. Thanks, - Jon --~--~-~--~~~---~--~~ 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 XML special chars rendered by lift, others not in 1.1-SNAPSHOT
Ah, IE7 seems to be confused about the character encoding of the page. When the encoding is set to Auto Select it chooses Western European (Windows) and the © displays as ©. If I turn off Auto Select and manually set to Unicode (UTF-8) it displays correctly. I have LiftRules.early.append(makeUtf8) in Boot. And the page includes ?xml version=1.0 encoding=UTF-8? Any ideas? Thanks, Jon On Sep 8, 9:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 7, 2009 at 11:38 PM, jon jonhoff...@gmail.com wrote: Hi, I've noticed that some special char xml tags are being interpreted by lift rather than passing through to the browser. source code in my template: div amp; copy; quot; raquo; lt; gt; /div result from curlhttp://localhost:8080/ div amp; © quot; » lt; gt; /div The rendered characters are problematic in IE7. Why? A fix or workaround would be much appreciated. The raw XHTML is valid. Lift is yielding non-ASCII characters, but they are UTF-8 encoded and should be correctly rendered on all browsers. I have never seen a problem with IE6 or IE7 (I have not tested in IE8) Thanks, - Jon -- 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: how do you set system properties in lift?
Note that if you're on 1.1-SNAPSHOT you can set customProperties on the Mailer which would allow to use some other configuration mechanism than system property (like Props or Configgy). val props = Map[String,String](mail.smtp.host - ...) Mailer.customProperties = props Mailer.authenticator = Full(new Authenticator(){ override def getPasswordAuthentication = new PasswordAuthentication(f...@foo.com,bar) }) Mailer.buildProps would return the Properties the Mailer is currently using. - Jon On Sep 8, 2:29 pm, Tim Nelson tnell...@gmail.com wrote: You need to set system properties: System.setProperty(mail.smtp.starttls.enable,true); System.setProperty(mail.smtp.host, host) System.setProperty(mail.smtp.port, 587) System.setProperty(mail.smtp.auth, true) Mailer.authenticator = Full(new Authenticator { override def getPasswordAuthentication = new PasswordAuthentication(user, password) }) Tim On Tue, Sep 8, 2009 at 12:03 PM, george geo...@mattandgeorge.com wrote: say I wanted to change the port / host that the Mailer uses. how would I go about that? 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: Some XML special chars rendered by lift, others not in 1.1-SNAPSHOT
Aha, It is a header problem. If the charset is specified in the content- type IE will pick the right encoding. I added the following to my Boot (I already had LiftRules.useXhtmlMimeType = false): LiftRules.determineContentType = { case _ = text/html; charset=utf-8 } Maybe this should be the default? Thanks! On Sep 8, 2:45 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Sep 8, 2009 at 10:37 AM, jon jonhoff...@gmail.com wrote: Ah, IE7 seems to be confused about the character encoding of the page. When the encoding is set to Auto Select it chooses Western European (Windows) and the © displays as ©. If I turn off Auto Select and manually set to Unicode (UTF-8) it displays correctly. I wonder if this is a header issue... I'll put this on my to do list to investigate. Although, I bet Tim has something to say about it. I have LiftRules.early.append(makeUtf8) in Boot. And the page includes ?xml version=1.0 encoding=UTF-8? Any ideas? Thanks, Jon On Sep 8, 9:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Sep 7, 2009 at 11:38 PM, jon jonhoff...@gmail.com wrote: Hi, I've noticed that some special char xml tags are being interpreted by lift rather than passing through to the browser. source code in my template: div amp; copy; quot; raquo; lt; gt; /div result from curlhttp://localhost:8080/ div amp; © quot; » lt; gt; /div The rendered characters are problematic in IE7. Why? A fix or workaround would be much appreciated. The raw XHTML is valid. Lift is yielding non-ASCII characters, but they are UTF-8 encoded and should be correctly rendered on all browsers. I have never seen a problem with IE6 or IE7 (I have not tested in IE8) Thanks, - Jon -- 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] solution to jetty:run locks files on windows problem
Hi all, If you happen to be developing under windows you will notice that mvn jetty:run locks files and prevents editing while the server is running. Super annoying. The problem is that jetty memory maps files by default and windows locks memory mapped files. The solution is to turn off the mapped files switch in jetty. Instructions are here: When using jetty:run, CSS and JavaScript files are locked - how can I fix this? http://appfuse.org/display/APF/FAQ --~--~-~--~~~---~--~~ 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: solution to jetty:run locks files on windows problem
Done: http://wiki.github.com/dpp/liftweb/how-to-fix-file-locking-problem-with-jettyrun-in-windows On Sep 7, 1:49 pm, Timothy Perrett timo...@getintheloop.eu wrote: Jon, good stuff - perhaps write this up on the wiki: http://wiki.github.com/dpp/liftweb Cheers, Tim On Sep 7, 6:09 pm, jon jonhoff...@gmail.com wrote: Hi all, If you happen to be developing under windows you will notice that mvn jetty:run locks files and prevents editing while the server is running. Super annoying. The problem is that jetty memory maps files by default and windows locks memory mapped files. The solution is to turn off the mapped files switch in jetty. Instructions are here: When using jetty:run, CSS and JavaScript files are locked - how can I fix this?http://appfuse.org/display/APF/FAQ --~--~-~--~~~---~--~~ 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] Upcoming 1.1-M5?
Hey, Just wondering if there are plans to create a new milestone sometime soon, or if there is some other way to freeze my lift libraries to a stable build of 1.1-SNAPSHOT while still using maven to manage the dependencies. - Jon --~--~-~--~~~---~--~~ 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: Mapper subclasses
You could also do this: trait HasCreated [T : HasCreated[T]] extends KeyedMapper[Long, T] { self: T = object created_at extends MappedDateTime(this) } //mix into your meta object: trait HasCreatedMetaMapper[T : HasCreated[T]] { self: T with LongKeyedMetaMapper[T] = import java.util.Date def findByCreated(startDate:Date, endDate:Date) = findAll(By_ (created_at, startDate), By_(created_at, endDate)) } On Sep 3, 10:16 am, Giuseppe Fogliazza g.foglia...@mcmspa.it wrote: As an alternative to asInstanceOf you could use explicit type parameter in MappedField creation: self:MapperType = object xdatetime extends MappedDateTime[MapperType](this) On 3 Set, 09:19, Giuseppe Fogliazza g.foglia...@mcmspa.it wrote: Unfortunately you cannot escape from asInstanceOf . Forcing self:MapperType the type of this will be TimeStamp with MapperType violating the constraint for the type of the first parameter of MappedDateTime :T : Mapper[T]. Regards Giuseppe On 3 Set, 07:08, Naftoli Gugenheim naftoli...@gmail.com wrote: So I guess you can't escape the asInstanceOf. Can you successfully give the trait a self-type of this: MapperType =, or declare it to extend Mapper[MapperType], without running into problems elsewhere? - harryhhar...@gmail.com wrote: I've been handling this with traits, for example I have something like so: trait Timestamp[MapperType : Mapper[MapperType]] { object xdatetime extends MappedDateTime[MapperType](this.asInstanceOf [MapperType]) // all sorts of utility functions for dealing with timestamps } Then I can do class Foo extends LongKeyedMapper[Foo] with IdPK with Timestamp[Foo] { // additional fields that are Foo specific } I have quite a few traits similar to Timestamp at this point corresponding to various fields that appear in lots of different tables in my application. -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] Proposed improvement to CRUDify
Hi, I think the _showAllTemplate should wrap the header and footer rows in thead and tfoot blocks respectively so that the table plays nice with the TableSorter widget. - Jon --~--~-~--~~~---~--~~ 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] SparkLines broken in 1.1-SNAPSHOT
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 --~--~-~--~~~---~--~~ 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: How to create (meta) mapper mixin?
Hi Jeppe, I did something similar with the following code: trait HasUser [T : HasUser[T]] extends KeyedMapper[Long, T]{ self: T= object user extends MappedLongForeignKey(this, User) { override def dbColumnName = user_id } } trait HasUserMetaMapper[T : HasUser[T]] { self: T with LongKeyedMetaMapper[T] = def findAllByUserId(uid:Long) = findAll(By(user,uid)) } On Aug 24, 5:31 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: Hi, I'm trying to create some mixins to be applied to mapper/metamapper objects to be used when objects are always owned by an account (ie. a multi tenant db) The mapper parts works fine: trait OwnedEntity { self: BaseMapper = object account extends MappedLongForeignKey(this.asInstanceOf[MapperType], Account) { override def dbColumnName = account_id override def dbDisplay_? = false override def defaultValue = Account.currentAccount } } but I can't seem to figure out the correct type bounds to create a MetaMapper mixin that uses the above. Simple example with just a findMap that finds all the entities owned by the current account: trait MetaOwnedEntity[A : OwnedEntity] { self: A with MetaMapper[A] = // Find and map all entities owner by current account def findMap[T](f: MapperType = Box[T]) : List[T] = findMap(By(account, Account.currentAccount))(f) } this fails compilation (1.1-SNAPSHOT), any clues? EntityUtils.scala:23: error: overloaded method value apply with alternatives [O : net.liftweb.mapper.Mapper[O],T,Q : net.liftweb.mapper.KeyedMapper[T,Q]](net.liftweb.mapper.MappedForeignKey[T, O,Q],net.liftweb.util.Box[Q])net.liftweb.mapper.Cmp[O,T] and [O : net.liftweb.mapper.Mapper[O],T,Q : net.liftweb.mapper.KeyedMapper[T,Q]](net.liftweb.mapper.MappedForeignKey[T, O,Q],Q)net.liftweb.mapper.Cmp[O,T] and [O : net.liftweb.mapper.Mapper[O],T,U](net.liftweb.mapper.MappedField[T,O],U)(im plicit (U) = T)net.liftweb.mapper.Cmp[O,T] cannot be applied to (MetaOwnedEntity.this.account.type,Long) def findMap[T](f: MapperType = Box[T]) : List[T] = findMap(By(account, Account.currentAccount))(f) /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com 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] AutoComplete IE bug?
Hi, The AutoComplete widget leaves a trailing , in the javascript that causes IE to complain and not function. Or, at least i think that's the only reason that it's not functioning in IE. Has anyone else noticed this problem? AutoComplete.scala:124 - Jon --~--~-~--~~~---~--~~ 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: AutoComplete IE bug?
btw, i removed the trailing , and confirmed that it fixes the IE problem. - jon On Aug 19, 3:38 pm, marius d. marius.dan...@gmail.com wrote: If no other committer wants to look into this I'll look on it. Tim, would this interest you ? Br's, Marius On Aug 19, 9:13 pm, jon jonhoff...@gmail.com wrote: Hi, The AutoComplete widget leaves a trailing , in the javascript that causes IE to complain and not function. Or, at least i think that's the only reason that it's not functioning in IE. Has anyone else noticed this problem? AutoComplete.scala:124 - Jon --~--~-~--~~~---~--~~ 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] Skip lift processing for single html file
Hi, How do I tell lift to serve /foo.html directly (without parsing xml or adding javascript) where foo.html is a file that lives in my webapp folder? I still want lift to process the rest of my html files. - Jon --~--~-~--~~~---~--~~ 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: how to do basic joins
One possibility is to do Baz.findAllBy{PreparedStatement,InsecureSql} (section 6.3.2 of lift book) I am also curious if there is a safe way to construct a join. - Jon On Aug 13, 3:41 pm, harryh har...@gmail.com wrote: I have 3 classes like so class Foo extends LongKeyedMapper[Foo] with IdPK def getBazes = { Baz.findAll(...) } } class Bar extends LongKeyedMapper[Bar] with IdPK object fooid extends MappedLongForeignKey(this, Foo) } class Baz extends LongKeyedMapper[Baz] with IdPK object barid extends MappedLongForeignKey(this, Bar) } How do I write Baz.findAll(...) so it will give me all the Bazes that point to any Bars that point to the Foo. In SQL I would write something like this: SELECT * FROM bazzes WHERE bazzes.barid = bars.id AND bars.fooid = 111; (where 111 is foo.id) I feel like I should be using ByRef here? But it's not clear to me how to do it. -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: bind with outer element?
Hi, I actually solved by wrapping the node i cared about in another node, but tried the FuncBindParam and it does seem to only grab the child nodes. On Aug 11, 11:37 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Doesn't the FuncBindParam only get the element's child NodeSeq? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Mon, Aug 10, 2009 at 1:44 PM, jon jonhoff...@gmail.com wrote: Hi, I have a template with the following lift:Snippit t:name shorten=true / t:foo form=POST form:name/ ... /t:foo /lift:Snippet And a snippet like: def doSnippet(x:NodeSeq):NodeSeq = { bind(t, x, name- (doName(_)), try: def myFunc(node: NodeSeq): NodeSeq = if ((node \ @shorten).isEmpty) longVersion else shortVersion bind(t, x, FuncBindParam(name, myFunc _)) You get the complete t:name shorten=true/ passed to myFunc. Thanks, David foo - (doForm(_)) ) } In the code above only the contents of the bound tags are available for doName and doForm, if I want to be able to read the attribute shorten in doName and have foo render with an enclosing form tag, how do I create the bind params? I am doing an expensive batch operation upfront, so I want everything to be in the same snippet. Thanks, Jon -- 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: ajaxForm with mapped function
Thanks Dave, I explored both of those routes. The hidden field would allow me to execute on the server, but not send back JS to execute on the client. The ajaxButton would allow me to execute code on the client, but not submit the form (unless I put the form serialize code in the button?). I wanted the JS code to vary depending on input from the whole form submission. On Aug 11, 8:17 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Aug 11, 2009 at 3:31 PM, jon jonhoff...@gmail.com wrote: Hi, I'm not sure if this behavior already exists via some other mechanism, but I wanted an ajaxForm that executed a JsCmd sent from the sever after submit. Here it is: def ajaxForm(body: NodeSeq,func: ()=JsCmd) = { val id = Helpers.nextFuncName fmapFunc(func)(name = form action=javascript:// id={id} onsubmit={makeAjaxCall(LiftRules.jsArtifacts.serialize(id)).toJsCmd+; return false;} input type=hidden name={name} value=true/ {body} /form) } Is there a better way? You could use an ajaxButton to update the div... alternatively, put an SHtml.hidden field in the form itself. jsonForms seemed like a bit of overkill to do what i wanted= simple update of div after submit. - Jon -- 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] h2 web console
Hi, For those using h2, you can make a call to the following function from boot to start up a web console while you're running in development mode: def startH2WebConsole = { if (Props.mode == Props.RunModes.Development) { import _root_.org.h2.server.web.WebServer import _root_.org.h2.tools.Server import _root_.org.h2.util.StartBrowser val webServer = new WebServer() val server = new Server(webServer, Array(-webPort, 0)) server.start DBVendor.newConnection(DefaultConnectionIdentifier).map (c=StartBrowser.openURL(webServer.addSession(c))) } } - Jon --~--~-~--~~~---~--~~ 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: ajaxForm with mapped function
That is surprising... revised function: def ajaxForm(body: NodeSeq,func: ()=JsCmd) = { SHtml.ajaxForm(body ++ SHtml.hidden(func)) } very cool! thanks, - jon On Aug 12, 11:51 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Aug 12, 2009 at 8:14 AM, jon jonhoff...@gmail.com wrote: Thanks Dave, I explored both of those routes. The hidden field would allow me to execute on the server, but not send back JS to execute on the client. The ajaxButton would allow me to execute code on the client, but not submit the form (unless I put the form serialize code in the button?). I wanted the JS code to vary depending on input from the whole form submission. Try it... you'll be surprised. If you have a SHtml.hidden() that returns a JsCmd, that JsCmd will be sent to the browser. On Aug 11, 8:17 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Aug 11, 2009 at 3:31 PM, jon jonhoff...@gmail.com wrote: Hi, I'm not sure if this behavior already exists via some other mechanism, but I wanted an ajaxForm that executed a JsCmd sent from the sever after submit. Here it is: def ajaxForm(body: NodeSeq,func: ()=JsCmd) = { val id = Helpers.nextFuncName fmapFunc(func)(name = form action=javascript:// id={id} onsubmit={makeAjaxCall(LiftRules.jsArtifacts.serialize(id)).toJsCmd+; return false;} input type=hidden name={name} value=true/ {body} /form) } Is there a better way? You could use an ajaxButton to update the div... alternatively, put an SHtml.hidden field in the form itself. jsonForms seemed like a bit of overkill to do what i wanted= simple update of div after submit. - Jon -- 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: bind with outer element?
Thanks Ross! that works. On Aug 12, 1:59 pm, Ross Mellgren dri...@gmail.com wrote: BindHelpers.currentNode is a Box[NodeSeq] that gives you the node that bind is currently replacing. -Ross On Aug 12, 2009, at 11:02 AM, jon wrote: Hi, I actually solved by wrapping the node i cared about in another node, but tried the FuncBindParam and it does seem to only grab the child nodes. On Aug 11, 11:37 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Doesn't the FuncBindParam only get the element's child NodeSeq? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Mon, Aug 10, 2009 at 1:44 PM, jon jonhoff...@gmail.com wrote: Hi, I have a template with the following lift:Snippit t:name shorten=true / t:foo form=POST form:name/ ... /t:foo /lift:Snippet And a snippet like: def doSnippet(x:NodeSeq):NodeSeq = { bind(t, x, name- (doName(_)), try: def myFunc(node: NodeSeq): NodeSeq = if ((node \ @shorten).isEmpty) longVersion else shortVersion bind(t, x, FuncBindParam(name, myFunc _)) You get the complete t:name shorten=true/ passed to myFunc. Thanks, David foo - (doForm(_)) ) } In the code above only the contents of the bound tags are available for doName and doForm, if I want to be able to read the attribute shorten in doName and have foo render with an enclosing form tag, how do I create the bind params? I am doing an expensive batch operation upfront, so I want everything to be in the same snippet. Thanks, Jon -- 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] ajaxForm with mapped function
Hi, I'm not sure if this behavior already exists via some other mechanism, but I wanted an ajaxForm that executed a JsCmd sent from the sever after submit. Here it is: def ajaxForm(body: NodeSeq,func: ()=JsCmd) = { val id = Helpers.nextFuncName fmapFunc(func)(name = form action=javascript:// id={id} onsubmit={makeAjaxCall(LiftRules.jsArtifacts.serialize(id)).toJsCmd+; return false;} input type=hidden name={name} value=true/ {body} /form) } Is there a better way? jsonForms seemed like a bit of overkill to do what i wanted= simple update of div after submit. - Jon --~--~-~--~~~---~--~~ 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] bind with outer element?
Hi, I have a template with the following lift:Snippit t:name shorten=true / t:foo form=POST form:name/ ... /t:foo /lift:Snippet And a snippet like: def doSnippet(x:NodeSeq):NodeSeq = { bind(t, x, name- (doName(_)), foo - (doForm(_)) ) } In the code above only the contents of the bound tags are available for doName and doForm, if I want to be able to read the attribute shorten in doName and have foo render with an enclosing form tag, how do I create the bind params? I am doing an expensive batch operation upfront, so I want everything to be in the same snippet. Thanks, Jon --~--~-~--~~~---~--~~ 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 demo website down
Hi David, What strategies would you employ to protect yourself against such an attack? Thanks - Jon On Aug 7, 9:30 am, David Pollak feeder.of.the.be...@gmail.com wrote: It's up. Please try again. Occasionally, the site gets session-bombed (some external system creates thousands of new sessions) which causes an out of memory condition on the slice-hosted instance. On Fri, Aug 7, 2009 at 6:23 AM, Terry J. Leach terry.le...@gmail.comwrote: The Lift demo website is displaying a 502 Bad Gateway error message -- 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] How do I create a function that takes MetaMappers?
I'd like to do something like def findAll[T : LongKeyedMapper[T],M : LongKeyedMetaMapper[T]] (metaObject: M): List[T] = { metaObject.findAll } val users:List[User] = findAll(User) val foos:List[Foo] = findAll(Foo) But the compiler won't have it. --~--~-~--~~~---~--~~ 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: How do I create a function that takes MetaMappers?
val users:List[User] = findAll(User) -- inferred type arguments [Nothing,object com.x.lift.model.User] do not conform to method findAll's type parameter bounds [T : net.liftweb.mapper.LongKeyedMapper[T],M : net.liftweb.mapper.LongKeyedMetaMapper[T]] if i change to: val users:List[User] = findAll[User,User](User) -- type arguments [com.x.lift.model.User,com.x.lift.model.User] do not conform to method findAll's type parameter bounds [T : net.liftweb.mapper.LongKeyedMapper[T],M : net.liftweb.mapper.LongKeyedMetaMapper[T]] thanks, jon On Aug 6, 3:12 pm, Ross Mellgren dri...@gmail.com wrote: What complaint does the compiler have? -Ross On Aug 6, 2009, at 2:06 PM, jon wrote: I'd like to do something like def findAll[T : LongKeyedMapper[T],M : LongKeyedMetaMapper[T]] (metaObject: M): List[T] = { metaObject.findAll } val users:List[User] = findAll(User) val foos:List[Foo] = findAll(Foo) But the compiler won't have it. --~--~-~--~~~---~--~~ 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: How do I create a function that takes MetaMappers?
Thanks Naftoli, is this what you mean? def findAll[T : LongKeyedMapper[T]] (metaObject: LongKeyedMetaMapper[T]): List[T] = { metaObject.findAll } **val users:List[User] = findAll[User](User) still get **- type arguments [com.udorse.lift.model.User] do not conform to method findAll's type parameter bounds [T : net.liftweb.mapper.LongKeyedMapper[T]] On Aug 6, 3:30 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Pull M out as a type parameter and just declare the value parameter to be whatever M means. - Ross Mellgrendri...@gmail.com wrote: What complaint does the compiler have? -Ross On Aug 6, 2009, at 2:06 PM, jon wrote: I'd like to do something like def findAll[T : LongKeyedMapper[T],M : LongKeyedMetaMapper[T]] (metaObject: M): List[T] = { metaObject.findAll } val users:List[User] = findAll(User) val foos:List[Foo] = findAll(Foo) But the compiler won't have it. --~--~-~--~~~---~--~~ 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: How do I create a function that takes MetaMappers?
excellent! thank you both. - jon On Aug 6, 3:47 pm, Ross Mellgren dri...@gmail.com wrote: Naftoli's suggestion is good, but I think your problem now is that User is not : LongKeyedMapper, it's : KeyedMapper. Here's one that compiles: object Test { def findAll[T](m: KeyedMetaMapper[_, T]) = m.findAll def test { val users: List[User] = findAll(User) users } } On Aug 6, 2009, at 3:39 PM, jon wrote: Thanks Naftoli, is this what you mean? def findAll[T : LongKeyedMapper[T]] (metaObject: LongKeyedMetaMapper[T]): List[T] = { metaObject.findAll } **val users:List[User] = findAll[User](User) still get **- type arguments [com.udorse.lift.model.User] do not conform to method findAll's type parameter bounds [T : net.liftweb.mapper.LongKeyedMapper[T]] On Aug 6, 3:30 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Pull M out as a type parameter and just declare the value parameter to be whatever M means. - Ross Mellgrendri...@gmail.com wrote: What complaint does the compiler have? -Ross On Aug 6, 2009, at 2:06 PM, jon wrote: I'd like to do something like def findAll[T : LongKeyedMapper[T],M : LongKeyedMetaMapper[T]] (metaObject: M): List[T] = { metaObject.findAll } val users:List[User] = findAll(User) val foos:List[Foo] = findAll(Foo) But the compiler won't have it. --~--~-~--~~~---~--~~ 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: Eclipse setup
I've found that simply closing all the open files and re-opening fixes some quirks. I'm using eclipse 3.5, IAM .10, scala 2.7.5, and javarebel-plugin 1.0.3 with javarebel 2.0.2b Is anyone else using javarebel with eclipse? I just run RunWebApp as a scala Application from within eclipse with javarebel. It works well when changing non-singletons-- Better than using jetty on a scanInterval which leaks permgen when it reloads the context. - Jon On Aug 6, 6:27 pm, Jonathan A Ferguson j...@spiralarm.com wrote: See if the following configuration helps you as it solved most of my problems. http://blog.spiralarm.com/richard/2009/07/using-existing-scala-maven-... Cheers Jono On 07/08/2009, at 6:44 AM, Steffen Weißmann wrote: You have two output folders: the Scala IDE = 2.7.5.final only supports one. Use a single default output folder. That helped somehow, at least in the Boot.scala file it was pretty much ok. But the other files were no better. For instance, clicking on MetaProtoUser still opens Object.java source... You also have source directories nested below the top level of your project. Although I've seen reports that this works from various people, there's code in 2.7.5.final and earlier which makes this unlikely. If switching to a single output folder doesn't solve your problems try also moving your source directories to the top level. I tried to move the scala src folder src/main/scala to the project root, but that didn't improve things. I really would like to use eclipse, but right now i am using idea (even though I completely agree with David Pollaks blog posts...) since it usually understands the scala source code and it usually displays the lift code (and also other code) properly. I guess several people are developing lift projects with eclipse, so I hope there is a chance to get it working. Is there any configuration (Eclipse version+plugin versions+project setup) that is known to work? Both of these issues are fixed on trunk (but don't go there unless you're using the Lift 2.8.0 branch). Unfortunately it didn't help to avoid these two issues... Let me know how you get on ... Well, I switched to idea for now, and i don't like it. Would it make sense to use the trunk version? Cheers, Steffen. Cheers, Miles -- Miles Sabin tel: +44 (0)7813 944 528 skype: milessabin http://www.chuusai.com/ http://twitter.com/milessabin -- Steffen Weissmann Technische Universitaet Berlin - Math. Department - MA 3-2 Str. des 17. Juni 136 10623 Berlin - Germany Phone: +49 30 314-29278 Mail: weissm...@math.tu-berlin.de Web:www.math.tu-berlin.de/~weissman --~--~-~--~~~---~--~~ 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 w/o ajax
From http://groups.google.com/group/liftweb/msg/a66e58b85523a1d9 Add to Boot: +// Do not insert Javascript-based GC +LiftRules.enableLiftGC = false; + +// Do not include Ajax include +LiftRules.autoIncludeAjax = _ = false; On Aug 4, 8:38 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Hi. I am writing a webapp to be run mainly on BlackBerries, including older ones that have basically no Javascript or Ajax support. I had the jquery script tag commented out in the default template, and everything was fine. Only now Internet Explorer is complaining about a javascript error (a reference to jquery) and I had to uncomment it. The pages have to load very fast. Is there a way that I can skip Javascript? --~--~-~--~~~---~--~~ 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] CircleShare Blog where?
At the bottom of this page http://wiki.liftweb.net/index.php/ Contribute it says: When you see an article on Lift, help spread the word by submitting it to digg, reddit, or hacknews. If you're looking for articles, a great place is to start is The CircleShare Blog where user:dpp blogs about Lift. When I click at The CircleShare Blog, I get this: Services for this domain have been discontinued Has CircleShare moved, or have they cashed in? /Jon --~--~-~--~~~---~--~~ 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] How to install non-standard Lift from GitHub
I have pulled and built a certain Lift branch from the GitHub on my Mac, and I would like to temporarily switch to using that branch. Do I have to make an installer app (how?) and run that, or could I just set up some pointer(s) (like an environment variable) to the directory where all the new jars are? (I may want to switch back to standard Lift 1.0 soon afterwards.) /Jon --~--~-~--~~~---~--~~ 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: todo app., Oracle: Invalid column type
Hi Derek, For me this sounds fine, but then I'm still a Lift and Scala newbie. I think the best way is just to try it. ;-) Whenever you have something that I can try, let me know. /Jon On Jul 23, 10:02 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, I think that this is happening because when we use the JDBC setObject call, we explicitly send the type. As far as I can tell the Oracle driver doesn't like java.sql.Types.BOOLEAN *at all*, so I'm trying to determine the best way to compensate. I'm not sure how common something like this might be, so it might be nice to allow the net.liftweb.mapper.Driver class to provide a partial function that allows the vendor-specific driver to remap the type. I would add something like: abstract class DriverType ... { def columnTypeRemapper : PartialFunction[Int,Int] = { case x = x } } and then in the Oracle Driver: object OracleDriver extends ... { override def columnTypeRemapper = { case java.sql.Types.BOOLEAN = java.sql.Types.INTEGER } ... } Thoughts? Derek --~--~-~--~~~---~--~~ 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: SQL dumping in log?
With Lift 1.0 and my tiny test app. against Oracle, and this: DB.addLogFunc ((q, t) = Log.info(Query(+t+): +q)) ... I get this: INFO - Query(73): oracle.jdbc.driver.t4cpreparedstatem...@10b868 INFO - Query(241): oracle.jdbc.driver.t4cpreparedstatem...@10b868 INFO - Service request (GET) /showPersons took 1418 Milliseconds /Jon On Jul 24, 12:27 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: ... Strange...On 1.1-SNAPSHOT I use essentially the same and get this: DB.addLogFunc ((q, t) = Log.info(Query(+t+): +q)) INFO - Query(46): SELECT users.id, users.firstname, users.lastname, users.email, users.locale, users.timezone, users.password_pw, users.password_slt, users.account_id, users.uniqueid, users.superuser, users.validated FROM users WHERE email = demou...@xx.yy INFO - Query(66): SELECT users.id, users.firstname, users.lastname, users.email, users.locale, users.timezone, users.password_pw, users.password_slt, users.account_id, users.uniqueid, users.superuser, users.validated FROM users WHERE email = ? /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com 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: todo app., Oracle: Invalid column type
I should be able to do the pulling and building myself, but a few directions on how to do it will be necessary. The pulling/building I can try quite soon, but the actual testing may have to wait a few days. (I'll let you know.) /Jon On Jul 24, 3:41 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: If I built a special branch to test this out would you be OK with pulling and building that yourself? Otherwise I can build it and send you the jars. Thanks, Derek On Thu, Jul 23, 2009 at 11:24 PM, Jon jon.klei...@usit.uio.no wrote: Hi Derek, For me this sounds fine, but then I'm still a Lift and Scala newbie. I think the best way is just to try it. ;-) Whenever you have something that I can try, let me know. /Jon On Jul 23, 10:02 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, I think that this is happening because when we use the JDBC setObject call, we explicitly send the type. As far as I can tell the Oracle driver doesn't like java.sql.Types.BOOLEAN *at all*, so I'm trying to determine the best way to compensate. I'm not sure how common something like this might be, so it might be nice to allow the net.liftweb.mapper.Driver class to provide a partial function that allows the vendor-specific driver to remap the type. I would add something like: abstract class DriverType ... { def columnTypeRemapper : PartialFunction[Int,Int] = { case x = x } } and then in the Oracle Driver: object OracleDriver extends ... { override def columnTypeRemapper = { case java.sql.Types.BOOLEAN = java.sql.Types.INTEGER } ... } Thoughts? Derek --~--~-~--~~~---~--~~ 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] todo app., Oracle: Invalid column type
(LiftServlet.scala:525) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) net.liftweb.http.URLRewriter$.doWith(Req.scala:390) net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:524) net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply(LiftServlet.scala:518) net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(Vars.scala:197) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5.apply(Vars.scala:196) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply$4.apply(Vars.scala:195) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) net.liftweb.http.RequestVarHandler$$anonfun$apply$3.apply(Vars.scala:194) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65) net.liftweb.http.RequestVarHandler$.apply(Vars.scala:193) net.liftweb.http.LiftFilterTrait$class.doFilter(LiftServlet.scala:517) net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:536) org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) org.mortbay.jetty.Server.handle(Server.java:324) org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880) org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) -- What can that Invalid column type be indicating? I'm using Lift 1.0. /Jon --~--~-~--~~~---~--~~ 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: todo app., Oracle: Invalid column type
I've now logged it as an issue. /Jon --~--~-~--~~~---~--~~ 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: todo app., Oracle: Invalid column type
I'm using Lift 1.0. /Jon On Jul 23, 5:08 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Based on this line: oracle.jdbc.driver. OraclePreparedStatement.setObject(OraclePreparedStatement.java:9316) I have a feeling that we're handing an Object to the driver that doesn't map correctly to the type of the column. For instance, we could be handing a Long to something with type DOUBLE. Normally JDBC drivers attempt to coerce the object based on internal mappings but they don't always match up the same between vendors in my experience. In particular, the fact that validated and superuser are being defined as NUMBER (because Oracle's JDBC driver doesn't support boolean,http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq) makes me think that we're handing a java Boolean to the driver. I think that this should be a simple fix with an extra case statement in MetaMapper. What version of Lift are you using? 1.0, 1.1-SNAPSHOT, or something else? Thanks, Derek --~--~-~--~~~---~--~~ 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] SQL dumping in log?
Hi, Is it possible to dump/log all SQL statements going to the database, so that one can see all the SELECTs, INSERTs etc.? /Jon --~--~-~--~~~---~--~~ 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: SQL dumping in log?
On Jul 23, 8:56 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: marius d. marius.dan...@gmail.com writes: I'm not sure if that logs the statements with the actual values. Does it ? Strange, just tried it because I definitely remember seeing values being logged, but turns out not all statements have values logged and it seem just queries are logged. /Jeppe I tried this: DB.addLogFunc((query, len) = Log.info(The query: +query+ took +len + milliseconds)) ... and only got things like this: INFO - The query: b8450018-0122-a854-9ce5-00cde658 took 47 milliseconds Not exactly what I was interested in. ;-) /Jon --~--~-~--~~~---~--~~ 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 and Oracle, what's the situation?
Hi, I've just started to look at Lift, and I have played with the sample app's like todo and PocketChange. Now I would like to try some simple things on an existing Orcale database. Is that possible with Lift 1.0? Are there any examples or descriptions available? /Jon --~--~-~--~~~---~--~~ 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] PocketChange app. problems
Hello, I checked out the PocketChange app. like this: git clone git://github.com/tjweir/pocketchangeapp.git When I run it, log in, and click on the Change Password link, Firefox says This XML file does not appear to have any style information associated with it. The document tree is shown below. The source I get looks like this: ?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 form action=/user_mgt/change_password method=post tabletrtd colspan=2Change Password/td/tr trtdOld password/tdtdinput name=F178147327358EIZ type=password value= //td/tr trtdNew password/tdtdinput name=F178147327359TLB type=password value= //td/tr trtdNew password (repeat)/tdtdinput name=F178147327359TLB type=password value= //td/tr trtdnbsp;/tdtdinput name=F178147337360QVW type=submit value=Change //td/tr /table /form The same problem happens when I click on the Edit User link. I'm running the standard Lift 1.0 (on a Mac), except that I just had to replace the included maven with maven 2.2.0, since the included one suddenly gave me this message: The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist ... The PocketChange problems also occurred with the included maven. Sincerely, Jon Kleiser --~--~-~--~~~---~--~~ 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: Writing Facebook applications in Lift (cookies, Javascript GC, example code)
Hi Steven, Have you done any more research into this problem? I am also exploring this area-- by creating your application as an iframe rather than fbml, which seems to be the recommended approach (http://stackoverflow.com/questions/219804/new-facebook-app-fbml-or- iframe), you should be able to use all the lift goodies out of the box. - Jon On Jun 29, 6:58 am, marius d. marius.dan...@gmail.com wrote: On Jun 29, 1:13 pm, Timothy Perrett timo...@getintheloop.eu wrote: Steven, Welcome to lift. Lift doesn't use the JSESSIONID in the URL... that is, lift does not require it (at least this is my understanding, if im wrong please correct me someone) - so you should have no problems with the requests being re-written. Actaully Lift is no different then a regular JEE web app. If you turn off cookies from the container you'll witness URL rewriting and JSESSIONID will be part of the URL. Regarding the GC stuff, it was added to improve memory usage of applications that run over a long period and to keep the heap size down. Marius or DPP would probably be able to give you more specifics but I think if your users are moving from page to page and you can cope with a slightly larger heap size then it shouldn't be too much of a problem. We did after all do without the GC stuff for quite sometime as it was only added recently. Essentially Lift GC is about de-referencing unseen bound functions if a certain period of time exceeds. There is a lightweight heart beat mechanism where Ajax requests are sent to keep functions alive. Of course bound function are associated with a generated page-id. Hope that helps Tim On Jun 28, 8:52 pm, Steven Murdoch sjmurd...@gmail.com wrote: Hi, I've been looking at Scala and Lift recently, and so far have been generally impressed. I'd like to write aFacebookapplication, both because I need one, and so I can learn more about Lift and Scala. I do have a few questions though, and I haven't been able to find answers in the documentation or mailing list. The first is about cookies and state.Facebookcanvas applications return pages which are re-written by theFacebookservers, so the JSESSIONID cookie will not be present. As I understand it, that means I'll need to manage state myself. I was therefore thinking about returning pages from LiftRules.statelessDispatchTable (as described in the Lift book, 3.13). The problem here is that I'd need to return a LiftResponse directly, and wouldn't be able to use most of the Lift infrastructure. Is this the right way to do things? Is there some other way to suppress cookies and/or use Lift without them in theFacebookapplication context? My second question is also becauseFacebooksuppresses Javascript when it processes web pages written in FBML. This means that the client-side code to do garbage collection of widgets won't run. I can disable the insertion using LiftRules.enableLiftGC, but will this trigger other problems? Finally, is there example code available for lift-facebook? It's great that Lift supportsFacebook, but other than a small mention in the Lift book, I haven't been able to find any documentation. Some example code would be very useful in getting started. Is there any available? Thanks in advance, Steven Murdoch. --http://www.cl.cam.ac.uk/users/sjm217/ --~--~-~--~~~---~--~~ 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: So where is that OAuth?
I've been working on the provider side of oauth to authenticate api calls. I was looking at the http-authentication example, but I'm not sure if want to go that route. I would like to be able to specify authentication for paths in the same place that I define them (in a DispatchPF). I'd also like to be able to pass down a Box[(consumer, Box[token])] to my response functions. This is what I have so far. I'm fairly new to scala/lift, so any pointers would be appreciated: object RestAPI extends XMLApiHelper{ //OAuth takes to functions for looking up the secrets associated with the consumer and token keys //trivial functions here for testing, but would be replaced with DB call val oauth = OAuth(c = c, t = t) def dispatch: LiftRules.DispatchPF = { case Req(List(api,user,userid), , GetRequest) = () = requireToken(showUser(userid)) } def showUser(userid: String) (consumer: Consumer, token: Token): LiftResponse = { val e: Box[NodeSeq] = for(r - User.find(userid.toLong)) yield { r.toXML } e } def unauth(message: String) = new XhtmlResponse(unauthorized {message}/unauthorized, Full(text/xml), Nil, Nil, 401, false) def requireToken(f: (Consumer, Token) = LiftResponse): LiftResponse = { oauth.verify_signature match { case Full((c, Full(t))) = f(c, t) case _ = unauth(Authentication failed) } } def requireSigned(f: (Consumer) = LiftResponse): LiftResponse = { oauth.verify_signature match { case Full((c, _)) = f(c) case _ = unauth(Invalid oauth signature) } } } On Jun 22, 12:36 pm, DFectuoso santiago1...@gmail.com wrote: Well i will start working on that tonight(after work of course) and keep you guys updated! Cheers! On Jun 22, 8:59 am, marius d. marius.dan...@gmail.com wrote: On Jun 22, 3:25 am, DFectuoso santiago1...@gmail.com wrote: Well i went ahead and learn a lot from the lift-openId implementation and understand what I would need to do have lift-OAuthworking It seems like i could do two things: 1) Get aOAuthjava library that allows me to post, get, login and logout then create aOAuth.scala file where i create a trait of the OAuthHandler that would access to this methods, then create a object that extends from that trait; Then create a OAuthProtoUser.scala where I would have a trait for the MetaOAuthProtoUser with the Xhtml for login, override the menus that i would not use and perform the login and logout of the user as well as the post and get methods. Finally create a trait for the OAuthProtoUser that would allow me to store information about the user. Besides Proto stuff we'd need an abstraction overOAuthartifacts. Essentially a wrapper over their Java library. 2) Go ahead and have the login,logout, post and get methods on the OAuth.scala actually do the logic to get the tokens without a java library, this would mean creating some way of signing a url and body to post and get stuff from the request, access and user-auth Token Url or an url in the service. I have absolutely no experience with scala, java or lift but I really want to get some(by doing this type of stuff). So what do you think is better(for me to learn, for lift and for you). I think it would be a good exercise. Once you're done with it we could probably review it and maybe it'll get its way into Lift if some committer doesn't implement it in the mean time, but regardless would be a good exercise for you. Also, what part of this abstraction(and how) is the one to set the consumer_key, secret_key and the request urls? InOAuthworld consumer secret and consumer key are somehow invariants as they impersonate a trusted service. So I would put them into a Scala object where user can just set these quantities from Boot. Finally; a uber noob question, what is the equivalent of curl(php) or urllib/urlopen(python) that i would use in the second option to actually make the http request to ther other site? I think its a servlet but some trivial example on this would really help me =) You can just use HttpUrlConnection, or Apache Http client. On Jun 21, 7:18 am, marius d. marius.dan...@gmail.com wrote: OAuthis not implemented yet in Lift still the project folder is there. I think Dave wanted to put it there but never got the chance to add it. Br's, Marius On Jun 21, 9:29 am, DFectuoso santiago1...@gmail.com wrote: Im trying to integrateOAuth(with twitter) in one of my projects... and i saw the lift-oauth, but i cant find the code, documentation or examples around this module; so i guess either its somewhere else or people is doing their twitter integrations with other class(maybe java)...
[Lift] Re: Stax
I was able to get the latest lift-example application deployed without a problem: http://helloworld.hoffrocket.staxapps.net/. It's running against a mysql DB that they're hosting, not h2. I got an nginx 502 gateway down with a more substantial app, but their log files were all blank, so I have no idea what the problem was. Their deployment mechanism is war/ear based (ear built locally, then uploaded). It would be cool if they supported standard mvn layouts and could just build your war from source. I'm on a 512kb max upload and lift-example took 5 minutes to deploy. - Jon On Jun 24, 4:21 pm, Tim Nelson tnell...@gmail.com wrote: I think they use Gant.http://gant.codehaus.org/ On Wed, Jun 24, 2009 at 3:10 PM, fan...@gmail.com fan...@gmail.com wrote: Tim Nelson a écrit : [...] I did install their SDK and from what I can tell it's basically some Groovy scripts that use Ant + Ivy. Gradle perhaps ?http://www.gradle.org/ -- Francois Armand http://fanf42.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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] Compile error with 1.1-M1 and CRUDify
Hi, I saw the following after moving my project from lift 1.0 to 1.1-M1: [WARNING] self-type com.company.model.City does not conform to net.liftweb.mapper.CRUDify[Long,com.company.model.City]'s selftype net.liftweb.mapper.CRUDify[Long,com.company.model.City] with com.company.model.City with net.liftweb.mapper.KeyedMetaMapper [Long,com.company.model.City] [WARNING] class City extends LongKeyedMapper[City] with IdPK with CRUDify[Long, City] { I fixed by moving the CRUDify trait from the class to the meta object definition. Is that correct usage? Was the CRUDify trait always supposed to be used on the meta object (the liftbook example shows the trait on the class)? Thanks, Jon --~--~-~--~~~---~--~~ 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: We need a wiki gardener
David, I've created a wiki user jhancock. Could you create a page for ruby/rails/merb to lift and give me rights? I will start off by adding notes for environment and setup issues. The getting current docs are great for those already using Java but could use some extra info for those not familiar with the Java toolchain. I have been away from Java for 5 years and things like Maven and how to have a single scala install that allows me to run jetty, use eclipse, and use the scala interpreter all referencing the same target source is something that is not easily put together...expect my next set of google group pepperings to target those issues. After that, I'll start adding notes as I go through a migration from merb. Then I can go further back and add notes from my older rails code. Then after I have quite a few ramblings put together, I can clean it all up. How does that sound? Jon On Mar 2, 11:36 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Mar 2, 2009 at 7:54 AM, Jon Hancock shellsha...@gmail.com wrote: David, I'm happy to contribute. I have a beginner's mind at the moment which may help. Either I'm missing huge sections of the wiki, or it doesn't have much. So from my point of view, the job isn't too big. Should I just create and account and start digging away? Yes. But I don't want to overload you. I think it would be better for you to create a section of the wiki called Lift from a Rails perspective and put the answers from this list into that section. Jon On Mar 1, 4:34 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, The Lift wiki has a lot of weeds growing in it. We really need a wiki gardener who will go through an remove or re-write all the code examples based on old versions of Lift. Any takers? Thanks, David -- 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: We need a wiki gardener
will do. first need someone, David?, to set it up for me as I don't have page create rights (at least I can't see that my new account does). Jon On Mar 2, 5:50 pm, Charles F. Munat c...@munat.com wrote: Jon, Can you post a link to this page when you have it set up? Thanks, Chas. Jon Hancock wrote: David, I've created a wiki user jhancock. Could you create a page for ruby/rails/merb to lift and give me rights? I will start off by adding notes for environment and setup issues. The getting current docs are great for those already using Java but could use some extra info for those not familiar with the Java toolchain. I have been away from Java for 5 years and things like Maven and how to have a single scala install that allows me to run jetty, use eclipse, and use the scala interpreter all referencing the same target source is something that is not easily put together...expect my next set of google group pepperings to target those issues. After that, I'll start adding notes as I go through a migration from merb. Then I can go further back and add notes from my older rails code. Then after I have quite a few ramblings put together, I can clean it all up. How does that sound? Jon On Mar 2, 11:36 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Mar 2, 2009 at 7:54 AM, Jon Hancock shellsha...@gmail.com wrote: David, I'm happy to contribute. I have a beginner's mind at the moment which may help. Either I'm missing huge sections of the wiki, or it doesn't have much. So from my point of view, the job isn't too big. Should I just create and account and start digging away? Yes. But I don't want to overload you. I think it would be better for you to create a section of the wiki called Lift from a Rails perspective and put the answers from this list into that section. Jon On Mar 1, 4:34 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, The Lift wiki has a lot of weeds growing in it. We really need a wiki gardener who will go through an remove or re-write all the code examples based on old versions of Lift. Any takers? Thanks, David -- 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: Lift newbie - Horizontal scaling of Lift servers
David, I'm in the same boat. I have an app I originally coded in Rails. Then I recoded it in Merb (much better, but now I'm unhappy with the merb-rails merger). I'm testing out lift now to see about recoding it once again before the app gets too complex. I also have another app or two to build and would like a single framework to grow with. I'm not interested in ditching ruby/merb for performance reasons as merb is ok for my needs. I'm interested in lift as I would like one go forward language (I've been tracking scala for a few years now) and am not compeltely happy with ruby or its frameworks. Hope this list doesn't mind me peppering it with noob questions as I spend the next week or two seeing if I can quickly recode my app with lift. thanks, Jon On Feb 28, 6:21 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sat, Feb 28, 2009 at 2:37 PM, Ikai Lan ikai@gmail.com wrote: Hi, I'm looking to learn Lift coming from working with Ruby on Rails for a while and I've been voraciously consuming the documentation and tutorials that are available on the internet. There are a few things I really like about Lift so far: - Out of the box Comet support - Rapid development (incremental compiles are awesome) - Being able to design without having to think of the request/response cycle* I'm putting an asterisk on the last item because I'm a bit confused how this will work in a production application running two or more load balanced Lift instances of the same application. You need a load balancer that's either JSESSIONID aware or can be tuned to work with Lift's feature that re-writes URLs in such a way that it's easy to have a load balancer send the requests back to the specific server that houses the Lift session. The fact that form processing can happen without inspecting GET/POST params or dealing with data that needs to life longer than a standard request cycle is pretty neat, but it raises questions about horizontal scalability. Where is the session data stored? In the app server where the session was initialized. If it is in-memory by default, are there any best practices for sharing session data across application servers, or is the recommended solution to use load balancer affinity? The latter. With all this being said, I have significant operational experience with the highest volume RoR powered site. A quad-core Intel/AMD box running Lift could have handled all of its traffic. So, unless you're expecting to have significantly more traffic than Twitter... unless you're site is saturating a gigabit ethernet card, you can run it on a single server with Lift. Thanks, David Ikai -- 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 newbie - Horizontal scaling of Lift servers
if I can get a lift version of my app http://shellshadow.com done in a few weeks, I could go for it. I am very happy to release the source to the rails, merb, and lift version so folks would have a real app to compare. Jon On Mar 1, 4:49 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Mar 1, 2009 at 2:43 PM, Jon Hancock shellsha...@gmail.com wrote: David, I'm in the same boat. I have an app I originally coded in Rails. Then I recoded it in Merb (much better, but now I'm unhappy with the merb-rails merger). I'm testing out lift now to see about recoding it once again before the app gets too complex. I also have another app or two to build and would like a single framework to grow with. I'm not interested in ditching ruby/merb for performance reasons as merb is ok for my needs. I'm interested in lift as I would like one go forward language (I've been tracking scala for a few years now) and am not compeltely happy with ruby or its frameworks. Hope this list doesn't mind me peppering it with noob questions as I spend the next week or two seeing if I can quickly recode my app with lift. Keep peppering. Perhaps you and Charles Munat could team up and write the Lift for recovering Rails developers guide. thanks, Jon On Feb 28, 6:21 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sat, Feb 28, 2009 at 2:37 PM, Ikai Lan ikai@gmail.com wrote: Hi, I'm looking to learn Lift coming from working with Ruby on Rails for a while and I've been voraciously consuming the documentation and tutorials that are available on the internet. There are a few things I really like about Lift so far: - Out of the box Comet support - Rapid development (incremental compiles are awesome) - Being able to design without having to think of the request/response cycle* I'm putting an asterisk on the last item because I'm a bit confused how this will work in a production application running two or more load balanced Lift instances of the same application. You need a load balancer that's either JSESSIONID aware or can be tuned to work with Lift's feature that re-writes URLs in such a way that it's easy to have a load balancer send the requests back to the specific server that houses the Lift session. The fact that form processing can happen without inspecting GET/POST params or dealing with data that needs to life longer than a standard request cycle is pretty neat, but it raises questions about horizontal scalability. Where is the session data stored? In the app server where the session was initialized. If it is in-memory by default, are there any best practices for sharing session data across application servers, or is the recommended solution to use load balancer affinity? The latter. With all this being said, I have significant operational experience with the highest volume RoR powered site. A quad-core Intel/AMD box running Lift could have handled all of its traffic. So, unless you're expecting to have significantly more traffic than Twitter... unless you're site is saturating a gigabit ethernet card, you can run it on a single server with Lift. Thanks, David Ikai -- 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] incremental or live dev with lift
I was under the impression that in development mode, I could modify my lift files and see the changes without restarting jetty. I have created the helloworld sample app from the lift book. It seems to run fine (command line, not ecplise, as I'm following the docs closely to get started). In HelloWorld.scala I change the line: def howdy = spanWelcome to helloworld at {new java.util.Date}/span to: def howdy = spanWelcome to NOW helloworld at {new java.util.Date}/ span and refresh my browser. nothing. I still get the old version. Am I doing something wrong? Or does lift not support this and I have to restart the server to test each change? thanks, Jon --~--~-~--~~~---~--~~ 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] eclipse plugin and scala shell
Does the eclipse plugin support the scala interactive shell? I would like to be able to develop my lift app in eclipse and interactively test model and controller behavior with the shell. How do others do this with lift?? thanks, Jon --~--~-~--~~~---~--~~ 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: eclipse plugin and scala shell
I see what you mean. Just tried it and the shell cranks up but doesn't seem to work at all. I'm on OS X 10.5.6 typing :help doesn't work typing 1 + 2 also doesn't do anything. any idea when you might have a new release? Jon On Mar 1, 5:36 pm, Josh Suereth joshua.suer...@gmail.com wrote: The eclipse plugin does mostly support the interactive shell, but the integration isn't that great right now (I'm allowed to crtique it, as I added it). I'm working on upgrading for better functionality. In the meantime, if you're not using windows, you should be able to run the interpreter via right clicking on a project in the Package explorer and selecting Scala - Create interpreter in XYZ On Sun, Mar 1, 2009 at 6:30 PM, Jon Hancock shellsha...@gmail.com wrote: Does the eclipse plugin support the scala interactive shell? I would like to be able to develop my lift app in eclipse and interactively test model and controller behavior with the shell. How do others do this with lift?? thanks, Jon --~--~-~--~~~---~--~~ 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: HTTP Client?
Is there a way to set the authToken in the instance rather than globally? On Sep 23, 12:29 pm, Tim Perrett [EMAIL PROTECTED] wrote: Hey guys, Ok, i've abstracted it all out into a class which you call a little like this: var paypal: PayPal = new PayPal(sandbox) paypal.transactionToken = S.param(tx).openOr() paypal.execute(pdt) And as your authentication token is global to your account, you can specify it by doing: PayPal.authenticationToken = dfgdfgdfgdfgdfgdfgd which I palced in boot. So far i've only implemented PDT, but have allowed for implementing IPN too - which should be a minimal amount of work ontop of what i already have. Thoughts? Cheers Tim --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---