[Lift] Re: Question about megaprotouser S.error
I'm sorry to keep picking on this but i want to undertand, why would MappedPassword have a default value that i can't override and that is shown to user with ProtoUser if i don't override the full signup form's xhtml? I would like to think that i can start any project, extend proto user and have a register/login system that is very easy to undertand for all user and i know that having a pre-filled value seems to be a non- important issue, still is one of the most voted things in my uservoice! At this moment i will override and create the html for the form to avoid having two fields prefilled with **. On Nov 5, 2:59 pm, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/4 David Pollak feeder.of.the.be...@gmail.com It is a bug in MappedPassword (not ProtoUser): It's not a bug, it's by design. Well , issue 157 (MappedPassword contains misspelled key for unset password) is a bug, but ** as default value is by design, of course. Heiko My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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] Rendering a template bit
I want to do the following pattern, i don't know how(or if its possible) to do it in lift: - I want any part of my code to call a Site.render() where site is a model and render is a function inside that model that will print it the information - I want the xhtml to be in a html file so that any designer/html guy can play with it and its css/html. (also they won't have to compile and/or scala:cc after every change). Is this possible? I was playing with the lift:embed what=/commons/site / and sending parameters, but i didn't know how to catch those params in the xml, has anyone done this pattern? Am i trying to solve something that can be solved other pattern? --~--~-~--~~~---~--~~ 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: Question about megaprotouser S.error
I just want to learn and understand why it is like that, i love lift and I keep doing different project with it. I DO understand i can change anything in different scales and layers and so far i have been able to solve any problem one way or another. Thank you. On Nov 5, 9:01 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Thu, Nov 5, 2009 at 5:44 PM, DFectuoso santiago1...@gmail.com wrote: I'm sorry to keep picking on this but i want to undertand, why would MappedPassword have a default value that i can't override and that is shown to user with ProtoUser if i don't override the full signup form's xhtml? If you do not like the way a particular feature is implemented in Lift, you can copy the source code and change the implementation (Lift's Apache 2 license allows for that). Lift is layered. You can change out pieces that don't suit your needs. You don't like the issues related to MegaProtoUser (like the whole templates in code thing), then copy the code into your user class and change the template calls to load the templates however you want. If you don't like how MappedPassword is implemented, then do your own implementation. I would like to think that i can start any project, extend proto user and have a register/login system that is very easy to undertand for all user and i know that having a pre-filled value seems to be a non- important issue, still is one of the most voted things in my uservoice! At this moment i will override and create the html for the form to avoid having two fields prefilled with **. On Nov 5, 2:59 pm, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/4 David Pollak feeder.of.the.be...@gmail.com It is a bug in MappedPassword (not ProtoUser): It's not a bug, it's by design. Well , issue 157 (MappedPassword contains misspelled key for unset password) is a bug, but ** as default value is by design, of course. Heiko My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net -- 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: Rendering a template bit
The thing is that i want the NodeSeq to reside in a html file, not inside the model. On Nov 5, 10:20 pm, harryh har...@gmail.com wrote: What you want can be done with very basic usage of snippets (the way that templates interface with code in Lift). In your template: lift:YourSnippet.foo/ Then in YourSnippet.scala: class YourSnippet { def foo(xhtml: NodeSeq) = Site.render() } Make sure render returns a NodeSeq. -harryh On Nov 5, 9:35 pm, DFectuoso santiago1...@gmail.com wrote: I want to do the following pattern, i don't know how(or if its possible) to do it in lift: - I want any part of my code to call a Site.render() where site is a model and render is a function inside that model that will print it the information - I want the xhtml to be in a html file so that any designer/html guy can play with it and its css/html. (also they won't have to compile and/or scala:cc after every change). Is this possible? I was playing with the lift:embed what=/commons/site / and sending parameters, but i didn't know how to catch those params in the xml, has anyone done this pattern? Am i trying to solve something that can be solved other pattern? --~--~-~--~~~---~--~~ 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: Question about megaprotouser S.error
I would expect that any time the form fails to validate(try clicking submit without typing a password or a valid email in hellolift) i would get a message saying what is wrong. On Nov 3, 12:58 am, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/3 DFectuoso santiago1...@gmail.com I am using MegaProtoUser in my user model and a couple of users reported they do not get any kind of feedback if they don't input a valid user in the Sign Up form What exactly is a valid user in your case? def testSignup() { theUser.validate match { case Nil = actionsAfterSignup(theUser) S.redirectTo(homePage) case xs = S.error(xs) ; signupFunc(Full(innerSignup _)) } } I think that S.error should be the one giving me the errors in the lift:msgs/ handler right? Yes. Cheers, Heiko -- My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Question about megaprotouser S.error
Yes, changing the binding to the full errors,notices and warning fixed it, now i just need to override the messages on fail(don't know how to change those password.must.set and the default password) and i'll be over this signup thing On Nov 3, 2:49 pm, DFectuoso santiago1...@gmail.com wrote: You can find my User.scala file inhttp://etherpad.com/someScalaCode (saved on rev 1). I need to add an EULA and thats it tho... i would like to keep it as simple as possible(i hate the idea of having html hardcoded in a model, and using signupFields is great! so my only real issues to solve is removing the ** from the default form( i have no idea why the password would be prefilled in a sign up form) and the feedback from malformed emails. On Nov 3, 1:42 pm, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Thank you. It's my contribution to the W-JAX Challenge where several web frameworks compete. But to be honest: The others are really nicely designed ... Heiko 2009/11/3 Randinn rand...@gmail.com Nicely designed site, just to go a bit off-topic, very clean. On Nov 4, 4:33 am, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/3 DFectuoso santiago1...@gmail.com I would expect that any time the form fails to validate(try clicking submit without typing a password or a valid email in hellolift) i would get a message saying what is wrong. That's how it works. Go tohttp://174.143.152.248:8080/kix-1.0/toseea live demo: Try to sign up and (thereafter) to login with invalid data. Go tohttp:// github.com/hseeberger/kix/and take a look at the User class (and object). Heiko -- Heiko Seeberger My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Question about megaprotouser S.error
Wow, its working allright, let me compare your code with mine, so far the only diff is that you are using the full error snippet lift:Msgs showAll=true lift:error_classerror/lift:error_class lift:notice_classnotice/lift:notice_class lift:warning_classerror/lift:warning_class /lift:Msgs in the template, while im doing a lift:Msgs/ Is there a way to override the default password (**) without making all the html of the signup page? On Nov 3, 11:33 am, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/3 DFectuoso santiago1...@gmail.com I would expect that any time the form fails to validate(try clicking submit without typing a password or a valid email in hellolift) i would get a message saying what is wrong. That's how it works. Go tohttp://174.143.152.248:8080/kix-1.0/to see a live demo: Try to sign up and (thereafter) to login with invalid data. Go tohttp://github.com/hseeberger/kix/and take a look at the User class (and object). Heiko --~--~-~--~~~---~--~~ 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: Question about megaprotouser S.error
You can find my User.scala file in http://etherpad.com/someScalaCode (saved on rev 1). I need to add an EULA and thats it tho... i would like to keep it as simple as possible(i hate the idea of having html hardcoded in a model, and using signupFields is great! so my only real issues to solve is removing the ** from the default form( i have no idea why the password would be prefilled in a sign up form) and the feedback from malformed emails. On Nov 3, 1:42 pm, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Thank you. It's my contribution to the W-JAX Challenge where several web frameworks compete. But to be honest: The others are really nicely designed ... Heiko 2009/11/3 Randinn rand...@gmail.com Nicely designed site, just to go a bit off-topic, very clean. On Nov 4, 4:33 am, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/3 DFectuoso santiago1...@gmail.com I would expect that any time the form fails to validate(try clicking submit without typing a password or a valid email in hellolift) i would get a message saying what is wrong. That's how it works. Go tohttp://174.143.152.248:8080/kix-1.0/tosee a live demo: Try to sign up and (thereafter) to login with invalid data. Go tohttp:// github.com/hseeberger/kix/and take a look at the User class (and object). Heiko -- Heiko Seeberger My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Question about megaprotouser S.error
well that seems great! I use the snapshot so if you finish that and want to make someone very happy, you can send me an example of how it ended up working and i will be very very thankful! The last piece of the puzzle is the ** default value of the mappedPassword, since its part of the mappedPassword and not of the ProtoUser. And its a val, i don't know how to override it. What is the reason of this default value? On Nov 3, 11:43 pm, Heiko Seeberger heiko.seeber...@googlemail.com wrote: 2009/11/3 DFectuoso santiago1...@gmail.com Yes, changing the binding to the full errors,notices and warning fixed it, now i just need to override the messages on fail(don't know how to change those password.must.set and the default password) and i'll be over this signup thing password.must.set is a key that will be looked up from the core lift properties. You can override these, but not on a single key base, you have to replace all. But obviously this is a bug! The core lift properties should contain an entry. But they do not. Well, they do, but the key is password.must.be.set which is a ways better key IMHO. So the bug is in the Scala code of ProtoUser. I will open a ticket and fix it, but do not know if this will make it into M7. Heiko -- My job: weiglewilczek.com My blog: heikoseeberger.name Follow me: twitter.com/hseeberger OSGi on Scala: scalamodules.org Lift, the simply functional web framework: liftweb.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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] Question about megaprotouser S.error
I am using MegaProtoUser in my user model and a couple of users reported they do not get any kind of feedback if they don't input a valid user in the Sign Up form, i can see the same issue in hellolift and other lift apps out there that is also using this module. I don't know if I am doing something wrong or if anyone can replicate this. I tried to look at the source of ProtoUser.scala and found the testSignup, but did not see any obvious cause for this trouble in: def testSignup() { theUser.validate match { case Nil = actionsAfterSignup(theUser) S.redirectTo(homePage) case xs = S.error(xs) ; signupFunc(Full(innerSignup _)) } } I think that S.error should be the one giving me the errors in the lift:msgs/ handler right? --~--~-~--~~~---~--~~ 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] API data linked to a user
I'm doing a prototype (learning a little bit more of everything) just for fun using lift and a Firefox extension to understand the usual infrastructure of a delicious api kinda thing. Right now i have the communication from the FFext to a restApi in scala (and it was painless to do it =) ), but right now im sending the username and password in each request so the api can decide if the information should be stored and if so, linked to what user. Analyzing a little bit of code of other firefox extensions and some network behaviour i realize most of them are not sending that auth information in every request, but the server already have a way to associate a session with the FFext(im not sure). So the options i have so far are: -keep sending the username and password(not a good idea) -keep sending the username and password encripted(any ideas what algorithm to use here?) -Generate a token after the login and after that handshake trust that token(any guideline on the use of this tokens? possible security issues?) -Use a OAuth server/cliente industry standard bullet-proof handshack Also, i would like to know how important is to encrypt the bjax (browser ajax) post information? Im sending information i would like to know its secure. I just wanted to bring this ideas to the table to know a little bit more of the best practices and security involved in this kind of projects and if someone has a very simple solution to trusting a input received like this and/or how to link this to a user, help me brainstorm pls =) --~--~-~--~~~---~--~~ 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: Comet Actors - single browser, multiple tabs, same URL - out of control GET problem
That seems like a logical reason why this is like this, but if i open 2 tabs of http://demo.liftweb.net/, both tabs start to send ajax request every 100ms, that is 20 ajax request per second, 72k per hour, so if an app had 100 crazy users who happen to open 2 tabs of the app (this happens to me a lot, im messy with my tabs) that means 7.2 million request per hour to the server? isnt that something we might want to avoid somehow? I'm guessing we can't really fight the connection limit, but we should be able to specify a frequency to the js if we are going to enter to a polling policy (instead of long poll)? On Sep 16, 4:49 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Sep 16, 2009 at 4:18 PM, Dano olearydani...@gmail.com wrote: We have a lift app (innovationgames.com) which has a page (actually several) with comet actors. When we go to the same URL in two tabs in the same browser, we see that the long polls (GET requests) return immediately in rapid fire succession and this behavior continues until we exit one of the tabs. We thought maybe we did something wrong in our code, so we tried the same thing using demo.liftweb.net. We saw the same behavior in the demo site that we see in our site. If you try this with something else like Gmail, it does not show this behavior. It's not a bug. There is a 2 connection per server per browser limit (in most browsers although Chrome and FF 3.5 apparently have relaxed this limit). If there is a long polling operation in progress and a second request comes into the same session, Lift will immediately end the long polling operation in order not to starve the connections. I thought I would post to this group and get some feedback before submitting a bug. Thanks in advance. Dano -- 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] Crazy idea for lift's mega proto user: admin panel.
I was thinking about how wonderful it is to get a login/register/ forgotPassword functionality with mega proto user and how it could become even better with a good tool for creating an admin section. I'm just adding the idea here so maybe if other people find value it could be considered for development(or probably it already is, i don't know). Adding an admin panel to mega proto user where the moderators/admins could change some options(like the way a user is validated, if gzip is enabled, etc) would be great for the end users of our apps, since it would be easier to change and maintain the site. Being a administrator at a Invision Power Board forum and having a couple of wordpress blogs, i see a lot of potential on this as a admin/ dev tool! Listing some of the things that i can imagine in this panel are: -phpMyAdmin-type of DB admin(browse your data easily, remove/change/ add stuff to it without having to create a CRUD for each thing) -execute queries -List the actor(and comet actors) with possibility to kill/reset them -Memory use analysis. -Statistics of use(hits, referrals, etc) -Options (any object/class/trait could have a val foo = adminPanel.option(category,optionName,description,defaultValue, otherValues[]) and be included in this place, of course the categories could create different menus. -User management(ban, authorize, give admin-rights). -Simple to-do list that all admins can edit -Log of errors/warnings/exceptions -Css editor -Easy-logo changer -File Manager(upload your images and stuff here) -String editor (you can change any default string from the megaprotouser forms and the index?) Also, a very polemic(and i think bad idea, but its common to see this in admin panels): -Installable plug-ins for this panel I know this seems like one step away from being a full blown CMS, forum, blog, etc. But if its extensible while we are building an app, it will be very useful for the different moments of development and use. Of course i don't expect any of this to be done right now, i understand there are a couple of integrations and bigger things going on but i really wanted to brainstorm on this with you guys! --~--~-~--~~~---~--~~ 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: Problem building my app in Windows
Yea, my steps where install java 1.5_20, then ran the windows installer i got from liftweb.com, then tried to run the application and basicly got into this problem, seems like maven is trying to download information from lift's repo and it get an error while trying to store it on localhost, i'll keep messing with this. David, yea im sure it works, there no doubt about it, and no religious war was intented i just dont know if i was missing something obvious and wanted to ask.(btw its vista and im running it on the command prompt, with run as administrator selected). On Aug 23, 12:20 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Please make sure you are: - Using Maven 2.0.9 or greater - Running things from the Windows command prompt (not the Git shell or Cygwin) I regularly use Windows for Scala development. I wrote *Beginning Scala* on a Windows machine and my traveling laptop is a Windows machine. I have not experienced any problems with Lift, Scala, or Maven on Windows. On Sat, Aug 22, 2009 at 10:08 PM, DFectuoso santiago1...@gmail.com wrote: Hi, i have been working in linux and mac and having a wonderful time with mvn and everything lift's got to offer =). Sadly i want to teach lift to a person who uses Windows as he's only OS, so i am trying to configure hes computer, neither him or me are experts on this OS. I installed java 1.6 and ran into some problems, so i downloaded 1.5_20 and now i have java and maven working, but while trying to compile a very simple file i get the an error(posted at the end of this post); and i'm wondering if theres anything i need to know, seems like it could be some permisions or something like that. Any ideas? People running on windows how did you configure you box? Thanks, The error: [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'net.liftweb:lift-co re:jar': Error getting POM for 'net.liftweb:lift-core' from the repository: Unab le to store local copy of metadata: Error updating group repository metadata net.liftweb:lift-core:pom:1.1-SNAPSHOT for project net.liftweb:lift-core net.liftweb:lift-core:jar:1.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2), scala-tools.org (http://scala-tools.org/repo-releases), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots), http://www.lag.net/repo/(http://www.lag.net/repo/) Path to dependency: 1) net.twitknow:4Disc:war:0.1 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:575) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi fecycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLi fecycleExecutor.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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) 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) Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unabl e to get dependency information: Unable to read the metadata file for artifact ' net.liftweb:lift-core:jar': Error getting POM for 'net.liftweb:lift- core' from t he repository: Unable to store local copy of metadata: Error updating group repo sitory metadata net.liftweb:lift-core:pom:1.1-SNAPSHOT for project net.liftweb:lift-core net.liftweb:lift-core:jar:1.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2), scala-tools.org (http://scala-tools.org/repo-releases), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots), http://www.lag.net/repo/(http://www.lag.net/repo/) Path to dependency: 1
[Lift] Problem building my app in Windows
Hi, i have been working in linux and mac and having a wonderful time with mvn and everything lift's got to offer =). Sadly i want to teach lift to a person who uses Windows as he's only OS, so i am trying to configure hes computer, neither him or me are experts on this OS. I installed java 1.6 and ran into some problems, so i downloaded 1.5_20 and now i have java and maven working, but while trying to compile a very simple file i get the an error(posted at the end of this post); and i'm wondering if theres anything i need to know, seems like it could be some permisions or something like that. Any ideas? People running on windows how did you configure you box? Thanks, The error: [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'net.liftweb:lift-co re:jar': Error getting POM for 'net.liftweb:lift-core' from the repository: Unab le to store local copy of metadata: Error updating group repository metadata net.liftweb:lift-core:pom:1.1-SNAPSHOT for project net.liftweb:lift-core net.liftweb:lift-core:jar:1.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2), scala-tools.org (http://scala-tools.org/repo-releases), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots), http://www.lag.net/repo/ (http://www.lag.net/repo/) Path to dependency: 1) net.twitknow:4Disc:war:0.1 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:575) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi fecycle(DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:478) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLi fecycleExecutor.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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) 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) Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unabl e to get dependency information: Unable to read the metadata file for artifact ' net.liftweb:lift-core:jar': Error getting POM for 'net.liftweb:lift- core' from t he repository: Unable to store local copy of metadata: Error updating group repo sitory metadata net.liftweb:lift-core:pom:1.1-SNAPSHOT for project net.liftweb:lift-core net.liftweb:lift-core:jar:1.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2), scala-tools.org (http://scala-tools.org/repo-releases), scala-tools.org.snapshots (http://scala-tools.org/repo-snapshots), http://www.lag.net/repo/ (http://www.lag.net/repo/) Path to dependency: 1) net.twitknow:4Disc:war:0.1 at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(D efaultArtifactCollector.java:403) at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(D efaultArtifactCollector.java:76) at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTra nsitively(DefaultArtifactResolver.java:300) at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTra nsitively(DefaultArtifactResolver.java:288) at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDepende ncies(DefaultPluginManager.java:1415) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPlugi nManager.java:405) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:558) ... 16 more Caused by: org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException : Unable to read the metadata file for artifact 'net.liftweb:lift- core:jar': Err or getting POM for 'net.liftweb:lift-core' from the repository: Unable to store local copy of metadata: Error updating group repository metadata net.liftweb:lift-core:pom:1.1-SNAPSHOT for project
[Lift] Re: Post form and return file?
I'm guessing that the easier one would be the way to go. If the user clicks on agree to these terms and get a new screen with a link, that link must only be accessible after agreeing in the last screen. If it could be the other way(click and get the file), it seems like there would be no perma link to the file, and that would accomplish the there's no other way to get this file but to agree to the terms Right now I'm playing with the StreamingResponse but can't figure out how that code is called, do i create a menu item that will be accessible from a view and in the view i have that code? or what is the usual pattern for using that code? On Aug 4, 10:27 am, David Pollak feeder.of.the.be...@gmail.com wrote: Can you be a little more specific about what you want to achieve? Do you want to have an agree to these terms screen and once that screen is passed, then the user can access a link that contains the content? Or do you mean once the user clicks on 'submit' on the agree to these terms, the user immediately receives an file? On Mon, Aug 3, 2009 at 9:23 PM, DFectuoso santiago1...@gmail.com wrote: I'm working on some landing pages that need to capture some information and after getting that, i will let the user download a file. The problem is that those files need to be protected so, they cannot be downloaded without submitting the form. So hosting them in a url-accesible way seems like a mistake. What i need is to have the files in the server in a folder not accessible from url's. I'm guessing i will need lift to find and stream the files with the correct header. Right now the form is done with JSON forms and the idea would be to continue doing so. Any ideas where i should begin? Things in my mind: -Opening files and streaming them this way would be too much stress for the server? if the files are big? -Is it the best solution? -I can use all the java file libraries, but is there a scala place i should look before jumping on the java way on something -Can i automatically decide the header i should use? Thanks for any ideas and comments! -- 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] Post form and return file?
I'm working on some landing pages that need to capture some information and after getting that, i will let the user download a file. The problem is that those files need to be protected so, they cannot be downloaded without submitting the form. So hosting them in a url-accesible way seems like a mistake. What i need is to have the files in the server in a folder not accessible from url's. I'm guessing i will need lift to find and stream the files with the correct header. Right now the form is done with JSON forms and the idea would be to continue doing so. Any ideas where i should begin? Things in my mind: -Opening files and streaming them this way would be too much stress for the server? if the files are big? -Is it the best solution? -I can use all the java file libraries, but is there a scala place i should look before jumping on the java way on something -Can i automatically decide the header i should use? Thanks for any ideas and comments! --~--~-~--~~~---~--~~ 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: Simple Javascript question(from a lift snippet of course...)
Thank you very much! Good to find the lifty way; time to refactor some code =) On Jul 29, 11:43 pm, marius d. marius.dan...@gmail.com wrote: Well assume you snippet returns a NodeSeq: import net.liftweb.http._ import js._ import JE._ import JsCmds._ def myFunc(xml: NodeSeq): NodeSeq = { ... resultingNode ++ head{Script(OnLoad(Call(myStartupFunction)))}/ head } In the above example we are returning a head node as well which will be merged by Lift automatically in the real page head. Then I'm using Lift's JavaScript abstractions to call on load function myStartupFunction. Instead of head{Script(OnLoad(Call(myStartupFunction)))}/head you can also use head script type=text/javascript charset=utf-8{ Unparsed( jQuery(document).ready(function() { myStartupFunction(); }) ) } /head Br's, Marius On Jul 30, 8:13 am, DFectuoso santiago1...@gmail.com wrote: This is probably trivial but can't seem to find the lifty way... without hand rolling javascript What is the best way to generate(in the snippet) a javascript command to be run on the window.onload event? Thank you very much you divine and infinite source or lift knowledge AKA lift google group =) --~--~-~--~~~---~--~~ 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: Getting Started tutorial - not understanding some syntax
Viktor, that was a great explanation, im sure ben will apraciate that kind of teaching =) A follow up question that just made me wonder, what is the diference between val square = (x : Int) = x * x and def square(x:Int):Int = x * x ? On Jul 30, 1:49 pm, Viktor Klang viktor.kl...@gmail.com wrote: Hello Ben! the following: val square = (x:Int) = x * x val square is the equivalent of a final reference in Java. (x : Int) = x * x This constructs a Function instance that takes an Int and returns that Int squared. The equivalent Java code would be something like: interface FunctionR,P //We're ignoring variance here, as to not confuse { public R call(P p); } final FunctionInteger,Integer square = new FunctionInteger,Integer() { public Integer call(Integer i) { return i * i; } } And then you can do: square.call(2) // 4 So, back to Scala: val square = (x : Int) = x * x square(2) // 4 On Thu, Jul 30, 2009 at 9:37 PM, ben b...@primrose.org.uk wrote: Hi, I feel I must apologise for this post ... I've only been doing scala for a week, and lift for 3 days, but I'm stuck. I'm coming from an experienced java background, just struggling with some scala constructs. I feel I understand the basics of lambda and function literals - but I'm blown away by some of the syntax in the lift Getting Started tutorial. For example, given : val mylist = Array(1,2,3) mylist..foreach(v = println(v) Here I understand where v comes from - its each int in the list. In the tutorial (http://liftweb.net/docs/getting_started/ mod_master.htmlhttp://liftweb.net/docs/getting_started/%0Amod_master.html ) there is a function desc (Listing 15) : private def desc(td: ToDo, reDraw: () = JsCmd) = swappable(span{td.desc}/span, span{ajaxText(td.desc, v = {td.desc(v).save; reDraw()})} /span) For my own brain to try and break it down, I have : private def desc(td: ToDo, reDraw: () = JsCmd) = { val myFunctionLiteral = (xxx: String) = {td.desc(xxx).save; println(!Desc function : + xxx); reDraw()} swappable(span{td.desc}/span, span{ajaxText(td.desc, myFunctionLiteral)}/span) } This is called from the doList method : private def doList(reDraw: () = JsCmd)(html: NodeSeq): NodeSeq = toShow. flatMap(td = bind(todo, html, desc - desc(td, reDraw) )) I understand where the ToDo object td is coming from, and how the reDraw thing works, and how they are passed to the desc function, but what I don't understand at all is where the val xxx in myFunctionLiteral comes from ? How is it passed into the function ? Is it currying ? I'm sorry for such a vague question, I'm totally at sea here. Thankyou for reading this, and for any help you may provide ! Ben -- Viktor Klang Rogue Scala-head Blog: klangism.blogspot.com Twttr: viktorklang --~--~-~--~~~---~--~~ 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] Simple Javascript question(from a lift snippet of course...)
This is probably trivial but can't seem to find the lifty way... without hand rolling javascript What is the best way to generate(in the snippet) a javascript command to be run on the window.onload event? Thank you very much you divine and infinite source or lift knowledge AKA lift google group =) --~--~-~--~~~---~--~~ 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: Hear podcast interview with David Pollack about Lift
Cheers! That was a great podcast! On Jul 28, 11:48 am, David Pollak feeder.of.the.be...@gmail.com wrote: I had a great time on the podcast... the pondjumpers are a cool pair of dudes. On Mon, Jul 27, 2009 at 11:40 AM, Goldfish gregt...@mindspring.com wrote: Visithttp://pondjumpers.com/2009/07/27/episode-2-interview-about-lift/ to hear a podcast interview with David Pollack about Lift. -- 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 runtime stats snippet
Funny thing to display in a website Mixing that with the runmode and displaying a div with that information could be useful for development(im doing this with twitter api request limit status, i will add it there =) ) On Jul 28, 5:18 pm, David Pollak feeder.of.the.be...@gmail.com wrote: This snippet is located in the sites/example code, not in Lift itself. Look for the RuntimeStats.scala file. On Tue, Jul 28, 2009 at 3:47 PM, Ewan ehar...@gmail.com wrote: Just finally noticed the runtime stats on the demo site and have tried to include them in my own using the following tags which are copied from the example default template except the snippets don't exist in lift/src/main/scala/net/liftweb/builtin/snippet. Stats: Total Memory: lift:runtime_stats:total_mem/ Free Memory: lift:runtime_stats:free_mem/ Open Sessions: lift:runtime_stats:sessions/ Updated At: lift:runtime_stats:updated_at/ I am currently running Liftversion1.1-SNAPSHOT built on Mon Jul 27 04:38:37 BST 2009 Which dependency do I need to add to my POM to get this to work? -- Ewan -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: S.getHeaders, could i get some examples?
+1 too Yea, and after i get this thing working i can add some stuff to the wiki on how to work with the browser's maker/version, etc. On Jul 21, 9:09 am, marius d. marius.dan...@gmail.com wrote: +1 ! On Jul 21, 6:05 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: S.getHeader is for retrieving headers that are set in the *response*, not the request. I can update the docs to make that more clear, although it seems like this is confusing. Perhaps we should make a getRequestHeader method. Thoughts? Derek On Mon, Jul 20, 2009 at 7:49 PM, DFectuoso santiago1...@gmail.com wrote: for some reason S.getHeader(User-Agent) returns empty, but the second one(using the so useful for) did the trick, thanks! On Jul 20, 4:34 pm, David Pollak feeder.of.the.be...@gmail.com wrote: How about S.getHeader(User-Agent)? Or for {r - S.request; ua - r.userAgent} yield ua? On Mon, Jul 20, 2009 at 4:20 PM, DFectuoso santiago1...@gmail.com wrote: Im trying to get information about the browser the user is using and wanted to get some working snippets around S.getHeaders. Can't get it to work ( S.getHeaders(List((User-Agent,))) returns (User-Agent, )). I guess I'm not calling it right. -- 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] S.getHeaders, could i get some examples?
Im trying to get information about the browser the user is using and wanted to get some working snippets around S.getHeaders. Can't get it to work ( S.getHeaders(List((User-Agent,))) returns (User-Agent, )). I guess I'm not calling it right. --~--~-~--~~~---~--~~ 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: S.getHeaders, could i get some examples?
for some reason S.getHeader(User-Agent) returns empty, but the second one(using the so useful for) did the trick, thanks! On Jul 20, 4:34 pm, David Pollak feeder.of.the.be...@gmail.com wrote: How about S.getHeader(User-Agent)? Or for {r - S.request; ua - r.userAgent} yield ua? On Mon, Jul 20, 2009 at 4:20 PM, DFectuoso santiago1...@gmail.com wrote: Im trying to get information about the browser the user is using and wanted to get some working snippets around S.getHeaders. Can't get it to work ( S.getHeaders(List((User-Agent,))) returns (User-Agent, )). I guess I'm not calling it right. -- 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] Nice 404's?
How can I implement nice 404's so instead of getting The Requested URL /dsdsa was not found on this server I Could have some HTML there? Pretty simple question =) (If there's a tutorial or documentation about this out there just point me there and ill serve myself, sorry for a simple post I just didn't find anything in the lift book/wiki/ google) --~--~-~--~~~---~--~~ 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: Nice 404's?
I don't know how i missed that wiki page I think : // Redirect LiftRules.uriNotFound.prepend{ case (req, _) = PermRedirectResponse(404, req) } Is all i needed =) And yes the entry is understandable enought. Thanks! On Jul 14, 5:04 pm, Xavi Ramirez xavi@gmail.com wrote: Here's a quick tutorial:http://wiki.liftweb.net/index.php/Setting_up_a_custom_404_page Not sure if it's comprehensive, but it's a nice start. Thanks, Xavi On Tue, Jul 14, 2009 at 7:00 PM, DFectuososantiago1...@gmail.com wrote: How can I implement nice 404's so instead of getting The Requested URL /dsdsa was not found on this server I Could have some HTML there? Pretty simple question =) (If there's a tutorial or documentation about this out there just point me there and ill serve myself, sorry for a simple post I just didn't find anything in the lift book/wiki/ google) --~--~-~--~~~---~--~~ 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] Snippet knowing all the possible parameters?
I don't know if its possible, but lift have surprised me so many times so far that it worth to ask. I have a html lift binding that i would like to place on several places of my web application like: lift:Foo.Bar variable=value/ lift:Foo.Bar variable=value1/ lift:Foo.Bar variable=value2/ Is there any way for Foo.Bar to programaticly know all the possible values that it could receive in variable(and those being value, value1 and value2 and if someone adds a new binding somewhere else with value3 then value3 too)? Its a long shot but if you have any idea please do tell! --~--~-~--~~~---~--~~ 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] http://wiki.liftweb.net request
How can people get editing power on the wiki? Is it intended to be used as a (real) wiki? Who is responsable right now for hosting that and keeping it up? I was fizzling around today with mySql and lift following the advice there and decided I would like to expand the article with some problems I had and how i solved and that kind of stuff =) --~--~-~--~~~---~--~~ 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: Background jobs
On Jul 9, 5:27 pm, Vlad Seryakov vserya...@gmail.com wrote: I am building Web application using Lift (my first one) which is the port of existing Tcl/Aolserver based application. In the existing one i have two parts: Web and backend. Backedn part consists of jobs running in the background from time to time using schedule or on demand. I am trying to figure out the architecture and practical way of doing this in servlet/Lift environment. I used to have telnet interface but this is not a requirement, i can test using special temporary Web interface. Is there any recommendation or experience regarding such applications? In my opinion... Yes, drop the telnet and do a web interface to administrate anything, its worth it. for example, i have special job for importing huge Xml files into the database. How huge? The problem of loading big Xml files in Scala is already a challenge but for now i assume i have unlimited memory. The problem i have how to test it. Test it? like automated testing or test it want to know it works. If its the second, how about making a simple html file with a file submit form, add a sitemap entry to a lift application and create a snippet that parses that file and print the time it takes to crunch it! =) If you have no idea how to do this I would recomend buying the Lift book ( http://www.apress.com/book/view/9781430224211 which is not quite easy or polished but its a great way to go head first into the liftworld) Using scala interpreter mode i could test the Xml loading and parsing, now i need to load it into database and i have Mapper setup for my schema. Calling this job from simple Web snippet is my only choice? Calling this job from a web snippet is one way, other is to use mvn scala:console, but really is fast to set up that snippet, if you need any help let me know! 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: Code Review for Unique Key Constraints
I for one would like to say: Cool! Thanks! If i need unique indexes in the next couple of weeks i'll get this baby to the war( .war thats it ) =) On Jul 9, 11:30 am, Calen Pennington calen.penning...@gmail.com wrote: As mentioned is this issue (http://github.com/dpp/liftweb/issues#issue/19), and as came up on the list recently, Lift currently has no way to specify that a field or an index be unique. I've coded up a patch that addresses this, and could also be used for other index types on a project specific basis (for instance, FULLTEXT or SPATIAL indexes in mysql). -Cale 0001-Adding-the-ability-to-create-UNIQUE-indexes-over-sin.patch 5KViewDownload --~--~-~--~~~---~--~~ 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] Actor and clusters?
I'm hosting some experiments on Stax and right now im pondering over the idea of checking out how to have a database backed session so the SessionVars work in a cluster of 5 boxes; With that in mind, have anyone worked with actors and clustering? Is there some documentation around that? should it work out of the box, or some works of encouragement to try working on this terrain? --~--~-~--~~~---~--~~ 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: Typesafe JSON builder?
I've read some stuff about Jorge Ortiz's Json Parser and how its super type safe, i guess you could use that same logic to create your builder (and I would not be surprised if theres something like that laying around in Lift). I hope if there is, someone will point you in the right direction, all I can do is point you to that parser: http://technically.us/git?p=dispatch.git;a=blob;f=src/main/scala/dispatch/Json.scala;h=776da7b6c399d2985dfbed74bd31a197568360f9;hb=HEAD On Jul 9, 10:35 am, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: Hi, Has anyone made a typesafe JSON builder? Many Javascript libraries provides support for extensive customization, usually via a JSON object (eg.http://www.jqplot.com/docs/files/optionsTutorial-txt.html#Options_Tut... It would be nice to generate this from Scala which would then give you type checking, IDE auto completion etc. Lacking concrete implementations, any ideas on the best way to approach this. I've seenhttp://blog.rafaelferreira.net/2008/07/type-safe-builder-pattern-in-s... which looks like a viable (if a bit verbose) approach. /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: Actor and clusters?
Thanks, that was very useful, to enable sticky variables i would do something like (explain here http://wiki.stax.net/w/index.php/Application_Clustering ) that? So bottom line? An actor can send a message an actor that is living in another JVM using sticky variables(or anything else) (sorry i don't know if that terracota, don't know what that is) On Jul 9, 11:53 pm, marius d. marius.dan...@gmail.com wrote: Actors are local to the JVM. Scala also has RemoteActors but we don't really use them. For a lift app in a cluster environment we have to have sticky sessions concept and the reason is that functions bound to a session and mostly the references they are holding are not serialized distributed. So assuming: 1. Session 1 is created on Node 1 2. If on a subsequent request (pertaining to the Session 1) load balancer decides to dispatch the request on Node 2 you are loosing all session context including bound functions etc. This is why the load balancer must guarantee that all requests pertaining to the same session needs to be dispatched on the same node. There were some efforts in the past to integrate Terracotta but I guess there was a dead end somewhere. You can of course build you own app to not use functions bound to a session and only rely on DispatchPf style (somehow similar with Spring controllers) but that's not very lift-ish. But in this case you can persist your state in DB (which is common to all nodes) and when a request comes you just fetch the context data from DB and set your SessionVars. The problem with functions kept on the session is that those function can be lambda expression referencing members from other classes which are not serializable etc. And even if they somehow were Java serialization is bad for performance. The bottom line is that sticky sessions have the benefit of the performance because there is no state that needs to be distributed and replicated among all cluster nodes OR no need to persist the session state. But the drawback is that requests pertaining to the same session needs to be processed by the same node. IMHO using Lift apps in a cluster env. without sticky sessions can be a very tricky thing to achieve. Br's, Marius On Jul 10, 6:32 am, DFectuoso santiago1...@gmail.com wrote: I'm hosting some experiments on Stax and right now im pondering over the idea of checking out how to have a database backed session so the SessionVars work in a cluster of 5 boxes; With that in mind, have anyone worked with actors and clustering? Is there some documentation around that? should it work out of the box, or some works of encouragement to try working on this terrain? --~--~-~--~~~---~--~~ 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: Actor and clusters?
Cool, thanks, this pretty much solves the question =) On Jul 10, 12:54 am, marius d. marius.dan...@gmail.com wrote: On Jul 10, 10:40 am, DFectuoso santiago1...@gmail.com wrote: Thanks, that was very useful, to enable sticky variables i would do something like (explain herehttp://wiki.stax.net/w/index.php/Application_Clustering ) that? So bottom line? An actor can send a message an actor that is living in another JVM using sticky variables(or anything else) (sorry i don't know if that terracota, don't know what that is) An actor can send messages to an actor in the same jvm (or better yet part of the same class loader's delegation). With Scala's RemoteActors (http://www.scala-lang.org/docu/files/api/index.html) you can send messages remotely. But I think it is using Java serialization/ deserialization and personally I'd stay away of this. I'd probably use other transports like AMQP or REST and keep working with actors locally. For terracotta you can read more here:http://www.terracotta.org/... it is a great framework. On Jul 9, 11:53 pm, marius d. marius.dan...@gmail.com wrote: Actors are local to the JVM. Scala also has RemoteActors but we don't really use them. For a lift app in a cluster environment we have to have sticky sessions concept and the reason is that functions bound to a session and mostly the references they are holding are not serialized distributed. So assuming: 1. Session 1 is created on Node 1 2. If on a subsequent request (pertaining to the Session 1) load balancer decides to dispatch the request on Node 2 you are loosing all session context including bound functions etc. This is why the load balancer must guarantee that all requests pertaining to the same session needs to be dispatched on the same node. There were some efforts in the past to integrate Terracotta but I guess there was a dead end somewhere. You can of course build you own app to not use functions bound to a session and only rely on DispatchPf style (somehow similar with Spring controllers) but that's not very lift-ish. But in this case you can persist your state in DB (which is common to all nodes) and when a request comes you just fetch the context data from DB and set your SessionVars. The problem with functions kept on the session is that those function can be lambda expression referencing members from other classes which are not serializable etc. And even if they somehow were Java serialization is bad for performance. The bottom line is that sticky sessions have the benefit of the performance because there is no state that needs to be distributed and replicated among all cluster nodes OR no need to persist the session state. But the drawback is that requests pertaining to the same session needs to be processed by the same node. IMHO using Lift apps in a cluster env. without sticky sessions can be a very tricky thing to achieve. Br's, Marius On Jul 10, 6:32 am, DFectuoso santiago1...@gmail.com wrote: I'm hosting some experiments on Stax and right now im pondering over the idea of checking out how to have a database backed session so the SessionVars work in a cluster of 5 boxes; With that in mind, have anyone worked with actors and clustering? Is there some documentation around that? should it work out of the box, or some works of encouragement to try working on this terrain? --~--~-~--~~~---~--~~ 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] Speeding load time; liftAjax.js and other javascript minified?
I dont know how liftAjax.js is generated, or if it changes or not, also I have no idea (if it regenerated) how it could be minified, and I know that minification seem like a micro-optimization but... With just GZipping and Javascript minification working together, the load time dropped from 16 seconds to just under 10 seconds. I was absolutely extactic at the progress I was making so for and so was my client! http://www.site-reference.com/articles/Website-Development/YSlow-Helping-slow-web-pages-load-faster.html For Google an increase in page load time from 0.4 second to 0.9 seconds decreased traffic and ad revenues by 20%. For Amazon every 100 ms increase in load times decreased sales with 1%. http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/ So, analyzing a couple of lift apps with YSlow I find a couple of things that could be done to improve the average load time. Of course there's a lot of impact on how you do your css, where you host css and images(and how), compresion, server configuration, javascript and css performance and a lot of things on the application side; but it would be nice to make everything possible on the framework side to create that culture around every lift app =) So I wanted to throw that idea here and see how to help in this matter. Ideas? --~--~-~--~~~---~--~~ 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: Speeding load time; liftAjax.js and other javascript minified?
Ok, i got my tools ready; but I am too tired so i'll run them tomorrow... Right now i did 2 different minifications on dfectuoso.com/liftAjax/ test1.html and test2.html in test.html its the liftAjax file we all use... so, im probably going to run a couple hundred hits on each one and see if theres any change; but im going to use (on each one) diferent versions of jQuery, just cause i love statistics... I'll keep you guys updated On Jul 10, 1:51 am, Timothy Perrett timo...@getintheloop.eu wrote: My bad marius... your reply must have gone in just before mine (I didnt read it before sending mine!) Cheers, Tim On Jul 10, 9:33 am, marius d. marius.dan...@gmail.com wrote: Tim, sorry but I have to say that liftAjax.js IS generated dynamically as I stated above :). It is not a script sitting somewhere but it ultimately comes from ScriptRenderer.scala Br's, Marius On Jul 10, 11:26 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey, liftAjax.js is not regenerated dynamically as far as im aware... By default, lift ships with the maven plugin for YUI compressor, so that should minify the CSS/JS in your webapp dir. Perhaps we should try and minify liftAjax.js during the build of lift... marius is probally the best man for this as this stuff is pretty much his baby. Cheers, Tim On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote: I dont know how liftAjax.js is generated, or if it changes or not, also I have no idea (if it regenerated) how it could be minified, and I know that minification seem like a micro-optimization but... With just GZipping and Javascript minification working together, the load time dropped from 16 seconds to just under 10 seconds. I was absolutely extactic at the progress I was making so for and so was my client!http://www.site-reference.com/articles/Website-Development/YSlow-Help... For Google an increase in page load time from 0.4 second to 0.9 seconds decreased traffic and ad revenues by 20%. For Amazon every 100 ms increase in load times decreased sales with 1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/ So, analyzing a couple of lift apps with YSlow I find a couple of things that could be done to improve the average load time. Of course there's a lot of impact on how you do your css, where you host css and images(and how), compresion, server configuration, javascript and css performance and a lot of things on the application side; but it would be nice to make everything possible on the framework side to create that culture around every lift app =) So I wanted to throw that idea here and see how to help in this matter. Ideas? --~--~-~--~~~---~--~~ 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: Speeding load time; liftAjax.js and other javascript minified?
I kinda knew that coz i did a very fast search for a file called liftAjax.js... just wanted to be sure! And now I am... Why don't you guys let me run some benchmarks before actually investing some time on this? (but keep talking about this subject tho, nothing bad can come from exploring how to do faster lift apps! ) On Jul 10, 1:33 am, marius d. marius.dan...@gmail.com wrote: Tim, sorry but I have to say that liftAjax.js IS generated dynamically as I stated above :). It is not a script sitting somewhere but it ultimately comes from ScriptRenderer.scala Br's, Marius On Jul 10, 11:26 am, Timothy Perrett timo...@getintheloop.eu wrote: Hey, liftAjax.js is not regenerated dynamically as far as im aware... By default, lift ships with the maven plugin for YUI compressor, so that should minify the CSS/JS in your webapp dir. Perhaps we should try and minify liftAjax.js during the build of lift... marius is probally the best man for this as this stuff is pretty much his baby. Cheers, Tim On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote: I dont know how liftAjax.js is generated, or if it changes or not, also I have no idea (if it regenerated) how it could be minified, and I know that minification seem like a micro-optimization but... With just GZipping and Javascript minification working together, the load time dropped from 16 seconds to just under 10 seconds. I was absolutely extactic at the progress I was making so for and so was my client!http://www.site-reference.com/articles/Website-Development/YSlow-Help... For Google an increase in page load time from 0.4 second to 0.9 seconds decreased traffic and ad revenues by 20%. For Amazon every 100 ms increase in load times decreased sales with 1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/ So, analyzing a couple of lift apps with YSlow I find a couple of things that could be done to improve the average load time. Of course there's a lot of impact on how you do your css, where you host css and images(and how), compresion, server configuration, javascript and css performance and a lot of things on the application side; but it would be nice to make everything possible on the framework side to create that culture around every lift app =) So I wanted to throw that idea here and see how to help in this matter. Ideas? --~--~-~--~~~---~--~~ 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: Actor and clusters?
Refering to why i want to know this: Im using stax because it's free, they are pretty cool and lift/scala worked out of the box pretty fast(i was having some issues getting some hosting for whatever i do in my free time with lift/scala). They have a cluster option right now(still, free) so, they are not the best machines in the world but it allowed me to play with cluster information. No, I don't have a production application that needs to scale to many boxes ATM... but I sure have a lot of curiosity of how things work! Once you get to the 100+ pages per second range, call me and we'll figure out how to distribute your app across more than 1 server. I will keep this mail stored in my secure mail secret location as insurance! hahaha On Jul 10, 6:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jul 10, 2009 at 6:50 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jul 10, 2009 at 12:40 AM, DFectuoso santiago1...@gmail.comwrote: Thanks, that was very useful, to enable sticky variables i would do something like (explain here http://wiki.stax.net/w/index.php/Application_Clustering ) that? So bottom line? An actor can send a message an actor that is living in another JVM Scala's remote actors are very, very fragile and have not been used in any kind of production or load environment to my knowledge. They rely of Java's serialization mechanism which has a series of problems (fragile in the face of different class versions on different nodes, the tendency to serialize the world because of references to globals, and the unsolved problem of serializing Scala singleton objects). I'm addressing these issues with Goat Rodeo (http://goatrodeo.org), but it won't be ready for other people to mess with for a couple of months. And a follow up... what kind of application do you have that requires more throughput than a single JVM can handle? In benchmarks that I've done, a big RDBMS gets saturated around the same time that a single Lift app gets saturated. A big RDBMS can handle about 10K requests per second if most of those requests are reads and they come from cache. If you have ACID enabled (so every write goes to disk), best case is 2K writes per second. A well tuned Lift app can serve 2K dynamically generated pages on a quad core box. If each page has a couple of read queries and a write query, you're pretty close to saturating you RDBMS. So, unless you're at Twitter/Facebook/LinkedIn levels of traffic, you'd be best designing your app for a single JVM. Once you get to the 100+ pages per second range, call me and we'll figure out how to distribute your app across more than 1 server. using sticky variables(or anything else) (sorry i don't know if that terracota, don't know what that is) On Jul 9, 11:53 pm, marius d. marius.dan...@gmail.com wrote: Actors are local to the JVM. Scala also has RemoteActors but we don't really use them. For a lift app in a cluster environment we have to have sticky sessions concept and the reason is that functions bound to a session and mostly the references they are holding are not serialized distributed. So assuming: 1. Session 1 is created on Node 1 2. If on a subsequent request (pertaining to the Session 1) load balancer decides to dispatch the request on Node 2 you are loosing all session context including bound functions etc. This is why the load balancer must guarantee that all requests pertaining to the same session needs to be dispatched on the same node. There were some efforts in the past to integrate Terracotta but I guess there was a dead end somewhere. You can of course build you own app to not use functions bound to a session and only rely on DispatchPf style (somehow similar with Spring controllers) but that's not very lift-ish. But in this case you can persist your state in DB (which is common to all nodes) and when a request comes you just fetch the context data from DB and set your SessionVars. The problem with functions kept on the session is that those function can be lambda expression referencing members from other classes which are not serializable etc. And even if they somehow were Java serialization is bad for performance. The bottom line is that sticky sessions have the benefit of the performance because there is no state that needs to be distributed and replicated among all cluster nodes OR no need to persist the session state. But the drawback is that requests pertaining to the same session needs to be processed by the same node. IMHO using Lift apps in a cluster env. without sticky sessions can be a very tricky thing to achieve. Br's, Marius On Jul 10, 6:32 am, DFectuoso santiago1...@gmail.com wrote: I'm hosting some experiments on Stax and right now im pondering over the idea of checking out how to have a database backed session so
[Lift] Pick n random elements from a list?
Hi! I have a list, lets say its List.range(1,100) and i want to pick n random elements from it. Basicly I know that i can create n diferente randon numbers inside the limits and pick each element, but that would look something like this store List.range(1,100); store randonNumbers generated by a function; foreach(randonNumber){ get number from the list into a new list So before I started coding that, i decided I need to stop thinking in php and start thinking in scala, i want a code that looks like List.range(1,100).shuffle take n So i did some poking around in scala and found that scala 2.8 theres a util.Random.shuffle so i could do util.Random.shuffle(List.range(1,100)) take 3 Close enought... but... it doesnt work in lift using scala 2.7.5 So before spending more time I wanted to check if you guys had a quick way to do this the scala way 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: Web service with DB access - Lift required?
Since i (personally) have no background in java, and have no idea how to get a request in a container(such as tomcat or jetty) to call me code inside a war file... if I where you i would set up a very simple lift app(it will take care many things like the db connection and other stuff). Keep in mind that i know how lift works, and not how the stack works. I would say if the case was the other way around(i would do this for python) i would go for pure language(no framework). Also, are you doing objective-C on the iPhone, or are you doing some wrapper on the browser and programming with html/js(with something like phoneGap)? On Jul 8, 5:43 pm, Raphael erzengelr...@googlemail.com wrote: Hey, I'd like to build a simple web service that makes conference schedules and session data accessible to an iPhone client. The data is supposed to be stored in a MySQL db on the server. So at the moment, I am not planning on creating any form of web app / web site for that. However, that would be one of the next steps also. I just have looked at Lift briefly. Is it a good idea to use Lift for just that web service if there's no web site? Considering that buiding a web site to access the data also soon, would you suggest going straight to Lift? Best regards Raphael --~--~-~--~~~---~--~~ 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: license expired
The license of javaRebel packed with lift expired a couple of days ago, there's already a couple of solutions (you can read all about it http://groups.google.com/group/liftweb/browse_thread/thread/f78ccc29771e7a6a/6786c9be242b6f06?lnk=gstq=license#6786c9be242b6f06 here) The best solution, for the next couple of days is to download a unrgistered copy(30 day free trial) from http://www.zeroturnaround.com/javarebel/download and replace de jars in your javaRebel folder(inside your lift instalation) Hope you get it working without trouble! On Jul 8, 4:55 pm, satish gunnu satish.gu...@gmail.com wrote: I am trying the getting started guide, when I try to run the following command I get the license expired. Am I looking at old guide or is it something that is going to be changed? Help/comments are appreciated. mvn archetype:generate -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-blank \ -DarchetypeVersion=1.0 \ -DremoteRepositories=http://scala-tools.org/repo-releases\ -DgroupId=demo.helloworld \ -DartifactId=helloworld \ -Dversion=1.0-SNAPSHOT # ZeroTurnaround JavaRebel 1.2.2 (200812021546) (c) Copyright Webmedia, Ltd, 2007, 2008. All rights reserved. YOUR JAVAREBEL LIMITED LICENSE HAS EXPIRED! This product is licensed to Scala Community until July 1, 2009 for unlimited number of developer seats on site. With the following restrictions: For use with Scala only ## --~--~-~--~~~---~--~~ 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: Overriding a lazy val and super?
But I want to override... and add something (adding something to the original sitemap, ) Allright, with your example I can express my question perfectly! If you have trait Foo { def bar: String } trait MegaFoo extends Foo { lazy val bar = Hello } And then want to create a trait that extends MegaFoo and override bar, adding something to that string... i get the next results: With: trait SuperMegaFoo extends MegaFoo { override lazy val bar = bar + Super Duper } Compiler: (fragment of overrideTest.scala):10: error: recursive lazy value bar needs type override lazy val bar = bar + Super Duper With: trait SuperMegaFoo extends MegaFoo { override lazy val bar:String = bar + Super Duper } Compiler: (Cras!) java.lang.StackOverflowError at scala.StringBuilder.append(StringBuilder.scala:242) at scala.StringBuilder.init(StringBuilder.scala:54) at scala.StringBuilder.init(StringBuilder.scala:41) at Main$$anon$2$SuperMegaFoo$class.bar((virtual file):14) at Main$$anon$2$$anon$1.bar((virtual file):17) at Main$$anon$2$SuperMegaFoo$class.bar((virtual file):14) at Main$$anon$2$$anon$1.bar((virtual file):17) at Main$$anon$2$SuperMegaFoo$class.bar((virtual file):14) With: trait SuperMegaFoo extends MegaFoo { override lazy val bar:String = super.bar + Super Duper } Compiler: (fragment of overrideTest.scala):10: error: super may be not be used on lazy value bar override lazy val bar:String = super.bar + Super Duper With trait SuperMegaFoo extends MegaFoo { override val bar:String = super.bar + Super Duper } Compiler: (fragment of overrideTest.scala):10: error: super may be not be used on lazy value bar override val bar:String = super.bar + Super Duper Finally, dropping the lazzy: trait SuperMegaFoo extends MegaFoo { override val bar:String = bar + Super Duper } Compiler: (fragment of overrideTest.scala):10: error: error overriding lazy value bar in trait MegaFoo of type java.lang.String; value bar must be declared lazy to override a concrete lazy value So this is my trouble(i get all this cases if i try to override sitemap from the metaprotouser to add new items to the sitemap) i cant drop the lazy, i cant use super in lazy so what am I doing something wrong? On Jul 8, 10:23 am, David Pollak feeder.of.the.be...@gmail.com wrote: trait Foo { def bar: String } trait MegaFoo extends Foo { lazy val bar = Hello } trait SuperMegaFoo extends MegaFoo { override lazy val bar = Super Duper } println((new SuperMegaFoo{}).bar) // Super Duper On Tue, Jul 7, 2009 at 11:46 PM, DFectuoso santiago1...@gmail.com wrote: I'm getting a little bit confused by the override lazy val behavior so I wanted to ask you guys... I want to create a trait that extends the MetaMegaProtoUser and overrides the sitemap(defined as a lazy val), adding something to the original sitemap, how would that declaration work? If I do something like: override lazy val sitemap = super.sitemap :: other elements The compiler tells me that super cannot be used in this context. If I dont user super, then it says that its a recursive declaration(and it seems to be). How can you achieve this overriding? -- 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] So, how to get from format to hosting a lift app?
I'm having a lot of trouble getting some code into production in my wiredtree VPS where i use apache and other stuff; so I decided to leave that host alone. I started playing with comet and some dispatch hacks that dont work on the GAE; so I decided to leave GAE alone. So I need a new hosting to run a couple of lift apps that I will be creating in the next weeks! I checked out SliceHost and it seems pretty cool, cheap and hard to configure, so... David said he prefers to use nginx and then jetty. I have no idea how to install, configure and deploy multiple apps in multiple domains in a webserver that only haves the OS installed(which I think is the case of slicehost). So, my first question would be if you know of a better hosting than slicehost. Anyway if I go with slicehost, what OS should I use? What do i need to install to have nginx and jetty running all the time with multiple apps and domains? How do I deploy? (ssh?, ftp? what?) Thank you very much guys! --~--~-~--~~~---~--~~ 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?
Well i went ahead and learn a lot from the lift-openId implementation and understand what I would need to do have lift-OAuth working It seems like i could do two things: 1) Get a OAuth java library that allows me to post, get, login and logout then create a OAuth.scala file where i create a trait of the OAuth Handler 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. 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). Also, what part of this abstraction(and how) is the one to set the consumer_key, secret_key and the request urls? 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 =) On Jun 21, 7:18 am, marius d. marius.dan...@gmail.com wrote: OAuth is 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 integrate OAuth (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)... So what are you guys doing around OAuth and what could i do to get this rolling? --~--~-~--~~~---~--~~ 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?
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-OAuth working It seems like i could do two things: 1) Get a OAuth java library that allows me to post, get, login and logout then create a OAuth.scala file where i create a trait of the OAuth Handler 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 over OAuth artifacts. 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? In OAuth world 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: OAuth is 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 integrate OAuth (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)... So what are you guys doing around OAuth and what could i do to get this rolling? --~--~-~--~~~---~--~~ 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: Jetty and Apache
Thank you very much, i will look into nginx! I admire how fast you answer everything in here =) ... o yea and thanks for creating this great community! How about the java container, do you strongly recommend jetty or is there anything better? (Specially what do you think of tomcat?) On Jun 20, 6:27 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Apache does not deal well with long polling or lots of open connections. For low traffic sites, it won't be noticeable. However, I strongly recommend nginx... it's a much much better http server than apache and it's got a very small memory footprint. On my servers, I run nginx at port 80 and proxy to apache for php sites. On Jun 20, 2009 3:11 PM, DFectuoso santiago1...@gmail.com wrote: I have a VPS in wiredtree where i would like to run a scala/lift application with jeety in a server that is running a LAMP stack. I want to use comet actors so i will be using the long http hack and i dont know if that would be important. So what options do i have? How can i achieve this? I read there are way to do this with mod_rewrite and with mod_proxy but i have no idea! --~--~-~--~~~---~--~~ 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: Jetty and Apache
Actually... what can I do to help you create a good tutorial on how to take any off the shelf vpn server running a LAMP stack to have nginx, jetty and apache running(and still using cpanel and everything else for php sites). I think that having a step by step tutorial on how to deploy to the GAE(i know you dont like it but hey), vpn, and Amazon EC2 would be great; I know there are some stuff out there but for people who have not used any java container its pretty hard to undertand what going on with all this softwares Kudos On Jun 20, 6:27 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Apache does not deal well with long polling or lots of open connections. For low traffic sites, it won't be noticeable. However, I strongly recommend nginx... it's a much much better http server than apache and it's got a very small memory footprint. On my servers, I run nginx at port 80 and proxy to apache for php sites. On Jun 20, 2009 3:11 PM, DFectuoso santiago1...@gmail.com wrote: I have a VPS in wiredtree where i would like to run a scala/lift application with jeety in a server that is running a LAMP stack. I want to use comet actors so i will be using the long http hack and i dont know if that would be important. So what options do i have? How can i achieve this? I read there are way to do this with mod_rewrite and with mod_proxy but i have no idea! --~--~-~--~~~---~--~~ 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: your first Lift application on GAE/J
You sir, you rock!!! Thanks for this awesome tutorial! On Jun 8, 7:28 pm, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com wrote: Hi, On Mon, Jun 8, 2009 at 11:38 PM, Amit Kumar Vermacdac.a...@gmail.com wrote: $ mvn package ... --- T E S T S --- Running test.test.test.AppTest [Fatal Error] :3:4: The markup in the document following the root element must be well-formed. I guess that the problem has happened in parsing your src/main/web/app/WEB-INF/appengine-web.xml That message says that the problem has occurred at line 3rd and column 4th. Please check it again. And what is the meaning of STEP 4 and STEP 5 $ appengine-java-sdk-1.2.0/bin/dev_appserver.sh target/test-1.0- SNAPSHOT $ appengine-java-sdk-1.2.0/bin/appcfg.sh update target/test-1.0- SNAPSHOT where is this appengine-java-sdk-1.2.0 is located ??? You can grab it at http://code.google.com/intl/en/appengine/downloads.html#Google_App_En... , and the latest version is 1.2.1 at the present time. Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 +1-415-578-3454 Skype callto://jcraft/ --~--~-~--~~~---~--~~ 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] So where is that OAuth?
Im trying to integrate OAuth (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)... So what are you guys doing around OAuth and what could i do to get this rolling? --~--~-~--~~~---~--~~ 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] Jetty and Apache
I have a VPS in wiredtree where i would like to run a scala/lift application with jeety in a server that is running a LAMP stack. I want to use comet actors so i will be using the long http hack and i dont know if that would be important. So what options do i have? How can i achieve this? I read there are way to do this with mod_rewrite and with mod_proxy but i have no idea! --~--~-~--~~~---~--~~ 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] Very basic questions
Hi! I'm starting to use lift/scala(I don't know either) and already I have a couple of (very very basic) questions. I'm reading The definitive guide to lift and even tho it's been enough to actually understand some of the key elements of a lift application I am having some problems understanding some of the code and how you people work with Lift. 1.- What tools do you use to program, debug and run the website? At this moment I'm using text mate to program and the terminal to run yetti; It's very slow to run yetti every time and its hard to understand the errors so i tried eclipse but I had trouble installing the maven plug-in so... what is your toolbox? 2.- What is _ and Full in different places? I see that in a binding name - SHtml.text(name, name = _) or when checking for cases there's a case for Full(_) and for _ ; what does _ means and what does Full mean; and whats the difference between Full (_) and _. 3.-Reading about the flow from request to response; i cant avoid to ask: How many times does the Boot(or bootloader) run? Once when i run the app(or web server; yetti in my case) or once every time there's a request? Thank you very much! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---