[Lift] Re: ws-generated code in lift
So I assume XMPP and AMQP would be other sinks / sources? If so the mind is boggling with old ideas laid to rest for some time... A thought that comes to mind is that of a source and sink are of the same type, eg. AMQP, would the interconnection make use of that technologies underlying implementation. eg. AMQP exchanges? Time to check out the progress in git... Marc On 18/08/2009, at 3:20 AM, David Pollak wrote: With Goat Rodeo, you can define message flow with an abstract source (input) and sink (output) in the form: Foo % Bar % (Baz * Distribution) You can define fork/join constructs, tee constructs, etc. in the high level flow description. The flow description defines the type- safe progression from each logic unit. The location of each logic unit and the threading/transport model is decided at runtime. This means that you can define logic models and plug in an Akka distribution and threading strategy for production or a single threaded strategy for your local test harness. You'll also be able to register the composed modules that can be composed into larger flows. So, how does this work with SOAP? Well.. the SOAP piece is just a source and sink for the logic flow. --~--~-~--~~~---~--~~ 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: Mapper: Is it possible to avoid the n+1 selects?
On Thu, Aug 13, 2009 at 5:12 PM, Derek Chen-Beckerdchenbec...@gmail.com wrote: You should be able to use the PreCache QueryParam to tell Mapper to pre-fetch the mapped object: http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/PreCache.html Ok, time for a bonus question: Can this be extended to more than 1 level? I have something similar to the following class Vehicle extends LongKeyedMapper[Vehicle] with IdPK { object vehicleType extends MappedLongForeignKey(this, VehicleType) } class VehicleType extends LongKeyedMapper[VehicleType] with IdPK { object brand extends MappedLongForeignKey(this, Brand) } class Brand extends LongKeyedMapper[Brand] with IdPK { } When displaying the list of vehicles I need to show both the vehicle, the vehicleType the brand in the same table So to get the list of vehicles and caching the vehicletypes I do this: override def findForListParams: List[QueryParam[Vehicle]] = List(By(account, User.currentUser.open_!.account.is), PreCache(vehicleType)) But I still get the n+1 selects when trying to resolve vehicleType.brand. Can this be remedied somehow? /Jeppe --~--~-~--~~~---~--~~ 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: makeUtf8 and HttpServletRequest broken in new build???
+1 on some amount of nesting and reorganization. For example: docs, lift-archetype-basic, lift-facebook, lift-installer are all too different to be peers and probably can have different home (nested) based on 'traits' :) Cheers, Indrajit On Aug 18, 3:51 am, Timothy Perrett timo...@getintheloop.eu wrote: They would still output the same of course I just see a need for a few more starting points and I don¹t want to clutter the main codebase so a little bit of housekeeping is in order :-) Cheers, Tim On 17/08/2009 23:43, David Pollak feeder.of.the.be...@gmail.com wrote: As long as you don't mess with the Basic archetype... I'm cool. --~--~-~--~~~---~--~~ 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] managing foreign key object relationships with mapper
What I want to do: Create a one-to-zero-or-one relationship between User and Address. I.e. User belongs to Address. When a new user signs up for an account they need to fill in an address form at that same time. So the user.address object needs to be initialised properly when the user object is created. (this part is working ok). I also want (for backwards compatibility) existing users to get a new Address object when they update their profile if they currently don't have an address. I.e. in the users table the address foreign key is null. (this part nearly works) What the problem is: When a new user signs up it seems to work fine. The address is saved in the database and the foreign key is set on the user. However, when there is an existing user with no address (the user.address FK is NULL), they fill in the form and click update. The address is saved into the database, BUT the user.address FK is not set in the users table. It remains NULL. I have tried various combinations of things such as primeObj(), apply () and LongMappedForeignMapper, but I don't understand why the FK is not being updated. Here is my User.scala http://gist.github.com/169639 and my Address.scala http://gist.github.com/169638 I also have a hello-lift app that demonstrates this problem if it's useful. Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: Recent presentation to the Boulder JUG
Watching this talk now and loving it. Do you have the slides online somewhere since they are kind of hard to read on the video? mvh Bjarte On Tue, Aug 18, 2009 at 7:01 AM, marius d.marius.dan...@gmail.com wrote: Great talk Derek !!! Br's, Marius On Aug 18, 2:46 am, Derek Chen-Becker dchenbec...@gmail.com wrote: http://blip.tv/file/2485411 A big thanks to BJUG and especially Fred Jean for recording this. I'll be giving another talk in December to the Denver Open Source User Group (DOSUG). Hopefully we'll have some exciting announcements concerning 1.1 by then! Derek -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Deploying
Peter, Just adding the following section in nginx conf would be a good start. server { location / { proxy_pass http://localhost:8080/; } } There is whole page on Nginx wiki on this: http://wiki.nginx.org/NginxJavaServers. Cheers, Indrajit On Aug 18, 6:14 am, Peter Robinett pe...@bubblefoundry.com wrote: Timothy, I'm just starting to learn how to use Nginx and would love to some pointers. How did you set up Nginx? How to do you launch your Jetty instances? Peter On Aug 17, 3:34 pm, Timothy Perrett timo...@getintheloop.eu wrote: I run several sizable applications with NGINX and Jetty... Works like a dream. On 17/08/2009 18:55, Peter Robinett pe...@bubblefoundry.com wrote: I know David likes running Nginx in front of Jetty --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
How recently did you try LongMappedForeignMapper? It's been updated recently. In any case, if you attach the test project I will try to look at it, but it may help to clarify: what is the sequence of events of saving user / saving address / setting value of user.address? The problem is that the address doesn't have its id until it's saved, which means there's nothing for user.address to reference. That is why I wrote LongMappedForeignMapper and recently added a beforeSave lifecycle event, so you just call its apply -- user.address(address) -- and it will update its Long value before its saved. - georgegeo...@mattandgeorge.com wrote: What I want to do: Create a one-to-zero-or-one relationship between User and Address. I.e. User belongs to Address. When a new user signs up for an account they need to fill in an address form at that same time. So the user.address object needs to be initialised properly when the user object is created. (this part is working ok). I also want (for backwards compatibility) existing users to get a new Address object when they update their profile if they currently don't have an address. I.e. in the users table the address foreign key is null. (this part nearly works) What the problem is: When a new user signs up it seems to work fine. The address is saved in the database and the foreign key is set on the user. However, when there is an existing user with no address (the user.address FK is NULL), they fill in the form and click update. The address is saved into the database, BUT the user.address FK is not set in the users table. It remains NULL. I have tried various combinations of things such as primeObj(), apply () and LongMappedForeignMapper, but I don't understand why the FK is not being updated. Here is my User.scala http://gist.github.com/169639 and my Address.scala http://gist.github.com/169638 I also have a hello-lift app that demonstrates this problem if it's useful. Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to 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: managing foreign key object relationships with mapper
I last tried your LongMappedForeignMapper about a week ago and it had exactly the same problem. I am also using the lifecycle callbacks to make sure that the address is saved at the right time and if I log the address object in the beforeSave handler I can see the values set properly and the id that the database has given it. Which means something doesn't work in u.address() here: // This is called beforeSave and beforeUpdate private def saveAddresses(u:User) : Unit = { u.address(u.address.obj.open_!.saveMe) Log.info(u.address.obj.open_!.toString) // This outputs what I expect } I would really like to understand why my code doesn't work before I add in any code from elsewhere. --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
Full source code is here: http://github.com/mattandgeorge/hello-lift --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] How to localize date format in MappedDate
Hi, I'm trying to change the date format used by MappedDate for display/input, but the only way I can see that works is to create a new class that overrides setFromAny, _toForm toString. It looks like the format for output is hardcoded to internetDateFormatter and input can be either SimpleDateFormat(/MM/dd) or internetDateFormatter. Did I miss something? /Jeppe --~--~-~--~~~---~--~~ 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: Has anyone tried Stax?
A friend of mine is building a lift app and wants to host it there. Indeed the lack of sticky session is problematic for large scale apps. that require more then one node. Haven't found a workaround yet ... Br's, Marius On Aug 18, 4:41 pm, Ryan Donahue donahu...@gmail.com wrote: Is anybody using Stax for anything more than prototyping or examples? If so, what has your experience been? Stax doesn't seem to fit lift very well, but I'd like to find out I'm wrong. Specifically, it does not support sticky sessions:http://developer.stax.net/forum/topics/initial-questions. I assume a Stax app shares resources with others on the same server, so you'd likely need to scale to additional servers sooner than normal. However, the lack of sticky sessions effectively caps a stateful lift app to one server. --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
I'm guessing you're using primeObj. What happens if you change that Log.info to show the foreign key Long value? - georgegeo...@mattandgeorge.com wrote: I last tried your LongMappedForeignMapper about a week ago and it had exactly the same problem. I am also using the lifecycle callbacks to make sure that the address is saved at the right time and if I log the address object in the beforeSave handler I can see the values set properly and the id that the database has given it. Which means something doesn't work in u.address() here: // This is called beforeSave and beforeUpdate private def saveAddresses(u:User) : Unit = { u.address(u.address.obj.open_!.saveMe) Log.info(u.address.obj.open_!.toString) // This outputs what I expect } I would really like to understand why my code doesn't work before I add in any code from elsewhere. --~--~-~--~~~---~--~~ 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: Has anyone tried Stax?
You set whether you want a shared server, or dedicated/various speeds. In any case, is there room to entertain the thought of at some point adding support in Lift to propogate sessions across instances? (Is it easier now that it's been decoupled from servlets?) - Ryan Donahuedonahu...@gmail.com wrote: Is anybody using Stax for anything more than prototyping or examples? If so, what has your experience been? Stax doesn't seem to fit lift very well, but I'd like to find out I'm wrong. Specifically, it does not support sticky sessions: http://developer.stax.net/forum/topics/initial-questions. I assume a Stax app shares resources with others on the same server, so you'd likely need to scale to additional servers sooner than normal. However, the lack of sticky sessions effectively caps a stateful lift app to one server. --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
The long value seems to be updated correctly. But it doesn't make it into the database. private def saveAddresses(u:User) : Unit = { u.address(u.address.obj.open_!.saveMe) Log.info(u.address.is.toString) Log.info(u.address.obj.open_!.toString) } INFO - 69 INFO - formfiller.model.Address= {line3=,id=69,line2=,line1=sadfas,country=,postcode=} The address is created like this: def getAddress : Address = address.obj match { case Full(a) = a case _ = val a = new Address address(a) address.primeObj(Full(a)) a } Full source here: http://gist.github.com/169639 --~--~-~--~~~---~--~~ 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] Proposed internal changes on Mapper?
I'm trying to fix Mapper support for Oracle and I've run into an issue. Oracle's JDBC drivers support returning autoGenerated keys, but not the way that Lift expects. The way that Lift currently works, it just calls executeUpdate with Statement.RETURN_GENERATED_KEYS set. In Oracle, this will simply return the ROWID of the inserted row, which means that we would have to do a second select to get the actual value. Alternatively, Oracle does support fetching the inserted value from a column if you use the executeUpdate(String, Array[String]) method (the Array is a set of column names to fetch). What I'm getting at is that support for autogenerated keys is very driver-specific right now, but the DriverTypes class essentially is just using some flags to control behavior in MetaMapper. I'm wondering if it would make more sense to move the support for insert queries into DriverTypes so that we have things tied directly to the drivers instead of splitting it up between two files. I'm thinking of adding something like: def performUpdate(conn : Connection, stmt : String, primaryKeyColumn : String) def performUpdate(conn : Connection, stmt : PreparedStatement, primaryKeyColumn : String) to DriverTypes, which would then allow us to define driver-specific key fetching in place. I could move the base functionality into DriverTypes itself, and then we could override as needed on specific vendor classes. The current situation with flags for brokenAutogeneratedKeys_? and wickedBrokenAutogeneratedKeys_?, while amusingly named, feels untenable in the long term as we continue to find corner cases for vendor drivers. I could add a notQuiteBrokenButDifferentAutogeneratedKeys_? flag for Oracle, but that doesn't feel right. Thoughts? Derek --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
And is the User saved after its address has been updated to 69? - georgegeo...@mattandgeorge.com wrote: The long value seems to be updated correctly. But it doesn't make it into the database. private def saveAddresses(u:User) : Unit = { u.address(u.address.obj.open_!.saveMe) Log.info(u.address.is.toString) Log.info(u.address.obj.open_!.toString) } INFO - 69 INFO - formfiller.model.Address= {line3=,id=69,line2=,line1=sadfas,country=,postcode=} The address is created like this: def getAddress : Address = address.obj match { case Full(a) = a case _ = val a = new Address address(a) address.primeObj(Full(a)) a } Full source here: http://gist.github.com/169639 --~--~-~--~~~---~--~~ 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: Symlinks and Javascript Files
I really don't know enough about Jetty to really say what else is going wrong here, Sorry :( Derek On Mon, Aug 17, 2009 at 7:09 PM, Peter Robinett pe...@bubblefoundry.comwrote: mvn -Dorg.mortbay.util.FileResource.checkAliases=False jetty:run lead to: HTTP ERROR 503 Problem accessing /jquery.sparkline.js. Reason: java.lang.IllegalStateException: Alias checking disabled Is is just for the symlin in the webroot – requsting the one in the js subdirectory still causes Lift to say it isn't in the SiteMap. Any ideas? Thanks? Peter On Aug 16, 7:13 am, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, this is not Lift's error message, but rather Jetty's. You need to set the following property to tell Jetty not to check symlinks: -Dorg.mortbay.util.FileResource.checkAliases=False Derek On Fri, Aug 14, 2009 at 1:28 PM, Peter Robinett pe...@bubblefoundry.com wrote: It is not in my site map. I did try the ResourceServer with the symlinked script in the 'js' subdir. Peter On Aug 14, 6:43 am, Derek Chen-Becker dchenbec...@gmail.com wrote: Is the path to that file defined in your SiteMap? In the case of using ResourceServer, the js that you've tried means that the script should be under a js subdir. Derek On Thu, Aug 13, 2009 at 7:57 PM, Peter Robinett pe...@bubblefoundry.com wrote: My Lift project is in a git repository and to the repository I've added a submodule. Since right now I only want one javascript file from this submodule, my thought was to make the directory src/main/ webroot/js and then make a symbolic link to the javascript file in question. Unfortunately, when I try to request the file at http://localhost:9090/js/jquery.sparkline.js, I get a 403 response that says the page is not defined in my sitemap. There was no note of the request in the stdout. Thinking that the js subdirectory is the problem, I then tried making the symlink in the webroot directory and got a 404 error. On stdout it said: 2009-08-13 18:38:23.051::WARN: Aliased resource: file:/Users/peter/ Sites/Equal%20Networks/server/src/main/webapp/ jquery.sparkline.js==file:/Users/peter/Sites/Equal%20Networks/server/ vendors/dashboard/www/jquery.sparkline.js From this I gather than Lift is troubled by the presence of a symlink and refused to acknowledge its presence. Is this true? If so, why? From the thread last week on ExtJS I see a discussion on loading files in webroot, including supporting a css directory by adding the following to Boot.scala: ResourceServer.allow { case css :: _ = true } I already have a css file being served from a directory in the exact same location without any additions to Boot.scala. Nonetheless, I tried the following: ResourceServer.allow { case js :: _ = true } Unfortunately, this had no effect. So, how can I get my symlinked javascript to be server? Or should I just give up on symlinks altogether (I'm not a git master, so perhaps that was the wrong approach anyway). Peter Robinett PS I'm on 1.1-SNAPSHOT. PPS The YUI Compressor works well. Very cool. --~--~-~--~~~---~--~~ 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: Has anyone tried Stax?
On Aug 18, 5:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You set whether you want a shared server, or dedicated/various speeds. In any case, is there room to entertain the thought of at some point adding support in Lift to propogate sessions across instances? (Is it easier now that it's been decoupled from servlets?) No it is not easier. The fundamental problem in distributing lift sessions is the bound functions. Sure, functions are serializable but their references may not be. For instance one can bind an ajax anonymous function and that functions can have a bunch of other references inside potentially other lambdas etc. Viktor was doing in the past some research to integrate with Terracotta but there were some issues. So consistently distributing Lift sessions in a clustered environment is a challenge but of course good ideas are more then welcome. - Ryan Donahuedonahu...@gmail.com wrote: Is anybody using Stax for anything more than prototyping or examples? If so, what has your experience been? Stax doesn't seem to fit lift very well, but I'd like to find out I'm wrong. Specifically, it does not support sticky sessions:http://developer.stax.net/forum/topics/initial-questions. I assume a Stax app shares resources with others on the same server, so you'd likely need to scale to additional servers sooner than normal. However, the lack of sticky sessions effectively caps a stateful lift app to one server. --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
What do you mean by is it saved? The long value of the address field is not being saved to the address FK field on the user row in the database. It remains NULL. I am assuming that user.save is being called because the beforeSave handler is triggered. --~--~-~--~~~---~--~~ 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: managing foreign key object relationships with mapper
Where do you call user.save? Does it return true? Is user.address still a positive number after? - georgegeo...@mattandgeorge.com wrote: What do you mean by is it saved? The long value of the address field is not being saved to the address FK field on the user row in the database. It remains NULL. I am assuming that user.save is being called because the beforeSave handler is triggered. --~--~-~--~~~---~--~~ 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: CMS for Lift?
I just put my fledgling stab at a Lift CMS on gitHub. I'm not a gitHub user, so it took me a while to set up and commit the files. Anyway, here's the URL: git://github.com/glennSilverman/democritus.git I'm sure others out there have more sophisticated content managers for Lift but I'm happy to throw mine out there for comment anyway. Glenn... On Aug 17, 4:43 am, Jefken De Vleesetenden Boterham cultoftheholysquir...@gmail.com wrote: thirded, I'd try to help out a bit On Sun, Aug 16, 2009 at 11:53 PM, TylerWeirtyler.w...@gmail.com wrote: @Glenn - is your project public? Seconded, toss it up on github and let the community start helping out. --http://pmonnaie.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: makeUtf8 and HttpServletRequest broken in new build???
David, I just ran the basic from SNAPSHOTS and Boot.scala still has private def makeUtf8(req: HttpServletRequest) { req.setCharacterEncoding(UTF-8) } in Boot.scala. Glenn... On Aug 17, 10:10 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Aug 17, 2009 at 9:42 AM, glenn gl...@exmbly.com wrote: Is anyone planning on fixing the archetype snapshots to add this change, and import provider._ in Boot.scala. I'm able to create a new Basic Lift app from archetypes... and it works just fine. Can you tell us what command you typed to get an archetype that did not work? Thanks in advance, Glenn... On Aug 10, 10:36 am, marius d. marius.dan...@gmail.com wrote: Your makeUTF8 should look like this: private def makeUtf8(req: HTTPRequest): Unit = {req.setCharacterEncoding(UTF-8)} just use HTTPRequest instead of HttpServletRequest. Br's, Marius On Aug 10, 7:49 pm, glenn gl...@exmbly.com wrote: I just got a type mismatch found error in LiftRules.early.append (makeUtf8) in Boot.scala. It's now looking for an net.liftweb.http.provider.HTTPRequest instead of a javax.servlet.http.HttpServletRequest. Is this a new change, and if so, where is the net.liftweb.http.provider package? Glenn... -- 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: managing foreign key object relationships with mapper
I have managed to narrow the problem down some more. It seems that when the User object is saved there is a check to see whether it is clean_? This check does not seem to include a check to see if the Address object is also clean_? To get around this I tried to provide an override implementation of the dirty_? and clean_? methods on my User singleton. override def clean_?(toCheck: User): Boolean = Address.clean_?(toCheck.getAddress) super.clean_?(toCheck) override def dirty_?(toCheck: User): Boolean = Address.dirty_?(toCheck.getAddress) super.dirty_?(toCheck) However, there seems to be something wrong with the way I have done this because it is preventing the User from being saved. When I remove both the above overrides, I get the desired functionality, EXCEPT that when an address field is changed, that change is not saved because the User object is still clean_?. So the question becomes how do I let Mapper know that when the nested address object is dirty then the user object is also dirty? Or, put another way, how can I force an object to save when it is clean? --~--~-~--~~~---~--~~ 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: Relax method scope
It's okay to relax it... maybe even make it public. On Tue, Aug 18, 2009 at 8:57 AM, Timothy Perrett timo...@getintheloop.euwrote: Guys, Is there a good reason that this method in MetaRecord is private [record]? private[record] def foreachCallback(inst: BaseRecord, f: LifecycleCallbacks = Any) { lifecycleCallbacks.foreach(m = f(m._2.invoke(inst).asInstanceOf [LifecycleCallbacks])) } Its a useful thing to want to implement in your custom record backends (DBRecord makes use of it for example) - can I relax it to: protected def foreachCallback(inst: BaseRecord, f: LifecycleCallbacks = Any) { lifecycleCallbacks.foreach(m = f(m._2.invoke(inst).asInstanceOf [LifecycleCallbacks])) } Cheers Tim -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: makeUtf8 and HttpServletRequest broken in new build???
On Tue, Aug 18, 2009 at 9:15 AM, glenn gl...@exmbly.com wrote: David, I just ran the basic from SNAPSHOTS and Boot.scala still has What did you type at the command line? private def makeUtf8(req: HttpServletRequest) { req.setCharacterEncoding(UTF-8) } in Boot.scala. Glenn... On Aug 17, 10:10 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Aug 17, 2009 at 9:42 AM, glenn gl...@exmbly.com wrote: Is anyone planning on fixing the archetype snapshots to add this change, and import provider._ in Boot.scala. I'm able to create a new Basic Lift app from archetypes... and it works just fine. Can you tell us what command you typed to get an archetype that did not work? Thanks in advance, Glenn... On Aug 10, 10:36 am, marius d. marius.dan...@gmail.com wrote: Your makeUTF8 should look like this: private def makeUtf8(req: HTTPRequest): Unit = {req.setCharacterEncoding(UTF-8)} just use HTTPRequest instead of HttpServletRequest. Br's, Marius On Aug 10, 7:49 pm, glenn gl...@exmbly.com wrote: I just got a type mismatch found error in LiftRules.early.append (makeUtf8) in Boot.scala. It's now looking for an net.liftweb.http.provider.HTTPRequest instead of a javax.servlet.http.HttpServletRequest. Is this a new change, and if so, where is the net.liftweb.http.provider package? Glenn... -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Git some:http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Mapper: Is it possible to avoid the n+1 selects?
I don't think it currently supports it, but I'd have to look at the source to give a definitive answer. On Tue, Aug 18, 2009 at 1:32 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: On Thu, Aug 13, 2009 at 5:12 PM, Derek Chen-Beckerdchenbec...@gmail.com wrote: You should be able to use the PreCache QueryParam to tell Mapper to pre-fetch the mapped object: http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/PreCache.html Ok, time for a bonus question: Can this be extended to more than 1 level? I have something similar to the following class Vehicle extends LongKeyedMapper[Vehicle] with IdPK { object vehicleType extends MappedLongForeignKey(this, VehicleType) } class VehicleType extends LongKeyedMapper[VehicleType] with IdPK { object brand extends MappedLongForeignKey(this, Brand) } class Brand extends LongKeyedMapper[Brand] with IdPK { } When displaying the list of vehicles I need to show both the vehicle, the vehicleType the brand in the same table So to get the list of vehicles and caching the vehicletypes I do this: override def findForListParams: List[QueryParam[Vehicle]] = List(By(account, User.currentUser.open_!.account.is), PreCache(vehicleType)) But I still get the n+1 selects when trying to resolve vehicleType.brand. Can this be remedied somehow? /Jeppe --~--~-~--~~~---~--~~ 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: Proposed internal changes on Mapper?
On Tue, Aug 18, 2009 at 7:12 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'm trying to fix Mapper support for Oracle and I've run into an issue. Oracle's JDBC drivers support returning autoGenerated keys, but not the way that Lift expects. The way that Lift currently works, it just calls executeUpdate with Statement.RETURN_GENERATED_KEYS set. In Oracle, this will simply return the ROWID of the inserted row, which means that we would have to do a second select to get the actual value. Alternatively, Oracle does support fetching the inserted value from a column if you use the executeUpdate(String, Array[String]) method (the Array is a set of column names to fetch). What I'm getting at is that support for autogenerated keys is very driver-specific right now, but the DriverTypes class essentially is just using some flags to control behavior in MetaMapper. I'm wondering if it would make more sense to move the support for insert queries into DriverTypes so that we have things tied directly to the drivers instead of splitting it up between two files. I'm thinking of adding something like: def performUpdate(conn : Connection, stmt : String, primaryKeyColumn : String) def performUpdate(conn : Connection, stmt : PreparedStatement, primaryKeyColumn : String) to DriverTypes, which would then allow us to define driver-specific key fetching in place. I could move the base functionality into DriverTypes itself, and then we could override as needed on specific vendor classes. The current situation with flags for brokenAutogeneratedKeys_? and wickedBrokenAutogeneratedKeys_?, while amusingly named, feels untenable in the long term as we continue to find corner cases for vendor drivers. I could add a notQuiteBrokenButDifferentAutogeneratedKeys_? flag for Oracle, but that doesn't feel right. Thoughts? I think it's a good idea. It will also help with Record support for JDBC. Derek -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Mapper: Is it possible to avoid the n+1 selects?
On Tue, Aug 18, 2009 at 12:32 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: On Thu, Aug 13, 2009 at 5:12 PM, Derek Chen-Beckerdchenbec...@gmail.com wrote: You should be able to use the PreCache QueryParam to tell Mapper to pre-fetch the mapped object: http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/PreCache.html Ok, time for a bonus question: Can this be extended to more than 1 level? You'd have to try it. ;-) I don't think Mapper officially supports multiple levels of precaching. I have something similar to the following class Vehicle extends LongKeyedMapper[Vehicle] with IdPK { object vehicleType extends MappedLongForeignKey(this, VehicleType) } class VehicleType extends LongKeyedMapper[VehicleType] with IdPK { object brand extends MappedLongForeignKey(this, Brand) } class Brand extends LongKeyedMapper[Brand] with IdPK { } When displaying the list of vehicles I need to show both the vehicle, the vehicleType the brand in the same table So to get the list of vehicles and caching the vehicletypes I do this: override def findForListParams: List[QueryParam[Vehicle]] = List(By(account, User.currentUser.open_!.account.is), PreCache(vehicleType)) But I still get the n+1 selects when trying to resolve vehicleType.brand. Can this be remedied somehow? /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Symlinks and Javascript Files
I'd advise against using sym links. They don't work on Windows and don't necessarily get JARed/WARed up correctly. On Mon, Aug 17, 2009 at 6:09 PM, Peter Robinett pe...@bubblefoundry.comwrote: mvn -Dorg.mortbay.util.FileResource.checkAliases=False jetty:run lead to: HTTP ERROR 503 Problem accessing /jquery.sparkline.js. Reason: java.lang.IllegalStateException: Alias checking disabled Is is just for the symlin in the webroot – requsting the one in the js subdirectory still causes Lift to say it isn't in the SiteMap. Any ideas? Thanks? Peter On Aug 16, 7:13 am, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, this is not Lift's error message, but rather Jetty's. You need to set the following property to tell Jetty not to check symlinks: -Dorg.mortbay.util.FileResource.checkAliases=False Derek On Fri, Aug 14, 2009 at 1:28 PM, Peter Robinett pe...@bubblefoundry.com wrote: It is not in my site map. I did try the ResourceServer with the symlinked script in the 'js' subdir. Peter On Aug 14, 6:43 am, Derek Chen-Becker dchenbec...@gmail.com wrote: Is the path to that file defined in your SiteMap? In the case of using ResourceServer, the js that you've tried means that the script should be under a js subdir. Derek On Thu, Aug 13, 2009 at 7:57 PM, Peter Robinett pe...@bubblefoundry.com wrote: My Lift project is in a git repository and to the repository I've added a submodule. Since right now I only want one javascript file from this submodule, my thought was to make the directory src/main/ webroot/js and then make a symbolic link to the javascript file in question. Unfortunately, when I try to request the file at http://localhost:9090/js/jquery.sparkline.js, I get a 403 response that says the page is not defined in my sitemap. There was no note of the request in the stdout. Thinking that the js subdirectory is the problem, I then tried making the symlink in the webroot directory and got a 404 error. On stdout it said: 2009-08-13 18:38:23.051::WARN: Aliased resource: file:/Users/peter/ Sites/Equal%20Networks/server/src/main/webapp/ jquery.sparkline.js==file:/Users/peter/Sites/Equal%20Networks/server/ vendors/dashboard/www/jquery.sparkline.js From this I gather than Lift is troubled by the presence of a symlink and refused to acknowledge its presence. Is this true? If so, why? From the thread last week on ExtJS I see a discussion on loading files in webroot, including supporting a css directory by adding the following to Boot.scala: ResourceServer.allow { case css :: _ = true } I already have a css file being served from a directory in the exact same location without any additions to Boot.scala. Nonetheless, I tried the following: ResourceServer.allow { case js :: _ = true } Unfortunately, this had no effect. So, how can I get my symlinked javascript to be server? Or should I just give up on symlinks altogether (I'm not a git master, so perhaps that was the wrong approach anyway). Peter Robinett PS I'm on 1.1-SNAPSHOT. PPS The YUI Compressor works well. Very cool. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Getting started: Rendering a template (Definitive Guide)
It's on my todo list to update Exploring Lift around at least a 1.1 milestone release. On Mon, Aug 17, 2009 at 11:23 AM, David Pollak feeder.of.the.be...@gmail.com wrote: It's also a really, really good idea to use Lift 1.1-SNAPSHOT or Lift 1.1-M4. There's a polite error message when in development mode that points out that the particular page needs to be added to SiteMap. Derek Co. Any way to update the PDF book to use 1.1-*something*? On Sun, Aug 16, 2009 at 11:25 PM, Morris Jones m...@whiteoaks.com wrote: marius d. wrote: I believe the book describes the SiteMap quite extensively. Yes, if you are using SiteMap then you have to add your new page to the SiteMap. I have no doubt that it's there in great detail. I just stumbled trying to experiment with it before I knew what I was doing, or got to that chapter. :) Thanks ... Cheers, Mojo -- Morris Jones Monrovia, CA http://www.whiteoaks.com Old Town Astronomers: http://www.otastro.org http://twitter.com/mojo_la -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Has anyone tried Stax?
I've had some conversations with the Stax folks... we want to do integration, but as Marius points out... the serialization issue is a bear. On Tue, Aug 18, 2009 at 6:41 AM, Ryan Donahue donahu...@gmail.com wrote: Is anybody using Stax for anything more than prototyping or examples? If so, what has your experience been? Stax doesn't seem to fit lift very well, but I'd like to find out I'm wrong. Specifically, it does not support sticky sessions: http://developer.stax.net/forum/topics/initial-questions. I assume a Stax app shares resources with others on the same server, so you'd likely need to scale to additional servers sooner than normal. However, the lack of sticky sessions effectively caps a stateful lift app to one server. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Getting started: Rendering a template (Definitive Guide)
On Mon, Aug 17, 2009 at 7:22 PM, Morris Jones m...@whiteoaks.com wrote: Great suggestion, and I'd love to do that. When I changed the versions to 1.1-SNAPSHOT in the POM file, maven wasn't able to find them at scala-tools.org. I guess I need to add another repository. repository idscala-tools.org.snapshots/id nameScala-Tools Maven2 Repository for Snapshots/name urlhttp://scala-tools.org/repo-snapshots/url snapshots/ /repository I'll look into that. Thanks, Mojo David Pollak wrote: It's also a really, really good idea to use Lift 1.1-SNAPSHOT or Lift 1.1-M4. There's a polite error message when in development mode that points out that the particular page needs to be added to SiteMap. Derek Co. Any way to update the PDF book to use 1.1-/something/? On Sun, Aug 16, 2009 at 11:25 PM, Morris Jones m...@whiteoaks.com mailto:m...@whiteoaks.com wrote: marius d. wrote: I believe the book describes the SiteMap quite extensively. Yes, if you are using SiteMap then you have to add your new page to the SiteMap. I have no doubt that it's there in great detail. I just stumbled trying to experiment with it before I knew what I was doing, or got to that chapter. :) Thanks ... -- Morris Jones Monrovia, CA http://www.whiteoaks.com Old Town Astronomers: http://www.otastro.org http://twitter.com/mojo_la -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Case insensitive LIKE query
Currently I think that you would have to use BySQL. Feel free to file a ticket on it. On Mon, Aug 17, 2009 at 1:24 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I'm using H2, and LIKE queries seem to be case sensitive. What should I do to search fields without being case sensitive?For example, right now I have: Client.findAll(Like(field, %+v+%)) In SQL I can write SELECT FIRST FROM CLIENT WHERE UPPER(FIRST) LIKE '%A%'; So is there a way to specify a database function in a query (without using SQL)? 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] how to construct a table with a set number of columns
I have a List[Foo] and I want to construct a table with 10 columns and however many rows necessary to contain all the Foos. I feel like I should do something like so, but it's not quite right yet: table lift:MyPage.func tdfoo:name//td /lift:MyPage.func /table def func(xhtml: NodeSeq): NodeSeq = { val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo = { bind(foo, xhtml, name - foo.name) }) // then reduce the list of cells putting in trs in appropriate places, but not sure how. } --~--~-~--~~~---~--~~ 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: Case insensitive LIKE query
On Mon, Aug 17, 2009 at 12:24 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I'm using H2, and LIKE queries seem to be case sensitive. What should I do to search fields without being case sensitive?For example, right now I have: Client.findAll(Like(field, %+v+%)) In SQL I can write SELECT FIRST FROM CLIENT WHERE UPPER(FIRST) LIKE '%A%'; So is there a way to specify a database function in a query (without using SQL)? Thanks. Fresh off the presses: Cmp[O, String](field, OprEnum.Like, Full(value), Empty, Full(UPPER)) You can include an SQL function in a Cmp. -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to localize date format in MappedDate
You can control this via the newly added LiftRules: /** * A function to format a Date... can be replaced by a function that is user-specific */ var formatDate: Date = String = date = date match {case null = LiftRules.formatDate(new Date(0L)) case s = toInternetDate(s)} /** * A function that parses a String into a Date... can be replaced by something that's user-specific */ var parseDate: String = Box[Date] = str = str match { case null = Empty case s = Helpers.toDate(s) } So, you can put in functions that parse and format dates based on the currently logged in user, etc. On Tue, Aug 18, 2009 at 6:24 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Hi, I'm trying to change the date format used by MappedDate for display/input, but the only way I can see that works is to create a new class that overrides setFromAny, _toForm toString. It looks like the format for output is hardcoded to internetDateFormatter and input can be either SimpleDateFormat(/MM/dd) or internetDateFormatter. Did I miss something? /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: how to construct a table with a set number of columns
You mean a word wrap / FlowLayout type of arrangement? One idea is to have two snippets like yours, one for tr's and one for td's; and make you class a StatefulSnippet and initialize a 2D array there (or the RequestVar equivalent); and prepare the row for the td snippet in the tr snippet. Another option is to use NodeSeq functions (FuncBindParam) inside one snippet instead of multiple snippets. So in your snippet arrange a 2D array, then bind say foreach:row to a function that iterates (flatMap) over the rows, binding foreach:col to each column of the current row (flatMap) with a NodeSeq function that does the bind of the cell contents. - harryhhar...@gmail.com wrote: I have a List[Foo] and I want to construct a table with 10 columns and however many rows necessary to contain all the Foos. I feel like I should do something like so, but it's not quite right yet: table lift:MyPage.func tdfoo:name//td /lift:MyPage.func /table def func(xhtml: NodeSeq): NodeSeq = { val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo = { bind(foo, xhtml, name - foo.name) }) // then reduce the list of cells putting in trs in appropriate places, but not sure how. } --~--~-~--~~~---~--~~ 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 construct a table with a set number of columns
With the second option you might be able to do a foldLeft instead of a flatMap to List.take(10) one row at a time. - harryhhar...@gmail.com wrote: I have a List[Foo] and I want to construct a table with 10 columns and however many rows necessary to contain all the Foos. I feel like I should do something like so, but it's not quite right yet: table lift:MyPage.func tdfoo:name//td /lift:MyPage.func /table def func(xhtml: NodeSeq): NodeSeq = { val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo = { bind(foo, xhtml, name - foo.name) }) // then reduce the list of cells putting in trs in appropriate places, but not sure how. } --~--~-~--~~~---~--~~ 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: slow down ajax?
No, this is the old way ...I am unsure how to invoke the ajax method -- could you enlighten me? On Aug 17, 12:26 pm, marius d. marius.dan...@gmail.com wrote: I don't see in your code the use of the overloaded ajaxText that I posted. Have you tried it? Marius On Aug 17, 10:20 pm, g-man gregor...@gmail.com wrote: OK, thanks for checking back... Snippet: swappable(span class='dueon'{task.dueOn.toString}/span, span class='chgDueon'{ajaxText(task.dueOn.toString, v = { task.dueOn(v.toLong).save; reDrawTasks(); }) % (size - 10)}/span) JS: $chgDueon // jQuery selection for text field .datepicker({dateFormat:'m-d-yy', minDate: +1}) .blur(function(){$chgDueon.val(parseDate($chgDueon.val()));}); // works well to pick a new date and change it to millis for save Emitted XHTML: span span class=dueon id=F111290299287IBE onclick=jQuery('#'+'F111290299287IBE').hide(); jQuery('#'+'F1112902992880KN').show().each(function(i) { var t = this; setTimeout(function() { t.focus(); }, 200);});return false;; 1248493271843/span span style=display: none id=F1112902992880KN onblur=jQuery('#'+'F111290299287IBE').show(); jQuery('#'+'F1112902992880KN').hide(); input onblur=lift_ajaxHandler('F111290299286DL1=' + encodeURIComponent(this.value), null, null) type=text value=1248493271843 onkeypress=lift_blurIfReturn(event) size=10 / /span /span So, all the parts work well together, but Lift's ajax just takes off too quickly, and cannot read the new value. On Aug 16, 11:02 pm, marius d. marius.dan...@gmail.com wrote: You can probably use this definition of ajaxText: def ajaxText(value: String, jsFunc: Call, func: String = JsCmd) See the jsFunc parameter. Essentially you are specifying your function call that may have one parameter. To your parameter list List we'll add a new parameter which is the ajax invocation function. In other words your code gets that function that does the ajax call meaning that you have the control over when the ajax call is made. Br's, Marius On Aug 17, 8:55 am, marius d. marius.dan...@gmail.com wrote: Would you please post a code snippet with what you're doing? (a minimalistic example) Br's, Marius On Aug 17, 7:41 am, g-man gregor...@gmail.com wrote: I am moving nicely with my 'save all dates as millis and let the client localize for display' project, learning while enhancing the ToDo sample app. I have added a 'dueOn' field, and that is displayed as swappable ajaxText, similar to the other fields in the tutorial. I have enabled datepicker for the ajaxText field via jQuery, and have a parsing function attached an event listener, so when datepicker finishes, the date is converted to millis, ready for Lift to send back to the server and save. So far, all good. The problem is that Lift's ajax starts ('onblur') before it has a chance to see the new date value, so the new value is never saved. What I need is a way to tell Lift to wait until after my parser has had a chance to write the changed value. I like the ajax style, so I don't want to make a 'submit' form, and 'onchange' won't do it either, because the value is actually changed twice (once to a formatted date, once to millis). What I need is some way to say, 'OK to start ajax now'! --~--~-~--~~~---~--~~ 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: slow down ajax?
Having def ajaxText(value: String, jsFunc: Call, func: String = JsCmd) jsFunc parameter is a Call which is defined as: case class Call(function: String, params: JsExp*) extends JsExp So by this you represent a javascript function invocations. So assuming somewhere you have a javascript function like: function myFunc(myParam, callback) { // do some logic callback() } in the snippet we have something like: ajaxText(task.dueOn.toString, Call(myFunc, Str(some_param_value)) v = { task.dueOn(v.toLong).save; reDrawTasks();}) As you can see we called Call(myFunc, Str (some_param_value)) .. .we provided the JS function name and one parameter. Lift will add the second parameter which is the callback function. This callback function represents the actual ajax call and since it is a callback you can invoke it whenever you want inside 'myFunc' javascript function. In other words you can defer the actual ajax call as you see fit. Now myFunc function declaration can be: 1. In your own .js file 2. Written in the script tag inside your html 3. Generate using Lifts' JS absctrations using JsCmds.Function() object such as: JsCmds.Function(MyFunc, List(myParam, callback), a_JsCmd_expression_which_is_the_function_body) The main point in all this is that you can defer the actual ajax call. You know better if this fits your case. Br's, Marius On Aug 18, 10:21 pm, g-man gregor...@gmail.com wrote: No, this is the old way ...I am unsure how to invoke the ajax method -- could you enlighten me? On Aug 17, 12:26 pm, marius d. marius.dan...@gmail.com wrote: I don't see in your code the use of the overloaded ajaxText that I posted. Have you tried it? Marius On Aug 17, 10:20 pm, g-man gregor...@gmail.com wrote: OK, thanks for checking back... Snippet: swappable(span class='dueon'{task.dueOn.toString}/span, span class='chgDueon'{ajaxText(task.dueOn.toString, v = { task.dueOn(v.toLong).save; reDrawTasks(); }) % (size - 10)}/span) JS: $chgDueon // jQuery selection for text field .datepicker({dateFormat:'m-d-yy', minDate: +1}) .blur(function(){$chgDueon.val(parseDate($chgDueon.val()));}); // works well to pick a new date and change it to millis for save Emitted XHTML: span span class=dueon id=F111290299287IBE onclick=jQuery('#'+'F111290299287IBE').hide(); jQuery('#'+'F1112902992880KN').show().each(function(i) { var t = this; setTimeout(function() { t.focus(); }, 200);});return false;; 1248493271843/span span style=display: none id=F1112902992880KN onblur=jQuery('#'+'F111290299287IBE').show(); jQuery('#'+'F1112902992880KN').hide(); input onblur=lift_ajaxHandler('F111290299286DL1=' + encodeURIComponent(this.value), null, null) type=text value=1248493271843 onkeypress=lift_blurIfReturn(event) size=10 / /span /span So, all the parts work well together, but Lift's ajax just takes off too quickly, and cannot read the new value. On Aug 16, 11:02 pm, marius d. marius.dan...@gmail.com wrote: You can probably use this definition of ajaxText: def ajaxText(value: String, jsFunc: Call, func: String = JsCmd) See the jsFunc parameter. Essentially you are specifying your function call that may have one parameter. To your parameter list List we'll add a new parameter which is the ajax invocation function. In other words your code gets that function that does the ajax call meaning that you have the control over when the ajax call is made. Br's, Marius On Aug 17, 8:55 am, marius d. marius.dan...@gmail.com wrote: Would you please post a code snippet with what you're doing? (a minimalistic example) Br's, Marius On Aug 17, 7:41 am, g-man gregor...@gmail.com wrote: I am moving nicely with my 'save all dates as millis and let the client localize for display' project, learning while enhancing the ToDo sample app. I have added a 'dueOn' field, and that is displayed as swappable ajaxText, similar to the other fields in the tutorial. I have enabled datepicker for the ajaxText field via jQuery, and have a parsing function attached an event listener, so when datepicker finishes, the date is converted to millis, ready for Lift to send back to the server and save. So far, all good. The problem is that Lift's ajax starts ('onblur') before it has a chance to see the new date value, so the new value is never saved. What I need is a way to tell Lift to wait until after my parser has had a chance to write the changed value. I like the ajax style, so I don't want to make a 'submit' form, and 'onchange' won't do it either, because the value is actually changed twice
[Lift] Re: how to construct a table with a set number of columns
You could do something like this. Snippet: def func(xhtml: NodeSeq): NodeSeq = { val foos = Foo.findAll(...) val rowSize = (S.attr(rowSize) openOr 10).toInt val rowNum = (foos.size + rowSize - 1) / rowSize List.range(0, rowNum).foldLeft(Util.emptyNodeSeq)((ns, i) = { val start = i*rowSize val end = start+rowSize ns ++ bind(list, xhtml, row - row(foos.slice(start, end)) _) }) } private def row(foos:List[String])(xhtml: NodeSeq) : NodeSeq = foos.foldLeft(Util.emptyNodeSeq)((ns, foo) = ns ++ bind(foo, xhtml, name - foo.name)) Then your template can use table/tr/td or it could just use floating divs that wrap over when necessary: table lift:MyPage.func rowSize=10 tr list:row tdfoo:name//td /list:row /tr /lift:MyPage.func /table OR lift:MyPage.func list:row div class=cellfoo:name//div /list:row /lift:MyPage.func For an empty NodeSeq that works in the foldLeft I've had to create the following. Anybody know a better way? object Util { val emptyNodeSeq : NodeSeq = NodeSeq.fromSeq(Seq(xml:group/ xml:group)) } On Aug 18, 2:58 pm, harryh har...@gmail.com wrote: I have a List[Foo] and I want to construct a table with 10 columns and however many rows necessary to contain all the Foos. I feel like I should do something like so, but it's not quite right yet: table lift:MyPage.func tdfoo:name//td /lift:MyPage.func /table def func(xhtml: NodeSeq): NodeSeq = { val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo = { bind(foo, xhtml, name - foo.name) }) // then reduce the list of cells putting in trs in appropriate places, but not sure how. } --~--~-~--~~~---~--~~ 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: Deploying
On Mon, Aug 17, 2009 at 10:59 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: Thanks everyone.This webapp is not going to be used very heavily or have a very demanding customer base. It's for an organization that will have around 5 people using it total, not necessarily at the same time. So I don't need any fancy setup like continuous integration etc. It's also the second version of the first webapp I've written (the first was in PHP). After I sent the question, I came across a thread from David (it was on Nabbles, I would guess from this group) where he described how to use nginx as the frontend web server and Jetty as the backend. I like Nginx as a front end because you have serve multiple virtual domains from the same front end server (this is handy for static sites run on the same server). Further, Nginx runs as root in order to listen to port 80 and that means you don't have to have some iptables port forwarding to your Jetty instance and you don't have to run Jetty as root. I should probably ask this on that thread, but [when] would I want to use nginx and not just Jetty? (Nothing else needs to be running on the server.) Also, what's the difference between the Jetty download link it had ( www.tunaforcats.com/deploy_jetty.tgz) and something you can download from Jetty's site? (And what exactly *is* tunaforcats.com ??!) Question 2: Any reason to run H2 either as a separate process or as part of the webapp? Part of the web app... it starts up and shuts down with the app. Thanks. On Mon, Aug 17, 2009 at 3:00 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Naftoli Gugenheim naftoli...@gmail.com writes: What's the best way to get a lift app running on a Ubuntu web server I can SSH into with full permissions? It came with almost nothing installed. Thanks. It may be overkill for you if it's just a one time install, but I've had great success with Chef (http://wiki.opscode.com/display/chef/Home) to do automatic provisioning of servers/services/deployment. Some time ago, I wrote a series of articles that describes a basic setup to deploy a basic Hello World Lift app to EC2. If you skip the EC2 part, you may find something useful: http://jeppenejsum.wordpress.com/2009/05/03/ec2-continuous-deployment-hello-world/ /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: How to localize date format in MappedDate
On Tue, Aug 18, 2009 at 8:58 PM, David Pollakfeeder.of.the.be...@gmail.com wrote: You can control this via the newly added LiftRules: Sweet, just what the doctor ordered...thanks /Jeppe --~--~-~--~~~---~--~~ 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: Mapper: Is it possible to avoid the n+1 selects?
On Tue, Aug 18, 2009 at 7:46 PM, David Pollakfeeder.of.the.be...@gmail.com wrote: On Tue, Aug 18, 2009 at 12:32 AM, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: On Thu, Aug 13, 2009 at 5:12 PM, Derek Chen-Beckerdchenbec...@gmail.com wrote: You should be able to use the PreCache QueryParam to tell Mapper to pre-fetch the mapped object: http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/PreCache.html Ok, time for a bonus question: Can this be extended to more than 1 level? You'd have to try it. ;-) Believe me, I tried :-) Couldn't really figure out what to use as parameter and looking at dealWithPrecache it seems like the two tables need to be directly linked It's not super critial atm, so I'll get back to this if necessary /Jeppe --~--~-~--~~~---~--~~ 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 construct a table with a set number of columns
Ah yes, flatMap, of course. That will clean up some of my code, thanks. On Aug 18, 4:16 pm, harryh har...@gmail.com wrote: Ah, perfect! Thx! Incidentally, I simplified in two places by instead of doing this: List.range(0, rowNum).foldLeft(Util.emptyNodeSeq)((ns, i) = { }) doing this: List.range(0, rowNum).flatMap(i = { }) (simlar change in the row function) -harryh On Aug 18, 3:52 pm, Ryan Donahue donahu...@gmail.com wrote: You could do something like this. Snippet: def func(xhtml: NodeSeq): NodeSeq = { val foos = Foo.findAll(...) val rowSize = (S.attr(rowSize) openOr 10).toInt val rowNum = (foos.size + rowSize - 1) / rowSize List.range(0, rowNum).foldLeft(Util.emptyNodeSeq)((ns, i) = { val start = i*rowSize val end = start+rowSize ns ++ bind(list, xhtml, row - row(foos.slice(start, end)) _) }) } private def row(foos:List[String])(xhtml: NodeSeq) : NodeSeq = foos.foldLeft(Util.emptyNodeSeq)((ns, foo) = ns ++ bind(foo, xhtml, name - foo.name)) Then your template can use table/tr/td or it could just use floating divs that wrap over when necessary: table lift:MyPage.func rowSize=10 tr list:row tdfoo:name//td /list:row /tr /lift:MyPage.func /table OR lift:MyPage.func list:row div class=cellfoo:name//div /list:row /lift:MyPage.func For an empty NodeSeq that works in the foldLeft I've had to create the following. Anybody know a better way? object Util { val emptyNodeSeq : NodeSeq = NodeSeq.fromSeq(Seq(xml:group/ xml:group)) } On Aug 18, 2:58 pm, harryh har...@gmail.com wrote: I have a List[Foo] and I want to construct a table with 10 columns and however many rows necessary to contain all the Foos. I feel like I should do something like so, but it's not quite right yet: table lift:MyPage.func tdfoo:name//td /lift:MyPage.func /table def func(xhtml: NodeSeq): NodeSeq = { val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo = { bind(foo, xhtml, name - foo.name) }) // then reduce the list of cells putting in trs in appropriate places, but not sure how. } --~--~-~--~~~---~--~~ 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-openid broken
Done. Great, propagated to maven repo now. 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: CMS for Lift?
I would like to know how the Lift/Scala can leveraged to with Alfresco or any other open source Java based CMS. Terry J. Leach On Aug 17, 2:09 pm, Stefan Scott stefanscottal...@gmail.com wrote: I'll chime in here since I've been evaluating several CMSs lately. I previously used Drupal and WordPress as my CMSs - now however I'm moving everything to MODx because of the increased flexibility and more-logical organization, and I'm also impressed with the demos of SilverStripe, TypoLight Typo3 - and LifeRay, which is written in Java instead of PHP. (LifeRay seems to be much more than a CMS - it claims to offer collaboration and social networking.) Some on-line demos here: MODx -http://trymodx.com/ SilverStripe -http://demo.silverstripe.com/ TypoLight -http://www.typolight.org/demo.html Typo3 -http://testsite.punkt.de/ LifeRay -http://demo.liferay.net/web/guest/home It would be good to take a look at these additional CMSs as they offer some capabilities beyond WordPress and Drupal. Drupal in particular is wildly popular but it may no longer be the best candidate to imitate, as it is less well-organized and less flexible/customizable (compared say to MODx, which lets you take CSS from an existing site and use it for your site, and which lets you apply a template to a single document, unlike Drupal where a theme applies to the entire site). To keep up with advanced CMSs, Drupal has evolved to use a bunch of (often redundant or competing) modules which are not always compatible with current releases. Examples of things that Drupal treats as add-ons (modules) are: custom content (the CCK/Views modules, with their confusing albeit AJAX-y interface), multi-language, and photo galleries (I gave up on Drupal after a few days of trying out various photo gallery modules, none of which I could understand). Finally, it seems odd that Drupal, as a content management system, lacks something all advanced CMSs have: a *treeview* of the overall site content. Instead, it only has a jumbled *list* of content, sorted by not by location but by last edited (!), with all translations also scattered through the list based on last- edited date, and this list is buried several levels deep in the admin navigation system, unlike the site content treeview navigator which is prominently displayed (usually on the left) in advanced CMSs. (Of course, I don't want to veer off-topic here and start a CMS flame war here in this liftweb discussion. :-) Regarding dynamic site map creation - I do know that MODx has something like this, using WayFinder to create a menu from selected branches of the site's document tree, automatically including any updated sub-branches, and I believe most other advanced CMSs have something like this too. LifeRay seems very intriguing - it claims to do a lot beyond just CMS. Since it's written in Java (not PHP), who knows if some of its code could be leveraged in Scala. So these might be some additional interesting CMSs to keep in mind (beyond Drupal and WordPress) when building a new CMS using liftweb. - Stefan Scott On Aug 16, 3:13 pm, glenn gl...@exmbly.com wrote: Philip, I'm working on a cms system in Lift. Right now, it allows for content creation using wymeditor, which can be tagged and displayed as an atom feed. This code is runnable, simple as it is. I'm working on adding dynamic site map creation as well. Is this kind of what you have in mind by a CMS system. I'm very interested in workiing with others on a CMS that can compete with any of the PHP varieties out there, such as Drupal and Wordpress. Most of these simply use plugins from one ore more javascript libraries out there for site creation, and Lift certainly can do javascript as well as, if not better than, these systems. Glenn... On Aug 15, 11:08 pm, philip philip14...@gmail.com wrote: Hi, Has anyone made a CMS for Liftweb? or I should say, in liftweb. Thanks, Philip --~--~-~--~~~---~--~~ 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] PreCache's use of WHERE ... IN
Given something like Tip.findAll(By(Tip.venueid, ), PreCache (Tip.userid)) The PreCache query param appears to do it's preaching by generating a query that uses IN, like so: SELECT DISTINCT users.id, users.firstname, users.lastname FROM users WHERE id IN (SELECT userid FROM tips WHERE venueid = ); This is a bit concerting as I have found queries of this form to be far less efficient (on a stock MySQL instance at least) than something like this (which will return the same results): SELECT DISTINCT users.id, users.firstname, users.lastname FROM users, tips WHERE tips.userid = users.id AND tips.venueid = ; Is there any particular reason that Lift is generating WHERE ... IN queries? Is there some way to instruct Lift to do otherwise? If not, should this possibly be changed? This is somewhat related to my last post on this thread as it also relates to WHERE ... IN queries. http://groups.google.com/group/liftweb/browse_thread/thread/14d4a5aac48ac73d/ -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: Has anyone tried Stax?
On Tue, Aug 18, 2009 at 4:22 PM, marius d. marius.dan...@gmail.com wrote: On Aug 18, 5:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You set whether you want a shared server, or dedicated/various speeds. In any case, is there room to entertain the thought of at some point adding support in Lift to propogate sessions across instances? (Is it easier now that it's been decoupled from servlets?) No it is not easier. The fundamental problem in distributing lift sessions is the bound functions. Sure, functions are serializable but their references may not be. For instance one can bind an ajax anonymous function and that functions can have a bunch of other references inside potentially other lambdas etc. Viktor was doing in the past some research to integrate with Terracotta but there were some issues. So consistently distributing Lift sessions in a clustered environment is a challenge but of course good ideas are more then welcome. Yeah, it really was a can of worms... - Ryan Donahuedonahu...@gmail.com wrote: Is anybody using Stax for anything more than prototyping or examples? If so, what has your experience been? Stax doesn't seem to fit lift very well, but I'd like to find out I'm wrong. Specifically, it does not support sticky sessions: http://developer.stax.net/forum/topics/initial-questions. I assume a Stax app shares resources with others on the same server, so you'd likely need to scale to additional servers sooner than normal. However, the lack of sticky sessions effectively caps a stateful lift app to one server. -- Viktor Klang Rogue Scala-head Blog: klangism.blogspot.com Twttr: viktorklang --~--~-~--~~~---~--~~ 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: Proposed internal changes on Mapper?
I'll go ahead and see what I can do, then. Derek On Tue, Aug 18, 2009 at 11:40 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Aug 18, 2009 at 7:12 AM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'm trying to fix Mapper support for Oracle and I've run into an issue. Oracle's JDBC drivers support returning autoGenerated keys, but not the way that Lift expects. The way that Lift currently works, it just calls executeUpdate with Statement.RETURN_GENERATED_KEYS set. In Oracle, this will simply return the ROWID of the inserted row, which means that we would have to do a second select to get the actual value. Alternatively, Oracle does support fetching the inserted value from a column if you use the executeUpdate(String, Array[String]) method (the Array is a set of column names to fetch). What I'm getting at is that support for autogenerated keys is very driver-specific right now, but the DriverTypes class essentially is just using some flags to control behavior in MetaMapper. I'm wondering if it would make more sense to move the support for insert queries into DriverTypes so that we have things tied directly to the drivers instead of splitting it up between two files. I'm thinking of adding something like: def performUpdate(conn : Connection, stmt : String, primaryKeyColumn : String) def performUpdate(conn : Connection, stmt : PreparedStatement, primaryKeyColumn : String) to DriverTypes, which would then allow us to define driver-specific key fetching in place. I could move the base functionality into DriverTypes itself, and then we could override as needed on specific vendor classes. The current situation with flags for brokenAutogeneratedKeys_? and wickedBrokenAutogeneratedKeys_?, while amusingly named, feels untenable in the long term as we continue to find corner cases for vendor drivers. I could add a notQuiteBrokenButDifferentAutogeneratedKeys_? flag for Oracle, but that doesn't feel right. Thoughts? I think it's a good idea. It will also help with Record support for JDBC. Derek -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: CMS for Lift?
I've been scratching my head about that one too. I have used both Alfresco and opencms to produce both dynamic and static and in the case of dynamic they have their own servlet/filter to render the content - I've not yet spent enough time working out how and if they can be fitted together. For me, having used Hybris (J2EE ecommerce engine with some CMS built in), I'd like to be able to have page fragments in a template served from the CMS (lift snippets presumably) that would be created/ maintained with some aspect of workflow by CMS user(s) in an associated CMS lift webapp with funky (X)HTML editor support. My web guys, non-lift devs, can then sprinkle cms tags where appropriate. A tag might be lift:cms contentId=news count=5 order=ascending/ which would render the last five news items in ascending order. Just some thoughts -- Ewan On Aug 18, 10:09 pm, Terry J. Leach terry.le...@gmail.com wrote: I would like to know how the Lift/Scala can leveraged to with Alfresco or any other open source Java based CMS. Terry J. Leach On Aug 17, 2:09 pm, Stefan Scott stefanscottal...@gmail.com wrote: I'll chime in here since I've been evaluating several CMSs lately. I previously used Drupal and WordPress as my CMSs - now however I'm moving everything to MODx because of the increased flexibility and more-logical organization, and I'm also impressed with the demos of SilverStripe, TypoLight Typo3 - and LifeRay, which is written in Java instead of PHP. (LifeRay seems to be much more than a CMS - it claims to offer collaboration and social networking.) Some on-line demos here: MODx -http://trymodx.com/ SilverStripe -http://demo.silverstripe.com/ TypoLight -http://www.typolight.org/demo.html Typo3 -http://testsite.punkt.de/ LifeRay -http://demo.liferay.net/web/guest/home It would be good to take a look at these additional CMSs as they offer some capabilities beyond WordPress and Drupal. Drupal in particular is wildly popular but it may no longer be the best candidate to imitate, as it is less well-organized and less flexible/customizable (compared say to MODx, which lets you take CSS from an existing site and use it for your site, and which lets you apply a template to a single document, unlike Drupal where a theme applies to the entire site). To keep up with advanced CMSs, Drupal has evolved to use a bunch of (often redundant or competing) modules which are not always compatible with current releases. Examples of things that Drupal treats as add-ons (modules) are: custom content (the CCK/Views modules, with their confusing albeit AJAX-y interface), multi-language, and photo galleries (I gave up on Drupal after a few days of trying out various photo gallery modules, none of which I could understand). Finally, it seems odd that Drupal, as a content management system, lacks something all advanced CMSs have: a *treeview* of the overall site content. Instead, it only has a jumbled *list* of content, sorted by not by location but by last edited (!), with all translations also scattered through the list based on last- edited date, and this list is buried several levels deep in the admin navigation system, unlike the site content treeview navigator which is prominently displayed (usually on the left) in advanced CMSs. (Of course, I don't want to veer off-topic here and start a CMS flame war here in this liftweb discussion. :-) Regarding dynamic site map creation - I do know that MODx has something like this, using WayFinder to create a menu from selected branches of the site's document tree, automatically including any updated sub-branches, and I believe most other advanced CMSs have something like this too. LifeRay seems very intriguing - it claims to do a lot beyond just CMS. Since it's written in Java (not PHP), who knows if some of its code could be leveraged in Scala. So these might be some additional interesting CMSs to keep in mind (beyond Drupal and WordPress) when building a new CMS using liftweb. - Stefan Scott On Aug 16, 3:13 pm, glenn gl...@exmbly.com wrote: Philip, I'm working on a cms system in Lift. Right now, it allows for content creation using wymeditor, which can be tagged and displayed as an atom feed. This code is runnable, simple as it is. I'm working on adding dynamic site map creation as well. Is this kind of what you have in mind by a CMS system. I'm very interested in workiing with others on a CMS that can compete with any of the PHP varieties out there, such as Drupal and Wordpress. Most of these simply use plugins from one ore more javascript libraries out there for site creation, and Lift certainly can do javascript as well as, if not better than, these systems. Glenn... On Aug 15, 11:08 pm, philip philip14...@gmail.com wrote: Hi, Has anyone made a CMS for Liftweb? or I should say, in liftweb. Thanks, Philip
[Lift] Re: how to construct a table with a set number of columns
Ah, perfect! Thx! Incidentally, I simplified in two places by instead of doing this: List.range(0, rowNum).foldLeft(Util.emptyNodeSeq)((ns, i) = { }) doing this: List.range(0, rowNum).flatMap(i = { }) (simlar change in the row function) -harryh On Aug 18, 3:52 pm, Ryan Donahue donahu...@gmail.com wrote: You could do something like this. Snippet: def func(xhtml: NodeSeq): NodeSeq = { val foos = Foo.findAll(...) val rowSize = (S.attr(rowSize) openOr 10).toInt val rowNum = (foos.size + rowSize - 1) / rowSize List.range(0, rowNum).foldLeft(Util.emptyNodeSeq)((ns, i) = { val start = i*rowSize val end = start+rowSize ns ++ bind(list, xhtml, row - row(foos.slice(start, end)) _) }) } private def row(foos:List[String])(xhtml: NodeSeq) : NodeSeq = foos.foldLeft(Util.emptyNodeSeq)((ns, foo) = ns ++ bind(foo, xhtml, name - foo.name)) Then your template can use table/tr/td or it could just use floating divs that wrap over when necessary: table lift:MyPage.func rowSize=10 tr list:row tdfoo:name//td /list:row /tr /lift:MyPage.func /table OR lift:MyPage.func list:row div class=cellfoo:name//div /list:row /lift:MyPage.func For an empty NodeSeq that works in the foldLeft I've had to create the following. Anybody know a better way? object Util { val emptyNodeSeq : NodeSeq = NodeSeq.fromSeq(Seq(xml:group/ xml:group)) } On Aug 18, 2:58 pm, harryh har...@gmail.com wrote: I have a List[Foo] and I want to construct a table with 10 columns and however many rows necessary to contain all the Foos. I feel like I should do something like so, but it's not quite right yet: table lift:MyPage.func tdfoo:name//td /lift:MyPage.func /table def func(xhtml: NodeSeq): NodeSeq = { val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo = { bind(foo, xhtml, name - foo.name) }) // then reduce the list of cells putting in trs in appropriate places, but not sure how. } --~--~-~--~~~---~--~~ 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: makeUtf8 and HttpServletRequest broken in new build???
Actually, I used the Maven Eclipse plugin. File/New/Other/Maven/Maven Project. Click Next twice and select the Nexus Indexer Archetype catalog. Use lift to filter and select Group Id: repository.net.liftweb Artifact Id: lift.archetype.basic Version: 1.1-SNAPSHOT Glenn... On Aug 18, 10:32 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Aug 18, 2009 at 9:15 AM, glenn gl...@exmbly.com wrote: David, I just ran the basic from SNAPSHOTS and Boot.scala still has What did you type at the command line? private def makeUtf8(req: HttpServletRequest) { req.setCharacterEncoding(UTF-8) } in Boot.scala. Glenn... On Aug 17, 10:10 am, David Pollak feeder.of.the.be...@gmail.com wrote: On Mon, Aug 17, 2009 at 9:42 AM, glenn gl...@exmbly.com wrote: Is anyone planning on fixing the archetype snapshots to add this change, and import provider._ in Boot.scala. I'm able to create a new Basic Lift app from archetypes... and it works just fine. Can you tell us what command you typed to get an archetype that did not work? Thanks in advance, Glenn... On Aug 10, 10:36 am, marius d. marius.dan...@gmail.com wrote: Your makeUTF8 should look like this: private def makeUtf8(req: HTTPRequest): Unit = {req.setCharacterEncoding(UTF-8)} just use HTTPRequest instead of HttpServletRequest. Br's, Marius On Aug 10, 7:49 pm, glenn gl...@exmbly.com wrote: I just got a type mismatch found error in LiftRules.early.append (makeUtf8) in Boot.scala. It's now looking for an net.liftweb.http.provider.HTTPRequest instead of a javax.servlet.http.HttpServletRequest. Is this a new change, and if so, where is the net.liftweb.http.provider package? Glenn... -- 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: Has anyone tried Stax?
Guys, This really seems like a weakness. Can someone walk me through the issues on the lift committers call, tomorrow? Best wishes, --greg On Tue, Aug 18, 2009 at 1:51 PM, Viktor Klang viktor.kl...@gmail.comwrote: On Tue, Aug 18, 2009 at 4:22 PM, marius d. marius.dan...@gmail.comwrote: On Aug 18, 5:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: You set whether you want a shared server, or dedicated/various speeds. In any case, is there room to entertain the thought of at some point adding support in Lift to propogate sessions across instances? (Is it easier now that it's been decoupled from servlets?) No it is not easier. The fundamental problem in distributing lift sessions is the bound functions. Sure, functions are serializable but their references may not be. For instance one can bind an ajax anonymous function and that functions can have a bunch of other references inside potentially other lambdas etc. Viktor was doing in the past some research to integrate with Terracotta but there were some issues. So consistently distributing Lift sessions in a clustered environment is a challenge but of course good ideas are more then welcome. Yeah, it really was a can of worms... - Ryan Donahuedonahu...@gmail.com wrote: Is anybody using Stax for anything more than prototyping or examples? If so, what has your experience been? Stax doesn't seem to fit lift very well, but I'd like to find out I'm wrong. Specifically, it does not support sticky sessions: http://developer.stax.net/forum/topics/initial-questions. I assume a Stax app shares resources with others on the same server, so you'd likely need to scale to additional servers sooner than normal. However, the lack of sticky sessions effectively caps a stateful lift app to one server. -- Viktor Klang Rogue Scala-head Blog: klangism.blogspot.com Twttr: viktorklang -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: PreCache's use of WHERE ... IN
Because making things line up name-wise for joins (especially when you're joining to the same table) is a lot more difficult. All RDBMS except MySQL will optimize both inner queries and joins the same way. Interesting. I have been considering switching to PostgreSQL (for reasons unrelated to this), and this issue may speed up my move. What RDBMS are others generally using with Lift? Are there any general recommendations? -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: CMS for Lift?
Just my two cents, but I wouldn't use the lift namespace... If you use the lift tags OOTB, you risk designers shoving lots of comet actors on a single page. You would get more granular control if you created a special set of tags: cms:something .. / Cheers, Tim On 18/08/2009 23:00, Ewan ehar...@gmail.com wrote: I've been scratching my head about that one too. I have used both Alfresco and opencms to produce both dynamic and static and in the case of dynamic they have their own servlet/filter to render the content - I've not yet spent enough time working out how and if they can be fitted together. For me, having used Hybris (J2EE ecommerce engine with some CMS built in), I'd like to be able to have page fragments in a template served from the CMS (lift snippets presumably) that would be created/ maintained with some aspect of workflow by CMS user(s) in an associated CMS lift webapp with funky (X)HTML editor support. My web guys, non-lift devs, can then sprinkle cms tags where appropriate. A tag might be lift:cms contentId=news count=5 order=ascending/ which would render the last five news items in ascending order. Just some thoughts -- Ewan On Aug 18, 10:09 pm, Terry J. Leach terry.le...@gmail.com wrote: I would like to know how the Lift/Scala can leveraged to with Alfresco or any other open source Java based CMS. Terry J. Leach On Aug 17, 2:09 pm, Stefan Scott stefanscottal...@gmail.com wrote: I'll chime in here since I've been evaluating several CMSs lately. I previously used Drupal and WordPress as my CMSs - now however I'm moving everything to MODx because of the increased flexibility and more-logical organization, and I'm also impressed with the demos of SilverStripe, TypoLight Typo3 - and LifeRay, which is written in Java instead of PHP. (LifeRay seems to be much more than a CMS - it claims to offer collaboration and social networking.) Some on-line demos here: MODx -http://trymodx.com/ SilverStripe -http://demo.silverstripe.com/ TypoLight -http://www.typolight.org/demo.html Typo3 -http://testsite.punkt.de/ LifeRay -http://demo.liferay.net/web/guest/home It would be good to take a look at these additional CMSs as they offer some capabilities beyond WordPress and Drupal. Drupal in particular is wildly popular but it may no longer be the best candidate to imitate, as it is less well-organized and less flexible/customizable (compared say to MODx, which lets you take CSS from an existing site and use it for your site, and which lets you apply a template to a single document, unlike Drupal where a theme applies to the entire site). To keep up with advanced CMSs, Drupal has evolved to use a bunch of (often redundant or competing) modules which are not always compatible with current releases. Examples of things that Drupal treats as add-ons (modules) are: custom content (the CCK/Views modules, with their confusing albeit AJAX-y interface), multi-language, and photo galleries (I gave up on Drupal after a few days of trying out various photo gallery modules, none of which I could understand). Finally, it seems odd that Drupal, as a content management system, lacks something all advanced CMSs have: a *treeview* of the overall site content. Instead, it only has a jumbled *list* of content, sorted by not by location but by last edited (!), with all translations also scattered through the list based on last- edited date, and this list is buried several levels deep in the admin navigation system, unlike the site content treeview navigator which is prominently displayed (usually on the left) in advanced CMSs. (Of course, I don't want to veer off-topic here and start a CMS flame war here in this liftweb discussion. :-) Regarding dynamic site map creation - I do know that MODx has something like this, using WayFinder to create a menu from selected branches of the site's document tree, automatically including any updated sub-branches, and I believe most other advanced CMSs have something like this too. LifeRay seems very intriguing - it claims to do a lot beyond just CMS. Since it's written in Java (not PHP), who knows if some of its code could be leveraged in Scala. So these might be some additional interesting CMSs to keep in mind (beyond Drupal and WordPress) when building a new CMS using liftweb. - Stefan Scott On Aug 16, 3:13 pm, glenn gl...@exmbly.com wrote: Philip, I'm working on a cms system in Lift. Right now, it allows for content creation using wymeditor, which can be tagged and displayed as an atom feed. This code is runnable, simple as it is. I'm working on adding dynamic site map creation as well. Is this kind of what you have in mind by a CMS system. I'm very interested in workiing with others on a CMS that can compete with any of the PHP varieties out there, such as Drupal and Wordpress. Most of these simply use plugins from one ore more javascript libraries out there
[Lift] Re: PreCache's use of WHERE ... IN
On Tue, Aug 18, 2009 at 1:51 PM, harryh har...@gmail.com wrote: Given something like Tip.findAll(By(Tip.venueid, ), PreCache (Tip.userid)) The PreCache query param appears to do it's preaching by generating a query that uses IN, like so: SELECT DISTINCT users.id, users.firstname, users.lastname FROM users WHERE id IN (SELECT userid FROM tips WHERE venueid = ); This is a bit concerting as I have found queries of this form to be far less efficient (on a stock MySQL instance at least) than something like this (which will return the same results): SELECT DISTINCT users.id, users.firstname, users.lastname FROM users, tips WHERE tips.userid = users.id AND tips.venueid = ; Is there any particular reason that Lift is generating WHERE ... IN queries? Because making things line up name-wise for joins (especially when you're joining to the same table) is a lot more difficult. All RDBMS except MySQL will optimize both inner queries and joins the same way. Is there some way to instruct Lift to do otherwise? No. If not, should this possibly be changed? It's not a high priority for me, but maybe on of the other committers wants to take up the project. This is somewhat related to my last post on this thread as it also relates to WHERE ... IN queries. http://groups.google.com/group/liftweb/browse_thread/thread/14d4a5aac48ac73d/ -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 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] Sitemap and mapper dependency's effects on object reuse
I'm looking for some answers on best coding practices, particularly when it comes to object reuse. In a data-centric application, where the Sitemap is used to navigate through your mapper entities, has anyone given much thought to the object dependencies this can create. In the case of page specific rendering with SiteMap, for example, where should the Menu entries go - in their own object, or should they stay with the MetaMappers. And what about the templates, which can have dependencies on snippets, which reside elsewhere. In other words, it seems to me that good design requires managing the chain of dependencies that an ordinary Menu entry may require. A consistent approach is always best, and I admit that I don't have one at present. --~--~-~--~~~---~--~~ 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: slow down ajax?
OK, seems like I have to learn a little more about Scala so I can override the ajaxText method, right? Here it is in the docs: def ajaxText(value: String, func: String = JsCmd): Elem = ajaxText_* (value, SFuncHolder(func)) When I fumble around, it won't compile, because I'm just not doing it right. My project is a hobby, not mission-critical, so I'm under no pressure. For now, I will change to an ajaxForm, but the learning is all good, and if you want to keep teaching, I will listen! Thanks for your patience... On Aug 18, 12:41 pm, marius d. marius.dan...@gmail.com wrote: Having def ajaxText(value: String, jsFunc: Call, func: String = JsCmd) jsFunc parameter is a Call which is defined as: case class Call(function: String, params: JsExp*) extends JsExp So by this you represent a javascript function invocations. So assuming somewhere you have a javascript function like: function myFunc(myParam, callback) { // do some logic callback() } in the snippet we have something like: ajaxText(task.dueOn.toString, Call(myFunc, Str(some_param_value)) v = { task.dueOn(v.toLong).save; reDrawTasks();}) As you can see we called Call(myFunc, Str (some_param_value)) .. .we provided the JS function name and one parameter. Lift will add the second parameter which is the callback function. This callback function represents the actual ajax call and since it is a callback you can invoke it whenever you want inside 'myFunc' javascript function. In other words you can defer the actual ajax call as you see fit. Now myFunc function declaration can be: 1. In your own .js file 2. Written in the script tag inside your html 3. Generate using Lifts' JS absctrations using JsCmds.Function() object such as: JsCmds.Function(MyFunc, List(myParam, callback), a_JsCmd_expression_which_is_the_function_body) The main point in all this is that you can defer the actual ajax call. You know better if this fits your case. Br's, Marius On Aug 18, 10:21 pm, g-man gregor...@gmail.com wrote: No, this is the old way ...I am unsure how to invoke the ajax method -- could you enlighten me? On Aug 17, 12:26 pm, marius d. marius.dan...@gmail.com wrote: I don't see in your code the use of the overloaded ajaxText that I posted. Have you tried it? Marius On Aug 17, 10:20 pm, g-man gregor...@gmail.com wrote: OK, thanks for checking back... Snippet: swappable(span class='dueon'{task.dueOn.toString}/span, span class='chgDueon'{ajaxText(task.dueOn.toString, v = { task.dueOn(v.toLong).save; reDrawTasks(); }) % (size - 10)}/span) JS: $chgDueon // jQuery selection for text field .datepicker({dateFormat:'m-d-yy', minDate: +1}) .blur(function(){$chgDueon.val(parseDate($chgDueon.val()));}); // works well to pick a new date and change it to millis for save Emitted XHTML: span span class=dueon id=F111290299287IBE onclick=jQuery('#'+'F111290299287IBE').hide(); jQuery('#'+'F1112902992880KN').show().each(function(i) { var t = this; setTimeout(function() { t.focus(); }, 200);});return false;; 1248493271843/span span style=display: none id=F1112902992880KN onblur=jQuery('#'+'F111290299287IBE').show(); jQuery('#'+'F1112902992880KN').hide(); input onblur=lift_ajaxHandler('F111290299286DL1=' + encodeURIComponent(this.value), null, null) type=text value=1248493271843 onkeypress=lift_blurIfReturn(event) size=10 / /span /span So, all the parts work well together, but Lift's ajax just takes off too quickly, and cannot read the new value. On Aug 16, 11:02 pm, marius d. marius.dan...@gmail.com wrote: You can probably use this definition of ajaxText: def ajaxText(value: String, jsFunc: Call, func: String = JsCmd) See the jsFunc parameter. Essentially you are specifying your function call that may have one parameter. To your parameter list List we'll add a new parameter which is the ajax invocation function. In other words your code gets that function that does the ajax call meaning that you have the control over when the ajax call is made. Br's, Marius On Aug 17, 8:55 am, marius d. marius.dan...@gmail.com wrote: Would you please post a code snippet with what you're doing? (a minimalistic example) Br's, Marius On Aug 17, 7:41 am, g-man gregor...@gmail.com wrote: I am moving nicely with my 'save all dates as millis and let the client localize for display' project, learning while enhancing the ToDo sample app. I have added a 'dueOn' field, and that is displayed as swappable ajaxText, similar to the other fields in the tutorial. I have enabled datepicker for the ajaxText