[Lift] Re: About the localization with lift:loc !
Yeah, it get the same result . So I'm very confused with the lift:loc ... Is anyone know this problem ? Thanks for help. :) Cheers, Neil On Nov 9, 2:53 pm, YING-KWANG TU ying.kwang...@gmail.com wrote: Neil, Considering that we are both using the lift-core_xx_XX in our bundle. 1. S.??(works seamlessly) However, I am having same issue with you on: lift:loc locid=loginDefault Value/lift:loc OR lift:loc loc_id=loginDefault Value/lift:loc OR lift:loclogin/lift:loc I am not sure if it has to do with the bundle name we are using but no, we can't get lift:loc/ to work. On Sat, Nov 7, 2009 at 9:46 PM, Neil.Lv anim...@gmail.com wrote: yk, I use the code that you write. 1:) I use this link to test the i18n http://localhost:8080/?locale=ms_MY S.??(login) = it works well ! 2:) But this code in the html page, it always doesn't work too, just show the Default value lift:loc locid=loginDefault value/lift:loc Thanks very much! Cheers, Neil On Nov 7, 8:29 pm, Timothy Perrett timo...@getintheloop.eu wrote: You should always be working with UTF-8 files for properties / localisation - I think the encoding reported by jetty is something different (that it reads from the system)... ensure your props files are UTF-8 and go from there. Cheers, Tim On Nov 7, 12:48 am, yk ying.kwang...@gmail.com wrote: Hi Tim, I've developed n tested localization on windows and it worked perfectly. however, localization of the same project placed on ubuntu server 9.10 did not. WinXP --- jdk1.6 maven 2.2.1 lifeweb 1.1-M7 encoding=cp1252 (as reported by mvn jetty:run) Ubuntu 9.10 server --- openjdk OR sun-jdk6 maven 2.2.1 liftweb 1.1-M7 encoding=UTF-8 (as reported by mvn jetty:run) I can't quite point my finger on why it worked on windows but not on linux. Do i have to convert all files that need to be deployed to UTF-8 encoding? Thank you in advance. Cheers, yk On Oct 26, 9:12 pm, Timothy Perrett timo...@getintheloop.eu wrote: The browser already knows the locale, you have it backward! Your localeCalculator is so that the browser can get lift to return the right content. Take a look at: http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/... I would start with just getting lift to explicitly set locale based on a query string or something... it will help you understand how the mechanism works. Cheers, Tim On 26 Oct 2009, at 12:34, Neil.Lv wrote: ... Where is the locale to be set that the browser can know the locale ? Thanks very much! Cheers, Neil On Oct 26, 7:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: setLocale was a method created by me, specific to my application - it does not exist in Lift... hence why I removed it in my simplified example. Cheers, Tim On 26 Oct 2009, at 11:45, Neil.Lv wrote: I have a silly question , where is the setLocale method ? I don't know where the package located. src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found: value setLocale setLocale(selectedLocale) :) Cheers, Neil On Oct 26, 5:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: Yes, your template code is right - your just seeing the default value because you have not told lift what resources to use when it gets the locale header from the browser. tryo() is like try/catch however, it will catch exceptions and returns Box[T] I would really suggest starting with something a lot simpler than the one i detailed that uses cookies and all sorts. Perhaps something like: def localeCalculator(request : Box[HTTPRequest]): Locale = request.flatMap(r = { tryo(r.locale) match { // your match here } }).openOr(java.util.Locale.getDefault()) Hope that helps Cheers, Tim On 26 Oct 2009, at 09:21, Neil.Lv wrote: lift:loc locid=loginLog in 222/lift:loc That means this code is correctly, the problem is that the browser doesn't know the locale? So we need to calculate the locale in the Boot.scala file ? Cheers, Neil On Oct 26, 5:09 pm, Neil.Lv anim...@gmail.com wrote: tryo(r.getParameter(locale)) match { case Full(null) = workOutLocale case Empty = workOutLocale case Failure(_,_,_) = workOutLocale case Full(selectedLocale) = { setLocale(selectedLocale) selectedLocale } } In this code , what's the tryo ? is try ? tryo () match {} What's the changes about the HTTP container providers?
[Lift] Re: Is there a Order Map in the lift ?
It works now ! I use the m.toList.sort(_ _) method to sort the result. ### scala var m = Map(2 - yy, 3 - zz, 1- xx) scala m.toList.sort(_ _) res149: List[(Int, java.lang.String)] = List((1,xx), (2,yy), (3,zz)) ### :) Cheers, Neil On Nov 9, 3:59 pm, Neil.Lv anim...@gmail.com wrote: Hi all, Is there a Order Map in the lift ? Example: 1- xx, 2 - yy, 3 - zz 1:) add 1- xx Map(1- xx) 2:) add 3 - zz Map(3 - zz, 1- xx) 3:) add 2 - yy Map(2 - yy, 3 - zz, 1- xx) The result maybe: Map(2 - yy, 3 - zz, 1- xx) But i want the structure(order by the number) is : Map(1- xx, 2 - yy, 3 - zz) Any help would be much appreciated ! Cheers, Neil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How quick is webdev with Lift?
Thanx fro SBT. I have to look at this tool. On 9 ноя, 06:43, harryh har...@gmail.com wrote: I use JRebel and SBT (http://code.google.com/p/simple-build-tool/) and very rarely have to restart my server when doing development. It's a very quick dev-cycle. No big tips really. I save the code and reload the page and see the results of my work. -harryh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: S.uri not including query params
Hello guys, I thought the purpose of loginRedirect was to be able to override where the newly logged-in user gets redirected to. I'm doing it like so, in model/User: loginRedirect(Full(/loadPrivateKey)) ..but it just goes to the page I accessed before I clicked on / user_mgt/login Is there another way I should be aware of to reach my goal? I guess I could be more specific: once a user is logged in I need to load his/her private key into memory with which to decrypt sensitive data from the database (previously encrypted with a public key). I have all the code written using BouncyCastle, but was wondering if Lift offers something built-in. I'd be happy to forward my code on if this could be a useful extension to the Lift code. Thanks, Juan On Oct 21, 2:18 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: http://github.com/dpp/liftweb/issues/#issue/121 If I have some time this afternoon I'll fix it. On Tue, Oct 20, 2009 at 8:07 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: Then my addition to MetaMegaProtoUser of loginRedirect has a bug, because loginFirst sets it based on S.uri. Since I'm not usually around an internet connection, I won't be able to go through filing a ticket, putting a diff on Review Board, and pushing it, in any small amount of time. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Oct 20, 2009 at 2:48 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: Is S.uri supposed to return the part of the URL after '?'? No -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] SiteMap: how to change order and text of menu items
Hello! I am a Lift beginner. I have created a site with archetype 'lift- archetype-basic'. In Boot.scala I add User.sitemap to LiftRules. In my html file I create the menu by using lift:Menu.builder/. Question 1: when I am logged in the order of the menu items from User are 'Logout | Edit User | Change Password'. How do I change the order of the menu items from User? I would like to have 'Edit User | Change Password | Logout'. Question 2: the default text of the menu items are in English. How do I change the text of the menu items to another language? Is there a simple way or do I have to implement it as described in http://blog.getintheloop.eu/2009/7/26/how-to-extensive-localization-with-the-liftweb-framework? Thanks for your help, Henrik --~--~-~--~~~---~--~~ 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: SiteMap: how to change order and text of menu items
Ooo, thats my blog :-) What is it you dont feel to be straight forward in what I described? You will need to use a locale calculator at the very least, because otherwise Lift has no way of knowing what language is being requested. Cheers, Tim On 9 Nov 2009, at 12:51, hmelchander wrote: Question 2: the default text of the menu items are in English. How do I change the text of the menu items to another language? Is there a simple way or do I have to implement it as described in http://blog.getintheloop.eu/2009/7/26/how-to-extensive-localization-with-the-liftweb-framework? --~--~-~--~~~---~--~~ 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: SiteMap: how to change order and text of menu items
Thanks for your answer Tim, and yes, I do believe that your description is straightforward. But I was wondering if there is a really easy way to change the text of the Loc's that are generated by User.sitemap; perhaps by manipulating the User object (MetaMegaProtoUser actually)? I have studied the documentation for MetaMegaProtoUser but can't figure out how to change the text or order of the generated Loc's. Best regards, Henrik On Nov 9, 2:41 pm, Timothy Perrett timo...@getintheloop.eu wrote: Ooo, thats my blog :-) What is it you dont feel to be straight forward in what I described? You will need to use a locale calculator at the very least, because otherwise Lift has no way of knowing what language is being requested. Cheers, Tim On 9 Nov 2009, at 12:51, hmelchander wrote: Question 2: the default text of the menu items are in English. How do I change the text of the menu items to another language? Is there a simple way or do I have to implement it as described in http://blog.getintheloop.eu/2009/7/26/how-to-extensive-localization-w... --~--~-~--~~~---~--~~ 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: CometActor and render
On Sun, Nov 8, 2009 at 11:28 PM, Jack Widman jack.wid...@gmail.com wrote: Thanks David. This is a big help. Can you tell me exactly how lowPriority, mediumPriorty and highPriority work? When are they called? When a message comes into the Actor's mailbox, the Actor determines if it can handle the message. CometActors have a set of messages they can (must) handle related to being a CometActor, but each CometActor is going to be customized, so it must be able to handle extra messages. The CometActor builds a PartialFunction to determine if it can handle messages by: val handler = highPriority orElse builtIn orElse mediumPriority orElse lowPriority The handler (built each time a message is tested or dispatched, so you can dynamically change the message handling) is tested against the message (isDefinedAt) and if it can handle the message, the message is removed from the mailbox and dispatched (apply). If the message cannot be dispatched, the next message in the mailbox is tested and so on until there are no more messages that can be dispatched. On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Jack, I reproduced your code and it seems to work fine. I've enclosed a working copy. Some comments about your code: - The foos variable and the foo variable may be getting confused in the code... the render method may be rendering the same thing based on the unchanging foos variable. - Doing null testing is a sign that you have logic errors in your code. I strongly recommend using either Box or Option for everything that can logically not contain a value/reference. If you're bridging out to Java code and are expecting null from the Java code, write a small bridge that will wrapper the Java return values in Box/Option. - You have a case class (Tick) that contains no parameters. Please use a case object instead. - Your Tick look is a spin loop. You fire a Tick message as part of processing the Tick message. I would suggest that if you're polling, that you have a reasonable poll interval, otherwise you'll starve your CPU. Further, having reRender on each loop through means that you're forcing a lot of bytes over the wire rather than only doing a reRender on changed values. Thanks, David On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.comwrote: Sorry. Here it is: As I said, I know that when render is called, foo.getValue has the right value. But it does not show on the screen, unless I refresh the browser. package com.foo.comet import net.liftweb._ import http._ import js._ import JsCmds._ import net.liftweb.util._ import net.liftweb.http._ import _root_.scala.xml._ import scala.actors._ import com.authoritude.snippet._ import scala.collection.mutable.Queue import net.liftweb.http.SessionVar class MyComet extends CometActor { override def defaultPrefix = Full(auth) private var foos = FooManager.getFoos def createDisplay(foos:List[Foo]):NodeSeq = { span id=gotable { for {foo - foos} yield trtd{foo.getValue}/td/tr } /table/span } def render = { bind(foo - createDisplay(foos)) } override def localSetup = { super.localSetup this ! Tick } var foo:Foo = null override def lowPriority = { case Tick = { foo=FooQueue.getLatest if (foo!=null foo.getValue -1) { blogs = FooManager.process(foo, foos) } else if (foo!=null){ foos = foos.remove((f:Foo)=(f.id==foo.id)) } reRender(false) this ! Tick } } } case class Tick On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett timo...@getintheloop.eu wrote: Without posting your code it's going to be tough to help you. Cheers, Tim Sent from my iPhone On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote: By the way, I know that when render is called, all the variables have the right values. I just don't see it on the screen unless I refresh it. On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote: I have a CometActor. render is called when it is supposed to be but I don't see the changes. If I refresh the page at anytime, I do see the changes. Any idea what might cause this? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group,
[Lift] Re: Is there a Order Map in the lift ?
scala.collection.SortedMap On Sun, Nov 8, 2009 at 11:59 PM, Neil.Lv anim...@gmail.com wrote: Hi all, Is there a Order Map in the lift ? Example: 1- xx, 2 - yy, 3 - zz 1:) add 1- xx Map(1- xx) 2:) add 3 - zz Map(3 - zz, 1- xx) 3:) add 2 - yy Map(2 - yy, 3 - zz, 1- xx) The result maybe: Map(2 - yy, 3 - zz, 1- xx) But i want the structure(order by the number) is : Map(1- xx, 2 - yy, 3 - zz) Any help would be much appreciated ! Cheers, Neil -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift jpa maven
On 6 stu, 06:50, Indrajit Raychaudhuri indraj...@gmail.com wrote: The archetypes needs some spit and polish. I'll take them up next week. Sorry for bothering but is there any news on when archetypes could be fixed? I would realy like to start (again) with lift + jpa. Cheers, Indrajit On 06/11/09 2:54 AM, David Pollak wrote: Hmmm... I am seeing the same thing. It appears that there's no archetype.xml file as part of the archetype JARs. Please file a ticket here:http://github.com/dpp/liftweb/issues We will add testing of the archetypes as part of the build process. On Thu, Nov 5, 2009 at 4:29 AM, ivan ivan.se...@gmail.com mailto:ivan.se...@gmail.com wrote: This is what I am trying to do: mvn -e archetype:create -U -DarchetypeGroupId=net.liftweb - DarchetypeArtifactId=lift-archetype-jpa-basic -DarchetypeVersion=1.1- scala2.7.7.RC2-SNAPSHOT -DremoteRepositories=http://scala-tools.org/ repo-snapshots http://scala-tools.org/%0Arepo-snapshots -DgroupId=hr.ivan.lift -DartifactId=lift-jpa-basic Ant this is what I'am getting: [ERROR] BUILD ERROR [INFO] [INFO] Error creating from archetype Embedded error: The META-INF/maven/archetype.xml descriptor cannot be found. Any ideas what could be the problem. I have tried with other versions and even some from repo-releases but can't get jpa-basic working. Thanks! -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Write javascript code in the Snippet ?
On Sat, Nov 7, 2009 at 10:24 PM, Neil.Lv anim...@gmail.com wrote: Hi all, Is there a easy way to write javascript code (dynamic for caculating flashvars )in the Snippet ? import net.liftweb._ import http._ import js._ import JsCmds._ import util._ import Helpers._ class MySnippet { def calcVars(in: NodeSeq): NodeSeq = head{ Script(JsRaw( var my_var = +(System.currentTimeMillis.toString.encJs)+; )) }/head } To write javascript code directly just like the raw js code and merge it into the head tag . Cheers, Neil -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Flash can't displayed in Firefox ?
Ah hah... xhtml strikes again. I think if you do LiftRules.useXhtmlMimeType = false in Boot.scala, things should work. On Sat, Nov 7, 2009 at 9:51 PM, Neil.Lv anim...@gmail.com wrote: It works well in the firefox, but not in IE. Result: swfobject.embedSWF(quot;/flash/test.swfquot;, quot;myContentquot;, quot;300quot;, quot;120quot;, quot;9.0.0quot;, quot;expressInstall.swfquot;); ### flash - Text(swfobject.embedSWF(/flash/test.swf, myContent, 300, 120, 9.0.0, expressInstall.swf);), ### It works well in Both of them. ### var flashSrc = /flash/test.swf flash - Text(swfobject.embedSWF(' + {flashSrc} + ', 'myContent', '300', '120', '9.0.0', 'expressInstall.swf');), ### Cheers, Neil On Nov 8, 1:25 pm, Neil.Lv anim...@gmail.com wrote: I use this code to achieve the purpose. Maybe there is some another better way to do it. ### lift:surround with=default at=content head script type=text/javascript src=/scripts/swfobject.js/script script type=text/javascript lift:HelloWorld.initFlash init:flash / /lift:HelloWorld.initFlash /script /head ### class HelloWorld { lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject the date def howdy(in: NodeSeq): NodeSeq = Helpers.bind(b, in, time - date.map(d = Text(d.toString))) var flashSrc = /flash/test.swf def initFlash(in: NodeSeq) : NodeSeq = { bind(init, in, flash - Text(swfobject.embedSWF({flashSrc}, myContent, 300, 120, 9.0.0, expressInstall.swf);) ) } } ### Cheers, Neil On Nov 8, 12:56 pm, Neil.Lv anim...@gmail.com wrote: Tim, How can i use the lift to generate the dynamic flashvars ? In the snippet ? In the rails we can use the %= % to get the value that from the server. Cheers, Neil On Nov 8, 12:48 pm, Neil.Lv anim...@gmail.com wrote: Thank you very much! This is very cool! :) Cheers, Neil On Nov 8, 2:52 am, Timothy Perrett timo...@getintheloop.eu wrote: Looks to me like a javascript issue - if your rendering flash, use swfobject: http://code.google.com/p/swfobject/ Cheers, Tim On 7 Nov 2009, at 18:49, Neil.Lv wrote: Hi all, I have a silly question about the embeded flash in the Firefox . The code like this (in the main/webapp/index.html page), and i added the /* ![CDATA[ */ in the script, It can show correctly in the IE browser, but it doesn't shown in the Firefox ? There is something wrong with it ? ### script type=text/javascript /* ![CDATA[ */ document.write('object classid= codebase= '); document.write('param name=movie value=/flash/focus.swf'); document.write('param name=quality value=highparam name=wmode value=opaque'); document.write('param name=FlashVars value=...'); document.write('embed src=/flash/focus.swf FlashVars= quality=high /'); document.write('/object'); /* ]] */ /script ### Thanks for any suggestion ! Cheers, Neil -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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] JsonResponse with non string values
Hello guys, I have the following code working ok: JsonResponse(JsObj(Op - 0,e - 0,id - newUser.id.toString)) The returned JSON message looks like the following: {Op: 5, e: 0, id:123455} I would like the message to be like this: {Op: 5, e: 0, id: 123455} If I write the line like this: JsonResponse(JsObj(Op - 0,e - 0,id - newUser.id) I receive a compilation error saying: found : Long required: net.liftweb.http.js.JsExp with net.liftweb.util.Bindable How can I return the long value without converting it to string? Thanks in advance, GA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JsonResponse with non string values
Bring the numToJsExp implicit into scope -- import net.liftweb.http.js.JE.numToJsExp -Ross On Nov 9, 2009, at 12:22 PM, GA wrote: Hello guys, I have the following code working ok: JsonResponse(JsObj(Op - 0,e - 0,id - newUser.id.toString)) The returned JSON message looks like the following: {Op: 5, e: 0, id:123455} I would like the message to be like this: {Op: 5, e: 0, id: 123455} If I write the line like this: JsonResponse(JsObj(Op - 0,e - 0,id - newUser.id) I receive a compilation error saying: found : Long required: net.liftweb.http.js.JsExp with net.liftweb.util.Bindable How can I return the long value without converting it to string? Thanks in advance, GA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JsonResponse with non string values
Thanks for the answer. This line does the trick: newUser.id.asJsExp . It returns a type net.liftweb.http.js.JE.numToJsExp. GA On Nov 9, 2009, at 6:31 PM, Ross Mellgren wrote: Bring the numToJsExp implicit into scope -- import net.liftweb.http.js.JE.numToJsExp -Ross On Nov 9, 2009, at 12:22 PM, GA wrote: Hello guys, I have the following code working ok: JsonResponse(JsObj(Op - 0,e - 0,id - newUser.id.toString)) The returned JSON message looks like the following: {Op: 5, e: 0, id:123455} I would like the message to be like this: {Op: 5, e: 0, id: 123455} If I write the line like this: JsonResponse(JsObj(Op - 0,e - 0,id - newUser.id) I receive a compilation error saying: found : Long required: net.liftweb.http.js.JsExp with net.liftweb.util.Bindable How can I return the long value without converting it to string? Thanks in advance, GA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Concatenate JsObj objects
Hello guys, is it possible to concatenate JsObj objects? Right now I have several JsonResponse calls depending on some conditions. I am building the responses including some error codes and different components. I would like to build the answer part by part and concatenate the pieces at the end of the method in only one call to JsonResponse. Here an example: JsonResponse(JsObj(a - 1, b-2)) Would it be possible to have something like: val response = JsObj(a - 1) val response1=JsObj(b - 2) then JsonResponse(JsObj(reponse ,response1)) A line exactly like this one gives a compilation error. I know I need to write it differently but I do not know how. Any suggestions? Thanks in advance, GA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Concatenate JsObj objects
var responses: List[(String, JsExp)] = Nil responses ::= a - 1 responses ::= b - 2 JsonResponse(JsObj(responses: _*)) If you really want to concatenate JsObj, you can do that too val response1 = JsObj(a - 1) val response2 = JsObj(b - 2) JsonResponse(response1 +* response2) -Ross On Nov 9, 2009, at 1:19 PM, GA wrote: Hello guys, is it possible to concatenate JsObj objects? Right now I have several JsonResponse calls depending on some conditions. I am building the responses including some error codes and different components. I would like to build the answer part by part and concatenate the pieces at the end of the method in only one call to JsonResponse. Here an example: JsonResponse(JsObj(a - 1, b-2)) Would it be possible to have something like: val response = JsObj(a - 1) val response1=JsObj(b - 2) then JsonResponse(JsObj(reponse ,response1)) A line exactly like this one gives a compilation error. I know I need to write it differently but I do not know how. Any suggestions? Thanks in advance, GA --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: ajax-loader not showing?
Is this in M7? It wasn't mentioned in the release notes, and I'm not sure I'm seeing it working... Chris On Nov 2, 6:20 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Fixed On Sat, Oct 31, 2009 at 9:04 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: David Pollak feeder.of.the.be...@gmail.com writes: It's a bug. Please file a ticket. Done.http://github.com/dpp/liftweb/issues/#issue/152 /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How quick is webdev with Lift?
Even without JRebel the cycle isn't that bad, especially if you don't need to alter Snippets. Often I'm only tweaking the xhtml, in which case I don't even have to restart the server. Chris On Nov 8, 11:43 pm, harryh har...@gmail.com wrote: I use JRebel and SBT (http://code.google.com/p/simple-build-tool/) and very rarely have to restart my server when doing development. It's a very quick dev-cycle. No big tips really. I save the code and reload the page and see the results of my work. -harryh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Lift for a backend REST Server
Hi, I'm curious what your thoughts are on using LIFT to implement a backend server for REST web services, e.g. respond to GET/PUT/POST/ DELETE requests with xml/json. Is this a good use of Lift? What are the advantages of doing this with Lift rather than just Jetty, or another library such as Restlets. Thanks! - Alex --~--~-~--~~~---~--~~ 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] Whitespace removal from XML
Not scrictly a Lift question, but does anyone have a library they like (or is there something in scalalib I'm not aware of) that will remove whitespace from XML? foo barhello world/bar /foo to: foobarhello world/bar/foo -harryh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift for a backend REST Server
there are several advantages. 1: you get to leverage type safety and the excellent XML support of Scala, and lift-json. 2: assuming it's not a open for all public REST server, you'd have to deal with security/auth. Lift will help here. 3: In the past, every time I've done a backend REST server project, soon or later, you end up going you know, I wish I can throw together a couple of simple backend admin pages. Lift makes that easy. On Mon, Nov 9, 2009 at 4:04 PM, Alex Black a...@alexblack.ca wrote: Hi, I'm curious what your thoughts are on using LIFT to implement a backend server for REST web services, e.g. respond to GET/PUT/POST/ DELETE requests with xml/json. Is this a good use of Lift? What are the advantages of doing this with Lift rather than just Jetty, or another library such as Restlets. Thanks! - Alex -- Omnem crede diem tibi diluxisse supremum. --~--~-~--~~~---~--~~ 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: Whitespace removal from XML
Answering my own question, I wrote this. I think it should do what I want: def compactXml(node: Node): Node = node match { case Elem(p, l, a, s, children @ _*) = Elem(p, l, a, s, children.map (compactXml(_)) :_*) case Text(data) = Text(data.trim) case x = x } -harryh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift for a backend REST Server
This is why Lift usually wins out in my decision making - its just a very well rounded tool and yes, its great for these kinds of task. I would also like to point out that if you wanted to mix Akka and Lift for the best of both worlds, then you can do that too. Rock on. Cheers, Tim On 9 Nov 2009, at 21:09, Wilson MacGyver wrote: there are several advantages. 1: you get to leverage type safety and the excellent XML support of Scala, and lift-json. 2: assuming it's not a open for all public REST server, you'd have to deal with security/auth. Lift will help here. 3: In the past, every time I've done a backend REST server project, soon or later, you end up going you know, I wish I can throw together a couple of simple backend admin pages. Lift makes that easy. --~--~-~--~~~---~--~~ 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: Whitespace removal from XML
Also see trimProper in http://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_7_7_final/src/library/scala/xml/Utility.scala?view=markup --Bryan On Mon, Nov 9, 2009 at 5:47 PM, harryh har...@gmail.com wrote: Answering my own question, I wrote this. I think it should do what I want: def compactXml(node: Node): Node = node match { case Elem(p, l, a, s, children @ _*) = Elem(p, l, a, s, children.map (compactXml(_)) :_*) case Text(data) = Text(data.trim) case x = x } -harryh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Pretty Printed Output?
How hard would this be to implement? I'm a big fan of pretty HTML output, so I'd be interested in implementing this if it's not too hard. Peter Robinett On Nov 7, 7:06 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Sat, Nov 7, 2009 at 1:01 AM, aw anth...@whitford.com wrote: Is there a mode whereby I can turn on pretty printed output for my xhtml? (I'm thinking of a LiftRule, I think?). Preferably, I'd also like to control some details like indentation size. No mode for that... sorry. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] How do you set disabled/readonly attributes from a snippet?
I found this answer on nabblehttp://old.nabble.com/How-to-disable-a-textfield-td25969916.htmlbut it's regarding setting the values client side. I want to set them in the snippet, depending on data. This doesn't work, but will give you a better idea of what I'm trying to do: def bindPerson(xhtml: NodeSeq, action: () = Unit, submitButtonName: String, disableAll: boolean): NodeSeq = { // Hold a val here so that the id closure holds it when we re-enter this method val currentId = person.id val disableString :String = disableAll match { case true = disabled case false = } bind(person, xhtml, id - SHtml.hidden(() = person.id = currentId), // version - SHtml.hidden(() = person.version), firstName - SHtml.text(person.firstName, person.firstName = _, id - firstName, disabled - disableString), middleName - SHtml.text(person.middleName, person.middleName = _, id - middleName, disabled - disableString), lastName - SHtml.text(person.lastName, person.lastName = _, id - lastName, disabled - disableString), submit - SHtml.submit(?(submitButtonName), action)) } -- James A Barrows --~--~-~--~~~---~--~~ 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: Pretty Printed Output?
I would imagine it would consist of recursively iterating over xml elements, with the recursive function taking an indent level argument and passing it to iself incremented; and in each iteration returning the input with spaces added before each element in propertion to the indent level, and newlines after each element. The function can either return a modified NodeSeq or a String. It should accept a NodeSeq and pattern match on it, performing the above behavior for Elems, skipping input whitespace, and expanding Groups. - Peter Robinettpe...@bubblefoundry.com wrote: How hard would this be to implement? I'm a big fan of pretty HTML output, so I'd be interested in implementing this if it's not too hard. Peter Robinett On Nov 7, 7:06 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Sat, Nov 7, 2009 at 1:01 AM, aw anth...@whitford.com wrote: Is there a mode whereby I can turn on pretty printed output for my xhtml? (I'm thinking of a LiftRule, I think?). Preferably, I'd also like to control some details like indentation size. No mode for that... sorry. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Unit Test Error
Hi, I have set the unitils properties for h2 database. I am getting the following error message for the unit test. Can anyone tell me what am I missing? Thanks. Sunanda java.lang.NullPointerException: Looking for Connection Identifier ConnectionIdentifier(lift) but failed to find either a JNDI data source with the name lift or a lift connection manager with the correct name at net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$7.apply(DB.scala: 95) at net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$7.apply(DB.scala: 95) at net.liftweb.util.EmptyBox.openOr(Box.scala:372) at net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:95) at net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:95) at net.liftweb.util.EmptyBox.openOr(Box.scala:372) at net.liftweb.mapper.DB$.newConnection(DB.scala:89) at net.liftweb.mapper.DB$.getConnection(DB.scala:136) at net.liftweb.mapper.DB$.use(DB.scala:303) at net.liftweb.mapper.KeyedMetaMapper$class.findDb(MetaMapper.scala: 1397) at net.irisinteractive.brandnet.gridxml.model.GridConfig$.findDb (GridConfig.scala:69) at net.liftweb.mapper.KeyedMetaMapper$class.findDb(MetaMapper.scala: 1393) at net.irisinteractive.brandnet.gridxml.model.GridConfig$.findDb (GridConfig.scala:69) at net.liftweb.mapper.KeyedMetaMapper$class.find(MetaMapper.scala: 1390) at net.irisinteractive.brandnet.gridxml.model.GridConfig$.find (GridConfig.scala:69) at net.irisinteractive.brandnet.gridxml.snippet.GridConfigRegistry.getGridConfiguration (GridConfigRegistry.scala:20) at net.irisinteractive.brandnet.gridxml.test.GridXmlComputationService.getGridXml (GridXmlComputationService.scala:28) at net.irisinteractive.brandnet.gridxml.test.TestGridConfig.test1 (TestGridConfig.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66) at org.junit.internal.runners.MethodRoadie.runTestMethod (MethodRoadie.java:105) at org.unitils.UnitilsJUnit4TestClassRunner $TestListenerInvokingMethodRoadie.runTestMethod (UnitilsJUnit4TestClassRunner.java:174) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java: 86) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters (MethodRoadie.java:94) at org.unitils.UnitilsJUnit4TestClassRunner $TestListenerInvokingMethodRoadie.runBeforesThenTestThenAfters (UnitilsJUnit4TestClassRunner.java:156) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java: 84) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49) at org.unitils.UnitilsJUnit4TestClassRunner.invokeTestMethod (UnitilsJUnit4TestClassRunner.java:95) at org.junit.internal.runners.JUnit4ClassRunner.runMethods (JUnit4ClassRunner.java:59) at org.unitils.UnitilsJUnit4TestClassRunner.access$000 (UnitilsJUnit4TestClassRunner.java:44) at org.unitils.UnitilsJUnit4TestClassRunner$1.run (UnitilsJUnit4TestClassRunner.java:62) at org.junit.internal.runners.ClassRoadie.runUnprotected (ClassRoadie.java:34) at org.junit.internal.runners.ClassRoadie.runProtected (ClassRoadie.java:44) at org.unitils.UnitilsJUnit4TestClassRunner.run (UnitilsJUnit4TestClassRunner.java:68) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift for a backend REST Server
Thanks for the info guys - going to go ahead with Lift! On Nov 9, 5:51 pm, Timothy Perrett timo...@getintheloop.eu wrote: This is why Lift usually wins out in my decision making - its just a very well rounded tool and yes, its great for these kinds of task. I would also like to point out that if you wanted to mix Akka and Lift for the best of both worlds, then you can do that too. Rock on. Cheers, Tim On 9 Nov 2009, at 21:09, Wilson MacGyver wrote: there are several advantages. 1: you get to leverage type safety and the excellent XML support of Scala, and lift-json. 2: assuming it's not a open for all public REST server, you'd have to deal with security/auth. Lift will help here. 3: In the past, every time I've done a backend REST server project, soon or later, you end up going you know, I wish I can throw together a couple of simple backend admin pages. Lift makes that easy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How do you set disabled/readonly attributes from a snippet?
Use None (Option) or Empty (Box) as the value of the attribute -- this will cause the pairToUnprefixed implicit that is being used inside SHtml to not generate an attribute. e.g.: val disableAttr: Box[String] = if (disableAll) Full(disabled) else Empty bind(person, xhtml, ... firstName - SHtml.text(person.firstName, person.firstName = _, id - firstName, disabled - disableAttr), ...) -Ross On Nov 9, 2009, at 6:51 PM, Jim Barrows wrote: I found this answer on nabble but it's regarding setting the values client side. I want to set them in the snippet, depending on data. This doesn't work, but will give you a better idea of what I'm trying to do: def bindPerson(xhtml: NodeSeq, action: () = Unit, submitButtonName: String, disableAll: boolean): NodeSeq = { // Hold a val here so that the id closure holds it when we re- enter this method val currentId = person.id val disableString :String = disableAll match { case true = disabled case false = } bind(person, xhtml, id - SHtml.hidden(() = person.id = currentId), // version - SHtml.hidden(() = person.version), firstName - SHtml.text(person.firstName, person.firstName = _, id - firstName, disabled - disableString), middleName - SHtml.text(person.middleName, person.middleName = _, id - middleName, disabled - disableString), lastName - SHtml.text(person.lastName, person.lastName = _, id - lastName, disabled - disableString), submit - SHtml.submit(?(submitButtonName), action)) } -- James A Barrows --~--~-~--~~~---~--~~ 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: About the localization with lift:loc !
Tim, You can browse to http://219.94.110.243 for the test site running on Ubuntu Server 9.10. There is a down-loadable test project which you can test out. Before this discussion thread on UTF-8 or ISO8859-1, 1. localization is running great on windows+maven2.2.1+liftweb1.1-M7 2. lift:loc locid=/ yet to work for both platform 3. on linux, even S.??() not working at all. Cheers, yk On Sat, Nov 7, 2009 at 8:29 PM, Timothy Perrett timo...@getintheloop.euwrote: You should always be working with UTF-8 files for properties / localisation - I think the encoding reported by jetty is something different (that it reads from the system)... ensure your props files are UTF-8 and go from there. Cheers, Tim On Nov 7, 12:48 am, yk ying.kwang...@gmail.com wrote: Hi Tim, I've developed n tested localization on windows and it worked perfectly. however, localization of the same project placed on ubuntu server 9.10 did not. WinXP --- jdk1.6 maven 2.2.1 lifeweb 1.1-M7 encoding=cp1252 (as reported by mvn jetty:run) Ubuntu 9.10 server --- openjdk OR sun-jdk6 maven 2.2.1 liftweb 1.1-M7 encoding=UTF-8 (as reported by mvn jetty:run) I can't quite point my finger on why it worked on windows but not on linux. Do i have to convert all files that need to be deployed to UTF-8 encoding? Thank you in advance. Cheers, yk On Oct 26, 9:12 pm, Timothy Perrett timo...@getintheloop.eu wrote: The browser already knows the locale, you have it backward! Your localeCalculator is so that the browser can get lift to return the right content. Take a look at: http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/. .. I would start with just getting lift to explicitly set locale based on a query string or something... it will help you understand how the mechanism works. Cheers, Tim On 26 Oct 2009, at 12:34, Neil.Lv wrote: ... Where is the locale to be set that the browser can know the locale ? Thanks very much! Cheers, Neil On Oct 26, 7:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: setLocale was a method created by me, specific to my application - it does not exist in Lift... hence why I removed it in my simplified example. Cheers, Tim On 26 Oct 2009, at 11:45, Neil.Lv wrote: I have a silly question , where is the setLocale method ? I don't know where the package located. src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found: value setLocale setLocale(selectedLocale) :) Cheers, Neil On Oct 26, 5:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: Yes, your template code is right - your just seeing the default value because you have not told lift what resources to use when it gets the locale header from the browser. tryo() is like try/catch however, it will catch exceptions and returns Box[T] I would really suggest starting with something a lot simpler than the one i detailed that uses cookies and all sorts. Perhaps something like: def localeCalculator(request : Box[HTTPRequest]): Locale = request.flatMap(r = { tryo(r.locale) match { // your match here } }).openOr(java.util.Locale.getDefault()) Hope that helps Cheers, Tim On 26 Oct 2009, at 09:21, Neil.Lv wrote: lift:loc locid=loginLog in 222/lift:loc That means this code is correctly, the problem is that the browser doesn't know the locale? So we need to calculate the locale in the Boot.scala file ? Cheers, Neil On Oct 26, 5:09 pm, Neil.Lv anim...@gmail.com wrote: tryo(r.getParameter(locale)) match { case Full(null) = workOutLocale case Empty = workOutLocale case Failure(_,_,_) = workOutLocale case Full(selectedLocale) = { setLocale(selectedLocale) selectedLocale } } In this code , what's the tryo ? is try ? tryo () match {} What's the changes about the HTTP container providers? Thanks very much! Cheers, Neil On Oct 26, 4:44 pm, Timothy Perrett timo...@getintheloop.eu wrote: Hmm - you posted a link to my article at the begining of this thread; in that article I explain lifts locale calculator. Without this, Lift has no idea how you want to handle different locales. By default, the following is used: var localeCalculator: Box[HTTPRequest] = Locale = defaultLocaleCalculator _ def defaultLocaleCalculator(request: Box[HTTPRequest]) = request.flatMap(_.locale).openOr(Locale.getDefault()) As you can see, that will get only the locale of your JVM, not the browser. You will need to write the appropriate locale calculator; the one in my article is
[Lift] Unit testing a RESTful webservice with Lift
Can anyone suggest some good examples or strategies to use to test a webservice written with Lift? I've started down the path of firing up Jetty in a unit test, then just hitting it with say a GET and checking the response. Whats a good way of firing up Jetty? It looks like using ServletTester would be the way to go: http://www.christianschenk.org/blog/testing-web-applications-with-jetty/ could that work with Lift? - Alex --~--~-~--~~~---~--~~ 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] 503 for url: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Hi, I'm attempting to write a basic unit test for a webservice I'm implementing in Lift, by test looks like this: val foo = XML.load(http://localhost:8080;) I'm getting an exception I assume because the XML parser is trying to download the DTD and is getting denied. Whats the best way to work around this? - Alex --~--~-~--~~~---~--~~ 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: 503 for url: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Exception: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd at sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1313) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity (XMLEntityManager.java:677) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity (XMLEntityManager.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity (XMLEntityManager.java:1282) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource (XMLDTDScannerImpl.java:283) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.next(XMLDocumentScannerImpl.java:1090) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $PrologDriver.next(XMLDocumentScannerImpl.java:1003) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML (NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.load(XML.scala:72) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:16) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:14) at com.snapsort.common.Using$.apply(Using.scala:12) at com.snapsort.dataServer.api.ServerTest.testBasic(ServerTest.scala: 14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run (JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) On Nov 9, 9:43 pm, Alex Black a...@alexblack.ca wrote: Hi, I'm attempting to write a basic unit test for a webservice I'm implementing in Lift, by test looks like this: val foo = XML.load(http://localhost:8080;) I'm getting an exception I assume because the XML parser is trying to download the DTD and is getting denied. Whats the best way to work around this? - Alex --~--~-~--~~~---~--~~ 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: 503 for url: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Don't know but it's been asked so you should be able to search for it; I'm not sure whether on this list or scala-user or both. - Alex Blacka...@alexblack.ca wrote: Exception: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd at sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1313) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity (XMLEntityManager.java:677) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity (XMLEntityManager.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity (XMLEntityManager.java:1282) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource (XMLDTDScannerImpl.java:283) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.next(XMLDocumentScannerImpl.java:1090) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $PrologDriver.next(XMLDocumentScannerImpl.java:1003) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML (NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.load(XML.scala:72) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:16) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:14) at com.snapsort.common.Using$.apply(Using.scala:12) at com.snapsort.dataServer.api.ServerTest.testBasic(ServerTest.scala: 14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run (JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) On Nov 9, 9:43 pm, Alex Black a...@alexblack.ca wrote: Hi, I'm attempting to write a basic unit test for a webservice I'm implementing in Lift, by test looks like this: val foo = XML.load(http://localhost:8080;) I'm getting an exception I assume because the XML parser is trying to download the DTD and is getting denied. Whats the best way to work around this? - Alex --~--~-~--~~~---~--~~ 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: 503 for url: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
I read these two: http://old.nabble.com/Exception-loading-XML-with-DTD-td25213294.html http://stackoverflow.com/questions/1096285/is-scala-java-not-respecting-w3-excess-dtd-traffic-specs Not sure what the answer is, some ugly work arounds are presented... Presumably Lift's XML output *should* work with XML.Load? - Alex On Nov 9, 10:01 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Don't know but it's been asked so you should be able to search for it; I'm not sure whether on this list or scala-user or both. - Alex Blacka...@alexblack.ca wrote: Exception: java.io.IOException: Server returned HTTP response code: 503 for URL:http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd at sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1313) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity (XMLEntityManager.java:677) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity (XMLEntityManager.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity (XMLEntityManager.java:1282) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource (XMLDTDScannerImpl.java:283) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.next(XMLDocumentScannerImpl.java:1090) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $PrologDriver.next(XMLDocumentScannerImpl.java:1003) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML (NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.load(XML.scala:72) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:16) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:14) at com.snapsort.common.Using$.apply(Using.scala:12) at com.snapsort.dataServer.api.ServerTest.testBasic(ServerTest.scala: 14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run (JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) On Nov 9, 9:43 pm, Alex Black a...@alexblack.ca wrote: Hi, I'm attempting to write a basic unit test for a webservice I'm implementing in Lift, by test looks like this: val foo = XML.load(http://localhost:8080;) I'm getting an exception I assume because the XML parser is trying to download the DTD and is
[Lift] Re: Unit testing a RESTful webservice with Lift
We fire up Jetty populate a temp database and then run a batch of tests. Seems to work well for us. Jono 2009/11/10 Alex Black a...@alexblack.ca Can anyone suggest some good examples or strategies to use to test a webservice written with Lift? I've started down the path of firing up Jetty in a unit test, then just hitting it with say a GET and checking the response. Whats a good way of firing up Jetty? It looks like using ServletTester would be the way to go: http://www.christianschenk.org/blog/testing-web-applications-with-jetty/ could that work with Lift? - Alex --~--~-~--~~~---~--~~ 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: About the localization with lift:loc !
By adding a println line in my localeCalculator churned the following output: en_US en_us en_us en_us en_us INFO - Service request (GET) / took 53 Milliseconds en_us ms_my ms_my ms_my ms_my INFO - Service request (GET) / took 37 Milliseconds ms_my th_th th_th th_th th_th INFO - Service request (GET) / took 37 Milliseconds It almost seems like it is java.util.Locale... Mysteriously, adding symlinks helps. For e.g. lift-core_en_us.properties - lift-core_en_US.properties On Tue, Nov 10, 2009 at 9:58 AM, YING-KWANG TU ying.kwang...@gmail.comwrote: Tim, You can browse to http://219.94.110.243 for the test site running on Ubuntu Server 9.10. There is a down-loadable test project which you can test out. Before this discussion thread on UTF-8 or ISO8859-1, 1. localization is running great on windows+maven2.2.1+liftweb1.1-M7 2. lift:loc locid=/ yet to work for both platform 3. on linux, even S.??() not working at all. Cheers, yk On Sat, Nov 7, 2009 at 8:29 PM, Timothy Perrett timo...@getintheloop.euwrote: You should always be working with UTF-8 files for properties / localisation - I think the encoding reported by jetty is something different (that it reads from the system)... ensure your props files are UTF-8 and go from there. Cheers, Tim On Nov 7, 12:48 am, yk ying.kwang...@gmail.com wrote: Hi Tim, I've developed n tested localization on windows and it worked perfectly. however, localization of the same project placed on ubuntu server 9.10 did not. WinXP --- jdk1.6 maven 2.2.1 lifeweb 1.1-M7 encoding=cp1252 (as reported by mvn jetty:run) Ubuntu 9.10 server --- openjdk OR sun-jdk6 maven 2.2.1 liftweb 1.1-M7 encoding=UTF-8 (as reported by mvn jetty:run) I can't quite point my finger on why it worked on windows but not on linux. Do i have to convert all files that need to be deployed to UTF-8 encoding? Thank you in advance. Cheers, yk On Oct 26, 9:12 pm, Timothy Perrett timo...@getintheloop.eu wrote: The browser already knows the locale, you have it backward! Your localeCalculator is so that the browser can get lift to return the right content. Take a look at: http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/. .. I would start with just getting lift to explicitly set locale based on a query string or something... it will help you understand how the mechanism works. Cheers, Tim On 26 Oct 2009, at 12:34, Neil.Lv wrote: ... Where is the locale to be set that the browser can know the locale ? Thanks very much! Cheers, Neil On Oct 26, 7:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: setLocale was a method created by me, specific to my application - it does not exist in Lift... hence why I removed it in my simplified example. Cheers, Tim On 26 Oct 2009, at 11:45, Neil.Lv wrote: I have a silly question , where is the setLocale method ? I don't know where the package located. src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found: value setLocale setLocale(selectedLocale) :) Cheers, Neil On Oct 26, 5:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: Yes, your template code is right - your just seeing the default value because you have not told lift what resources to use when it gets the locale header from the browser. tryo() is like try/catch however, it will catch exceptions and returns Box[T] I would really suggest starting with something a lot simpler than the one i detailed that uses cookies and all sorts. Perhaps something like: def localeCalculator(request : Box[HTTPRequest]): Locale = request.flatMap(r = { tryo(r.locale) match { // your match here } }).openOr(java.util.Locale.getDefault()) Hope that helps Cheers, Tim On 26 Oct 2009, at 09:21, Neil.Lv wrote: lift:loc locid=loginLog in 222/lift:loc That means this code is correctly, the problem is that the browser doesn't know the locale? So we need to calculate the locale in the Boot.scala file ? Cheers, Neil On Oct 26, 5:09 pm, Neil.Lv anim...@gmail.com wrote: tryo(r.getParameter(locale)) match { case Full(null) = workOutLocale case Empty = workOutLocale case Failure(_,_,_) = workOutLocale case Full(selectedLocale) = { setLocale(selectedLocale) selectedLocale } } In this code , what's the tryo ? is try ? tryo () match {} What's the changes about the HTTP container providers? Thanks very much! Cheers, Neil On Oct 26, 4:44 pm, Timothy Perrett timo...@getintheloop.eu wrote: Hmm - you posted a link to my article at the begining of this thread; in
[Lift] Where did Mapper's MappedManyToMany go?
I can see it herehttp://github.com/dpp/liftweb/blob/1.1-M7/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/ManyToMany.scalain the 1.1M7 code base, but can't find it in the jar that Maven downloaded. The trait is there, but the Mapped version is missing. The same for MappedOneToMany as well. -- James A Barrows --~--~-~--~~~---~--~~ 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: Where did Mapper's MappedManyToMany go?
MappedManyToMany is defined in the ManyToMay trait, which your mapper should extend. - Jim Barrowsjim.barr...@gmail.com wrote: I can see it herehttp://github.com/dpp/liftweb/blob/1.1-M7/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/ManyToMany.scalain the 1.1M7 code base, but can't find it in the jar that Maven downloaded. The trait is there, but the Mapped version is missing. The same for MappedOneToMany as well. -- James A Barrows --~--~-~--~~~---~--~~ 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: About the localization with lift:loc !
Maybe it's a bug with lift:loc locid=/ It's so confused. Cheers, Neil On Nov 10, 12:11 pm, YING-KWANG TU ying.kwang...@gmail.com wrote: By adding a println line in my localeCalculator churned the following output: en_US en_us en_us en_us en_us INFO - Service request (GET) / took 53 Milliseconds en_us ms_my ms_my ms_my ms_my INFO - Service request (GET) / took 37 Milliseconds ms_my th_th th_th th_th th_th INFO - Service request (GET) / took 37 Milliseconds It almost seems like it is java.util.Locale... Mysteriously, adding symlinks helps. For e.g. lift-core_en_us.properties - lift-core_en_US.properties On Tue, Nov 10, 2009 at 9:58 AM, YING-KWANG TU ying.kwang...@gmail.comwrote: Tim, You can browse tohttp://219.94.110.243for the test site running on Ubuntu Server 9.10. There is a down-loadable test project which you can test out. Before this discussion thread on UTF-8 or ISO8859-1, 1. localization is running great on windows+maven2.2.1+liftweb1.1-M7 2. lift:loc locid=/ yet to work for both platform 3. on linux, even S.??() not working at all. Cheers, yk On Sat, Nov 7, 2009 at 8:29 PM, Timothy Perrett timo...@getintheloop.euwrote: You should always be working with UTF-8 files for properties / localisation - I think the encoding reported by jetty is something different (that it reads from the system)... ensure your props files are UTF-8 and go from there. Cheers, Tim On Nov 7, 12:48 am, yk ying.kwang...@gmail.com wrote: Hi Tim, I've developed n tested localization on windows and it worked perfectly. however, localization of the same project placed on ubuntu server 9.10 did not. WinXP --- jdk1.6 maven 2.2.1 lifeweb 1.1-M7 encoding=cp1252 (as reported by mvn jetty:run) Ubuntu 9.10 server --- openjdk OR sun-jdk6 maven 2.2.1 liftweb 1.1-M7 encoding=UTF-8 (as reported by mvn jetty:run) I can't quite point my finger on why it worked on windows but not on linux. Do i have to convert all files that need to be deployed to UTF-8 encoding? Thank you in advance. Cheers, yk On Oct 26, 9:12 pm, Timothy Perrett timo...@getintheloop.eu wrote: The browser already knows the locale, you have it backward! Your localeCalculator is so that the browser can get lift to return the right content. Take a look at: http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/. .. I would start with just getting lift to explicitly set locale based on a query string or something... it will help you understand how the mechanism works. Cheers, Tim On 26 Oct 2009, at 12:34, Neil.Lv wrote: ... Where is the locale to be set that the browser can know the locale ? Thanks very much! Cheers, Neil On Oct 26, 7:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: setLocale was a method created by me, specific to my application - it does not exist in Lift... hence why I removed it in my simplified example. Cheers, Tim On 26 Oct 2009, at 11:45, Neil.Lv wrote: I have a silly question , where is the setLocale method ? I don't know where the package located. src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found: value setLocale setLocale(selectedLocale) :) Cheers, Neil On Oct 26, 5:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: Yes, your template code is right - your just seeing the default value because you have not told lift what resources to use when it gets the locale header from the browser. tryo() is like try/catch however, it will catch exceptions and returns Box[T] I would really suggest starting with something a lot simpler than the one i detailed that uses cookies and all sorts. Perhaps something like: def localeCalculator(request : Box[HTTPRequest]): Locale = request.flatMap(r = { tryo(r.locale) match { // your match here } }).openOr(java.util.Locale.getDefault()) Hope that helps Cheers, Tim On 26 Oct 2009, at 09:21, Neil.Lv wrote: lift:loc locid=loginLog in 222/lift:loc That means this code is correctly, the problem is that the browser doesn't know the locale? So we need to calculate the locale in the Boot.scala file ? Cheers, Neil On Oct 26, 5:09 pm, Neil.Lv anim...@gmail.com wrote: tryo(r.getParameter(locale)) match { case Full(null) = workOutLocale case Empty = workOutLocale case Failure(_,_,_) = workOutLocale case Full(selectedLocale) = { setLocale(selectedLocale) selectedLocale } } In this code , what's the tryo ? is try ? tryo () match {} What's the changes about
[Lift] Re: CometActor and render
The only difference between your working code and mine is that mine has a process in the background that is always running and puts Foo objects on a queue whenever they are ready. Where can I start this long running process so that it doesn't interfere with the lowPriority method that takes things off the queue and rerenders the page. I tried starting the process in its own Actor that I start in localSetup but it seems somehow to be blocking the lowPriority method from doing its thing. On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Jack, I reproduced your code and it seems to work fine. I've enclosed a working copy. Some comments about your code: - The foos variable and the foo variable may be getting confused in the code... the render method may be rendering the same thing based on the unchanging foos variable. - Doing null testing is a sign that you have logic errors in your code. I strongly recommend using either Box or Option for everything that can logically not contain a value/reference. If you're bridging out to Java code and are expecting null from the Java code, write a small bridge that will wrapper the Java return values in Box/Option. - You have a case class (Tick) that contains no parameters. Please use a case object instead. - Your Tick look is a spin loop. You fire a Tick message as part of processing the Tick message. I would suggest that if you're polling, that you have a reasonable poll interval, otherwise you'll starve your CPU. Further, having reRender on each loop through means that you're forcing a lot of bytes over the wire rather than only doing a reRender on changed values. Thanks, David On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.com wrote: Sorry. Here it is: As I said, I know that when render is called, foo.getValue has the right value. But it does not show on the screen, unless I refresh the browser. package com.foo.comet import net.liftweb._ import http._ import js._ import JsCmds._ import net.liftweb.util._ import net.liftweb.http._ import _root_.scala.xml._ import scala.actors._ import com.authoritude.snippet._ import scala.collection.mutable.Queue import net.liftweb.http.SessionVar class MyComet extends CometActor { override def defaultPrefix = Full(auth) private var foos = FooManager.getFoos def createDisplay(foos:List[Foo]):NodeSeq = { span id=gotable { for {foo - foos} yield trtd{foo.getValue}/td/tr } /table/span } def render = { bind(foo - createDisplay(foos)) } override def localSetup = { super.localSetup this ! Tick } var foo:Foo = null override def lowPriority = { case Tick = { foo=FooQueue.getLatest if (foo!=null foo.getValue -1) { blogs = FooManager.process(foo, foos) } else if (foo!=null){ foos = foos.remove((f:Foo)=(f.id==foo.id)) } reRender(false) this ! Tick } } } case class Tick On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett timo...@getintheloop.euwrote: Without posting your code it's going to be tough to help you. Cheers, Tim Sent from my iPhone On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote: By the way, I know that when render is called, all the variables have the right values. I just don't see it on the screen unless I refresh it. On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote: I have a CometActor. render is called when it is supposed to be but I don't see the changes. If I refresh the page at anytime, I do see the changes. Any idea what might cause this? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 --~--~-~--~~~---~--~~ 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: ajax-loader not showing?
It's in M7. If you created your code from an archetype prior to M7, you have to manually put the spinning gif into your /images directory On Mon, Nov 9, 2009 at 11:57 AM, CodeSlave9000 ccebelen...@gmail.comwrote: Is this in M7? It wasn't mentioned in the release notes, and I'm not sure I'm seeing it working... Chris On Nov 2, 6:20 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Fixed On Sat, Oct 31, 2009 at 9:04 AM, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: David Pollak feeder.of.the.be...@gmail.com writes: It's a bug. Please file a ticket. Done.http://github.com/dpp/liftweb/issues/#issue/152 /Jeppe -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: CometActor and render
On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.com wrote: The only difference between your working code and mine is that mine has a process in the background that is always running and puts Foo objects on a queue whenever they are ready. Where can I start this long running process so that it doesn't interfere with the lowPriority method that takes things off the queue and rerenders the page. I tried starting the process in its own Actor that I start in localSetup but it seems somehow to be blocking the lowPriority method from doing its thing. I have no idea what this means... sorry. Please post actual runnable code and we can help you debug. On Sun, Nov 8, 2009 at 11:35 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Jack, I reproduced your code and it seems to work fine. I've enclosed a working copy. Some comments about your code: - The foos variable and the foo variable may be getting confused in the code... the render method may be rendering the same thing based on the unchanging foos variable. - Doing null testing is a sign that you have logic errors in your code. I strongly recommend using either Box or Option for everything that can logically not contain a value/reference. If you're bridging out to Java code and are expecting null from the Java code, write a small bridge that will wrapper the Java return values in Box/Option. - You have a case class (Tick) that contains no parameters. Please use a case object instead. - Your Tick look is a spin loop. You fire a Tick message as part of processing the Tick message. I would suggest that if you're polling, that you have a reasonable poll interval, otherwise you'll starve your CPU. Further, having reRender on each loop through means that you're forcing a lot of bytes over the wire rather than only doing a reRender on changed values. Thanks, David On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.comwrote: Sorry. Here it is: As I said, I know that when render is called, foo.getValue has the right value. But it does not show on the screen, unless I refresh the browser. package com.foo.comet import net.liftweb._ import http._ import js._ import JsCmds._ import net.liftweb.util._ import net.liftweb.http._ import _root_.scala.xml._ import scala.actors._ import com.authoritude.snippet._ import scala.collection.mutable.Queue import net.liftweb.http.SessionVar class MyComet extends CometActor { override def defaultPrefix = Full(auth) private var foos = FooManager.getFoos def createDisplay(foos:List[Foo]):NodeSeq = { span id=gotable { for {foo - foos} yield trtd{foo.getValue}/td/tr } /table/span } def render = { bind(foo - createDisplay(foos)) } override def localSetup = { super.localSetup this ! Tick } var foo:Foo = null override def lowPriority = { case Tick = { foo=FooQueue.getLatest if (foo!=null foo.getValue -1) { blogs = FooManager.process(foo, foos) } else if (foo!=null){ foos = foos.remove((f:Foo)=(f.id==foo.id)) } reRender(false) this ! Tick } } } case class Tick On Sun, Nov 8, 2009 at 5:31 AM, Timothy Perrett timo...@getintheloop.eu wrote: Without posting your code it's going to be tough to help you. Cheers, Tim Sent from my iPhone On 8 Nov 2009, at 08:14, jack jack.wid...@gmail.com wrote: By the way, I know that when render is called, all the variables have the right values. I just don't see it on the screen unless I refresh it. On Nov 8, 3:12 am, jack jack.wid...@gmail.com wrote: I have a CometActor. render is called when it is supposed to be but I don't see the changes. If I refresh the page at anytime, I do see the changes. Any idea what might cause this? -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- Jack Widman co-founder / cto, Authoritude, Inc. 203-641-9355 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: 503 for url: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
It's not an issue of Lift's output working with XML.load, it's an issue of the W3C blocking the Java libraries. This has nothing to do with Lift or the XML Lift emits. If you want to parse XML and not run into that problem, use net.liftweb.util.PCDataXmlParser On Mon, Nov 9, 2009 at 7:11 PM, Alex Black a...@alexblack.ca wrote: I read these two: http://old.nabble.com/Exception-loading-XML-with-DTD-td25213294.html http://stackoverflow.com/questions/1096285/is-scala-java-not-respecting-w3-excess-dtd-traffic-specs Not sure what the answer is, some ugly work arounds are presented... Presumably Lift's XML output *should* work with XML.Load? - Alex On Nov 9, 10:01 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Don't know but it's been asked so you should be able to search for it; I'm not sure whether on this list or scala-user or both. - Alex Blacka...@alexblack.ca wrote: Exception: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd at sun.net.www.protocol.http.HttpURLConnection.getInputStream (HttpURLConnection.java:1313) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity (XMLEntityManager.java:677) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity (XMLEntityManager.java:1315) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity (XMLEntityManager.java:1282) at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource (XMLDTDScannerImpl.java:283) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $DTDDriver.next(XMLDocumentScannerImpl.java:1090) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl $PrologDriver.next(XMLDocumentScannerImpl.java:1003) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML (NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.load(XML.scala:72) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:16) at com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply (ServerTest.scala:14) at com.snapsort.common.Using$.apply(Using.scala:12) at com.snapsort.dataServer.api.ServerTest.testBasic(ServerTest.scala: 14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run (JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
[Lift] Re: Pretty Printed Output?
On Mon, Nov 9, 2009 at 3:28 PM, Peter Robinett pe...@bubblefoundry.comwrote: How hard would this be to implement? Does a Scala XML pretty-printer exist? If one does, I could see adding a NodeSeq = NodeSeq function near the end of the rendering pipeline. I'm a big fan of pretty HTML output, so I'd be interested in implementing this if it's not too hard. Peter Robinett On Nov 7, 7:06 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Sat, Nov 7, 2009 at 1:01 AM, aw anth...@whitford.com wrote: Is there a mode whereby I can turn on pretty printed output for my xhtml? (I'm thinking of a LiftRule, I think?). Preferably, I'd also like to control some details like indentation size. No mode for that... sorry. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Unit Test Error
In your unit tests, you must call Boot.scala or alternatively, execute the set-up code in Boot.scala in order to set up the RDBMS connections, etc. On Mon, Nov 9, 2009 at 5:37 PM, sunanda sunanda.pa...@gmail.com wrote: Hi, I have set the unitils properties for h2 database. I am getting the following error message for the unit test. Can anyone tell me what am I missing? Thanks. Sunanda java.lang.NullPointerException: Looking for Connection Identifier ConnectionIdentifier(lift) but failed to find either a JNDI data source with the name lift or a lift connection manager with the correct name at net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$7.apply(DB.scala: 95) at net.liftweb.mapper.DB$$anonfun$3$$anonfun$apply$7.apply(DB.scala: 95) at net.liftweb.util.EmptyBox.openOr(Box.scala:372) at net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:95) at net.liftweb.mapper.DB$$anonfun$3.apply(DB.scala:95) at net.liftweb.util.EmptyBox.openOr(Box.scala:372) at net.liftweb.mapper.DB$.newConnection(DB.scala:89) at net.liftweb.mapper.DB$.getConnection(DB.scala:136) at net.liftweb.mapper.DB$.use(DB.scala:303) at net.liftweb.mapper.KeyedMetaMapper$class.findDb(MetaMapper.scala: 1397) at net.irisinteractive.brandnet.gridxml.model.GridConfig$.findDb (GridConfig.scala:69) at net.liftweb.mapper.KeyedMetaMapper$class.findDb(MetaMapper.scala: 1393) at net.irisinteractive.brandnet.gridxml.model.GridConfig$.findDb (GridConfig.scala:69) at net.liftweb.mapper.KeyedMetaMapper$class.find(MetaMapper.scala: 1390) at net.irisinteractive.brandnet.gridxml.model.GridConfig$.find (GridConfig.scala:69) at net.irisinteractive.brandnet.gridxml.snippet.GridConfigRegistry.getGridConfiguration (GridConfigRegistry.scala:20) at net.irisinteractive.brandnet.gridxml.test.GridXmlComputationService.getGridXml (GridXmlComputationService.scala:28) at net.irisinteractive.brandnet.gridxml.test.TestGridConfig.test1 (TestGridConfig.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66) at org.junit.internal.runners.MethodRoadie.runTestMethod (MethodRoadie.java:105) at org.unitils.UnitilsJUnit4TestClassRunner $TestListenerInvokingMethodRoadie.runTestMethod (UnitilsJUnit4TestClassRunner.java:174) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java: 86) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters (MethodRoadie.java:94) at org.unitils.UnitilsJUnit4TestClassRunner $TestListenerInvokingMethodRoadie.runBeforesThenTestThenAfters (UnitilsJUnit4TestClassRunner.java:156) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java: 84) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49) at org.unitils.UnitilsJUnit4TestClassRunner.invokeTestMethod (UnitilsJUnit4TestClassRunner.java:95) at org.junit.internal.runners.JUnit4ClassRunner.runMethods (JUnit4ClassRunner.java:59) at org.unitils.UnitilsJUnit4TestClassRunner.access$000 (UnitilsJUnit4TestClassRunner.java:44) at org.unitils.UnitilsJUnit4TestClassRunner$1.run (UnitilsJUnit4TestClassRunner.java:62) at org.junit.internal.runners.ClassRoadie.runUnprotected (ClassRoadie.java:34) at org.junit.internal.runners.ClassRoadie.runProtected (ClassRoadie.java:44) at org.unitils.UnitilsJUnit4TestClassRunner.run (UnitilsJUnit4TestClassRunner.java:68) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit
[Lift] Re: Pretty Printed Output?
http://www.scala-lang.org/docu/files/api/scala/xml/PrettyPrinter.html But this can be done today using: val responseTransformers = RulesSeq [LiftResponse = LiftResponse] LiftRules.responseTransformers.append { case response = // do some LiftResponse pattern matching here for and XhtmlResponse, take the NodeSeq and run it against the pretty printer above. // and return the new XhtmlResponse } Br's, Marius On Nov 10, 8:37 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Nov 9, 2009 at 3:28 PM, Peter Robinett pe...@bubblefoundry.comwrote: How hard would this be to implement? Does a Scala XML pretty-printer exist? If one does, I could see adding a NodeSeq = NodeSeq function near the end of the rendering pipeline. I'm a big fan of pretty HTML output, so I'd be interested in implementing this if it's not too hard. Peter Robinett On Nov 7, 7:06 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Sat, Nov 7, 2009 at 1:01 AM, aw anth...@whitford.com wrote: Is there a mode whereby I can turn on pretty printed output for my xhtml? (I'm thinking of a LiftRule, I think?). Preferably, I'd also like to control some details like indentation size. No mode for that... sorry. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---