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

2009-09-13 Thread george
Thanks Xavi I believe you can also modify web.xml in some way, but I'm not really sure. that would be useful as I don't have the ability to set properties on the production environment. I wonder if anyone else can confirm? --~--~-~--~~~---~--~~ You received

[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! script type=text/javascript src=../js/jquery-1.3.2.js/ script script type=text/javascript src=../js/ui/ui.core.js/script script type=text/javascript src=../js/ui/ui.tabs.js/script

[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.name.last) )

[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: 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 env-entry/ 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: Call

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

[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] 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 freeman.j...@gmail.comwrote: Hi, Your example should work if you take the val away from your case class: case class MyName(first:String, last:String)

[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

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

[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: script id=jquery src=/classpath/jquery.js type=text/ javascript/script 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

[Lift] Re: Lift deal breakers

2009-09-13 Thread marius d.
On Sep 13, 11:33 am, valotas valo...@gmail.com 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

[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

[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 pe...@bubblefoundry.comwrote: Hi all, I'm having problems running mvn -o jetty:run with my version of Lift (1.1-SNAPSHOT) because Maven

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

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

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

[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 timo...@getintheloop.eu wrote: A synthetic file sounds good to me and would probably be preferable. Cheers, Tim

[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 binding the results of chooseTemplate to, i.e., the BindParam that holds the chosen part of the view. (2) The part of the view

[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 freeman.j...@gmail.com 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:

[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

[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

[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

[Lift] Re: Best way to write a wizard

2009-09-13 Thread Naftoli Gugenheim
Okay, here's what I mean. Using chooseTemplate: View: ... person:code / person:info   personinfo:concise person:fullname / bM:/b person:mobile /br / /personinfo:concise personinfo:detailed Last: person:last /br / First: person:first /br / ... /personinfo:detailed

[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 Wrightkev.lee.wri...@googlemail.com wrote: Maven is essentially a java application, so you *should* just be able to download and run.  

[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 Ramirezxavi@gmail.com wrote: If I understand everything correctly, the

[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 kev.lee.wri...@googlemail.com wrote: Maven is essentially a java application, so you *should* just be able to

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

[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

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

[Lift] Re: Lift deal breakers

2009-09-13 Thread Charles F. Munat
marius d. wrote: I'm thinking that instead of: button onclick=liftAjax.lift_ajaxHandler ('F1029758482780OTA=true',null, null, null); return false;Press me/ button We could have: button onclick=liftAjax('F1029758482780OTA')Press me/button This is not what I had in mind at all. You

[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

[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 pe...@bubblefoundry.comwrote:

[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: 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. marius.dan...@gmail.com wrote: I kinda used the term js file a bit too loosely. It is true that each page would

[Lift] Re: Lift deal breakers

2009-09-13 Thread marius d.
On Sep 13, 8:00 pm, Charles F. Munat c...@munat.com wrote: marius d. wrote: I'm thinking that instead of: button onclick=liftAjax.lift_ajaxHandler ('F1029758482780OTA=true',null, null, null); return false;Press me/ button We could have: button

[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

[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

[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(my-div,

[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] 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] 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 Freemanfreeman.j...@gmail.com wrote: Extending ClassfileAnnotation does not work at the moment. Excerpt from Programming Scala

[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 extracting this

[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

[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

[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

[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