Re: [Lift] method call from out of nowhere

2009-11-30 Thread Hannes
It is called outside from an Actor, everytime a new item is created. thanks. Where is joinOtherOrders()called within your code? alex On Sun, Nov 29, 2009 at 7:24 AM, Hannes hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote: Hey Lifters, I've some really strange things

Re: [Lift] Re: method call from out of nowhere

2009-11-30 Thread Hannes
Hi Marius, the method is called from an Actor, everytime a new order is created. I did override def afterCreate in my LimitOrder MetaObject. thanks. In your code in what conditions joinOtherOrders gets called ? Br's, Marius On Nov 29, 6:18 pm, Hannes hannes.flo...@gmx.li wrote: Hi

Re: [Lift] Re: method call from out of nowhere

2009-11-30 Thread Hannes
Timothy Perrett schrieb: The two defs only make sence together, that's why I put them together in one def. I think that's encapsulation... - dont use while loops. period. you have a List[T], use foreach if you have a unit operation If you want encapsulation, because they only make

Re: [Lift] method call from out of nowhere

2009-11-30 Thread Hannes
Hi David, In my LimitOrder Meta Object, I did: override def afterCreate to inform an Actor, everytime a new Order is created. The Actor than calls the joinOtherOrders method. # I think I understand it now. Cause I'm creating new orders inside the loop at some point. But still I don' t really

Re: [Lift] method call from out of nowhere

2009-11-30 Thread Hannes
ok, I'll do that. thanks. Or you can get stack trace information from Thread. I have a utility function getCaller that does a getStackTrace and then looks at the proper element of the array. (second, third? I forget) On Mon, Nov 30, 2009 at 12:30 AM, Alex Boisvert alex.boisv...@gmail.com

[Lift] radio button problem

2009-11-30 Thread mr najmi
hai again.. i try to bind the data from the db in the radio button but have an error like this: overloaded method value bind with alternatives (String,net.liftweb.util.Box[(scala.xml.NodeSeq) = scala.xml.NodeSeq],net.liftweb.util.Box[(scala.xml.PrefixedAttribute) =

[Lift] Re: radio button problem

2009-11-30 Thread Timothy Perrett
Do something like: val radios = SHtml.radio(List(business, technical), Full (preference.preference_selection), s = whatever.field(s)) bind(form, xhtml, options_one - radios.apply(0), options_two - radios.apply(1), save - SHtml.submit(Submit, submit _) ) Cheers, Tim On Nov 30, 9:29 am, mr

[Lift] Re: Lift and LDAP

2009-11-30 Thread Timothy Perrett
Right now there are no plans to implement this, certainly not before 2.0 (this is the first time anyone has asked for it) - if you need it specifically, it probably wouldn't be too difficult to implement within your own application. Cheers, Tim On Nov 30, 7:41 am, Xuefeng Wu ben...@gmail.com

[Lift] Re: newbie question about record

2009-11-30 Thread Timothy Perrett
That depends on the semantic of your backend does it not? What backend are you talking to? Can you provide more information? Cheers, Tim On Nov 30, 2:58 am, Jarod Liu liuyuan...@gmail.com wrote: how to setup table/column names of a record entity.(like override dbTableName field in mapper) --

[Lift] Re: vscaladoc broken?

2009-11-30 Thread Indrajit Raychaudhuri
Tim, The scala-tools maven site honors the package link defs. Did you do scaladoc generation as part site build or as part of scala:doc? I am assuming you did the later. And quite likely the configuration for the jvmArgs (-DpackageLinkDefs in particular) isn't getting propagated from report

Re: [Lift] Re: vscaladoc broken?

2009-11-30 Thread Timothy Perrett
Hey :-) Yeah I did a mvn scala:doc - what should one run instead? mvn site? Cheers, Tim On 30 Nov 2009, at 13:16, Indrajit Raychaudhuri wrote: Tim, The scala-tools maven site honors the package link defs. Did you do scaladoc generation as part site build or as part of scala:doc? I am

Re: [Lift] Feedback on wizard code

2009-11-30 Thread David Pollak
On Sun, Nov 29, 2009 at 3:57 PM, Timothy Perrett timo...@getintheloop.euwrote: David, So I took a close look at the lift-wizard code with a view to do what we discussed on the committers call. From that, I have the following feedback and questions: - Wizard.scala, L192... You have

Re: [Lift] Re: vscaladoc broken?

2009-11-30 Thread Indrajit Raychaudhuri
Short answer: Use mvn site for a couple of days to have the package link defs work, but ideally mvn scala:doc should be consistent. I'll fix that, give me a day or two please. Long answer: mvn site picks up plugin settings from reporting section and mvn scala:doc picks up plugin settings from

[Lift] Re: A sensible AJAX approach

2009-11-30 Thread glenn
David, Thanks a bunch. Your solution is one I was trying to implement but wasn't quite sure how until you showed me that I can create an AnonFunc using Shtml.ajaxCall. It certainly does simplify things. One of the issues that stymied me - and still does, frankly - is how the ajaxCall wraps the

[Lift] Re: How to get the servlet context

2009-11-30 Thread Marius
Ok I may be missing something essential from all this thread but why not use a folder from the user's home directory? If your app runs say under jetty OS user should heve read/write rights to write on the home user file-system. Even if not (although I haven't encountered the case) those rights can

[Lift] Re: How to get the servlet context

2009-11-30 Thread jhonig
Marius, I tried to create a link from the webapp dir to another location with rw-access, but that was not allowed... My conclusion was that you can't have symbolic links to locations outside the war. My problem is that there are three different locations that could all be interpreted as a root

Re: [Lift] How to get the servlet context

2009-11-30 Thread Heiko Seeberger
All this is brittle, at least special! Please use the temp dir the servlet context will offer you. Tomcat and Jetty offer one. Heiko On Monday, November 30, 2009, jhonig al...@xs4all.nl wrote: Marius, I tried to create a link from the webapp dir to another location with rw-access, but that

[Lift] Re: How to get the servlet context

2009-11-30 Thread Marius
Ahh so you want direct links to those files. Still you can do something else. Point your URI's from your page to a specific uri such as /myapp/serve/myimage.jpg. You intercept requests to myapp :: serve :: _ using a DispatchPF. The dispatch PF knows about your folder location (presumably from a

[Lift] Re: newbie question about record

2009-11-30 Thread TylerWeir
I think there is a general interest for a non-trivial Record example. Maybe kill two birds with one stone and connect to a NoSQL store. On Nov 30, 5:26 am, Timothy Perrett timo...@getintheloop.eu wrote: That depends on the semantic of your backend does it not? What backend are you talking

[Lift] lift-json escaping bug

2009-11-30 Thread harryh
scala import net.liftweb.json._ scala val s2 = { \id\: \America\\/New_York\ } s2: java.lang.String = { id: America\/New_York } scala JsonParser.parse(s2) res1: net.liftweb.json.JsonAST.JValue = JObject(List(JField(id,JString (America\New_York It should be America/New_York but for some reason

Re: [Lift] Re: How to get the servlet context

2009-11-30 Thread David Pollak
Storing files inside the exploded WAR file is a tremendously bad idea. I don't think we should be helping a user do something that is going to continue to cause him pain. If he needs to upload images, etc. and then subsequently present them to the user, it's two tables in the RDBMS and a single

Re: [Lift] MetaMapper - Count with Group By?

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 10:07 PM, Joern joern.bernha...@gmx.net wrote: Hi there, is it possible, to create a select statement like SELECT user_id, count(*) FROM table GROUP BY user_id with the MetaMapper? No. Sorry. You could do: DB.runQuery(SELECT user_id, count(*) FROM table GROUP BY

[Lift] Re: lift-json escaping bug

2009-11-30 Thread Peter Robinett
Harry, I think you're double-escaping the slash. This works: scala import net.liftweb.json._ scala val s1 = { \id\: \America/New_York\ } s1: java.lang.String = { id: America/New_York } scala JsonParser.parse(s1) res0: net.liftweb.json.JsonAST.JValue = JObject(List(JField(id,JString

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
He's double escaping so that scala's string interpretation will put a raw \ in there, so that it's an escaped forward slash (\/) to the JSON parson, as I understand it. The output should be either invalid escape or forward slash, but not backslash unless the input was \\. -Ross On Nov 30,

[Lift] Re: lift-json escaping bug

2009-11-30 Thread harryh
Yes, what Ross said. Further, taking a look at JsonParser.scala the bug appears to be on line ~202 where there are a couple of missing escape sequences: \/ as well as \f. -harryh On Nov 30, 6:20 pm, Ross Mellgren dri...@gmail.com wrote: He's double escaping so that scala's string

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
If you file an issue on github I'll write up a patch for you tonight. -Ross On Nov 30, 2009, at 6:30 PM, harryh wrote: Yes, what Ross said. Further, taking a look at JsonParser.scala the bug appears to be on line ~202 where there are a couple of missing escape sequences: \/ as well as \f.

[Lift] Re: lift-json escaping bug

2009-11-30 Thread Nathan Folkman (Foursquare)
Here's the complete list from http://json.org/: char: Any Unicode character except or \ or control-character. \ \\ \/ \b \f \n \r \t \u four-hex-digits - n On Nov 30, 6:30 pm, harryh har...@gmail.com wrote: Yes, what Ross said.  Further, taking a look at JsonParser.scala the bug appears to

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
What I find particularly interesting is that the JSON spec lacks \', but gains \/, relative to the ECMA-262 (javascript) spec that JSON supposedly derives from. -Ross On Nov 30, 2009, at 6:34 PM, Nathan Folkman (Foursquare) wrote: Here's the complete list from http://json.org/: char:

Re: [Lift] Refactoring Round 2

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 7:30 AM, Heiko Seeberger heiko.seeber...@googlemail.com wrote: Excellent proposal! +1 Heiko On Friday, November 27, 2009, Indrajit Raychaudhuri indraj...@gmail.com wrote: Folks, In continuation to the refactoring initiative and following up on the

Re: [Lift] Re: Broken 1.1-M7 jpa archetypes

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 2:49 AM, Indrajit Raychaudhuri indraj...@gmail.comwrote: Fixed in snapshot repo :) The following command should give you a good project now. mvn archetype:generate -DarchetypeRepository=http://scala-tools.org/ repo-snapshots

Re: [Lift] Re: How to get the servlet context

2009-11-30 Thread Timothy Perrett
Sometimes its an unavoidable fact that we need to store stuff on the file-system. Im not promoting inside the exploded war, but knowing your location and going from there can be a useful aid; its certainly something that i've done before with success. Cheers, Tim On 30 Nov 2009, at 22:30,

Re: [Lift] How to redirect to a specify url when logged in successfully?

2009-11-30 Thread David Pollak
On Sun, Nov 29, 2009 at 12:17 AM, Neil.Lv anim...@gmail.com wrote: Hi all, I want to redirecto to a specify URL like this /all_users when logged in successfully via the default link, http://localhost:8080/user_mgt/login Is there a help method (i dont't find it) to configure it? When

Re: [Lift] Re: How to get the servlet context

2009-11-30 Thread David Pollak
On Mon, Nov 30, 2009 at 4:14 PM, Timothy Perrett timo...@getintheloop.euwrote: Sometimes its an unavoidable fact that we need to store stuff on the file-system. Im not promoting inside the exploded war, but knowing your location and going from there can be a useful aid; its certainly something

Re: [Lift] Re: Beef with LiftRules.explicitlyParsedSuffixes

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 1:52 PM, Marius marius.dan...@gmail.com wrote: For a default behavior this is a reasonable approach. But from a framework perspective this is a little limiting. In order to be more extensible I think we should allow users to plug in their own splitting functions (say

Re: [Lift] Multipage wizards

2009-11-30 Thread David Pollak
On Wed, Nov 25, 2009 at 12:30 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: David Pollak feeder.of.the.be...@gmail.com writes: Folks, I've completed the first pass at multi-page input Wizards in Lift. You can see an example at: http://demo.liftweb.net/wiz Great news! [...] The

Re: [Lift] Re: Lift and LDAP

2009-11-30 Thread Xuefeng Wu
Thank you for your reply and I will try. On Mon, Nov 30, 2009 at 6:25 PM, Timothy Perrett timo...@getintheloop.euwrote: Right now there are no plans to implement this, certainly not before 2.0 (this is the first time anyone has asked for it) - if you need it specifically, it probably wouldn't

[Lift] Re: lift-json escaping bug

2009-11-30 Thread harryh
Done: http://github.com/dpp/liftweb/issues/#issue/214 On Nov 30, 6:33 pm, Ross Mellgren dri...@gmail.com wrote: If you file an issue on github I'll write up a patch for you tonight. -Ross On Nov 30, 2009, at 6:30 PM, harryh wrote: Yes, what Ross said.  Further, taking a look at

[Lift] IN Query Param

2009-11-30 Thread Trevor Austin
I have some slow code: val users:List[User] = Tag.findAll(By(Tag.tagType,this), OrderBy (Tag.created_at, Descending), MaxRows(100), PreCache(Tag.user)).map (_.user.obj.open_!) That I turned into faster ugly code: val users:List[User] = User.findAll(BySql(WHERE id IN (SELECT TOP 100 user from

[Lift] Re: IN Query Param

2009-11-30 Thread Trevor Austin
Never mind, it just needed a type hint: val users:List[User] = User.findAll(In(User.id, Tag.user, By (Tag.tagType, this), OrderBy(Tag.created_at, Descending), MaxRows[Tag] (100))) On Nov 30, 9:17 pm, Trevor Austin traus...@gmail.com wrote: I have some slow code: val users:List[User] =

Re: [Lift] Re: IN Query Param

2009-11-30 Thread David Pollak
On Mon, Nov 30, 2009 at 6:25 PM, Trevor Austin traus...@gmail.com wrote: Never mind, it just needed a type hint: Sometimes the type inferencer gets it right and sometimes it needs some extra help. val users:List[User] = User.findAll(In(User.id, Tag.user, By (Tag.tagType, this),

Re: [Lift] Re: lift-json escaping bug

2009-11-30 Thread Ross Mellgren
On review board: http://reviewboard.liftweb.net/r/131/ I did run across another infelicity when writing the test -- apparently JsonParser crashes when given a scalar value, as opposed to an array or object: scala parse(\foobar\) net.liftweb.json.JsonParser$ParseException: unexpected null Near:

[Lift] **URGENT** Archetypes broken

2009-11-30 Thread David Pollak
Folks, Somehow somebody broke the basic archetype. This is not acceptable. Here's what I typed and here's what happened: d...@sevenof9:~/tmp$ cat /home/dpp/bin/new_lift #!/bin/sh mvn archetype:create -U -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \

Re: [Lift] **URGENT** Archetypes broken

2009-11-30 Thread David Pollak
On Mon, Nov 30, 2009 at 8:25 PM, Ross Mellgren dri...@gmail.com wrote: It looks like they work to me. I'm using this: r...@hugo:~$ mklift lift-archetype-basic test-brokenarchetypes4 + mklift lift-archetype-basic test-brokenarchetypes4 + test 2 -lt 2 + mvn archetype:generate

Re: [Lift] how to fill dropdown list with data in the database

2009-11-30 Thread David Pollak
if you have: val books: List[Book] = ... def chosenBook(in: Book): Unit = { ... this method will be called when the form is processed } SHtml.selectObj[Book](books.map(b = (b, b.name.is)), Empty, chosenBook _) Hope this helps. On Thu, Nov 19, 2009 at 7:55 PM, mr najmi mnajm...@gmail.com

[Lift] Re: lift-json escaping bug

2009-11-30 Thread Joni Freeman
Hi, This is from JSON RFC (http://www.ietf.org/rfc/rfc4627.txt): A JSON text is a serialized object or array. I checked with another parser (http://www.jsonlint.com) and it fails too when given just JSON value: syntax error, unexpected TNUMBER, expecting '{' or '[' at line 1 So perhaps a better

Re: [Lift] **URGENT** Archetypes broken

2009-11-30 Thread Indrajit Raychaudhuri
On 01/12/09 10:58 AM, David Pollak wrote: On Mon, Nov 30, 2009 at 8:25 PM, Ross Mellgren dri...@gmail.com mailto:dri...@gmail.com wrote: It looks like they work to me. I'm using this: ... snip/ ... I note you're using archetype:create? The wiki says

Re: [Lift] **URGENT** Archetypes broken

2009-11-30 Thread Indrajit Raychaudhuri
On 01/12/09 11:30 AM, Ross Mellgren wrote: On Dec 1, 2009, at 12:28 AM, David Pollak wrote: On Mon, Nov 30, 2009 at 8:25 PM, Ross Mellgren dri...@gmail.com mailto:dri...@gmail.com wrote: archetype:create was working up through last week. There were no **BREAKING CHANGES** notifications.

Re: [Lift] method call from out of nowhere

2009-11-30 Thread Hannes
Hi David, On Mon, Nov 30, 2009 at 12:11 AM, Hannes hannes.flo...@gmx.li mailto:hannes.flo...@gmx.li wrote: Hi David, In my LimitOrder Meta Object, I did: override def afterCreate to inform an Actor, everytime a new Order is created. The Actor than calls the

Re: [Lift] Multipage wizards

2009-11-30 Thread Jeppe Nejsum Madsen
David Pollak feeder.of.the.be...@gmail.com writes: [...] Thoughts? Yeah this all sounds good. I'm trying to unify most of the pieces of single form inputs, validation, mapper, record and wizard. It's generally slow going. Good news (about the unification :-) Let me know if there's

[Lift] Re: Image upload and serving example

2009-11-30 Thread Marius
This sounds like a good wiki subject. Wiki gardeners ? Br's, Marius On Dec 1, 7:26 am, David Pollak feeder.of.the.be...@gmail.com wrote: Folks, Lately there's been a bunch of chatter on the list about image upload and figuring out how to put the image files in the right place to serve them