[Lift] Re: Tic Tac Toe, Lift Style
David, i don't know if this is any help, but here's the git version i'm using. Best wishes, --greg bash-3.2$ which git /opt/local/bin/git bash-3.2$ git -v Unknown option: -v usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS] bash-3.2$ git --version git version 1.6.0.4 bash-3.2$ On Fri, Jan 30, 2009 at 9:13 PM, Meredith Gregory wrote: > David, > > i'm probably just misusing git, but this is what happens for me > > bash-3.2$ git clone > http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac > Initialized empty Git repository in > /Users/lgm/work/src/projex/biosimilarity/tictac/.git/ > fatal: > http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac/info/refsnot > found: did you run git update-server-info on the server? > bash-3.2$ > > Any clues? > > Best wishes, > > --greg > > On Fri, Jan 30, 2009 at 5:18 PM, David Pollak < > feeder.of.the.be...@gmail.com> wrote: > >> Folks, >> >> I've committed up a Tic Tac Toe example: >> >> http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac >> >> It's an example of using the StatefulComet stuff. >> >> Things I like: >> ToeDisplay is very concise >> The example works >> >> Things I don't like: >> Way too much display stuff in ToeBoard >> The whole Lobby logic seems like a hack >> >> Enjoy. >> >> Thanks, >> >> David >> >> -- >> Lift, the simply functional web framework http://liftweb.net >> Beginning Scala http://www.apress.com/book/view/1430219890 >> Follow me: http://twitter.com/dpp >> Git some: http://github.com/dpp >> >> >> >> > > > -- > L.G. Meredith > Managing Partner > Biosimilarity LLC > 806 55th St NE > Seattle, WA 98105 > > +1 206.650.3740 > > http://biosimilarity.blogspot.com > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Tic Tac Toe, Lift Style
David, i'm probably just misusing git, but this is what happens for me bash-3.2$ git clone http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac Initialized empty Git repository in /Users/lgm/work/src/projex/biosimilarity/tictac/.git/ fatal: http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac/info/refsnot found: did you run git update-server-info on the server? bash-3.2$ Any clues? Best wishes, --greg On Fri, Jan 30, 2009 at 5:18 PM, David Pollak wrote: > Folks, > > I've committed up a Tic Tac Toe example: > > http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac > > It's an example of using the StatefulComet stuff. > > Things I like: > ToeDisplay is very concise > The example works > > Things I don't like: > Way too much display stuff in ToeBoard > The whole Lobby logic seems like a hack > > Enjoy. > > Thanks, > > David > > -- > Lift, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Git some: http://github.com/dpp > > > > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [SOLVED] Req lazy val xml not working
David, i figured, but i know some people with really strong opinions about XML. ;-) Best wishes, --greg On Fri, Jan 30, 2009 at 8:04 PM, David Pollak wrote: > > > On Fri, Jan 30, 2009 at 7:02 PM, Meredith Gregory < > lgreg.mered...@gmail.com> wrote: > >> Tim, >> >> In this last email i'm trying to parse this sentence >> >> XML request processing should not work perfectly >>> >> >> Is this >> >>- a philosophical stance >>- a warning, or >>- a typo? >> >> > typo... XML request processing should now work perfectly. > >> >>- >> >> Best wishes, >> >> --greg >> >> On Fri, Jan 30, 2009 at 3:14 PM, Tim Perrett wrote: >> >>> >>> Ok, found the problem. Req.scala needed a patch, which I have applied >>> and committed into master. >>> >>> XML request processing should not work perfectly >>> >>> Cheers, Tim >>> >>> On Jan 30, 10:48 pm, Tim Perrett wrote: >>> > Attached is an example application that shows the problem >>> > >>> > Cheers, Tim >>> > >>> > problem_example.zip >>> > 16KViewDownload >>> >>> >> >> >> -- >> L.G. Meredith >> Managing Partner >> Biosimilarity LLC >> 806 55th St NE >> Seattle, WA 98105 >> >> +1 206.650.3740 >> >> http://biosimilarity.blogspot.com >> >> >> >> > > > -- > Lift, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Git some: http://github.com/dpp > > > > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: building lift from source --- warnings/errors expected?
On Fri, Jan 30, 2009 at 7:36 PM, mighdoll wrote: > > Hey folks, I'm trying to build the lift sources. It mostly works, but > I see more errors and warnings than I expected. I'm wondering if my > configuration is set up correctly. Or do you see errors/warnings > too? Thx. > > mvn jetty:run in liftweb/sites/example seems to work. > > I've tried mvn clean, and deleting my .m2/repository. > > I tried mvn jetty:run in hellodarwin and got: > > ERROR - Failed to Boot > net.liftweb.sitemap.SiteMapException: Location Hello1.1 defined twice > Loc(Hello1.1, , LinkText(), List()) and Loc > (Hello1.1, , LinkText(), List()) >at net.liftweb.sitemap.SiteMap.addLoc(SiteMap.scala:36) > --- > > > Here are a few of the errors/warning when I try mvn install: > > Tests in error: > wiki edit HomePage should not have HomePage content define > wiki edit HomePage should allow edition of HomePage > Tests run: 2, Failures: 0, Errors: 2, Skipped: 0 > -- As of yesterday, there's been a failure on Macs. We can't reproduce it on Windows or Linux. My Mac's in the repair shop. DavidB is a Linux user, so it'll be a few days before we can address this particular problem. :-( > > > [INFO] suggestion: remove the scalaVersion from pom.xml > [ERROR] /home/lee/tools/liftweb/lift-widgets/src/main/scala > -- > > [WARNING] .../target/classes/toserve/tablesorter/ > jquery.tablesorter.js:line -1:column -1:Try to use a single 'var' > statement per scope. > -- > > [WARNING] /home/lee/tools/liftweb/sites/hellolift/src/main/scala/com/ > hellolift/comet/DynamicBlogView.scala:35: warning: match is not > exhaustive! > [WARNING] missing combination Empty > [WARNING] missing combinationFailure > [WARNING] > [WARNING] name match { > [WARNING] ^ > [WARNING] warning: there were unchecked warnings; re-run with - > unchecked for details > [WARNING] two warnings found > -- > > > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: building lift from source --- warnings/errors expected?
Lee, The hellodarwin example has no maintainer. I'll look into the problem can check in some fixed code. I'll also look into some of the warnings. Thanks, David On Fri, Jan 30, 2009 at 7:36 PM, mighdoll wrote: > > Hey folks, I'm trying to build the lift sources. It mostly works, but > I see more errors and warnings than I expected. I'm wondering if my > configuration is set up correctly. Or do you see errors/warnings > too? Thx. > > mvn jetty:run in liftweb/sites/example seems to work. > > I've tried mvn clean, and deleting my .m2/repository. > > I tried mvn jetty:run in hellodarwin and got: > > ERROR - Failed to Boot > net.liftweb.sitemap.SiteMapException: Location Hello1.1 defined twice > Loc(Hello1.1, , LinkText(), List()) and Loc > (Hello1.1, , LinkText(), List()) >at net.liftweb.sitemap.SiteMap.addLoc(SiteMap.scala:36) > --- > > > Here are a few of the errors/warning when I try mvn install: > > Tests in error: > wiki edit HomePage should not have HomePage content define > wiki edit HomePage should allow edition of HomePage > Tests run: 2, Failures: 0, Errors: 2, Skipped: 0 > -- > > [INFO] suggestion: remove the scalaVersion from pom.xml > [ERROR] /home/lee/tools/liftweb/lift-widgets/src/main/scala > -- > > [WARNING] .../target/classes/toserve/tablesorter/ > jquery.tablesorter.js:line -1:column -1:Try to use a single 'var' > statement per scope. > -- > > [WARNING] /home/lee/tools/liftweb/sites/hellolift/src/main/scala/com/ > hellolift/comet/DynamicBlogView.scala:35: warning: match is not > exhaustive! > [WARNING] missing combination Empty > [WARNING] missing combinationFailure > [WARNING] > [WARNING] name match { > [WARNING] ^ > [WARNING] warning: there were unchecked warnings; re-run with - > unchecked for details > [WARNING] two warnings found > -- > > > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [SOLVED] Req lazy val xml not working
On Fri, Jan 30, 2009 at 7:02 PM, Meredith Gregory wrote: > Tim, > > In this last email i'm trying to parse this sentence > > XML request processing should not work perfectly >> > > Is this > >- a philosophical stance >- a warning, or >- a typo? > > typo... XML request processing should now work perfectly. > >- > > Best wishes, > > --greg > > On Fri, Jan 30, 2009 at 3:14 PM, Tim Perrett wrote: > >> >> Ok, found the problem. Req.scala needed a patch, which I have applied >> and committed into master. >> >> XML request processing should not work perfectly >> >> Cheers, Tim >> >> On Jan 30, 10:48 pm, Tim Perrett wrote: >> > Attached is an example application that shows the problem >> > >> > Cheers, Tim >> > >> > problem_example.zip >> > 16KViewDownload >> >> > > > -- > L.G. Meredith > Managing Partner > Biosimilarity LLC > 806 55th St NE > Seattle, WA 98105 > > +1 206.650.3740 > > http://biosimilarity.blogspot.com > > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] building lift from source --- warnings/errors expected?
Hey folks, I'm trying to build the lift sources. It mostly works, but I see more errors and warnings than I expected. I'm wondering if my configuration is set up correctly. Or do you see errors/warnings too? Thx. mvn jetty:run in liftweb/sites/example seems to work. I've tried mvn clean, and deleting my .m2/repository. I tried mvn jetty:run in hellodarwin and got: ERROR - Failed to Boot net.liftweb.sitemap.SiteMapException: Location Hello1.1 defined twice Loc(Hello1.1, , LinkText(), List()) and Loc (Hello1.1, , LinkText(), List()) at net.liftweb.sitemap.SiteMap.addLoc(SiteMap.scala:36) --- Here are a few of the errors/warning when I try mvn install: Tests in error: wiki edit HomePage should not have HomePage content define wiki edit HomePage should allow edition of HomePage Tests run: 2, Failures: 0, Errors: 2, Skipped: 0 -- [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /home/lee/tools/liftweb/lift-widgets/src/main/scala -- [WARNING] .../target/classes/toserve/tablesorter/ jquery.tablesorter.js:line -1:column -1:Try to use a single 'var' statement per scope. -- [WARNING] /home/lee/tools/liftweb/sites/hellolift/src/main/scala/com/ hellolift/comet/DynamicBlogView.scala:35: warning: match is not exhaustive! [WARNING] missing combination Empty [WARNING] missing combinationFailure [WARNING] [WARNING] name match { [WARNING] ^ [WARNING] warning: there were unchecked warnings; re-run with - unchecked for details [WARNING] two warnings found -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [SOLVED] Req lazy val xml not working
Tim, In this last email i'm trying to parse this sentence XML request processing should not work perfectly > Is this - a philosophical stance - a warning, or - a typo? Best wishes, --greg On Fri, Jan 30, 2009 at 3:14 PM, Tim Perrett wrote: > > Ok, found the problem. Req.scala needed a patch, which I have applied > and committed into master. > > XML request processing should not work perfectly > > Cheers, Tim > > On Jan 30, 10:48 pm, Tim Perrett wrote: > > Attached is an example application that shows the problem > > > > Cheers, Tim > > > > problem_example.zip > > 16KViewDownload > > > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Tic Tac Toe, Lift Style
David, Thanks for this! i'm looking forward to diving in. Best wishes, --greg On Fri, Jan 30, 2009 at 5:18 PM, David Pollak wrote: > Folks, > > I've committed up a Tic Tac Toe example: > > http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac > > It's an example of using the StatefulComet stuff. > > Things I like: > ToeDisplay is very concise > The example works > > Things I don't like: > Way too much display stuff in ToeBoard > The whole Lobby logic seems like a hack > > Enjoy. > > Thanks, > > David > > -- > Lift, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Git some: http://github.com/dpp > > > > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Tic Tac Toe, Lift Style
Folks, I've committed up a Tic Tac Toe example: http://github.com/dpp/lift-samples/tree/c5d22b8bca126ea518107f231a27353b63841ef8/tictac It's an example of using the StatefulComet stuff. Things I like: ToeDisplay is very concise The example works Things I don't like: Way too much display stuff in ToeBoard The whole Lobby logic seems like a hack Enjoy. Thanks, David -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] [Fwd: Welcome to scala-xml!]
Originally sent from my other account that's not a subscriber to liftweb... *sigh* -0xe1a --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~--- --- Begin Message --- Hi folks! I'm Alex Cruise (obviously!) I'm a software architect at http://www.layer7tech.com/ (located in Vancouver, Canada) and have been hanging around the Scala community for about a year and a half. I have recently volunteered to serve as a coordinator for the Scala XML team. At this time, the XML team (apart from EPFL people, of course) consists of myself, Michael Fogus, Normen Müller and (I think) David Pollak, but contributions--including bug reports, patches, complaints, feature requests and existential angst--are of course welcome from everyone. On behalf of said team, I would like to invite everyone who is interested in Scala's XML support to join the new scala-xml list! (This post cc'd to scala and liftweb--the latter because the Lift project is easily one of the heaviest users of scala.xml, and I'm certain that members of that community will enthusiastically join in the discussion in short order. :) If you'd like to watch the sausage being made, or even turn the crank a bit yourself, please subscribe to scala-xml by sending an empty email to scala-xml-subscr...@listes.epfl.ch . Here's some background info for anyone who is unfamiliar with Scala's XML support: The Scala compiler supports XML literals in Scala source files, with very few additional restrictions on their syntax. XML literals are translated into a tree built from instances of several classes in the scala.xml package (http://www.scala-lang.org/docu/files/api/scala/xml$package.html), and may contain nested Scala expressions (each of which can also incorporate sub-nested XML literals, etc...) whose results are interpolated into the XML. The scala.xml.Node class and its descendants form a comparatively lightweight, immutable, DOM-like representation of XML that can be used in pattern matching and provide simple, XPath-like node selection queries. The package also contains a few parsers and other assorted tools. IMO we owe a debt of gratitude to Burak Emir, the primary developer of scala.xml. I believe he has laid a solid foundation that will serve us well. Burak also wrote http://burak.emir.googlepages.com/scalaxbook.docbk.html which gives insight into the rationale behind the design and implementation of the library. Now, let's kick off the list with a small agenda: 1) Bug triage Rather than list the (~18) known bugs here, I'll supply an URL (http://lampsvn.epfl.decenturl.com/scala-xml-bugs), and anyone who feels like their favourite bug merits further discussion should fire up a new topic on scala-xml and we'll start hashing it out. If nobody pipes up I'll start posting individual emails regarding each bug with a few of my own comments in a few days. 2) Proposed enhancements I'm sure many of us have a wish list of things we would like to see changed in Scala's XML support--please feel free to join in and tell us all about them. Thanks for your time, -0xe1a --- End Message ---
[Lift] [SOLVED] Req lazy val xml not working
Ok, found the problem. Req.scala needed a patch, which I have applied and committed into master. XML request processing should not work perfectly Cheers, Tim On Jan 30, 10:48 pm, Tim Perrett wrote: > Attached is an example application that shows the problem > > Cheers, Tim > > problem_example.zip > 16KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Menus with Submenus - can I have a top level menu as container only?
I have an application with a menu which has too many items. I would like to move some of the menu items into submenus. For example, let's say I have menu items called "Client Admin" and "Custom Content" at the top level and I want to put them under a new top level menu item called "Site Admin". Using the example code from the lift sites sandbox as a guide, the code for this might look something like: Menu(Loc("SiteAdmin", List("site_admin", "index"), "Site Admin", ifIsLoggedIn, ifIsSuperUser), Menu(Loc("ClientAdmin", List("client_admin", "index"), "Client Mgt", ifIsLoggedIn, ifIsSuperUser)), Menu(Loc("CustomContent", List("custom_content", "index"), "Custom Content", ifIsLoggedIn, ifIsSuperUser)) )) In the above example, the "Site Admin" menu takes you to a new page (/ site_admin/index). However, I really just want to stay on the current page and show the two sub-menu items. When I use the current page in the Loc() expression for SiteAdmin, I don't get the sub menu items when I click on "Site Admin". Does anyone have a suggestion on how to have the sub-menu items in the above example show when I click on "Site Admin" without requiring that the browser navigate to a new page? Many thanks in advance. Dano --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Req lazy val xml not working
David, Try this: object RestApi extends XMLApiHelper { def dispatch: LiftRules.DispatchPF = { case r @ Req("api" :: "user" :: user :: Nil, "", _) => () => modify_user(user, r) } // user methods def modify_user(username: String, req: Req): LiftResponse = { println("Is XML: " + req.xml_?.toString) println("XML Body: " + req.xml.toString) println("Body: " + req.body) println(req.headers) PlainTextResponse("ok") } def createTag(in: NodeSeq) = {in} } // in boot.scala LiftRules.dispatch.preend(RestApi.dispatch) //HTTP Request looks like: Req(List(), Map(), ParsePath(List(api, user, timperrett),,true,false), , PutRequest, text/xml; charset=UTF-8) // Response: Is XML: true XML Body: Empty Body: Empty List((Content-Length,42), (Content-Type,text/xml; charset=UTF-8), (Host,127.0.0.1:8080), (Connection,Keep-Alive), (User-Agent,Apache- HttpClient/4.0-beta1 (java 1.4)), (Expect,100-continue)) So, we can conclude that it knows that its xml, but its not processing it as such. Might it be down to line 77 in Req.scala: if ((reqType.post_? || reqType.put_?) && request.getContentType == "text/xml") The content type im sending is "text/xml; charset=UTF-8", not "text/ xml" What are your thoughts? It strikes me that there is a potential missing case from that if/else if/else statement in param calculator too which is why its ending up Empty. What are your thoughts? Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Packaging lift application for distribution
I'm starting to look at lift as an alternative to a Scala+Swing application I have. I'll most likely embed Jetty anyway but after playing a little with Maven a question came to my mind: How to I package a Lift application to be run standalone on a desktop. My application comes with all the jars it needs (the two scala libs) and a couple of scripts to fire it off. I wonder if there is a way to build something like this for a Lift application. Something that makes easy for someone that is a regular user to get a simple one machine install done with a couple of clicks. Any hints? Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: submit and redirect
Lifted, Apps from gmail to Swik have demonstrated tagging as a pretty good alternative metaphor to the standard notion of container. The real beauty of this is that it can push all the way back to the data model. With that intro i was wondering if anyone has already built a tagging-style app in lift that they might care to share experiences about or even code. Best wishes, --greg On Fri, Jan 30, 2009 at 12:44 PM, Derek Chen-Becker wrote: > Right, really the same mechanism in different guises. Still, the code that > Sergey sent should work as far as I can tell... > > Derek > > > On Fri, Jan 30, 2009 at 11:01 AM, Marius wrote: > >> >> Yeah it does... in essence not very different from initial proposal >> since internally redirectTo from stateful snippet does the same thing: >> binds a function to be executed upon redirect. >> >> On Jan 30, 5:47 pm, Derek Chen-Becker wrote: >> > Unless I'm missing something the stateful snippet should be working. The >> > this.redirectTo call should be invoking the StatefulSnippet's >> redirectTo, >> > which should associate the same snippet instance with the new page. That >> > should allow access to the same var. I just coded up a test app >> (attached) >> > and it works fine using very similar code. >> > >> > On Fri, Jan 30, 2009 at 12:36 AM, Marius >> wrote: >> > >> > > On Jan 29, 10:54 pm, Sergey Andreev wrote: >> > > > Hi Liftlers, >> > > > I am migrating one of my application to the lift as a way to learn >> it and >> > > i >> > > > would like to ask a question. >> > >> > > > After submitting a form i would like to do a redirect and show the >> > > submitted >> > > > values on the other template. I have 2 templates and i use the same >> > > snippet >> > > > in both of them to render a dynamic content. >> > > > As far as i understand there are 2 ways to make it work: saving >> state >> > > using >> > > > SessionVars(which works for me) or extending StatefulSnippet and >> calling >> > > > this.redirectTo on it (looking at the sources it should register the >> > > > stateful snippet in the session). I've tried extending >> StatefulSnippet >> > > but >> > > > it doesn't work for me. A hashed value is added to the redirect url >> which >> > > > should map to the stateful snippet but the state is lost. I don't >> > > understand >> > > > what i am doing wrong. >> > >> > > > The simplified example of the code: >> > >> > > > class MySnippet extend StatefulSnippet { >> > > > private var myValues: List[String] = List() >> > >> > > > val dispatch.. = { >> > > > case "save" => save_ >> > > > case "show" => show _ >> > > > } >> > >> > > > def show = { >> > > > myValues.foreach(Log.info(_)) //nothing here >> > > > } >> > >> > > > def save(xhtml: NodeSeq) : NodeSeq = { >> > > > def processForm = { >> > > > myValues.foreach(Log.info(_)) //submitted values are printed >> out >> > > > this.redirectTo("/show") >> > > > } >> > >> > > Unless I'm missing something I do not this your values can be shown in >> > > the new template. There is an overloaded S.redirectTo where you can >> > > specify a function to be executed when the redirect is receives. Hence >> > > here you can pass state. See >> > >> > > def redirectTo[T](where: String, func: () => Unit): T >> > >> > > In this function you could probably set some RequestVar holding your >> > > needed state and when you snippet is rendered in the /show page you >> > > just read the info from these RequestVar(s). >> > >> > > > bind("render", xhtml, >> > > >.. //render textboxes and register functions which add >> values >> > > to >> > > > the myValues list >> > > >"submit" -> submit("Submit", processForm) >> > > > } >> > >> > > > } >> > >> > > > Thanks, >> > > > Sergey >> > > > P.S. The more i learn about Lift the more i like it. Thank you David >> and >> > > all >> > > > lift committers!!! >> > >> > >> > >> > teststateful.tgz >> > 7KViewDownload >> >> > > > > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: submit and redirect
Right, really the same mechanism in different guises. Still, the code that Sergey sent should work as far as I can tell... Derek On Fri, Jan 30, 2009 at 11:01 AM, Marius wrote: > > Yeah it does... in essence not very different from initial proposal > since internally redirectTo from stateful snippet does the same thing: > binds a function to be executed upon redirect. > > On Jan 30, 5:47 pm, Derek Chen-Becker wrote: > > Unless I'm missing something the stateful snippet should be working. The > > this.redirectTo call should be invoking the StatefulSnippet's redirectTo, > > which should associate the same snippet instance with the new page. That > > should allow access to the same var. I just coded up a test app > (attached) > > and it works fine using very similar code. > > > > On Fri, Jan 30, 2009 at 12:36 AM, Marius > wrote: > > > > > On Jan 29, 10:54 pm, Sergey Andreev wrote: > > > > Hi Liftlers, > > > > I am migrating one of my application to the lift as a way to learn it > and > > > i > > > > would like to ask a question. > > > > > > After submitting a form i would like to do a redirect and show the > > > submitted > > > > values on the other template. I have 2 templates and i use the same > > > snippet > > > > in both of them to render a dynamic content. > > > > As far as i understand there are 2 ways to make it work: saving state > > > using > > > > SessionVars(which works for me) or extending StatefulSnippet and > calling > > > > this.redirectTo on it (looking at the sources it should register the > > > > stateful snippet in the session). I've tried extending > StatefulSnippet > > > but > > > > it doesn't work for me. A hashed value is added to the redirect url > which > > > > should map to the stateful snippet but the state is lost. I don't > > > understand > > > > what i am doing wrong. > > > > > > The simplified example of the code: > > > > > > class MySnippet extend StatefulSnippet { > > > > private var myValues: List[String] = List() > > > > > > val dispatch.. = { > > > > case "save" => save_ > > > > case "show" => show _ > > > > } > > > > > > def show = { > > > > myValues.foreach(Log.info(_)) //nothing here > > > > } > > > > > > def save(xhtml: NodeSeq) : NodeSeq = { > > > > def processForm = { > > > > myValues.foreach(Log.info(_)) //submitted values are printed > out > > > > this.redirectTo("/show") > > > > } > > > > > Unless I'm missing something I do not this your values can be shown in > > > the new template. There is an overloaded S.redirectTo where you can > > > specify a function to be executed when the redirect is receives. Hence > > > here you can pass state. See > > > > > def redirectTo[T](where: String, func: () => Unit): T > > > > > In this function you could probably set some RequestVar holding your > > > needed state and when you snippet is rendered in the /show page you > > > just read the info from these RequestVar(s). > > > > > > bind("render", xhtml, > > > >.. //render textboxes and register functions which add > values > > > to > > > > the myValues list > > > >"submit" -> submit("Submit", processForm) > > > > } > > > > > > } > > > > > > Thanks, > > > > Sergey > > > > P.S. The more i learn about Lift the more i like it. Thank you David > and > > > all > > > > lift committers!!! > > > > > > > > teststateful.tgz > > 7KViewDownload > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Req lazy val xml not working
On Fri, Jan 30, 2009 at 12:28 PM, Tim Perrett wrote: > > > > > Try: > > > > sdfsdfsdf > > > > > > I'd already tried before, that and still no luck. I've also tried just > getting it to print something out that was passed. Even param1=badger type > post requests, but no luck. > > Thoughts? Please write up a test case that fails and I'll fix it. > > > Cheers, Tim > > > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Req lazy val xml not working
> > Try: > > sdfsdfsdf > > I'd already tried before, that and still no luck. I've also tried just getting it to print something out that was passed. Even param1=badger type post requests, but no luck. Thoughts? Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Req lazy val xml not working
On Fri, Jan 30, 2009 at 12:22 PM, Tim Perrett wrote: > > The xml is: > > > > sdfsdfsdf > > > I've tried all sorts, but still no cigar any ideas? Try: sdfsdfsdf > > > Cheers, Tim > > > On Jan 30, 8:17 pm, David Pollak > wrote: > > On Fri, Jan 30, 2009 at 12:12 PM, Tim Perrett > wrote: > > > > > Guys, > > > > > Just writing a little rest service, and I want to process the incoming > > > XML... The Req class has the following methods: > > > > > xml_? : Boolean > > > xml: Box[Elem] > > > > > Now then, xml_? is returning true, and the content-length header is > > > the correct length, but req.xml always, always returns Empty. > > > > > FYI, even trying to do: > > > > > req.body // => Empty > > > > > Any ideas why this might be happening? > > > > The XML is not well formed. > > > > > > > > > Cheers > > > > > Tim > > > > -- > > Lift, the simply functional web frameworkhttp://liftweb.net > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > Follow me:http://twitter.com/dpp > > Git some:http://github.com/dpp > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Req lazy val xml not working
The xml is: sdfsdfsdf I've tried all sorts, but still no cigar any ideas? Cheers, Tim On Jan 30, 8:17 pm, David Pollak wrote: > On Fri, Jan 30, 2009 at 12:12 PM, Tim Perrett wrote: > > > Guys, > > > Just writing a little rest service, and I want to process the incoming > > XML... The Req class has the following methods: > > > xml_? : Boolean > > xml: Box[Elem] > > > Now then, xml_? is returning true, and the content-length header is > > the correct length, but req.xml always, always returns Empty. > > > FYI, even trying to do: > > > req.body // => Empty > > > Any ideas why this might be happening? > > The XML is not well formed. > > > > > Cheers > > > Tim > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Req lazy val xml not working
On Fri, Jan 30, 2009 at 12:12 PM, Tim Perrett wrote: > > Guys, > > Just writing a little rest service, and I want to process the incoming > XML... The Req class has the following methods: > > xml_? : Boolean > xml: Box[Elem] > > Now then, xml_? is returning true, and the content-length header is > the correct length, but req.xml always, always returns Empty. > > FYI, even trying to do: > > req.body // => Empty > > Any ideas why this might be happening? The XML is not well formed. > > > Cheers > > Tim > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Req lazy val xml not working
Guys, Just writing a little rest service, and I want to process the incoming XML... The Req class has the following methods: xml_? : Boolean xml: Box[Elem] Now then, xml_? is returning true, and the content-length header is the correct length, but req.xml always, always returns Empty. FYI, even trying to do: req.body // => Empty Any ideas why this might be happening? Cheers Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
Jorge, chestit rozden den Best wishes, --greg On Fri, Jan 30, 2009 at 8:32 AM, Tim Perrett wrote: > > lol! This is like the most global happy birthday greeting ever! ;-) > > On Jan 30, 4:04 pm, Derek Chen-Becker wrote: > > ¡Feliz cumpleaños, señor! > > > > -- L.G. Meredith Managing Partner Biosimilarity LLC 806 55th St NE Seattle, WA 98105 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Added HTTP Auth example to sites directory
Nice stuff Tim. Thanks for adding this. On Jan 30, 2:06 pm, Tim Perrett wrote: > Guys, > > Its been ages, and im sorry its taken so long, but please now find an > example of how to use the HTTP Auth stuff in the sites directory. > > Respect to Marius who's been chipping away on this keeping it up-to- > date with the RulesSeq stuff etc as the lift API has moved forward. > For an example of how to use it, just check the sites/http- > authentication lift project, or github.com: > > http://github.com/dpp/liftweb/tree/master/sites/http-authentication > > Cheers > > Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: submit and redirect
Yeah it does... in essence not very different from initial proposal since internally redirectTo from stateful snippet does the same thing: binds a function to be executed upon redirect. On Jan 30, 5:47 pm, Derek Chen-Becker wrote: > Unless I'm missing something the stateful snippet should be working. The > this.redirectTo call should be invoking the StatefulSnippet's redirectTo, > which should associate the same snippet instance with the new page. That > should allow access to the same var. I just coded up a test app (attached) > and it works fine using very similar code. > > On Fri, Jan 30, 2009 at 12:36 AM, Marius wrote: > > > On Jan 29, 10:54 pm, Sergey Andreev wrote: > > > Hi Liftlers, > > > I am migrating one of my application to the lift as a way to learn it and > > i > > > would like to ask a question. > > > > After submitting a form i would like to do a redirect and show the > > submitted > > > values on the other template. I have 2 templates and i use the same > > snippet > > > in both of them to render a dynamic content. > > > As far as i understand there are 2 ways to make it work: saving state > > using > > > SessionVars(which works for me) or extending StatefulSnippet and calling > > > this.redirectTo on it (looking at the sources it should register the > > > stateful snippet in the session). I've tried extending StatefulSnippet > > but > > > it doesn't work for me. A hashed value is added to the redirect url which > > > should map to the stateful snippet but the state is lost. I don't > > understand > > > what i am doing wrong. > > > > The simplified example of the code: > > > > class MySnippet extend StatefulSnippet { > > > private var myValues: List[String] = List() > > > > val dispatch.. = { > > > case "save" => save_ > > > case "show" => show _ > > > } > > > > def show = { > > > myValues.foreach(Log.info(_)) //nothing here > > > } > > > > def save(xhtml: NodeSeq) : NodeSeq = { > > > def processForm = { > > > myValues.foreach(Log.info(_)) //submitted values are printed out > > > this.redirectTo("/show") > > > } > > > Unless I'm missing something I do not this your values can be shown in > > the new template. There is an overloaded S.redirectTo where you can > > specify a function to be executed when the redirect is receives. Hence > > here you can pass state. See > > > def redirectTo[T](where: String, func: () => Unit): T > > > In this function you could probably set some RequestVar holding your > > needed state and when you snippet is rendered in the /show page you > > just read the info from these RequestVar(s). > > > > bind("render", xhtml, > > > .. //render textboxes and register functions which add values > > to > > > the myValues list > > > "submit" -> submit("Submit", processForm) > > > } > > > > } > > > > Thanks, > > > Sergey > > > P.S. The more i learn about Lift the more i like it. Thank you David and > > all > > > lift committers!!! > > > > teststateful.tgz > 7KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
lol! This is like the most global happy birthday greeting ever! ;-) On Jan 30, 4:04 pm, Derek Chen-Becker wrote: > ¡Feliz cumpleaños, señor! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
¡Feliz cumpleaños, señor! On Fri, Jan 30, 2009 at 12:48 AM, Marius wrote: > > If Skype is right it must be Jorge's birthday ! > > HAPPY BIRTHDAY MAN ! > > Br's, > Marius > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: submit and redirect
Unless I'm missing something the stateful snippet should be working. The this.redirectTo call should be invoking the StatefulSnippet's redirectTo, which should associate the same snippet instance with the new page. That should allow access to the same var. I just coded up a test app (attached) and it works fine using very similar code. On Fri, Jan 30, 2009 at 12:36 AM, Marius wrote: > > > > On Jan 29, 10:54 pm, Sergey Andreev wrote: > > Hi Liftlers, > > I am migrating one of my application to the lift as a way to learn it and > i > > would like to ask a question. > > > > After submitting a form i would like to do a redirect and show the > submitted > > values on the other template. I have 2 templates and i use the same > snippet > > in both of them to render a dynamic content. > > As far as i understand there are 2 ways to make it work: saving state > using > > SessionVars(which works for me) or extending StatefulSnippet and calling > > this.redirectTo on it (looking at the sources it should register the > > stateful snippet in the session). I've tried extending StatefulSnippet > but > > it doesn't work for me. A hashed value is added to the redirect url which > > should map to the stateful snippet but the state is lost. I don't > understand > > what i am doing wrong. > > > > The simplified example of the code: > > > > class MySnippet extend StatefulSnippet { > > private var myValues: List[String] = List() > > > > val dispatch.. = { > > case "save" => save_ > > case "show" => show _ > > } > > > > def show = { > > myValues.foreach(Log.info(_)) //nothing here > > } > > > > def save(xhtml: NodeSeq) : NodeSeq = { > > def processForm = { > > myValues.foreach(Log.info(_)) //submitted values are printed out > > this.redirectTo("/show") > > } > > Unless I'm missing something I do not this your values can be shown in > the new template. There is an overloaded S.redirectTo where you can > specify a function to be executed when the redirect is receives. Hence > here you can pass state. See > > def redirectTo[T](where: String, func: () => Unit): T > > In this function you could probably set some RequestVar holding your > needed state and when you snippet is rendered in the /show page you > just read the info from these RequestVar(s). > > > > > > bind("render", xhtml, > >.. //render textboxes and register functions which add values > to > > the myValues list > >"submit" -> submit("Submit", processForm) > > } > > > > } > > > > Thanks, > > Sergey > > P.S. The more i learn about Lift the more i like it. Thank you David and > all > > lift committers!!! > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~--- teststateful.tgz Description: GNU Zip compressed data
[Lift] Re: submit and redirect
On Jan 30, 2:14 pm, Sergey Andreev wrote: > Marius, thanks for the code sample. I read your mails about that usage of > the redirectTo method on the list before but was confused how to use it. I > wish there was a way to hide function's hash code from the URL without > losing state. Lift knows which functions to invoke upon a request based on the query string parameters. I'm not sure why this matters so much. However if you really don't want to do that then you explicitly need to keep your state on server side most typically using SessionVar-s. Write your state in a SessionVar before redirect and read it in your snippets for /show template. I proposed the above solution because it is way cleaner IMO and the redirect function is automatically cleaned up ;) > Cheers, > Sergey > > On Fri, Jan 30, 2009 at 10:40 AM, Marius wrote: > > > On Jan 30, 9:36 am, Marius wrote: > > > On Jan 29, 10:54 pm, Sergey Andreev wrote: > > > > > Hi Liftlers, > > > > I am migrating one of my application to the lift as a way to learn it > > and i > > > > would like to ask a question. > > > > > After submitting a form i would like to do a redirect and show the > > submitted > > > > values on the other template. I have 2 templates and i use the same > > snippet > > > > in both of them to render a dynamic content. > > > > As far as i understand there are 2 ways to make it work: saving state > > using > > > > SessionVars(which works for me) or extending StatefulSnippet and > > calling > > > > this.redirectTo on it (looking at the sources it should register the > > > > stateful snippet in the session). I've tried extending StatefulSnippet > > but > > > > it doesn't work for me. A hashed value is added to the redirect url > > which > > > > should map to the stateful snippet but the state is lost. I don't > > understand > > > > what i am doing wrong. > > > > > The simplified example of the code: > > > > > class MySnippet extend StatefulSnippet { > > > > private var myValues: List[String] = List() > > > > > val dispatch.. = { > > > > case "save" => save_ > > > > case "show" => show _ > > > > } > > > > > def show = { > > > > myValues.foreach(Log.info(_)) //nothing here > > > > } > > > > > def save(xhtml: NodeSeq) : NodeSeq = { > > > > def processForm = { > > > > myValues.foreach(Log.info(_)) //submitted values are printed out > > > > this.redirectTo("/show") > > > > } > > > > Unless I'm missing something I do not this your values can be shown in > > > the new template. There is an overloaded S.redirectTo where you can > > > specify a function to be executed when the redirect is receives. Hence > > > here you can pass state. See > > > > def redirectTo[T](where: String, func: () => Unit): T > > > > In this function you could probably set some RequestVar holding your > > > needed state and when you snippet is rendered in the /show page you > > > just read the info from these RequestVar(s). > > > To me more specific I was referring to something like: > > > def myFunc(state: List[String])() { // a curried function > > > // here set the state on a RequestVar > > > } > > > from you submit function call: > > > S.redirectTo("/show", myFunc(myValues) _) > > > > > bind("render", xhtml, > > > > .. //render textboxes and register functions which add > > values to > > > > the myValues list > > > > "submit" -> submit("Submit", processForm) > > > > } > > > > > } > > > > > Thanks, > > > > Sergey > > > > P.S. The more i learn about Lift the more i like it. Thank you David > > and all > > > > lift committers!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
Happy Birthday! On Thu, Jan 29, 2009 at 11:48 PM, Marius wrote: > > If Skype is right it must be Jorge's birthday ! > > HAPPY BIRTHDAY MAN ! > > Br's, > Marius > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: submit and redirect
Derek, The templates are quite simple: fist one: second one: //other attributes are ommitted Sergey On Fri, Jan 30, 2009 at 10:01 AM, Derek Chen-Becker wrote: > That looks like it should be working, but could you post the template(s) > that go along with this? > > Derek > > > On Thu, Jan 29, 2009 at 1:54 PM, Sergey Andreev wrote: > >> Hi Liftlers, >> I am migrating one of my application to the lift as a way to learn it and >> i would like to ask a question. >> >> After submitting a form i would like to do a redirect and show the >> submitted values on the other template. I have 2 templates and i use the >> same snippet in both of them to render a dynamic content. >> As far as i understand there are 2 ways to make it work: saving state >> using SessionVars(which works for me) or extending StatefulSnippet and >> calling this.redirectTo on it (looking at the sources it should register the >> stateful snippet in the session). I've tried extending StatefulSnippet but >> it doesn't work for me. A hashed value is added to the redirect url which >> should map to the stateful snippet but the state is lost. I don't understand >> what i am doing wrong. >> >> The simplified example of the code: >> >> class MySnippet extend StatefulSnippet { >> private var myValues: List[String] = List() >> >> val dispatch.. = { >> case "save" => save_ >> case "show" => show _ >> } >> >> def show = { >> myValues.foreach(Log.info(_)) //nothing here >> } >> >> def save(xhtml: NodeSeq) : NodeSeq = { >> def processForm = { >> myValues.foreach(Log.info(_)) //submitted values are printed out >> this.redirectTo("/show") >> } >> >> bind("render", xhtml, >>.. //render textboxes and register functions which add values >> to the myValues list >>"submit" -> submit("Submit", processForm) >> } >> } >> >> Thanks, >> Sergey >> P.S. The more i learn about Lift the more i like it. Thank you David and >> all lift committers!!! >> >> >> >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: submit and redirect
Marius, thanks for the code sample. I read your mails about that usage of the redirectTo method on the list before but was confused how to use it. I wish there was a way to hide function's hash code from the URL without losing state. Cheers, Sergey On Fri, Jan 30, 2009 at 10:40 AM, Marius wrote: > > > > On Jan 30, 9:36 am, Marius wrote: > > On Jan 29, 10:54 pm, Sergey Andreev wrote: > > > > > > > > > Hi Liftlers, > > > I am migrating one of my application to the lift as a way to learn it > and i > > > would like to ask a question. > > > > > After submitting a form i would like to do a redirect and show the > submitted > > > values on the other template. I have 2 templates and i use the same > snippet > > > in both of them to render a dynamic content. > > > As far as i understand there are 2 ways to make it work: saving state > using > > > SessionVars(which works for me) or extending StatefulSnippet and > calling > > > this.redirectTo on it (looking at the sources it should register the > > > stateful snippet in the session). I've tried extending StatefulSnippet > but > > > it doesn't work for me. A hashed value is added to the redirect url > which > > > should map to the stateful snippet but the state is lost. I don't > understand > > > what i am doing wrong. > > > > > The simplified example of the code: > > > > > class MySnippet extend StatefulSnippet { > > > private var myValues: List[String] = List() > > > > > val dispatch.. = { > > > case "save" => save_ > > > case "show" => show _ > > > } > > > > > def show = { > > > myValues.foreach(Log.info(_)) //nothing here > > > } > > > > > def save(xhtml: NodeSeq) : NodeSeq = { > > > def processForm = { > > > myValues.foreach(Log.info(_)) //submitted values are printed out > > > this.redirectTo("/show") > > > } > > > > Unless I'm missing something I do not this your values can be shown in > > the new template. There is an overloaded S.redirectTo where you can > > specify a function to be executed when the redirect is receives. Hence > > here you can pass state. See > > > > def redirectTo[T](where: String, func: () => Unit): T > > > > In this function you could probably set some RequestVar holding your > > needed state and when you snippet is rendered in the /show page you > > just read the info from these RequestVar(s). > > > To me more specific I was referring to something like: > > > def myFunc(state: List[String])() { // a curried function > > // here set the state on a RequestVar > > } > > from you submit function call: > > S.redirectTo("/show", myFunc(myValues) _) > > > > > > > > > > > bind("render", xhtml, > > >.. //render textboxes and register functions which add > values to > > > the myValues list > > >"submit" -> submit("Submit", processForm) > > > } > > > > > } > > > > > Thanks, > > > Sergey > > > P.S. The more i learn about Lift the more i like it. Thank you David > and all > > > lift committers!!! > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] bug in mixinAttributes
Hi, I have encountered a bug in the mixinAttributes method If you put the following xml in the template: and bind it like that: bind("data", xhtml, "textBoxes" -> mixinAttributes(text("",)) _) then the attributes won't be merged. Whereas, if you change the template: attributes are merged. The problem is that in the first template, the child NodeSeq of the textBoxes element has a first element without attributes so the following line returns Null val attributes = in.firstOption.map(_.attributes).getOrElse(Null) I made a hack with filtering in's elements on having non-null attributes with non-zero length before applying firstOption. It would be nice if that bug will be addressed in the future releases. Regards, Sergey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
Happy Birthday Sir! On Jan 30, 4:44 am, Tim Perrett wrote: > Happy birthday Jorge!! > > On Jan 30, 8:34 am, Viktor Klang wrote: > > > Grattis på födelsedagen! > > > On Fri, Jan 30, 2009 at 9:30 AM, David Bernard > > wrote: > > > > Bon Anniversaire > > > > On Fri, Jan 30, 2009 at 08:48, Marius wrote: > > > >> If Skype is right it must be Jorge's birthday ! > > > >> HAPPY BIRTHDAY MAN ! > > > >> Br's, > > >> Marius > > > -- > > Viktor Klang > > Senior Systems Analyst > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Added HTTP Auth example to sites directory
Guys, Its been ages, and im sorry its taken so long, but please now find an example of how to use the HTTP Auth stuff in the sites directory. Respect to Marius who's been chipping away on this keeping it up-to- date with the RulesSeq stuff etc as the lift API has moved forward. For an example of how to use it, just check the sites/http- authentication lift project, or github.com: http://github.com/dpp/liftweb/tree/master/sites/http-authentication Cheers Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
Happy birthday Jorge!! On Jan 30, 8:34 am, Viktor Klang wrote: > Grattis på födelsedagen! > > On Fri, Jan 30, 2009 at 9:30 AM, David Bernard > wrote: > > > > > Bon Anniversaire > > > On Fri, Jan 30, 2009 at 08:48, Marius wrote: > > >> If Skype is right it must be Jorge's birthday ! > > >> HAPPY BIRTHDAY MAN ! > > >> Br's, > >> Marius > > -- > Viktor Klang > Senior Systems Analyst --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
Grattis på födelsedagen! On Fri, Jan 30, 2009 at 9:30 AM, David Bernard wrote: > Bon Anniversaire > > > On Fri, Jan 30, 2009 at 08:48, Marius wrote: > >> >> If Skype is right it must be Jorge's birthday ! >> >> HAPPY BIRTHDAY MAN ! >> >> Br's, >> Marius >> >> > > > > -- Viktor Klang Senior Systems Analyst --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Jorge's birthday ...
Bon Anniversaire On Fri, Jan 30, 2009 at 08:48, Marius wrote: > > If Skype is right it must be Jorge's birthday ! > > HAPPY BIRTHDAY MAN ! > > Br's, > Marius > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---