[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Peter Robinett
Ahh, thanks Josh. It turns out I had a third version of Maven at / Applications/liftweb-1.0/apache-maven, in addition to /user/share/java/ apache-maven-2.0.9 and the 2.2.1 version I downloaded. Removing it from my PATH got me using the 2.2.1 version. Who's responsible for the OS X Lift installer?

[Lift] mvn war has no love for yui compressor

2009-09-13 Thread jon
Hi, I have my js and css in my webapp directory and for a long time I had been blissfully assuming that everything was nicely minified in my deployed wars. So, I was very shocked to notice that although yui compressor appears to be doing its magic during the compile stage, its output is overwritt

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Joni Freeman
Using back ticks could work, I'll have to check that out. Another approach is to use map function, it works but there's a small performance and verbosity hit. import net.liftweb.json.JsonParser.parse import net.liftweb.json.JsonAST.JField implicit val formats = net.liftweb.json.DefaultFormats c

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Naftoli Gugenheim
Can't you require back ticks and name the case class members the same as in the JSON? Also if it comes to traits you may as well just allow an adapter that can read and write values -- maybe a map of String to setter/getter functions. - Joni Freeman wrote:

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Joni Freeman
Hi, Here's another example. {"lotto": { "id": 5, "winning-numbers": [2,45,34,23,7,5,3], "draw-date": "2009-09-14T18:00:00Z", "winners": [ {"winner-id": 23, "numbers": [2,45,34,23,3,5] }, {"winner-id": 54, "numbers":[52,3,12,11,18,22] } ] } } At the moment I'm

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Naftoli Gugenheim
Is there a list of rules for committers to stick to? Especially considering the review board system being put into place. - Joni Freeman wrote: Extending ClassfileAnnotation does not work at the moment. Excerpt from "Programming Scala" (http://programming-sc

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Joni Freeman
Extending ClassfileAnnotation does not work at the moment. Excerpt from "Programming Scala" (http://programming-scala.labs.oreilly.com/ ch13.html"): "Another child of scala.Annotation that is intended to be a parent of other annotations is the trait scala.ClassfileAnnotation. It is supposed to be

[Lift] Using Ajax to send text to browser as it is generated.

2009-09-13 Thread jack
I have some code that generates a list of urls but it takes awhile to generate all of them. I would like to send them to the browser as they are generated. How do I use Ajax to accomplish this. I can put the urls in a List as they are generated if that works. But how do I hook up the List to the

[Lift] Ajax example from the book

2009-09-13 Thread jack
Could somebody please explain to me how this example from the book works. def myFunc(html:NodeSeq):NodeSeq = { bind("hello",html,"button" -> ajaxButton(Text("Press me"), { () => println("Got an Ajax call.") SetHtml(

[Lift] Re: Lift deal breakers

2009-09-13 Thread Charles F. Munat
This is pretty close to what I'm doing. I have a REST backend (in Lift) that serves the data, and a separate Ext JS front end (one single page with a lot of Ext JS) running in a separate Lift app. It's still in progress and I haven't worked out all the details yet, but I'm very happy with it s

[Lift] Re: Lift deal breakers

2009-09-13 Thread Charles F. Munat
Well, conciseness is always good. I haven't looked at (and don't have time to look at) the code that inserts this stuff, so I'll take your word for it that it's a big undertaking. Lord knows, I don't have time, so I'm certainly not complaining. But we've got a desideratum, anyway. Maybe down t

[Lift] Re: Lift deal breakers

2009-09-13 Thread marius d.
On Sep 13, 8:00 pm, "Charles F. Munat" wrote: > marius d. wrote: > > I'm thinking that instead of: > > > Press me > button> > > > We could have: > > > Press me > > This is not what I had in mind at all. You still have the event handler > in the HTML. The idea, I thought, was to attach the event

[Lift] Re: Lift deal breakers

2009-09-13 Thread Xavi Ramirez
Hi Marius, Ahh yes I see. That's very different from what I originally understood. Your implementation makes sense. Thanks, Xavi On Sun, Sep 13, 2009 at 8:43 PM, marius d. wrote: > > I kinda used the term js file a bit too loosely. It is true that each > page would likely have different func

[Lift] Re: Lift deal breakers

2009-09-13 Thread Josh Suereth
This is how we do JavaScript/ExtJS development at my work place, except with a twist. We actually have a javascript-only project for a our javascript "library". We use the maven-javascript-tools plugins to create a javascript project that relies on others (in our case, things like Simile Timeline

[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Josh Suereth
Check your PATH variable, probably pointing to the wrong maven still. You really need to get off of maven 2.0.9. The offlline mode is broken. 2.0.10 should be the minimum version you need to fix that issue. On Sun, Sep 13, 2009 at 8:33 PM, Peter Robinett wrote: > > Thanks, Kevin. Dropping in

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Josh Suereth
Scala does support annotations, they're just anemic at this point. I hadn't tried, but does extending ClassfileAnnotation allow runtime visibility? That would give you a pure scala implementation. If not, I think we need to rally for StaticAnnotation/ClassfileAnnotation to be joined by their fut

[Lift] Re: Lift deal breakers

2009-09-13 Thread Charles F. Munat
marius d. wrote: > I'm thinking that instead of: > > Press me button> > > We could have: > > Press me This is not what I had in mind at all. You still have the event handler in the HTML. The idea, I thought, was to attach the event handler from an external file using the id (or class) of the

[Lift] Re: Lift deal breakers

2009-09-13 Thread Naftoli Gugenheim
Is the DOM approach ruled out? I.e., generate a short script tag that is generated from the events needed to be listened for, which are delegated to a javascript generator that depends on the library. The actual JS files would be static. Maybe I missed where this option was eliminated? Also, wh

[Lift] Re: Lift deal breakers

2009-09-13 Thread Charles F. Munat
I'm afraid I have to disagree. As a website developer, I've been putting all my JS into an external file (per page when necessary) for many years without any problems. Every good JS programmer I know does the same. It is considered *more* not less robust to put the JS in an external file and a

[Lift] Re: Lift deal breakers

2009-09-13 Thread marius d.
I kinda used the term js file a bit too loosely. It is true that each page would likely have different functions there and even the same page on subsequent load would have different content so the file can not really be cached. I'm thinking that instead of: Press me We could have: Press me ..

[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Peter Robinett
Thanks, Kevin. Dropping in the latest version didn't seem to work (mvn --version kept saying I still had 2.0.9) but switching to 1.1-M5 did. Peter On Sep 13, 4:00 pm, Kevin Wright wrote: > Maven is essentially a java application, so you *should* just be able to > download and run.  I'm afraid I

[Lift] Re: Lift deal breakers

2009-09-13 Thread Naftoli Gugenheim
You mean cached by the browser? Isn't that a matter of setting headers, since it won't change in the session--or will it? Can one app switch dynamically from JQuery to YUI? - Xavi Ramirez wrote: If I understand everything correctly, the proposal is to dynam

[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Naftoli Gugenheim
You could probably just overwrite where ever the lift installer installed maven to. Or maybe run a newer lift installer? On Sun, Sep 13, 2009 at 7:00 PM, Kevin Wright wrote: > Maven is essentially a java application, so you *should* just be able to > download and run.  I'm afraid I can't really g

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Naftoli Gugenheim
Okay, here's what I mean. Using chooseTemplate: View: ...    M: Last: First: ... Snippet: bind("person", xhtml, "code" -> person.code.is, "info" -> ( if(!detailedView) bind("person", chooseTemplate(xhtml, "personinfo", "concise"), ...) // did I get the

[Lift] Re: Lift deal breakers

2009-09-13 Thread Xavi Ramirez
If I understand everything correctly, the proposal is to dynamically create a js file for each page request to add event handlers? If this is true, then I'm against the proposal for the following two reasons: 1. Every page will load slower Since the js file is dynamically create on each request

[Lift] Re: Lift deal breakers

2009-09-13 Thread Charles F. Munat
+1 I would much prefer it if all JS were in external files (synthetic as necessary) and simply attached to the DOM via ids or classes. I have been building my sites this way for years, and I find it the best practice for reasons already put forth in this discussion. Chas. Timothy Perrett wro

[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Kevin Wright
Maven is essentially a java application, so you *should* just be able to download and run. I'm afraid I can't really give better advice for OS-X though. One other idea is to work with 1.1-M5, which should let you go offline on the older maven version - assuming you have no other snapshot dependenc

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread marius d.
On Sep 13, 3:15 pm, Joni Freeman wrote: > Hi, > > That annotation is used to configure the json path when extracting > values. By default the extraction code assumes that case class > parameter names match with json field names. For instance these match: > > case class Foo(bar: String, baz: Int

[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Peter Robinett
Thanks. I have version 2.0.9, which was installed by the Lift OS X installer. What is the best way to upgrade to 2.2.1? Peter On Sep 13, 12:57 pm, Kevin Wright wrote: > Try updating to the latest maven, older versions have known issues with > offline behaviour for snapshots. > > On Sun, Sep 13,

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Naftoli Gugenheim
By the way, I would be curious to see a link to a post where a newbie was confused by multiple ways to do something -- not curious about the difference, but having a harder time with even one than if there hadn't been the alternative. I'm not doubting what you said--just curious to see such a p

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Naftoli Gugenheim
Well, you could do it with bind too, or just write your own xml recursion. :) With chooseTemplate, you (1) need to have a specific location in the xml that you're "bind"ing the results of chooseTemplate to, i.e., the BindParam that holds the chosen part of the view. (2) The part of the view sele

[Lift] Re: Lift deal breakers

2009-09-13 Thread marius d.
I think so too. Does anyone have an opinion against this? I'll probably have some time this week or next weekend to work on it. Br's, Marius On Sep 13, 2:59 pm, Timothy Perrett wrote: > A synthetic file sounds good to me and would probably be preferable. > > Cheers, Tim > > On 13 Sep 2009, at 2

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Timothy Perrett
It just seems to me that you can already do what you detailed using chooseTemplate? My concern about having multiple ways to do a single task IMHO makes it more confusing for n00bs... Much better if there is a clear problem:solution relationship :-) we already have chooseTemplate right? A

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Naftoli Gugenheim
What do you mean mixed messages? Do you object to committing bindSwitch--after all it's much more general and basic than wizards--or that it's what Josh should use? Also, I read that DPP said it would take him 2-3 days once he found 2-3 days free to apply himself to lift-wizard. Did I miss a mes

[Lift] Re: Why isn't this a trait in lift-json?

2009-09-13 Thread Joni Freeman
Hi, That annotation is used to configure the json path when extracting values. By default the extraction code assumes that case class parameter names match with json field names. For instance these match: case class Foo(bar: String, baz: Int) { "bar": "qwerty", "baz": 10 } But sometimes json fi

[Lift] Why isn't this a trait in lift-json?

2009-09-13 Thread Timothy Perrett
Just had a browse over the latest commit and found the following in path.java: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface path { public String value(); } Any reason were not using a trait etc to complete the same functionality? Cheers, Tim --~--~

[Lift] Re: Lift deal breakers

2009-09-13 Thread Timothy Perrett
A synthetic file sounds good to me and would probably be preferable. Cheers, Tim On 13 Sep 2009, at 20:31, marius d. wrote: > That looks a little cleaner but we'll have to look more into it if > we'd want to go on this path. Perhaps accumulate those function into > synthetic js file .. we'll se

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Timothy Perrett
Naftoli, Whilst I commend your idea of bindSwitch, im really not sure that is the right way forward and would only confuse people (we dont want mixed messages). DPP will in two days or less have the wizard in a workable state so i would recommend doing just hanging out until that is compl

[Lift] Re: Getting Maven Offline Mode Working

2009-09-13 Thread Kevin Wright
Try updating to the latest maven, older versions have known issues with offline behaviour for snapshots. On Sun, Sep 13, 2009 at 8:55 PM, Peter Robinett wrote: > > Hi all, > > I'm having problems running mvn -o jetty:run with my version of Lift > (1.1-SNAPSHOT) because Maven thinks that net.lift

[Lift] Getting Maven Offline Mode Working

2009-09-13 Thread Peter Robinett
Hi all, I'm having problems running mvn -o jetty:run with my version of Lift (1.1-SNAPSHOT) because Maven thinks that net.liftweb:lift-core:jar:1.1- SNAPSHOT is missing. How do I fix that? My pom.xml is here: http://gist.github.com/186293 I've got an international plane flight in 24 hours, so I'

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Naftoli Gugenheim
I will try, G-d willing, to commit code today that allows you to "bindSwitch" -- that is, you give it a list of nodes, one of which is bound; and the others are replaced with NodeSeq.Empty. I used it in a view that had several parts that depend on the state. E.g., if you have not selected a cli

[Lift] Re: Lift deal breakers

2009-09-13 Thread marius d.
On Sep 13, 11:33 am, valotas wrote: > I also think that javascript should go just before the boby's closing > tag. The main reason: Yahoo's YSlow and Google's Page speed both > telling you that is better to have as less scripts as possible and all > of them placed at the end of the page. The op

[Lift] Re: using jquery 1.3.2 and 'tabs'

2009-09-13 Thread Indrajit Raychaudhuri
David, 1. Lift includes jquery-1.3.2, just do: and your done. 2. For the other stuff: a. Put the files in src/main/resources/toserve/ui (e.g., src/main/ resources/toserve/ui/ui.tabs.js) b. Add them to ResourceServer.allowedPaths by adding this to Boot: ResourceServer.allow { case "

[Lift] Best way to write a wizard

2009-09-13 Thread Josh Suereth
All, I write to you (unfortunately still) as a lift n00b. I'm trying to modify a form such that it looks more "wizard" like. i.e. I want it to specifically state "You've completed part 1, you're on step 2 of 5", etc. How should I accomplish this in view-first rendering? Normal MVC, I'd make o

[Lift] Re: Lift deal breakers

2009-09-13 Thread valotas
I also think that javascript should go just before the boby's closing tag. The main reason: Yahoo's YSlow and Google's Page speed both telling you that is better to have as less scripts as possible and all of them placed at the end of the page. The optimal would be one javascript at the end of the

[Lift] Re: lift-json

2009-09-13 Thread Lincoln
Got it. Thanks for the info. I was afraid I was doing something wrong. Thanks, Lincoln On Sun, Sep 13, 2009 at 9:48 AM, Joni Freeman wrote: > > Hi, > > Your example should work if you take the val away from your case > class: > > case class MyName(first:String, last:String) > case class MyUser(

[Lift] Re: lift-json

2009-09-13 Thread Joni Freeman
Hi, Your example should work if you take the val away from your case class: case class MyName(first:String, last:String) case class MyUser(id:String, name:MyName, url:String) The reflection code currently fails to find the primary constructor of case class if there's extra fields. This will hop

[Lift] Re: how to send an attachment using Mailer?

2009-09-13 Thread george
update: ok, so it turns out that you can send pdfs as inline attachments using XHTMLPlusImages. (the byte array being empty was my fault). however, it would still be good to be able to add arbitrary attachments. a pdf isn't really an image. --~--~-~--~~~---~--~~

[Lift] how to send an attachment using Mailer?

2009-09-13 Thread george
hello all I need to send a pdf attachment with my xhtml mail body. At first I thought I might be able to treat it as an inline image (byte array). But this doesn't seem to work (the pdf file has 0 bytes when received). Then I thought I could make my own MailBodyType and include it that way, but

[Lift] Re: how / where to set the runmode of a lift application?

2009-09-13 Thread Indrajit Raychaudhuri
If you are modifying web.xml, doing it via and having it available via JNDI (java:comp/env) [1] seems closest. However, I am not sure that would be available via System.getProperty (). Alternately, try jetty.xml (or jetty-env.xml, if possible) [2][3] to do something like: run.mode productio

[Lift] lift-json

2009-09-13 Thread linxbetter
Hello, I saw a post about lift-json on the scala-user list so I decided to check it out. I was particularly interested in the ability to call something along the lines of json.extract[MyClass]. I set up a little test case for this though, and apparently having a val of any sort in my case class

[Lift] Re: lift-json

2009-09-13 Thread Lincoln
Sorry, here's the full code I'm using: case class MyName(first:String, last:String) case class MyUser(id:String, name:MyName, url:String) { val wtf = "wtf" } implicit val formats = net.liftweb.json.DefaultFormats val json = ("id" -> me.id) ~ ("name" -> ("first" -> me.name.first) ~ ("last" -> me

[Lift] using jquery 1.3.2 and 'tabs'

2009-09-13 Thread David
I'd like to use the latest jquery, 1.3.2. I'm new to both jquery and lift but I like what I see!