[Lift] Re: [scala] A Lift and Scala presentation at SAP TechEd
Excellent stuff David! Gonna show it to some people today :) Cheers! Viktor On Thu, Sep 11, 2008 at 11:16 PM, David Pollak [EMAIL PROTECTED] wrote: Marius wrote: BRAVO ! Thanks... and now you have a face and a voice with the email. :-) Plus 3,000+ SAP developers saw the Lift logo on my T-Shirt. :-) :-) On Sep 12, 12:01 am, David Pollak [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: http://www.youtube.com/watch?v=JFJMpFkpoQU Marius Danciu wrote: Excellent Dave and congrats! Can't wait to see the videos ... hopefully this time the videos quality is better so I can actually see you :) Br's, Marius On Thu, Sep 11, 2008 at 10:07 AM, David Pollak [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Folks, I've been at SAP TechEd (the geek fest that SAP throws every year to get developers in the SAP ecosystem together) this week chatting with folks about Scala and Lift. I gave a presentation tonight to about 40 RIA (Rich Internet App) developers about Lift and Scala. In 30 minutes I created a Lift real-time chat application with no cutting/pasting of code. The source is here: http://code.google.com/p/sdn-mentor-handson-2008/source/browse/#svn/t... SAP's NetWeaver platform is a J2EE container with a ton of SAP extensions. Lift apps run perfectly in NetWeaver. Over the next few months, I think we will see a fair number of these folks joining the Scala and Lift lists and asking lots of questions. I'll post links to videos and blogs that resulted from TechEd as they become available. Thanks, David -- Lift, the simply functional web frameworkhttp://liftweb.net Collaborative Task Managementhttp://much4.us Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Template questions
Yup, chooseTemplate is exactly what I was thinking of :) Derek On Thu, Sep 11, 2008 at 2:52 PM, Kris Nuttycombe [EMAIL PROTECTED]wrote: I think I found the cleaner method you were talking about; it's in 0.10: bind(item, chooseTemplate(order,items,xhtml), ...) which internally does almost exactly what your code is doing. There are also a couple of versions simply named template that return a Can[NodeSeq] instead of NodeSeq.Empty on not being able to find the child. Speaking of Can and null safety, if I'm binding something val foo = ... bind(foo, xhtml, bar -- Text(foo.bar)) and foo.bar has the potential to return null, what is the best practice for safely handling this without cluttering the code too much (since Text will throw an exception if passed a null in the constructor)? Thanks, Kris On Wed, Sep 10, 2008 at 2:28 PM, Derek Chen-Becker [EMAIL PROTECTED] wrote: Sorry, forgot about that. You might be able to use Scala's XML processing to just get at the children: bind (item, (xhtml \\ items).first.child, ...) Kind of ugly. I still can't find the example that David posted but it seemed a lot cleaner. Derek On Wed, Sep 10, 2008 at 12:39 PM, Kris Nuttycombe [EMAIL PROTECTED] wrote: Hrm. I think that I need to do something extra there to extract and bind against just the order:items element to avoid re-binding over the entire contents of the snippet. Marius, can you expand at all on using snippet attributes for case (1)? I've googled around and looked at all of the template docs I can find and am not really following how to take that approach. Thanks, Kris On Wed, Sep 10, 2008 at 12:08 PM, Derek Chen-Becker [EMAIL PROTECTED] wrote: I think the bind would look something like this (assuming that xhtml is the input NodeSeq): bind(order, xhtml, id -- Text(your_id_here), items -- your_items.flatMap{ item = bind(item, xhtml, name -- Text(item.name), cost -- Text(item.cost)) }) I seem to remember David giving an example of a nested bind but I can't find it. Derek On Wed, Sep 10, 2008 at 11:37 AM, Marius [EMAIL PROTECTED] wrote: Hi, 1. You can use snippet attributes. 2. You can leave the divs in the template page and attach only certain attributes from the snippet. Note that Scala XML API is immutable but that was never an inconvenience for me :) ... you could pattern match them easily. Br's, Marius On Sep 10, 8:05 pm, Kris Nuttycombe [EMAIL PROTECTED] wrote: Hi, all, I'm in the process of moving a Rails app over to Lift, and have a couple of questions about how to achieve a few things that aren't really addressed in the basic template tutorials. First, I have a situation where I have a list of orders, each of which has some number of items. What would the binding look like for something like the following? lift:snippet type=Orders:list order:idsample_order_id/order:id order:items item:nameSample Item/item:name item:cost$0.00/item:cost /order:items /lift:snippet Secondly, I know that there have been some additions since the discussion on dynamic node attributes here: http://groups.google.com/group/liftweb/browse_thread/thread/c7fe7b4b3... What is the best way to go about porting something that looks like this in Rails: div style=color:blue;cursor:pointer onclick=document.getElementById('order_%= order.id %').style.display='block';this.style.display='none'[View Details]/div div id=order_%= order.id % style=display:none ... /div It seems a bit odd to use different snippet functions to write the onclick and id attributes. I know that I could move the generation of both divs into the snippet, but that won't make our designers happy because they won't be able to play with the functionality in their browsers. Thanks, Kris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Desiderata. Was: Re: [Lift] Re: RBAC in Lift
You can get the human-readable pages via the LiftRules.addDispatch... methods. They take a partial function which uses a RequestMatcher to determine which handler to use for a particular request. In the process, you can use Scala's List wildcarding to extract parts of the URL that was passed in. The syntax appears to have changed a bit since I tried this last, but in Boot you would do something like this: LiftRules.addDispatchBefore({ case RequestMatcher(RequestState(page :: page_name :: Nil, _, _, _, _, _, _, _)) = some_handler(_, page_name) }) I know I'm butchering that, but that's the general idea. The page :: page_name :: Nil matches against the path, so that will match any URL path that looks like /page/page_name and make the latter portion available for your handlers. Derek On Thu, Sep 11, 2008 at 4:09 PM, Charles F. Munat [EMAIL PROTECTED] wrote: Marius wrote: Also, I like the user-created pages to be accessible by URL (i.e. without a query string) with a readable URL, so: mysite.com/some_page Not: mysite.com/p123456, mysite.com?page=some_page, or mysite.com?page=123456 What is the difference between mysite.com/some_page and mysite.com/ p123456? I mean what is the exact problem you're trying to solve? Perhaps a more concrete example may help us help you. A short synopsis can be found here: http://plone.org/products/plone/features/3.0/existing-features/human-readable-urls If you Google human-readable URL, you'll get some other interesting hits. I first encountered the concept years ago when I was spending time on the W3C's Web Accessibility Initiative list. I've been doing my best to use human-readable URLs ever since. But I wasn't actually asking a question, just mentioning this as a desiderata. I'll figure it out when I get to that point. Meanwhile, I am getting my hands dirty -- as you put it -- figuring out the SiteMap and related code. Will post questions as they come up. Chas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: [scala] A Lift and Scala presentation at SAP TechEd
Great presentation! It's really exciting to be a part of this community :) Derek On Fri, Sep 12, 2008 at 1:26 AM, Viktor Klang [EMAIL PROTECTED]wrote: Excellent stuff David! Gonna show it to some people today :) Cheers! Viktor On Thu, Sep 11, 2008 at 11:16 PM, David Pollak [EMAIL PROTECTED] wrote: Marius wrote: BRAVO ! Thanks... and now you have a face and a voice with the email. :-) Plus 3,000+ SAP developers saw the Lift logo on my T-Shirt. :-) :-) On Sep 12, 12:01 am, David Pollak [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: http://www.youtube.com/watch?v=JFJMpFkpoQU Marius Danciu wrote: Excellent Dave and congrats! Can't wait to see the videos ... hopefully this time the videos quality is better so I can actually see you :) Br's, Marius On Thu, Sep 11, 2008 at 10:07 AM, David Pollak [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Folks, I've been at SAP TechEd (the geek fest that SAP throws every year to get developers in the SAP ecosystem together) this week chatting with folks about Scala and Lift. I gave a presentation tonight to about 40 RIA (Rich Internet App) developers about Lift and Scala. In 30 minutes I created a Lift real-time chat application with no cutting/pasting of code. The source is here: http://code.google.com/p/sdn-mentor-handson-2008/source/browse/#svn/t... SAP's NetWeaver platform is a J2EE container with a ton of SAP extensions. Lift apps run perfectly in NetWeaver. Over the next few months, I think we will see a fair number of these folks joining the Scala and Lift lists and asking lots of questions. I'll post links to videos and blogs that resulted from TechEd as they become available. Thanks, David -- Lift, the simply functional web frameworkhttp://liftweb.net Collaborative Task Managementhttp://much4.us Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Desiderata. Was: Re: [Lift] Re: RBAC in Lift
Thanks Tim, I had forgotten about just using a rewrite (which is definitely simpler). I had thought there was a Wiki page on the addDispatch methods, too, but I can't find it. The Wiki search function doesn't appear to work on substrings :( Derek On Fri, Sep 12, 2008 at 7:46 AM, Tim Perrett [EMAIL PROTECTED] wrote: Indeed - just reading this thread back and not quite understanding why its *not* possible to friendly urls in lift its very easy as derek points out. Check out: http://liftweb.net/index.php/UrlRewriting Tim On Sep 12, 2:17 pm, Derek Chen-Becker [EMAIL PROTECTED] wrote: You can get the human-readable pages via the LiftRules.addDispatch... methods. They take a partial function which uses a RequestMatcher to determine which handler to use for a particular request. In the process, you can use Scala's List wildcarding to extract parts of the URL that was passed in. The syntax appears to have changed a bit since I tried this last, but in Boot you would do something like this: LiftRules.addDispatchBefore({ case RequestMatcher(RequestState(page :: page_name :: Nil, _, _, _, _, _, _, _)) = some_handler(_, page_name) }) I know I'm butchering that, but that's the general idea. The page :: page_name :: Nil matches against the path, so that will match any URL path that looks like /page/page_name and make the latter portion available for your handlers. Derek On Thu, Sep 11, 2008 at 4:09 PM, Charles F. Munat [EMAIL PROTECTED] wrote: Marius wrote: Also, I like the user-created pages to be accessible by URL (i.e. without a query string) with a readable URL, so: mysite.com/some_page Not: mysite.com/p123456, mysite.com?page=some_page, or mysite.com?page=123456 What is the difference between mysite.com/some_page and mysite.com/ p123456? I mean what is the exact problem you're trying to solve? Perhaps a more concrete example may help us help you. A short synopsis can be found here: http://plone.org/products/plone/features/3.0/existing-features/human-. .. If you Google human-readable URL, you'll get some other interesting hits. I first encountered the concept years ago when I was spending time on the W3C's Web Accessibility Initiative list. I've been doing my best to use human-readable URLs ever since. But I wasn't actually asking a question, just mentioning this as a desiderata. I'll figure it out when I get to that point. Meanwhile, I am getting my hands dirty -- as you put it -- figuring out the SiteMap and related code. Will post questions as they come up. Chas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Desiderata. Was: [Lift] RBAC in Lift
On Sep 12, 5:07 am, Marc Boschma [EMAIL PROTECTED] wrote: My current understanding is that Lift is a snippet rather than page oriented framework. SiteMap focuses on access or not to page level. Well kind of ... snippets are just for generating dynamic markup. Thinking about this overnight it sounds like we need some way to inform a snippet of who is trying to interact with it and what rights they have is needed. Can I ask why? What would this solve? Would that be done by wrapping utilising isDefinedAt on the PartialFunction to allow snippet code to behave differently based on some sort of passed in (does it actually have to be passed in?) credential type? Well since snippet is Scala code any snippet can behave different in different context. The context can be impersonated by LiftSession content, actors .. virtually anything. Can you please provide a concrete example? To me the solution should allow the snippet's logic to be in one place, if possible have no impact on a non-credential sensitive snippet (or very little, if we don't want to default to a snippet being open if not explicitly closed). Also since snippets are recursive how do we handle a chain of InSecureSnippet - SecureSnippet when we don't want InSecureSnippet to produce content if SecureSnippet doesn't want to produce content? I feel that this is more an applicaiton concern and not a framework work. As lift framework just provides the means to do a lot of really cool stuff ... but it's the application who actually uses them. I'm not saying that this shouldn't be considered but if you have an example application/use-case that can not be solved easily today we can take this forward discuss it and see how lift as a framework can solve such problems. Would there need to be special provisions for StatefulSnippets if the credentials change from them starting? Well since any snippet can be context aware (has access to LiftSession or some SessionVar-s) lots of things can be easily done. Marc On 12/09/2008, at 8:09 AM, Charles F. Munat wrote: Marius wrote: Also, I like the user-created pages to be accessible by URL (i.e. without a query string) with a readable URL, so: mysite.com/some_page Not: mysite.com/p123456, mysite.com?page=some_page, or mysite.com? page=123456 What is the difference between mysite.com/some_page and mysite.com/ p123456? I mean what is the exact problem you're trying to solve? Perhaps a more concrete example may help us help you. A short synopsis can be found here: http://plone.org/products/plone/features/3.0/existing-features/human-... If you Google human-readable URL, you'll get some other interesting hits. I first encountered the concept years ago when I was spending time on the W3C's Web Accessibility Initiative list. I've been doing my best to use human-readable URLs ever since. But I wasn't actually asking a question, just mentioning this as a desiderata. I'll figure it out when I get to that point. Meanwhile, I am getting my hands dirty -- as you put it -- figuring out the SiteMap and related code. Will post questions as they come up. Chas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Desiderata. Was: Re: [Lift] Re: RBAC in Lift
These suggestions look really good. Thanks! I'll pore over the information and will try to figure it out. Chas. Tim Perrett wrote: Indeed - just reading this thread back and not quite understanding why its *not* possible to friendly urls in lift its very easy as derek points out. Check out: http://liftweb.net/index.php/UrlRewriting Tim On Sep 12, 2:17 pm, Derek Chen-Becker [EMAIL PROTECTED] wrote: You can get the human-readable pages via the LiftRules.addDispatch... methods. They take a partial function which uses a RequestMatcher to determine which handler to use for a particular request. In the process, you can use Scala's List wildcarding to extract parts of the URL that was passed in. The syntax appears to have changed a bit since I tried this last, but in Boot you would do something like this: LiftRules.addDispatchBefore({ case RequestMatcher(RequestState(page :: page_name :: Nil, _, _, _, _, _, _, _)) = some_handler(_, page_name) }) I know I'm butchering that, but that's the general idea. The page :: page_name :: Nil matches against the path, so that will match any URL path that looks like /page/page_name and make the latter portion available for your handlers. Derek On Thu, Sep 11, 2008 at 4:09 PM, Charles F. Munat [EMAIL PROTECTED] wrote: Marius wrote: Also, I like the user-created pages to be accessible by URL (i.e. without a query string) with a readable URL, so: mysite.com/some_page Not: mysite.com/p123456, mysite.com?page=some_page, or mysite.com?page=123456 What is the difference between mysite.com/some_page and mysite.com/ p123456? I mean what is the exact problem you're trying to solve? Perhaps a more concrete example may help us help you. A short synopsis can be found here: http://plone.org/products/plone/features/3.0/existing-features/human-... If you Google human-readable URL, you'll get some other interesting hits. I first encountered the concept years ago when I was spending time on the W3C's Web Accessibility Initiative list. I've been doing my best to use human-readable URLs ever since. But I wasn't actually asking a question, just mentioning this as a desiderata. I'll figure it out when I get to that point. Meanwhile, I am getting my hands dirty -- as you put it -- figuring out the SiteMap and related code. Will post questions as they come up. Chas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: bind() and lift:embed
Okay, I have encountered one problem with eager_eval: recursive embed evaluation. If I have templateA.html: lift:MySnippet eager_eval=true lift:embed what=templateB /lift:MySnippet and templateB.html: div class=foobar ... lift:embed what=templateC ... /div then I get a somewhat opaque error from deep inside Scala's XML stack: Exception occured while processing /orders/list Message: java.lang.IllegalArgumentException: line 32 does not exist scala.io.Source.getLine(Source.scala:280) scala.io.Source.report(Source.scala:368) scala.io.Source.reportError(Source.scala:355) scala.io.Source.reportError(Source.scala:344) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1113) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:77) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1117) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:77) scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:226) net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:77) net.liftweb.util.PCDataXmlParser$.apply(PCDataMarkupParser.scala:88) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1$$anonfun$apply$49.apply(LiftSession.scala:896) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1$$anonfun$apply$49.apply(LiftSession.scala:896) net.liftweb.util.Full.flatMap(Can.scala:266) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1.apply(LiftSession.scala:896) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1.apply(LiftSession.scala:896) scala.Function1$$anonfun$andThen$1.apply(Function1.scala:48) scala.Stream$class.flatMap(Stream.scala:430) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.List$$anon$1.flatMap(List.scala:1307) net.liftweb.util.ListHelpers$class.first(ListHelpers.scala:35) net.liftweb.util.Helpers$.first(Helpers.scala:26) net.liftweb.http.TemplateFinder$.findAnyTemplate(LiftSession.scala:896) net.liftweb.http.LiftSession.findTemplate(LiftSession.scala:506) net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$findAndEmbed(LiftSession.scala:520) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:652) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:645) scala.PartialFunction$$anon$1.apply(PartialFunction.scala:38) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$35.apply(LiftSession.scala:669) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$35.apply(LiftSession.scala:669) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:24) net.liftweb.http.S$.setVars(S.scala:518) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:669) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:666) scala.Seq$class.flatMap(Seq.scala:267) scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
[Lift] Re: bind() and lift:embed
These exceptions are due to malformed XML. lift:MySnippet eager_eval=true lift:embed what=templateB /lift:MySnippet Should be lift:MySnippet eager_eval=true lift:embed what=templateB*/* /lift:MySnippet and div class=foobar ... lift:embed what=templateC ... /div Should be: div class=foobar ... lift:embed what=templateC/ ... /div Note the '/' that close the tag. Kris Nuttycombe wrote: Okay, I have encountered one problem with eager_eval: recursive embed evaluation. If I have templateA.html: lift:MySnippet eager_eval=true lift:embed what=templateB /lift:MySnippet and templateB.html: div class=foobar ... lift:embed what=templateC ... /div then I get a somewhat opaque error from deep inside Scala's XML stack: Exception occured while processing /orders/list Message: java.lang.IllegalArgumentException: line 32 does not exist scala.io.Source.getLine(Source.scala:280) scala.io.Source.report(Source.scala:368) scala.io.Source.reportError(Source.scala:355) scala.io.Source.reportError(Source.scala:344) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1113) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:77) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1117) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:77) scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:226) net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:77) net.liftweb.util.PCDataXmlParser$.apply(PCDataMarkupParser.scala:88) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1$$anonfun$apply$49.apply(LiftSession.scala:896) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1$$anonfun$apply$49.apply(LiftSession.scala:896) net.liftweb.util.Full.flatMap(Can.scala:266) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1.apply(LiftSession.scala:896) net.liftweb.http.TemplateFinder$$anonfun$findAnyTemplate$1.apply(LiftSession.scala:896) scala.Function1$$anonfun$andThen$1.apply(Function1.scala:48) scala.Stream$class.flatMap(Stream.scala:430) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$$anonfun$flatMap$1.apply(Stream.scala:435) scala.Stream$class.append(Stream.scala:255) scala.List$$anon$1.append(List.scala:1307) scala.Stream$class.flatMap(Stream.scala:435) scala.List$$anon$1.flatMap(List.scala:1307) scala.List$$anon$1.flatMap(List.scala:1307) net.liftweb.util.ListHelpers$class.first(ListHelpers.scala:35) net.liftweb.util.Helpers$.first(Helpers.scala:26) net.liftweb.http.TemplateFinder$.findAnyTemplate(LiftSession.scala:896) net.liftweb.http.LiftSession.findTemplate(LiftSession.scala:506) net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$findAndEmbed(LiftSession.scala:520) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:652) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:645) scala.PartialFunction$$anon$1.apply(PartialFunction.scala:38) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$35.apply(LiftSession.scala:669) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$35.apply(LiftSession.scala:669)
[Lift] Re: Desiderata. Was: Re: [Lift] Re: RBAC in Lift
The missing piece is the ability to un-rewrite URLs via SiteMap such that it's easy to create nicely formed URLs with nicely placed parameters using SiteMap and have the rules be bi-directional. It's been on my noodling list for a while, but hasn't been high priority. Charles F. Munat wrote: These suggestions look really good. Thanks! I'll pore over the information and will try to figure it out. Chas. Tim Perrett wrote: Indeed - just reading this thread back and not quite understanding why its *not* possible to friendly urls in lift its very easy as derek points out. Check out: http://liftweb.net/index.php/UrlRewriting Tim On Sep 12, 2:17 pm, Derek Chen-Becker [EMAIL PROTECTED] wrote: You can get the human-readable pages via the LiftRules.addDispatch... methods. They take a partial function which uses a RequestMatcher to determine which handler to use for a particular request. In the process, you can use Scala's List wildcarding to extract parts of the URL that was passed in. The syntax appears to have changed a bit since I tried this last, but in Boot you would do something like this: LiftRules.addDispatchBefore({ case RequestMatcher(RequestState(page :: page_name :: Nil, _, _, _, _, _, _, _)) = some_handler(_, page_name) }) I know I'm butchering that, but that's the general idea. The page :: page_name :: Nil matches against the path, so that will match any URL path that looks like /page/page_name and make the latter portion available for your handlers. Derek On Thu, Sep 11, 2008 at 4:09 PM, Charles F. Munat [EMAIL PROTECTED] wrote: Marius wrote: Also, I like the user-created pages to be accessible by URL (i.e. without a query string) with a readable URL, so: mysite.com/some_page Not: mysite.com/p123456, mysite.com?page=some_page, or mysite.com?page=123456 What is the difference between mysite.com/some_page and mysite.com/ p123456? I mean what is the exact problem you're trying to solve? Perhaps a more concrete example may help us help you. A short synopsis can be found here: http://plone.org/products/plone/features/3.0/existing-features/human-... If you Google human-readable URL, you'll get some other interesting hits. I first encountered the concept years ago when I was spending time on the W3C's Web Accessibility Initiative list. I've been doing my best to use human-readable URLs ever since. But I wasn't actually asking a question, just mentioning this as a desiderata. I'll figure it out when I get to that point. Meanwhile, I am getting my hands dirty -- as you put it -- figuring out the SiteMap and related code. Will post questions as they come up. Chas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Demo app error
Just thought I should point out that http://demo.liftweb.net/lift/simple/ is puking: Message: java.lang.reflect.InvocationTargetException sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) net.liftweb.util.Helpers$$anonfun$net$liftweb$util$Helpers$$_invokeMethod$1.apply(Helpers.scala:613) net.liftweb.util.Helpers$$anonfun$net$liftweb$util$Helpers$$_invokeMethod$1.apply(Helpers.scala:612) net.liftweb.util.Full.map(Can.scala:236) net.liftweb.util.Helpers$.net$liftweb$util$Helpers$$_invokeMethod(Helpers.scala:612) net.liftweb.util.Helpers$.invokeMethod(Helpers.scala:623) net.liftweb.util.Helpers$.invokeMethod(Helpers.scala:636) net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$24$$anonfun$apply$27.apply(LiftSession.scala:424) net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$24$$anonfun$apply$27.apply(LiftSession.scala:424) net.liftweb.util.EmptyCan.or(Can.scala:269) net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$24.apply(LiftSession.scala:424) net.liftweb.http.LiftSession$$anonfun$18$$anonfun$apply$24.apply(LiftSession.scala:410) net.liftweb.util.EmptyCan.openOr(Can.scala:267) net.liftweb.http.LiftSession$$anonfun$18.apply(LiftSession.scala:410) net.liftweb.http.LiftSession$$anonfun$18.apply(LiftSession.scala:409) net.liftweb.util.Full.map(Can.scala:236) net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$processSnippet(LiftSession.scala:409) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:476) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:462) scala.PartialFunction$$anon$1.apply(PartialFunction.scala:38) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:465) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:462) scala.PartialFunction$$anon$1.apply(PartialFunction.scala:38) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$33.apply(LiftSession.scala:486) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$33.apply(LiftSession.scala:486) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:24) net.liftweb.http.S$.setVars(S.scala:370) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:486) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:483) scala.Seq$class.flatMap(Seq.scala:268) scala.xml.NodeSeq.flatMap(NodeSeq.scala:34) net.liftweb.http.LiftSession.processSurroundAndInclude(LiftSession.scala:482) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:487) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:483) scala.Seq$class.flatMap(Seq.scala:268) scala.xml.NodeSeq.flatMap(NodeSeq.scala:34) net.liftweb.http.LiftSession.processSurroundAndInclude(LiftSession.scala:482) net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$processSurroundElement(LiftSession.scala:616) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:468) net.liftweb.http.LiftSession$$anonfun$_defaultLiftTagProcessing$1.apply(LiftSession.scala:462) scala.PartialFunction$$anon$1.apply(PartialFunction.scala:38) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$33.apply(LiftSession.scala:486) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1$$anonfun$apply$33.apply(LiftSession.scala:486) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:24) net.liftweb.http.S$.setVars(S.scala:370) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:486) net.liftweb.http.LiftSession$$anonfun$processSurroundAndInclude$1.apply(LiftSession.scala:483) scala.Seq$class.flatMap(Seq.scala:268) scala.xml.NodeSeq.flatMap(NodeSeq.scala:34) net.liftweb.http.LiftSession.processSurroundAndInclude(LiftSession.scala:482) net.liftweb.http.LiftSession$$anonfun$processRequest$1$$anonfun$apply$10.apply(LiftSession.scala:190) net.liftweb.http.LiftSession$$anonfun$processRequest$1$$anonfun$apply$10.apply(LiftSession.scala:190) net.liftweb.util.Full.map(Can.scala:236) net.liftweb.http.LiftSession$$anonfun$processRequest$1.apply(LiftSession.scala:190) net.liftweb.http.LiftSession$$anonfun$processRequest$1.apply(LiftSession.scala:165) net.liftweb.http.S$$anonfun$net$liftweb$http$S$$wrapQuery$1.apply(S.scala:280) net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:24) net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:277) net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$2$$anonfun$apply$18$$anonfun$apply$19$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(S.scala:323)