[Lift] Re: lift-json's extract and Mapper
Hi Peter, To select multiple packets you need to first select the objects within the array. Like this: for { JObject(packet) - parse(s) JField(node, JString(node)) - packet JField(dt, JInt(dt)) - packet JField(temp, JDouble(temp)) - packet } yield // construct Packet here Cheers Joni On Oct 5, 2:13 am, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, Joni. I've been playing with just that for comprehension syntax over the weekend. How would I do it if I had multiple packets? { packets: [ { node: 00:1D:C9:00:04:9F, dt: 1254553581405, temp: 27.5 }, { node: 00:1D:C9:00:04:9E, dt: 1254553582405, temp: 24.3 } ] } I've had some problems iterating across the parsed results. If I do: for { json - parse(s) JField(node, JString(node)) - json JField(dt, JInt(dt)) - json JField(temp, JDouble(temp)) - json } yield // construct Packet here I will end up with 8 Packets. Should I be doing something like JArray (json) - parse(s)? Thanks for your help, Peter On Oct 4, 3:08 pm, Joni Freeman freeman.j...@gmail.com wrote: I don't know how hard would it be to add this feature, so I don't know if this is a reasonable request. This would make making JSON API endpoints really easy for me and I hope for other people too. This certainly sounds like a reasonable feature request, I will take a deeper look at it. Meanwhile, you can use tmp case class as Kevin noted, or use for- comprehension to query the json. Something like: { packet: { node: 00:1D:C9:00:04:9F, dt: 1254553581405, temp: 27.5 } } val json = parse(s) for { JField(node, JString(node)) - json JField(dt, JInt(dt)) - json JField(temp, JDouble(temp)) - json } yield // construct Packet here That's a bit verbose but quite flexible. This test case contains more query examples:http://github.com/dpp/liftweb/blob/master/lift-json/src/test/scala/ne... Cheers Joni --~--~-~--~~~---~--~~ 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: execute code when browser is closed
On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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 deploy yours?
Indrajit, Your right, jetty-runner is Jetty 7. The only tie we have to Jetty 6 would be this line: val cc = Class.forName (org.mortbay.util.ajax.ContinuationSupport) It would be trivial to add a match or whatever that determined the correct type to use... The question is, why haven't we done this already? I suspect its just a time / capacity issue but wanted to check. I know I could write a jetty 6 wrapper, but that is my fallback position as something more OOTB would be preferable. Cheers, Tim On Oct 5, 8:29 am, Indrajit Raychaudhuri indraj...@gmail.com wrote: Tim, Interestingly, we are trying out something similar in a project here and this is absolutely cool stuff. In fact, Zimbra Desktop does this too. Pure Prism+Jetty bundled as 'desktop application'. That you can have 'double-click' friendly application helps :-) Few notes: 1. Embedding Jetty server is super easy with org.mortbay.jetty.Server. Something that we have in Lift - well almost ;-) The RunWebApp in the archetypes are primitive use case of such. [1] 2. Jetty Runner is available only on Jetty 7.x series I think (not certain). But yes, looks good either way. 3. Jetty has this clean and nice way of having web-app specific jetty config tucked inside the application (war or expanded) within WEB-INF/jetty-web.xml which is basically an XmlConfiguration instance applied on the specific WebApplicationContext instead of the Container Context. [2] 4. An archetype that does self deploying is something that I have on my todo-list. Do you think this would make sense? 5. Maven assembly plugin would do. I haven't tried this myself, but Maven shade plugin looks something close. [3] [1]http://docs.codehaus.org/display/JETTY/Embedding+Jetty [2]http://docs.codehaus.org/display/JETTY/jetty-web.xml [3]http://maven.apache.org/plugins/maven-shade-plugin/ Cheers, Indrajit NB: Looks like quite a few night owl here! On 05/10/09 4:11 AM, Timothy Perrett wrote: Viktor, you and I should not be up this late on a sunday! ;-) You have to see this:http://blogs.webtide.com/janb/entry/jetty_runner Im going to hash this together as a maven assembly; if it works, then i'll write a blog and stuff it on the wiki... this could really make self deploying apps very nice indeed. I'll check with DavidB, but im fairly sure it would also be trivial to make a little maven plugin that builds a single JAR output... Cheers, Tim On Oct 4, 11:10 pm, Viktor Klangviktor.kl...@gmail.com wrote: Thanks for the linky, mate! Was a good read :) On Sun, Oct 4, 2009 at 11:45 PM, Timothy Perretttimo...@getintheloop.euwrote: Just some more fuel for this debate: http://technically.us/code/x/to-jettison-geronimo/ Cheers, Tim On Oct 4, 8:46 pm, Timothy Perretttimo...@getintheloop.eu wrote: Guys, Of late i've been having several discussions with people about how they deploy there lift apps... So, how do you deploy yours? Specifically, how are people managing multiple apps in one install of jetty? Or, alternatively, how are you embedded jetty so you have an executable JAR? Im using Winstone for apps that dont use Comet because the package is so slick (thanks DavidB), but now, I really really want to be able to embed jetty so I have an executable JAR in the same vein as Winstone. As time moves on, I feel like this is more and more important and we dont current have a defined path for n00bs. Cheers, Tim -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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: execute code when browser is closed
But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/net/liftweb/http/SessionVar.html Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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-json's extract and Mapper
Thanks, Joni, that works perfectly! Peter On Oct 5, 8:49 am, Joni Freeman freeman.j...@gmail.com wrote: Hi Peter, To select multiple packets you need to first select the objects within the array. Like this: for { JObject(packet) - parse(s) JField(node, JString(node)) - packet JField(dt, JInt(dt)) - packet JField(temp, JDouble(temp)) - packet } yield // construct Packet here Cheers Joni On Oct 5, 2:13 am, Peter Robinett pe...@bubblefoundry.com wrote: Thanks, Joni. I've been playing with just that for comprehension syntax over the weekend. How would I do it if I had multiple packets? { packets: [ { node: 00:1D:C9:00:04:9F, dt: 1254553581405, temp: 27.5 }, { node: 00:1D:C9:00:04:9E, dt: 1254553582405, temp: 24.3 } ] } I've had some problems iterating across the parsed results. If I do: for { json - parse(s) JField(node, JString(node)) - json JField(dt, JInt(dt)) - json JField(temp, JDouble(temp)) - json } yield // construct Packet here I will end up with 8 Packets. Should I be doing something like JArray (json) - parse(s)? Thanks for your help, Peter On Oct 4, 3:08 pm, Joni Freeman freeman.j...@gmail.com wrote: I don't know how hard would it be to add this feature, so I don't know if this is a reasonable request. This would make making JSON API endpoints really easy for me and I hope for other people too. This certainly sounds like a reasonable feature request, I will take a deeper look at it. Meanwhile, you can use tmp case class as Kevin noted, or use for- comprehension to query the json. Something like: { packet: { node: 00:1D:C9:00:04:9F, dt: 1254553581405, temp: 27.5 } } val json = parse(s) for { JField(node, JString(node)) - json JField(dt, JInt(dt)) - json JField(temp, JDouble(temp)) - json } yield // construct Packet here That's a bit verbose but quite flexible. This test case contains more query examples:http://github.com/dpp/liftweb/blob/master/lift-json/src/test/scala/ne... Cheers Joni --~--~-~--~~~---~--~~ 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: Concurrency control of database access in Lift/Comet
Thanks Kevin, I know, that this is more of a theoretical problem, but now that I have read so much about Actors and concurrent programming, I am actually curious about the underlying concurrency strategies taken by Scala. Infact I realize, that this is actually more a Scala question, than a Lift one. But it is interesting for lift too, as it it builds upon Scalas actor model. So as far as I understand you suggest, that I take the concurrency problem over to the database and leave it up to the database to handle concurrency like in the following flow schema: Many open Comet connections - one thread per one or more client socket connections - one database connection per thread - concurrency handling in DB This approach however means that my application will generate many open connections to the database and therefore much connection (IPC-) overhead. Also by doing so it doesn't actually use the advantages of Scalas concurrency model. My approach was instead something like this: Many open Comet connections - one thread per one or more client socket connections - one thread receiving messages from all other threads putting them in a message queue - one database connection - DB access Concurrency in such model is handled by the message system of Scala, which AFAIK is thread safe and doesn't use locks?! The advantage would be, that I just would need one database connection, which to me sounds more efficient. I think my question can be drilled down to the following. How efficient is Scala's concurrency model? Do Scala Actors use locks in the underpinning or are concurrency operations atomic? (I read here http://www.ibm.com/developerworks/java/library/j-scala04109.html that Scala uses locks under the hood too so after all I could finish up with the same problems like with shared memory and mutexes?) Best regards Gregor On 4 Okt., 21:06, Kevin Wright kev.lee.wri...@googlemail.com wrote: In my experience, the database engine itself does a pretty good job of managing concurrent connections like this out of the box, which is much of the reason why connection pooling is so effective. Of course, thinks can be a bit interesting on the database side if you want to get really obsessive about performance, with possibilities such as tinkering with page sizes, locking strategies, and such like, but it's extremely rare for this to be a bottleneck in an application. However... For the example you've given, I'd just run a dedicated actor to persist chat messages. There's no need to wait for a message to be persisted before displaying it to the user, so asynchronous messages can really help out here. On Sun, Oct 4, 2009 at 6:41 PM, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: I have read that the Lift framework supports the CometActor model. As far as I understand this is achieved by creating many threads out of some thread pool, each of which handles one or more client socket connection to a client. My question is, what kind of approach Lift takes to handle access from such threads to a shared object, e.g. a database? Many thread based applications use locks to access shared data, which however won't scale well. I read that better models would be timestamp ordering or multiversion concurrency control like e.g. used by CouchDB. Perhaps this is also handled automatically by the database and I don't have to bother about it at all from my application? Is it save to use a database connection from different threads? A simple example that came to my mind would be a Comet chat application, where one wants to save the communication to a database. How would the concurrent write requests from two threads to the database be handled in such case? Best regards Gregor --~--~-~--~~~---~--~~ 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: Model Events
Thanks Peter, that pretty much answers my question! On 5 Okt., 01:17, Peter Robinett pe...@bubblefoundry.com wrote: Hi Gregor, For my Mapper model called Packet, my companion object looks like this: object Packet extends Packet with LongKeyedMetaMapper[Packet] { override def dbTableName = packets // define the DB table name /* register callback to send the new packet */ override def afterCreate = createdRow _ :: super.afterCreate private def createdRow(packet: Packet) { DatacenterBroker.createdPacket(packet) } } As you can see, after a Packet is created it is sent to an Actor (using the broker object as an intermediary). The Scaladocs for MetaMapper show many before and after events that you can override like I've done with afterCreate:http://scala-tools.org/mvnsites-snapshots/liftweb/lift-mapper/scalado... Peter Robinett On Oct 4, 10:47 pm, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: Hi Marius, Thanks for your fast response. As an app developer, if I would like to get notified from the persistence layer, that some changes to my domain model have happened, how could I get such functionality with a Scala actor? By subclassing the persistence class? Or is such functionality already integrated in the persistence layer? Let's say I would like to get notified before some data is inserted in the database. How would I achieve that? Thanks again On 4 Okt., 20:37, marius d. marius.dan...@gmail.com wrote: Scala has a natural support for events notifications = Scala Actors. It's a very natural fit for building event driven systems. In Lift we're moving CometActors to LiftActors instead of Scala Actors due to some memory consumption problems with current Scala actors implementation which are probably fixed now in Scala 2.7.7 RC1. So definitely yes, event driven programming is quite fitful in Lift. Br's, Marius On Oct 4, 8:25 pm, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: I have been looking for Web frameworks that will take advantage of an Event Driven programming model. Some Frameworks like Python's Zope and Grails manage to subscribe to Model Events. E.g. one can subscribe to a notification message, whenever a domain model gets changed, added, deleted, etc. (like explained here http://bit.ly/2AkVBy) Can the Lift Framework throw such events too? Similar to the way Grails and Zope do it? Or is there another way in Lift to do the same? I must say that I preety much do like the Lift Framework and it's fresh approach on important tasks like Comet, Templating, Active Record, Web Services, Localization... However one of my key requirements would be simple handling of events and notifications. Thank you Gregor --~--~-~--~~~---~--~~ 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 deploy yours?
On 05/10/09 1:37 PM, Timothy Perrett wrote: I know I could write a jetty 6 wrapper, but that is my fallback position as something more OOTB would be preferable. I am in complete agreement with you on this. /Indrajit --~--~-~--~~~---~--~~ 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: Concurrency control of database access in Lift/Comet
Its really more of a Java problem, or JDBC to be specific. The normal way to configure this would be to establish a pool of connections, when a thread, or actor, needs to interact with the database it takes a connection from the pool, uses it, then returns it to the pool. This is the same regardless of how you approach concurrency (actors/locks/dataflow/etc.). When every connection in the pool is in use, subsequent requests will block until one becomes available, thus limiting the number of simultaneous requests to the DB. Tuning is then handled by adjusting the pool size to a value that delivers greatest throughput from the database. Depending on your exact requirements, it's then possible to build a layer on to of this that can take advantage of asynchronous messages to actors On Mon, Oct 5, 2009 at 12:50 PM, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: Thanks Kevin, I know, that this is more of a theoretical problem, but now that I have read so much about Actors and concurrent programming, I am actually curious about the underlying concurrency strategies taken by Scala. Infact I realize, that this is actually more a Scala question, than a Lift one. But it is interesting for lift too, as it it builds upon Scalas actor model. So as far as I understand you suggest, that I take the concurrency problem over to the database and leave it up to the database to handle concurrency like in the following flow schema: Many open Comet connections - one thread per one or more client socket connections - one database connection per thread - concurrency handling in DB This approach however means that my application will generate many open connections to the database and therefore much connection (IPC-) overhead. Also by doing so it doesn't actually use the advantages of Scalas concurrency model. My approach was instead something like this: Many open Comet connections - one thread per one or more client socket connections - one thread receiving messages from all other threads putting them in a message queue - one database connection - DB access Concurrency in such model is handled by the message system of Scala, which AFAIK is thread safe and doesn't use locks?! The advantage would be, that I just would need one database connection, which to me sounds more efficient. I think my question can be drilled down to the following. How efficient is Scala's concurrency model? Do Scala Actors use locks in the underpinning or are concurrency operations atomic? (I read here http://www.ibm.com/developerworks/java/library/j-scala04109.html that Scala uses locks under the hood too so after all I could finish up with the same problems like with shared memory and mutexes?) Best regards Gregor On 4 Okt., 21:06, Kevin Wright kev.lee.wri...@googlemail.com wrote: In my experience, the database engine itself does a pretty good job of managing concurrent connections like this out of the box, which is much of the reason why connection pooling is so effective. Of course, thinks can be a bit interesting on the database side if you want to get really obsessive about performance, with possibilities such as tinkering with page sizes, locking strategies, and such like, but it's extremely rare for this to be a bottleneck in an application. However... For the example you've given, I'd just run a dedicated actor to persist chat messages. There's no need to wait for a message to be persisted before displaying it to the user, so asynchronous messages can really help out here. On Sun, Oct 4, 2009 at 6:41 PM, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: I have read that the Lift framework supports the CometActor model. As far as I understand this is achieved by creating many threads out of some thread pool, each of which handles one or more client socket connection to a client. My question is, what kind of approach Lift takes to handle access from such threads to a shared object, e.g. a database? Many thread based applications use locks to access shared data, which however won't scale well. I read that better models would be timestamp ordering or multiversion concurrency control like e.g. used by CouchDB. Perhaps this is also handled automatically by the database and I don't have to bother about it at all from my application? Is it save to use a database connection from different threads? A simple example that came to my mind would be a Comet chat application, where one wants to save the communication to a database. How would the concurrent write requests from two threads to the database be handled in such case? Best regards Gregor --~--~-~--~~~---~--~~ 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
[Lift] lift-json and attributes
Loving the new lift-json code. We've been producing XML for a REST API, and now need to produce JSON. lift-json to the rescue, except...the Xml converter doesn't handle attributes: scala val xml = user id=7nameBert/name/user xml: scala.xml.Elem = user id=7nameBert/name/user scala val json = toJson(xml) json: net.liftweb.json.JsonAST.JValue = JObject(List(JField(user,JObject(List(JField(name,JString(Bert))) scala JsonDSL.compact(JsonAST.render(json)) res5: String = {user:{name:Bert}} I'd expect res5 to be something like: {user:{id:7,name:Bert}} I'm either missing a clue, or this is a feature request. I can see there's ambiguity in how you might map the above JSON back to XML with attributes, but it seems reasonable that if you have XML + attributes they would be present in a JSON representation. Thank you Richard --~--~-~--~~~---~--~~ 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: Concurrency control of database access in Lift/Comet
Howdy, I think you misunderstand how Actors work. An Actor only consumes resources while it is processing an item in its mailbox. So if an Actor is hanging out, doing nothing, it will only consume memory (like any other object.) When the Actor receives a message, it allocates some additional resources to process the message. Those resources always include a thread. In Lift, those resources also include an S scope. When S (session state) comes into scope, a connection to the RDBMS may be allocated (depending on you application's transaction policy) so that all RDBMS interactions that take place during that message processing will be part of a single RDBMS transaction. There are no resources allocated while a browser is waiting for a Comet event (except an NIO connection and a few objects allocated in memory). It's only when something happens that will cause HTML to go to the browser that events get put into mailboxes and RDBMS connections get pulled out of a pool. I hope this helps clear up the questions you had. Thanks, David On Sun, Oct 4, 2009 at 10:41 AM, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: I have read that the Lift framework supports the CometActor model. As far as I understand this is achieved by creating many threads out of some thread pool, each of which handles one or more client socket connection to a client. My question is, what kind of approach Lift takes to handle access from such threads to a shared object, e.g. a database? Many thread based applications use locks to access shared data, which however won't scale well. I read that better models would be timestamp ordering or multiversion concurrency control like e.g. used by CouchDB. Perhaps this is also handled automatically by the database and I don't have to bother about it at all from my application? Is it save to use a database connection from different threads? A simple example that came to my mind would be a Comet chat application, where one wants to save the communication to a database. How would the concurrent write requests from two threads to the database be handled in such case? Best regards Gregor -- 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: How to share request scope data among snippets in Lift
On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com wrote: Thank you for your example, David. It will work in my purpose. Cool. It seems that my poor English and less information let some people confused. I appreciate that you have put in the work to translate your thoughts to English. I apologize that I only speak English, but would love to speak Japanese, German, Russian, and a few other languages. I need just a request scope data. It means I want to share information between snippets across a request. (Is the expression request scope not good for in this case...?) request scope is exactly the right phrase. Thank all responsed my post, and your suggestions are informative. I think very nice community is here. On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote: To share information between snippets during a request, use a RequestVar: object MyInfo extends RequestVar(calculate_value) so object MyInfo extends RequestVar[Box[Invoice]](Empty) in one snippet, you may calculate the Invoice and put it in the MyInfo: MyInfo.set(Full(invoice)) In another snippet, you can extract: for { invoice - MyInfo.is } yield ... Note that the calculate_value is a call-by-name parameter, so it will be invoked each time the RequestVar is uninitialized. You can place lazy calculation logic in here. On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. If my lift application have some data that cost to create, and I want to share it among snippets, how to do in Lift? if such data are shared inside one snippet, I may use lazy val. But I have no nice idea to share it among different snippts. Thanks much. -- 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: ShutDown and CometActor
When you send the shutdown message, oddly enough, the CometActor shuts down. You don't have to do this (in fact, don't do it). Lift will shut the CometActor down automatically. On Sun, Oct 4, 2009 at 7:32 PM, jack jack.wid...@gmail.com wrote: I am sending a ShutDown message to my CometActor to end the session. WHen I then go back to the CometActor, it is not working properly the way it did the first time. Is there anything I have to do after shutting down the session, or should it just work when I load the CometActor again? -- 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: How do you deploy yours?
On 05/10/09 5:29 PM, Timothy Perrett wrote: So I just wrote a Jetty 6 wrapper - getting the packaging working was not ideal and not as flexible as Jetty 7 jetty-runner. Yes, just took a look at jetty-runner. Feature wise, it's blows away the older mechanism man! Any thoughts in and around altering the lift code to adjust the package based on jetty version? I can think of two options basically: 1. Move to jetty 7 and be done with it. 2. Allowing user option (via -Djetty.version) during archetype:generate. jetty.version can be an overridable archetype property that defaults to (say 6) but user can do -Djetty.version=7. Depending on the jetty version, the *.scala, *.xml etc. can be filtered to make the right kind of adjustment during archetype creation. Cheers, Indrajit Cheers, Tim On Oct 5, 9:07 am, Timothy Perretttimo...@getintheloop.eu wrote: Indrajit, Your right, jetty-runner is Jetty 7. The only tie we have to Jetty 6 would be this line: val cc = Class.forName (org.mortbay.util.ajax.ContinuationSupport) It would be trivial to add a match or whatever that determined the correct type to use... The question is, why haven't we done this already? I suspect its just a time / capacity issue but wanted to check. I know I could write a jetty 6 wrapper, but that is my fallback position as something more OOTB would be preferable. Cheers, Tim On Oct 5, 8:29 am, Indrajit Raychaudhuriindraj...@gmail.com wrote: Tim, Interestingly, we are trying out something similar in a project here and this is absolutely cool stuff. In fact, Zimbra Desktop does this too. Pure Prism+Jetty bundled as 'desktop application'. That you can have 'double-click' friendly application helps :-) Few notes: 1. Embedding Jetty server is super easy with org.mortbay.jetty.Server. Something that we have in Lift - well almost ;-) The RunWebApp in the archetypes are primitive use case of such. [1] 2. Jetty Runner is available only on Jetty 7.x series I think (not certain). But yes, looks good either way. 3. Jetty has this clean and nice way of having web-app specific jetty config tucked inside the application (war or expanded) within WEB-INF/jetty-web.xml which is basically an XmlConfiguration instance applied on the specific WebApplicationContext instead of the Container Context. [2] 4. An archetype that does self deploying is something that I have on my todo-list. Do you think this would make sense? 5. Maven assembly plugin would do. I haven't tried this myself, but Maven shade plugin looks something close. [3] [1]http://docs.codehaus.org/display/JETTY/Embedding+Jetty [2]http://docs.codehaus.org/display/JETTY/jetty-web.xml [3]http://maven.apache.org/plugins/maven-shade-plugin/ Cheers, Indrajit NB: Looks like quite a few night owl here! On 05/10/09 4:11 AM, Timothy Perrett wrote: Viktor, you and I should not be up this late on a sunday! ;-) You have to see this:http://blogs.webtide.com/janb/entry/jetty_runner Im going to hash this together as a maven assembly; if it works, then i'll write a blog and stuff it on the wiki... this could really make self deploying apps very nice indeed. I'll check with DavidB, but im fairly sure it would also be trivial to make a little maven plugin that builds a single JAR output... Cheers, Tim On Oct 4, 11:10 pm, Viktor Klangviktor.kl...@gmail.comwrote: Thanks for the linky, mate! Was a good read :) On Sun, Oct 4, 2009 at 11:45 PM, Timothy Perretttimo...@getintheloop.euwrote: Just some more fuel for this debate: http://technically.us/code/x/to-jettison-geronimo/ Cheers, Tim On Oct 4, 8:46 pm, Timothy Perretttimo...@getintheloop.euwrote: Guys, Of late i've been having several discussions with people about how they deploy there lift apps... So, how do you deploy yours? Specifically, how are people managing multiple apps in one install of jetty? Or, alternatively, how are you embedded jetty so you have an executable JAR? Im using Winstone for apps that dont use Comet because the package is so slick (thanks DavidB), but now, I really really want to be able to embed jetty so I have an executable JAR in the same vein as Winstone. As time moves on, I feel like this is more and more important and we dont current have a defined path for n00bs. Cheers, Tim -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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: ShutDown and CometActor
Actually, this is working nicely now. Thanks. On Mon, Oct 5, 2009 at 11:46 AM, David Pollak feeder.of.the.be...@gmail.com wrote: When you send the shutdown message, oddly enough, the CometActor shuts down. You don't have to do this (in fact, don't do it). Lift will shut the CometActor down automatically. On Sun, Oct 4, 2009 at 7:32 PM, jack jack.wid...@gmail.com wrote: I am sending a ShutDown message to my CometActor to end the session. WHen I then go back to the CometActor, it is not working properly the way it did the first time. Is there anything I have to do after shutting down the session, or should it just work when I load the CometActor again? -- 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 --~--~-~--~~~---~--~~ 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: ShutDown and CometActor
I made this mistake when I first came to Lift development - if your needing to do this, then its quite likely that you need to re-address your actor / comet actor design. Cheers, Tim On 5 Oct 2009, at 16:46, David Pollak wrote: When you send the shutdown message, oddly enough, the CometActor shuts down. You don't have to do this (in fact, don't do it). Lift will shut the CometActor down automatically. On Sun, Oct 4, 2009 at 7:32 PM, jack jack.wid...@gmail.com wrote: I am sending a ShutDown message to my CometActor to end the session. WHen I then go back to the CometActor, it is not working properly the way it did the first time. Is there anything I have to do after shutting down the session, or should it just work when I load the CometActor again? -- 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: How to share request scope data among snippets in Lift
On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com wrote: Thank you for your example, David. It will work in my purpose. Cool. It seems that my poor English and less information let some people confused. I appreciate that you have put in the work to translate your thoughts to English. I apologize that I only speak English, but would love to speak Japanese, German, Russian, and a few other languages. oh you gotta learn Romanian :) I need just a request scope data. It means I want to share information between snippets across a request. (Is the expression request scope not good for in this case...?) request scope is exactly the right phrase. Thank all responsed my post, and your suggestions are informative. I think very nice community is here. On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote: To share information between snippets during a request, use a RequestVar: object MyInfo extends RequestVar(calculate_value) so object MyInfo extends RequestVar[Box[Invoice]](Empty) in one snippet, you may calculate the Invoice and put it in the MyInfo: MyInfo.set(Full(invoice)) In another snippet, you can extract: for { invoice - MyInfo.is } yield ... Note that the calculate_value is a call-by-name parameter, so it will be invoked each time the RequestVar is uninitialized. You can place lazy calculation logic in here. On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. If my lift application have some data that cost to create, and I want to share it among snippets, how to do in Lift? if such data are shared inside one snippet, I may use lazy val. But I have no nice idea to share it among different snippts. Thanks much. -- 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 -~--~~~~--~~--~--~---
[Lift] Re: Model Events
Glad to help. Peter On Oct 5, 11:29 am, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: Thanks Peter, that pretty much answers my question! On 5 Okt., 01:17, Peter Robinett pe...@bubblefoundry.com wrote: Hi Gregor, For my Mapper model called Packet, my companion object looks like this: object Packet extends Packet with LongKeyedMetaMapper[Packet] { override def dbTableName = packets // define the DB table name /* register callback to send the new packet */ override def afterCreate = createdRow _ :: super.afterCreate private def createdRow(packet: Packet) { DatacenterBroker.createdPacket(packet) } } As you can see, after a Packet is created it is sent to an Actor (using the broker object as an intermediary). The Scaladocs for MetaMapper show many before and after events that you can override like I've done with afterCreate:http://scala-tools.org/mvnsites-snapshots/liftweb/lift-mapper/scalado... Peter Robinett On Oct 4, 10:47 pm, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: Hi Marius, Thanks for your fast response. As an app developer, if I would like to get notified from the persistence layer, that some changes to my domain model have happened, how could I get such functionality with a Scala actor? By subclassing the persistence class? Or is such functionality already integrated in the persistence layer? Let's say I would like to get notified before some data is inserted in the database. How would I achieve that? Thanks again On 4 Okt., 20:37, marius d. marius.dan...@gmail.com wrote: Scala has a natural support for events notifications = Scala Actors. It's a very natural fit for building event driven systems. In Lift we're moving CometActors to LiftActors instead of Scala Actors due to some memory consumption problems with current Scala actors implementation which are probably fixed now in Scala 2.7.7 RC1. So definitely yes, event driven programming is quite fitful in Lift. Br's, Marius On Oct 4, 8:25 pm, donfranciscodequevedo donfranciscodequev...@gmail.com wrote: I have been looking for Web frameworks that will take advantage of an Event Driven programming model. Some Frameworks like Python's Zope and Grails manage to subscribe to Model Events. E.g. one can subscribe to a notification message, whenever a domain model gets changed, added, deleted, etc. (like explained here http://bit.ly/2AkVBy) Can the Lift Framework throw such events too? Similar to the way Grails and Zope do it? Or is there another way in Lift to do the same? I must say that I preety much do like the Lift Framework and it's fresh approach on important tasks like Comet, Templating, Active Record, Web Services, Localization... However one of my key requirements would be simple handling of events and notifications. Thank you Gregor --~--~-~--~~~---~--~~ 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 to share request scope data among snippets in Lift
Why don't we make Esperanto the official Lift language? On Mon, Oct 5, 2009 at 11:52 AM, marius d. marius.dan...@gmail.com wrote: On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com wrote: Thank you for your example, David. It will work in my purpose. Cool. It seems that my poor English and less information let some people confused. I appreciate that you have put in the work to translate your thoughts to English. I apologize that I only speak English, but would love to speak Japanese, German, Russian, and a few other languages. oh you gotta learn Romanian :) I need just a request scope data. It means I want to share information between snippets across a request. (Is the expression request scope not good for in this case...?) request scope is exactly the right phrase. Thank all responsed my post, and your suggestions are informative. I think very nice community is here. On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote: To share information between snippets during a request, use a RequestVar: object MyInfo extends RequestVar(calculate_value) so object MyInfo extends RequestVar[Box[Invoice]](Empty) in one snippet, you may calculate the Invoice and put it in the MyInfo: MyInfo.set(Full(invoice)) In another snippet, you can extract: for { invoice - MyInfo.is } yield ... Note that the calculate_value is a call-by-name parameter, so it will be invoked each time the RequestVar is uninitialized. You can place lazy calculation logic in here. On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. If my lift application have some data that cost to create, and I want to share it among snippets, how to do in Lift? if such data are shared inside one snippet, I may use lazy val. But I have no nice idea to share it among different snippts. Thanks much. -- 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 -- Jack --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: comet
On Sun, Oct 4, 2009 at 2:51 PM, jack jack.wid...@gmail.com wrote: Well the way I have it render is being called multiple times so I can put initial code there. I have some code near the top of my Comet class and thats the code I want to run every time I load the page. Currently, it is only run the first time. render is called when the component is first loaded, in response to a reRender method invocation, or in you have had a partial update and then a new HTML page containing the CometActor is rendered via Lift's page rendering pipeline. All setup should be done in localSetup() and all shutdown (e.g., releasing external resources) should be done in localShutdown(). Do not do anything in render other than rendering the HTML for the current state of the CometActor. On Oct 4, 11:50 am, marius d. marius.dan...@gmail.com wrote: Well render will be called for sure ... but if you build your comet component to rely only with partial updates when updating coment's real estate and don't call re-render then render should be called only when page is loaded, meaning that you can reset any state there. ... of course unless something escapes me :) Br's, Marius On Oct 4, 6:12 pm, jack jack.wid...@gmail.com wrote: How can assure that every time a comet page is loaded, it starts again fresh? I.e. as if the page were being loaded for the first time? -- 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: execute code when browser is closed
HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack --~--~-~--~~~---~--~~ 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] YUI Compressor Fatal Error
Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Mon Oct 05 17:18:57 UTC 2009 [INFO] Final Memory: 27M/66M [INFO] --~--~-~--~~~---~--~~ 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: YUI Compressor Fatal Error
Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO] task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Mon Oct 05 17:18:57 UTC 2009 [INFO] Final Memory: 27M/66M [INFO] --~--~-~--~~~---~--~~ 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
[Lift] Re: execute code when browser is closed
Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com wrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.eu wrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack --~--~-~--~~~---~--~~ 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: YUI Compressor Fatal Error
I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced (Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java: 255) at org.codehaus.classworlds.Launcher.mainWithExitCode (Launcher.java: 430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Mon Oct 05 17:18:57 UTC 2009 [INFO] Final Memory: 27M/66M [INFO]
[Lift] Re: comet
Include a snippet on the page that tells the comet actor to reset itself. 2009/10/5 David Pollak feeder.of.the.be...@gmail.com: On Sun, Oct 4, 2009 at 2:51 PM, jack jack.wid...@gmail.com wrote: Well the way I have it render is being called multiple times so I can put initial code there. I have some code near the top of my Comet class and thats the code I want to run every time I load the page. Currently, it is only run the first time. render is called when the component is first loaded, in response to a reRender method invocation, or in you have had a partial update and then a new HTML page containing the CometActor is rendered via Lift's page rendering pipeline. All setup should be done in localSetup() and all shutdown (e.g., releasing external resources) should be done in localShutdown(). Do not do anything in render other than rendering the HTML for the current state of the CometActor. On Oct 4, 11:50 am, marius d. marius.dan...@gmail.com wrote: Well render will be called for sure ... but if you build your comet component to rely only with partial updates when updating coment's real estate and don't call re-render then render should be called only when page is loaded, meaning that you can reset any state there. ... of course unless something escapes me :) Br's, Marius On Oct 4, 6:12 pm, jack jack.wid...@gmail.com wrote: How can assure that every time a comet page is loaded, it starts again fresh? I.e. as if the page were being loaded for the first time? -- 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] Possible lift-json bug in Xml.toJson
Xml.toJson (in M5) is converting this: iconhttp://harryh.org/img/icons/foo.png/icon to this: JField(icon, JObject(Nil)) Is there some special handling of URLs going on here that might be causing me problems? -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: Possible lift-json bug in Xml.toJson
More info. If the code that generates the XML looks like this: icon{http://harryh.org+theUri}/icon everything is fine, but it breaks when like this: iconhttp://harryh.org{theUrl}/icon -harryh On Oct 5, 2:22 pm, harryh har...@gmail.com wrote: Xml.toJson (in M5) is converting this: iconhttp://harryh.org/img/icons/foo.png/icon to this: JField(icon, JObject(Nil)) Is there some special handling of URLs going on here that might be causing me problems? -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: execute code when browser is closed
Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 --~--~-~--~~~---~--~~ 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: Possible lift-json bug in Xml.toJson
Is there a difference in the NodeSeq that generates? On Mon, Oct 5, 2009 at 2:31 PM, harryh har...@gmail.com wrote: More info. If the code that generates the XML looks like this: icon{http://harryh.org+theUri}/icon everything is fine, but it breaks when like this: iconhttp://harryh.org{theUrl}/icon -harryh On Oct 5, 2:22 pm, harryh har...@gmail.com wrote: Xml.toJson (in M5) is converting this: iconhttp://harryh.org/img/icons/foo.png/icon to this: JField(icon, JObject(Nil)) Is there some special handling of URLs going on here that might be causing me problems? -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: Possible lift-json bug in Xml.toJson
Hmmm looks like there might be multiple Text() nodes in the icon node and the parser isn't picking them up as one piece of text. Might be worthy of a ticket. On Mon, Oct 5, 2009 at 11:31 AM, harryh har...@gmail.com wrote: More info. If the code that generates the XML looks like this: icon{http://harryh.org+theUri}/icon everything is fine, but it breaks when like this: iconhttp://harryh.org{theUrl}/icon -harryh On Oct 5, 2:22 pm, harryh har...@gmail.com wrote: Xml.toJson (in M5) is converting this: iconhttp://harryh.org/img/icons/foo.png/icon to this: JField(icon, JObject(Nil)) Is there some special handling of URLs going on here that might be causing me problems? -harryh -- 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: execute code when browser is closed
On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.com wrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- 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 nearly inaccessible for newby
Being a non-programmer, and additionally not having a Java background, which framework are you comparing Lift to when you say it's not easy? :) Can you clarify: Is this going to be a site, or a back end to a mobile app that sits on the phone? On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote: Hi, Being a no-programmer and having no Java-background I'd like to have mentioned that Lift really isn't an easy framework. Having said that, I will try to read my way into this system and try to solve the problems I encounter. I have one question. I would like to establish a login method where a visitor of my site (to be) could be accepted as a valid user, based on the info the server receives when the visitor enters the site. In my case it will be a site for mobile phones and some mobile phone operators will provide me with the telephone-number of the user once she enters. Once a user has paid for the service, this number alone should be enough to make the visitior into a valid user. Without needing to log in. I have read the following on: http://demo.liftweb.net/ws t's easy to dispatch incoming HTTP requests. In your Boot class create a PartialFunction that matches a pattern related to the incoming request and then create a short-lived controller to service the request. This code matches all the requests to /webservices/ and assigns the stuff in '' to the variable c. Then the code attempts to find a public method with that name on the controller. If the method exists, it's invoked and Lift processes the result. I assume I will have to write my own public method and place it where??? in the direcory webservices.? Maven didn't include such a directory in my project set-up, so I assume this webservices are on an external server and that I will have torefer to and extend an existing function. Am I correct in this? and is there an exemple of how to write such a method. I would be really happy to make some progress, and any help is welcome. Thanks, Ko --~--~-~--~~~---~--~~ 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: Started integrating lift in a scala+spring project. Feedback?
On Sat, Oct 3, 2009 at 2:56 AM, rintcius rintc...@gmail.com wrote: Hmm, I am still confused... Maybe better to get into a specific use case. Suppose i have the following: 1) a lift application just serving stuff via the Servlet interface 2) an object in the ServletContext (let's say spring's ApplicationContext) 3) a snippet that does not need a session but needs access to this object in the ServletContext (let's say just some static content but reusing spring's i18n support) How do I get access to this object in the ServletContext from such a snippet? Or are you telling me that this use case makes no sense in Lift? I'm saying don't use open_! The thing you're opening may not contain anything and when it doesn't, you get an exception. See http://blog.lostlake.org/index.php?/archives/50-The-Scala-Option-class-and-how-lift-uses-it.html Rintcius -- 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: execute code when browser is closed
In my app, when the user is done searching on one keyword, they click a link which takes them back to the main search page. Thats the time when I wanted the CometActor to stop. Otherwise there will be too many threads floating around and performance will suffer. On Mon, Oct 5, 2009 at 2:50 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- 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 --~--~-~--~~~---~--~~ 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: execute code when browser is closed
On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.com wrote: In my app, when the user is done searching on one keyword, they click a link which takes them back to the main search page. Thats the time when I wanted the CometActor to stop. Otherwise there will be too many threads floating around and performance will suffer. Why? Actors do not consume threads, they consume memory unless they are actively processing a message. On Mon, Oct 5, 2009 at 2:50 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- 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 -- 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: execute code when browser is closed
Because when the users searches on a new keyword, the actors that were processing the results for the last keyword are still processing (some of them). But I can just send each of those a message to stop processing, no? No problem with that, right? On Mon, Oct 5, 2009 at 3:02 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.comwrote: In my app, when the user is done searching on one keyword, they click a link which takes them back to the main search page. Thats the time when I wanted the CometActor to stop. Otherwise there will be too many threads floating around and performance will suffer. Why? Actors do not consume threads, they consume memory unless they are actively processing a message. On Mon, Oct 5, 2009 at 2:50 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- 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 -- 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 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To
[Lift] Re: MappedStringForeignKey and Schemifier
I know there are a lot of mapper tickets open, but please add this one. I'll spend a day or two this week getting the Mapper tickets closed. On Sat, Oct 3, 2009 at 3:00 AM, Peter Robinett pe...@bubblefoundry.comwrote: I have a model, Node, with a string index. I have another model, Packet, which has a MappedStringForeignKey to Node. Unfortunately, Schemifier doesn't seem to respect the MappedStringForeignKey type and creates a BIGINT column in the packets table, as you can see from its output: INFO - CREATE TABLE packets (temp DOUBLE , id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE KEY , mac BIGINT UNSIGNED , dt DATETIME , mah DOUBLE , lux DOUBLE , rssi DOUBLE) ENGINE = InnoDB INFO - ALTER TABLE packets ADD CONSTRAINT packets_PK PRIMARY KEY(id) INFO - CREATE INDEX packets_mac ON packets ( mac ) Is this a bug? I can override fieldCreatorString for the foreign key but I don't think I should have to. This is with 1.1-SNAPSHOT. Peter And the relevant parts of my models: class Node extends KeyedMapper[String, Node] { def getSingleton = Node /* MAC address as primary key */ def primaryKeyField = mac object mac extends MappedStringIndex(this, 17) with IndexedField [String] { override def dbDisplay_? = true override lazy val defaultValue = randomString(maxLen) /* allow user-defined primary key */ override def writePermission_? = true override def dbAutogenerated_? = false private var myDirty = false override def dirty_? = myDirty override def dirty_?(b : Boolean) = { myDirty = b; super.dirty_?(b) } override def fieldCreatorString(dbType: DriverType, colName: String): String = colName+ CHAR(+maxLen+) NOT NULL } } class Packet extends LongKeyedMapper[Packet] with IdPK { def getSingleton = Packet object node extends MappedStringForeignKey(this, Node, 17) { // Change the default behavior to add a database index for this column. override def dbIndexed_? = true override def dbColumnName = mac } } -- 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: execute code when browser is closed
On Mon, Oct 5, 2009 at 12:06 PM, Jack Widman jack.wid...@gmail.com wrote: Because when the users searches on a new keyword, the actors that were processing the results for the last keyword are still processing (some of them). But I can just send each of those a message to stop processing, no? No problem with that, right? Sure... send them a message that says tell all your jobs to stop. This has nothing to do with the CometActor lifecycle. It is all your application level stuff. On Mon, Oct 5, 2009 at 3:02 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.comwrote: In my app, when the user is done searching on one keyword, they click a link which takes them back to the main search page. Thats the time when I wanted the CometActor to stop. Otherwise there will be too many threads floating around and performance will suffer. Why? Actors do not consume threads, they consume memory unless they are actively processing a message. On Mon, Oct 5, 2009 at 2:50 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- 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 -- Lift, the simply functional web framework http://liftweb.net Beginning Scala
[Lift] Re: execute code when browser is closed
Good. Only thing is that if their job was to start an actor to go out and search some pages, say, then 'stop your job' means ' 'call your 'exit' method, no?Not trying to be a wise guy. I actually have a number of VCs lined up to look at my app. Overall I am very glad to be using Lift. On the Comet alone it save me a LOT of time. Of course, I have a lot to learn. On Mon, Oct 5, 2009 at 3:08 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 12:06 PM, Jack Widman jack.wid...@gmail.comwrote: Because when the users searches on a new keyword, the actors that were processing the results for the last keyword are still processing (some of them). But I can just send each of those a message to stop processing, no? No problem with that, right? Sure... send them a message that says tell all your jobs to stop. This has nothing to do with the CometActor lifecycle. It is all your application level stuff. On Mon, Oct 5, 2009 at 3:02 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.comwrote: In my app, when the user is done searching on one keyword, they click a link which takes them back to the main search page. Thats the time when I wanted the CometActor to stop. Otherwise there will be too many threads floating around and performance will suffer. Why? Actors do not consume threads, they consume memory unless they are actively processing a message. On Mon, Oct 5, 2009 at 2:50 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- Lift, the simply
[Lift] Re: execute code when browser is closed
On Mon, Oct 5, 2009 at 12:13 PM, Jack Widman jack.wid...@gmail.com wrote: Good. Only thing is that if their job was to start an actor to go out and search some pages, say, then 'stop your job' means ' 'call your 'exit' method, no? I have no idea what you application logic looks like, so I don't know what call your exit will do. If you call exit on a CometActor, you'll mess things up (as you've discovered.) But your search shouldn't be taking place in the CometActor. Your search should be taking place on other threads/actors which then report their status back to the CometActor. Not trying to be a wise guy. I actually have a number of VCs lined up to look at my app. Overall I am very glad to be using Lift. On the Comet alone it save me a LOT of time. Of course, I have a lot to learn. On Mon, Oct 5, 2009 at 3:08 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 12:06 PM, Jack Widman jack.wid...@gmail.comwrote: Because when the users searches on a new keyword, the actors that were processing the results for the last keyword are still processing (some of them). But I can just send each of those a message to stop processing, no? No problem with that, right? Sure... send them a message that says tell all your jobs to stop. This has nothing to do with the CometActor lifecycle. It is all your application level stuff. On Mon, Oct 5, 2009 at 3:02 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:53 AM, Jack Widman jack.wid...@gmail.comwrote: In my app, when the user is done searching on one keyword, they click a link which takes them back to the main search page. Thats the time when I wanted the CometActor to stop. Otherwise there will be too many threads floating around and performance will suffer. Why? Actors do not consume threads, they consume memory unless they are actively processing a message. On Mon, Oct 5, 2009 at 2:50 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 11:45 AM, Jack Widman jack.wid...@gmail.comwrote: Interesting. I will try that. And I won't send any more ShutDownMessages :) Though I should add that each CometActor is doing a lot of processing. So I it would be good if I could shut one down somehow when the user searches on a new term. Timeout won't work because there is no way to know how long it will take. Maybe I could just kill all the actors directly that are doing the processing. That's going to be even worse. You'll kill something out from under Lift... it's going to cause a huge pile of pain. You can remove an Actor from the session and that will cause ShutDown to be sent to it, but depending on how the Actor was written it's not going to stop processing its mailbox. Bottom line... there's no way to tell if a user is not looking at a page with an Actor anymore. The best way to deal with that is timing the Actor out. It's going to take time (your timeout period), but it's the best way to do it. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.com wrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com wrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado. .. Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com
[Lift] Re: Overriding superclass member objects (specifically mapped fields)
On Sun, Oct 4, 2009 at 1:17 PM, tommycli tommy...@ucla.edu wrote: In reference to this problem: http://www.nabble.com/-scala--Overriding-superclass-object-member...-td15344451.html This use case in specific: trait Bar { self: Mapper = object barField extends StringField } class Foo extends Mapper with Bar { override barField { override def dbTableName = fruit_bat } } Did this problem ever get solved? Is there a way to override the defined fields of a superclass? No and no and I'm sorry. -- 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: How to stop validations if previous validator returns error.
On Sun, Oct 4, 2009 at 2:12 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. I have found StopValidationOnError trait in Mapper.scala, But I couldn't understand how to use it. Please show me a example. def stopableValMaxLen: (String = List[FieldError]) with StopValidationOnError[String] = new (String = List[FieldError]) with StopValidationOnError[String] { def apply(in: String) = valMaxLen(32, Too long)(in) } thanks. On 9月15日, 午前4:08, David Pollak feeder.of.the.be...@gmail.com wrote: I'll check code in after it passes the reviewboard process that let's you mix in: trait StopValidationOnError[T] extends Function1[T, List[FieldError]] to a validation function such that the validator will stop processing a given field if a validator that has that trait mixed in returns a validation error. On Sun, Sep 6, 2009 at 3:02 PM, ishiijp yoshinori.is...@gmail.com wrote: I'm looking for a way to stop MappedField validations if prefvious validator returns error. For example: object Alphabets extends MappedString(this, 20) { override def validations = valMinLen(1, Alphabets is required) _ :: valRegex(Pattern.compile(^[a-zA-Z]+$, It's not alphabets!) _ :: super.validations } if valMinLen returns error, I don't want to process valRegex. My solutions are (1) define custom validator which works as I want. (2) override MappedField#validate() If you have other ideas, please help me. Thanks in advance. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp 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 to share request scope data among snippets in Lift
On Mon, Oct 5, 2009 at 6:02 PM, Jack Widman jack.wid...@gmail.com wrote: Why don't we make Esperanto the official Lift language? I'd say make Scala the official language ;) On Mon, Oct 5, 2009 at 11:52 AM, marius d. marius.dan...@gmail.comwrote: On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com wrote: Thank you for your example, David. It will work in my purpose. Cool. It seems that my poor English and less information let some people confused. I appreciate that you have put in the work to translate your thoughts to English. I apologize that I only speak English, but would love to speak Japanese, German, Russian, and a few other languages. oh you gotta learn Romanian :) I need just a request scope data. It means I want to share information between snippets across a request. (Is the expression request scope not good for in this case...?) request scope is exactly the right phrase. Thank all responsed my post, and your suggestions are informative. I think very nice community is here. On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote: To share information between snippets during a request, use a RequestVar: object MyInfo extends RequestVar(calculate_value) so object MyInfo extends RequestVar[Box[Invoice]](Empty) in one snippet, you may calculate the Invoice and put it in the MyInfo: MyInfo.set(Full(invoice)) In another snippet, you can extract: for { invoice - MyInfo.is } yield ... Note that the calculate_value is a call-by-name parameter, so it will be invoked each time the RequestVar is uninitialized. You can place lazy calculation logic in here. On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. If my lift application have some data that cost to create, and I want to share it among snippets, how to do in Lift? if such data are shared inside one snippet, I may use lazy val. But I have no nice idea to share it among different snippts. Thanks much. -- 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 -- Jack -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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 to share request scope data among snippets in Lift
Well it is high enough level! [?] On Mon, Oct 5, 2009 at 3:49 PM, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:02 PM, Jack Widman jack.wid...@gmail.com wrote: Why don't we make Esperanto the official Lift language? I'd say make Scala the official language ;) On Mon, Oct 5, 2009 at 11:52 AM, marius d. marius.dan...@gmail.comwrote: On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com wrote: Thank you for your example, David. It will work in my purpose. Cool. It seems that my poor English and less information let some people confused. I appreciate that you have put in the work to translate your thoughts to English. I apologize that I only speak English, but would love to speak Japanese, German, Russian, and a few other languages. oh you gotta learn Romanian :) I need just a request scope data. It means I want to share information between snippets across a request. (Is the expression request scope not good for in this case...?) request scope is exactly the right phrase. Thank all responsed my post, and your suggestions are informative. I think very nice community is here. On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote: To share information between snippets during a request, use a RequestVar: object MyInfo extends RequestVar(calculate_value) so object MyInfo extends RequestVar[Box[Invoice]](Empty) in one snippet, you may calculate the Invoice and put it in the MyInfo: MyInfo.set(Full(invoice)) In another snippet, you can extract: for { invoice - MyInfo.is } yield ... Note that the calculate_value is a call-by-name parameter, so it will be invoked each time the RequestVar is uninitialized. You can place lazy calculation logic in here. On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. If my lift application have some data that cost to create, and I want to share it among snippets, how to do in Lift? if such data are shared inside one snippet, I may use lazy val. But I have no nice idea to share it among different snippts. Thanks much. -- 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 -- Jack -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub -- Jack --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- inline: 330.gif
[Lift] Re: How to share request scope data among snippets in Lift
I was about to offer a smattering of Greek, Swedish and Hungarian (don't ask...) But scala has to take the prize, I wonder if we couldn't implement lojban as a DSL? :) On Mon, Oct 5, 2009 at 8:49 PM, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:02 PM, Jack Widman jack.wid...@gmail.com wrote: Why don't we make Esperanto the official Lift language? I'd say make Scala the official language ;) On Mon, Oct 5, 2009 at 11:52 AM, marius d. marius.dan...@gmail.com wrote: On Oct 5, 6:15 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Oct 4, 2009 at 2:41 AM, ishiijp yoshinori.is...@gmail.com wrote: Thank you for your example, David. It will work in my purpose. Cool. It seems that my poor English and less information let some people confused. I appreciate that you have put in the work to translate your thoughts to English. I apologize that I only speak English, but would love to speak Japanese, German, Russian, and a few other languages. oh you gotta learn Romanian :) I need just a request scope data. It means I want to share information between snippets across a request. (Is the expression request scope not good for in this case...?) request scope is exactly the right phrase. Thank all responsed my post, and your suggestions are informative. I think very nice community is here. On 9月26日, 午後10:33, David Pollak feeder.of.the.be...@gmail.com wrote: To share information between snippets during a request, use a RequestVar: object MyInfo extends RequestVar(calculate_value) so object MyInfo extends RequestVar[Box[Invoice]](Empty) in one snippet, you may calculate the Invoice and put it in the MyInfo: MyInfo.set(Full(invoice)) In another snippet, you can extract: for { invoice - MyInfo.is } yield ... Note that the calculate_value is a call-by-name parameter, so it will be invoked each time the RequestVar is uninitialized. You can place lazy calculation logic in here. On Sat, Sep 26, 2009 at 12:14 AM, ishiijp yoshinori.is...@gmail.com wrote: Hi. If my lift application have some data that cost to create, and I want to share it among snippets, how to do in Lift? if such data are shared inside one snippet, I may use lazy val. But I have no nice idea to share it among different snippts. Thanks much. -- 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 -- Jack -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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: MappedStringForeignKey and Schemifier
Thanks, David. Here is the ticket: http://github.com/dpp/liftweb/issues/#issue/79 Peter On Oct 5, 9:06 pm, David Pollak feeder.of.the.be...@gmail.com wrote: I know there are a lot of mapper tickets open, but please add this one. I'll spend a day or two this week getting the Mapper tickets closed. On Sat, Oct 3, 2009 at 3:00 AM, Peter Robinett pe...@bubblefoundry.comwrote: I have a model, Node, with a string index. I have another model, Packet, which has a MappedStringForeignKey to Node. Unfortunately, Schemifier doesn't seem to respect the MappedStringForeignKey type and creates a BIGINT column in the packets table, as you can see from its output: INFO - CREATE TABLE packets (temp DOUBLE , id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE KEY , mac BIGINT UNSIGNED , dt DATETIME , mah DOUBLE , lux DOUBLE , rssi DOUBLE) ENGINE = InnoDB INFO - ALTER TABLE packets ADD CONSTRAINT packets_PK PRIMARY KEY(id) INFO - CREATE INDEX packets_mac ON packets ( mac ) Is this a bug? I can override fieldCreatorString for the foreign key but I don't think I should have to. This is with 1.1-SNAPSHOT. Peter And the relevant parts of my models: class Node extends KeyedMapper[String, Node] { def getSingleton = Node /* MAC address as primary key */ def primaryKeyField = mac object mac extends MappedStringIndex(this, 17) with IndexedField [String] { override def dbDisplay_? = true override lazy val defaultValue = randomString(maxLen) /* allow user-defined primary key */ override def writePermission_? = true override def dbAutogenerated_? = false private var myDirty = false override def dirty_? = myDirty override def dirty_?(b : Boolean) = { myDirty = b; super.dirty_?(b) } override def fieldCreatorString(dbType: DriverType, colName: String): String = colName+ CHAR(+maxLen+) NOT NULL } } class Packet extends LongKeyedMapper[Packet] with IdPK { def getSingleton = Packet object node extends MappedStringForeignKey(this, Node, 17) { // Change the default behavior to add a database index for this column. override def dbIndexed_? = true override def dbColumnName = mac } } -- 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: redirectTo throwing net.liftweb.http.ResponseShortcutException: Shortcut
I'm not familiar with JsCmds etc., but you are calling registerThisSnippet in the code that gets invoked by the ajax button. What needs to happen somehow, if it's possible, is that after it redirects, triggering a new request, you have to call registerThisSnippet in that request. As you pointed out that's possible with StatefulSnippet.redirect/S.redirectWithState. Looking at the source code for JsCmds.RedirectTo, the problem is as follows: It's not a server side redirect; it's sending a window.location=... javascript statement to be executed. If you can't get it to use a server side redirect, what you may have to do is register a function and modify the URL passed to JsCmds.RedirectTo to include its name. I noticed there's a method S.mapFuncToURI--does that do what you need? On Mon, Oct 5, 2009 at 3:45 PM, David david.b...@gmail.com wrote: Ok so I tried using registerThisSnippet: save - SHtml.ajaxButton( Save, {() = registerThisSnippet println(currentSnippet: + S.currentSnippet) JsCmds.RedirectTo(/workflow/index) }) Maybe I am doing something wrong. The redirect happens, but then when in my StatefulSnippet, I cannot access variables that were previously set. I believe that this JsCmds.RedirectTo() is not setting the function name in the query string as if I were using StatefulSnippet.redirect or StatefulSnippet.link. Also, I checked to see if the currentSnippet is set, it prints: currentSnippet: Empty Thanks, for any help. -Dave On Sep 25, 2:12 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Try calling registerThisSnippet in the redirect function. - Daviddavid.b...@gmail.com wrote: Thank you, that mostly worked! I forgot to mention that I'm using StatefulSnippet, and the place where the redirect is happening should redirect to a different url, but the different url is backed by the same StatefulSnippet instance. So when I use JsCmds.RedirectToI'm not getting the same StatefulSnippet instance. Is there a way to redirect that will preserve my StatefulSnippet instance? url/a(StatefulSnippet) - links to url/b(StatefulSnippet) using super.link() url/b - redirects back to url/a url/a is a grid, with a starting 'page' number, and url/b is a edit form. When the user is done with url/b they click 'save' which sends them back to url/a, hopefully at the same place in the grid. When returning to the grid from the edit page, the grid is reloading from the beginning. I need a way to preserve the original StatefulSnippet instance. Thanks, Dave On Sep 25, 4:26 am, Timothy Perrett timo...@getintheloop.eu wrote: Just realised your using ajaxForm... in that case you need to do RedirectToJsCmd which will effectively send a window.location.href to the browser. Cheers, Tim On 24 Sep 2009, at 21:49, David wrote: Hello lifters, I have the following form and bind: SHtml.ajaxForm( bind(ajax, xhtml, view - doView _, save - SHtml.ajaxButton( Save, {() = Log.info(Got a 'save' AJAX call) this.redirectTo(/redirect1) //workflow/index2 }, (class, ui-state-default ui-corner-all When the 'Save' ajax button is called, the redirect should be invoked, that is working. However I get the exception below. Based on what I've read, this exception should be handled by lift. I don't have any explicit exception handling in my code. Is there a bug here, is my redirect correct? I've also tried adding this to my Boot.scala: LiftRules.dispatch.prepend { case Req(redirect1 :: _, _, _) = () = Full(RedirectWithState(/workflow/index2, RedirectState(() = println(Called on redirect!), My error - NoticeType.Error))) Thanks for any suggestions or help. -Dave 16:44:14.097 [12569...@qtp-1983971-5] WARN lift.warn:114 - Request for /ajax_request/F664660567847L4N/ failed Shortcut net.liftweb.http.ResponseShortcutException: Shortcut at net.liftweb.http.ResponseShortcutException$.redirect (ResponseShortcutException.scala:31) [lift-webkit-1.1-SNAPSHOT.jar:na] at net.liftweb.http.ResponseShortcutException$.redirect (ResponseShortcutException.scala:35) [lift-webkit-1.1-SNAPSHOT.jar:na] at net.liftweb.http.S$.redirectTo(S.scala:759) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.StatefulSnippet$class.redirectTo(Stateful.scala: 77) [lift-webkit-1.1-SNAPSHOT.jar:na] at snippet.Workflow.redirectTo(Workflow.scala:31) [classes/:na] at snippet.Workflow$$anonfun$edit$2.apply(Workflow.scala:151) [classes/:na] at snippet.Workflow$$anonfun$edit$2.apply(Workflow.scala:149) [classes/:na] at
[Lift] Re: lift-json and attributes
Thanks Richard! This is a feature request and I just committed an implementation to my branch. I modified existing example to contain few attributes to show how they are mapped: http://github.com/dpp/liftweb/blob/joni_wip_xml/lift-json/src/test/scala/net/liftweb/json/XmlExamples.scala If other committers give it the green light I will push it to master. Cheers Joni On Oct 5, 5:41 pm, Richard Dallaway dalla...@gmail.com wrote: Loving the new lift-json code. We've been producing XML for a REST API, and now need to produce JSON. lift-json to the rescue, except...the Xml converter doesn't handle attributes: scala val xml = user id=7nameBert/name/user xml: scala.xml.Elem = user id=7nameBert/name/user scala val json = toJson(xml) json: net.liftweb.json.JsonAST.JValue = JObject(List(JField(user,JObject(List(JField(name,JString(Bert))) scala JsonDSL.compact(JsonAST.render(json)) res5: String = {user:{name:Bert}} I'd expect res5 to be something like: {user:{id:7,name:Bert}} I'm either missing a clue, or this is a feature request. I can see there's ambiguity in how you might map the above JSON back to XML with attributes, but it seems reasonable that if you have XML + attributes they would be present in a JSON representation. Thank you Richard --~--~-~--~~~---~--~~ 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: redirectTo throwing net.liftweb.http.ResponseShortcutException: Shortcut
Try: S.fmapFunc(registerThisSnippet)(binding = JsCmds.RedirectTo(/ workflow/index? + binding + =_)) ? I'm not sure this is the right way to do it, but I think that should work. -Ross On Oct 5, 2009, at 3:45 PM, David wrote: Ok so I tried using registerThisSnippet: save - SHtml.ajaxButton( Save, {() = registerThisSnippet println(currentSnippet: + S.currentSnippet) JsCmds.RedirectTo(/workflow/index) }) Maybe I am doing something wrong. The redirect happens, but then when in my StatefulSnippet, I cannot access variables that were previously set. I believe that this JsCmds.RedirectTo() is not setting the function name in the query string as if I were using StatefulSnippet.redirect or StatefulSnippet.link. Also, I checked to see if the currentSnippet is set, it prints: currentSnippet: Empty Thanks, for any help. -Dave On Sep 25, 2:12 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Try calling registerThisSnippet in the redirect function. - Daviddavid.b...@gmail.com wrote: Thank you, that mostly worked! I forgot to mention that I'm using StatefulSnippet, and the place where the redirect is happening should redirect to a different url, but the different url is backed by the same StatefulSnippet instance. So when I use JsCmds.RedirectToI'm not getting the same StatefulSnippet instance. Is there a way to redirect that will preserve my StatefulSnippet instance? url/a(StatefulSnippet) - links to url/b(StatefulSnippet) using super.link() url/b - redirects back to url/a url/a is a grid, with a starting 'page' number, and url/b is a edit form. When the user is done with url/b they click 'save' which sends them back to url/a, hopefully at the same place in the grid. When returning to the grid from the edit page, the grid is reloading from the beginning. I need a way to preserve the original StatefulSnippet instance. Thanks, Dave On Sep 25, 4:26 am, Timothy Perrett timo...@getintheloop.eu wrote: Just realised your using ajaxForm... in that case you need to do RedirectToJsCmd which will effectively send a window.location.href to the browser. Cheers, Tim On 24 Sep 2009, at 21:49, David wrote: Hello lifters, I have the following form and bind: SHtml.ajaxForm( bind(ajax, xhtml, view - doView _, save - SHtml.ajaxButton( Save, {() = Log.info(Got a 'save' AJAX call) this.redirectTo(/redirect1) //workflow/index2 }, (class, ui-state-default ui-corner-all When the 'Save' ajax button is called, the redirect should be invoked, that is working. However I get the exception below. Based on what I've read, this exception should be handled by lift. I don't have any explicit exception handling in my code. Is there a bug here, is my redirect correct? I've also tried adding this to my Boot.scala: LiftRules.dispatch.prepend { case Req(redirect1 :: _, _, _) = () = Full(RedirectWithState(/workflow/index2, RedirectState(() = println(Called on redirect!), My error - NoticeType.Error))) Thanks for any suggestions or help. -Dave 16:44:14.097 [12569...@qtp-1983971-5] WARN lift.warn:114 - Request for /ajax_request/F664660567847L4N/ failed Shortcut net.liftweb.http.ResponseShortcutException: Shortcut at net.liftweb.http.ResponseShortcutException$.redirect (ResponseShortcutException.scala:31) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.ResponseShortcutException$.redirect (ResponseShortcutException.scala:35) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.S$.redirectTo(S.scala:759) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.StatefulSnippet$class.redirectTo (Stateful.scala: 77) [lift-webkit-1.1-SNAPSHOT.jar:na] at snippet.Workflow.redirectTo(Workflow.scala:31) [classes/:na] at snippet.Workflow$$anonfun$edit$2.apply(Workflow.scala:151) [classes/:na] at snippet.Workflow$$anonfun$edit$2.apply(Workflow.scala:149) [classes/:na] at net.liftweb.http.S$NFuncHolder$$anonfun$apply$40.apply (S.scala: 1843) [lift-webkit-1.1-SNAPSHOT.jar:na] at net.liftweb.http.S$NFuncHolder$$anonfun$apply$40.apply (S.scala: 1843) [lift-webkit-1.1-SNAPSHOT.jar:na] at scala.List.map(List.scala:812) [scala-library-2.7.5.jar:na] at net.liftweb.http.S$NFuncHolder.apply(S.scala:1843) [lift- webkit-1.1-SNAPSHOT.jar:na] at net.liftweb.http.LiftSession$$anonfun$buildFunc$1$2.apply (LiftSession.scala:323) [lift-webkit-1.1-SNAPSHOT.jar:na] at net.liftweb.http.LiftSession$$anonfun$6$$anonfun$apply $17.apply (LiftSession.scala:338) [lift-webkit-1.1-SNAPSHOT.jar:na] at net.liftweb.http.LiftSession$$anonfun$6$$anonfun$apply $17.apply
[Lift] Re: YUI Compressor Fatal Error
Ross, I am using OpenJDK: $ java -version java version 1.6.0_0 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) Is it possible to use YUI Compressor at all with OpenJDK? Peter On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote: I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO] task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced (Launcher.java: 315) at org.codehaus.classworlds.Launcher.launch(Launcher.java: 255) at org.codehaus.classworlds.Launcher.mainWithExitCode
[Lift] Re: redirectTo throwing net.liftweb.http.ResponseShortcutException: Shortcut
That worked! Thank you for such a quick response. I only had to make one change, as posted I got: found : Unit required: net.liftweb.http.S.AFuncHolder S.fmapFunc(registerThisSnippet)(binding = JsCmds.RedirectTo(/workflow/index? + binding + =_)) Changed to: S.fmapFunc(() = registerThisSnippet)(binding = JsCmds.RedirectTo(/ workflow/index? + binding + =_)) And it works like a charm. Lifters are the best! -Dave On Oct 5, 4:00 pm, Ross Mellgren dri...@gmail.com wrote: Try: S.fmapFunc(registerThisSnippet)(binding = JsCmds.RedirectTo(/ workflow/index? + binding + =_)) ? I'm not sure this is the right way to do it, but I think that should work. -Ross On Oct 5, 2009, at 3:45 PM, David wrote: Ok so I tried using registerThisSnippet: save - SHtml.ajaxButton( Save, {() = registerThisSnippet println(currentSnippet: + S.currentSnippet) JsCmds.RedirectTo(/workflow/index) }) Maybe I am doing something wrong. The redirect happens, but then when in my StatefulSnippet, I cannot access variables that were previously set. I believe that this JsCmds.RedirectTo() is not setting the function name in the query string as if I were using StatefulSnippet.redirect or StatefulSnippet.link. Also, I checked to see if the currentSnippet is set, it prints: currentSnippet: Empty Thanks, for any help. -Dave On Sep 25, 2:12 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Try calling registerThisSnippet in the redirect function. - Daviddavid.b...@gmail.com wrote: Thank you, that mostly worked! I forgot to mention that I'm using StatefulSnippet, and the place where the redirect is happening should redirect to a different url, but the different url is backed by the same StatefulSnippet instance. So when I use JsCmds.RedirectToI'm not getting the same StatefulSnippet instance. Is there a way to redirect that will preserve my StatefulSnippet instance? url/a(StatefulSnippet) - links to url/b(StatefulSnippet) using super.link() url/b - redirects back to url/a url/a is a grid, with a starting 'page' number, and url/b is a edit form. When the user is done with url/b they click 'save' which sends them back to url/a, hopefully at the same place in the grid. When returning to the grid from the edit page, the grid is reloading from the beginning. I need a way to preserve the original StatefulSnippet instance. Thanks, Dave On Sep 25, 4:26 am, Timothy Perrett timo...@getintheloop.eu wrote: Just realised your using ajaxForm... in that case you need to do RedirectToJsCmd which will effectively send a window.location.href to the browser. Cheers, Tim On 24 Sep 2009, at 21:49, David wrote: Hello lifters, I have the following form and bind: SHtml.ajaxForm( bind(ajax, xhtml, view - doView _, save - SHtml.ajaxButton( Save, {() = Log.info(Got a 'save' AJAX call) this.redirectTo(/redirect1) //workflow/index2 }, (class, ui-state-default ui-corner-all When the 'Save' ajax button is called, the redirect should be invoked, that is working. However I get the exception below. Based on what I've read, this exception should be handled by lift. I don't have any explicit exception handling in my code. Is there a bug here, is my redirect correct? I've also tried adding this to my Boot.scala: LiftRules.dispatch.prepend { case Req(redirect1 :: _, _, _) = () = Full(RedirectWithState(/workflow/index2, RedirectState(() = println(Called on redirect!), My error - NoticeType.Error))) Thanks for any suggestions or help. -Dave 16:44:14.097 [12569...@qtp-1983971-5] WARN lift.warn:114 - Request for /ajax_request/F664660567847L4N/ failed Shortcut net.liftweb.http.ResponseShortcutException: Shortcut at net.liftweb.http.ResponseShortcutException$.redirect (ResponseShortcutException.scala:31) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.ResponseShortcutException$.redirect (ResponseShortcutException.scala:35) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.S$.redirectTo(S.scala:759) [lift-webkit-1.1- SNAPSHOT.jar:na] at net.liftweb.http.StatefulSnippet$class.redirectTo (Stateful.scala: 77) [lift-webkit-1.1-SNAPSHOT.jar:na] at snippet.Workflow.redirectTo(Workflow.scala:31) [classes/:na] at snippet.Workflow$$anonfun$edit$2.apply(Workflow.scala:151) [classes/:na] at snippet.Workflow$$anonfun$edit$2.apply(Workflow.scala:149) [classes/:na] at net.liftweb.http.S$NFuncHolder$$anonfun$apply$40.apply (S.scala: 1843) [lift-webkit-1.1-SNAPSHOT.jar:na] at
[Lift] Re: Possible lift-json bug in Xml.toJson
Yes, that's exactly what happens here. David, do you know if this should be considered a bug in Scala XML or should lift-json be able to merge those Text() nodes? Cheers Joni On Oct 5, 9:46 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Hmmm looks like there might be multiple Text() nodes in the icon node and the parser isn't picking them up as one piece of text. Might be worthy of a ticket. On Mon, Oct 5, 2009 at 11:31 AM, harryh har...@gmail.com wrote: More info. If the code that generates the XML looks like this: icon{http://harryh.org+theUri}/icon everything is fine, but it breaks when like this: iconhttp://harryh.org{theUrl}/icon -harryh On Oct 5, 2:22 pm, harryh har...@gmail.com wrote: Xml.toJson (in M5) is converting this: iconhttp://harryh.org/img/icons/foo.png/icon to this: JField(icon, JObject(Nil)) Is there some special handling of URLs going on here that might be causing me problems? -harryh -- 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: YUI Compressor Fatal Error
I don't remember hearing any solution that involved staying with OpenJDK in the original thread -- I personally use the Sun JDK and so never noticed this problem. With ubuntu you can add the Sun JDK by installing the sun-java-6-jdk package. Then you have to fiddle with /etc/alternatives to repoint at it. -Ross On Oct 5, 2009, at 4:10 PM, Peter Robinett wrote: Ross, I am using OpenJDK: $ java -version java version 1.6.0_0 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) Is it possible to use YUI Compressor at all with OpenJDK? Peter On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote: I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at
[Lift] Git wiki formatting
Can someone please fix the formatting on http://wiki.github.com/dpp/liftweb/example-paginating-mapper-based-snippets-with-sortable-headers ? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift nearly inaccessible for newby
hi Naftoli, thanks for your interest. On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Being a non-programmer, and additionally not having a Java background, which framework are you comparing Lift to when you say it's not easy? :) First I read a book about rails, explaining things from the start, I did watch quite a lot of nice video's on the web explaining some basic tricks with Rails. I think it is a system that is easy to start with but I became nervous about recurring issues about scaling, the integration of Rails and Merb and had the idea, maybe wrong, that it was a system too much in transition. I read part of the tutorial of Lift, installed it on my computer using Maven, but in a way I got lost. Then I partially read a book about Wicket. I like the system very much, especially one trick exited me: the Ajaxfallbacklink in which a link worked in a simple way when javasript is disabled , but at the same time has some Ajax functionality when Javascript is enabled on the users system. I liked this feature very much, but the integration with a database is not an integral part of the Wicket-system and can be acquired via a Wicket-Spring-Hibernate combination. This seemed too much for me to get into as a starter. That's how I came back to Lift. I need a stable database-connection. You need one when you hope that people will be paying some, even small, amount of money for your service. Can you clarify: Is this going to be a site, or a back end to a mobile app that sits on the phone? I just want to make a site But I hope it is clear I am not here to criticise anybody, it is just that often I feel this system is way over my head. Maybe that will change. thanks Ko On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote: Hi, Being a no-programmer and having no Java-background I'd like to have mentioned that Lift really isn't an easy framework. Having said that, I will try to read my way into this system and try to solve the problems I encounter. I have one question. I would like to establish a login method where a visitor of my site (to be) could be accepted as a valid user, based on the info the server receives when the visitor enters the site. In my case it will be a site for mobile phones and some mobile phone operators will provide me with the telephone-number of the user once she enters. Once a user has paid for the service, this number alone should be enough to make the visitior into a valid user. Without needing to log in. I have read the following on:http://demo.liftweb.net/ws t's easy to dispatch incoming HTTP requests. In your Boot class create a PartialFunction that matches a pattern related to the incoming request and then create a short-lived controller to service the request. This code matches all the requests to /webservices/ and assigns the stuff in '' to the variable c. Then the code attempts to find a public method with that name on the controller. If the method exists, it's invoked and Lift processes the result. I assume I will have to write my own public method and place it where??? in the direcory webservices.? Maven didn't include such a directory in my project set-up, so I assume this webservices are on an external server and that I will have torefer to and extend an existing function. Am I correct in this? and is there an exemple of how to write such a method. I would be really happy to make some progress, and any help is welcome. Thanks, Ko --~--~-~--~~~---~--~~ 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 to share request scope data among snippets in Lift
Call me old fashioned, but good ol' English seems to be quite prevalent these days ;-) On 5 Oct 2009, at 17:02, Jack Widman wrote: Why don't we make Esperanto the official Lift language? --~--~-~--~~~---~--~~ 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 deploy yours?
Id say that it would be easier to use a match statement as part of the val assignment... The current code is just using reflection, so factoring into a case statement shouldnt be too tough right? Thoughts? Cheers, Tim On 5 Oct 2009, at 16:48, Indrajit Raychaudhuri wrote: On 05/10/09 5:29 PM, Timothy Perrett wrote: So I just wrote a Jetty 6 wrapper - getting the packaging working was not ideal and not as flexible as Jetty 7 jetty-runner. Yes, just took a look at jetty-runner. Feature wise, it's blows away the older mechanism man! Any thoughts in and around altering the lift code to adjust the package based on jetty version? I can think of two options basically: 1. Move to jetty 7 and be done with it. 2. Allowing user option (via -Djetty.version) during archetype:generate. jetty.version can be an overridable archetype property that defaults to (say 6) but user can do -Djetty.version=7. Depending on the jetty version, the *.scala, *.xml etc. can be filtered to make the right kind of adjustment during archetype creation. Cheers, Indrajit Cheers, Tim On Oct 5, 9:07 am, Timothy Perretttimo...@getintheloop.eu wrote: Indrajit, Your right, jetty-runner is Jetty 7. The only tie we have to Jetty 6 would be this line: val cc = Class.forName (org.mortbay.util.ajax.ContinuationSupport) It would be trivial to add a match or whatever that determined the correct type to use... The question is, why haven't we done this already? I suspect its just a time / capacity issue but wanted to check. I know I could write a jetty 6 wrapper, but that is my fallback position as something more OOTB would be preferable. Cheers, Tim On Oct 5, 8:29 am, Indrajit Raychaudhuriindraj...@gmail.com wrote: Tim, Interestingly, we are trying out something similar in a project here and this is absolutely cool stuff. In fact, Zimbra Desktop does this too. Pure Prism+Jetty bundled as 'desktop application'. That you can have 'double-click' friendly application helps :-) Few notes: 1. Embedding Jetty server is super easy with org.mortbay.jetty.Server. Something that we have in Lift - well almost ;-) The RunWebApp in the archetypes are primitive use case of such. [1] 2. Jetty Runner is available only on Jetty 7.x series I think (not certain). But yes, looks good either way. 3. Jetty has this clean and nice way of having web-app specific jetty config tucked inside the application (war or expanded) within WEB-INF/jetty-web.xml which is basically an XmlConfiguration instance applied on the specific WebApplicationContext instead of the Container Context. [2] 4. An archetype that does self deploying is something that I have on my todo-list. Do you think this would make sense? 5. Maven assembly plugin would do. I haven't tried this myself, but Maven shade plugin looks something close. [3] [1]http://docs.codehaus.org/display/JETTY/Embedding+Jetty [2]http://docs.codehaus.org/display/JETTY/jetty-web.xml [3]http://maven.apache.org/plugins/maven-shade-plugin/ Cheers, Indrajit NB: Looks like quite a few night owl here! On 05/10/09 4:11 AM, Timothy Perrett wrote: Viktor, you and I should not be up this late on a sunday! ;-) You have to see this:http://blogs.webtide.com/janb/entry/ jetty_runner Im going to hash this together as a maven assembly; if it works, then i'll write a blog and stuff it on the wiki... this could really make self deploying apps very nice indeed. I'll check with DavidB, but im fairly sure it would also be trivial to make a little maven plugin that builds a single JAR output... Cheers, Tim On Oct 4, 11:10 pm, Viktor Klangviktor.kl...@gmail.comwrote: Thanks for the linky, mate! Was a good read :) On Sun, Oct 4, 2009 at 11:45 PM, Timothy Perretttimo...@getintheloop.euwrote: Just some more fuel for this debate: http://technically.us/code/x/to-jettison-geronimo/ Cheers, Tim On Oct 4, 8:46 pm, Timothy Perretttimo...@getintheloop.eu wrote: Guys, Of late i've been having several discussions with people about how they deploy there lift apps... So, how do you deploy yours? Specifically, how are people managing multiple apps in one install of jetty? Or, alternatively, how are you embedded jetty so you have an executable JAR? Im using Winstone for apps that dont use Comet because the package is so slick (thanks DavidB), but now, I really really want to be able to embed jetty so I have an executable JAR in the same vein as Winstone. As time moves on, I feel like this is more and more important and we dont current have a defined path for n00bs. Cheers, Tim -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub
[Lift] Re: How to share request scope data among snippets in Lift
On Mon, Oct 5, 2009 at 9:35 AM, Timothy Perrett timo...@getintheloop.euwrote: Call me old fashioned, but good ol' English seems to be quite prevalent these days ;-) Is this the Queen's English? ;-) On 5 Oct 2009, at 17:02, Jack Widman wrote: Why don't we make Esperanto the official Lift language? -- 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 nearly inaccessible for newby
If it's a site how will it know the phone number? On Mon, Oct 5, 2009 at 5:44 PM, koveen liep...@xs4all.nl wrote: hi Naftoli, thanks for your interest. On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Being a non-programmer, and additionally not having a Java background, which framework are you comparing Lift to when you say it's not easy? :) First I read a book about rails, explaining things from the start, I did watch quite a lot of nice video's on the web explaining some basic tricks with Rails. I think it is a system that is easy to start with but I became nervous about recurring issues about scaling, the integration of Rails and Merb and had the idea, maybe wrong, that it was a system too much in transition. I read part of the tutorial of Lift, installed it on my computer using Maven, but in a way I got lost. Then I partially read a book about Wicket. I like the system very much, especially one trick exited me: the Ajaxfallbacklink in which a link worked in a simple way when javasript is disabled , but at the same time has some Ajax functionality when Javascript is enabled on the users system. I liked this feature very much, but the integration with a database is not an integral part of the Wicket-system and can be acquired via a Wicket-Spring-Hibernate combination. This seemed too much for me to get into as a starter. That's how I came back to Lift. I need a stable database-connection. You need one when you hope that people will be paying some, even small, amount of money for your service. Can you clarify: Is this going to be a site, or a back end to a mobile app that sits on the phone? I just want to make a site But I hope it is clear I am not here to criticise anybody, it is just that often I feel this system is way over my head. Maybe that will change. thanks Ko On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote: Hi, Being a no-programmer and having no Java-background I'd like to have mentioned that Lift really isn't an easy framework. Having said that, I will try to read my way into this system and try to solve the problems I encounter. I have one question. I would like to establish a login method where a visitor of my site (to be) could be accepted as a valid user, based on the info the server receives when the visitor enters the site. In my case it will be a site for mobile phones and some mobile phone operators will provide me with the telephone-number of the user once she enters. Once a user has paid for the service, this number alone should be enough to make the visitior into a valid user. Without needing to log in. I have read the following on:http://demo.liftweb.net/ws t's easy to dispatch incoming HTTP requests. In your Boot class create a PartialFunction that matches a pattern related to the incoming request and then create a short-lived controller to service the request. This code matches all the requests to /webservices/ and assigns the stuff in '' to the variable c. Then the code attempts to find a public method with that name on the controller. If the method exists, it's invoked and Lift processes the result. I assume I will have to write my own public method and place it where??? in the direcory webservices.? Maven didn't include such a directory in my project set-up, so I assume this webservices are on an external server and that I will have torefer to and extend an existing function. Am I correct in this? and is there an exemple of how to write such a method. I would be really happy to make some progress, and any help is welcome. Thanks, Ko --~--~-~--~~~---~--~~ 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 nearly inaccessible for newby
And if it's a site why do you want web services? On Mon, Oct 5, 2009 at 5:53 PM, Naftoli Gugenheim naftoli...@gmail.com wrote: If it's a site how will it know the phone number? On Mon, Oct 5, 2009 at 5:44 PM, koveen liep...@xs4all.nl wrote: hi Naftoli, thanks for your interest. On Oct 5, 10:50 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Being a non-programmer, and additionally not having a Java background, which framework are you comparing Lift to when you say it's not easy? :) First I read a book about rails, explaining things from the start, I did watch quite a lot of nice video's on the web explaining some basic tricks with Rails. I think it is a system that is easy to start with but I became nervous about recurring issues about scaling, the integration of Rails and Merb and had the idea, maybe wrong, that it was a system too much in transition. I read part of the tutorial of Lift, installed it on my computer using Maven, but in a way I got lost. Then I partially read a book about Wicket. I like the system very much, especially one trick exited me: the Ajaxfallbacklink in which a link worked in a simple way when javasript is disabled , but at the same time has some Ajax functionality when Javascript is enabled on the users system. I liked this feature very much, but the integration with a database is not an integral part of the Wicket-system and can be acquired via a Wicket-Spring-Hibernate combination. This seemed too much for me to get into as a starter. That's how I came back to Lift. I need a stable database-connection. You need one when you hope that people will be paying some, even small, amount of money for your service. Can you clarify: Is this going to be a site, or a back end to a mobile app that sits on the phone? I just want to make a site But I hope it is clear I am not here to criticise anybody, it is just that often I feel this system is way over my head. Maybe that will change. thanks Ko On Mon, Oct 5, 2009 at 2:32 PM, koveen liep...@xs4all.nl wrote: Hi, Being a no-programmer and having no Java-background I'd like to have mentioned that Lift really isn't an easy framework. Having said that, I will try to read my way into this system and try to solve the problems I encounter. I have one question. I would like to establish a login method where a visitor of my site (to be) could be accepted as a valid user, based on the info the server receives when the visitor enters the site. In my case it will be a site for mobile phones and some mobile phone operators will provide me with the telephone-number of the user once she enters. Once a user has paid for the service, this number alone should be enough to make the visitior into a valid user. Without needing to log in. I have read the following on:http://demo.liftweb.net/ws t's easy to dispatch incoming HTTP requests. In your Boot class create a PartialFunction that matches a pattern related to the incoming request and then create a short-lived controller to service the request. This code matches all the requests to /webservices/ and assigns the stuff in '' to the variable c. Then the code attempts to find a public method with that name on the controller. If the method exists, it's invoked and Lift processes the result. I assume I will have to write my own public method and place it where??? in the direcory webservices.? Maven didn't include such a directory in my project set-up, so I assume this webservices are on an external server and that I will have torefer to and extend an existing function. Am I correct in this? and is there an exemple of how to write such a method. I would be really happy to make some progress, and any help is welcome. Thanks, Ko --~--~-~--~~~---~--~~ 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 to share request scope data among snippets in Lift
I'm not sure English is Turing Complete. Also not sure how prominent it will be in 50 years ... :) On Mon, Oct 5, 2009 at 5:51 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 9:35 AM, Timothy Perrett timo...@getintheloop.euwrote: Call me old fashioned, but good ol' English seems to be quite prevalent these days ;-) Is this the Queen's English? ;-) On 5 Oct 2009, at 17:02, Jack Widman wrote: Why don't we make Esperanto the official Lift language? -- 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 --~--~-~--~~~---~--~~ 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 to share request scope data among snippets in Lift
On Mon, Oct 5, 2009 at 10:54 PM, Jack Widman jack.wid...@gmail.com wrote: I'm not sure English is Turing Complete. Also not sure how prominent it will be in 50 years ... :) Nor I, but I'm certain that Turing was (Queen's) English complete... :) On Mon, Oct 5, 2009 at 5:51 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Oct 5, 2009 at 9:35 AM, Timothy Perrett timo...@getintheloop.eu wrote: Call me old fashioned, but good ol' English seems to be quite prevalent these days ;-) Is this the Queen's English? ;-) On 5 Oct 2009, at 17:02, Jack Widman wrote: Why don't we make Esperanto the official Lift language? -- 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 --~--~-~--~~~---~--~~ 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 to share request scope data among snippets in Lift
Only the Queen speaks the queens english - your average schmuck on this isle can only just about manage to string together a sentence! HAHA. Cheers, Tim On 5 Oct 2009, at 22:51, David Pollak wrote: On Mon, Oct 5, 2009 at 9:35 AM, Timothy Perrett timo...@getintheloop.eu wrote: Call me old fashioned, but good ol' English seems to be quite prevalent these days ;-) Is this the Queen's English? ;-) On 5 Oct 2009, at 17:02, Jack Widman wrote: Why don't we make Esperanto the official Lift language? --~--~-~--~~~---~--~~ 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: YUI Compressor Fatal Error
I'm setting up an OpenJDK ubuntu instance to test On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett pe...@bubblefoundry.comwrote: Ross, I am using OpenJDK: $ java -version java version 1.6.0_0 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) Is it possible to use YUI Compressor at all with OpenJDK? Peter On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote: I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at
[Lift] Re: Possible lift-json bug in Xml.toJson
On Mon, Oct 5, 2009 at 1:19 PM, Joni Freeman freeman.j...@gmail.com wrote: Yes, that's exactly what happens here. David, do you know if this should be considered a bug in Scala XML or should lift-json be able to merge those Text() nodes? I don't think it's a bug in Scala's XML representation. I think that the json library needs to handle this case as well as the Group() related cases (e.g., Group(Text(..), Text(..))) Cheers Joni On Oct 5, 9:46 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Hmmm looks like there might be multiple Text() nodes in the icon node and the parser isn't picking them up as one piece of text. Might be worthy of a ticket. On Mon, Oct 5, 2009 at 11:31 AM, harryh har...@gmail.com wrote: More info. If the code that generates the XML looks like this: icon{http://harryh.org+theUri}/icon everything is fine, but it breaks when like this: iconhttp://harryh.org{theUrl}/icon -harryh On Oct 5, 2:22 pm, harryh har...@gmail.com wrote: Xml.toJson (in M5) is converting this: iconhttp://harryh.org/img/icons/foo.png/icon to this: JField(icon, JObject(Nil)) Is there some special handling of URLs going on here that might be causing me problems? -harryh -- 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] Oauth
Just came across http://scala-tools.org/mvnsites/liftweb-1.0/lift-oauth/license.html while browsing for updates. Is this project near a release stage, I'd love to get my hands on some apache 2.0 version of the code. As someone still very new to web programming is there some way I can contribute? --~--~-~--~~~---~--~~ 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] SessionVar within Actors
Hey guys, Been playing with this for a little while now and I cant remember what the scenario is for setting sessionvars from an actor? (thats a plain actor, not a comet actor) I remember there is some issue, but its so late here that it escapes me? What's the best practice? If there isn't one, they I guess i'll just do something with the query string or url parameter (its just a value but id prefer to not display it to the user) Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: SessionVar within Actors
You have to know the session... from within your Actor: case MyMessage(stuff) = S.initIfUninitted(session) { access SessionVars from here } Thanks, David On Mon, Oct 5, 2009 at 4:10 PM, Timothy Perrett timo...@getintheloop.euwrote: Hey guys, Been playing with this for a little while now and I cant remember what the scenario is for setting sessionvars from an actor? (thats a plain actor, not a comet actor) I remember there is some issue, but its so late here that it escapes me? What's the best practice? If there isn't one, they I guess i'll just do something with the query string or url parameter (its just a value but id prefer to not display it to the user) Cheers, Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp 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: SessionVar within Actors
Ah of course - I'd forgotten about the S access. Cheers, Tim On 6 Oct 2009, at 00:15, David Pollak wrote: You have to know the session... from within your Actor: case MyMessage(stuff) = S.initIfUninitted(session) { access SessionVars from here } Thanks, David On Mon, Oct 5, 2009 at 4:10 PM, Timothy Perrett timo...@getintheloop.eu wrote: Hey guys, Been playing with this for a little while now and I cant remember what the scenario is for setting sessionvars from an actor? (thats a plain actor, not a comet actor) I remember there is some issue, but its so late here that it escapes me? What's the best practice? If there isn't one, they I guess i'll just do something with the query string or url parameter (its just a value but id prefer to not display it to the user) Cheers, Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp 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: YUI Compressor Fatal Error
Such service! Thanks, David. On Oct 6, 12:10 am, David Pollak feeder.of.the.be...@gmail.com wrote: I'm setting up an OpenJDK ubuntu instance to test On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett pe...@bubblefoundry.comwrote: Ross, I am using OpenJDK: $ java -version java version 1.6.0_0 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) Is it possible to use YUI Compressor at all with OpenJDK? Peter On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote: I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO] task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke
[Lift] Re: YUI Compressor Fatal Error
d...@david-desktop:~/Desktop/liftweb/examples/example$ java -version Picked up JAVA_TOOL_OPTIONS: -Xmx1024M java version 1.6.0_0 OpenJDK Runtime Environment (build 1.6.0_0-b11) OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing) d...@david-desktop:~/Desktop/liftweb/examples/example$ I'm running on Ubuntu 8.04 with the OpenJDK installation. I get compilation failures on about half the runs. They appear to be random. Scala Actors do not work (I'm not trying to throw gasoline on any fires, just reporting what I'm seeing) when powering Lift's comet stuff. However, Lift Actors do work. I'm not seeing any explicit issues with other libraries. What OS are you running under your OpenJDK installation? On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett pe...@bubblefoundry.comwrote: Ross, I am using OpenJDK: $ java -version java version 1.6.0_0 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) Is it possible to use YUI Compressor at all with OpenJDK? Peter On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote: I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b)[84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFai lures (DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:291)
[Lift] Re: log4j
Changing the logging has to come at the very beginning of the boot method. I'm using slf4j in a 1.0.2 project and it's working fine. The very first line of my boot method is: LogBoot.loggerSetup = () = true which basically disables Lift setting up any logging (you'll have to do your own configuration via xml or API). Try that and let me know if you still have problems. Derek On Fri, Oct 2, 2009 at 3:02 PM, Christopher Mason cjma...@gmail.com wrote: So, is this support only present post 1.0.2? Cause in 1.0.2 it seems like log4j symbols are referenced before my Boot.boot() gets called (see below). Also, what do you mean by Configure slf4j to use Slf4jLogBoot (doc says Note that slf4j back-end should be configured previously to use Slf4jLogBoot. which also doesn't make sense to me).Sorry I missed the Slf4jLogBoot class; I'm still learning how to use Intellij to properly navigate scala code. Thanks! -c java.lang.NoClassDefFoundError: org/apache/log4j/LogManager at net.liftweb.util.LogBoot$.log4jIsConfigured$1(Log.scala:114) [massqc-1.3-foo-all.jar:na] at net.liftweb.util.LogBoot$._log4JSetup(Log.scala:130) [massqc-1.3- foo-all.jar:na] at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96) [massqc-1.3-foo-all.jar:na] at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96) [massqc-1.3-foo-all.jar:na] at net.liftweb.util.LogBoot$.checkConfig(Log.scala:94) [massqc-1.3- foo-all.jar:na] at net.liftweb.util.LogBoot$.net$liftweb$util$LogBoot$$_logger (Log.scala:140) [massqc-1.3-foo-all.jar:na] at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142) [massqc-1.3-foo-all.jar:na] at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142) [massqc-1.3-foo-all.jar:na] at net.liftweb.http.LiftRules$.init(LiftRules.scala:559) [massqc-1.3-foo-all.jar:na] at net.liftweb.http.LiftRules$.clinit(LiftRules.scala) [massqc-1.3- foo-all.jar:na] at net.liftweb.http.LiftFilter.init(LiftServlet.scala:554) [massqc-1.3-foo-all.jar:na] at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java: 74) [massqc-1.3-foo-all.jar:na] Also On Oct 2, 3:58 am, Indrajit Raychaudhuri indraj...@gmail.com wrote: You can of course use slf4j instead of log4j in your application. Quick steps: 1. Exclude log4j from dependency tree by adding exclusion filter in lift-webkit dependency. POM should look something like this: dependency groupIdnet.liftweb/groupId artifactIdlift-webkit/artifactId version1.1-SNAPSHOT/version exclusions exclusion groupIdlog4j/groupId artifactIdlog4j/artifactId /exclusion /exclusions dependency 2. Add slf4j, logback dependencies in POM 3. Enable slf4j in Boot: Slf4jLogBoot.enable() 4. Configure slf4j to use Slf4jLogBoot Cheers, Indrajit NB: net.liftweb.util.Slf4jLogBoot has a nice scaladoc with the above steps. You might wish to go through that as well :-) On 02/10/09 1:50 PM, Christopher Mason wrote: Is log4j a hard dependency to break? It seems like you're using slf4j most places, but then have some hard deps for configuration. I'm using logback. How hard would it be for me to remove the log4j dep and replace with slf4j/logback. (I have logback already configured in my servlet container.) Thanks! -c --~--~-~--~~~---~--~~ 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: YUI Compressor Fatal Error
According to his version number he's running ubuntu and that particular version corresponds to jaunty jackalope (9.04) Unless he spliced that package into debian or something else. -Ross On Oct 5, 2009, at 8:06 PM, David Pollak wrote: d...@david-desktop:~/Desktop/liftweb/examples/example$ java -version Picked up JAVA_TOOL_OPTIONS: -Xmx1024M java version 1.6.0_0 OpenJDK Runtime Environment (build 1.6.0_0-b11) OpenJDK Client VM (build 1.6.0_0-b11, mixed mode, sharing) d...@david-desktop:~/Desktop/liftweb/examples/example$ I'm running on Ubuntu 8.04 with the OpenJDK installation. I get compilation failures on about half the runs. They appear to be random. Scala Actors do not work (I'm not trying to throw gasoline on any fires, just reporting what I'm seeing) when powering Lift's comet stuff. However, Lift Actors do work. I'm not seeing any explicit issues with other libraries. What OS are you running under your OpenJDK installation? On Mon, Oct 5, 2009 at 1:10 PM, Peter Robinett pe...@bubblefoundry.com wrote: Ross, I am using OpenJDK: $ java -version java version 1.6.0_0 OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) Is it possible to use YUI Compressor at all with OpenJDK? Peter On Oct 5, 7:32 pm, Ross Mellgren dri...@gmail.com wrote: I thought someone mentioned this a little while ago and it was due to OpenJDK (and only related to the YUI compressor)? -Ross On Oct 5, 2009, at 1:25 PM, jon wrote: Is there a syntax problem in one of your javascript files? On Oct 5, 1:23 pm, Peter Robinett pe...@bubblefoundry.com wrote: Hi all, I've been compiling and running my Lift app on my personal machine without any problems but when I try to run it on another machine (where it had previously worked), I am getting fatal YUI Compressor errors. Not knowing YUI Compressor or how Lift and Maven use it (but willing to learn!), I'd appreciate any tips on how to get it to work again. Thanks in advance, Peter Robinett PS I thought I already posted a version of this message but I don't see it on the Groups site. My apologies if this message is a duplicate. $ mvn jetty:run [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building server [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [yuicompressor:compress {execution: default}] [INFO] equalnetworks.css (267b) - equalnetworks.css (197b)[73%] [INFO] dashboard.css (5511b) - dashboard.css (4478b)[81%] [INFO] jquery.tooltip.css (172b) - jquery.tooltip.css (145b) [84%] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null [INFO] [INFO] Trace java.lang.RuntimeException at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber (JavaScriptCompressor.java:299) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse (JavaScriptCompressor.java:335) at com.yahoo.platform.yui.compressor.JavaScriptCompressor.init (JavaScriptCompressor.java:532) at net.sf.alchim.mojo.yuicompressor.YuiCompressorMojo.processFile (YuiCompressorMojo.java:178) at net.sf.alchim.mojo.yuicompressor.MojoSupport.processDir (MojoSupport.java:151) at net.sf.alchim.mojo.yuicompressor.MojoSupport.execute (MojoSupport.java:105) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycl e (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle (DefaultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle (DefaultLifecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
[Lift] maven and jetty
I have been working locally for a long time and I seem to have forgotten how to deploy and run a war on Jetty! I am ftping the war to my server and putting it in the target directory. I then run mvn jetty:run-war -Djetty.port=80 and I keep getting the default app. What am I doing wrong? --~--~-~--~~~---~--~~ 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: maven and jetty
Have you verified another server is not running on that port? Have you tried http://url:80/name of app Just to see if that works Sent from my iPhone On Oct 5, 2009, at 10:12 PM, jack jack.wid...@gmail.com wrote: I have been working locally for a long time and I seem to have forgotten how to deploy and run a war on Jetty! I am ftping the war to my server and putting it in the target directory. I then run mvn jetty:run-war -Djetty.port=80 and I keep getting the default app. What am I doing wrong? --~--~-~--~~~---~--~~ 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: maven and jetty
Well it seems that mvn run-war is creating the war and overriding the one I just uploaded. How do I just run with a given war and not create the war. On Mon, Oct 5, 2009 at 10:37 PM, Ryan Stradling ryanstradl...@gmail.comwrote: Have you verified another server is not running on that port? Have you tried http://url:80/name of app Just to see if that works Sent from my iPhone On Oct 5, 2009, at 10:12 PM, jack jack.wid...@gmail.com wrote: I have been working locally for a long time and I seem to have forgotten how to deploy and run a war on Jetty! I am ftping the war to my server and putting it in the target directory. I then run mvn jetty:run-war -Djetty.port=80 and I keep getting the default app. What am I doing wrong? -- Jack --~--~-~--~~~---~--~~ 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] Help!
Is mvn jetty:run supposed to creat the war file? I want to upload a war file and just run it, not create another one. How do I do that? --~--~-~--~~~---~--~~ 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: Help!
I meant to say jetty:run-war On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote: Is mvn jetty:run supposed to creat the war file? I want to upload a war file and just run it, not create another one. How do I do that? -- Jack --~--~-~--~~~---~--~~ 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: Help!
never mind. deploy-war, not run-war (been working too hard) On Oct 5, 11:09 pm, Jack Widman jack.wid...@gmail.com wrote: I meant to say jetty:run-war On Mon, Oct 5, 2009 at 10:52 PM, jack jack.wid...@gmail.com wrote: Is mvn jetty:run supposed to creat the war file? I want to upload a war file and just run it, not create another one. How do I do that? -- Jack --~--~-~--~~~---~--~~ 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: execute code when browser is closed
Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 --~--~-~--~~~---~--~~ 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: execute code when browser is closed
i guess you meant put the snippet right in the CometActor. Ok. Now I'm getting it. On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote: Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- Jack --~--~-~--~~~---~--~~ 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: execute code when browser is closed
I guess you could generate the comet tag or attribute from a snippet... - Jack Widmanjack.wid...@gmail.com wrote: Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 --~--~-~--~~~---~--~~ 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: execute code when browser is closed
What do you mean? - jackjack.wid...@gmail.com wrote: i guess you meant put the snippet right in the CometActor. Ok. Now I'm getting it. On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote: Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- Jack --~--~-~--~~~---~--~~ 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: execute code when browser is closed
Let me start again. Maybe I am misunderstanding when Comet should be used. In my application, people search for web pages. I do a lot of processing for each resulting page. First I just display the links and then as the processing is finished, the links on the page are automatically modified with the data I just found for each link. This is all working fine. But, the session is being shared among all users so if I make one search in one browser, and then make another search from another browser, I get the results from the first browser. David suggested I name each CometActor differently. That is not working, though maybe I am not doing it right. On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote: What do you mean? - jackjack.wid...@gmail.com wrote: i guess you meant put the snippet right in the CometActor. Ok. Now I'm getting it. On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote: Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- Jack --~--~-~--~~~---~--~~ 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: alternate webroot using Boot?
I found this issue and voted on it at github. I've done a few presentations on scala at my job, a java shop, and used lift in one of the demos. A few people are quite interested in scala, and one is particularly interested in lift. The project I work on is in spring mvc, and it would be really cool to deploy a lift app beside it, as I could expose the spring context and show what portions of the actual app /might/ look like in lift. On Sep 21, 7:07 pm, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Sep 15, 2009 at 10:52 AM, tonyc tculs...@gmail.com wrote: Thanks David. It will mean developers can introduce lift gradually without a big bang approach, which is what I'm trying to do. It's quite normal to change the url-pattern on servlets/filters and it's also unusual for a filter which acts on *.html files in the root to override the default action (of serving up an html file). When dynamically changing the content of an html file before serving up, it's probably a sign that an alternative file extension and/or location is needed. JSPs (ugh!), do end in *.jsp, not *.html so that the web container knows not to serve them directly up, ie. they are picked up by the JSP Servlet, not a filter that matches on every url. Lift supports URL rewriting for inbound requests, so you could turn /something/index into /index. The challenge as I see it is that Lift also re-writes URLs on the way out and that might cause issues (the URLs would not be correctly re-written from /index to /something/index). I'll open a ticket because this also has to do with context paths and Lift is pretty rigid about context paths. Maybe there is a way with what's already there, but I'm missing something? Cheers, Tony. On Sep 16, 2:58 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Sep 15, 2009 at 1:57 AM, tonyc tculs...@gmail.com wrote: I'm considering lift for an alternative web framework but need to maintain a whole bunch of servlets / filters that already live in my web.xml. This is the closest thread to this subject so I thought I'd post here. I'm trying to get the LiftFilter to match on a distinct url-pattern to allow the other filters/servlets to continue matching their current url patterns. For this reason I need LiftFilter to match on say lift-test/* and so it receives requests like http://host/lift-test/index.html, but NOT like http://host/index.html I think you have to put the index.html file in /lift-test/index.html If this becomes a common occurrence, I think we can introduce something into LiftRules that will offset where things are looked up and also the re-writing of URL. Trouble is, I'm now a bit confused where to put the (lift) index.html in the webapp and/or what I need to change in Boot.scala. Scala plays nicely with Java, and I'd like to be able to get web frameworks playing nicely as well. I've already cobbled together spring/gwt/restlet/apachecxf so I guess I'm a glutton for punishment;) I suspect there's quite a few people want to integrate Lift with their pre-existing webapps, so I'm hoping somebody has solved it already. Cheers, Tony. -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: execute code when browser is closed
You are correct that Comet is a way to update information after the page is loaded. I think there's a simpler way using ajax, but I haven't explored those areas of Lift yet. But meanwhile you need to have the xml specifying the comet actor be dynamic. So you need to have that xml be generated by a snippet. A snippet is an XML to XML function. - jackjack.wid...@gmail.com wrote: Let me start again. Maybe I am misunderstanding when Comet should be used. In my application, people search for web pages. I do a lot of processing for each resulting page. First I just display the links and then as the processing is finished, the links on the page are automatically modified with the data I just found for each link. This is all working fine. But, the session is being shared among all users so if I make one search in one browser, and then make another search from another browser, I get the results from the first browser. David suggested I name each CometActor differently. That is not working, though maybe I am not doing it right. On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote: What do you mean? - jackjack.wid...@gmail.com wrote: i guess you meant put the snippet right in the CometActor. Ok. Now I'm getting it. On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote: Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.comwrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.comwrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- Jack --~--~-~--~~~---~--~~ 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: execute code when browser is closed
So I am using a snippet like this def go:NodeSeq = { var term:String = S.param(term).openOr() lift:surround with=default at=content lift:comet type=JoopComet name={term} auth:joop/auth:joop /lift:comet /lift:surround } And the term is indeed different each time. But I am still getting the same results from two different browsers with different terms. On Tue, Oct 6, 2009 at 12:18 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: You are correct that Comet is a way to update information after the page is loaded. I think there's a simpler way using ajax, but I haven't explored those areas of Lift yet. But meanwhile you need to have the xml specifying the comet actor be dynamic. So you need to have that xml be generated by a snippet. A snippet is an XML to XML function. - jackjack.wid...@gmail.com wrote: Let me start again. Maybe I am misunderstanding when Comet should be used. In my application, people search for web pages. I do a lot of processing for each resulting page. First I just display the links and then as the processing is finished, the links on the page are automatically modified with the data I just found for each link. This is all working fine. But, the session is being shared among all users so if I make one search in one browser, and then make another search from another browser, I get the results from the first browser. David suggested I name each CometActor differently. That is not working, though maybe I am not doing it right. On Oct 6, 12:01 am, Naftoli Gugenheim naftoli...@gmail.com wrote: What do you mean? - jackjack.wid...@gmail.com wrote: i guess you meant put the snippet right in the CometActor. Ok. Now I'm getting it. On Oct 5, 11:46 pm, Jack Widman jack.wid...@gmail.com wrote: Sorry if this is a dumb question but in lift:comet type=Search name={searchString}/, what is searchString? This is in an html file. I am obviously missing something. On Mon, Oct 5, 2009 at 2:40 PM, David Pollak feeder.of.the.be...@gmail.comwrote: On Mon, Oct 5, 2009 at 10:27 AM, Jack Widman jack.wid...@gmail.com wrote: Understood. My intention is to send a ShutDown message to the CometActor when somebody closes the browser. I need this so that when they visit the page in a browser again, the CometActor is 'reset'. First, there's no way to determine if the browser window is closed. Second, *DO NOT* send a ShutDown message to the CometActor. This is an internal Lift piece of housekeeping. If you do this, you will break stuff. Don't do it. (There is a reason the message is not private, but it should not be used for this purpose.) CometActors can be named: lift:comet type=Search name={searchString}/ You can then have a separate CometActor for each searchString. Voila... you get what you want. Now, how do you make then CometActor go away when it's not being used anymore? In your CometActor: override def lifespan: Box[TimeSpan] = Full(3 minutes) That means if a CometActor does not appear on a page for 3 minutes, it's removed from the session. If the named CometActor is requested again, a new one will be created. On Mon, Oct 5, 2009 at 1:18 PM, marius d. marius.dan...@gmail.com wrote: HTTP session termination does not equate with browser-close event. Br's, Marius On Oct 5, 3:22 pm, Jack Widman jack.wid...@gmail.com wrote: Yes, thats what I meant. Thanks On Mon, Oct 5, 2009 at 4:10 AM, Timothy Perrett timo...@getintheloop.euwrote: But you can do it on session termination (which is what you probably want): http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scalado... Checkout the method: registerCleanupFunc Cheers, Tim On Oct 5, 8:54 am, Viktor Klang viktor.kl...@gmail.com wrote: On Mon, Oct 5, 2009 at 6:50 AM, jack jack.wid...@gmail.com wrote: I would like to call a function when the browser is closed. How do I do this? You cannot reliably do this. -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub -- Jack -- Jack -- 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 -- Jack -- Jack --~--~-~--~~~---~--~~ 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
[Lift] Re: Need two classes to inherit from one model, database design and view issues
Lift doesn't really support this directly in Mapper, although you could write a single class and use a discriminator value field. If there's not a relational need for both types to have a common superclass it would probably be simpler to just build two distinct classes and have them sit in different tables. IIRC, you *could* have a common base class with common fields for both types and just override the dbTableName def on the Meta object for each. If you're using JPA you can easily do this with an inheritance mapping. Derek On Fri, Oct 2, 2009 at 8:55 PM, Dave davidtgoldb...@gmail.com wrote: Hi all- I posted this on stackoverflow but I figure its probably relevant here too. I checked out the post with David and Steve Yen corresponding but I am still at a loss and am curious if any progress has been made in this direction. So, here goes. I am creating a website which will need two types of users: students and providers. In a traditional java setting I would create a user class (or interface) and then create two classes which inherited from the user. Is this the best course in scala too, using the extends and with modifiers? If that is indeed the best way (which I suspect it is), what the best way to map this in the DB? Would it be best to keep a type column and then have it set to one or the other? Etc. The second question is how to work with the view. The display will be very different depending on which type of user one is and so I figure there will be some serious routing logic involved or at least logic built into snippets in the view. I guess the overarching question is: Is there a preferred way to go about doing this (like a recipe in rails or some such), or am I kind of out on my own? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Need two classes to inherit from one model, database design and view issues
You can factor common fields into a trait, then extend both mapper classes from it. As far as having the view depend, see BindPlus.bindSwitch. - Derek Chen-Beckerdchenbec...@gmail.com wrote: Lift doesn't really support this directly in Mapper, although you could write a single class and use a discriminator value field. If there's not a relational need for both types to have a common superclass it would probably be simpler to just build two distinct classes and have them sit in different tables. IIRC, you *could* have a common base class with common fields for both types and just override the dbTableName def on the Meta object for each. If you're using JPA you can easily do this with an inheritance mapping. Derek On Fri, Oct 2, 2009 at 8:55 PM, Dave davidtgoldb...@gmail.com wrote: Hi all- I posted this on stackoverflow but I figure its probably relevant here too. I checked out the post with David and Steve Yen corresponding but I am still at a loss and am curious if any progress has been made in this direction. So, here goes. I am creating a website which will need two types of users: students and providers. In a traditional java setting I would create a user class (or interface) and then create two classes which inherited from the user. Is this the best course in scala too, using the extends and with modifiers? If that is indeed the best way (which I suspect it is), what the best way to map this in the DB? Would it be best to keep a type column and then have it set to one or the other? Etc. The second question is how to work with the view. The display will be very different depending on which type of user one is and so I figure there will be some serious routing logic involved or at least logic built into snippets in the view. I guess the overarching question is: Is there a preferred way to go about doing this (like a recipe in rails or some such), or am I kind of out on my own? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---