Re: [Lift] Idea proposal for Google Summer of Code project
Mads Hartmann mads...@gmail.com writes: Morning everyone (it's 8am in Denmark) I would very much like to participate in Google Summer of Code 2010. I know I'm eligible to participate because I'm a student at the IT University of Copenhagen and I'm pretty sure Lift is eligible to participate as a mentoring organization - So all we need now is an 'Ideas-list' which is a list of potential projects for the students to work on created by the mentoring organization. Sounds like a great idea, but see David's e-mail earlier on the subject. Here's my proposal for an idea to the 'ideas-list' - one I would like to work on :) The idea: -- A graphical tool to help people with the data-model part of a Lift project. The user would be able to draw UML models with a simple tool which would be coded by the student - once the user has drawn a few classes it would have the ability to export an XML file. A small scala application would read the XML file and output the correct mapper/ record classes. The tool should be able to read existing classes and discover any changes so it could be reflected in the graphical representation. So basically it would be like Core Data just for Lift ;) It would make sense to code the graphical tool for the browser - possible with the very potent mix og jQuery and Raphaël (http:// raphaeljs.com/) -- So what do you think, is it something you would want to use? Personally, no. I also think that if you need to model your DB graphically, it is probably too complex for Mapper and you should stick to JPA/Hibernate for which (I believe) graphical tools exist. I think this could be a cool project to showcase some of Lift's potential, but as a project to advance the usage of Lift I think the effort is more wisely spent elsewhere :-) /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Logging error when building lift
Naftoli Gugenheim naftoli...@gmail.com writes: Does this mean I'm not up to date? Or were the tests not updated with the change to logging? No change has been made to logging yet (unless I did some git mistake, not impossible :-) But I think this is caused by the fact that lift-webkit includes slf4j-simple as test dependency as well as jwebunit-htmlunit-plugin which in turn includes slf4j-log4j12 causing two slf4j logging backends to be included. This seems like bad packaging of jwebunit (the mistake we'll try to avoid in #309 :-) In general I think some of the dependencies need cleanup (ie lift-openid includes Spring!) and once #309 is done (after M2) we can cleanup the logging dependencies (ie remove commons-logging) /Jeppe When building Lift I get --- T E S T S --- Running net.liftweb.webapptest.ToHeadUsagesTest SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/Naftoli/.m2/repository/org/slf4j/slf4j-simple/1.5.10/slf4j-simple-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/Naftoli/.m2/repository/org/slf4j/slf4j-log4j12/1.5.0/slf4j-log4j12-1.5.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 0 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger(org.mortbay.log) via org.mortbay.log.Slf4jLog 94 [main] INFO org.mortbay.log - jetty-6.1.22 468 [main] INFO org.mortbay.log - NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet 151189 [main] INFO org.mortbay.log - Started socketconnec...@0.0.0.0:8989 log4j:WARN No appenders could be found for logger (com.gargoylesoftware.htmlunit.WebClient). log4j:WARN Please initialize the log4j system properly. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Idea proposal for Google Summer of Code project
Thanks for the feedback :) Just read the mail by David, and I can see we also need someone who would be willing to submit Lift to GSoC - Not sure if google would find it fishy if I submitted Lift and later sumitted for the project as a student also :P If you have any ideas for the 'ideas-list' which you think would be a welcome addittion to lift, please post em here :) On 10/02/2010, at 09.37, Jeppe Nejsum Madsen wrote: Mads Hartmann mads...@gmail.com writes: Morning everyone (it's 8am in Denmark) I would very much like to participate in Google Summer of Code 2010. I know I'm eligible to participate because I'm a student at the IT University of Copenhagen and I'm pretty sure Lift is eligible to participate as a mentoring organization - So all we need now is an 'Ideas-list' which is a list of potential projects for the students to work on created by the mentoring organization. Sounds like a great idea, but see David's e-mail earlier on the subject. Here's my proposal for an idea to the 'ideas-list' - one I would like to work on :) The idea: -- A graphical tool to help people with the data-model part of a Lift project. The user would be able to draw UML models with a simple tool which would be coded by the student - once the user has drawn a few classes it would have the ability to export an XML file. A small scala application would read the XML file and output the correct mapper/ record classes. The tool should be able to read existing classes and discover any changes so it could be reflected in the graphical representation. So basically it would be like Core Data just for Lift ;) It would make sense to code the graphical tool for the browser - possible with the very potent mix og jQuery and Raphaël (http:// raphaeljs.com/) -- So what do you think, is it something you would want to use? Personally, no. I also think that if you need to model your DB graphically, it is probably too complex for Mapper and you should stick to JPA/Hibernate for which (I believe) graphical tools exist. I think this could be a cool project to showcase some of Lift's potential, but as a project to advance the usage of Lift I think the effort is more wisely spent elsewhere :-) /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
Naftoli Gugenheim naftoli...@gmail.com writes: At what would make sense to move around, i.e., what I should to move #257 and #258 forward. Thanks! I think those look good. In the spirit of incremental progress, I think any other changes should be on new tickets. /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Snippet with no reflection an no massive case statement
Again, the only reason i raised this question it's because i was alarmed by what the wiki page about reflection snippets says: works perfectly for development / low volume deployment, however when your site starts to scale this method of snippet modeling may become undesirable. All i would like is some clarification if this statement is in fact true, if not i will go on with my project happily using reflection snippets. If it is true i then would be looking for a better alternative. On Wed, Feb 10, 2010 at 06:56, Naftoli Gugenheim naftoli...@gmail.comwrote: Besides, would it even help? Is the time in obtaining a Method instance rather than invoking it? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Feb 9, 2010 at 9:10 AM, Hugo Palma hugo.m.pa...@gmail.com wrote: Why doesn't Lift create the mapping at startup using reflection ? It's not using reflection that's the problem, it's using reflection at runtime for every single snippet usage. Why do you care? The cost of doing a method dispatch via reflection is about 5x the cost of a doing a method call on an interface with is about 2x more costly than doing a method call on a class. The amount of time to do reflection on the 10 or 20 snippets you may have on a page is unmeasurably small compared to the cost of rendering the page. I may be over simplifying things, but if at startup Lift would go through all snippet classes and using reflection found all the methods kept all the mappings somewhere in memory i think it could work. Is this doable ? No, it is not possible at start-up time to determine all the classes that might be snippets. On 9 Fev, 17:01, Timothy Perrett timo...@getintheloop.eu wrote: So you don't want to write any explicit mapping, and you don't want to use reflection??? How would you propose Lift know what your asking for? Im afraid voodoo is not yet compatible with the JVM ;-) Cheers, Tim On 9 Feb 2010, at 16:54, Hugo Palma wrote: I just readhttp://wiki.github.com/dpp/liftweb/about-snippetsand i have the following question: So is really the only way to avoid having a reflection call every time you use a snippet to use a DispatchSnippet with a case statement for every method ? It's just that i don't really think that the case is a very clean way of doing things. Can be ok for a couple of methods but it can be really ugly with more than that. So, is there any other way ? Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] how to combine sequence of JsCmd in SHtml.ajaxCall?
Hi, I have the following code: def jsF(x: String): JsCmd = { /* JsCmds.SetHtml(...) JsCmds.SetElemById(...) */ JE.JsRaw(alert('1')).cmd JE.JsRaw(alert('2'); alert('3')).cmd // last cmd } button onclick={SHtml.ajaxCall(Str(x), jsF _)._2} /button when I tried, only the last cmd got executed, I know this is because it's the return value for the whole function jsF(). I'm wondering is it possible to make it execute a sequence of JsCmd? e.g. as the code that have been commented out? how this can be done in Lift (instead of writing raw JsRaw)? Thanks! -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Lift 2.0 on Scala 2.8 update
scalacheck_2.8.0.Beta1 used in the branch 280_port_refresh now. Tim, see if your build works on this branch now. Cheers, Indrajit On 04/02/10 12:12 PM, Indrajit Raychaudhuri wrote: Sure, I will. This would go in as regular 280_port_refresh update activity. Cheers, Indrajit On 04/02/10 3:13 AM, Timothy Perrett wrote: Awesome stuff :-) IRC, will you take the lead on this? Cheers, Tim Sent from my iPhone On 3 Feb 2010, at 20:33, Rickard Nilsson rickyn...@gmail.com wrote: I have now built ScalaCheck for Scala 2.8.0 Beta 1: http://groups.google.com/group/scalacheck/browse_thread/thread/5a1e216fa82ed91 Regards, Rickard Den 2010-01-31 21:57:07 skrev David Pollak feeder.of.the.be...@gmail.com: The problem is that there's no ScalaCheck version for Scala 2.8.0 Beta1. The Beta1-RC5 compilation of ScalaCheck was causing the wrong Scala libraries to be loaded. This is seriously suboptimal. On Sun, Jan 31, 2010 at 12:44 PM, Timothy Perrett timo...@getintheloop.euwrote: Im just doing a fresh clone and checkout to see if something was screwed in my local build. Cheers, Tim On Jan 31, 7:44 pm, Indrajit Raychaudhuri indraj...@gmail.com wrote: I was suspecting Java 1.5 (if you were on 10.5). That's not the case. So I am completely stumped now. See if you can compare with the Hudson copy (http://hudson.scala-tools.org/view/Lift/job/lift-framework-scala280/) - IRC On 01/02/10 12:55 AM, Timothy Perrett wrote: macbookpro:lift-framework timperrett$ java -version -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Features in Lift 2.0
Hi, I have been exploring lift and was interested in what new features are in/planned for lift 2.0. I havent been able to find any documentation regarding it. Can anyone guide me to it. Also what is the planned release for 2.0? Also appreciate for maintaining such a responsive mailing list. Thanks, Murtaza -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: how to combine sequence of JsCmd in SHtml.ajaxCall?
(JsCmds.SetHtml(...) JsCmds.SetElemById(...) JE.JsRaw(alert('1')) JE.JsRaw(alert('2'); alert('3'))).cmd Br's, Marius On Feb 10, 10:22 am, wm min...@gmail.com wrote: Hi, I have the following code: def jsF(x: String): JsCmd = { /* JsCmds.SetHtml(...) JsCmds.SetElemById(...) */ JE.JsRaw(alert('1')).cmd JE.JsRaw(alert('2'); alert('3')).cmd // last cmd } button onclick={SHtml.ajaxCall(Str(x), jsF _)._2} /button when I tried, only the last cmd got executed, I know this is because it's the return value for the whole function jsF(). I'm wondering is it possible to make it execute a sequence of JsCmd? e.g. as the code that have been commented out? how this can be done in Lift (instead of writing raw JsRaw)? Thanks! -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Mixing up 2.7 and 2.8 codes inline (was Re: [Lift] Why not SHtml?)
Hey Naftoli, Man, it would be great *not to* mix up 2.7 and 2.8 codes inline. Keeping it in sync with master would get very confusing and error prone (personally I don't find that aesthetically pleasing either). In fact, with some adjustment, it's possible to have parts of code friendly with both 2.7 and 2.8. That way, we'll have smaller delta to manage between the branches. If necessary, feel free to reopen #313 and backport as much as possible. Cheers, Indrajit On 10/02/10 9:59 AM, Naftoli Gugenheim wrote: Never mind, apparently I wasn't up to date. On Tue, Feb 9, 2010 at 11:20 PM, Naftoli Gugenheim naftoli...@gmail.com mailto:naftoli...@gmail.com wrote: I got OneToMany to compile (not in a way that would work on 2.7 though). Then I tried to push it: naft...@naftoli-pc /c/dev/gitrepo/liftweb (280_port_refresh) $ git rebase origin/280_port_refresh Current branch 280_port_refresh is up to date. naft...@naftoli-pc /c/dev/gitrepo/liftweb (280_port_refresh) $ git push origin 280_port_refresh To g...@github.com:dpp/liftweb.git ! [rejected]280_port_refresh - 280_port_refresh (non-fast forward) error: failed to push some refs to 'g...@github.com:dpp/liftweb.git' naft...@naftoli-pc /c/dev/gitrepo/liftweb (280_port_refresh) $ Actually I only did the rebase to be sure, after I had already gotten the 'non-fast forward' error. What am I doing wrong? As far as ManyToMany, I can't work on it because the compiler seems to just freeze (using up CPU though). I assume that means there's a compiler bug involved. Thanks. On Tue, Feb 9, 2010 at 5:46 PM, David Pollak feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com wrote: On Tue, Feb 9, 2010 at 2:28 PM, Naftoli Gugenheim naftoli...@gmail.com mailto:naftoli...@gmail.com wrote: Could you give me exact instructions what to do to test my code on 2.8? git checkout -b 280_port_refresh origin/280_port_refresh cd framework/lift-persistence/lift-mapper emacs $(grep -l FIXME: 280 $(find . -name *.scala)) remove the comments around your code. Make it compile and pass the existing tests. Thanks. 2010/2/7 David Pollak feeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com On Sun, Feb 7, 2010 at 1:01 PM, Naftoli Gugenheim naftoli...@gmail.com mailto:naftoli...@gmail.com wrote: So if I get around to it would it indeed be preferable to point it to SHtml? Changing the code is one of the lowest priorities I could imagine. I would say that closing the stuff you've had on review board for 1 months would be much higher priority. Adding copyright notices and other headers to the code you've written in Lift is a higher priority. Helping to port your code to 2.8 would be a higher priority. - David Pollakfeeder.of.the.be...@gmail.com mailto:feeder.of.the.be...@gmail.com wrote: On Sun, Feb 7, 2010 at 12:47 PM, Naftoli Gugenheim naftoli...@gmail.com mailto:naftoli...@gmail.comwrote: Hello. Why do Mapper's toForm implementations use S.fmapFunc directly rather than using SHtml? Is it not duplicate code? Because the Mapper code was the earliest Lift code... written long before SHtml. 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 mailto:liftweb@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com mailto:liftweb%2bunsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com mailto:liftweb%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp
Re: [Lift] Features in Lift 2.0
Hi Murtaza, Everything since Lift 1.0 is new on Lift 2.0 [1]. There is a good chance that you'll find most as part of the changelog that we maintain. See the static version in project docs [2] or milestone-wise details in Assembla [3] (we have them since 1.1-M6 here). Cheers, Indrajit [1] Lift 1.1 has been renamed Lift 2.0, there are same stuff [2] http://scala-tools.org/mvnsites-snapshots/liftweb/changes-report.html [3] https://liftweb.assembla.com/spaces/milestones/completed/liftweb?milestone_sort_id=ASC On 10/02/10 6:27 PM, Murtaza Rampurawala wrote: Hi, I have been exploring lift and was interested in what new features are in/planned for lift 2.0. I havent been able to find any documentation regarding it. Can anyone guide me to it. Also what is the planned release for 2.0? Also appreciate for maintaining such a responsive mailing list. Thanks, Murtaza -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] **IMPORTANT** **BREAKING CHANGES** lift-core is deprecated
Folks, If your project has dependency on lift-core, this is important for you! lift-core stands deprecated and Lift 2.0-M2 would be the penultimate milestone with support for lift-core. Subsequently (after the milestone 2.0-M3) it would be unsupported. lift-core is a 'meta' module that can be added as a dependency to a Lift based application to pull in all the Lift modules. The initial purpose of having single dependency on this 'meta' module in the application was to conveniently serve as a singular configuration point in a Lift based application. However, this comes for a cost. Since lift-core downloads and enforces bundling all the Lift modules (irrespective of whether the project needs it), adding this as the dependency slows down things for a standard Lift application that doesn't need all the additional modules. Further, this makes the generated application war much larger than necessary. Going forward, just discontinue using lift-core in your project and for alternative(s), follow these general guidelines: 1. If you are using any of the persistence modules (lift-mapper, lift-jpa, lift-record), just have the respective persistence module as dependency. You *do not* need to add any of the other base modules (lift-common, lift-actor, lift-json, lift-util, lift-webkit) as dependency. 2. If you are not using the persistence module (possibly because your app doesn't need such support), just including lift-webkit should suffice. 3. Additionally, if you are using any of the special purpose modules (from lift-modules), add that to the list of dependencies in addition to the ones added in #1 or #2 above. In all the above cases, the additional dependencies necessary (and just the necessary ones) for the respective modules would be pulled transitively in your project automatically. This would make your application lighter by having more precise dependency map. And that's a good thing! Cheers, Indrajit -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Comet shutdown?
Hello, Yes, in fact there is a timespan method in CometActor. You should be using Lift 2.0-M1 or 2.0-SNAPSHOT. I'm using 2.0-SNAPSHOT: class Test extends CometActor { def render = NodeSeq.Empty override def timespan = 0 } error: method timespan overrides nothing override def timespan = 0 ^ one error found same for timeSpan. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Comet shutdown?
On 10/02/10 9:49 PM, David Pollak wrote: On Wed, Feb 10, 2010 at 8:13 AM, Adam Warski a...@warski.org mailto:a...@warski.org wrote: Hello, Yes, in fact there is a timespan method in CometActor. You should be using Lift 2.0-M1 or 2.0-SNAPSHOT. I'm using 2.0-SNAPSHOT: class Test extends CometActor { def render = NodeSeq.Empty override def timespan = 0 } error: method timespan overrides nothing override def timespan = 0 ^ one error found same for timeSpan. Yep, override def timespan: Int does if fact override nothing... please look at my mail. The method to override is def timespan: Box[Helpers.TimeSpan] You probably mean def lifespan: Box[TimeSpan] -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com mailto:liftweb@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com mailto:liftweb%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Support for page and snippet level localization
Interesting. What would an example where two pages in the same locale should have different values for the same key used by the same snippet? - Hugo Palmahugo.m.pa...@gmail.com wrote: I think a simple inheritance concept would work just fine. We could have: application resource bundle (what Lift has now) - page resource bundle - snippet resource bundle This would mean that every snippet would inherit the the resource bundle of the page where it's being rendered. So yes, the same snippet could translate the same key to a different value depending on the page where it's rendered. Does that make sense to you ? In the past i've found such an approach very natural and really useful. On Wed, Feb 10, 2010 at 06:38, Naftoli Gugenheim naftoli...@gmail.comwrote: If the same snippet is used by two pages you would want two separate resource bundles to be used for the same snippet? - Hugo Palmahugo.m.pa...@gmail.com wrote: So what you're saying is that a page can include a bunch of snippets and that's why it doesn't be an advantage to have page resource bundles ? I'm sorry but i don't see why. I'm not sure how people are using resource bundles with Lift now but the way i would do it would be to create a resource bundle for each page that would have the properties that are specific to that page and then i would have one or more bundles with properties that would be used in several pages across the application. I think this makes sense in large applications because it's just a natural way of organizing your translated text. I realize this is possible with Lift now, but it has the following problems: - Even if you separate in bundles the properties are globally available. There's no bundle namespace concept. For example, i might want to have the property page-name with the current page name. And if i'm on the home page i want it to translate to Home and if i'm on the search page i want it to translate to Search. This could be possible with this. - I have to register every single resource bundle in LiftRules.resourceNames. Although not critical this could easily be replace with automatic bindle discovery like i suggested. On Tue, Feb 9, 2010 at 17:38, Timothy Perrett timo...@getintheloop.eu wrote: The analogy would be MVC controllers... the index method has an index page and an index resource bundle. Within Lift, we dont use controllers, so there is nothing stopping you calling a whole bunch of snippets on a single page - thus, there would be no single page resource bundle (that is, it wouldn't buy you anything IMHO) as different snippets might share localised text or whatever. I guess im just trying to say things are not silo'ed in Lift. Does that add some more clarity to my statement? Cheers, Tim On Feb 9, 2:47 pm, Hugo Palma hugo.m.pa...@gmail.com wrote: Sorry Tim but i don't quite understand what you mean by page is scoped to a single snippet and that invalidates that you have a resource bundle per page. Sorry is this is clear to everyone else but i'm new with Lift so i'm still grasping basic concepts. On Feb 8, 10:49 pm, Timothy Perrett timo...@getintheloop.eu wrote: That wouldn't work for Lift as it assumes a page is scoped to a single snippet. It works with Tapestry because its an MVC framework. Lift is *not* MVC. Have you seen LiftRules.resourceBundleFactories ? Cheers, Tim On 8 Feb 2010, at 22:11, Hugo Palma wrote: Lift only support global resource bundles, i think it would be very useful if page and snipped level resource bundles were supported. For example, if i have a page index it would automatically have access to the indexlocale.properties_ bundle. Obviously this bundle would not be accessible from any other page. I come from an Apache Tapestry background that has page and component level localization and it proved very useful. What do you guys think about this ? -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group at
[Lift] Binding to a Map
I have a Lift app that's managing its own domain objects in a MongoDB. At one point I had an object with a list of embedded objects and all worked well. My users had many accounts, and I did something like: private def bindAccountFields(in:NodeSeq, a:Account, isNewAccount:Boolean):NodeSeq = {...} Then, from my Manage.render snippet: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap(bindAccountFields(in, _, false)) } I recently wanted to change User.accounts to a Map[String, Account], since accounts are named and should have unique names. So I did that, and changed the above to: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap((v:Tuple2[String, Account]) = bindAccountFields(in, v._2, false)) } Except, try though I might, I can't seem to eliminate this error: [error] /home/nolan/Projects/Utterance2/src/main/scala/info/thewordnerd/utterance/snippet/Manage.scala:67: type mismatch; [error] found : Iterable[scala.xml.Node] [error] required: scala.xml.NodeSeq [error] case false = user.accounts.flatMap((v:Tuple2[String, Account]) = bindAccountFields(in, v._2, false)) [error] ^ [error] one error found bindAccountFields hasn't changed at all. I'm just changing the collection I iterate over to call it, and the parameter it was passed. Am I missing something obvious? The whole binding snippets to a collection thing seems like magic to me. The getting started guide shows it done, but unless I read carelessly, it really doesn't explain how binding works in that situation. Are prefixes bound in order such that each time I call, say, account.name/ in a form I get the next value bound there? Does that hold true such that I can have an Account.edit and Account.render snippet, both of which bind to account:name/, only the edit snippet binds a text field while the render snippet just displays text? So I'd then have to call the snippets in the order I've bound them? Obviously that wouldn't be advisable if my assumption is true, I'm just trying to understand how this particular bit of magic works. :) Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] serializing and deserializing a json object through Lift-JSON
Dear All, I am wondering would you please tell me how can I use lift-json (2.0 snapshots) to serialize and deserialize the following scala case classes. case class Plan( plan:Option[Action] ) case class Game( game:Map[String,Plan]) case class Action(id:Int, subAction : Option[Action]) val game = new Game(Map(a-new Plan(new Some(new Action(1,None) implicit val formats = net.liftweb.json.DefaultFormats game must beEqualTo( Serialization.read[Game] (Serialization.write(game))) Test fails. Cheers, -A -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Make MenuBuilder generate link for current page
Unless someone objects, this works for me. On Tue, Feb 9, 2010 at 10:29 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: linkToSelf=true? (Without getting involved in the different conventions for multiple-word attributes :) ) - David Pollakfeeder.of.the.be...@gmail.com wrote: On Mon, Feb 8, 2010 at 6:53 AM, Hugo Palma hugo.m.pa...@gmail.com wrote: By default the menubuilder snippet doesn't generate a link for the current page. Can this behavior be changed ? There's currently no option to override this behavior. What attribute do folks think should be added to change this behavior? Thanks -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Deploying Lift app
Hello everyone I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I would be very grateful for a bullet-point explanation of the process - I understand you can create a .war file and deploy that but I can't seem to figure out how - maybe it's because I'm a bit slow today :) Thanks, Mads Hartmann Jensen -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Snippet with no reflection an no massive case statement
All i would like is some clarification if this statement is in fact true, if not i will go on with my project happily using reflection snippets. If it is true i then would be looking for a better alternative. It is much better practice in my opinion to use an explicit dispatch. But you do whatever you want. If it becomes a performance problem for you and you're on a production site, then we'll look at it. More broadly, we like to help newbies and folks with live production sites. But, we also expect that newbies will bring us real issues that they themselves are facing, not premature optimizations. We have limited time to help people and wasting (and this thread has crossed seriously into time-wasting land) time with stuff that doesn't really impact you means that (1) you will get a lot less attention in the future (think the boy who cried wolf) and (2) it lowers the quality of discussion for the rest of the folks on the list. I really don't get your response, as Hugo just asked about a statement on the wikipage, which very clearly says that using reflection snippets brings a performance hit and is discouraged to be used in production. Now, it may very well be that this statement shouldn't be there as it's not true - which is your opinion I think. Maybe it would be better to write something like: If you are experiencing performance problems because of too many reflection calls, the cause may be using reflection snippets. Consider using dispatch snippets. But why do you say to new users who just ask about statements from the wiki that their posts are time-wasting and that they can get less attention in the future I really don't understand. Peace :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Deploying Lift app
I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I think it should be enough to run mvn jetty:run in the background. My start-server.sh script: #!/bin/bash mvn jetty:run log.out 21 (puts all logs in log.out for further inspection) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Snippet with no reflection an no massive case statement
On Wed, Feb 10, 2010 at 8:57 AM, Adam Warski a...@warski.org wrote: All i would like is some clarification if this statement is in fact true, if not i will go on with my project happily using reflection snippets. If it is true i then would be looking for a better alternative. It is much better practice in my opinion to use an explicit dispatch. But you do whatever you want. If it becomes a performance problem for you and you're on a production site, then we'll look at it. More broadly, we like to help newbies and folks with live production sites. But, we also expect that newbies will bring us real issues that they themselves are facing, not premature optimizations. We have limited time to help people and wasting (and this thread has crossed seriously into time-wasting land) time with stuff that doesn't really impact you means that (1) you will get a lot less attention in the future (think the boy who cried wolf) and (2) it lowers the quality of discussion for the rest of the folks on the list. I really don't get your response, as Hugo just asked about a statement on the wikipage, which very clearly says that using reflection snippets brings a performance hit and is discouraged to be used in production. Now, it may very well be that this statement shouldn't be there as it's not true - which is your opinion I think. My opinion is that using dispatch snippets is the best practice because it's clearer to other team members what's going on. Maybe it would be better to write something like: If you are experiencing performance problems because of too many reflection calls, the cause may be using reflection snippets. Consider using dispatch snippets. I did not write the wiki entry. I rarely post to the wiki. You can write whatever you want. But why do you say to new users who just ask about statements from the wiki that their posts are time-wasting and that they can get less attention in the future I really don't understand. Please read the entire thread and the other threads that Hugo has started. Hugo is pushing on this issue (without any real basis, measurement, problems, statistics) and not letting it go. I've answered his question a number of times (using dispatch snippets is best practices [more from a code readability standpoint, but also there is a minor performance penalty]) and he keeps harping on the issue. If you repeat the same question over and over *after Tim and I have answered it* it is a waste of time. David Peace :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Binding to a Map
If adding .toSeq or a : NodeSeq type annotation don't trigger the implicit, wrap it with NodeSeq.fromSeq(...). Also, you can do ...flatMap{case (_, account) = bindAccountFields(in, account, false)} - Nolan Darilekno...@thewordnerd.info wrote: I have a Lift app that's managing its own domain objects in a MongoDB. At one point I had an object with a list of embedded objects and all worked well. My users had many accounts, and I did something like: private def bindAccountFields(in:NodeSeq, a:Account, isNewAccount:Boolean):NodeSeq = {...} Then, from my Manage.render snippet: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap(bindAccountFields(in, _, false)) } I recently wanted to change User.accounts to a Map[String, Account], since accounts are named and should have unique names. So I did that, and changed the above to: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap((v:Tuple2[String, Account]) = bindAccountFields(in, v._2, false)) } Except, try though I might, I can't seem to eliminate this error: [error] /home/nolan/Projects/Utterance2/src/main/scala/info/thewordnerd/utterance/snippet/Manage.scala:67: type mismatch; [error] found : Iterable[scala.xml.Node] [error] required: scala.xml.NodeSeq [error] case false = user.accounts.flatMap((v:Tuple2[String, Account]) = bindAccountFields(in, v._2, false)) [error] ^ [error] one error found bindAccountFields hasn't changed at all. I'm just changing the collection I iterate over to call it, and the parameter it was passed. Am I missing something obvious? The whole binding snippets to a collection thing seems like magic to me. The getting started guide shows it done, but unless I read carelessly, it really doesn't explain how binding works in that situation. Are prefixes bound in order such that each time I call, say, account.name/ in a form I get the next value bound there? Does that hold true such that I can have an Account.edit and Account.render snippet, both of which bind to account:name/, only the edit snippet binds a text field while the render snippet just displays text? So I'd then have to call the snippets in the order I've bound them? Obviously that wouldn't be advisable if my assumption is true, I'm just trying to understand how this particular bit of magic works. :) Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Snippet with no reflection an no massive case statement
Please read the entire thread and the other threads that Hugo has started. Hugo is pushing on this issue (without any real basis, measurement, problems, statistics) and not letting it go. I've answered his question a number of times (using dispatch snippets is best practices [more from a code readability standpoint, but also there is a minor performance penalty]) and he keeps harping on the issue. I think that the statement on the wiki may sound too authoritative and that may be the source of misunderstanding - I'll edit the wiki to clear this up. I remember I've also wondered about this sentence when I was starting to get to know lift. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Support for page and snippet level localization
I think this idea is weak. Lift supports localized pages (e.g., index_en_US.html, index_it.html, etc.) Any page-level localization can be accomplished by writing a localized page. Any snippet-level localization can be achieved by passing localized XHTML as parameters to the snippet. Further, as Tim pointed out, there are ways to customize localization based on current state (which includes the current Req(uest)). I'd suggest using Lift and using the existing facilities for localization. If they are lacking *after you use them* and you find that you are writing additional helpers, then we can see how your helpers integrate into Lift. On Wed, Feb 10, 2010 at 2:48 AM, Hugo Palma hugo.m.pa...@gmail.com wrote: I think a simple inheritance concept would work just fine. We could have: application resource bundle (what Lift has now) - page resource bundle - snippet resource bundle This would mean that every snippet would inherit the the resource bundle of the page where it's being rendered. So yes, the same snippet could translate the same key to a different value depending on the page where it's rendered. Does that make sense to you ? In the past i've found such an approach very natural and really useful. On Wed, Feb 10, 2010 at 06:38, Naftoli Gugenheim naftoli...@gmail.comwrote: If the same snippet is used by two pages you would want two separate resource bundles to be used for the same snippet? - Hugo Palmahugo.m.pa...@gmail.com wrote: So what you're saying is that a page can include a bunch of snippets and that's why it doesn't be an advantage to have page resource bundles ? I'm sorry but i don't see why. I'm not sure how people are using resource bundles with Lift now but the way i would do it would be to create a resource bundle for each page that would have the properties that are specific to that page and then i would have one or more bundles with properties that would be used in several pages across the application. I think this makes sense in large applications because it's just a natural way of organizing your translated text. I realize this is possible with Lift now, but it has the following problems: - Even if you separate in bundles the properties are globally available. There's no bundle namespace concept. For example, i might want to have the property page-name with the current page name. And if i'm on the home page i want it to translate to Home and if i'm on the search page i want it to translate to Search. This could be possible with this. - I have to register every single resource bundle in LiftRules.resourceNames. Although not critical this could easily be replace with automatic bindle discovery like i suggested. On Tue, Feb 9, 2010 at 17:38, Timothy Perrett timo...@getintheloop.eu wrote: The analogy would be MVC controllers... the index method has an index page and an index resource bundle. Within Lift, we dont use controllers, so there is nothing stopping you calling a whole bunch of snippets on a single page - thus, there would be no single page resource bundle (that is, it wouldn't buy you anything IMHO) as different snippets might share localised text or whatever. I guess im just trying to say things are not silo'ed in Lift. Does that add some more clarity to my statement? Cheers, Tim On Feb 9, 2:47 pm, Hugo Palma hugo.m.pa...@gmail.com wrote: Sorry Tim but i don't quite understand what you mean by page is scoped to a single snippet and that invalidates that you have a resource bundle per page. Sorry is this is clear to everyone else but i'm new with Lift so i'm still grasping basic concepts. On Feb 8, 10:49 pm, Timothy Perrett timo...@getintheloop.eu wrote: That wouldn't work for Lift as it assumes a page is scoped to a single snippet. It works with Tapestry because its an MVC framework. Lift is *not* MVC. Have you seen LiftRules.resourceBundleFactories ? Cheers, Tim On 8 Feb 2010, at 22:11, Hugo Palma wrote: Lift only support global resource bundles, i think it would be very useful if page and snipped level resource bundles were supported. For example, if i have a page index it would automatically have access to the indexlocale.properties_ bundle. Obviously this bundle would not be accessible from any other page. I come from an Apache Tapestry background that has page and component level localization and it proved very useful. What do you guys think about this ? -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com . For
Re: [Lift] Deploying Lift app
That was refreshingly easy :) Thanks a lot Mads Hartmann On 10/02/2010, at 18.00, Adam Warski wrote: I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I think it should be enough to run mvn jetty:run in the background. My start-server.sh script: #!/bin/bash mvn jetty:run log.out 21 (puts all logs in log.out for further inspection) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Binding to a Map
On 02/10/2010 11:18 AM, Naftoli Gugenheim wrote: If adding .toSeq or a : NodeSeq type annotation don't trigger the implicit, wrap it with NodeSeq.fromSeq(...). Also, you can do ...flatMap{case (_, account) = bindAccountFields(in, account, false)} Cool. I made the following changes, but still get the same error: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap({ case (_, account) = NodeSeq.fromSeq( bindAccountFields(in, account, false) ) }) } [error] /home/nolan/Projects/Utterance2/src/main/scala/info/thewordnerd/utterance/snippet/Manage.scala:67: type mismatch; [error] found : Iterable[scala.xml.Node] [error] required: scala.xml.NodeSeq [error] case false = user.accounts.flatMap({ [error] ^ [error] one error found Thanks for the partial function tip. I'm starting to learn some of Scala's more functional corners and recently read up on those, but didn't think to use them there. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Comet shutdown?
Adam, As mentioned earlier, please try *lifespan* instead. def lifespan: Box[TimeSpan] is what you probably want. - Indrajit On 10/02/10 10:58 PM, Adam Warski wrote: Hello, to be extra sure I pulled the latest sources from git and recompiled. And I still get an error: error: method timespan overrides nothing override def timespan: Box[TimeSpan] = Full(0 seconds) Yep, override def timespan: Int does if fact override nothing... please look at my mail. The method to override is def timespan: Box[Helpers.TimeSpan] if I was trying to override a method with another method with an incompatible return type, I would get another error (like error overriding method x in class A of type = Int; method x has incompatible type = String) Searching for timespan method in the current source: http://github.com/dpp/liftweb/blob/master/framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/CometActor.scala also doesn't return anything. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Deploying Lift app
Download: http://github.com/dpp/lift-samples/blob/master/jetty_instance.tgz tar -xzvf jetty_instance.tgz Put your WAR file in jetty_instance/webapps/root.war run start_prod.sh to start-up in production mode. Change base_port to specify the port your app will run on. Change ram_size to specify the maximum heap size. On Wed, Feb 10, 2010 at 8:56 AM, Mads Hartmann mads...@gmail.com wrote: Hello everyone I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I would be very grateful for a bullet-point explanation of the process - I understand you can create a .war file and deploy that but I can't seem to figure out how - maybe it's because I'm a bit slow today :) Thanks, Mads Hartmann Jensen -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Comet shutdown?
As mentioned earlier, please try *lifespan* instead. def lifespan: Box[TimeSpan] is what you probably want. Ah :D I thought you were correcting the type parameter in David's email, didn't notice the function name. Thanks a lot! :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Support for page and snippet level localization
On Feb 8, 5:07 pm, Timothy Perrett timo...@getintheloop.eu wrote: Generally I find that to be only of use when needed specific adjustments to templates. For instance, english vs german... the german language is significantly more verbose so requires different div heights etc sometimes. Its not generally a strategy one adopts for their entire localisation scheme. We're using the built-in localized template lookup (index_fr.html) in production, and I find it to be better than any alternative I've seen across any web framework. As you noted, most pages aren't actually different, so our build process is scripted to translate index.html to index_fr.html in the target directory. Our source tree isn't cluttered with _fr versions of everything, our templates aren't filled with loc or |/l tags everywhere . . . so far it seems like a win-win to me. Only minor snag we've run into with lift localization was that S.? isn't really parseable by xgettext, so we just used a wrapper function with a different character. To the OP, like David said, try what's there first, chances are it will meet your needs. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Binding to a Map
On Wed, Feb 10, 2010 at 9:29 AM, Nolan Darilek no...@thewordnerd.infowrote: On 02/10/2010 11:18 AM, Naftoli Gugenheim wrote: If adding .toSeq or a : NodeSeq type annotation don't trigger the implicit, wrap it with NodeSeq.fromSeq(...). Also, you can do ...flatMap{case (_, account) = bindAccountFields(in, account, false)} Cool. I made the following changes, but still get the same error: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap({ case (_, account) = NodeSeq.fromSeq( bindAccountFields(in, account, false) ) try: user.accounts.flatMap({ case (_, account) = NodeSeq.fromSeq( bindAccountFields(in, account, false) ) : NodeSeq }) } [error] /home/nolan/Projects/Utterance2/src/main/scala/info/thewordnerd/utterance/snippet/Manage.scala:67: type mismatch; [error] found : Iterable[scala.xml.Node] [error] required: scala.xml.NodeSeq [error] case false = user.accounts.flatMap({ [error] ^ [error] one error found Thanks for the partial function tip. I'm starting to learn some of Scala's more functional corners and recently read up on those, but didn't think to use them there. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] serializing and deserializing a json object through Lift-JSON
Sometimes the serialization code needs a helping hand, using: implicit val format = Serialization.formats(ShortTypeHints(List(classOf[Plan], classOf[Action], classOf[Game]))) instead of the defaults makes it work here. Cheers, Justin Reardon On 2010-02-10, at 11:42 , Ali wrote: Dear All, I am wondering would you please tell me how can I use lift-json (2.0 snapshots) to serialize and deserialize the following scala case classes. case class Plan( plan:Option[Action] ) case class Game( game:Map[String,Plan]) case class Action(id:Int, subAction : Option[Action]) val game = new Game(Map(a-new Plan(new Some(new Action(1,None) implicit val formats = net.liftweb.json.DefaultFormats game must beEqualTo( Serialization.read[Game] (Serialization.write(game))) Test fails. Cheers, -A -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Welcome javier Goday to the Lift committers
Hi, thanks all, i was reading http://wiki.github.com/dpp/liftweb/committer-process-tips-and-tricks and made a patch for the lift-ldap module to include in http://reviewboard.liftweb.net/ . Just a silly question, How can i get an username for reviewboard ? Thanks ! -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Binding to a Map
I mean to wrap the whole flatMap: case false = NodeSeq.fromSeq(user.accounts.flatMap... - Nolan Darilekno...@thewordnerd.info wrote: On 02/10/2010 11:18 AM, Naftoli Gugenheim wrote: If adding .toSeq or a : NodeSeq type annotation don't trigger the implicit, wrap it with NodeSeq.fromSeq(...). Also, you can do ...flatMap{case (_, account) = bindAccountFields(in, account, false)} Cool. I made the following changes, but still get the same error: user.accounts.isEmpty match { case true = pYou have no accounts configured./p case false = user.accounts.flatMap({ case (_, account) = NodeSeq.fromSeq( bindAccountFields(in, account, false) ) }) } [error] /home/nolan/Projects/Utterance2/src/main/scala/info/thewordnerd/utterance/snippet/Manage.scala:67: type mismatch; [error] found : Iterable[scala.xml.Node] [error] required: scala.xml.NodeSeq [error] case false = user.accounts.flatMap({ [error] ^ [error] one error found Thanks for the partial function tip. I'm starting to learn some of Scala's more functional corners and recently read up on those, but didn't think to use them there. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Snippet with no reflection an no massive case statement
I don't understand why people are being so aggressive on this list, i'm just looking to understand how Lift works and i think it's normal to have questions that many people here maybe will find that don't really make sense. Still, i think i've been able to structure my questions fairly well and i've been getting a really nor friendly replies. Yes i've insisted on the questions more than once, but that's because i found that none of the answers were explanatory. IMHO you guys should really appreciate more the questions and opinions from newcomers because sometimes they can provide a fresh look on things, even thought sometimes them may seem stupid. Anyway, i'll drop this subject and i'm sorry if i was too pushy on this thread. My intentions were the best. Thanks. On Wed, Feb 10, 2010 at 17:08, David Pollak feeder.of.the.be...@gmail.comwrote: On Wed, Feb 10, 2010 at 8:57 AM, Adam Warski a...@warski.org wrote: All i would like is some clarification if this statement is in fact true, if not i will go on with my project happily using reflection snippets. If it is true i then would be looking for a better alternative. It is much better practice in my opinion to use an explicit dispatch. But you do whatever you want. If it becomes a performance problem for you and you're on a production site, then we'll look at it. More broadly, we like to help newbies and folks with live production sites. But, we also expect that newbies will bring us real issues that they themselves are facing, not premature optimizations. We have limited time to help people and wasting (and this thread has crossed seriously into time-wasting land) time with stuff that doesn't really impact you means that (1) you will get a lot less attention in the future (think the boy who cried wolf) and (2) it lowers the quality of discussion for the rest of the folks on the list. I really don't get your response, as Hugo just asked about a statement on the wikipage, which very clearly says that using reflection snippets brings a performance hit and is discouraged to be used in production. Now, it may very well be that this statement shouldn't be there as it's not true - which is your opinion I think. My opinion is that using dispatch snippets is the best practice because it's clearer to other team members what's going on. Maybe it would be better to write something like: If you are experiencing performance problems because of too many reflection calls, the cause may be using reflection snippets. Consider using dispatch snippets. I did not write the wiki entry. I rarely post to the wiki. You can write whatever you want. But why do you say to new users who just ask about statements from the wiki that their posts are time-wasting and that they can get less attention in the future I really don't understand. Please read the entire thread and the other threads that Hugo has started. Hugo is pushing on this issue (without any real basis, measurement, problems, statistics) and not letting it go. I've answered his question a number of times (using dispatch snippets is best practices [more from a code readability standpoint, but also there is a minor performance penalty]) and he keeps harping on the issue. If you repeat the same question over and over *after Tim and I have answered it* it is a waste of time. David Peace :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Binding to a Map
On 02/10/2010 12:00 PM, Naftoli Gugenheim wrote: I mean to wrap the whole flatMap: case false = NodeSeq.fromSeq(user.accounts.flatMap... Gotcha. I now have: case false = NodeSeq.fromSeq( user.accounts.flatMap({ case (_, account) = bindAccountFields(in, account, false) }).toSeq ) } and that seems to have done it. I like type safety, but sometimes it's a PITA. :) Thanks for the help. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Support for page and snippet level localization
I'm not sure i understand your solution, so your build process find an index.html and replaces all the text there to all the languages and creates the appropriate index_lang.html file ? If so, where do you keep the translated text at dev time ? Is it still on resource bundles ? On Wed, Feb 10, 2010 at 17:46, cody koeninger c...@koeninger.org wrote: On Feb 8, 5:07 pm, Timothy Perrett timo...@getintheloop.eu wrote: Generally I find that to be only of use when needed specific adjustments to templates. For instance, english vs german... the german language is significantly more verbose so requires different div heights etc sometimes. Its not generally a strategy one adopts for their entire localisation scheme. We're using the built-in localized template lookup (index_fr.html) in production, and I find it to be better than any alternative I've seen across any web framework. As you noted, most pages aren't actually different, so our build process is scripted to translate index.html to index_fr.html in the target directory. Our source tree isn't cluttered with _fr versions of everything, our templates aren't filled with loc or |/l tags everywhere . . . so far it seems like a win-win to me. Only minor snag we've run into with lift localization was that S.? isn't really parseable by xgettext, so we just used a wrapper function with a different character. To the OP, like David said, try what's there first, chances are it will meet your needs. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Support for page and snippet level localization
On Wed, Feb 10, 2010 at 17:28, David Pollak feeder.of.the.be...@gmail.comwrote: I think this idea is weak. Lift supports localized pages (e.g., index_en_US.html, index_it.html, etc.) Any page-level localization can be accomplished by writing a localized page. Any snippet-level localization can be achieved by passing localized XHTML as parameters to the snippet. Further, as Tim pointed out, there are ways to customize localization based on current state (which includes the current Req(uest)). But this way you would be moving the translated text from the resource bundle into the html right ? I guess it's a design choice but i prefer to keep my html free of localized text and keep all that in resource bundles. I'd suggest using Lift and using the existing facilities for localization. If they are lacking *after you use them* and you find that you are writing additional helpers, then we can see how your helpers integrate into Lift. I am using the existing facilities, that's why i started this thread. I wanted to make sure that i wasn't missing anything or taking the wrong approach before trying to implement such a solution into Lift. On Wed, Feb 10, 2010 at 2:48 AM, Hugo Palma hugo.m.pa...@gmail.comwrote: I think a simple inheritance concept would work just fine. We could have: application resource bundle (what Lift has now) - page resource bundle - snippet resource bundle This would mean that every snippet would inherit the the resource bundle of the page where it's being rendered. So yes, the same snippet could translate the same key to a different value depending on the page where it's rendered. Does that make sense to you ? In the past i've found such an approach very natural and really useful. On Wed, Feb 10, 2010 at 06:38, Naftoli Gugenheim naftoli...@gmail.comwrote: If the same snippet is used by two pages you would want two separate resource bundles to be used for the same snippet? - Hugo Palmahugo.m.pa...@gmail.com wrote: So what you're saying is that a page can include a bunch of snippets and that's why it doesn't be an advantage to have page resource bundles ? I'm sorry but i don't see why. I'm not sure how people are using resource bundles with Lift now but the way i would do it would be to create a resource bundle for each page that would have the properties that are specific to that page and then i would have one or more bundles with properties that would be used in several pages across the application. I think this makes sense in large applications because it's just a natural way of organizing your translated text. I realize this is possible with Lift now, but it has the following problems: - Even if you separate in bundles the properties are globally available. There's no bundle namespace concept. For example, i might want to have the property page-name with the current page name. And if i'm on the home page i want it to translate to Home and if i'm on the search page i want it to translate to Search. This could be possible with this. - I have to register every single resource bundle in LiftRules.resourceNames. Although not critical this could easily be replace with automatic bindle discovery like i suggested. On Tue, Feb 9, 2010 at 17:38, Timothy Perrett timo...@getintheloop.eu wrote: The analogy would be MVC controllers... the index method has an index page and an index resource bundle. Within Lift, we dont use controllers, so there is nothing stopping you calling a whole bunch of snippets on a single page - thus, there would be no single page resource bundle (that is, it wouldn't buy you anything IMHO) as different snippets might share localised text or whatever. I guess im just trying to say things are not silo'ed in Lift. Does that add some more clarity to my statement? Cheers, Tim On Feb 9, 2:47 pm, Hugo Palma hugo.m.pa...@gmail.com wrote: Sorry Tim but i don't quite understand what you mean by page is scoped to a single snippet and that invalidates that you have a resource bundle per page. Sorry is this is clear to everyone else but i'm new with Lift so i'm still grasping basic concepts. On Feb 8, 10:49 pm, Timothy Perrett timo...@getintheloop.eu wrote: That wouldn't work for Lift as it assumes a page is scoped to a single snippet. It works with Tapestry because its an MVC framework. Lift is *not* MVC. Have you seen LiftRules.resourceBundleFactories ? Cheers, Tim On 8 Feb 2010, at 22:11, Hugo Palma wrote: Lift only support global resource bundles, i think it would be very useful if page and snipped level resource bundles were supported. For example, if i have a page index it would automatically have access to the indexlocale.properties_ bundle. Obviously this bundle would not be accessible from any other page. I come from an Apache Tapestry
[Lift] Re: Netty integration
Nick did you happen to make some progress on this? Are you still working on it ? Br's, Marius On 27 ian., 14:54, nick n...@glynnreeves.plus.com wrote: I'm just about to try and do aNettyintegration, which I might be able to contribute back. Searching the group I deduce that this is possible but hasn't been done yet. Before I start I thought I'd just post to check that someone else isn't doing this already. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Welcome javier Goday to the Lift committers
WELCOME ! On 9 feb., 18:09, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, Please join me in welcoming Javier Goday to the Lift committers. Javier wrote the Lift LDAP module and now that he's a committer, he can make the LDAP module part of the official Lift distribution (and the crowd goes wild). Welcome Javier!! Thanks, David -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Facebook Application
With connect you can also get a client: for (client - FacebookConnect.client){ client !? ... } On Feb 9, 2010, at 8:56 AM, Leo Lännenmäki wrote: Hi, I'll definitely take a look. But I think FB connect is not applicable for our use.. Here a simple version of the use: - We have a Lift application providing a RESTfull JSON API for our clients. Through that API a client application can share a photo to Facebook - We have a Web client for the API provided by the Lift server looming on a different machine. That client does the FB login in order to get a token for the user. - That token is sent to the Lift server which uses it to create a new client (val client = FacebookClient.fromAuthToken(authToken).get) - When the user shares a photo through our API that fb client is used to upload the photo to Facebook On Feb 9, 6:06 am, Jonathan Hoffman jonhoff...@gmail.com wrote: Hi All, I just created issue #336 to provide a Facebook Connect helper and example application. You can take a look at what I've got here:http://github.com/dpp/liftweb/commit/3b6686201e3b7f22100e52a04734fd4c... Leo, if you're trying to use fb connect, hopefully this will help you out (I would suggest using connect rather than redirecting to FB) Will push out to master pending your comments and RB. - Jon On Feb 5, 2010, at 10:35 AM, Leo Lännenmäki wrote: Hi, I have only tried to do a couple of things with the Facebook module (I'm using 2.0-M1) and I have gotten some of the stuff to actually work :) Photo upload would be something like this: import java.io.File import org.apache.commons.io.FileUtils import net.liftweb.ext_api.facebook._ import scala.xml._ FacebookRestApi.apiKey = your api key FacebookRestApi.secret = secret // Get a user to login to Facebook with a link like http://www.facebook.com/login.php?v=1.0api_key=your api key // If you mess around with the Facebook settings you will get FB to // redirect the user back to your app with a token as a query param val authToken = as described previously val client = FacebookClient.fromAuthToken(authToken).get val photo = new File(...) val bytes = FileUtils.readFileToByteArray(photo) val resp = client !? UploadPhoto(test.jpg, jpg, bytes) val photoUrl = (resp \\ link).text Getting a list of friends: val resp = client !? GetFriends() Some real documentation and examples sure would be nice! Leo On Feb 3, 9:00 am, celestocalculus celestocalcu...@yahoo.co.uk wrote: Hello, I'm an intermediate lift developer. Suddenly, it has become my first choice framework for web applications. I really think it's a nice framework you guys are doing a great job. I'm new on facebook application development and I have been looking at the liftweb facebook API. I really don't know how to put this but I'm just blank, I don't know where to start. I would really appreciate it if I get a step by step explanation. All the book I got on facebook apps are on php and I find it difficult to match the php codes to their corresponding lift counterparts. Please I'll also appreciate sample codes, please let it be step by step and on point. Thanks in advance. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
So are you saying to leave buildSetFromString pointing to Helpers.toDate for the time being? - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Naftoli Gugenheim naftoli...@gmail.com writes: At what would make sense to move around, i.e., what I should to move #257 and #258 forward. Thanks! I think those look good. In the spirit of incremental progress, I think any other changes should be on new tickets. /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Deploying Lift app
Mads Hartmann mads...@gmail.com writes: Hello everyone I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I would be very grateful for a bullet-point explanation of the process - I understand you can create a .war file and deploy that but I can't seem to figure out how - maybe it's because I'm a bit slow today :) Assuming you have full control of your server: The container (Jetty) should be installed on the server and integrated with the server startup/shutdown cycle. Then (locally) mvn package to create the war file. Move the war file to the server's app dir (eg /usr/share/jetty6/webapps) While a bit dated, here's how you can automate all of these steps (including bootstrapping the server :-) http://jeppenejsum.wordpress.com/2009/05/03/ec2-continuous-deployment-hello-world/ /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Deploying Lift app
What OS is on the server? - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Mads Hartmann mads...@gmail.com writes: Hello everyone I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I would be very grateful for a bullet-point explanation of the process - I understand you can create a .war file and deploy that but I can't seem to figure out how - maybe it's because I'm a bit slow today :) Assuming you have full control of your server: The container (Jetty) should be installed on the server and integrated with the server startup/shutdown cycle. Then (locally) mvn package to create the war file. Move the war file to the server's app dir (eg /usr/share/jetty6/webapps) While a bit dated, here's how you can automate all of these steps (including bootstrapping the server :-) http://jeppenejsum.wordpress.com/2009/05/03/ec2-continuous-deployment-hello-world/ /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Testing local archetypes?
Quick question: I'm updating archetypes, how can I test them locally? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Testing local archetypes?
Don't understand the question. mvn test? - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Quick question: I'm updating archetypes, how can I test them locally? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Testing local archetypes?
On Wed, Feb 10, 2010 at 9:21 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Don't understand the question. mvn test? I've modified the archetypes in my local Git repo. How can I create a new project based on the modified archetypes? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Testing local archetypes?
Shouldn't: cd archetypes; mvn clean install mvn archetype:generate -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=2.0-SNAPSHOT work, since clean install will install in your local repo? -Ross On Feb 10, 2010, at 3:22 PM, Jeppe Nejsum Madsen wrote: On Wed, Feb 10, 2010 at 9:21 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Don't understand the question. mvn test? I've modified the archetypes in my local Git repo. How can I create a new project based on the modified archetypes? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Testing local archetypes?
I think just mvn install from its directory (or archetypes directory). - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: On Wed, Feb 10, 2010 at 9:21 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Don't understand the question. mvn test? I've modified the archetypes in my local Git repo. How can I create a new project based on the modified archetypes? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Deploying Lift app
It's Debian, but I think I have enough information to go on now ;) Thanks everyone, Mads Hartmann On Feb 10, 9:16 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: What OS is on the server? - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Mads Hartmann mads...@gmail.com writes: Hello everyone I can't quite figure out how to deploy my lift app and was hoping one of you could point me in the right direction. For fun i uploaded my entire project (uncompiled) to the server and ran mvn jetty:run - this worked fine but as soon as i killed my ssh connection the jetty server stopped. I would be very grateful for a bullet-point explanation of the process - I understand you can create a .war file and deploy that but I can't seem to figure out how - maybe it's because I'm a bit slow today :) Assuming you have full control of your server: The container (Jetty) should be installed on the server and integrated with the server startup/shutdown cycle. Then (locally) mvn package to create the war file. Move the war file to the server's app dir (eg /usr/share/jetty6/webapps) While a bit dated, here's how you can automate all of these steps (including bootstrapping the server :-) http://jeppenejsum.wordpress.com/2009/05/03/ec2-continuous-deployment... /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Testing local archetypes?
On Wed, Feb 10, 2010 at 9:24 PM, Ross Mellgren dri...@gmail.com wrote: Shouldn't: cd archetypes; mvn clean install mvn archetype:generate -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=2.0-SNAPSHOT work, since clean install will install in your local repo? Almost. The magic sauce I had to add: -DarchetypeCatalog=local Thanks, /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Url Rewriting Extractors - Inheritance? Composition?
On Mon, Feb 8, 2010 at 7:13 PM, Alex Black a...@alexblack.ca wrote: Has anyone found a good pattern/method of re-using Url Rewriting extractors? I've got a url like this: /products/manufacturer/productId And an extractor for that, that given a product gives you a URL (apply) and given a ParsePath gives you an Option[Product]. I'd then like to support a sub url like this: /products/manufacturer/productId/view/viewName so I'd like to make a class to handle view and ViewName (or anything else that comes below productId), and re-use the functionality in ProductURL extractor. I can't seem to figure out a way to do it for unapply. thoughts? def unapply(in: List[String]): Option[ProductInfo] = in match { case Product(product) :: Nil = Some(ProductInfo(product)) case Product(product) :: view :: ViewName(viewName) :: Nil = Some(ProductInfo(product, viewName)) case _ = None } - Alex -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
On Wed, Feb 10, 2010 at 9:02 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: So are you saying to leave buildSetFromString pointing to Helpers.toDate for the time being? I'm not sure I follow? I can't find buildSetFromString (in master) anywhere and the setFromAny that covers string seem to call ConversionRules? To summarize: I think all code in MappedDate/Time should go through ConversionRules /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Maven problem in archetypes
(Man, I'm learning more Maven than I ever imagined I could survive :-( I'm trying to update the archetypes for the Slf4j fix. A problem with the JPA ones is that hibernate includes an old version of slf4j-api. So (after variable substitution) I add following to fix to the version we use in lift: dependencyManagement dependencies dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version[1.5.6,)/version /dependency /dependencies /dependencyManagement Except this doesn't change anything. If I modify the version to not be a range: version1.5.10/version it works. What to do? /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Support for page and snippet level localization
On Feb 10, 12:11 pm, Hugo Palma hugo.m.pa...@gmail.com wrote: I'm not sure i understand your solution, so your build process find an index.html and replaces all the text there to all the languages and creates the appropriate index_lang.html file ? Yes May seem like a hack, but on the other hand I honestly don't understand how people deal with mostly textual websites that consist of templates with nothing but e.g. wicket:message key=foo all over the place. Webapps with a limited amount of text, sure, but making up new property keys for every paragraph. . .are you serious? If so, where do you keep the translated text at dev time ? Is it still on resource bundles ? Yes, translated text is in resource bundles, used by the script that does the xml translation (well, we keep a .po version as well as the java properties file, because of existing gettext toolchain, but that's incidental) -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
Sorry, type: I was referring to this: def buildSetActualValue(accessor: Method, v: AnyRef, columnName: String): (T, AnyRef) = Unit = (inst, v) = doField(inst, accessor, {case f: MappedDate[_] = f.st (toDate(v))}) def buildSetLongValue(accessor: Method, columnName: String): (T, Long, Boolean) = Unit = (inst, v, isNull) = doField(inst, accessor, {case f: MappedDate[_] = f.st(if (isNull) Empty else Full(new Date(v)))}) def buildSetStringValue(accessor: Method, columnName: String): (T, String) = Unit = (inst, v) = doField(inst, accessor, {case f: MappedDate[_] = f.st (toDate(v))}) def buildSetDateValue(accessor: Method, columnName: String): (T, Date) = Unit = (inst, v) = doField(inst, accessor, {case f: MappedDate[_] = f.st (Full(v))}) def buildSetBooleanValue(accessor: Method, columnName: String): (T, Boolean, Boolean) = Unit = (inst, v, isNull) = doField(inst, accessor, {case f: MappedDate[_] = f.st(Empty)}) 2010/2/10 Jeppe Nejsum Madsen je...@ingolfs.dk On Wed, Feb 10, 2010 at 9:02 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: So are you saying to leave buildSetFromString pointing to Helpers.toDate for the time being? I'm not sure I follow? I can't find buildSetFromString (in master) anywhere and the setFromAny that covers string seem to call ConversionRules? To summarize: I think all code in MappedDate/Time should go through ConversionRules /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
In Mapped(Date)(Time) And 'type' was also a typo. :) On Wed, Feb 10, 2010 at 5:21 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: Sorry, type: I was referring to this: def buildSetActualValue(accessor: Method, v: AnyRef, columnName: String): (T, AnyRef) = Unit = (inst, v) = doField(inst, accessor, {case f: MappedDate[_] = f.st (toDate(v))}) def buildSetLongValue(accessor: Method, columnName: String): (T, Long, Boolean) = Unit = (inst, v, isNull) = doField(inst, accessor, {case f: MappedDate[_] = f.st(if (isNull) Empty else Full(new Date(v)))}) def buildSetStringValue(accessor: Method, columnName: String): (T, String) = Unit = (inst, v) = doField(inst, accessor, {case f: MappedDate[_] = f.st (toDate(v))}) def buildSetDateValue(accessor: Method, columnName: String): (T, Date) = Unit = (inst, v) = doField(inst, accessor, {case f: MappedDate[_] = f.st (Full(v))}) def buildSetBooleanValue(accessor: Method, columnName: String): (T, Boolean, Boolean) = Unit = (inst, v, isNull) = doField(inst, accessor, {case f: MappedDate[_] = f.st(Empty)}) 2010/2/10 Jeppe Nejsum Madsen je...@ingolfs.dk On Wed, Feb 10, 2010 at 9:02 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: So are you saying to leave buildSetFromString pointing to Helpers.toDate for the time being? I'm not sure I follow? I can't find buildSetFromString (in master) anywhere and the setFromAny that covers string seem to call ConversionRules? To summarize: I think all code in MappedDate/Time should go through ConversionRules /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
Ahh ok. It's getting late and I'm perhaps not thinking straight but I think TimeHelpers.toDate should go through ConversionRules. This may cause circular deps etc. in which case I think buildSetStringValue should go through ConversionRules. I don't know mapper internals good enough to really see through the consequences, but from a user perspective, I think all conversions should (in the end) go through ConversionRules. /Jeppe -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] JsonHandler capturing state from enclosing snippet
Hi everybody, I'm having a JsonHandler object inside a snippet and I want to access some vals from to enclosing snippet. But unfortunately this doesn't work, because it seems that there is just one single instance per session and class name maintained by Lift. Having a fresh handler per snippet would let me easily capture some state from the enclosing snippet instance, but as the same JsonHandler gets reused in setting up the Javascript for callback, this is not working. Is there a way to remove the registered handler from the session? LiftSession.set and unset aren't accessible for the outside world. Or to enforce to have a new handler everytime? I'm using Lift 1.1-M8. Thanks for any ideas, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Mapped(Date)(Time) formatter/parser
- Until now there were two places in Mapped(Date)(Time) where parsing occurred. setFromAny used LiftRules.parseDate, while buildSetStringValue etc. used TimeHelpers.toDate. - Do we need methods like setFromAny and TimeHelpers.toDate, which take an Any and pattern match on several types of inputs? Isn't that very un-typesafe? - Why the inconsistency between setFromAny and buildSetStringValue? Should both use ConversionRules? Should both use toDate which should use ConversionRules? David, it would be great if you could comment on at least these points. Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] JsonHandler capturing state from enclosing snippet
On Wed, Feb 10, 2010 at 2:47 PM, ced docpom...@googlemail.com wrote: Hi everybody, I'm having a JsonHandler object inside a snippet and I want to access some vals from to enclosing snippet. But unfortunately this doesn't work, because it seems that there is just one single instance per session and class name maintained by Lift. Having a fresh handler per snippet would let me easily capture some state from the enclosing snippet instance, but as the same JsonHandler gets reused in setting up the Javascript for callback, this is not working. Is there a way to remove the registered handler from the session? LiftSession.set and unset aren't accessible for the outside world. Or to enforce to have a new handler everytime? I'm using Lift 1.1-M8. If you use this: val (call: JsonCall, jsCmd: JsCmd) = S.buildJsonFunc{ case ... = ... } You'll get a new JSON Handler, closed over the variables in your snippet for each new instance of your snippet. Is that what you're looking for? Thanks for any ideas, Chris -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Enumeration.Value versus Enumeration#Value
What's the difference between Enumeration.Value and Enumeration#Value? I'm getting a type mismatch error: [INFO] found : com.test.States#Value [INFO] required: com.test.States.Value When trying to set the Enumeration via a form. Basically, I have a mapper object, Address, that has a MappedEnum(this, States) where States is my defined enumeration of US states. The form method is: state - SHtml.selectObj[States.Value]( States.elements.toList.map(v = (v,v.toString)), Full(address.state) /*seems to default to first value in enum if unassigned*/, selected = address.state(selected)) Thanks, Strom -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] lifecycle callbacks in record
Can anyone give me an example of how to implement a lifecycle callback in record? I can't, for the life of me, get it to work. Nor does there appear to be any documentation at all :( -harryh -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] how to set boolean (non-string) value in NodeSeq?
def seq(): NodeSeq = { button disabled=true /button } it errors out: error: in XML literal: ' or delimited attribute value or '{' scala- expr '}' expected 0 doesn't work either, only string is accepted. Why is there such a restriction? any workaround? Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Enumeration.Value versus Enumeration#Value
i recomend this papper http://lampwww.epfl.ch/~odersky/papers/ScalableComponent.pdf On Feb 10, 7:32 pm, Strom strommo...@gmail.com wrote: What's the difference between Enumeration.Value and Enumeration#Value? I'm getting a type mismatch error: [INFO] found : com.test.States#Value [INFO] required: com.test.States.Value When trying to set the Enumeration via a form. Basically, I have a mapper object, Address, that has a MappedEnum(this, States) where States is my defined enumeration of US states. The form method is: state - SHtml.selectObj[States.Value]( States.elements.toList.map(v = (v,v.toString)), Full(address.state) /*seems to default to first value in enum if unassigned*/, selected = address.state(selected)) Thanks, Strom -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: how to set boolean (non-string) value in NodeSeq?
Do it XML style: button disabled=disabled /button On Feb 10, 10:56 pm, wm min...@gmail.com wrote: def seq(): NodeSeq = { button disabled=true /button } it errors out: error: in XML literal: ' or delimited attribute value or '{' scala- expr '}' expected 0 doesn't work either, only string is accepted. Why is there such a restriction? any workaround? Thanks. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: how to set boolean (non-string) value in NodeSeq?
Do it XML style: button disabled=disabled /button The problem is even after setting disabled= (empty string), it's still treated as true; I found it behave as expected only when setting it to boolean true/false. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Enumeration.Value versus Enumeration#Value
. means a member of a value. # means a member of a type. On Wed, Feb 10, 2010 at 8:32 PM, Strom strommo...@gmail.com wrote: What's the difference between Enumeration.Value and Enumeration#Value? I'm getting a type mismatch error: [INFO] found : com.test.States#Value [INFO] required: com.test.States.Value When trying to set the Enumeration via a form. Basically, I have a mapper object, Address, that has a MappedEnum(this, States) where States is my defined enumeration of US states. The form method is: state - SHtml.selectObj[States.Value]( States.elements.toList.map(v = (v,v.toString)), Full(address.state) /*seems to default to first value in enum if unassigned*/, selected = address.state(selected)) Thanks, Strom -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Enumeration.Value versus Enumeration#Value
and it seems we are getting the type and not the value try Full(States(address.state.toInt)) On Feb 10, 7:32 pm, Strom strommo...@gmail.com wrote: What's the difference between Enumeration.Value and Enumeration#Value? I'm getting a type mismatch error: [INFO] found : com.test.States#Value [INFO] required: com.test.States.Value When trying to set the Enumeration via a form. Basically, I have a mapper object, Address, that has a MappedEnum(this, States) where States is my defined enumeration of US states. The form method is: state - SHtml.selectObj[States.Value]( States.elements.toList.map(v = (v,v.toString)), Full(address.state) /*seems to default to first value in enum if unassigned*/, selected = address.state(selected)) Thanks, Strom -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Re: [Lift] Re: Enumeration.Value versus Enumeration#Value
Have you tried forcing the type parameters in your MappedEnum declaration ? Like this: object state extends MappedEnum[Address, States.type](this, States) On Thu, Feb 11, 2010 at 6:30 AM, edgarchan edgarchancarri...@gmail.comwrote: and it seems we are getting the type and not the value try Full(States(address.state.toInt)) On Feb 10, 7:32 pm, Strom strommo...@gmail.com wrote: What's the difference between Enumeration.Value and Enumeration#Value? I'm getting a type mismatch error: [INFO] found : com.test.States#Value [INFO] required: com.test.States.Value When trying to set the Enumeration via a form. Basically, I have a mapper object, Address, that has a MappedEnum(this, States) where States is my defined enumeration of US states. The form method is: state - SHtml.selectObj[States.Value]( States.elements.toList.map(v = (v,v.toString)), Full(address.state) /*seems to default to first value in enum if unassigned*/, selected = address.state(selected)) Thanks, Strom -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: serializing and deserializing a json object through Lift-JSON
Hi, Type hints should not be needed in this case since the Map is not used in a polymorphic way. But the work-around Justin showed should work. Actually it seems that it is enough to put type info just to Action to make serialization work: implicit val format = Serialization.formats(ShortTypeHints(List(classOf[Action])) Anyway, I added a ticket for this defect: http://www.assembla.com/spaces/liftweb/tickets/341-Type-hints-are-needed-in-JSON-serializization-for-non-polymorphic-Map- Cheers Joni On Feb 10, 7:49 pm, Justin Reardon justin.rear...@gmail.com wrote: Sometimes the serialization code needs a helping hand, using: implicit val format = Serialization.formats(ShortTypeHints(List(classOf[Plan], classOf[Action], classOf[Game]))) instead of the defaults makes it work here. Cheers, Justin Reardon On 2010-02-10, at 11:42 , Ali wrote: Dear All, I am wondering would you please tell me how can I use lift-json(2.0 snapshots) to serialize and deserialize the following scala case classes. case class Plan( plan:Option[Action] ) case class Game( game:Map[String,Plan]) case class Action(id:Int, subAction : Option[Action]) val game = new Game(Map(a-new Plan(new Some(new Action(1,None) implicit val formats = net.liftweb.json.DefaultFormats game must beEqualTo( Serialization.read[Game] (Serialization.write(game))) Test fails. Cheers, -A -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en. -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.