[Lift] how to override superUser.dbDisplay_? = false

2010-03-01 Thread wm
superUser is defined in ProtoUser.

class User extends ProtoUser[User] {
  // I cannot make it work
  //override def superUser = override def dbDisplay_? = false
}

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] what's the equivalent of php's var $_FILES in lift?

2010-03-01 Thread wm
http://php.net/manual/en/reserved.variables.files.php

i.e. the array of items uploaded to the current script via the HTTP
POST method.

I know there is FileParamHolder, but I want to get multiple files in
the array.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] newbie question : get lift to actually run (AbstractMethodError)

2010-03-01 Thread Naftoli Gugenheim
I think that AbstractMethodError always means either mismatched scala version 
or out of date class file.

-
Jeppe Nejsum Madsen wrote:

On Mon, Mar 1, 2010 at 3:39 PM, ojonam  wrote:
> Hello all,
>
> I am trying to launch a lift web app on my computer, but trying to use
> Snapshot 2.0 instead of 1.0 (which seems to have some problems with
> Scala 2.7.7).
>
> I have taken the following steps :
>
> - tried to create a lift blank app with 2.0-snapshot, adapting the
> archetype:generate command from the book as required

Try to show the complete command. Or look in the ML for commands that
work with 2.0-SNAPSHOT

> - once that is done, I modify the version of scala in my pom.xml
> - then I type 'mvn jetty:run'

> - somehow maven still downloads *both* the 2.7.1 and 2.7.7 versions of
> scala, and I get the warning that both of them exist

This sounds bad

> when trying to look at the webpage on localhost:8080, I am given the
> following error :
>
>  Request for / failed net.liftweb.http.SessionMaster$.mailbox_
> $eq(Lscala/actors/MessageQueue;)V
> java.lang.AbstractMethodError: net.liftweb.http.SessionMaster$.mailbox_
> $eq(Lscala/actors/MessageQueue;)V
>        at scala.actors.Actor$class.$init$(Actor.scala:370)
>        at net.liftweb.http.SessionMaster$.(LiftSession.scala:47)
>        at net.liftweb.http.SessionMaster$.(LiftSession.scala)
>        at net.liftweb.http.LiftSession.setSession(LiftSession.scala:138)
>        at net.liftweb.http.LiftSession$.createSession(LiftSession.scala:34)
>        at net.liftweb.http.LiftSession$$anonfun$1.apply(LiftSession.scala:
> 36)
>        at net.liftweb.http.LiftSession$$anonfun$1.apply(LiftSession.scala:
> 36)
>        at net.liftweb.http.LiftSession$.apply(LiftSession.scala:39)
>
>
> I have not posted the whole stacktrace, but will do so if necessary.
> Googling for this error gives me messages that are very old, and they
> don't apply to me.

You may have old code laying around. If code mysteriously fails, "mvn
clean" is your friend. Try; mvn clean jetty:run

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] reload application.properties

2010-03-01 Thread Naftoli Gugenheim
Is a dynamic menu not advantageous for production apps (e.g., a CMS)?
Would changing setSiteMap (if that's what it's called) to take a call by name 
be a bad idea?

-
David Pollak wrote:

On Mon, Mar 1, 2010 at 12:30 PM, Jeppe Nejsum Madsen wrote:

> David Pollak  writes:
>
> > The Props.get stuff is frozen the first time its accessed.  This is a
> > philosophical issue for me.  The properties should be fixed at start-up
> > time.  If there are things to vary, build an administrative interface or
> > some other thingy (e.g., a separate HTTP listener) that allows you to
> > manipulate the mutable configuration.
>
> And I agree very much in this philosophywhen we're talking
> production.
>
> I'm interested if you feel the same way about this during development? If
> so,
> stop reading as the rest will just be a rant, if not read on :-)
>
> I think the static nature of some of Lift's internals is one of the
> greatest productivity killers when it comes to rapidly start up with a
> new app where you quickly iterate different ideas (or even do many small
> changes in an existing app).
>
> 1) Change the menu structure? Restart server
>

Yes.  This is a problem.


> 2) Change the menu text? Restart server (yes I use properties for text
> and yes I need an app in different languages, see other thread :-)
>

This is a problem as well.


> 3) Change something in a mapped field? Restart server
>

This is unavoidable.  If the model changes, you have to re-sync to the RDBMS
and this requires a restart.  In practice, how often do you change your
model?


> 4) Change a field label? Restart server
>

With JRebel, the change to a field label should be reflected immediately.


>
> Using JRebel doesn't really help in these scenarios as the values are
> fixed at start-up.
>
> There are probably others, but these are the ones I can recall. Perhaps
> I'm being hit harder than others since 1) We need different languages
> and 2) You need to be logged in to see the app. Or perhaps I just don't
> develop in an efficient way who knows?
>
> It would be really nice for some of this to be picked up automatically
> when running in development mode. I still remember some time ago when I
> did a project in PHP. I don't like the PHP language very much, but you
> can't really beat the instant gratification of a code change: Just
> reload the page!
>

The problem is two-fold: (1) Lift is stateful and trying to morph the state
based on change to logic is non-trivial and (2) the amount of logic you can
get into a line of PHP vs. a line of Scala is 2-3 orders of magnitude
different.


>
> I think some of these issues could be solved easily, some will require
> more work and some may be impossible.
>
> - Reloading properties if the file has changed should be easy.
>

What do you keep in your properties file?  I keep database connection info
and service endpoints (e.g., Amazon S3 urls and passwords).  Changing this
stuff should require an app restart.

What do you keep in your properties files that can change at runtime?


>
> - Rebooting lift on the fly may not be easy, but perhaps some things
>  could be made reloadable (sitemap?). If you then write a JRebel plugin
>  (not a hard task) that triggers the reload when a class change is
>  detected, you will be one step closer to RAD nirvana.
>

SiteMap is an easy case.  If you'd be so kind as to open a ticket and assign
it to me, I'll make SiteMap morphable in development mode.  What other
things need changing?  Maybe the LiftRules stuff can be more dynamic at
runtime.


>
> I'm interested to hear if others have the same pain points as me (if
> not, I don't see this changing soon :-) and if there are some ideas how
> to remedy this (either by changing Lift or changing my development
> process :-)
>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb

Re: [Lift] Re: ByList using OR instead of IN?

2010-03-01 Thread Naftoli Gugenheim
Maybe there could be
case class Or(qps: QueryParam*) extends QueryParam
or something like it? This way ByList could use IN but one can also do OR?

-
aw wrote:

I was searching for a prior thread and couldn't find it last night,
but I think I found it today:

http://groups.google.com/group/liftweb/browse_thread/thread/1cf5c0e153e98b47/5b60451a961ad78d?lnk=gst&q=ByList#
Is this the thread you are referring to?

It leaves me with much to be desired since the precise issue is
unclear and limited to Postgres.  (It sounds like the author might
have experienced the issue with the IN (select ...) construct which
isn't even the same thing.)

I like James Iry's idea that the final SQL would be dependent on the
database dialect (Driver, I guess).  I know that different vendors
have different limits for the number of elements in an IN clause.  If
we had a limit of 250, for example, but had 300 items, you could
transform it into:

where (a in (1, 2, 3, ..., 250) or a in (251, 252, ..., 300))

That would be clever (and probably necessary if the database vendor
has a relatively small number for the maximum number of IN clause
elements).  I'm pretty sure that Oracle has a limit of 1,000 elements
for an IN clause, and I can't imagine requiring more than that.

For the average case (< 30 items), the IN clause is going to be easier
to read, faster to parse, and likely faster to execute on almost all
database vendors -- that is why I like it.

(I luckily don't have a large data set right now, so this won't bother
me too much.)

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread Naftoli Gugenheim
When you bind a form, you write functions that handle parts of the form. They 
are stored in memory and when the form is submitted they are executed. They are 
triggered by assigning them a unique id and using it as the form element's 
name. There's no way to preserve the functions to survive a restart. So it may 
be a good idea to warn users in advance about maintenance and that form data 
won't be submitted if the page is loaded before and submitted after.
It would be a nice feature if Lift could somehow detect query params that look 
like they are bound to functions but are not actually, and give the app a 
chance to notify the user that the form was not submitted, if such a thing is 
possible.

-
John Pletka wrote:

The ProtoExtendedSession looks like it might match what I'm looking for.
With that, they won't have to re-login, right?  We're trying to avoid
multi-page state-full workflows so that is not a problem.  Are you saying if
they have a form up, then submit it (say to update a record), that will
fail?  Will it generate an error that could be caught and nicely handled by
the app?

On a related note, any recommendations about a open-source loadbalancer that
would allow you to take a server offline for new connections, but still
allow the old connections to flow through?

On Mon, Mar 1, 2010 at 5:39 PM, David Pollak
wrote:

>
>
> On Mon, Mar 1, 2010 at 1:19 PM, Jeppe Nejsum Madsen wrote:
>
>> Ahh just saw David beat me to it with the other reply :-)
>>
>> John Pletka  writes:
>>
>> > It is a business application - lots of forms, reports, data lookups.
>>  I'm
>> > not too concerned about the performance on a single node - at any given
>> time
>> > we'll probably have a max of 1000 requests a minute coming in which I've
>> > seen Lift handle easily.  The biggest problem is we need near 100%
>> up-time.
>>
>> But you can have near 100% uptime with sticky sessions. What you can't
>> have is High Availability (HA), ie. users won't notice when a server
>> breaks.
>>
>
> There are 3 scenarios:
>
>1. Unplanned fail-over.  Having a hot standby and extended login
>session (See ProtoExtendedSession).  The user would lose a stateful
>multi-page wizard and would lose input to the particular screen they were
>on.  It would appear as a "glitch"... not optimal, but not end of the 
> world.
>2. Planned transfer.  You could shuffle all new sessions off to the new
>machine and let the old sessions age on the old server.  With a little 
> extra
>work, you could demark when a user was done with a logic task (e.g., going
>back to the home page) and use that as the trigger to move the session to
>the new machine.
>3. Upgrade that breaks the DB schema.  You're going to have downtime.
>No way around it.
>
>
>
>>
>> > That means having at least a second server in hot-standby mode
>> > (preferably parallel production), and some way to do upgrades without
>> > bringing the whole site offline.
>>
>> Doing rolling upgrades is never easy, even if you don't share state. You
>> may have all this figured, but you need to account for different app
>> versions running simultaneously, expanding/shrinking db upgrades etc.
>>
>> /Jeppe
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread John Pletka
The ProtoExtendedSession looks like it might match what I'm looking for.
With that, they won't have to re-login, right?  We're trying to avoid
multi-page state-full workflows so that is not a problem.  Are you saying if
they have a form up, then submit it (say to update a record), that will
fail?  Will it generate an error that could be caught and nicely handled by
the app?

On a related note, any recommendations about a open-source loadbalancer that
would allow you to take a server offline for new connections, but still
allow the old connections to flow through?

On Mon, Mar 1, 2010 at 5:39 PM, David Pollak
wrote:

>
>
> On Mon, Mar 1, 2010 at 1:19 PM, Jeppe Nejsum Madsen wrote:
>
>> Ahh just saw David beat me to it with the other reply :-)
>>
>> John Pletka  writes:
>>
>> > It is a business application - lots of forms, reports, data lookups.
>>  I'm
>> > not too concerned about the performance on a single node - at any given
>> time
>> > we'll probably have a max of 1000 requests a minute coming in which I've
>> > seen Lift handle easily.  The biggest problem is we need near 100%
>> up-time.
>>
>> But you can have near 100% uptime with sticky sessions. What you can't
>> have is High Availability (HA), ie. users won't notice when a server
>> breaks.
>>
>
> There are 3 scenarios:
>
>1. Unplanned fail-over.  Having a hot standby and extended login
>session (See ProtoExtendedSession).  The user would lose a stateful
>multi-page wizard and would lose input to the particular screen they were
>on.  It would appear as a "glitch"... not optimal, but not end of the 
> world.
>2. Planned transfer.  You could shuffle all new sessions off to the new
>machine and let the old sessions age on the old server.  With a little 
> extra
>work, you could demark when a user was done with a logic task (e.g., going
>back to the home page) and use that as the trigger to move the session to
>the new machine.
>3. Upgrade that breaks the DB schema.  You're going to have downtime.
>No way around it.
>
>
>
>>
>> > That means having at least a second server in hot-standby mode
>> > (preferably parallel production), and some way to do upgrades without
>> > bringing the whole site offline.
>>
>> Doing rolling upgrades is never easy, even if you don't share state. You
>> may have all this figured, but you need to account for different app
>> versions running simultaneously, expanding/shrinking db upgrades etc.
>>
>> /Jeppe
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: About the url rewrite (more thant one params and get 404 not found error)

2010-03-01 Thread Neil.Lv
OK, Got it, Thank you very much!

On Mar 2, 3:01 am, David Pollak  wrote:
> On Sun, Feb 28, 2010 at 8:28 PM, Neil.Lv  wrote:
> > Hi all,
>
> >  I have a silly question about the url rewrite in the lift.
> >  It has another two params in the url after the img.
>
> >  http://localhost:8080/show/img/version/id
>
> >  The url works fine.
> >  =>http://localhost:8080/show/img
> >  =>http://localhost:8080/show/img/v1/
> >  =>http://localhost:8080/show/img/v1/1
>
> >  Get 404 error if the "/" string is not added at the end of the url
> > (the id param isn't supplied)
> >  =>http://localhost:8080/show/img/v1
>
> >  So, how can i rewrite the url and set the sitemap can make this link
> > (  http://localhost:8080/show/img/v1 )
> >  works fine as (  http://localhost:8080/show/img/v1/ ) when the id
> > is not supplied.
>
> >  Here is the code:
>
> > ###
> >  case RewriteRequest(
> >  ParsePath(List("show", "img", version, id), _, _,_), _, _) =>
> >RewriteResponse(List("show", "img"),
> >  Map("version" -> version, "id" -> id)
> >  )
> > ###
>
> This is just basic pattern matching stuff.  So,
>
> case RewriteRequest(
>  ParsePath("show" :: "img" :: version :: rest, _, _,_), _, _) =>
> RewriteResponse(List("show", "img"),
>  Map("version" -> version, "id" -> (rest.firstOption getOrElse "N/A"))
>  )
>
> Please pick up a copy of one of the Scala books and look at the pattern
> matching section related to Lists.  There's a lot of flexibility that's no
> Lift-specific, but that Lift leverages.
>
> val entries = Menu(Loc("Home", List("index"), "Home")) ::
>
>
>
> > Menu(Loc("show", List("show"), "show", Hidden)) :: User.sitemap
>
> > ###
>
> >  BTW, I use the LiftView to handle the request.
>
> > ###
> > class show extends LiftView {
> >  def dispatch = {
> >case "img" => imgDispatch _
> >case _ => allDispatch _
> >  }
>
> >  def imgDispatch(): Box[NodeSeq] = {
> >...
> >  }
>
> >  def allDispatch(): Box[NodeSeq] = {
> >...
> >  }
> > }
> > ###
>
> >  Thanks very much!
>
> > Cheers,
> >  Neil
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: New logging code is in master

2010-03-01 Thread aw
Very nice!  I am looking forward to this.

On Feb 28, 8:14 am, Jeppe Nejsum Madsen  wrote:
> The new logging code is now in master and should be fully usable.
> Therefore, the existing logging code has been deprecated.
>
> I've added a Wiki article 
> here:http://wiki.github.com/dpp/liftweb/logging-in-lift
>
> /Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: ByList using OR instead of IN?

2010-03-01 Thread aw
I was searching for a prior thread and couldn't find it last night,
but I think I found it today:

http://groups.google.com/group/liftweb/browse_thread/thread/1cf5c0e153e98b47/5b60451a961ad78d?lnk=gst&q=ByList#
Is this the thread you are referring to?

It leaves me with much to be desired since the precise issue is
unclear and limited to Postgres.  (It sounds like the author might
have experienced the issue with the IN (select ...) construct which
isn't even the same thing.)

I like James Iry's idea that the final SQL would be dependent on the
database dialect (Driver, I guess).  I know that different vendors
have different limits for the number of elements in an IN clause.  If
we had a limit of 250, for example, but had 300 items, you could
transform it into:

where (a in (1, 2, 3, ..., 250) or a in (251, 252, ..., 300))

That would be clever (and probably necessary if the database vendor
has a relatively small number for the maximum number of IN clause
elements).  I'm pretty sure that Oracle has a limit of 1,000 elements
for an IN clause, and I can't imagine requiring more than that.

For the average case (< 30 items), the IN clause is going to be easier
to read, faster to parse, and likely faster to execute on almost all
database vendors -- that is why I like it.

(I luckily don't have a large data set right now, so this won't bother
me too much.)

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] reload application.properties

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 12:30 PM, Jeppe Nejsum Madsen wrote:

> David Pollak  writes:
>
> > The Props.get stuff is frozen the first time its accessed.  This is a
> > philosophical issue for me.  The properties should be fixed at start-up
> > time.  If there are things to vary, build an administrative interface or
> > some other thingy (e.g., a separate HTTP listener) that allows you to
> > manipulate the mutable configuration.
>
> And I agree very much in this philosophywhen we're talking
> production.
>
> I'm interested if you feel the same way about this during development? If
> so,
> stop reading as the rest will just be a rant, if not read on :-)
>
> I think the static nature of some of Lift's internals is one of the
> greatest productivity killers when it comes to rapidly start up with a
> new app where you quickly iterate different ideas (or even do many small
> changes in an existing app).
>
> 1) Change the menu structure? Restart server
>

Yes.  This is a problem.


> 2) Change the menu text? Restart server (yes I use properties for text
> and yes I need an app in different languages, see other thread :-)
>

This is a problem as well.


> 3) Change something in a mapped field? Restart server
>

This is unavoidable.  If the model changes, you have to re-sync to the RDBMS
and this requires a restart.  In practice, how often do you change your
model?


> 4) Change a field label? Restart server
>

With JRebel, the change to a field label should be reflected immediately.


>
> Using JRebel doesn't really help in these scenarios as the values are
> fixed at start-up.
>
> There are probably others, but these are the ones I can recall. Perhaps
> I'm being hit harder than others since 1) We need different languages
> and 2) You need to be logged in to see the app. Or perhaps I just don't
> develop in an efficient way who knows?
>
> It would be really nice for some of this to be picked up automatically
> when running in development mode. I still remember some time ago when I
> did a project in PHP. I don't like the PHP language very much, but you
> can't really beat the instant gratification of a code change: Just
> reload the page!
>

The problem is two-fold: (1) Lift is stateful and trying to morph the state
based on change to logic is non-trivial and (2) the amount of logic you can
get into a line of PHP vs. a line of Scala is 2-3 orders of magnitude
different.


>
> I think some of these issues could be solved easily, some will require
> more work and some may be impossible.
>
> - Reloading properties if the file has changed should be easy.
>

What do you keep in your properties file?  I keep database connection info
and service endpoints (e.g., Amazon S3 urls and passwords).  Changing this
stuff should require an app restart.

What do you keep in your properties files that can change at runtime?


>
> - Rebooting lift on the fly may not be easy, but perhaps some things
>  could be made reloadable (sitemap?). If you then write a JRebel plugin
>  (not a hard task) that triggers the reload when a class change is
>  detected, you will be one step closer to RAD nirvana.
>

SiteMap is an easy case.  If you'd be so kind as to open a ticket and assign
it to me, I'll make SiteMap morphable in development mode.  What other
things need changing?  Maybe the LiftRules stuff can be more dynamic at
runtime.


>
> I'm interested to hear if others have the same pain points as me (if
> not, I don't see this changing soon :-) and if there are some ideas how
> to remedy this (either by changing Lift or changing my development
> process :-)
>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread David Pollak
If the mechanism was something more along the lines of:

display name calculator: (Mapper[_], Locale, String) => Box[String] // we
could use Lift's factory mechanism here

Then you have lots of room to keep the current implementation as the default
if there is no actual name calculated.  Further, the calculation is not
based on the currently logged in user, so you could cache the results (or
not if you're in development mode).

My issue is that I like to not push functions like this towards external
files, but allow external files (and other resources) to be consulted
depending on the localization mechanism chosen for the given project.

On Mon, Mar 1, 2010 at 12:56 PM, Jeppe Nejsum Madsen wrote:

> Jim Barrows  writes:
>
> > My point was that you've moved the boilerplate, not eliminated it.  If
> what
> > you suggest was in place you'd have to add 100+ properties in a file.
>
> I'm not sure if we're wandering out on a philosophical tangent here, but
> would genuinely like to hear if you have better solutions:
>
> Given that I have say 100 fields and need it translated to say 5
> different languages.
>
> I need to have at least 500 words stored somewhere. If I don't want to
> use a word's position in the file as key, I'll need a key per word. I
> would also like one file per language since this allows independent
> translation. So now I have 5 files each with 100 lines containing two
> words.
>
> But AFAIKS, there's no repetition (except for the keys, which I think
> are unavoidable), so no boilerplate.
>
> Now I have to add the 100 overrides to actually look up the translated
> names. This is the only place I see boilerplate, and it could be easily
> removed :-)
>
> I agree 100% that if you don't need translation, properties are often
> the wrong approach, but when you do need it I've yet to see a better
> alternative (but would love to hear about it!)
>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] New logging code is in master

2010-03-01 Thread Jeppe Nejsum Madsen
On Mon, Mar 1, 2010 at 12:20 AM, David Pollak
 wrote:
> Excellent!
>
> We have the deprecations turned off in the pom.xml file by default... but
> gotta turn the deprecation warnings on post M3.

I think the main reasons deprecations are not shown for stuff like
Log.info is that deprecation of objects doesn't work
https://lampsvn.epfl.ch/trac/scala/ticket/3115. I've made a new ticket
so we can deprecate all the members instead

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 1:19 PM, Jeppe Nejsum Madsen wrote:

> Ahh just saw David beat me to it with the other reply :-)
>
> John Pletka  writes:
>
> > It is a business application - lots of forms, reports, data lookups.  I'm
> > not too concerned about the performance on a single node - at any given
> time
> > we'll probably have a max of 1000 requests a minute coming in which I've
> > seen Lift handle easily.  The biggest problem is we need near 100%
> up-time.
>
> But you can have near 100% uptime with sticky sessions. What you can't
> have is High Availability (HA), ie. users won't notice when a server
> breaks.
>

There are 3 scenarios:

   1. Unplanned fail-over.  Having a hot standby and extended login session
   (See ProtoExtendedSession).  The user would lose a stateful multi-page
   wizard and would lose input to the particular screen they were on.  It would
   appear as a "glitch"... not optimal, but not end of the world.
   2. Planned transfer.  You could shuffle all new sessions off to the new
   machine and let the old sessions age on the old server.  With a little extra
   work, you could demark when a user was done with a logic task (e.g., going
   back to the home page) and use that as the trigger to move the session to
   the new machine.
   3. Upgrade that breaks the DB schema.  You're going to have downtime.  No
   way around it.



>
> > That means having at least a second server in hot-standby mode
> > (preferably parallel production), and some way to do upgrades without
> > bringing the whole site offline.
>
> Doing rolling upgrades is never easy, even if you don't share state. You
> may have all this figured, but you need to account for different app
> versions running simultaneously, expanding/shrinking db upgrades etc.
>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread Jeppe Nejsum Madsen
Ahh just saw David beat me to it with the other reply :-)

John Pletka  writes:

> It is a business application - lots of forms, reports, data lookups.  I'm
> not too concerned about the performance on a single node - at any given time
> we'll probably have a max of 1000 requests a minute coming in which I've
> seen Lift handle easily.  The biggest problem is we need near 100% up-time.

But you can have near 100% uptime with sticky sessions. What you can't
have is High Availability (HA), ie. users won't notice when a server breaks.

> That means having at least a second server in hot-standby mode
> (preferably parallel production), and some way to do upgrades without
> bringing the whole site offline.

Doing rolling upgrades is never easy, even if you don't share state. You
may have all this figured, but you need to account for different app
versions running simultaneously, expanding/shrinking db upgrades etc.

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread John Pletka
It is a business application - lots of forms, reports, data lookups.  I'm
not too concerned about the performance on a single node - at any given time
we'll probably have a max of 1000 requests a minute coming in which I've
seen Lift handle easily.  The biggest problem is we need near 100% up-time.
That means having at least a second server in hot-standby mode (preferably
parallel production), and some way to do upgrades without bringing the whole
site offline.

On Mon, Mar 1, 2010 at 3:48 PM, David Pollak
wrote:

>
>
> On Mon, Mar 1, 2010 at 12:29 PM, John Pletka  wrote:
>
>> I was tasked with designing a new web-based application that has the
>> requirement of being able to run on multiple servers that could be
>> 1) Load balanced without requiring sticky sessions and
>> 2) Single nodes could be transparently shutdown or added without the users
>> noticing
>>
>> I would like to use Lift if possible, but I'm a bit worried about it's
>> state-full nature.  Is it possible to use something like Cassandra or
>> Memcached to hold the session data and have Lift grab that from a cookie
>> instead of storing it all internally in memory?  I've looked around, but I
>> have not found any good articles about how to scale Lift horizontally.
>>
>
> The short answer is that Lift is stateful and you can't shovel Lift state
> into a backing store.
>
> You could use Terracotta to create a cluster of Lift machines, but you're
> still going to be a lot better off routing requests back to the same machine
> to avoid shuffling a lot of state around (which is expensive any way you
> slice it)
>
> If you could tell us more about your app, there might be other ways to skin
> your cat. http://icanhascheezburger.com/2007/08/08/i-has-minions/
>
> Thanks,
>
> David
>
>
>>
>> Thanks in advance
>>
>> John
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread Jeppe Nejsum Madsen
John Pletka  writes:

> I was tasked with designing a new web-based application that has the
> requirement of being able to run on multiple servers that could be
> 1) Load balanced without requiring sticky sessions and
> 2) Single nodes could be transparently shutdown or added without the users
> noticing
>
> I would like to use Lift if possible, but I'm a bit worried about it's
> state-full nature.  Is it possible to use something like Cassandra or
> Memcached to hold the session data and have Lift grab that from a cookie
> instead of storing it all internally in memory? 

Short version: No.
Longer version: It's not currently possible and probably hard (but not
impossible) to do. But I think (but this is pure speculation) that
a Lift session is rather heavy since it contains closures for all the
callbacks that have been active within the last 10(?) minutes, the
overhead of serializing the session state for each request (which you
need for HA) would be substantial.

> I've looked around, but I have not found any good articles about how
> to scale Lift horizontally.

Probably because it has not been done (without sticky sessions)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread Jeppe Nejsum Madsen
Jim Barrows  writes:

> My point was that you've moved the boilerplate, not eliminated it.  If what
> you suggest was in place you'd have to add 100+ properties in a file.

I'm not sure if we're wandering out on a philosophical tangent here, but
would genuinely like to hear if you have better solutions:

Given that I have say 100 fields and need it translated to say 5
different languages.

I need to have at least 500 words stored somewhere. If I don't want to
use a word's position in the file as key, I'll need a key per word. I
would also like one file per language since this allows independent
translation. So now I have 5 files each with 100 lines containing two
words.

But AFAIKS, there's no repetition (except for the keys, which I think
are unavoidable), so no boilerplate.

Now I have to add the 100 overrides to actually look up the translated
names. This is the only place I see boilerplate, and it could be easily
removed :-)

I agree 100% that if you don't need translation, properties are often
the wrong approach, but when you do need it I've yet to see a better
alternative (but would love to hear about it!)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Running parallel site load balanced

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 12:29 PM, John Pletka  wrote:

> I was tasked with designing a new web-based application that has the
> requirement of being able to run on multiple servers that could be
> 1) Load balanced without requiring sticky sessions and
> 2) Single nodes could be transparently shutdown or added without the users
> noticing
>
> I would like to use Lift if possible, but I'm a bit worried about it's
> state-full nature.  Is it possible to use something like Cassandra or
> Memcached to hold the session data and have Lift grab that from a cookie
> instead of storing it all internally in memory?  I've looked around, but I
> have not found any good articles about how to scale Lift horizontally.
>

The short answer is that Lift is stateful and you can't shovel Lift state
into a backing store.

You could use Terracotta to create a cluster of Lift machines, but you're
still going to be a lot better off routing requests back to the same machine
to avoid shuffling a lot of state around (which is expensive any way you
slice it)

If you could tell us more about your app, there might be other ways to skin
your cat. http://icanhascheezburger.com/2007/08/08/i-has-minions/

Thanks,

David


>
> Thanks in advance
>
> John
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Running parallel site load balanced

2010-03-01 Thread John Pletka
I was tasked with designing a new web-based application that has the
requirement of being able to run on multiple servers that could be
1) Load balanced without requiring sticky sessions and
2) Single nodes could be transparently shutdown or added without the users
noticing

I would like to use Lift if possible, but I'm a bit worried about it's
state-full nature.  Is it possible to use something like Cassandra or
Memcached to hold the session data and have Lift grab that from a cookie
instead of storing it all internally in memory?  I've looked around, but I
have not found any good articles about how to scale Lift horizontally.

Thanks in advance

John

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Less boilerplate in your specifications / tests

2010-03-01 Thread Jeppe Nejsum Madsen
David Pollak  writes:

> Eric,
>
> You're a Lift committer.  Feel very encouraged to clean up the tests!

But if you do, please have in mind that not all the niceties of Specs
are supported very well by IDEs, which may be why some tests are as they
are :-( 

Hopefully that will change when 2.8 comes out (at least for Eclipse it
will. The current workaround for running specs is quite horrible)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] reload application.properties

2010-03-01 Thread Jeppe Nejsum Madsen
David Pollak  writes:

> The Props.get stuff is frozen the first time its accessed.  This is a
> philosophical issue for me.  The properties should be fixed at start-up
> time.  If there are things to vary, build an administrative interface or
> some other thingy (e.g., a separate HTTP listener) that allows you to
> manipulate the mutable configuration.

And I agree very much in this philosophywhen we're talking
production. 

I'm interested if you feel the same way about this during development? If so,
stop reading as the rest will just be a rant, if not read on :-)

I think the static nature of some of Lift's internals is one of the
greatest productivity killers when it comes to rapidly start up with a
new app where you quickly iterate different ideas (or even do many small
changes in an existing app).

1) Change the menu structure? Restart server
2) Change the menu text? Restart server (yes I use properties for text
and yes I need an app in different languages, see other thread :-)
3) Change something in a mapped field? Restart server
4) Change a field label? Restart server

Using JRebel doesn't really help in these scenarios as the values are
fixed at start-up.

There are probably others, but these are the ones I can recall. Perhaps
I'm being hit harder than others since 1) We need different languages
and 2) You need to be logged in to see the app. Or perhaps I just don't
develop in an efficient way who knows?

It would be really nice for some of this to be picked up automatically
when running in development mode. I still remember some time ago when I
did a project in PHP. I don't like the PHP language very much, but you
can't really beat the instant gratification of a code change: Just
reload the page!

I think some of these issues could be solved easily, some will require
more work and some may be impossible.

- Reloading properties if the file has changed should be easy.

- Rebooting lift on the fly may not be easy, but perhaps some things
  could be made reloadable (sitemap?). If you then write a JRebel plugin
  (not a hard task) that triggers the reload when a class change is
  detected, you will be one step closer to RAD nirvana.

I'm interested to hear if others have the same pain points as me (if
not, I don't see this changing soon :-) and if there are some ideas how
to remedy this (either by changing Lift or changing my development
process :-)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread Jim Barrows
On Mon, Mar 1, 2010 at 12:54 PM, Jeppe Nejsum Madsen wrote:

> Jim Barrows  writes:
>
> > On Mon, Mar 1, 2010 at 7:19 AM, Jeppe Nejsum Madsen  >wrote:
> >
> >> Hi,
> >>
> >> In the interest of cutting boilerplate from mapped objects, I would
> >> like to get the display name from a property file.
> >>
> >
> > So your replacing code boilerplate with property file boilerplate?  The
> > boilerplate has to go somewhere, and abstracting things like this out
> > doesn't change that.
>
> Yes it does. Now I have to go through all my 100+ fields and add:
>
> override def displayName = S.?(getClass.getName+"."+name)
>


My point was that you've moved the boilerplate, not eliminated it.  If what
you suggest was in place you'd have to add 100+ properties in a file.



>
> Same line in every field. That counts as boilerplate for me :-)
>
> > On the other hand, if you have to l10n your app, then this works.
>
> Exactly.
>
> > What about turning it off by default, and turned on in Boot though.  Also
> it
> > should probably use the existing method by default, rolling to the
> property
> > file if it's turned on and it's not provided.
>
> That was pretty much what I suggested.except I don't want to force
> people to use displayNameFromPropertyFile. They could provide their own
> function that looked it up in a db, generated random names etc.
>


Okay, so displayNameFactory maybe?



> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
James A Barrows

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread Jeppe Nejsum Madsen
Jim Barrows  writes:

> On Mon, Mar 1, 2010 at 7:19 AM, Jeppe Nejsum Madsen wrote:
>
>> Hi,
>>
>> In the interest of cutting boilerplate from mapped objects, I would
>> like to get the display name from a property file.
>>
>
> So your replacing code boilerplate with property file boilerplate?  The
> boilerplate has to go somewhere, and abstracting things like this out
> doesn't change that. 

Yes it does. Now I have to go through all my 100+ fields and add:

override def displayName = S.?(getClass.getName+"."+name)

Same line in every field. That counts as boilerplate for me :-)

> On the other hand, if you have to l10n your app, then this works.

Exactly.

> What about turning it off by default, and turned on in Boot though.  Also it
> should probably use the existing method by default, rolling to the property
> file if it's turned on and it's not provided.

That was pretty much what I suggested.except I don't want to force
people to use displayNameFromPropertyFile. They could provide their own
function that looked it up in a db, generated random names etc.

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread Jeppe Nejsum Madsen
David Pollak  writes:

> On Mon, Mar 1, 2010 at 8:27 AM, Jim Barrows  wrote:
>
>>
>> On Mon, Mar 1, 2010 at 7:19 AM, Jeppe Nejsum Madsen wrote:
>>
>>> Hi,
>>>
>>> In the interest of cutting boilerplate from mapped objects, I would
>>> like to get the display name from a property file.
>>>
>>
>> So your replacing code boilerplate with property file boilerplate?  The
>> boilerplate has to go somewhere, and abstracting things like this out
>> doesn't change that.  On the other hand, if you have to l10n your app, then
>> this works.
>>
>> What about turning it off by default, and turned on in Boot though.  Also
>> it should probably use the existing method by default, rolling to the
>> property file if it's turned on and it's not provided.
>>
>
> Yeah... I gotta say, the less stuff that winds up outside Scala by default,
> the better.

Well, you probably have the luxury of not having to localize your
apps. Unfortunately, I don't :-(

But I'm interested if you know of better ways to handle i18n for things
like displayName.

/Jeppe 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Emerging Languages Face Off: Scala, Go, Clojure and Ruby

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 11:18 AM, Mads Hartmann Jensen wrote:

> Any chance that there'll be an audio version after?
>
> Would love the hear it :)
>

I don't know.  Miking/mixing 4 participants is non-trivial (beyond what I
can do with my traveling AV stuff)


>
> On 01/03/2010, at 19.53, Jim Barrows wrote:
>
> Best of luck!
>
> Will you be facing off with swords or... oh wait.. never mind... ;)
>
> On Mon, Mar 1, 2010 at 10:50 AM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>> Folks,
>>
>> I'll be representing Scala in an emerging languages face-off at
>> http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&eventID=13632
>>
>> Interestingly, Scala and Clojure and both functional languages...
>> indicating that FP is gaining interest from folks inside 2 standard
>> deviations from the mean.
>>
>> Looking forward to seeing lots of cool folks there.
>>
>> Thanks,
>>
>> David
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Surf the harmonics
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> James A Barrows
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Emerging Languages Face Off: Scala, Go, Clojure and Ruby

2010-03-01 Thread Mads Hartmann Jensen
Any chance that there'll be an audio version after? 

Would love the hear it :) 

On 01/03/2010, at 19.53, Jim Barrows wrote:

> Best of luck!
> 
> Will you be facing off with swords or... oh wait.. never mind... ;)
> 
> On Mon, Mar 1, 2010 at 10:50 AM, David Pollak  
> wrote:
> Folks,
> 
> I'll be representing Scala in an emerging languages face-off at 
> http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&eventID=13632
> 
> Interestingly, Scala and Clojure and both functional languages... indicating 
> that FP is gaining interest from folks inside 2 standard deviations from the 
> mean.
> 
> Looking forward to seeing lots of cool folks there.
> 
> Thanks,
> 
> David
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 
> 
> 
> -- 
> James A Barrows
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Less boilerplate in your specifications / tests

2010-03-01 Thread David Pollak
Eric,

You're a Lift committer.  Feel very encouraged to clean up the tests!

Thanks,

David

On Sun, Feb 28, 2010 at 4:42 PM, etorreborre  wrote:

> Hi all Lift-developers,
>
> I have noticed a few commits recently where the declarations for
> specifications could be reduced to something simpler.
>
> For example:
>
> import org.specs._
> import org.specs.runner._
>
> class BindingsSpecTest extends Runner(BindingsSpec) with JUnit with
> Console
> object BindingsSpec extends Specification
>
> can be written as
>
> import org.specs._
>
> class BindingsSpec extends SpecificationWithJUnit
>
>  - the BindingsSpec class will run with maven, provided that you add
> the proper include directive in the pom.xml file, like this, for
> example:
>
>  
>org.apache.maven.plugins
>maven-surefire-plugin
>2.4.3
>
>  false
>  -Xmx512m
>  always
>  
>**/*Unit.java
>**/*Spec.java
>  
>  
>**/*Test.java
>  
>
>  
>
>  - It will also run in the console, like this:
>
>   scala -cp  run net.liftweb.http.BindingsSpec
>
> I hope this helps, please ping me if you have any concern with this.
>
> Eric.
>
> PS: I forgot to mention that I am guilty of the situation above
> because of how things were done in specs when I starting contributing
> the first specifications to Lift,...
>
> PPS: I've edited the User Guide to make clear what was the preferred
> way of using JUnit with specs:
>
>
> http://code.google.com/p/specs/wiki/RunningSpecs#Run_your_specification_with_JUnit4
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] snakify and abbreviations

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 2:46 AM, Jeppe Nejsum Madsen wrote:

> Hi,
>
> Eager to use the new Mapper support for snake_case I discovered that
> the snakify method doesn' handle abbreviations well:
>
> StringHelpers.snakify("HTML")
> res5: java.lang.String = h_t_m_l
>
> StringHelpers.snakify("HTMLEditor")
> res6: java.lang.String = h_t_m_l_editor
>
> I would expect those to be html and html_editor respectively...
>
> What do people think?
>

Yeah, adjacent caps should be part of the same word.


>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] About the url rewrite (more thant one params and get 404 not found error)

2010-03-01 Thread David Pollak
On Sun, Feb 28, 2010 at 8:28 PM, Neil.Lv  wrote:

> Hi all,
>
>  I have a silly question about the url rewrite in the lift.
>  It has another two params in the url after the img.
>
>  http://localhost:8080/show/img/version/id
>
>  The url works fine.
>  => http://localhost:8080/show/img
>  => http://localhost:8080/show/img/v1/
>  => http://localhost:8080/show/img/v1/1
>
>  Get 404 error if the "/" string is not added at the end of the url
> (the id param isn't supplied)
>  => http://localhost:8080/show/img/v1
>
>  So, how can i rewrite the url and set the sitemap can make this link
> (  http://localhost:8080/show/img/v1  )
>  works fine as (  http://localhost:8080/show/img/v1/  ) when the id
> is not supplied.
>
>  Here is the code:
>
> ###
>  case RewriteRequest(
>  ParsePath(List("show", "img", version, id), _, _,_), _, _) =>
>RewriteResponse(List("show", "img"),
>  Map("version" -> version, "id" -> id)
>  )
> ###
>


This is just basic pattern matching stuff.  So,

case RewriteRequest(
 ParsePath("show" :: "img" :: version :: rest, _, _,_), _, _) =>
RewriteResponse(List("show", "img"),
 Map("version" -> version, "id" -> (rest.firstOption getOrElse "N/A"))
 )

Please pick up a copy of one of the Scala books and look at the pattern
matching section related to Lists.  There's a lot of flexibility that's no
Lift-specific, but that Lift leverages.

val entries = Menu(Loc("Home", List("index"), "Home")) ::
> Menu(Loc("show", List("show"), "show", Hidden)) :: User.sitemap
>
> ###
>
>  BTW, I use the LiftView to handle the request.
>
> ###
> class show extends LiftView {
>  def dispatch = {
>case "img" => imgDispatch _
>case _ => allDispatch _
>  }
>
>  def imgDispatch(): Box[NodeSeq] = {
>...
>  }
>
>  def allDispatch(): Box[NodeSeq] = {
>...
>  }
> }
> ###
>
>  Thanks very much!
>
> Cheers,
>  Neil
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Emerging Languages Face Off: Scala, Go, Clojure and Ruby

2010-03-01 Thread Jim Barrows
Best of luck!

Will you be facing off with swords or... oh wait.. never mind... ;)

On Mon, Mar 1, 2010 at 10:50 AM, David Pollak  wrote:

> Folks,
>
> I'll be representing Scala in an emerging languages face-off at
> http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&eventID=13632
>
> Interestingly, Scala and Clojure and both functional languages...
> indicating that FP is gaining interest from folks inside 2 standard
> deviations from the mean.
>
> Looking forward to seeing lots of cool folks there.
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
James A Barrows

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread David Pollak
Send it to me directly, but please make sure that there are no hard-coded
paths or dependencies other than Ant and Ivy that I might not have on my
machine.

On Mon, Mar 1, 2010 at 9:46 AM, Donald McLean  wrote:

> Fortunately, I'm doing a tech-eval prototype so I can just send the
> whole kit-n-caboodle. It's just under 700k as a tar file.
>
> Where should I send it?
>
> Donald
>
> On Mon, Mar 1, 2010 at 12:32 PM, David Pollak
>  wrote:
> >
> >
> > On Mon, Mar 1, 2010 at 9:28 AM, Donald McLean 
> wrote:
> >>
> >> That didn't help. The problem is related to the Lift-2.0-M2 libraries.
> >> I went to 1.0.3 and it is fine.
> >
> > If you can put together a reproduceable example, we'll look into it.
>
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Emerging Languages Face Off: Scala, Go, Clojure and Ruby

2010-03-01 Thread David Pollak
Folks,

I'll be representing Scala in an emerging languages face-off at
http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&eventID=13632

Interestingly, Scala and Clojure and both functional languages... indicating
that FP is gaining interest from folks inside 2 standard deviations from the
mean.

Looking forward to seeing lots of cool folks there.

Thanks,

David

-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread Donald McLean
Fortunately, I'm doing a tech-eval prototype so I can just send the
whole kit-n-caboodle. It's just under 700k as a tar file.

Where should I send it?

Donald

On Mon, Mar 1, 2010 at 12:32 PM, David Pollak
 wrote:
>
>
> On Mon, Mar 1, 2010 at 9:28 AM, Donald McLean  wrote:
>>
>> That didn't help. The problem is related to the Lift-2.0-M2 libraries.
>> I went to 1.0.3 and it is fine.
>
> If you can put together a reproduceable example, we'll look into it.

-- 
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 9:28 AM, Donald McLean  wrote:

> That didn't help. The problem is related to the Lift-2.0-M2 libraries.
> I went to 1.0.3 and it is fine.
>

If you can put together a reproduceable example, we'll look into it.


>
> Donald
>
> On Mon, Mar 1, 2010 at 11:51 AM, David Pollak
>  wrote:
> >
> >
> > On Mon, Mar 1, 2010 at 8:19 AM, Donald McLean 
> wrote:
> >>
> >> I appreciate the response but I'm not using Maven, I'm using Ant. If
> >> you could tell me what that would accomplish I could probably figure
> >> out the equivalent.
> >>
> >
> > whatever does a clean... whatever deletes all the .class files.
> >
> >>
> >> Thank you,
> >>
> >> Donald
> >>
> >> On Mon, Mar 1, 2010 at 11:07 AM, David Pollak
> >>  wrote:
> >> >
> >> >
> >> > On Mon, Mar 1, 2010 at 8:03 AM, Donald McLean 
> >> > wrote:
> >> >>
> >> >> I just updated to Lift 2.0m2 and Scala 2.7.7 and now I'm getting this
> >> >> error message. I would greatly appreciate a suggestion on how to
> >> >> resolve this.
> >> >
> >> >
> >> > This is a known bug in the Scala compiler.
> >> >
> >> > To fix it, do: mvn clean
> >> >
> >> >> java.lang.RuntimeException: malformed Scala signature of Loc at 5720;
> >> >> reference value common of package liftweb refers to nonexisting
> >> >> symbol.
> >> >>at
> >> >>
> >> >>
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)
> >> >>
> >> >> --
> >> >> Family photographs are a critical legacy for
> >> >> ourselves and our descendants. Protect that
> >> >> legacy with a digital backup and recovery plan.
> >> >>
> >> >> Join the photo preservation advocacy Facebook group:
> >> >>
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups
> >> >> "Lift" group.
> >> >> To post to this group, send email to lift...@googlegroups.com.
> >> >> To unsubscribe from this group, send email to
> >> >> liftweb+unsubscr...@googlegroups.com
> .
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/liftweb?hl=en.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Lift, the simply functional web framework http://liftweb.net
> >> > Beginning Scala http://www.apress.com/book/view/1430219890
> >> > Follow me: http://twitter.com/dpp
> >> > Surf the harmonics
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "Lift" group.
> >> > To post to this group, send email to lift...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > liftweb+unsubscr...@googlegroups.com
> .
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/liftweb?hl=en.
> >> >
> >>
> >>
> >>
> >> --
> >> Family photographs are a critical legacy for
> >> ourselves and our descendants. Protect that
> >> legacy with a digital backup and recovery plan.
> >>
> >> Join the photo preservation advocacy Facebook group:
> >> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Lift" group.
> >> To post to this group, send email to lift...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> liftweb+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/liftweb?hl=en.
> >>
> >
> >
> >
> > --
> > Lift, the simply functional web framework http://liftweb.net
> > Beginning Scala http://www.apress.com/book/view/1430219890
> > Follow me: http://twitter.com/dpp
> > Surf the harmonics
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/liftweb?hl=en.
> >
>
>
>
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googl

[Lift] Lift 2.0-M3 code slush

2010-03-01 Thread David Pollak
Folks,

The Lift master branch is now in code slush in anticipation of a late
Wednesday March 3rd PST release of Lift 2.0 Milestone 3.

If you are a committer: THANK YOU!! for working hard and working as a team
to make M3 a reality.  If you committed something to M3, please contact me
privately with your shipping address and your preference between coffee, tea
or jam (sorry, I can't send pies) and I will have some shipped to you as a
way of saying "Thanks!"

If you are a Lift user (this means guys like HarryH and Jon) and want to
help, please test your code thoroughly against the current 2.0-SNAPSHOT.  If
there is a defect or problem, please report it at
https://liftweb.assembla.com/spaces/liftweb/tickets  We'll work to determine
if a fix needs to go into M3.

Thanks,

David

-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread Donald McLean
That didn't help. The problem is related to the Lift-2.0-M2 libraries.
I went to 1.0.3 and it is fine.

Donald

On Mon, Mar 1, 2010 at 11:51 AM, David Pollak
 wrote:
>
>
> On Mon, Mar 1, 2010 at 8:19 AM, Donald McLean  wrote:
>>
>> I appreciate the response but I'm not using Maven, I'm using Ant. If
>> you could tell me what that would accomplish I could probably figure
>> out the equivalent.
>>
>
> whatever does a clean... whatever deletes all the .class files.
>
>>
>> Thank you,
>>
>> Donald
>>
>> On Mon, Mar 1, 2010 at 11:07 AM, David Pollak
>>  wrote:
>> >
>> >
>> > On Mon, Mar 1, 2010 at 8:03 AM, Donald McLean 
>> > wrote:
>> >>
>> >> I just updated to Lift 2.0m2 and Scala 2.7.7 and now I'm getting this
>> >> error message. I would greatly appreciate a suggestion on how to
>> >> resolve this.
>> >
>> >
>> > This is a known bug in the Scala compiler.
>> >
>> > To fix it, do: mvn clean
>> >
>> >> java.lang.RuntimeException: malformed Scala signature of Loc at 5720;
>> >> reference value common of package liftweb refers to nonexisting
>> >> symbol.
>> >>        at
>> >>
>> >> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)
>> >>
>> >> --
>> >> Family photographs are a critical legacy for
>> >> ourselves and our descendants. Protect that
>> >> legacy with a digital backup and recovery plan.
>> >>
>> >> Join the photo preservation advocacy Facebook group:
>> >> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Lift" group.
>> >> To post to this group, send email to lift...@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> liftweb+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/liftweb?hl=en.
>> >>
>> >
>> >
>> >
>> > --
>> > Lift, the simply functional web framework http://liftweb.net
>> > Beginning Scala http://www.apress.com/book/view/1430219890
>> > Follow me: http://twitter.com/dpp
>> > Surf the harmonics
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Lift" group.
>> > To post to this group, send email to lift...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > liftweb+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/liftweb?hl=en.
>> >
>>
>>
>>
>> --
>> Family photographs are a critical legacy for
>> ourselves and our descendants. Protect that
>> legacy with a digital backup and recovery plan.
>>
>> Join the photo preservation advocacy Facebook group:
>> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Newbie Q: Lift suitable as webgui for java 6 app with embedded webserver and no database ?

2010-03-01 Thread David Pollak
Jeppe gave a great answer.  Just to reinforce that Lift's webkit is totally
agnostic to the data being presented.  As long as that data can be
materialized as instances of objects in the JVM, you can use Lift.

On Mon, Mar 1, 2010 at 4:54 AM, Jeppe Nejsum Madsen wrote:

> mortench  writes:
>
> > Hi All,
> >
>
> [...]
>
> > How suited would Lift be for this scenario or to be more precise:
> > a) Is a lift web app as fast to startup as a normal jave jsp/servlet
> > app ?
>
> Depends mostly on your own code. If you have an empty Boot, startup is <
> 1s.
>
> > b) Can lift be used without a database and can the relate code such as
> > the OR mapped be omitted ?
>
> Yes
>
> > c) Any special considerations needed when starting and stopping an
> > embedded lift web app ?
>
> Dunno :-)
>
> > d) What does lift require of the java web server ? I.e. can some of
> > the more lightweight java web servers be used that might not support
> > the full servlet/jsp specifications such as the embedded HTTP server
> > in Java 6, Winstone, Grizzly etc.? ... What (light) java webservers
> > are lift known to work with ?
>
> You need a recent servlet implementation.


Lift needs Servlet 2.5 or higher.


> JSP is not needed. I'm using
> Jetty although not embedded, but Jetty seems like it should easily be
> embedded. During development, I launch a small Scala app that starts
> jetty (the RunWebApp class generated by the Lift archetype)
>
> > e) What would the best way for the lift web app to communicate with
> > the backend code of the java app ? By just calling into the existing
> > java code (some integration/classloader issues here?) or more loosely
> > by calling REST WS Api exposed by the Java code ?
>
> Not sure what you envision here, but REST and loosely coupled should
> work :-)
>

Given that Scala works perfectly calling Java code, I'd go with calling your
Java classes directly.


>
> > f) I am using ANT and not maven to develop the java app. Will be able
> > to make Lift work with ANT so I use the same build tool for
> > everything?
>
> Yes, but you're probably on your own
>
> > g) What version of lift should I use ? In particular does Lift 2.0
> > change anything for my scenario ?
>
> You should use the latest 2.0-SNAPSHOT or milestone (M3 is just around
> the corner)
>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] reload application.properties

2010-03-01 Thread David Pollak
The Props.get stuff is frozen the first time its accessed.  This is a
philosophical issue for me.  The properties should be fixed at start-up
time.  If there are things to vary, build an administrative interface or
some other thingy (e.g., a separate HTTP listener) that allows you to
manipulate the mutable configuration.

On Mon, Mar 1, 2010 at 4:57 AM, Martin  wrote:

> Hi
>
> is there any way to reload application.properties file after
> boot.scala finishes? I would like to do dynamic localization of
> properties on my site, without need to stop/start application.
> Mayby there is  much better way to accomplish it.
> I would really appreciate any help.
>
> best regards,
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 8:27 AM, Jim Barrows  wrote:

>
> On Mon, Mar 1, 2010 at 7:19 AM, Jeppe Nejsum Madsen wrote:
>
>> Hi,
>>
>> In the interest of cutting boilerplate from mapped objects, I would
>> like to get the display name from a property file.
>>
>
> So your replacing code boilerplate with property file boilerplate?  The
> boilerplate has to go somewhere, and abstracting things like this out
> doesn't change that.  On the other hand, if you have to l10n your app, then
> this works.
>
> What about turning it off by default, and turned on in Boot though.  Also
> it should probably use the existing method by default, rolling to the
> property file if it's turned on and it's not provided.
>

Yeah... I gotta say, the less stuff that winds up outside Scala by default,
the better.


>
>
>
>>
>> So I was thinking that it would be an idea to add a
>> MapperRules.nameToDisplayName such as this
>>
>> var  nameToDisplayName: ( Mapper[_], String) = (_,name) => name
>>
>
> A department of redundancy department approved name? :) *LOL*
>
> How about displayNameFromPropertyFile?  A little wordy, but it shouldn't
> ever need to be typed except to be overridden.
>
>
>
>>
>> This would allow me to do things like nameToDisplayName = (m,name) =>
>> S.?(m.getClass.getName+"."+name)
>>
>> Thoughts?
>>
>> /Jeppe
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>>
>
>
> --
> James A Barrows
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 8:19 AM, Donald McLean  wrote:

> I appreciate the response but I'm not using Maven, I'm using Ant. If
> you could tell me what that would accomplish I could probably figure
> out the equivalent.
>
>
whatever does a clean... whatever deletes all the .class files.


> Thank you,
>
> Donald
>
> On Mon, Mar 1, 2010 at 11:07 AM, David Pollak
>  wrote:
> >
> >
> > On Mon, Mar 1, 2010 at 8:03 AM, Donald McLean 
> wrote:
> >>
> >> I just updated to Lift 2.0m2 and Scala 2.7.7 and now I'm getting this
> >> error message. I would greatly appreciate a suggestion on how to
> >> resolve this.
> >
> >
> > This is a known bug in the Scala compiler.
> >
> > To fix it, do: mvn clean
> >
> >> java.lang.RuntimeException: malformed Scala signature of Loc at 5720;
> >> reference value common of package liftweb refers to nonexisting
> >> symbol.
> >>at
> >>
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)
> >>
> >> --
> >> Family photographs are a critical legacy for
> >> ourselves and our descendants. Protect that
> >> legacy with a digital backup and recovery plan.
> >>
> >> Join the photo preservation advocacy Facebook group:
> >> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Lift" group.
> >> To post to this group, send email to lift...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> liftweb+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/liftweb?hl=en.
> >>
> >
> >
> >
> > --
> > Lift, the simply functional web framework http://liftweb.net
> > Beginning Scala http://www.apress.com/book/view/1430219890
> > Follow me: http://twitter.com/dpp
> > Surf the harmonics
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/liftweb?hl=en.
> >
>
>
>
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread Jim Barrows
On Mon, Mar 1, 2010 at 7:19 AM, Jeppe Nejsum Madsen wrote:

> Hi,
>
> In the interest of cutting boilerplate from mapped objects, I would
> like to get the display name from a property file.
>

So your replacing code boilerplate with property file boilerplate?  The
boilerplate has to go somewhere, and abstracting things like this out
doesn't change that.  On the other hand, if you have to l10n your app, then
this works.

What about turning it off by default, and turned on in Boot though.  Also it
should probably use the existing method by default, rolling to the property
file if it's turned on and it's not provided.



>
> So I was thinking that it would be an idea to add a
> MapperRules.nameToDisplayName such as this
>
> var  nameToDisplayName: ( Mapper[_], String) = (_,name) => name
>

A department of redundancy department approved name? :) *LOL*

How about displayNameFromPropertyFile?  A little wordy, but it shouldn't
ever need to be typed except to be overridden.



>
> This would allow me to do things like nameToDisplayName = (m,name) =>
> S.?(m.getClass.getName+"."+name)
>
> Thoughts?
>
> /Jeppe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
James A Barrows

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] ByList using OR instead of IN?

2010-03-01 Thread David Pollak
It used to be IN and then someone asked that it be changed to the current OR
and they had a reasonable argument, so we changed it.

On Sun, Feb 28, 2010 at 11:17 PM, aw  wrote:

> From reading Exploring Lift (Section 6.1, page 81), it says that
> ByList corresponds to the “field IN (x,y,z)” syntax in SQL.
> Well, that was what I needed, so I took it for a test drive.  However,
> instead of seeing SQL like:  where some.id in (4, 9, 20)
> I am seeing SQL like:  where some.id = 4 or some.id = 9 or some.id =
> 20.
>
> I double checked the latest code:
>
> http://github.com/dpp/liftweb/blob/master/framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala
> and it looks like there isn't a magical workaround to get IN working
> as I expected.
>
> To me, this is a violation of SQL Tuning 101:  as a rule of thumb,
> prefer the IN clause over an OR clause.
>
> Is there a good reason why this code creates OR clauses instead of an
> IN clause?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread Donald McLean
I appreciate the response but I'm not using Maven, I'm using Ant. If
you could tell me what that would accomplish I could probably figure
out the equivalent.

Thank you,

Donald

On Mon, Mar 1, 2010 at 11:07 AM, David Pollak
 wrote:
>
>
> On Mon, Mar 1, 2010 at 8:03 AM, Donald McLean  wrote:
>>
>> I just updated to Lift 2.0m2 and Scala 2.7.7 and now I'm getting this
>> error message. I would greatly appreciate a suggestion on how to
>> resolve this.
>
>
> This is a known bug in the Scala compiler.
>
> To fix it, do: mvn clean
>
>> java.lang.RuntimeException: malformed Scala signature of Loc at 5720;
>> reference value common of package liftweb refers to nonexisting
>> symbol.
>>        at
>> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)
>>
>> --
>> Family photographs are a critical legacy for
>> ourselves and our descendants. Protect that
>> legacy with a digital backup and recovery plan.
>>
>> Join the photo preservation advocacy Facebook group:
>> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Compile error

2010-03-01 Thread David Pollak
On Mon, Mar 1, 2010 at 8:03 AM, Donald McLean  wrote:

> I just updated to Lift 2.0m2 and Scala 2.7.7 and now I'm getting this
> error message. I would greatly appreciate a suggestion on how to
> resolve this.
>


This is a known bug in the Scala compiler.

To fix it, do: mvn clean




>
> Donald
>
> java.lang.RuntimeException: malformed Scala signature of Loc at 5720;
> reference value common of package liftweb refers to nonexisting
> symbol.
>at
> scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)
>
> --
> Family photographs are a critical legacy for
> ourselves and our descendants. Protect that
> legacy with a digital backup and recovery plan.
>
> Join the photo preservation advocacy Facebook group:
> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Compile error

2010-03-01 Thread Donald McLean
I just updated to Lift 2.0m2 and Scala 2.7.7 and now I'm getting this
error message. I would greatly appreciate a suggestion on how to
resolve this.

Donald

java.lang.RuntimeException: malformed Scala signature of Loc at 5720;
reference value common of package liftweb refers to nonexisting
symbol.
at 
scala.tools.nsc.symtab.classfile.UnPickler$UnPickle.errorBadSignature(UnPickler.scala:762)

-- 
Family photographs are a critical legacy for
ourselves and our descendants. Protect that
legacy with a digital backup and recovery plan.

Join the photo preservation advocacy Facebook group:
http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: newbie question : get lift to actually run (AbstractMethodError)

2010-03-01 Thread Jeppe Nejsum Madsen
On Mon, Mar 1, 2010 at 4:35 PM, ojonam  wrote:
>
>
>> > - tried to create a lift blank app with 2.0-snapshot, adapting the
>> > archetype:generate command from the book as required
>>
>> Try to show the complete command. Or look in the ML for commands that
>> work with 2.0-SNAPSHOT
>
> So I tried two things
> - type mvn archetype:generate and then follow the command prompts to
> fill up the different properties (this didn't work)
>
> type in the following command directly (it works)
>
> mvn archetype:generate -U   -DarchetypeGroupId=net.liftweb   -
> DarchetypeArtifactId=lift-archetype-blank   -DarchetypeVersion=1.0   -
> DremoteRepositories=http://scala-tools.org/repo-releases   -
> DgroupId=demo.helloworld   -DartifactId=helloworld   -Dversion=2.0-
> SNAPSHOT

You have the wrong archetype version & repo. See here:

http://wiki.github.com/dpp/liftweb/about-maven-mini-guide

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: newbie question : get lift to actually run (AbstractMethodError)

2010-03-01 Thread David Pollak
If you set -darchetypeVersion to 1.0, then you'll get Lift 1.0 built on Scala 
2.7.3.  If you use 1.0.3 then you'll get the latest branch of Lift 1.0... built 
with Scala 2.7.7.  I strong recommend you use 2.0-M2 which is also built with 
2.7.7

Connected by MOTOBLUR™ on T-Mobile

-Original message-
From: ojonam 
To: Lift 
Sent: Mon, Mar 1, 2010 15:35:17 GMT+00:00
Subject: [Lift] Re: newbie question : get lift to actually run 
(AbstractMethodError)



> > - tried to create a lift blank app with 2.0-snapshot, adapting the
> > archetype:generate command from the book as required
>
> Try to show the complete command. Or look in the ML for commands that
> work with 2.0-SNAPSHOT

So I tried two things
- type mvn archetype:generate and then follow the command prompts to
fill up the different properties (this didn't work)

type in the following command directly (it works)

mvn archetype:generate -U   -DarchetypeGroupId=net.liftweb   -
DarchetypeArtifactId=lift-archetype-blank   -DarchetypeVersion=1.0   -
DremoteRepositories=http://scala-tools.org/repo-releases   -
DgroupId=demo.helloworld   -DartifactId=helloworld   -Dversion=2.0-
SNAPSHOT

This gives me a pom.xml with 2.7.3 (how do I by default get it to
2.7.7 instead of modifying it everytime) ?

> > - once that is done, I modify the version of scala in my pom.xml
> > - then I type 'mvn jetty:run'
> > - somehow maven still downloads *both* the 2.7.1 and 2.7.7 versions of
> > scala, and I get the warning that both of them exist
>
> This sounds bad

I went to my local .m2 folder, and removed all scala related folders
by hand. With the new command, I have versions 2.7.3 and 2.7.7 (still
doesn't solve the problem of multiple scala versions)


> You may have old code laying around. If code mysteriously fails, "mvn
> clean" is your friend. Try; mvn clean jetty:run

I actually removed the complete directory and redid everything.
Somehow, it seems to work now, but still doesn't explain why the first
type of command did not work.

> /Jeppe

Manohar

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: newbie question : get lift to actually run (AbstractMethodError)

2010-03-01 Thread ojonam


> > - tried to create a lift blank app with 2.0-snapshot, adapting the
> > archetype:generate command from the book as required
>
> Try to show the complete command. Or look in the ML for commands that
> work with 2.0-SNAPSHOT

So I tried two things
- type mvn archetype:generate and then follow the command prompts to
fill up the different properties (this didn't work)

type in the following command directly (it works)

mvn archetype:generate -U   -DarchetypeGroupId=net.liftweb   -
DarchetypeArtifactId=lift-archetype-blank   -DarchetypeVersion=1.0   -
DremoteRepositories=http://scala-tools.org/repo-releases   -
DgroupId=demo.helloworld   -DartifactId=helloworld   -Dversion=2.0-
SNAPSHOT

This gives me a pom.xml with 2.7.3 (how do I by default get it to
2.7.7 instead of modifying it everytime) ?

> > - once that is done, I modify the version of scala in my pom.xml
> > - then I type 'mvn jetty:run'
> > - somehow maven still downloads *both* the 2.7.1 and 2.7.7 versions of
> > scala, and I get the warning that both of them exist
>
> This sounds bad

I went to my local .m2 folder, and removed all scala related folders
by hand. With the new command, I have versions 2.7.3 and 2.7.7 (still
doesn't solve the problem of multiple scala versions)


> You may have old code laying around. If code mysteriously fails, "mvn
> clean" is your friend. Try; mvn clean jetty:run

I actually removed the complete directory and redid everything.
Somehow, it seems to work now, but still doesn't explain why the first
type of command did not work.

> /Jeppe

Manohar

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: About the url rewrite (more thant one params and get 404 not found error)

2010-03-01 Thread Neil.Lv

  I add these code in the Boot class, but it doesn't work.

  How can write the correct code to parse the url ?

#
object ParamsExtractor {
  def unapply(pp: ParsePath): Option[(String)] = {
Log.info("wholePath: " + pp.wholePath)
val path = List("test")
val result:Box[(String)] = if (pp.wholePath.startsWith(path) &&
pp.wholePath.length == (path.length + 2)) {
  val res = Full(("test2"))
Log.info("Decoded URL: %s=%s".format(pp, res))
res
} else None
Log.info("result: " + result)
result
  }
}

class Boot {
  def boot {
...
LiftRules.statelessRewrite.prepend {
 case RewriteRequest(ParamsExtractor(param) , _, _) =>
   RewriteResponse(List("test"), Map("param" -> param))
}
...
  }
}
#

  Thanks!~~

Cheers,
  Neil

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: Javascript Dependencies

2010-03-01 Thread Jeppe Nejsum Madsen
Marius  writes:

> Yes we do have different perspectives. I'm saying "for page X here
> these are the JS dependencies" whether you seem to say "here is a
> snippet, and it needs these dependencies"

Yes

> I'd still prefer my paradigm (not because of my ego) because it'd be
> easier to manage redundancies, it applies generically for snippets,
> comet actors etc. without having to induce other type of API. It is
> maybe coarse grained vs. your proposal that seems to me finner
> grained.

I think the two can co-exist, although I haven't thought it through wrt
comet actors etc. That was what I was hinting at in the previous
mail. At the of the day (or before sending a response at least :-) a
page needs to have a well-defined list of script files to include. 

So it makes sense to start with "your" paradigm and "my" paradigm should
be able to be layered on top if one wishes...

> However I'd be happy to see an implementation of any of these
> proposals. Maybe other people would have better ideas so perhaps Peter
> and/oryou could dig could make this happen?

I'll let Peter take the lead and help where ever I can :-)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] newbie question : get lift to actually run (AbstractMethodError)

2010-03-01 Thread Jeppe Nejsum Madsen
On Mon, Mar 1, 2010 at 3:39 PM, ojonam  wrote:
> Hello all,
>
> I am trying to launch a lift web app on my computer, but trying to use
> Snapshot 2.0 instead of 1.0 (which seems to have some problems with
> Scala 2.7.7).
>
> I have taken the following steps :
>
> - tried to create a lift blank app with 2.0-snapshot, adapting the
> archetype:generate command from the book as required

Try to show the complete command. Or look in the ML for commands that
work with 2.0-SNAPSHOT

> - once that is done, I modify the version of scala in my pom.xml
> - then I type 'mvn jetty:run'

> - somehow maven still downloads *both* the 2.7.1 and 2.7.7 versions of
> scala, and I get the warning that both of them exist

This sounds bad

> when trying to look at the webpage on localhost:8080, I am given the
> following error :
>
>  Request for / failed net.liftweb.http.SessionMaster$.mailbox_
> $eq(Lscala/actors/MessageQueue;)V
> java.lang.AbstractMethodError: net.liftweb.http.SessionMaster$.mailbox_
> $eq(Lscala/actors/MessageQueue;)V
>        at scala.actors.Actor$class.$init$(Actor.scala:370)
>        at net.liftweb.http.SessionMaster$.(LiftSession.scala:47)
>        at net.liftweb.http.SessionMaster$.(LiftSession.scala)
>        at net.liftweb.http.LiftSession.setSession(LiftSession.scala:138)
>        at net.liftweb.http.LiftSession$.createSession(LiftSession.scala:34)
>        at net.liftweb.http.LiftSession$$anonfun$1.apply(LiftSession.scala:
> 36)
>        at net.liftweb.http.LiftSession$$anonfun$1.apply(LiftSession.scala:
> 36)
>        at net.liftweb.http.LiftSession$.apply(LiftSession.scala:39)
>
>
> I have not posted the whole stacktrace, but will do so if necessary.
> Googling for this error gives me messages that are very old, and they
> don't apply to me.

You may have old code laying around. If code mysteriously fails, "mvn
clean" is your friend. Try; mvn clean jetty:run

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] newbie question : get lift to actually run (AbstractMethodError)

2010-03-01 Thread ojonam
Hello all,

I am trying to launch a lift web app on my computer, but trying to use
Snapshot 2.0 instead of 1.0 (which seems to have some problems with
Scala 2.7.7).

I have taken the following steps :

- tried to create a lift blank app with 2.0-snapshot, adapting the
archetype:generate command from the book as required
- once that is done, I modify the version of scala in my pom.xml
- then I type 'mvn jetty:run'
- somehow maven still downloads *both* the 2.7.1 and 2.7.7 versions of
scala, and I get the warning that both of them exist

when trying to look at the webpage on localhost:8080, I am given the
following error :

 Request for / failed net.liftweb.http.SessionMaster$.mailbox_
$eq(Lscala/actors/MessageQueue;)V
java.lang.AbstractMethodError: net.liftweb.http.SessionMaster$.mailbox_
$eq(Lscala/actors/MessageQueue;)V
at scala.actors.Actor$class.$init$(Actor.scala:370)
at net.liftweb.http.SessionMaster$.(LiftSession.scala:47)
at net.liftweb.http.SessionMaster$.(LiftSession.scala)
at net.liftweb.http.LiftSession.setSession(LiftSession.scala:138)
at net.liftweb.http.LiftSession$.createSession(LiftSession.scala:34)
at net.liftweb.http.LiftSession$$anonfun$1.apply(LiftSession.scala:
36)
at net.liftweb.http.LiftSession$$anonfun$1.apply(LiftSession.scala:
36)
at net.liftweb.http.LiftSession$.apply(LiftSession.scala:39)


I have not posted the whole stacktrace, but will do so if necessary.
Googling for this error gives me messages that are very old, and they
don't apply to me.

So how do I proceed ?

Best,
ojonam

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Javascript Dependencies

2010-03-01 Thread Marius
Yes we do have different perspectives. I'm saying "for page X here
these are the JS dependencies" whether you seem to say "here is a
snippet, and it needs these dependencies"

I'd still prefer my paradigm (not because of my ego) because it'd be
easier to manage redundancies, it applies generically for snippets,
comet actors etc. without having to induce other type of API. It is
maybe coarse grained vs. your proposal that seems to me finner
grained.

However I'd be happy to see an implementation of any of these
proposals. Maybe other people would have better ideas so perhaps Peter
and/oryou could dig could make this happen?

Br's,
Marius

On Mar 1, 2:45 pm, Jeppe Nejsum Madsen  wrote:
> Marius  writes:
>
> [...]
>
> > I'm not sure that doing this per snippet is the right approach.
>
> Maybe we differ in our thinking then :-) I'm thinking more in a
> component oriented approach where I would like to put a widget on a
> page. I'll just add the correct snippet tags to my page and don't want
> to worry about which js dependencies I need to include before the
> snippet works.
>
> > The reason I'd put it LiftRules is that it CAN use a dependency tree
> > per page ... after all, scripts are specified per page.
>
> Yeah, maybe some flexibility is needed and as usual it seems like a good
> idea to have the low level foundations in place first and build the
> higher level abstractions on top. If we have the function in LiftRules
> it should be possible to what I want by creating a smarter Req => Tree
> function.
>
> /Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] reload application.properties

2010-03-01 Thread Martin
Hi

is there any way to reload application.properties file after
boot.scala finishes? I would like to do dynamic localization of
properties on my site, without need to stop/start application.
Mayby there is  much better way to accomplish it.
I would really appreciate any help.

best regards,
Martin

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] MapperRules.nameToDisplayName?

2010-03-01 Thread Jeppe Nejsum Madsen
Hi,

In the interest of cutting boilerplate from mapped objects, I would
like to get the display name from a property file.

So I was thinking that it would be an idea to add a
MapperRules.nameToDisplayName such as this

var  nameToDisplayName: ( Mapper[_], String) = (_,name) => name

This would allow me to do things like nameToDisplayName = (m,name) =>
S.?(m.getClass.getName+"."+name)

Thoughts?

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Newbie Q: Lift suitable as webgui for java 6 app with embedded webserver and no database ?

2010-03-01 Thread Jeppe Nejsum Madsen
mortench  writes:

> Hi All,
>

[...]

> How suited would Lift be for this scenario or to be more precise:
> a) Is a lift web app as fast to startup as a normal jave jsp/servlet
> app ?

Depends mostly on your own code. If you have an empty Boot, startup is <
1s.

> b) Can lift be used without a database and can the relate code such as
> the OR mapped be omitted ?

Yes

> c) Any special considerations needed when starting and stopping an
> embedded lift web app ?

Dunno :-)

> d) What does lift require of the java web server ? I.e. can some of
> the more lightweight java web servers be used that might not support
> the full servlet/jsp specifications such as the embedded HTTP server
> in Java 6, Winstone, Grizzly etc.? ... What (light) java webservers
> are lift known to work with ?

You need a recent servlet implementation. JSP is not needed. I'm using
Jetty although not embedded, but Jetty seems like it should easily be
embedded. During development, I launch a small Scala app that starts
jetty (the RunWebApp class generated by the Lift archetype)

> e) What would the best way for the lift web app to communicate with
> the backend code of the java app ? By just calling into the existing
> java code (some integration/classloader issues here?) or more loosely
> by calling REST WS Api exposed by the Java code ?

Not sure what you envision here, but REST and loosely coupled should
work :-)

> f) I am using ANT and not maven to develop the java app. Will be able
> to make Lift work with ANT so I use the same build tool for
> everything?

Yes, but you're probably on your own

> g) What version of lift should I use ? In particular does Lift 2.0
> change anything for my scenario ?

You should use the latest 2.0-SNAPSHOT or milestone (M3 is just around
the corner)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: Javascript Dependencies

2010-03-01 Thread Jeppe Nejsum Madsen
Marius  writes:


[...]

> I'm not sure that doing this per snippet is the right approach.

Maybe we differ in our thinking then :-) I'm thinking more in a
component oriented approach where I would like to put a widget on a
page. I'll just add the correct snippet tags to my page and don't want
to worry about which js dependencies I need to include before the
snippet works.

> The reason I'd put it LiftRules is that it CAN use a dependency tree
> per page ... after all, scripts are specified per page.

Yeah, maybe some flexibility is needed and as usual it seems like a good
idea to have the low level foundations in place first and build the
higher level abstractions on top. If we have the function in LiftRules
it should be possible to what I want by creating a smarter Req => Tree
function.


/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Javascript Dependencies

2010-03-01 Thread Marius


On Mar 1, 1:50 pm, Jeppe Nejsum Madsen  wrote:
> Marius  writes:
> > Yes I believe this needs a bit more thinking. I didn;t spend too much
> > time into this but perhaps add a LiftRules function to describe the
> > dependency tree per page:
>
> > i.e.
>
> > var jsDependencies : (Req) => JsDependencyTree
>
> > where
>
> > case class JsDependencyTree (url: String, dependencies:
> > JsDependencyTree *) // not sure if we'd need more info
>
> > The head merge (and potentially tail merge as well) mechanism in Lift
> > would obtain the JsDependencyTree from LiftRules passing the Req
> > (hence you can have a different dependency tree per page, or per
> > application depending how you do pattern matching). Thus head merge
> > would arrange the scripts according to the dependency tree. If a
> > script is not in the dependency tree, it will just be appended to the
> > scripts "list".
>
> I can't help to think this is a bit too low level. I would hate to have
> to go in and modify LiftRules everytime I add/change something on a
> page. Or maybe I don't understand it correctly?
>
> The way I see it, we can have some named values that corresponds to files
> that need to be included (not sure about actual syntax), ie
>
> In snippet A:
>
> I need flot
>
> In snippet B:
>
> I need flot-piechart-plugin
>
> It seems fairly straight forward to compute a tree of dependencies
> (basically the JsDependencyTree) having the correct order depending on
> the above declarations:
>
> Process snippets in order and avoid duplicates:
>
> A needs Flot which needs Jquery -> [jquery, flot]
> B needs flot-piechart-plugin which needs flot which needs jquery ->
> [jquery, flot] ++ [jquery, flot, flot-piechart-plugin] =
> [jquery, flot, flot-piechart-plugin]

I'm not sure that doing this per snippet is the right approach. The
reason I'd put it LiftRules is that it CAN use a dependency tree per
page ... after all, scripts are specified per page.

>
> There will have to be some validations (circular dependencies etc), but
> this should be fixable
>
> > Adjacent features that I see:
>
> > 1. Detect if a dependency is missing
> > 2. Construct a suite of dependency trees for most used JQuery plugins
> > that people can easily re-use.
>
> That would be cool
>
> /Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Newbie Q: Lift suitable as webgui for java 6 app with embedded webserver and no database ?

2010-03-01 Thread mortench
Hi All,

I am considering if Lift might be a good solution for implementing a
web gui frontend for a java 6 application which among other things has
an embedded web server with HTTP/HTTPS support. When the application
is launced the webserver can be started so that the web gui can be
accessed using a browser by the user (incl. the capability to shutdown/
restart the app from the web gui). The application does not include a
database and saves it's state on the local disk itself.

Being familiar with RoR, I did try the scenario first using Rails
+Jruby and while it worked I had to abandon it as Rails boot turned
out the be too slow for the users (Rails boot took > 30s). Also the
Rails JRuby/integration was tricky and I had to do considerable coding
to support consistent, MT-safe start/shutdown/cancel, reporting boot
progress, error handling etc. So NO, Rails was not a good idea here!

How suited would Lift be for this scenario or to be more precise:
a) Is a lift web app as fast to startup as a normal jave jsp/servlet
app ?
b) Can lift be used without a database and can the relate code such as
the OR mapped be omitted ?
c) Any special considerations needed when starting and stopping an
embedded lift web app ?
d) What does lift require of the java web server ? I.e. can some of
the more lightweight java web servers be used that might not support
the full servlet/jsp specifications such as the embedded HTTP server
in Java 6, Winstone, Grizzly etc.? ... What (light) java webservers
are lift known to work with ?
e) What would the best way for the lift web app to communicate with
the backend code of the java app ? By just calling into the existing
java code (some integration/classloader issues here?) or more loosely
by calling REST WS Api exposed by the Java code ?
f) I am using ANT and not maven to develop the java app. Will be able
to make Lift work with ANT so I use the same build tool for
everything?
g) What version of lift should I use ? In particular does Lift 2.0
change anything for my scenario ?

Thanks
Morten

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: Javascript Dependencies

2010-03-01 Thread Jeppe Nejsum Madsen
Marius  writes:

> Yes I believe this needs a bit more thinking. I didn;t spend too much
> time into this but perhaps add a LiftRules function to describe the
> dependency tree per page:
>
> i.e.
>
> var jsDependencies : (Req) => JsDependencyTree
>
> where
>
> case class JsDependencyTree (url: String, dependencies:
> JsDependencyTree *) // not sure if we'd need more info
>
> The head merge (and potentially tail merge as well) mechanism in Lift
> would obtain the JsDependencyTree from LiftRules passing the Req
> (hence you can have a different dependency tree per page, or per
> application depending how you do pattern matching). Thus head merge
> would arrange the scripts according to the dependency tree. If a
> script is not in the dependency tree, it will just be appended to the
> scripts "list". 

I can't help to think this is a bit too low level. I would hate to have
to go in and modify LiftRules everytime I add/change something on a
page. Or maybe I don't understand it correctly?

The way I see it, we can have some named values that corresponds to files
that need to be included (not sure about actual syntax), ie

In snippet A:

I need flot

In snippet B:

I need flot-piechart-plugin

It seems fairly straight forward to compute a tree of dependencies
(basically the JsDependencyTree) having the correct order depending on
the above declarations:

Process snippets in order and avoid duplicates:

A needs Flot which needs Jquery -> [jquery, flot]
B needs flot-piechart-plugin which needs flot which needs jquery ->
[jquery, flot] ++ [jquery, flot, flot-piechart-plugin] =
[jquery, flot, flot-piechart-plugin]

There will have to be some validations (circular dependencies etc), but
this should be fixable

> Adjacent features that I see:
>
> 1. Detect if a dependency is missing
> 2. Construct a suite of dependency trees for most used JQuery plugins
> that people can easily re-use.

That would be cool

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: Javascript Dependencies

2010-03-01 Thread Marius
Yes I believe this needs a bit more thinking. I didn;t spend too much
time into this but perhaps add a LiftRules function to describe the
dependency tree per page:

i.e.

var jsDependencies : (Req) => JsDependencyTree

where

case class JsDependencyTree (url: String, dependencies:
JsDependencyTree *) // not sure if we'd need more info

The head merge (and potentially tail merge as well) mechanism in Lift
would obtain the JsDependencyTree from LiftRules passing the Req
(hence you can have a different dependency tree per page, or per
application depending how you do pattern matching). Thus head merge
would arrange the scripts according to the dependency tree. If a
script is not in the dependency tree, it will just be appended to the
scripts "list". Adjacent features that I see:

1. Detect if a dependency is missing
2. Construct a suite of dependency trees for most used JQuery plugins
that people can easily re-use.

Br's,
Marius

On Mar 1, 1:54 am, Peter Robinett  wrote:
> Issue 281 is not going to make it into M3. The specific issue that
> needs to be solved first is how to manage dependencies across multiple
> snippets on one page. See the Assembla page for more 
> information:http://www.assembla.com/spaces/liftweb/tickets/281
>
> Peter
>
> On Feb 26, 5:14 pm, Peter Robinett  wrote:
>
>
>
> > Mads, thanks for bringing ticket 281 to my attention, I'll address it
> > in my patch.
>
> > Jeppe, that's how I plan on using it with Flot: having Flot.init
> > register the plugins and in the charts call toHTML as needed.
>
> > Should have everything up on my pr1001_issue_322 branch by tomorrow.
>
> > Peter
>
> > On Feb 25, 1:14 am, Jeppe Nejsum Madsen  wrote:
>
> > > Peter Robinett  writes:
> > > > Hi all,
>
> > > [...]
>
> > > > // Usage in boot.scala
> > > > val myJsScript = new JsScript("flot" :: "jquery.flot.selectable.js" ::
> > > > Nil)
> > > > ResourceServer.allow(myJsScript.allowResource)
>
> > > > // Usage in a normal snippet
> > > > def mySnippet = {
> > > >    
> > > >            { myJsScript.toHTML }
> > > >    
> > > >    
> > > >            The rest of the snippet...
> > > >    
> > > > }
>
> > > > // Usage in a CometActor
> > > > class myActor extends CometActor with JsScriptDependency {
> > > >    override def scripts = List(new JsScript("flot" ::
> > > > "jquery.flot.selectable.js" :: Nil));
> > > > }
>
> > > > What do you think? It's a really quite basic but I think such an
> > > > approach could work well for things like as lift-flot.
>
> > > It might be a start :-) I'm a little unsure if it supports the use case
> > > I would like to see:
>
> > > I'm using jqPlot (a flot-like lib) and would like to, in boot, just
> > > initialize the widget:
>
> > > jqPlot.init
>
> > > jqPlot comes with numerous plugins and this should be handled by the
> > > widget. Whether a plugin is loaded on a page depends on some higher
> > > level structure. Ie. if I wish to draw a pie chart, the pie chart plugin
> > > should be loaded.
>
> > > Looking back at this, it seems like this could work with the above
>
> > > In init: register all plugins
> > > In the specific charts, call toHtml on the plugins needed
>
> > > /Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] snakify and abbreviations

2010-03-01 Thread Jeppe Nejsum Madsen
Hi,

Eager to use the new Mapper support for snake_case I discovered that
the snakify method doesn' handle abbreviations well:

StringHelpers.snakify("HTML")
res5: java.lang.String = h_t_m_l

StringHelpers.snakify("HTMLEditor")
res6: java.lang.String = h_t_m_l_editor

I would expect those to be html and html_editor respectively...

What do people think?

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] New logging code is in master

2010-03-01 Thread Jeppe Nejsum Madsen
On Mon, Mar 1, 2010 at 12:20 AM, David Pollak
 wrote:
> Excellent!
>
> We have the deprecations turned off in the pom.xml file by default... but
> gotta turn the deprecation warnings on post M3.

Not sure what this means? Do the generated jars on scala-tools not
contain deprecation info or does the compilation of Lift itself not
show deprecation warnings?

If the former, this would explain what I see. If the latter, I added

  

  -deprecation

  

to my own pom and would expect this to show the warnings

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: About the url rewrite (more thant one params and get 404 not found error)

2010-03-01 Thread Neil.Lv


On Mar 1, 5:10 pm, Jeppe Nejsum Madsen  wrote:
> Ahh yes, the example was from a Loc rewrite, The principle is the same I
> guess, you should be able to do something like this:
>
> case RewriteRequest(ParamsExtractor(account,orgUnit) , _, _) =>
>   RewriteResponse(path, Map("account" -> account, "orgUnit" -> orgUnit))
>
> The important part is the extractor which takes care of parsing the
> request into meaningful values...
>
> /Jeppe

  Got it, thanks for your reply.

  I'll  try it later.

  :)

Cheers,
  Neil

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: About the url rewrite (more thant one params and get 404 not found error)

2010-03-01 Thread Jeppe Nejsum Madsen
"Neil.Lv"  writes:

> On Mar 1, 3:53 pm, Jeppe Nejsum Madsen  wrote:
>>
>> I'm not sure if this can be handled with the standard ParsePath, but it
>> is fairly easy to write your own extractor that can handle more complex
>> scenarios. Here's an example:
>>
>> object ParamsExtractor {
>>   def unapply(pp:ParsePath): Option[(Account, OrgUnit)] = {
>> val result:Box[(Account, OrgUnit)] = if 
>> (pp.wholePath.startsWith(path) && pp.wholePath.length == (path.length + 2)) {
>>   val res = Full((XX,YY))
>>   debug("Decoded URL: %s=%s".format(pp,res))
>>   res
>>   }
>> else
>>   None
>> result
>>   }
>> }
>> used like this:
>>
>> case RewriteRequest(ParamsExtractor(account,orgUnit) , _, _) =>
>> (RewriteResponse(path), Full(account, orgUnit))
>
>   I have some question about these code that i don't understand.
>
>   The first one that contains the Map() in the RewriteResponse() .
>-->
>case RewriteRequest() => RewriteResponse()
>
>   but the second one that doesn't contain the Map in the
> RewriteResponse(),
>   what's the mean of the Full(account, orgUnit) in the
> ( RewriteResponse(path), Full(account, orgUnit) )
>-->
>case RewriteRequest() => ( RewriteResponse(), Full() )


Ahh yes, the example was from a Loc rewrite, The principle is the same I
guess, you should be able to do something like this:

case RewriteRequest(ParamsExtractor(account,orgUnit) , _, _) =>
  RewriteResponse(path, Map("account" -> account, "orgUnit" -> orgUnit))

The important part is the extractor which takes care of parsing the
request into meaningful values...

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: About the url rewrite (more thant one params and get 404 not found error)

2010-03-01 Thread Neil.Lv


On Mar 1, 3:53 pm, Jeppe Nejsum Madsen  wrote:
>
> I'm not sure if this can be handled with the standard ParsePath, but it
> is fairly easy to write your own extractor that can handle more complex
> scenarios. Here's an example:
>
> object ParamsExtractor {
>   def unapply(pp:ParsePath): Option[(Account, OrgUnit)] = {
> val result:Box[(Account, OrgUnit)] = if 
> (pp.wholePath.startsWith(path) && pp.wholePath.length == (path.length + 2)) {
>   val res = Full((XX,YY))
>   debug("Decoded URL: %s=%s".format(pp,res))
>   res
>   }
> else
>   None
> result
>   }
> }
> used like this:
>
> case RewriteRequest(ParamsExtractor(account,orgUnit) , _, _) =>
> (RewriteResponse(path), Full(account, orgUnit))

  I have some question about these code that i don't understand.

  The first one that contains the Map() in the RewriteResponse() .
   -->
   case RewriteRequest() => RewriteResponse()

  but the second one that doesn't contain the Map in the
RewriteResponse(),
  what's the mean of the Full(account, orgUnit) in the
( RewriteResponse(path), Full(account, orgUnit) )
   -->
   case RewriteRequest() => ( RewriteResponse(), Full() )

###

  case RewriteRequest(
  ParsePath(List("show", "img", version, id), _, _,_), _, _) =>
RewriteResponse(List("show", "img"),
  Map("version" -> version, "id" -> id)
)


  case RewriteRequest(
  ParamsExtractor(account,orgUnit) , _, _) =>
( RewriteResponse(path), Full(account, orgUnit) )
###

Thank you very much.

Cheers,
  Neil

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.