[Lift] Re: Broken class in latest nightly snapshot?

2008-12-01 Thread Derek Chen-Becker
Darnit. I figured out the issue. My pom.xml had a tucked away and set to 2.7.1. Changing to 2.7.2 fixed it. Derek On Mon, Dec 1, 2008 at 4:58 PM, David Pollak <[EMAIL PROTECTED]>wrote: > I just pushed a change... change the line to: > > class Entry extends KeyedRecord[Entry,Long] > > and see if

[Lift] Re: Are there printable versions of any draft Lift books?

2008-12-01 Thread TylerWeir
Please keep in mind most things are in flux. Just fair warning. :) On Dec 1, 6:11 pm, mal3 <[EMAIL PROTECTED]> wrote: > Are there printable versions of any draft Lift books? > > It would help me and would provide an easy basis for feedback to the > authors if the Lift books currently in draft we

[Lift] Re: Tools

2008-12-01 Thread David Pollak
I'd suggest removing the ~/.netbeans directory (and anything that looks like it). On Mon, Dec 1, 2008 at 5:00 PM, Charles F. Munat <[EMAIL PROTECTED]> wrote: > > I thought I had updated to that, but maybe I broke it before the > update... Will install all the latest this time and will see what >

[Lift] Re: Tools

2008-12-01 Thread Charles F. Munat
I thought I had updated to that, but maybe I broke it before the update... Will install all the latest this time and will see what happens. But I had the same experience a couple of months ago when I tried it for the first time. I'd really like it to work, though. That would be great, and it w

[Lift] Re: Testing best practices

2008-12-01 Thread David Pollak
Please make sure that you've got specs 1.4.0 and scalacheck 1.5 Also, please do an mvn clean test Thanks, David On Sat, Nov 29, 2008 at 3:45 AM, Juha L <[EMAIL PROTECTED]> wrote: > > I managed after all to find specs test example from the example > webapp. Now that I try to start creating some

[Lift] Re: A javascript method bound to lift?

2008-12-01 Thread David Pollak
You certainly can. The easiest way is with the JsonFunc: val (jsonCall: JsonCall, jsCmd: JsCmd) = S.buildJsonFunc { case JsonCmd("DoSomething", _, s, _) => println("Got "+s) Alert("You entered: "+s) case _ => Noop } In your page, include: { Script(jsCmd) // emit the JSON call }

[Lift] Re: Are there printable versions of any draft Lift books?

2008-12-01 Thread Derek Chen-Becker
Each chapter is its own self-contained LyX file, so you can always generate directly from a chapter. The only thing to remember with that is that all of the formatting and cross-refs are done through the master.lyx file, so if you do single chapters they lose that. Derek On Mon, Dec 1, 2008 at 4:

[Lift] Re: Broken class in latest nightly snapshot?

2008-12-01 Thread David Pollak
I just pushed a change... change the line to: class Entry extends KeyedRecord[Entry,Long] and see if it works. On Mon, Dec 1, 2008 at 3:39 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote: > I'm writing up some sample code for the book (Record chapter) and I got > this when trying to do a keyed r

[Lift] Re: Are there printable versions of any draft Lift books?

2008-12-01 Thread Charles F. Munat
You can use Lyx to create a pdf of Tyler & Derek's book and then print that. It's a big install. I'm using it on Mac and it works very well. http://www.lyx.org/ Once you install it I think you can just double-click on the master.lyx file and then choose File > Export > ... (I use pdflatex). I

[Lift] Re: Tools

2008-12-01 Thread David Pollak
There was a defect in the plugin. Cauyuon posted a fix to this list last week. On Mon, Dec 1, 2008 at 3:07 PM, Charles F. Munat <[EMAIL PROTECTED]> wrote: > > I've tried twice to get NetBeans up and running on my MacBook Pro with 2 > gigs of RAM. Both times I made the mistake of loading in the e

[Lift] Broken class in latest nightly snapshot?

2008-12-01 Thread Derek Chen-Becker
I'm writing up some sample code for the book (Record chapter) and I got this when trying to do a keyed record: [WARNING] error: error while loading KeyedRecord, class file '/home/software/mavenrepo/net/liftweb/lift-webkit/0.10-SNAPSHOT/lift-webkit-0.10-SNAPSHOT.jar(net/liftweb/record/KeyedRecord.c

[Lift] Re: SHtml form inputs and attributes/labels

2008-12-01 Thread Charles F. Munat
I figured there was a better way to do it. I rewrote pretty much all of SHtml to allow adding attributes easily (which is why mine says FH instead of SHtml). This looks interesting. I'll check it out. Thanks, Chas. David Pollak wrote: > Charles, > > Thanks for the suggestion. > > I've just c

[Lift] Re: Inserting/deleting table rows with AJAX

2008-12-01 Thread Charles F. Munat
Will do. Thanks. Chas. David Pollak wrote: > Charles, > > I just checked in code that has a "return false" at the end of > ajaxButton. If you've pulled the Lift source from GitHub, please do a > fresh pull and an "mvn clean install" on Lift and then give it a try. > > Thanks, > > David >

[Lift] Re: Tools

2008-12-01 Thread Charles F. Munat
Cool. I hope I get time to read this really soon. Thanks! Chas. Derek Chen-Becker wrote: > I've done it in Eclipse and I'm assuming it would be similarly easy in > NetBeans. There's a good article on setting up Maven remote debugging > with Jetty here: > > http://www.mojavelinux.com/blog/arc

[Lift] Are there printable versions of any draft Lift books?

2008-12-01 Thread mal3
Are there printable versions of any draft Lift books? It would help me and would provide an easy basis for feedback to the authors if the Lift books currently in draft were made available for easy download and printing, in say PDF format. The Scala book early access process was both useful and e

[Lift] Re: Tools

2008-12-01 Thread Charles F. Munat
I've tried twice to get NetBeans up and running on my MacBook Pro with 2 gigs of RAM. Both times I made the mistake of loading in the entire liftweb library. After that -- and even after I closed the liftweb master project -- NetBeans will lock up for long periods of time (e.g. ten minutes or

[Lift] Re: Strange behavior for /index.html

2008-12-01 Thread Derek Chen-Becker
I am using 0.10-SNAPSHOT, but let me do a "clean jetty:run" and make sure it's still doing it. Thanks! Derek On Mon, Dec 1, 2008 at 3:44 PM, David Pollak <[EMAIL PROTECTED]>wrote: > Derek, > > I've made the default behavior to not pass requests to the container (you > can change the default in

[Lift] Re: Minor differences between mapper and record

2008-12-01 Thread Derek Chen-Becker
I would but I have so many other things going on right now I don't want to hold things up. I don't want to sound like I'm complaining about something and not wanting to actually deal with it but my plate is pretty full :( Derek On Mon, Dec 1, 2008 at 3:21 PM, David Pollak <[EMAIL PROTECTED]>wrote

[Lift] Re: SHtml form inputs and attributes/labels

2008-12-01 Thread TylerWeir
Gah, this is super-handy. Thanks Chas, Dave. On Dec 1, 5:41 pm, "David Pollak" <[EMAIL PROTECTED]> wrote: > Charles, > > Thanks for the suggestion. > > I've just checked up code that looks something like yours: > >   def ajaxButton(text: NodeSeq, func: () => JsCmd, attrs: (String, > String)*): E

[Lift] Re: Strange behavior for /index.html

2008-12-01 Thread David Pollak
Derek, I've made the default behavior to not pass requests to the container (you can change the default in LiftRules.) That will address the "raw" template being displayed. Now... I have no idea why you need an "index" and a "" List("index") always matches for me. Are you using 0.10-SNAPSHOT?

[Lift] Re: Compile problems with lift

2008-12-01 Thread Jorge Ortiz
It might be the type checker getting confused. Try: val models: List[MetaMapper] = List(User, Game, GameUser, Hull, Ship, StarSystem) You can also call schemify with: Schemifier.schemify(true, Log.infoF _, models :_*) Instead of the foreach stuff --j On Mon, Dec 1, 2008 at 3:44 PM, Juha

[Lift] Re: Compile problems with lift

2008-12-01 Thread David Pollak
The exception is an out of memory exception. What OS and RAM size are you running? On Mon, Dec 1, 2008 at 1:44 PM, Juha L <[EMAIL PROTECTED]> wrote: > > I'm not sure whether it is just me, but I seem to be stumbling on the > Scala compiler exceptions whatever I do. First there was one when > cre

[Lift] Re: SHtml form inputs and attributes/labels

2008-12-01 Thread David Pollak
Charles, Thanks for the suggestion. I've just checked up code that looks something like yours: def ajaxButton(text: NodeSeq, func: () => JsCmd, attrs: (String, String)*): Elem = attrs.foldLeft({text})(_ % _) All the various form element creation methods take an attrs vararg. Also, note t

[Lift] Re: Inserting/deleting table rows with AJAX

2008-12-01 Thread David Pollak
Charles, I just checked in code that has a "return false" at the end of ajaxButton. If you've pulled the Lift source from GitHub, please do a fresh pull and an "mvn clean install" on Lift and then give it a try. Thanks, David On Mon, Dec 1, 2008 at 2:18 PM, Charles F. Munat <[EMAIL PROTECTED]>

[Lift] Compile problems with lift

2008-12-01 Thread Juha L
I'm not sure whether it is just me, but I seem to be stumbling on the Scala compiler exceptions whatever I do. First there was one when creating specs that I mailed earlier, and now I get compile problems when I changed Boot-class. I have changed Boot-class as follows. Idea is to allow different

[Lift] Re: Minor differences between mapper and record

2008-12-01 Thread David Pollak
On Mon, Dec 1, 2008 at 1:44 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote: > Hi, > I'm writing the chapter on Mapper/Record right now and I was wondering > why there have been small name changes between the two frameworks. Things > like > >1. MappedField.validations vs. Field.validators >

[Lift] Re: Inserting/deleting table rows with AJAX

2008-12-01 Thread Charles F. Munat
Hmm. Crap. Damn that IE. Well, I have something working in Firefox on Mac for the button. It's probably more complicated than it needs to be... def ajaxRemove(name: String, func: AFuncHolder, attrs: Tuple2[String, String]*): Elem = { val funcName = mapFunc(func) () %

[Lift] Re: Tools

2008-12-01 Thread Derek Chen-Becker
I've done it in Eclipse and I'm assuming it would be similarly easy in NetBeans. There's a good article on setting up Maven remote debugging with Jetty here: http://www.mojavelinux.com/blog/archives/2007/03/remote_debugging_with_jetty/ Derek On Mon, Dec 1, 2008 at 2:43 PM, David Pollak <[EMAIL P

[Lift] Minor differences between mapper and record

2008-12-01 Thread Derek Chen-Becker
Hi, I'm writing the chapter on Mapper/Record right now and I was wondering why there have been small name changes between the two frameworks. Things like 1. MappedField.validations vs. Field.validators 2. MappedField.asHtml vs. Field.asXHtml (and Field.toXHtml, which seems redundant)

[Lift] Re: Tools

2008-12-01 Thread David Pollak
Charles, I use NetBeans and a whole lot of printlns. In general, if you've got a case class or Scala collections, the toString methods are pretty descriptive of what's going on. I have heard tell that it's possible to hook the NetBeans debugger up to a running Jetty instance and do breakpoints i

[Lift] Re: Joins in Lift mapper

2008-12-01 Thread David Pollak
On Thu, Oct 9, 2008 at 9:46 AM, Charles F. Munat <[EMAIL PROTECTED]> wrote: > > Is it possible to do joins in Lift Mapper? > > For example, I have a Category class that has a name and position (an > int). I have a Document class that has a name, a URI, and a Category. > > I want to query the datab

[Lift] Re: Inserting/deleting table rows with AJAX

2008-12-01 Thread David Pollak
Charles, If you're planning to deploy this app in IE, you may have an issue. My experience with IE is that adding/removing doesn't always work well. :-( What is most likely happening is that your button is inside a form. It turns out that there's a race condition where sometimes the XmlHttpReq

[Lift] Inserting/deleting table rows with AJAX

2008-12-01 Thread Charles F. Munat
I have a table in which each row represents an object in the database, with each cell in the row an input bound to an attribute of the object. I want to be able to add rows (with new, blank objects) and delete rows (deleting both the row on the page and the associated object in the database).

[Lift] Re: new to lift ... horizontal scaling of databases?

2008-12-01 Thread David Pollak
On Sun, Nov 30, 2008 at 6:07 PM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > > Hi ... new to Scala and Lift. I'm having trouble understanding how to > think about a project with a horizontally scaled database. I guess > people call this "sharding" these days? My existing app uses PHP, no

[Lift] Re: JPA find or create new

2008-12-01 Thread Charles F. Munat
Thanks. Types are still largely a mystery to me, but this works just fine. Chas. Derek Chen-Becker wrote: > Because it's type erasure I don't think I can do a generic "new" inside > the methods, but the findOne method does return a Can. That means that > you were actually pretty close in your

[Lift] Re: Bug in Chat example?

2008-12-01 Thread Paul Butcher
I hate to "nag", but does anyone have any idea what's up with the bug in the chat example I e-mailed about a while ago? I've been playing around with the ask/answer functionality in the interim, and (although it's quite possible that I'm missing something) I can't get it to work at all. The first

[Lift] Re: Bug in Chat example?

2008-12-01 Thread David Pollak
On Mon, Dec 1, 2008 at 10:43 AM, Paul Butcher <[EMAIL PROTECTED]> wrote: > > I hate to "nag", but does anyone have any idea what's up with the bug > in the chat example I e-mailed about a while ago? I fixed it yesterday. The code is in GitHub and I believe the latest JAR files are up on Scala-t

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Shawn O'Connor
On Sun, Nov 30, 2008 at 6:27 AM, Derek Chen-Becker <[EMAIL PROTECTED]> wrote: > If you're heavily skewed towards reads and not writes (as it seems in the > case of a CMS), you might want to look at Celko nested sets: > > http://www.intelligententerprise.com/001020/celko.jhtml > http://dev.mysql.co

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Charles F. Munat
When I use a nested set, I make it like a combination of nested set and a simple tree. So in my database, I have: idparent_idlftrgtname -- 1 NULL 1 20Electronics 21 2 9Televisions 3

[Lift] new to lift ... horizontal scaling of databases?

2008-12-01 Thread baconeater...@gmail.com
Hi ... new to Scala and Lift. I'm having trouble understanding how to think about a project with a horizontally scaled database. I guess people call this "sharding" these days? My existing app uses PHP, no framework, and no O-R mapping. It's all PHP/MySQL with SQL statements. Some O-R mapper

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Tim Perrett
> I'd do something different... I'd replicate the Lift tag mechanism, but with > your own tags... then you can control which tags get executed. > > Further, you can enhance the Textile parser to recognize custom tags such > that you can allow users to enter a combination of Textile and your > ma

[Lift] Re: JPA and Record

2008-12-01 Thread Marius
On Dec 1, 8:22 pm, "David Pollak" <[EMAIL PROTECTED]> wrote: > My 2 cents: > >    - I'm strongly opposed to any compiler plugins as they (1) mean that IDEs >    will work less well and (2) they require some sort of installation (if they >    can be rolled into the Maven building stuff, it makes

[Lift] Re: JPA and Record

2008-12-01 Thread Josh Suereth
- I'm pretty close to having a releasable version of the maven-scala-plugin that supports compiler plugins. - Adding integration between the maven-pom and eclipse is going to take some time (but is "possible"). I'm not sure about the netbeans/IntelliJ tools, but this could be an awkward integratio

[Lift] Re: A quick question

2008-12-01 Thread David Pollak
Marius, Back when I wrote the mapper stuff, there were a bunch of limitations of using vals: - Because of uniform access rules, the difference between val foo = new Thing ; def bar = foo was not possible to calculate. It looks like the compiler now stores things in a named field, so loo

[Lift] Re: Alter presentation behavior with snippet markup

2008-12-01 Thread David Pollak
On Mon, Dec 1, 2008 at 10:24 AM, Alex Boisvert <[EMAIL PROTECTED]> wrote: > Isn't this similar to Option.mapOrElse that you opposed on the scala > mailing list? :) In fact it is. :-) Polluting Scala is bad. Polluting Lift is less bad. > > > alex > > > On Mon, Dec 1, 2008 at 9:55 AM, David Po

[Lift] Re: SQL queries

2008-12-01 Thread David Pollak
On Wed, Nov 26, 2008 at 5:55 PM, Joachim A. <[EMAIL PROTECTED]>wrote: > > Hi, > after profiling my lift application (which uses the mapper classes) I > found out that most of the time is spend doing SQL queries. Displaying > medium-sized tabular data executes hundreds of (mostly small) queries. >

[Lift] Re: Alter presentation behavior with snippet markup

2008-12-01 Thread Alex Boisvert
Isn't this similar to Option.mapOrElse that you opposed on the scala mailing list? :) alex On Mon, Dec 1, 2008 at 9:55 AM, David Pollak <[EMAIL PROTECTED]>wrote: > I've added def dmap[B](dflt: => B)(f: A => B): B to Cans: > > S.param("foo").dmap(5)(toInt) > > > On Fri, Nov 28, 2008 at 6:53 AM,

[Lift] Re: JPA and Record

2008-12-01 Thread David Pollak
My 2 cents: - I'm strongly opposed to any compiler plugins as they (1) mean that IDEs will work less well and (2) they require some sort of installation (if they can be rolled into the Maven building stuff, it makes this objection go away) - I'm strongly opposed to mixing annotation

[Lift] Re: Lift and eclipse hotdeploy

2008-12-01 Thread David Pollak
On Fri, Nov 28, 2008 at 4:39 AM, Acciaio <[EMAIL PROTECTED]> wrote: > > Thanx for the advice, > Now I'm writing code into eclipse with a project setted up "without > source files to compile" > > and after I run jetty I also run a scala:cc on the same project... > > Don't works perfectly but in thi

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread David Pollak
On Mon, Dec 1, 2008 at 9:57 AM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > Hey David, > > Thanks for the response - I have been reflecting on the whole L2 cache > thing today and kind of came to the same conclusion. If the content > has been served, it might as well be cached in its entirety as a

[Lift] Re: Alter presentation behavior with snippet markup

2008-12-01 Thread David Pollak
I've added def dmap[B](dflt: => B)(f: A => B): B to Cans: S.param("foo").dmap(5)(toInt) On Fri, Nov 28, 2008 at 6:53 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote: > I have to say, I love this "Can->map->openOr" idiom. I use it all of the > time in my code for parameter handling, etc. > > Derek

[Lift] Re: Named Partial Functions

2008-12-01 Thread David Pollak
On Wed, Nov 26, 2008 at 2:44 PM, Alex Boisvert <[EMAIL PROTECTED]> wrote: > "... extends PartialFunction with Named" ? I was looking to name the companion object. It's called NamedPF > > > alex > > > On Wed, Nov 26, 2008 at 2:08 PM, TylerWeir <[EMAIL PROTECTED]> wrote: > >> >> DebugPartialFun

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Tim Perrett
Hey David, Thanks for the response - I have been reflecting on the whole L2 cache thing today and kind of came to the same conclusion. If the content has been served, it might as well be cached in its entirety as a HTML file so it can then be served by the front end web-server (nginx, apache etc)

[Lift] Re: Two items on Record

2008-12-01 Thread David Pollak
On Wed, Nov 26, 2008 at 11:19 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote: > Still getting the type error using an explicit List(...): > > [WARNING] > /home/software/liftbook-demos/demo-record/src/main/scala/com/theliftbook/model/Entry.scala:50: > error: type mismatch; > [WARNING] found : >

[Lift] Re: Testing for well-formed XML

2008-12-01 Thread David Pollak
On Sun, Nov 30, 2008 at 3:46 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote: > OK, I have a maven-lift plugin done with an i18ngen target that you can > use to parse all of your Scala and xhtml sources for i18n keys (lift:loc, > etc). The question now is, where should I put it? Should I put it in

[Lift] Re: JPA find or create new

2008-12-01 Thread David Pollak
If you wrap your JPA stuff in a trait like: trait Builder[T] { def create: T } Thus, you've got a type-safe create method... you'd use it like: object UserSingleton extends Builder[User] { def create = new User def user: User = Model.createNamedQuery[User]().findOne openOr create } O

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread David Pollak
Tim, Please remember that Lift's Snippet processing is recursive. Thus, you don't really need to hook into the templating system in order to be able to using Lift's templates. For example, if your snippet returned: Lift would then interpret the two comet tags and you'd wind up with two comet

[Lift] Re: Testing for well-formed XML

2008-12-01 Thread Derek Chen-Becker
For now the plugin lives here: http://github.com/dchenbecker/maven-lift/tree/master I'm going to talk to David B. about hosting the plugin on scala-tools, but for now you can check it out and do a "mvn install" on the source. Then add net.liftweb.tools maven-lift T

[Lift] Re: JPA find or create new

2008-12-01 Thread Derek Chen-Becker
Because it's type erasure I don't think I can do a generic "new" inside the methods, but the findOne method does return a Can. That means that you were actually pretty close in your demo code. Here's what it could look like: val user: User = Model.createNamedQuery[User]( "findUserByUsername"

[Lift] Re: a plea for documentation

2008-12-01 Thread Derek Chen-Becker
http://github.com/tjweir/liftbook/tree/master See earlier posts for details. Derek On Sun, Nov 30, 2008 at 7:33 PM, Oscar Picasso <[EMAIL PROTECTED]>wrote: > Which book are you talking about? > > I didn't know that they were already chapters of a lift book we could > read. > > On Wed, Nov 26,

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Tim Perrett
Im not sure I follow? Can you use this diagram to try and explain?: http://dev.mysql.com/tech-resources/articles/hierarchical-data-4.png If you wanted to select the direct children of 'electronics', how would one go about doing that? Is there a simpler way than all that HQL? Cheers Tim On Dec

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Charles F. Munat
Are you including a link to the parent node or are you just using the left and right values to figure out which nodes are children? I always include a foreign key to the parent so I can just select the children of that parent directly. Then to get all descendants, I use the left and right valu

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Tim Perrett
On Dec 1, 9:21 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote: > Will do, if I figure it out. But my comment wasn't complaining. I am > honestly mystified. Am I the only one using trees in Hibernate? Is there > a tree library in Scala that I'm missing? What the heck does everyone > else do? It

[Lift] Re: JPA find or create new

2008-12-01 Thread Charles F. Munat
That will probably work. I was thinking it would be nice to build in a method findOrNew that would do it for me... but it looks like that might involve some sort of implicit manifest thingy, so I don't know. Chas. Viktor Klang wrote: > > > On Mon, Dec 1, 2008 at 7:12 AM, Charles F. Munat <[E

[Lift] Re: Using TemplatePf for JPA powered templates

2008-12-01 Thread Charles F. Munat
Will do, if I figure it out. But my comment wasn't complaining. I am honestly mystified. Am I the only one using trees in Hibernate? Is there a tree library in Scala that I'm missing? What the heck does everyone else do? It just blows my mind. Chas. Viktor Klang wrote: > > > On Mon, Dec 1,