[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 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 > again. > > I've written a

Re: [Lift] Multipage wizards

2009-11-30 Thread Jeppe Nejsum Madsen
David Pollak 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 anything I can do to spee

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 > 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 joinOtherOrder

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 > > wrote: >> >> archetype:create was working up through last week. There were no >> **BREAKING CHANGES** notifications. arche

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 > wrote: > > It looks like they work to me. I'm using this: > > ... > > ... > > I note you're using archetype:create? The wiki says > archetype:generate; I don'

[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 bet

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

2009-11-30 Thread Ross Mellgren
On Dec 1, 2009, at 12:28 AM, David Pollak wrote: > On Mon, Nov 30, 2009 at 8:25 PM, Ross Mellgren wrote: > > archetype:create was working up through last week. There were no **BREAKING > CHANGES** notifications. archetype:generate forces me to answer questions > (the whole point of having a

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 wrote: > can anyone sh

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

2009-11-30 Thread David Pollak
On Mon, Nov 30, 2009 at 8:25 PM, Ross Mellgren 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 -DarchetypeGroupId=net.lift

[Lift] Image upload and serving example

2009-11-30 Thread David Pollak
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 again. I've written a simple example of image uploading, storing the image in the RDBMS and then serving the image. You can find the code at:

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

2009-11-30 Thread Ross Mellgren
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 -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=

[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 \ -Dar

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 Ne

Re: [Lift] Re: IN Query Param

2009-11-30 Thread David Pollak
On Mon, Nov 30, 2009 at 6:25 PM, Trevor Austin 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), OrderBy(Tag.created_at,

[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 wrote: > I have some slow code: > > val users:List[User] = Tag.findAll(By(Tag.tagT

[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 Ta

[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 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 JsonParser.scala t

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 wrote: > 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

Re: [Lift] Multipage wizards

2009-11-30 Thread David Pollak
On Wed, Nov 25, 2009 at 12:30 AM, Jeppe Nejsum Madsen wrote: > David Pollak 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 building of HTML forms from

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

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 1:52 PM, Marius 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 a LiftRules RulesSe

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 wrote: > 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 bef

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 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 i logge

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, Da

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 wrote: > Fixed in snapshot repo :) > > The following command should give you a good project now. > > mvn archetype:generate -DarchetypeRepository=http://scala-tools.org/ > repo-snapshots -DremoteReposi

Re: [Lift] Binding error in Ajax call : how to debug ?

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 4:14 AM, Francois wrote: > Hello, > > When I use bind(namespace, template, bindings*) in an Ajax call, if > there is a binding error (for example, a misspelled word in the > template), I can't see any error, nor in the web broswer as it the case > for such error outside Aj

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 > wrote: > > Folks, > > > > In continuation to the refactoring initiative and following up on the > > discussio

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: >

[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 wrote: > Yes, what Ross said.  Further, taking a look at JsonParser.scala the > bug appears to be on line ~

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 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 wrote: > He's double escaping so that scala's string interpretation will put a   >

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, 2

[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 (A

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

2009-11-30 Thread David Pollak
On Fri, Nov 27, 2009 at 10:07 PM, Joern 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 user_id", Nil)

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 s

[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

[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 wrote: > That depends on the semantic of your backend does it not? What backend > are you talking to? Can you provide more

[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 co

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 wrote: > Marius, > > I tried to create a link from the webapp dir to another location with > rw-access, but that was not allow

[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"

[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 ca

[Lift] Re: How to get the servlet context

2009-11-30 Thread jhonig
Hi Tim, Jeppe, and others who have replied... I have spent a few more hours, but there are just too many variables and I haven't been able to figure them out. I logged the various locations (running under a standalone jetty, not mvn jetty:run, and got this: INFO - TEMP = /tmp/Jetty_0_0_0_0_8080

[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 ed

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 setting

Re: [Lift] Feedback on wizard code

2009-11-30 Thread David Pollak
On Sun, Nov 29, 2009 at 3:57 PM, Timothy Perrett wrote: > 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 hardcoded html tables; IM

Re: [Lift] method call from out of nowhere

2009-11-30 Thread David Pollak
On Mon, Nov 30, 2009 at 12:11 AM, Hannes 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 joinOtherOrders method. > # > I think I understand it now. Cause I'm creating new

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?

[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 plugi

[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 wrote: > how to setup table/column names of a record entity.(like override > dbTableName field in mapper) -- You received this

[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 wrote: > Such ashttp

[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

[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) => scala.xml.MetaData],scala.xml

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 > wrote: > >> An

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 k

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 "

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 wrote: > >> Hi Tim,> Hannes,

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 > wrote: > > Hey Lifters, > > I've some really strange things going on here.