Re: [Lift] scala eclipse plugin with lift

2009-11-17 Thread Francois Armand
Oscar Picasso a écrit :
> Hi,
> 
> I did import a new created lift project in a eclipse as a maven project.
> The project is recognized as a scala project but there is neither syntax 
> syntax highlighting nor auto completion while it works fine, in the same 
> workspace when I create directly a scala project with the scala eclipse 
> plugin.


What plugin version are you using ? There is a 2.7 version of the plugin 
that has to be used with Lift. This version is notoriously buggy, slow 
and not maintained.

The new Eclipse plugin version, which only target Scala 2.8, is far far 
better (and is become better days after days). It is not production 
ready yet (compared to say the Java editor of Eclipse), but I begin to 
think that it will be good (from usable today) in a near future.

This version work nicely with Lift 2.8 port - thanks for that branch 
Lift commiters !

-- 
Francois Armand
http://fanf42.blogspot.com

--

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=.




Re: [Lift] odd ajax issue (works every other time)

2009-11-17 Thread David Pollak
I am able to reproduce the problem with a simple Ajax control.

It's very, very odd.  It seems to be an intermittent failure of the servlet
container to find the HttpServletSession.  The client is presenting the
cookie correctly, but Jetty is not recognizing it.

On Tue, Nov 17, 2009 at 4:10 PM, Kris Nuttycombe
wrote:

> I am able to duplicate this error. I was concerned that it might be
> the result of my Loc changes, so I just rebuilt Lift without the
> patches associated with that change and reproduced the problem again.
>
> Here are the conditions under which I'm able to reproduce the failure:
>
> 1) load a page where the snippets are managed by a StatefulSnippet
> 2) some page elements (in my case select boxes) have their values
> update by AJAX in response to user events. This appears to work
> normally.
> 3) upon submission of the form on the page, the page is re-rendered.
> Logging in the submission function indicates that it is never called.
> 4) if I fill in the form again and resubmit after the initial failure,
> the form submit behaves properly.
> 5) I believe I've seen at least one instance (though I can't reliably
> reproduce this) where just a normal AJAX call (modifying one of the
> select boxes) caused the entire page to reload.
>
> Kris
>
> Kris
>
> On Tue, Nov 17, 2009 at 4:07 PM, O'Rorke Paul  wrote:
> > Not in a place where I can really debug this right now but I'm curious
> > whether anybody else has seen this and knows the solution...
> >
> > since rebuilding a day or two ago with no recent code or other changes:
> > every second time I go to click on an ajax checkbox or select widget,
> > I get effectively no response.
> > actually, it looks like there is a very quick spinning wheel (almost
> > imperceptible) but the page doesn't  get  repainted and the database
> > does not change.
> > If  I use another operation that is non ajax (going in and editing an
> > item and doing old fashioned get / posts) everything works fine after
> > that (one time).
> > Or if I reload the page then if I use an ajax widget after reloading
> > ajax works (once).
> >
> > This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.
> >
> > Perhaps not coincidentally, I am getting "Multiple versions of scala
> > libraries detected!" warnings and have not yet figured out how to get
> > rid of them.
> > I don't see another version of Scala in my pom or eclipse maven
> > dependency graph and have been going around nuking old copies of scala
> > but to no avail as yet.
> >
> > Another odd thing that is now happening is that when I shutdown with a
> > control C in the terminal window, I get the following error:
> >
> >> INFO - Service request (GET) /ajax_request/liftAjax.js took 2
> >> Milliseconds
> >> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
> >> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
> >> [INFO] Jetty server exiting.
> >> [INFO]
> >> 
> >> [INFO] BUILD SUCCESSFUL
> >> [INFO]
> >> 
> >> [INFO] Total time: 33 minutes 4 seconds
> >> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
> >> [INFO] Final Memory: 23M/257M
> >> [INFO]
> >> 
> >> ERROR - Couldn't start SessionMaster ping
> >> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
> >> $checkandpur...@1cab4a5 could not be scheduled on
> >> net.liftweb.http.sessionmast...@119c2af
> >>   at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
> >>   at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
> >> $doPing(LiftSession.scala:187)
> >>   at net.liftweb.http.SessionMaster$$anonfun$1.apply
> >> (LiftSession.scala:169)
> >>   at net.liftweb.http.SessionMaster$$anonfun$1.apply
> >> (LiftSession.scala:135)
> >>   at
> net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:
> >> 247)
> >>   at
> net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:
> >> 91)
> >>   at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor
> >> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
> >>   at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
> >> $1.apply(LiftActor.scala:109)
> >>   at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
> >> $1.apply(LiftActor.scala:109)
> >>   at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run
> >> (LiftActor.scala:37)
> >>   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> >> (ThreadPoolExecutor.java:886)
> >>   at java.util.concurrent.ThreadPoolExecutor$Worker.run
> >> (ThreadPoolExecutor.java:908)
> >>   at java.lang.Thread.run(Thread.java:637)
> >> Caused by: java.util.concurrent.RejectedExecutionException
> >>   at java.util.concurrent.ThreadPoolExecutor
> >> $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:17

[Lift] Re: Call it Lift 2.0

2009-11-17 Thread Joni Freeman
On 18 marras, 01:10, David Pollak 
wrote:
> I'd like to see the JSON stuff moved from Option to Box, but that's Joni's
> call.

Hi,

I do not agree. We have quite a lot of lift-json users who do not yet
use other parts of Lift, and Box is not a familiar construct outside
of Lift. I really like to keep it that way. But could lift REST APIs
wrap the lib to provide more Liftesque API?

Cheers Joni

--

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=.




[Lift] Re: scala eclipse plugin with lift

2009-11-17 Thread jon
I share Chris's sentiment.  The 2.7.x eclipse plugin has been unusably
unstable in my experience.

My current dev setup: text editor with syntax highlighting and two
terminals running sbt
term one: sbt, then ~prepare-webapp (continuous compilation and
deployment)
term two: sbt-rebel jetty (start jetty and dynamically reload classes
with java rebel)

my sbt-rebel script looks like:

java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -noverify -
javaagent:/path/to/jrebel.jar -Xmx512m -jar ~/bin/sbt-launcher.jar
"$@"

get sbt: http://code.google.com/p/simple-build-tool/wiki/Setup
create project: 
http://code.google.com/p/simple-build-tool/wiki/WebApplicationExample
get your free javarebel license here: 
http://www.zeroturnaround.com/scala-license/

- Jon

On Nov 17, 10:53 pm, Chris Lewis  wrote:
> I can't say I enjoy eclipse for scala code, but did you make sure your
> project has the Scala Nature?
>
>
>
> Oscar Picasso wrote:
> > Hi,
>
> > I did import a new created lift project in a eclipse as a maven project.
> > The project is recognized as a scala project but there is neither syntax
> > syntax highlighting nor auto completion while it works fine, in the same
> > workspace when I create directly a scala project with the scala eclipse
> > plugin.
>
> > Any idea?
>
> > --
>
> > 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=.

--

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=.




Re: [Lift] XML Parsing Error: prefix not bound to a namespace

2009-11-17 Thread Ross Mellgren
You forgot to quote "branches" before -> in your bind. That is,

>bind("e",xhtml,
> branches -> SHtml.text(branches,branches=_)
> 
>)

Should be:

>bind("e",xhtml,
> "branches" -> SHtml.text(branches,branches=_)
> 
>)

As it is, the only tag that would be accepted would be "" (the empty string)

-Ross


On Nov 17, 2009, at 11:46 PM, mr najmi wrote:

> hai,
> 
> i have a problem in liftweb that is XML Parsing Error: prefix not
> bound to a namespace..
> Branch : 
> ^
> here is the code
> 
> 
>
>
>Branch : 
> 
>Search
>
>
> 
> class Appointment {
> 
>def search(xhtml:NodeSeq):NodeSeq={
>var branches = ""
> 
>bind("e",xhtml,
> branches -> SHtml.text(branches,branches=_)
> 
>)
>}
> }
> 
> 
> i have try all the sugested solution but fail to solve this problem..i
> really2 need help.
> 
> --
> 
> 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=.
> 
> 

--

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=.




[Lift] XML Parsing Error: prefix not bound to a namespace

2009-11-17 Thread mr najmi
hai,

i have a problem in liftweb that is XML Parsing Error: prefix not
bound to a namespace..
Branch : 
^
here is the code




Branch : 

Search



class Appointment {

def search(xhtml:NodeSeq):NodeSeq={
var branches = ""

bind("e",xhtml,
 branches -> SHtml.text(branches,branches=_)

)
}
}


i have try all the sugested solution but fail to solve this problem..i
really2 need help.

--

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=.




Re: [Lift] odd ajax issue (works every other time)

2009-11-17 Thread Kris Nuttycombe
I've looked a bit and will give it another couple of hours tonight or
in the morning. If you have any ideas of places to start looking
please let me know.

Kris

On Tue, Nov 17, 2009 at 5:13 PM, David Pollak
 wrote:
>
>
> On Tue, Nov 17, 2009 at 4:12 PM, Kris Nuttycombe 
> wrote:
>>
>> Added as ticket #198
>
> Tnx.
>
> Do you want to work it or should I (unless I hear from anyone else)
>
>>
>> Kris
>>
>> On Tue, Nov 17, 2009 at 5:10 PM, Kris Nuttycombe
>>  wrote:
>> > I am able to duplicate this error. I was concerned that it might be
>> > the result of my Loc changes, so I just rebuilt Lift without the
>> > patches associated with that change and reproduced the problem again.
>> >
>> > Here are the conditions under which I'm able to reproduce the failure:
>> >
>> > 1) load a page where the snippets are managed by a StatefulSnippet
>> > 2) some page elements (in my case select boxes) have their values
>> > update by AJAX in response to user events. This appears to work
>> > normally.
>> > 3) upon submission of the form on the page, the page is re-rendered.
>> > Logging in the submission function indicates that it is never called.
>> > 4) if I fill in the form again and resubmit after the initial failure,
>> > the form submit behaves properly.
>> > 5) I believe I've seen at least one instance (though I can't reliably
>> > reproduce this) where just a normal AJAX call (modifying one of the
>> > select boxes) caused the entire page to reload.
>> >
>> > Kris
>> >
>> > Kris
>> >
>> > On Tue, Nov 17, 2009 at 4:07 PM, O'Rorke Paul  wrote:
>> >> Not in a place where I can really debug this right now but I'm curious
>> >> whether anybody else has seen this and knows the solution...
>> >>
>> >> since rebuilding a day or two ago with no recent code or other changes:
>> >> every second time I go to click on an ajax checkbox or select widget,
>> >> I get effectively no response.
>> >> actually, it looks like there is a very quick spinning wheel (almost
>> >> imperceptible) but the page doesn't  get  repainted and the database
>> >> does not change.
>> >> If  I use another operation that is non ajax (going in and editing an
>> >> item and doing old fashioned get / posts) everything works fine after
>> >> that (one time).
>> >> Or if I reload the page then if I use an ajax widget after reloading
>> >> ajax works (once).
>> >>
>> >> This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.
>> >>
>> >> Perhaps not coincidentally, I am getting "Multiple versions of scala
>> >> libraries detected!" warnings and have not yet figured out how to get
>> >> rid of them.
>> >> I don't see another version of Scala in my pom or eclipse maven
>> >> dependency graph and have been going around nuking old copies of scala
>> >> but to no avail as yet.
>> >>
>> >> Another odd thing that is now happening is that when I shutdown with a
>> >> control C in the terminal window, I get the following error:
>> >>
>> >>> INFO - Service request (GET) /ajax_request/liftAjax.js took 2
>> >>> Milliseconds
>> >>> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
>> >>> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
>> >>> [INFO] Jetty server exiting.
>> >>> [INFO]
>> >>>
>> >>> 
>> >>> [INFO] BUILD SUCCESSFUL
>> >>> [INFO]
>> >>>
>> >>> 
>> >>> [INFO] Total time: 33 minutes 4 seconds
>> >>> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
>> >>> [INFO] Final Memory: 23M/257M
>> >>> [INFO]
>> >>>
>> >>> 
>> >>> ERROR - Couldn't start SessionMaster ping
>> >>> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
>> >>> $checkandpur...@1cab4a5 could not be scheduled on
>> >>> net.liftweb.http.sessionmast...@119c2af
>> >>>       at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
>> >>>       at
>> >>> net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
>> >>> $doPing(LiftSession.scala:187)
>> >>>       at net.liftweb.http.SessionMaster$$anonfun$1.apply
>> >>> (LiftSession.scala:169)
>> >>>       at net.liftweb.http.SessionMaster$$anonfun$1.apply
>> >>> (LiftSession.scala:135)
>> >>>       at
>> >>> net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:
>> >>> 247)
>> >>>       at
>> >>> net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:
>> >>> 91)
>> >>>       at
>> >>> net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor
>> >>> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
>> >>>       at
>> >>> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>> >>> $1.apply(LiftActor.scala:109)
>> >>>       at
>> >>> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>> >>> $1.apply(LiftActor.scala:109)
>> >>>       at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run
>> >>> (LiftActor.scala:37)
>> >>>       at java.util.concurren

Re: [Lift] scala eclipse plugin with lift

2009-11-17 Thread Chris Lewis
I can't say I enjoy eclipse for scala code, but did you make sure your 
project has the Scala Nature?

Oscar Picasso wrote:
> Hi,
> 
> I did import a new created lift project in a eclipse as a maven project.
> The project is recognized as a scala project but there is neither syntax 
> syntax highlighting nor auto completion while it works fine, in the same 
> workspace when I create directly a scala project with the scala eclipse 
> plugin.
> 
> Any idea?
> 
> --
> 
> 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=.

--

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=.




[Lift] Re: RequestVar doesn't work in the Lift1.1-SNAPSHOT ?

2009-11-17 Thread Neil.Lv

   I didn't add this code before.

   Now the jars can be download.

   Thank you very much!

Cheers,
  Neil

On Nov 18, 10:41 am, Ross Mellgren  wrote:
> 1.1-SNAPSHOT is in the scala-tools snapshots repo. Do you have this in your 
> pom.xml?
>
> 
> scala-tools.org.snapshots
> Scala-Tools Maven2 Repository for Snapshots
> http://scala-tools.org/repo-snapshots
> 
> 
>
> On Nov 17, 2009, at 9:32 PM, Neil.Lv wrote:
>
>
>
> >  When i delete all the repository file, then use "mvn jetty:run",
> > this information will be shown.
>
> >  It doesn't find the webkit jar file, when i can download it manually
> > so that i can use the mvn install:install-file
> > to install it.
>
> >  I use the 1.1-SNAPSHOT to develop the app not 1.1-M7.
>
> >  I see the (http://scala-tools.org/repo-releases) website that the
> > 1.1-SNAPSHOT doesn't exist ?
>
> > ##
> > Missing:
> > --
> > 1) net.liftweb:lift-webkit:jar:1.1-SNAPSHOT
>
> >  Try downloading the file manually from the project website.
>
> >  Then, install it using the command:
> >  mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
> > webkit -D
> > version=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
>
> >  Alternatively, if you host your own repository you can deploy the
> > file there:
>
> >  mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
> > webkit -Dve
> > rsion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
> > Drepository
> > Id=[id]
>
> >  Path to dependency:
> >1) demo.helloworld:helloworld:war:1.0-SNAPSHOT
> >2) net.liftweb:lift-webkit:jar:1.1-SNAPSHOT
>
> > 2) net.liftweb:lift-mapper:jar:1.1-SNAPSHOT
>
> >  Try downloading the file manually from the project website.
>
> >  Then, install it using the command:
> >  mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
> > mapper -D
> > version=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
>
> >  Alternatively, if you host your own repository you can deploy the
> > file there:
>
> >  mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
> > mapper -Dve
> > rsion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
> > Drepository
> > Id=[id]
>
> >  Path to dependency:
> >1) demo.helloworld:helloworld:war:1.0-SNAPSHOT
> >2) net.liftweb:lift-mapper:jar:1.1-SNAPSHOT
>
> > --
> > 2 required artifacts are missing.
>
> > for artifact:
> >  demo.helloworld:helloworld:war:1.0-SNAPSHOT
>
> > from the specified remote repositories:
> >  central (http://repo1.maven.org/maven2),
> >  scala-tools.org (http://scala-tools.org/repo-releases)
>
> > ##
>
> > Cheers,
> >  Neil
>
> > On Nov 18, 9:34 am, "Neil.Lv"  wrote:
> >>   It doesn't work too.
>
> >>   The error message is the same as before :
> >> ###
> >> object creation impossible, since method testWasSet in trait
> >> AnyVarTrait of type (String)Boolean is not defined
> >>  object currentItemVar extends RequestVar[Item]({
> >> ###
>
> >>  What is the testWasSet in trait AnyVarTrait  ... ?
>
> >>  I use the RequestVar to save the item that will be edited in the
> >> edit page.
>
> >> Cheers,
> >>  Neil
>
> >> On Nov 18, 12:42 am, David Pollak 
> >> wrote:
>
> >>> On Tue, Nov 17, 2009 at 8:23 AM, Neil.Lv  wrote:
>  Hi all,
>
>  The RequestVar doesn't work in the Lift1.1-SNAPSHOT,
>
>   The error message is:
>  ###
>  object creation impossible, since method testWasSet in trait
>  AnyVarTrait of type (String)Boolean is not defined
>  object currentItemVar extends RequestVar[Item]({
>  ###
>
>  The code is :
>  ###
>  object currentItemVar extends RequestVar[Item]({
>    Item.getItemById(S.param("id").toString.toLong)
>  })
>  ###
>
>  When updating the lift1.1's jars file, this code is broken.
>
>  Any help must be appreciated!
>
> >>> Please do a "mvn -U clean install"
>
>  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=.
>
> >>> --
> >>> 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 
> > athttp://groups.google.com/group/liftweb?hl=.

--

You received this message because you are subscr

Re: [Lift] scala eclipse plugin with lift

2009-11-17 Thread David Pollak
Hey Oscar,

Welcome back to Lift-land... haven't seen you in almost two years.

Thanks,

David

On Tue, Nov 17, 2009 at 6:56 PM, Oscar Picasso wrote:

> Hi,
>
> I did import a new created lift project in a eclipse as a maven project.
> The project is recognized as a scala project but there is neither syntax
> syntax highlighting nor auto completion while it works fine, in the same
> workspace when I create directly a scala project with the scala eclipse
> plugin.
>
> Any idea?
>
> --
> 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=.
>



-- 
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=.




[Lift] scala eclipse plugin with lift

2009-11-17 Thread Oscar Picasso
Hi,

I did import a new created lift project in a eclipse as a maven project.
The project is recognized as a scala project but there is neither syntax
syntax highlighting nor auto completion while it works fine, in the same
workspace when I create directly a scala project with the scala eclipse
plugin.

Any idea?

--

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=.




Re: [Lift] Re: RequestVar doesn't work in the Lift1.1-SNAPSHOT ?

2009-11-17 Thread Ross Mellgren
1.1-SNAPSHOT is in the scala-tools snapshots repo. Do you have this in your 
pom.xml?


scala-tools.org.snapshots
Scala-Tools Maven2 Repository for Snapshots
http://scala-tools.org/repo-snapshots




On Nov 17, 2009, at 9:32 PM, Neil.Lv wrote:

> 
>  When i delete all the repository file, then use "mvn jetty:run",
> this information will be shown.
> 
>  It doesn't find the webkit jar file, when i can download it manually
> so that i can use the mvn install:install-file
> to install it.
> 
>  I use the 1.1-SNAPSHOT to develop the app not 1.1-M7.
> 
>  I see the (http://scala-tools.org/repo-releases) website that the
> 1.1-SNAPSHOT doesn't exist ?
> 
> ##
> Missing:
> --
> 1) net.liftweb:lift-webkit:jar:1.1-SNAPSHOT
> 
>  Try downloading the file manually from the project website.
> 
>  Then, install it using the command:
>  mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
> webkit -D
> version=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
> 
>  Alternatively, if you host your own repository you can deploy the
> file there:
> 
>  mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
> webkit -Dve
> rsion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
> Drepository
> Id=[id]
> 
>  Path to dependency:
>1) demo.helloworld:helloworld:war:1.0-SNAPSHOT
>2) net.liftweb:lift-webkit:jar:1.1-SNAPSHOT
> 
> 2) net.liftweb:lift-mapper:jar:1.1-SNAPSHOT
> 
>  Try downloading the file manually from the project website.
> 
>  Then, install it using the command:
>  mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
> mapper -D
> version=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
> 
>  Alternatively, if you host your own repository you can deploy the
> file there:
> 
>  mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
> mapper -Dve
> rsion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
> Drepository
> Id=[id]
> 
>  Path to dependency:
>1) demo.helloworld:helloworld:war:1.0-SNAPSHOT
>2) net.liftweb:lift-mapper:jar:1.1-SNAPSHOT
> 
> --
> 2 required artifacts are missing.
> 
> for artifact:
>  demo.helloworld:helloworld:war:1.0-SNAPSHOT
> 
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2),
>  scala-tools.org (http://scala-tools.org/repo-releases)
> 
> ##
> 
> 
> Cheers,
>  Neil
> 
> 
> On Nov 18, 9:34 am, "Neil.Lv"  wrote:
>>   It doesn't work too.
>> 
>>   The error message is the same as before :
>> ###
>> object creation impossible, since method testWasSet in trait
>> AnyVarTrait of type (String)Boolean is not defined
>>  object currentItemVar extends RequestVar[Item]({
>> ###
>> 
>>  What is the testWasSet in trait AnyVarTrait  ... ?
>> 
>>  I use the RequestVar to save the item that will be edited in the
>> edit page.
>> 
>> Cheers,
>>  Neil
>> 
>> On Nov 18, 12:42 am, David Pollak 
>> wrote:
>> 
>>> On Tue, Nov 17, 2009 at 8:23 AM, Neil.Lv  wrote:
 Hi all,
>> 
 The RequestVar doesn't work in the Lift1.1-SNAPSHOT,
>> 
  The error message is:
 ###
 object creation impossible, since method testWasSet in trait
 AnyVarTrait of type (String)Boolean is not defined
 object currentItemVar extends RequestVar[Item]({
 ###
>> 
 The code is :
 ###
 object currentItemVar extends RequestVar[Item]({
   Item.getItemById(S.param("id").toString.toLong)
 })
 ###
>> 
 When updating the lift1.1's jars file, this code is broken.
>> 
 Any help must be appreciated!
>> 
>>> Please do a "mvn -U clean install"
>> 
 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=.
>> 
>>> --
>>> 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=.
> 
> 

--

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=.




[Lift] Re: RequestVar doesn't work in the Lift1.1-SNAPSHOT ?

2009-11-17 Thread Neil.Lv

  When i delete all the repository file, then use "mvn jetty:run",
this information will be shown.

  It doesn't find the webkit jar file, when i can download it manually
so that i can use the mvn install:install-file
to install it.

  I use the 1.1-SNAPSHOT to develop the app not 1.1-M7.

  I see the (http://scala-tools.org/repo-releases) website that the
1.1-SNAPSHOT doesn't exist ?

##
Missing:
--
1) net.liftweb:lift-webkit:jar:1.1-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
webkit -D
version=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the
file there:

  mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
webkit -Dve
rsion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
Drepository
Id=[id]

  Path to dependency:
1) demo.helloworld:helloworld:war:1.0-SNAPSHOT
2) net.liftweb:lift-webkit:jar:1.1-SNAPSHOT

2) net.liftweb:lift-mapper:jar:1.1-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
mapper -D
version=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the
file there:

  mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
mapper -Dve
rsion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
Drepository
Id=[id]

  Path to dependency:
1) demo.helloworld:helloworld:war:1.0-SNAPSHOT
2) net.liftweb:lift-mapper:jar:1.1-SNAPSHOT

--
2 required artifacts are missing.

for artifact:
  demo.helloworld:helloworld:war:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  scala-tools.org (http://scala-tools.org/repo-releases)

##


Cheers,
  Neil


On Nov 18, 9:34 am, "Neil.Lv"  wrote:
>It doesn't work too.
>
>The error message is the same as before :
> ###
> object creation impossible, since method testWasSet in trait
> AnyVarTrait of type (String)Boolean is not defined
>   object currentItemVar extends RequestVar[Item]({
> ###
>
>   What is the testWasSet in trait AnyVarTrait  ... ?
>
>   I use the RequestVar to save the item that will be edited in the
> edit page.
>
> Cheers,
>   Neil
>
> On Nov 18, 12:42 am, David Pollak 
> wrote:
>
> > On Tue, Nov 17, 2009 at 8:23 AM, Neil.Lv  wrote:
> > > Hi all,
>
> > >  The RequestVar doesn't work in the Lift1.1-SNAPSHOT,
>
> > >   The error message is:
> > > ###
> > > object creation impossible, since method testWasSet in trait
> > > AnyVarTrait of type (String)Boolean is not defined
> > >  object currentItemVar extends RequestVar[Item]({
> > > ###
>
> > >  The code is :
> > > ###
> > >  object currentItemVar extends RequestVar[Item]({
> > >Item.getItemById(S.param("id").toString.toLong)
> > >  })
> > > ###
>
> > >  When updating the lift1.1's jars file, this code is broken.
>
> > >  Any help must be appreciated!
>
> > Please do a "mvn -U clean install"
>
> > > 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=.
>
> > --
> > 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=.




[Lift] Re: RequestVar doesn't work in the Lift1.1-SNAPSHOT ?

2009-11-17 Thread Neil.Lv

   It doesn't work too.

   The error message is the same as before :
###
object creation impossible, since method testWasSet in trait
AnyVarTrait of type (String)Boolean is not defined
  object currentItemVar extends RequestVar[Item]({
###

  What is the testWasSet in trait AnyVarTrait  ... ?

  I use the RequestVar to save the item that will be edited in the
edit page.

Cheers,
  Neil


On Nov 18, 12:42 am, David Pollak 
wrote:
> On Tue, Nov 17, 2009 at 8:23 AM, Neil.Lv  wrote:
> > Hi all,
>
> >  The RequestVar doesn't work in the Lift1.1-SNAPSHOT,
>
> >   The error message is:
> > ###
> > object creation impossible, since method testWasSet in trait
> > AnyVarTrait of type (String)Boolean is not defined
> >  object currentItemVar extends RequestVar[Item]({
> > ###
>
> >  The code is :
> > ###
> >  object currentItemVar extends RequestVar[Item]({
> >Item.getItemById(S.param("id").toString.toLong)
> >  })
> > ###
>
> >  When updating the lift1.1's jars file, this code is broken.
>
> >  Any help must be appreciated!
>
> Please do a "mvn -U clean install"
>
>
>
>
>
> > 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=.
>
> --
> 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=.




Re: [Lift] Re: More questions about dynamic image generation

2009-11-17 Thread Ross Mellgren
http://github.com/Dridus/test-image

-Ross

On Nov 17, 2009, at 1:52 PM, Strom wrote:

> Actually, can I see the code you used? It's weird yours works and mine
> doesn't. I'd just like to compare.
> 
> On Nov 17, 10:47 am, Strom  wrote:
>> Thanks Ross,
>> I looked up the mime type and save time in the DB (using postgres),
>> and mime type is "image/jpeg" while save time is non-zero. The save
>> time override is the current time in millis, so I don't think there
>> should be a 0 save time.
>> 
>> Anyways, thanks for your help in this. I'll poke around a bit more,
>> and reply to this if I find out anything more.
>> 
>> On Nov 16, 9:23 pm, Ross Mellgren  wrote:
>> 
>>> I tried to hack your code into a lift-archetype-basic and eventually had 
>>> success but could not reproduce the problem (theimagedownloaded as I 
>>> intended). I did hardcode theimagedata and mime type because I didn't want 
>>> to try and wedge animagefile into the H2 database. I did have one issue 
>>> where the savetime on theimagewas 0, and that caused it to generate 304 Not 
>>> Modified. You might want to make your savetime in the database is not 0.
>> 
>>> -Ross
>> 
>>> On Nov 16, 2009, at 9:03 PM, Strom wrote:
>> 
 /**Image.scala **/
 objectImageextendsImagewith LongKeyedMetaMapper[Image] {
  override def dbTableName = "images"
 }
>> 
 classImageextends LongKeyedMapper[Image] with IdPK {
  def getSingleton =Image
>> 
  objectimageextends MappedBinary(this)
  object listing extends MappedLongForeignKey(this, Listing)
  object lookup extends MappedUniqueId(this, 16) {
override def dbIndexed_? = true
  }
  object saveTime extends MappedLong(this) {
override def defaultValue = Helpers.millis //TimeHelpers method
  }
  object mimeType extends MappedString(this, 256)
  def imageUrl : NodeSeq = {

  }
 }
>> 
 /** ImageLogic.scala **/
 object ImageLogic {
  object TestImage {
def unapply(in: String): Option[Image] =
  Image.find(By(Image.lookup, in.trim))
  }
>> 
  def matcher: LiftRules.DispatchPF = {
case req @ Req("image" :: TestImage(img) :: Nil, _, GetRequest) =>
  () => serveImage(img, req)
  }
>> 
  def serveImage(img:Image, req: Req) : Box[LiftResponse] = {
if (req.testIfModifiedSince(img.saveTime)) {
  //if not modified, optimized to tell browser to use last good
 version
  Full(InMemoryResponse(
new Array[Byte](0),
List("Last-Modified" -> toInternetDate(img.saveTime.is)),
Nil,
HttpCode.NotModified))
} else {
  //serve theimage
  Full(InMemoryResponse(
img.image.is,
List("Last-Modified" -> toInternetDate(img.saveTime.is),
 "Content-Type" -> img.mimeType.is,
 "Content-Length" -> img.image.is.length.toString),
 Nil /*cookies*/,
 HttpCode.Ok)
  )
}
  }//end serveImage
>> 
 }//end object ImageLogic
>> 
 /** Template HTML **/
 
  Details
  
  





  
 
>> 
 /** ListingDetailsPage snippet **/
 class ListingDetailsPage {
  def summary(xhtml : NodeSeq) : NodeSeq  = S.param("listingId") match
 {
case Full(listingId) => {
Listing.find(By(Listing.id, listingId.toLong)) match {
  case Full(l) => {
  bind("listing", xhtml,
   "title" -> l.title.asHtml,
   "desc" -> l.description.asHtml,
   "image" -> bindImages(l.images))
}
  case _ => Text("Could not find any listing with id:
 "+listingId)
}
  }
case _ => {
Text("No listing id provided")
  }
  } //end listingId match, summary method
>> 
  private def bindImages(images: List[Image]) : NodeSeq = {
if(images.isEmpty) {
  Text("Noimageor default")
} else {
  images(0).imageUrl
}
  }
>> 
 } //end class
>> 
 On Nov 16, 5:53 pm, Strom  wrote:
> Thanks Ross,
> I'll try to get some code up in a bit. In the meantime, can you
> explain how to use Firebug to check the content type? I looked under
> the HTML and DOM inspectors and didn't find how to look for it.
>> 
> Also, the error I'm getting is an XML parsing error:
> XML Parsing Error: no element found
> Location:http://localhost:8080//image/2WAW0HOHBIG03VYR
> Line Number 1, Column 1
>> 
> Probably doesn't help too much, but thought I'd share before getting
> some code up.
>> 
> On Nov 16, 5:19 pm, Ross Mellgren  wrote:
>> 
>> Any chance you could post your code or a reproducible example so we can 
>> poke at it?
>> 
>> If you're getting an XML error looking at theimageURL dire

Re: [Lift] Re: problems with tomcat

2009-11-17 Thread Naftoli Gugenheim
If you call maven with the right parameter it will skip the tests. I think it's 
something like -Dmaven.tests.skip .

-
DavidV wrote:

More specifically, I am trying to follow the stack trace to lead me to
some sort of URL so that I can see where and why this connection is
trying to be made.  I'm not sure why the AppTest needs to make a
connection in the first place.  Can I just skip the Test portion of
the mvn package command?  Or do I have hard code the proxy settings
somewhere other than in my maven settings.xml file?  I'm still
struggling with this problem...

On Nov 16, 10:54 am, DavidV  wrote:
> For the time being I have code that compiles correctly and I am
> leaving eclipse completely out of the picture.  I am running Windows
> Vista 64bit. I have quit eclipse and tried to run a "mvn clean
> install" to rebuild my project, but I get the exact same error that I
> previously posted (ConnectException) regarding the AppTest failure
> when the install command executes the "TESTS".  Therefore, the build
> fails.
> ...
> ---
>  T E S T S
> ---
> Running net.genomas.lift.test.AppTest
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.199
> sec <<< FA
> ILURE!
>
> Results :
>
> Tests in error:
>   testXml(net.genomas.lift.test.AppTest)
>
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
>
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO] There are test failures.
>
> ...
>
> If I run the project with "mvn cleantomcat:run" it works fine because
> it doesn't execute the "TESTS" step.
>
> I think that my problems with remotetomcatserver may stem from
> eclipse messing up the correct maven packaging of the .war file.  I'm
> still trying to figure out what is causing this ConnectException
> whenever AppTest.scala is executed that is preventing me from
> performing a normal "mvn package"
>
> On Nov 13, 6:39 pm, David Pollak 
> wrote:
>
> > On Fri, Nov 13, 2009 at 9:15 AM, DavidV  wrote:
>
> > > When running Lift-1.0.2 and Scala-2.7.5 I am able to compile and run
> > > my code through maven.  However, I am concerned about my inability to
> > > run the "mvn clean package" command successfully without first running
> > > the "clean" command in eclipse.
>
> > Yeah... Eclipse is generally a problem.
>
> > Are you running Windows or Linux/Mac?
>
> > Can you quite Eclipses before doing a build.
>
> > >  I am afraid that this extra eclipse
> > > step may be interfering with the proper creation of the .war file
> > > which may be contributing to the problem.  When I try to execute "mvn
> > > clean package" without eclipse I get the following error appearing in
> > > my surefire-report:
>
> > > ---
> > > Test set: net.genomas.lift.test.AppTest
>
> > > ---
> > > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.251
> > > sec <<< FAILURE!
> > > testXml(net.genomas.lift.test.AppTest)  Time elapsed: 1.228 sec  <<<
> > > ERROR!
> > > java.net.ConnectException: Connection refused: connect
> > >        at java.net.PlainSocketImpl.socketConnect(Native Method)
> > >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> > >        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:
> > > 195)
> > >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> > >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> > >        at java.net.Socket.connect(Socket.java:525)
> > >        at java.net.Socket.connect(Socket.java:475)
> > >        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
> > >        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
> > >        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
> > >        at sun.net.www.http.HttpClient.(HttpClient.java:233)
> > >        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
> > >        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
> > >        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient
> > > (HttpURLConnection.java:860)
> > >        at sun.net.www.protocol.http.HttpURLConnection.plainConnect
> > > (HttpURLConnection.java:801)
> > >        at sun.net.www.protocol.http.HttpURLConnection.connect
> > > (HttpURLConnection.java:726)
> > >        at sun.net.www.protocol.http.HttpURLConnection.getInputStream
> > > (HttpURLConnection.java:1049)
> > >        at
> > > com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity
> > > (XMLEntityManager.java:677)
> > >        at
> > > com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity
> > > (XMLEntityM

Re: [Lift] odd ajax issue (works every other time)

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 4:12 PM, Kris Nuttycombe
wrote:

> Added as ticket #198
>

Tnx.

Do you want to work it or should I (unless I hear from anyone else)


>
> Kris
>
> On Tue, Nov 17, 2009 at 5:10 PM, Kris Nuttycombe
>  wrote:
> > I am able to duplicate this error. I was concerned that it might be
> > the result of my Loc changes, so I just rebuilt Lift without the
> > patches associated with that change and reproduced the problem again.
> >
> > Here are the conditions under which I'm able to reproduce the failure:
> >
> > 1) load a page where the snippets are managed by a StatefulSnippet
> > 2) some page elements (in my case select boxes) have their values
> > update by AJAX in response to user events. This appears to work
> > normally.
> > 3) upon submission of the form on the page, the page is re-rendered.
> > Logging in the submission function indicates that it is never called.
> > 4) if I fill in the form again and resubmit after the initial failure,
> > the form submit behaves properly.
> > 5) I believe I've seen at least one instance (though I can't reliably
> > reproduce this) where just a normal AJAX call (modifying one of the
> > select boxes) caused the entire page to reload.
> >
> > Kris
> >
> > Kris
> >
> > On Tue, Nov 17, 2009 at 4:07 PM, O'Rorke Paul  wrote:
> >> Not in a place where I can really debug this right now but I'm curious
> >> whether anybody else has seen this and knows the solution...
> >>
> >> since rebuilding a day or two ago with no recent code or other changes:
> >> every second time I go to click on an ajax checkbox or select widget,
> >> I get effectively no response.
> >> actually, it looks like there is a very quick spinning wheel (almost
> >> imperceptible) but the page doesn't  get  repainted and the database
> >> does not change.
> >> If  I use another operation that is non ajax (going in and editing an
> >> item and doing old fashioned get / posts) everything works fine after
> >> that (one time).
> >> Or if I reload the page then if I use an ajax widget after reloading
> >> ajax works (once).
> >>
> >> This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.
> >>
> >> Perhaps not coincidentally, I am getting "Multiple versions of scala
> >> libraries detected!" warnings and have not yet figured out how to get
> >> rid of them.
> >> I don't see another version of Scala in my pom or eclipse maven
> >> dependency graph and have been going around nuking old copies of scala
> >> but to no avail as yet.
> >>
> >> Another odd thing that is now happening is that when I shutdown with a
> >> control C in the terminal window, I get the following error:
> >>
> >>> INFO - Service request (GET) /ajax_request/liftAjax.js took 2
> >>> Milliseconds
> >>> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
> >>> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
> >>> [INFO] Jetty server exiting.
> >>> [INFO]
> >>>
> 
> >>> [INFO] BUILD SUCCESSFUL
> >>> [INFO]
> >>>
> 
> >>> [INFO] Total time: 33 minutes 4 seconds
> >>> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
> >>> [INFO] Final Memory: 23M/257M
> >>> [INFO]
> >>>
> 
> >>> ERROR - Couldn't start SessionMaster ping
> >>> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
> >>> $checkandpur...@1cab4a5 could not be scheduled on
> >>> net.liftweb.http.sessionmast...@119c2af
> >>>   at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
> >>>   at
> net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
> >>> $doPing(LiftSession.scala:187)
> >>>   at net.liftweb.http.SessionMaster$$anonfun$1.apply
> >>> (LiftSession.scala:169)
> >>>   at net.liftweb.http.SessionMaster$$anonfun$1.apply
> >>> (LiftSession.scala:135)
> >>>   at
> net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:
> >>> 247)
> >>>   at
> net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:
> >>> 91)
> >>>   at net.liftweb.actor.SpecializedLiftActor$class.net
> $liftweb$actor
> >>> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
> >>>   at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
> >>> $1.apply(LiftActor.scala:109)
> >>>   at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
> >>> $1.apply(LiftActor.scala:109)
> >>>   at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run
> >>> (LiftActor.scala:37)
> >>>   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> >>> (ThreadPoolExecutor.java:886)
> >>>   at java.util.concurrent.ThreadPoolExecutor$Worker.run
> >>> (ThreadPoolExecutor.java:908)
> >>>   at java.lang.Thread.run(Thread.java:637)
> >>> Caused by: java.util.concurrent.RejectedExecutionException
> >>>   at java.util.concurrent.ThreadPoolExecutor
> >>> $AbortPolicy.reje

Re: [Lift] odd ajax issue (works every other time)

2009-11-17 Thread Kris Nuttycombe
Added as ticket #198

Kris

On Tue, Nov 17, 2009 at 5:10 PM, Kris Nuttycombe
 wrote:
> I am able to duplicate this error. I was concerned that it might be
> the result of my Loc changes, so I just rebuilt Lift without the
> patches associated with that change and reproduced the problem again.
>
> Here are the conditions under which I'm able to reproduce the failure:
>
> 1) load a page where the snippets are managed by a StatefulSnippet
> 2) some page elements (in my case select boxes) have their values
> update by AJAX in response to user events. This appears to work
> normally.
> 3) upon submission of the form on the page, the page is re-rendered.
> Logging in the submission function indicates that it is never called.
> 4) if I fill in the form again and resubmit after the initial failure,
> the form submit behaves properly.
> 5) I believe I've seen at least one instance (though I can't reliably
> reproduce this) where just a normal AJAX call (modifying one of the
> select boxes) caused the entire page to reload.
>
> Kris
>
> Kris
>
> On Tue, Nov 17, 2009 at 4:07 PM, O'Rorke Paul  wrote:
>> Not in a place where I can really debug this right now but I'm curious
>> whether anybody else has seen this and knows the solution...
>>
>> since rebuilding a day or two ago with no recent code or other changes:
>> every second time I go to click on an ajax checkbox or select widget,
>> I get effectively no response.
>> actually, it looks like there is a very quick spinning wheel (almost
>> imperceptible) but the page doesn't  get  repainted and the database
>> does not change.
>> If  I use another operation that is non ajax (going in and editing an
>> item and doing old fashioned get / posts) everything works fine after
>> that (one time).
>> Or if I reload the page then if I use an ajax widget after reloading
>> ajax works (once).
>>
>> This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.
>>
>> Perhaps not coincidentally, I am getting "Multiple versions of scala
>> libraries detected!" warnings and have not yet figured out how to get
>> rid of them.
>> I don't see another version of Scala in my pom or eclipse maven
>> dependency graph and have been going around nuking old copies of scala
>> but to no avail as yet.
>>
>> Another odd thing that is now happening is that when I shutdown with a
>> control C in the terminal window, I get the following error:
>>
>>> INFO - Service request (GET) /ajax_request/liftAjax.js took 2
>>> Milliseconds
>>> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
>>> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
>>> [INFO] Jetty server exiting.
>>> [INFO]
>>> 
>>> [INFO] BUILD SUCCESSFUL
>>> [INFO]
>>> 
>>> [INFO] Total time: 33 minutes 4 seconds
>>> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
>>> [INFO] Final Memory: 23M/257M
>>> [INFO]
>>> 
>>> ERROR - Couldn't start SessionMaster ping
>>> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
>>> $checkandpur...@1cab4a5 could not be scheduled on
>>> net.liftweb.http.sessionmast...@119c2af
>>>       at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
>>>       at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
>>> $doPing(LiftSession.scala:187)
>>>       at net.liftweb.http.SessionMaster$$anonfun$1.apply
>>> (LiftSession.scala:169)
>>>       at net.liftweb.http.SessionMaster$$anonfun$1.apply
>>> (LiftSession.scala:135)
>>>       at net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:
>>> 247)
>>>       at net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:
>>> 91)
>>>       at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor
>>> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
>>>       at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>>> $1.apply(LiftActor.scala:109)
>>>       at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>>> $1.apply(LiftActor.scala:109)
>>>       at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run
>>> (LiftActor.scala:37)
>>>       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
>>> (ThreadPoolExecutor.java:886)
>>>       at java.util.concurrent.ThreadPoolExecutor$Worker.run
>>> (ThreadPoolExecutor.java:908)
>>>       at java.lang.Thread.run(Thread.java:637)
>>> Caused by: java.util.concurrent.RejectedExecutionException
>>>       at java.util.concurrent.ThreadPoolExecutor
>>> $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
>>>       at java.util.concurrent.ThreadPoolExecutor.reject
>>> (ThreadPoolExecutor.java:767)
>>>       at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
>>> (ScheduledThreadPoolExecutor.java:216)
>>>       at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
>>> (ScheduledThreadPoolExec

Re: [Lift] odd ajax issue (works every other time)

2009-11-17 Thread Kris Nuttycombe
I am able to duplicate this error. I was concerned that it might be
the result of my Loc changes, so I just rebuilt Lift without the
patches associated with that change and reproduced the problem again.

Here are the conditions under which I'm able to reproduce the failure:

1) load a page where the snippets are managed by a StatefulSnippet
2) some page elements (in my case select boxes) have their values
update by AJAX in response to user events. This appears to work
normally.
3) upon submission of the form on the page, the page is re-rendered.
Logging in the submission function indicates that it is never called.
4) if I fill in the form again and resubmit after the initial failure,
the form submit behaves properly.
5) I believe I've seen at least one instance (though I can't reliably
reproduce this) where just a normal AJAX call (modifying one of the
select boxes) caused the entire page to reload.

Kris

Kris

On Tue, Nov 17, 2009 at 4:07 PM, O'Rorke Paul  wrote:
> Not in a place where I can really debug this right now but I'm curious
> whether anybody else has seen this and knows the solution...
>
> since rebuilding a day or two ago with no recent code or other changes:
> every second time I go to click on an ajax checkbox or select widget,
> I get effectively no response.
> actually, it looks like there is a very quick spinning wheel (almost
> imperceptible) but the page doesn't  get  repainted and the database
> does not change.
> If  I use another operation that is non ajax (going in and editing an
> item and doing old fashioned get / posts) everything works fine after
> that (one time).
> Or if I reload the page then if I use an ajax widget after reloading
> ajax works (once).
>
> This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.
>
> Perhaps not coincidentally, I am getting "Multiple versions of scala
> libraries detected!" warnings and have not yet figured out how to get
> rid of them.
> I don't see another version of Scala in my pom or eclipse maven
> dependency graph and have been going around nuking old copies of scala
> but to no avail as yet.
>
> Another odd thing that is now happening is that when I shutdown with a
> control C in the terminal window, I get the following error:
>
>> INFO - Service request (GET) /ajax_request/liftAjax.js took 2
>> Milliseconds
>> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
>> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
>> [INFO] Jetty server exiting.
>> [INFO]
>> 
>> [INFO] BUILD SUCCESSFUL
>> [INFO]
>> 
>> [INFO] Total time: 33 minutes 4 seconds
>> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
>> [INFO] Final Memory: 23M/257M
>> [INFO]
>> 
>> ERROR - Couldn't start SessionMaster ping
>> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
>> $checkandpur...@1cab4a5 could not be scheduled on
>> net.liftweb.http.sessionmast...@119c2af
>>       at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
>>       at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
>> $doPing(LiftSession.scala:187)
>>       at net.liftweb.http.SessionMaster$$anonfun$1.apply
>> (LiftSession.scala:169)
>>       at net.liftweb.http.SessionMaster$$anonfun$1.apply
>> (LiftSession.scala:135)
>>       at net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:
>> 247)
>>       at net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:
>> 91)
>>       at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor
>> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
>>       at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>> $1.apply(LiftActor.scala:109)
>>       at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>> $1.apply(LiftActor.scala:109)
>>       at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run
>> (LiftActor.scala:37)
>>       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
>> (ThreadPoolExecutor.java:886)
>>       at java.util.concurrent.ThreadPoolExecutor$Worker.run
>> (ThreadPoolExecutor.java:908)
>>       at java.lang.Thread.run(Thread.java:637)
>> Caused by: java.util.concurrent.RejectedExecutionException
>>       at java.util.concurrent.ThreadPoolExecutor
>> $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
>>       at java.util.concurrent.ThreadPoolExecutor.reject
>> (ThreadPoolExecutor.java:767)
>>       at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
>> (ScheduledThreadPoolExecutor.java:216)
>>       at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
>> (ScheduledThreadPoolExecutor.java:379)
>>       at java.util.concurrent.Executors
>> $DelegatedScheduledExecutorService.schedule(Executors.java:654)
>>       at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:52)
>>       ..

Re: [Lift] What is the problem with Lift API?

2009-11-17 Thread Naftoli Gugenheim
Do you really mean to ask it as a question, why it's like this? It's like this 
because that's what happens when many people collaborate on a project in their 
free time and no one has time to go through the names in a comprehensive 
fashion. I think what you're really asking is, what can be done about it.
I have a radical suggestion. Would you like to volunteer to compose a 
comprehensive list of questionable or discussable names used? Then post it 
somewhere like Google Docs, and everyone can comment on each name.
As everyone knows, Lift is an amazing revolution. I very much want it to stay 
that way, and moreover, gain as much popularity as possible. I think we should 
have a long term goal to get the APIs as consistent and intuitive as possible. 
To many people, this is a very important factor in choosing a framework, and to 
many it has a big impact on productivity.
Possibly a factor that helped push me in this direction of thought was reading 
a comparison of Joomla's and Drupal's APIs (IIRC). The article made a point of 
how one's APIs were much cleaner.


-
Alex Siman wrote:

Hi David and others,

thanks for the Lift. It is a revolutionary piece of soft!

But what is the problem with Lift's API design? For now (2009) we have
Scala plugins for modern such IDEs like: Eclipse, NetBeans and IDEA
with code completion and Scala's static typing. Why does Lift go the
way of shortened names of its classes, objects and methods? Some times
it looks like it was designed for programming in DOS (just joking).

For example, I have found such inconsistency in Lift API:

In S.scala:

loc
curRequestContextPath
but:
currentAttrsToMetaData
removeSessionRewriter
clearSessionRewriter
redirectTo
clearHighLevelSessionDispatcher

so why not:
rmSessionRewriter
clrSessionRewriter
redirTo
clrHiLevSesDisp

or even worse:
rmSesRwrtr
clrSesRwrtr


In SHtml.scala:
-
selectObj
multiSelectObj
but:
secureOptions
toggleKids
password

so why not:
secureOpt
tglKids
passwd
pwd


In class/object names:
-
Req
but:
RequestType


And caps vs lower case:
-
XML2Js
HTTPSession
CSS
but:
XmlMenu
JqSHtml
HttpResponse
SHtml


IMHO, as for readability, a name such as AjaxXmlHttpJsRequest is a way
better than AJAXXMLHTTPJSRequest.

And BTW, what is the cool name for object - "S"?

Maybe it's time for some refactoring work?

--

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=.


--

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=.




[Lift] What is the problem with Lift API?

2009-11-17 Thread Alex Siman
Hi David and others,

thanks for the Lift. It is a revolutionary piece of soft!

But what is the problem with Lift's API design? For now (2009) we have
Scala plugins for modern such IDEs like: Eclipse, NetBeans and IDEA
with code completion and Scala's static typing. Why does Lift go the
way of shortened names of its classes, objects and methods? Some times
it looks like it was designed for programming in DOS (just joking).

For example, I have found such inconsistency in Lift API:

In S.scala:

loc
curRequestContextPath
but:
currentAttrsToMetaData
removeSessionRewriter
clearSessionRewriter
redirectTo
clearHighLevelSessionDispatcher

so why not:
rmSessionRewriter
clrSessionRewriter
redirTo
clrHiLevSesDisp

or even worse:
rmSesRwrtr
clrSesRwrtr


In SHtml.scala:
-
selectObj
multiSelectObj
but:
secureOptions
toggleKids
password

so why not:
secureOpt
tglKids
passwd
pwd


In class/object names:
-
Req
but:
RequestType


And caps vs lower case:
-
XML2Js
HTTPSession
CSS
but:
XmlMenu
JqSHtml
HttpResponse
SHtml


IMHO, as for readability, a name such as AjaxXmlHttpJsRequest is a way
better than AJAXXMLHTTPJSRequest.

And BTW, what is the cool name for object - "S"?

Maybe it's time for some refactoring work?

--

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=.




Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread Jack Widman
I would like to second this. What David has created here is quite
incredible. Between Lift itself and the community surrounding it. This is
all very impressive.

On Tue, Nov 17, 2009 at 6:10 PM, Naftoli Gugenheim wrote:

> David,
> I'm really sorry if I came across badly, like if it sounded cynical or
> something. I did not mean it that way!
> Everything you wrote about how much toil you put into this project, that's
> exactly my point! It's your brainchild, you started it, and you keep it
> going, and that's why I said is that the final decision is up to you.
> I know we had a couple of disagreements about names, and as I told you
> then: I will be happy to debate as long as it's up for discussion; but when
> you make a final decision, that's your right. I'm not being bitter about it!
> I mean it 100%.
> When someone announced they were starting a new forum for Lift, I was the
> one who said, let's see if DPP minds.
> @Heiko: I didn't mean that it's DPP's in the sense that it's his toy, not
> yours and everyone else's opinion is irrelevant! I meant exactly what you
> responded. But it's not random that the decision maker is DPP. It's all
> thanks to him after all.
> So I agree wholeheartedly with everything DPP and Heiko replied, and I'm
> sorry if I implied otherwise.
> Gratitude is one of the primary distinctions between man and animal.
>
>
>
> -
> David Pollak wrote:
>
> On Mon, Nov 16, 2009 at 11:08 PM, Naftoli Gugenheim  >wrote:
>
> > I agree. I would to see a 2.0 or 3.0 or something eventually with a lot
> of
> > names improved.
>
>
> If you want to improve names, propose it on this list.  Kris just opened up
> a thread on that and you've been silent.
>
> Now is the time to improve method names.  Now is the time to suggest
> alternative class names.  It's not going to be wholesale breakage, but the
> really bad stuff can be renamed and the rest can be politely deprecated.
>
>
> > But it's up to DPP because it's his project.
> >
> >
> Please note how I approached this conversation.  I didn't say "no."  I
> didn't say, "over my dead body."  I gave my perspective on how much Lift
> has
> progressed since 1.0... and I think I've got the experience with Lift to be
> able to say that.  I give a lot of deference to Heiko in terms of his OSGi
> experience.  I have my opinion, but I'm listening and being swayed.
>
> So, yes, I have made some decisions that have gone counter to others.  Yes,
> I do have the final word.  But think about our conversation when you wanted
> to add XML for configuring menus in SiteMap.  Did I say, "no"?  I said,
> "It's not the way I'd do things, but add it and let's see if people adopt
> it."  When Marius abstracted the Servlet stuff out of Lift, he went about
> it
> in a way different than I would have, but I think his results are awesome.
> There are lots of decisions about Lift that are not my personal
> inclination,
> but if they hold together then they work.  When things don't work or
> there's
> a particular corner case (e.g., Alex's changes to the type erasure issue in
> Req that I have 2+ years of experience with and he has none), I pull out my
> veto stamp.  Maybe it feels like I do this a lot, but I think that's
> generally because of lot of stuff happens without a lot of disagreement and
> it's only when I have to disagree with folks who I have a ton of respect
> for, there's an "energy spike" on the list and that's what people remember.
>
> More broadly, Lift mentally hangs together pretty well.  Yes, there's room
> for improvement.  Yes, there are folks with more FP experience than I have
> who can and are lending excellent perspectives to the code base (take a
> look
> at Kris's recent additions).  But there's general coherence across the
> framework.
>
> Keeping something hanging together well and keeping people who have no
> reason to participate except that they want to motivated is non-trivial.
> Pile onto this the fact that most of the committers are probably the
> smartest guys in their class.  They are among the top 1% of coders in
> whatever company they work for.  Each of the committers is remarkable on
> his/her own.  So, we've got a collection of folks who are 3 standard
> deviations out in their field who are all opinionated and used to being
> right almost all the time.  I have the challenge of keeping this tremendous
> group of people aligned and motivated.
>
> Now, intersect this with the current time-constraints.  I have been a
> nanny-less single parent for nearly the past month.  Derek is traveling
> with
> his family and Marius and Tim are busy at work.  Debby's been occupied with
> other gigs so I have less process help than I usually do.  I have to
> balance
> between debates, supporting the increasing number of production sites (and,
> yes, Naftoli, I have supported your production site... I was sitting in
> this
> line: http://www.uplifting.me/the-h1n1-vaccine-line coding fixes for your
> tickets to receive 

Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 2:49 PM, Jonathan Ferguson wrote:

>
>
> 2009/11/18 David Pollak 
>
>
>>
>> -
>>> Jonathan Ferguson wrote:
>>>
>>> I was thinking about this earlier, if there is to be a 2.0 I would hope
>>> there was a chance to remove deprecated code.
>>>
>>
>> Which particular deprecated code are you thinking.
>>
>
> Generally, nothing concrete, there have been a few conversations on the
> list where you have said to leave deprecated code in place rather than
> remove so as not to cause undue pain.
>

Anything that was introduced after M5 that's now deprecated should be
removed.  Anything that was deprecated in 1.0 should be removed.  The pre M5
stuff that's deprecated should be taken on a case by case basis.

If anyone would like to sign up to make a list of the above, please do and
open tickets (except for the pre M5 stuff which should result in a
discussion on list).


>
>
>>
>>
>>>  Also consider making breaking
>>> changes @dpp hasn't been in favour of making to date.
>>>
>>
>> Which changes are you thinking about?
>>
>
>
> Once again, it was a general there have been a few conversations on the
> list where changing from Option to Box or renaming functions and you've
> suggested leaving them, once again not to cause undue pain.
>

Changing return types is wicked dangerous.

There are places in the code that are currently Option[] and they should
likely stay that way (stuff that's related to Scala's XML attributes deals
with Option, but not Box).

I'd like to see the JSON stuff moved from Option to Box, but that's Joni's
call.

If there are additional Option that should be Box, let's see what they are.

In terms of renaming stuff, Kris opened a thread on this.  Now is the time
to suggest changes.

I am all for cleaning up Lift's method & class names, but where it can't be
done with a simple depcrecation cycle, then we have to see the trade-offs
between making the change and the value of the change.

Thanks,

David


>
>
>>
>>
>>> Not to annoy him. As
>>> 1.X to 2.X is a big enough change that people who don't want to move can
>>> stay with a stable 1.X and those of us who are running HEAD/TRUNK
>>> whatever
>>> these new fangled git kids call it nowadays can keep racing along.
>>>
>>
>> I'm not sure we have the resources to support a 1.X and a 2.X and a 2.7.x
>> and a 2.8.x branch.  If there are any folks who want to step up and maintain
>> a branch (or if there's money to hire someone), it's something worth a
>> discussion, but I don't think there's anyone I know of who could maintain a
>> 1.X branch if we're going to get radical with a 2.X.  I think it's one
>> branch.
>>
>
> I may not have thought of this, we have 1.0.X and 1.1 at the moment. I
> guess I thought a 1.1 and 1.0.X would be unsupported if people didn't have
> money.
>
>
>
>  --
> 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=.
>



-- 
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=.




Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread Naftoli Gugenheim
David,
I'm really sorry if I came across badly, like if it sounded cynical or 
something. I did not mean it that way!
Everything you wrote about how much toil you put into this project, that's 
exactly my point! It's your brainchild, you started it, and you keep it going, 
and that's why I said is that the final decision is up to you.
I know we had a couple of disagreements about names, and as I told you then: I 
will be happy to debate as long as it's up for discussion; but when you make a 
final decision, that's your right. I'm not being bitter about it! I mean it 
100%.
When someone announced they were starting a new forum for Lift, I was the one 
who said, let's see if DPP minds.
@Heiko: I didn't mean that it's DPP's in the sense that it's his toy, not yours 
and everyone else's opinion is irrelevant! I meant exactly what you responded. 
But it's not random that the decision maker is DPP. It's all thanks to him 
after all.
So I agree wholeheartedly with everything DPP and Heiko replied, and I'm sorry 
if I implied otherwise.
Gratitude is one of the primary distinctions between man and animal.



-
David Pollak wrote:

On Mon, Nov 16, 2009 at 11:08 PM, Naftoli Gugenheim wrote:

> I agree. I would to see a 2.0 or 3.0 or something eventually with a lot of
> names improved.


If you want to improve names, propose it on this list.  Kris just opened up
a thread on that and you've been silent.

Now is the time to improve method names.  Now is the time to suggest
alternative class names.  It's not going to be wholesale breakage, but the
really bad stuff can be renamed and the rest can be politely deprecated.


> But it's up to DPP because it's his project.
>
>
Please note how I approached this conversation.  I didn't say "no."  I
didn't say, "over my dead body."  I gave my perspective on how much Lift has
progressed since 1.0... and I think I've got the experience with Lift to be
able to say that.  I give a lot of deference to Heiko in terms of his OSGi
experience.  I have my opinion, but I'm listening and being swayed.

So, yes, I have made some decisions that have gone counter to others.  Yes,
I do have the final word.  But think about our conversation when you wanted
to add XML for configuring menus in SiteMap.  Did I say, "no"?  I said,
"It's not the way I'd do things, but add it and let's see if people adopt
it."  When Marius abstracted the Servlet stuff out of Lift, he went about it
in a way different than I would have, but I think his results are awesome.
There are lots of decisions about Lift that are not my personal inclination,
but if they hold together then they work.  When things don't work or there's
a particular corner case (e.g., Alex's changes to the type erasure issue in
Req that I have 2+ years of experience with and he has none), I pull out my
veto stamp.  Maybe it feels like I do this a lot, but I think that's
generally because of lot of stuff happens without a lot of disagreement and
it's only when I have to disagree with folks who I have a ton of respect
for, there's an "energy spike" on the list and that's what people remember.

More broadly, Lift mentally hangs together pretty well.  Yes, there's room
for improvement.  Yes, there are folks with more FP experience than I have
who can and are lending excellent perspectives to the code base (take a look
at Kris's recent additions).  But there's general coherence across the
framework.

Keeping something hanging together well and keeping people who have no
reason to participate except that they want to motivated is non-trivial.
Pile onto this the fact that most of the committers are probably the
smartest guys in their class.  They are among the top 1% of coders in
whatever company they work for.  Each of the committers is remarkable on
his/her own.  So, we've got a collection of folks who are 3 standard
deviations out in their field who are all opinionated and used to being
right almost all the time.  I have the challenge of keeping this tremendous
group of people aligned and motivated.

Now, intersect this with the current time-constraints.  I have been a
nanny-less single parent for nearly the past month.  Derek is traveling with
his family and Marius and Tim are busy at work.  Debby's been occupied with
other gigs so I have less process help than I usually do.  I have to balance
between debates, supporting the increasing number of production sites (and,
yes, Naftoli, I have supported your production site... I was sitting in this
line: http://www.uplifting.me/the-h1n1-vaccine-line coding fixes for your
tickets to receive a "the names you chose, they're not so good" feedback
from you), the Scala 2.8 port, and the flood of newbies on the list.  So,
yeah, I don't spend 2+ hours a day debating... I make shorter fuse
decisions.

But, the "it's DPP's ball and he'll do with it what he wants" kind of
feedback bugs me at a very, very core level.


> -
> Jonathan Ferguson wrote:

Re: [Lift] odd ajax issue (works every other time)

2009-11-17 Thread Ross Mellgren
I can't comment on the AJAX issue in particular, though you should  
switch to Scala 2.7.7 -- that's the version that should be used with  
1.1-SNAPSHOT.

-Ross

On Nov 17, 2009, at 6:07 PM, O'Rorke Paul wrote:

> Not in a place where I can really debug this right now but I'm curious
> whether anybody else has seen this and knows the solution...
>
> since rebuilding a day or two ago with no recent code or other  
> changes:
> every second time I go to click on an ajax checkbox or select widget,
> I get effectively no response.
> actually, it looks like there is a very quick spinning wheel (almost
> imperceptible) but the page doesn't  get  repainted and the database
> does not change.
> If  I use another operation that is non ajax (going in and editing an
> item and doing old fashioned get / posts) everything works fine after
> that (one time).
> Or if I reload the page then if I use an ajax widget after reloading
> ajax works (once).
>
> This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.
>
> Perhaps not coincidentally, I am getting "Multiple versions of scala
> libraries detected!" warnings and have not yet figured out how to get
> rid of them.
> I don't see another version of Scala in my pom or eclipse maven
> dependency graph and have been going around nuking old copies of scala
> but to no avail as yet.
>
> Another odd thing that is now happening is that when I shutdown with a
> control C in the terminal window, I get the following error:
>
>> INFO - Service request (GET) /ajax_request/liftAjax.js took 2
>> Milliseconds
>> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
>> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
>> [INFO] Jetty server exiting.
>> [INFO]
>> 
>> [INFO] BUILD SUCCESSFUL
>> [INFO]
>> 
>> [INFO] Total time: 33 minutes 4 seconds
>> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
>> [INFO] Final Memory: 23M/257M
>> [INFO]
>> 
>> ERROR - Couldn't start SessionMaster ping
>> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster
>> $checkandpur...@1cab4a5 could not be scheduled on
>> net.liftweb.http.sessionmast...@119c2af
>>  at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
>>  at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$
>> $doPing(LiftSession.scala:187)
>>  at net.liftweb.http.SessionMaster$$anonfun$1.apply
>> (LiftSession.scala:169)
>>  at net.liftweb.http.SessionMaster$$anonfun$1.apply
>> (LiftSession.scala:135)
>>  at net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:
>> 247)
>>  at net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:
>> 91)
>>  at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor
>> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
>>  at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>> $1.apply(LiftActor.scala:109)
>>  at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply
>> $1.apply(LiftActor.scala:109)
>>  at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run
>> (LiftActor.scala:37)
>>  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
>> (ThreadPoolExecutor.java:886)
>>  at java.util.concurrent.ThreadPoolExecutor$Worker.run
>> (ThreadPoolExecutor.java:908)
>>  at java.lang.Thread.run(Thread.java:637)
>> Caused by: java.util.concurrent.RejectedExecutionException
>>  at java.util.concurrent.ThreadPoolExecutor
>> $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
>>  at java.util.concurrent.ThreadPoolExecutor.reject
>> (ThreadPoolExecutor.java:767)
>>  at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute
>> (ScheduledThreadPoolExecutor.java:216)
>>  at java.util.concurrent.ScheduledThreadPoolExecutor.schedule
>> (ScheduledThreadPoolExecutor.java:379)
>>  at java.util.concurrent.Executors
>> $DelegatedScheduledExecutorService.schedule(Executors.java:654)
>>  at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:52)
>>  ... 12 more
>>
>
> Ideas / Suggestions for any of these issues (perhaps they are
> related?) most welcome!
> ---Paul O
>
>
>
>
> --
>
> 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= 
> .
>
>

--

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

[Lift] odd ajax issue (works every other time)

2009-11-17 Thread O'Rorke Paul
Not in a place where I can really debug this right now but I'm curious  
whether anybody else has seen this and knows the solution...

since rebuilding a day or two ago with no recent code or other changes:
every second time I go to click on an ajax checkbox or select widget,  
I get effectively no response.
actually, it looks like there is a very quick spinning wheel (almost  
imperceptible) but the page doesn't  get  repainted and the database  
does not change.
If  I use another operation that is non ajax (going in and editing an  
item and doing old fashioned get / posts) everything works fine after  
that (one time).
Or if I reload the page then if I use an ajax widget after reloading  
ajax works (once).

This is with 2.7.5 Scala and Lift 1.1-SNAPSHOT.

Perhaps not coincidentally, I am getting "Multiple versions of scala  
libraries detected!" warnings and have not yet figured out how to get  
rid of them.
I don't see another version of Scala in my pom or eclipse maven  
dependency graph and have been going around nuking old copies of scala  
but to no avail as yet.

Another odd thing that is now happening is that when I shutdown with a  
control C in the terminal window, I get the following error:

> INFO - Service request (GET) /ajax_request/liftAjax.js took 2  
> Milliseconds
> ^C2009-11-16 15:29:01.634::INFO:  Shutdown hook executing
> 2009-11-16 15:29:02.249::INFO:  Shutdown hook complete
> [INFO] Jetty server exiting.
> [INFO]  
> 
> [INFO] BUILD SUCCESSFUL
> [INFO]  
> 
> [INFO] Total time: 33 minutes 4 seconds
> [INFO] Finished at: Mon Nov 16 15:29:02 PST 2009
> [INFO] Final Memory: 23M/257M
> [INFO]  
> 
> ERROR - Couldn't start SessionMaster ping
> net.liftweb.util.ActorPingException: net.liftweb.http.SessionMaster 
> $checkandpur...@1cab4a5 could not be scheduled on  
> net.liftweb.http.sessionmast...@119c2af
>   at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:54)
>   at net.liftweb.http.SessionMaster$.net$liftweb$http$SessionMaster$ 
> $doPing(LiftSession.scala:187)
>   at net.liftweb.http.SessionMaster$$anonfun$1.apply 
> (LiftSession.scala:169)
>   at net.liftweb.http.SessionMaster$$anonfun$1.apply 
> (LiftSession.scala:135)
>   at net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala: 
> 247)
>   at net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala: 
> 91)
>   at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor 
> $SpecializedLiftActor$$processMailbox(LiftActor.scala:142)
>   at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply 
> $1.apply(LiftActor.scala:109)
>   at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply 
> $1.apply(LiftActor.scala:109)
>   at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run 
> (LiftActor.scala:37)
>   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask 
> (ThreadPoolExecutor.java:886)
>   at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:908)
>   at java.lang.Thread.run(Thread.java:637)
> Caused by: java.util.concurrent.RejectedExecutionException
>   at java.util.concurrent.ThreadPoolExecutor 
> $AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
>   at java.util.concurrent.ThreadPoolExecutor.reject 
> (ThreadPoolExecutor.java:767)
>   at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute 
> (ScheduledThreadPoolExecutor.java:216)
>   at java.util.concurrent.ScheduledThreadPoolExecutor.schedule 
> (ScheduledThreadPoolExecutor.java:379)
>   at java.util.concurrent.Executors 
> $DelegatedScheduledExecutorService.schedule(Executors.java:654)
>   at net.liftweb.util.ActorPing$.schedule(ActorPing.scala:52)
>   ... 12 more
>

Ideas / Suggestions for any of these issues (perhaps they are  
related?) most welcome!
---Paul O




--

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=.




Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread Jonathan Ferguson
2009/11/18 David Pollak 

>
>
> -
>> Jonathan Ferguson wrote:
>>
>> I was thinking about this earlier, if there is to be a 2.0 I would hope
>> there was a chance to remove deprecated code.
>>
>
> Which particular deprecated code are you thinking.
>

Generally, nothing concrete, there have been a few conversations on the list
where you have said to leave deprecated code in place rather than remove so
as not to cause undue pain.


>
>
>>  Also consider making breaking
>> changes @dpp hasn't been in favour of making to date.
>>
>
> Which changes are you thinking about?
>


Once again, it was a general there have been a few conversations on the list
where changing from Option to Box or renaming functions and you've suggested
leaving them, once again not to cause undue pain.


>
>
>> Not to annoy him. As
>> 1.X to 2.X is a big enough change that people who don't want to move can
>> stay with a stable 1.X and those of us who are running HEAD/TRUNK whatever
>> these new fangled git kids call it nowadays can keep racing along.
>>
>
> I'm not sure we have the resources to support a 1.X and a 2.X and a 2.7.x
> and a 2.8.x branch.  If there are any folks who want to step up and maintain
> a branch (or if there's money to hire someone), it's something worth a
> discussion, but I don't think there's anyone I know of who could maintain a
> 1.X branch if we're going to get radical with a 2.X.  I think it's one
> branch.
>

I may not have thought of this, we have 1.0.X and 1.1 at the moment. I guess
I thought a 1.1 and 1.0.X would be unsupported if people didn't have money.

--

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=.




Re: [Lift] Re: How to output un-escaped content from the database

2009-11-17 Thread Ross Mellgren
I was going to say originally that using Unparsed for javascript was a  
bad idea, but I read the source for JsCmds.Script and then revised my  
pending email ;-)

-Ross

On Nov 17, 2009, at 5:41 PM, David Pollak wrote:

>
>
> On Tue, Nov 17, 2009 at 2:37 PM, Ross Mellgren   
> wrote:
> As long as you put a CDATA block inside the Unparsed.
>
>
> Or just use net.liftweb.http.js.JsCmds.Script which does the proper  
> wrapping.
>
> -Ross
>
> On Nov 17, 2009, at 5:33 PM, DMB wrote:
>
> > Yup. This is also useful for writing out Javascript.
> >
> > On Nov 17, 6:27 am, David Pollak 
> > wrote:
> >> On Tue, Nov 17, 2009 at 6:25 AM, philip 
> >> wrote:
> >>> Hi,
> >>
> >>> I am making a CMS, I have content in the database and I need to
> >>> output
> >>> it directly as HTML.
> >>> It appears this is outputting my content as escaped HTML. Thats a
> >>> good
> >>> thing right, as it prevents hacking attacks, but I really want  
> that
> >>> HTML, how can I get it?
> >>
> >> scala.xml.Unparsed
> >>
> >> This will insert an unparsed stream of Chars into your XML page.
> >>
> >> Use it with extreme care.
> >>
> >>
> >>
> >>> class Content
> >>> {
> >>>  def display(in: NodeSeq): NodeSeq =
> >>>{
> >>>  val name = S.attr("name") openOr "0"
> >>>  // Get the site content from the database
> >>>  val content:SiteContent = SiteContent.findByUniqueName(name)
> >>> openOr new SiteContent
> >>>  // Return the content inside a DIV
> >>>  {content.page_Content_Html}
> >>
> >> {Unparsed(content.page_Content_Html)}
> >>
> >>
> >>
> >>>}
> >>> }
> >>
> >>> Thanks!, Philip
> >>
> >>> --
> >>
> >>> 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 >>> %2bunsubscr...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/liftweb?hl=.
> >>
> >> --
> >> 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=
> > .
> >
> >
>
> --
>
> 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= 
> .
>
>
>
>
>
> -- 
> 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= 
> .

--

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=.




Re: [Lift] Re: How to output un-escaped content from the database

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 2:37 PM, Ross Mellgren  wrote:

> As long as you put a CDATA block inside the Unparsed.
>
>
Or just use net.liftweb.http.js.JsCmds.Script which does the proper
wrapping.


> -Ross
>
> On Nov 17, 2009, at 5:33 PM, DMB wrote:
>
> > Yup. This is also useful for writing out Javascript.
> >
> > On Nov 17, 6:27 am, David Pollak 
> > wrote:
> >> On Tue, Nov 17, 2009 at 6:25 AM, philip 
> >> wrote:
> >>> Hi,
> >>
> >>> I am making a CMS, I have content in the database and I need to
> >>> output
> >>> it directly as HTML.
> >>> It appears this is outputting my content as escaped HTML. Thats a
> >>> good
> >>> thing right, as it prevents hacking attacks, but I really want that
> >>> HTML, how can I get it?
> >>
> >> scala.xml.Unparsed
> >>
> >> This will insert an unparsed stream of Chars into your XML page.
> >>
> >> Use it with extreme care.
> >>
> >>
> >>
> >>> class Content
> >>> {
> >>>  def display(in: NodeSeq): NodeSeq =
> >>>{
> >>>  val name = S.attr("name") openOr "0"
> >>>  // Get the site content from the database
> >>>  val content:SiteContent = SiteContent.findByUniqueName(name)
> >>> openOr new SiteContent
> >>>  // Return the content inside a DIV
> >>>  {content.page_Content_Html}
> >>
> >> {Unparsed(content.page_Content_Html)}
> >>
> >>
> >>
> >>>}
> >>> }
> >>
> >>> Thanks!, Philip
> >>
> >>> --
> >>
> >>> 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
>  >>> %2bunsubscr...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/liftweb?hl=.
> >>
> >> --
> >> 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=
> > .
> >
> >
>
> --
>
> 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=.
>
>
>


-- 
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=.




Re: [Lift] Re: How to output un-escaped content from the database

2009-11-17 Thread Ross Mellgren
As long as you put a CDATA block inside the Unparsed.

-Ross

On Nov 17, 2009, at 5:33 PM, DMB wrote:

> Yup. This is also useful for writing out Javascript.
>
> On Nov 17, 6:27 am, David Pollak 
> wrote:
>> On Tue, Nov 17, 2009 at 6:25 AM, philip   
>> wrote:
>>> Hi,
>>
>>> I am making a CMS, I have content in the database and I need to  
>>> output
>>> it directly as HTML.
>>> It appears this is outputting my content as escaped HTML. Thats a  
>>> good
>>> thing right, as it prevents hacking attacks, but I really want that
>>> HTML, how can I get it?
>>
>> scala.xml.Unparsed
>>
>> This will insert an unparsed stream of Chars into your XML page.
>>
>> Use it with extreme care.
>>
>>
>>
>>> class Content
>>> {
>>>  def display(in: NodeSeq): NodeSeq =
>>>{
>>>  val name = S.attr("name") openOr "0"
>>>  // Get the site content from the database
>>>  val content:SiteContent = SiteContent.findByUniqueName(name)
>>> openOr new SiteContent
>>>  // Return the content inside a DIV
>>>  {content.page_Content_Html}
>>
>> {Unparsed(content.page_Content_Html)}
>>
>>
>>
>>>}
>>> }
>>
>>> Thanks!, Philip
>>
>>> --
>>
>>> 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>> %2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/liftweb?hl=.
>>
>> --
>> 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= 
> .
>
>

--

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=.




[Lift] Re: How to output un-escaped content from the database

2009-11-17 Thread DMB
Yup. This is also useful for writing out Javascript.

On Nov 17, 6:27 am, David Pollak 
wrote:
> On Tue, Nov 17, 2009 at 6:25 AM, philip  wrote:
> > Hi,
>
> > I am making a CMS, I have content in the database and I need to output
> > it directly as HTML.
> > It appears this is outputting my content as escaped HTML. Thats a good
> > thing right, as it prevents hacking attacks, but I really want that
> > HTML, how can I get it?
>
> scala.xml.Unparsed
>
> This will insert an unparsed stream of Chars into your XML page.
>
> Use it with extreme care.
>
>
>
> > class Content
> > {
> >  def display(in: NodeSeq): NodeSeq =
> >    {
> >      val name = S.attr("name") openOr "0"
> >      // Get the site content from the database
> >      val content:SiteContent = SiteContent.findByUniqueName(name)
> > openOr new SiteContent
> >      // Return the content inside a DIV
> >      {content.page_Content_Html}
>
> {Unparsed(content.page_Content_Html)}
>
>
>
> >    }
> > }
>
> > Thanks!, Philip
>
> > --
>
> > 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=.
>
> --
> 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=.




Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread Heiko Seeberger
2009/11/17 Naftoli Gugenheim 

> But it's up to DPP because it's his project.
>

Of course David kicked off Lift and he is "managing the project actively".
Yet there is also a huge Lift community. Hence I do not agree calling Lift
"his project".

And even though I do not agree with every decision, I think that it is very
beneficial for Lift to have a decision maker like him. Just look at the
figures: There are 30+ committers and 1500+ members in this list. Ain't that
successful?

Heiko

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net

--

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=.




Re: [Lift] foursquare.com now basically all on Lift

2009-11-17 Thread Jorge Ortiz
I've been MIA from the Lift community recently, but I've gotta say I love
Foursquare and use it almost every day. It gives me even more warm fuzzies
to know that it's using Lift under the hood :)

Thanks for a great app!

--j

On Tue, Nov 17, 2009 at 12:16 PM, harryh  wrote:

> I've been a bit coy about it on the list, but three months ago when I
> joined the team at foursquare.com I made the final decision that we
> would port our webservers to Scala/Lift.  It took about 3 months, but
> foursquare.com is now basically running only on Lift(1).  This
> includes the website, a mobile website (m.foursquare.com) and a simple
> (but growing!) REST api (api.foursquare.com).
>
> I'd like the send a huge thank you to dpp and the rest of the Lift
> team. You've built a really great framework here, and I look forward
> to using it and seeing it grow for many years to come. An additional
> thanks goes out to all those who have answered my many random
> questions over the past couple of months.
>
> For those who haven't yet found out about foursquare, you can read
> more about it here: http://foursquare.com/learn_more
>
> Anyways, that's about enough self promotion, but I did want to
> officially let the community know about what I hope will be a fairly
> high profile site that is using Lift.
>
> -harryh
>
> (1) Haven't quite ported feeds.foursquare.com, and there is a legacy
> PHP based REST api that will live on for a bit longer as it supports
> current versions of our iPhone app.
>
> --
>
> 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=.
>
>
>

--

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=.




Re: [Lift] Re: problems with tomcat

2009-11-17 Thread David Pollak
Just delete the AppTest.scala file.

On Tue, Nov 17, 2009 at 7:41 AM, DavidV  wrote:

> More specifically, I am trying to follow the stack trace to lead me to
> some sort of URL so that I can see where and why this connection is
> trying to be made.  I'm not sure why the AppTest needs to make a
> connection in the first place.  Can I just skip the Test portion of
> the mvn package command?  Or do I have hard code the proxy settings
> somewhere other than in my maven settings.xml file?  I'm still
> struggling with this problem...
>
> On Nov 16, 10:54 am, DavidV  wrote:
> > For the time being I have code that compiles correctly and I am
> > leaving eclipse completely out of the picture.  I am running Windows
> > Vista 64bit. I have quit eclipse and tried to run a "mvn clean
> > install" to rebuild my project, but I get the exact same error that I
> > previously posted (ConnectException) regarding the AppTest failure
> > when the install command executes the "TESTS".  Therefore, the build
> > fails.
> > ...
> > ---
> >  T E S T S
> > ---
> > Running net.genomas.lift.test.AppTest
> > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.199
> > sec <<< FA
> > ILURE!
> >
> > Results :
> >
> > Tests in error:
> >   testXml(net.genomas.lift.test.AppTest)
> >
> > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
> >
> > [INFO]
> > 
> > [ERROR] BUILD FAILURE
> > [INFO]
> > 
> > [INFO] There are test failures.
> >
> > ...
> >
> > If I run the project with "mvn cleantomcat:run" it works fine because
> > it doesn't execute the "TESTS" step.
> >
> > I think that my problems with remotetomcatserver may stem from
> > eclipse messing up the correct maven packaging of the .war file.  I'm
> > still trying to figure out what is causing this ConnectException
> > whenever AppTest.scala is executed that is preventing me from
> > performing a normal "mvn package"
> >
> > On Nov 13, 6:39 pm, David Pollak 
> > wrote:
> >
> > > On Fri, Nov 13, 2009 at 9:15 AM, DavidV 
> wrote:
> >
> > > > When running Lift-1.0.2 and Scala-2.7.5 I am able to compile and run
> > > > my code through maven.  However, I am concerned about my inability to
> > > > run the "mvn clean package" command successfully without first
> running
> > > > the "clean" command in eclipse.
> >
> > > Yeah... Eclipse is generally a problem.
> >
> > > Are you running Windows or Linux/Mac?
> >
> > > Can you quite Eclipses before doing a build.
> >
> > > >  I am afraid that this extra eclipse
> > > > step may be interfering with the proper creation of the .war file
> > > > which may be contributing to the problem.  When I try to execute "mvn
> > > > clean package" without eclipse I get the following error appearing in
> > > > my surefire-report:
> >
> > > >
> ---
> > > > Test set: net.genomas.lift.test.AppTest
> >
> > > >
> ---
> > > > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.251
> > > > sec <<< FAILURE!
> > > > testXml(net.genomas.lift.test.AppTest)  Time elapsed: 1.228 sec  <<<
> > > > ERROR!
> > > > java.net.ConnectException: Connection refused: connect
> > > >at java.net.PlainSocketImpl.socketConnect(Native Method)
> > > >at
> java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> > > >at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:
> > > > 195)
> > > >at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> > > >at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> > > >at java.net.Socket.connect(Socket.java:525)
> > > >at java.net.Socket.connect(Socket.java:475)
> > > >at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
> > > >at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
> > > >at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
> > > >at sun.net.www.http.HttpClient.(HttpClient.java:233)
> > > >at sun.net.www.http.HttpClient.New(HttpClient.java:306)
> > > >at sun.net.www.http.HttpClient.New(HttpClient.java:323)
> > > >at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient
> > > > (HttpURLConnection.java:860)
> > > >at sun.net.www.protocol.http.HttpURLConnection.plainConnect
> > > > (HttpURLConnection.java:801)
> > > >at sun.net.www.protocol.http.HttpURLConnection.connect
> > > > (HttpURLConnection.java:726)
> > > >at sun.net.www.protocol.http.HttpURLConnection.getInputStream
> > > > (HttpURLConnection.java:1049)
> > > >at
> > > >
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity
> 

Re: [Lift] Re: **Important** Migration guide Scala Actors -> Lift Actors

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 12:34 PM, braver  wrote:

>
> On Nov 17, 2:26 pm, David Pollak 
> wrote:
> > There's no such thing as "shut down" for Lift Actors.  They are like any
> > other object in your JVM.  They respond to messages and when there are no
> > more references to them, they get garbage collected.
>
> I'm probably belaboring the point or missing a koan, but that was
> exactly my wonderment, as to where and how do I declare the reader and
> writer as Lift actors in order for them to go out of scope when I
> desire.


Just like any other object in your application.  Do you worry about a String
or a Map or a List being garbage collected?  Does it matter?


>  I'll stick to my app even though it might not be ideal for
> actors, to try to understand how and whether it can be done.
>
> E.g.,
>
> def main(...) {
>
>  val reader = new ReaderLiftActor(inputFileName,...)
>  val writer = new WriterLiftActor(...)
>
> }
>
> The reader slurps all lines in the input file and starts feeding the
> writer, one my one, via message.  Now what?  OK, so I have to leave
> scope.  Would I do something like,
>
> def main(...) {
>
>  var exit: Boolean = false
>
>  /* some scope prefix, like while (!exit) ? */ {
>val reader = new ReaderLiftActor(inputFileName,...) // affects
> exit?
>val writer = new WriterLiftActor(...)
>// some waiting?
>  } // end of scope
>
>  // yay!  may go home
> }
>
> Is there an idiom in Lift to create the actors in scopes for the job,
> then let them slip into the night?
>

Yes, the idiom is the same idiom that you use to create any other JVM object
and let it slip into the night:

to create:
val obj = new Object

to slip into the night:

exit the scope of val obj and if the reference wasn't passed to and retained
by any other object in the system, it will be garbage collected.

But as I've said, you should not use Actors (Scala or Lift) for IO.  If you
want to do IO, use threads and use thread.join to wait until the thread has
terminated.

Thanks,

David


> Cheers,
> Alexy
>
> --
>
> 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=.
>
>
>


-- 
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=.




Re: [Lift] foursquare.com now basically all on Lift

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 12:16 PM, harryh  wrote:

> I've been a bit coy about it on the list, but three months ago when I
> joined the team at foursquare.com I made the final decision that we
> would port our webservers to Scala/Lift.  It took about 3 months, but
> foursquare.com is now basically running only on Lift(1).  This
> includes the website, a mobile website (m.foursquare.com) and a simple
> (but growing!) REST api (api.foursquare.com).
>
> I'd like the send a huge thank you to dpp and the rest of the Lift
> team. You've built a really great framework here, and I look forward
> to using it and seeing it grow for many years to come. An additional
> thanks goes out to all those who have answered my many random
> questions over the past couple of months.
>
> For those who haven't yet found out about foursquare, you can read
> more about it here: http://foursquare.com/learn_more
>
> Anyways, that's about enough self promotion, but I did want to
> officially let the community know about what I hope will be a fairly
> high profile site that is using Lift.
>

Harry,

Thanks for choosing Lift and being part of the Lift community.

I just checked in at Pho Garden on Four Square... and I generally love using
Four Square... thanks for building a fun app.

David


>
> -harryh
>
> (1) Haven't quite ported feeds.foursquare.com, and there is a legacy
> PHP based REST api that will live on for a bit longer as it supports
> current versions of our iPhone app.
>
> --
>
> 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=.
>
>
>


-- 
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=.




Re: [Lift] foursquare.com now basically all on Lift

2009-11-17 Thread Heiko Seeberger
Very very cool!

Heiko

2009/11/17 harryh 

> I've been a bit coy about it on the list, but three months ago when I
> joined the team at foursquare.com I made the final decision that we
> would port our webservers to Scala/Lift.  It took about 3 months, but
> foursquare.com is now basically running only on Lift(1).  This
> includes the website, a mobile website (m.foursquare.com) and a simple
> (but growing!) REST api (api.foursquare.com).
>
> I'd like the send a huge thank you to dpp and the rest of the Lift
> team. You've built a really great framework here, and I look forward
> to using it and seeing it grow for many years to come. An additional
> thanks goes out to all those who have answered my many random
> questions over the past couple of months.
>
> For those who haven't yet found out about foursquare, you can read
> more about it here: http://foursquare.com/learn_more
>
> Anyways, that's about enough self promotion, but I did want to
> officially let the community know about what I hope will be a fairly
> high profile site that is using Lift.
>
> -harryh
>
> (1) Haven't quite ported feeds.foursquare.com, and there is a legacy
> PHP based REST api that will live on for a bit longer as it supports
> current versions of our iPhone app.
>
> --
>
> 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=.
>
>
>


-- 
Heiko Seeberger

My job: weiglewilczek.com
My blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net

--

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=.




[Lift] Re: foursquare.com now basically all on Lift

2009-11-17 Thread TylerWeir
Great to hear Harry!

When you get a chance, maybe write up your experience doing the port.

Tyler

On Nov 17, 3:16 pm, harryh  wrote:
> I've been a bit coy about it on the list, but three months ago when I
> joined the team at foursquare.com I made the final decision that we
> would port our webservers to Scala/Lift.  It took about 3 months, but
> foursquare.com is now basically running only on Lift(1).  This
> includes the website, a mobile website (m.foursquare.com) and a simple
> (but growing!) REST api (api.foursquare.com).
>
> I'd like the send a huge thank you to dpp and the rest of the Lift
> team. You've built a really great framework here, and I look forward
> to using it and seeing it grow for many years to come. An additional
> thanks goes out to all those who have answered my many random
> questions over the past couple of months.
>
> For those who haven't yet found out about foursquare, you can read
> more about it here:http://foursquare.com/learn_more
>
> Anyways, that's about enough self promotion, but I did want to
> officially let the community know about what I hope will be a fairly
> high profile site that is using Lift.
>
> -harryh
>
> (1) Haven't quite ported feeds.foursquare.com, and there is a legacy
> PHP based REST api that will live on for a bit longer as it supports
> current versions of our iPhone app.

--

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=.




[Lift] Re: **Important** Migration guide Scala Actors -> Lift Actors

2009-11-17 Thread braver

On Nov 17, 2:26 pm, David Pollak 
wrote:
> There's no such thing as "shut down" for Lift Actors.  They are like any
> other object in your JVM.  They respond to messages and when there are no
> more references to them, they get garbage collected.

I'm probably belaboring the point or missing a koan, but that was
exactly my wonderment, as to where and how do I declare the reader and
writer as Lift actors in order for them to go out of scope when I
desire.  I'll stick to my app even though it might not be ideal for
actors, to try to understand how and whether it can be done.

E.g.,

def main(...) {

  val reader = new ReaderLiftActor(inputFileName,...)
  val writer = new WriterLiftActor(...)

}

The reader slurps all lines in the input file and starts feeding the
writer, one my one, via message.  Now what?  OK, so I have to leave
scope.  Would I do something like,

def main(...) {

  var exit: Boolean = false

  /* some scope prefix, like while (!exit) ? */ {
val reader = new ReaderLiftActor(inputFileName,...) // affects
exit?
val writer = new WriterLiftActor(...)
// some waiting?
  } // end of scope

  // yay!  may go home
}

Is there an idiom in Lift to create the actors in scopes for the job,
then let them slip into the night?
Cheers,
Alexy

--

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=.




[Lift] foursquare.com now basically all on Lift

2009-11-17 Thread harryh
I've been a bit coy about it on the list, but three months ago when I
joined the team at foursquare.com I made the final decision that we
would port our webservers to Scala/Lift.  It took about 3 months, but
foursquare.com is now basically running only on Lift(1).  This
includes the website, a mobile website (m.foursquare.com) and a simple
(but growing!) REST api (api.foursquare.com).

I'd like the send a huge thank you to dpp and the rest of the Lift
team. You've built a really great framework here, and I look forward
to using it and seeing it grow for many years to come. An additional
thanks goes out to all those who have answered my many random
questions over the past couple of months.

For those who haven't yet found out about foursquare, you can read
more about it here: http://foursquare.com/learn_more

Anyways, that's about enough self promotion, but I did want to
officially let the community know about what I hope will be a fairly
high profile site that is using Lift.

-harryh

(1) Haven't quite ported feeds.foursquare.com, and there is a legacy
PHP based REST api that will live on for a bit longer as it supports
current versions of our iPhone app.

--

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=.




Re: [Lift] Missing dependency problems trying "Getting Started..."

2009-11-17 Thread Donald McLean
You nailed it. Thank you.

On Tue, Nov 17, 2009 at 2:35 PM, David Pollak
 wrote:
> Short answer:
>
> In your pom.xml file, change the lift-core dependency to lift-webkit and
> lift-mapper.
>
> On Tue, Nov 17, 2009 at 11:24 AM, Donald McLean  wrote:
>>
>> When I tried the first exercise I ran into errors that I didn't
>> understand so I tried the second part to see if it would be better.
>>
>> Following the directions for the second part (todo), everything worked
>> great up to the "mvn jetty:run" part, where I get an error for an
>> unresolved dependency:
>>
>> 1) org.igniterealtime.smack:smackx:jar:3.1.0
>>
>> It started with 2 (smack and smackx). I was able to fix smack using
>> the directions provided by maven but those directions did NOT resolve
>> the smackx problem.
>>
>> Any suggestions?
-- 
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=.




[Lift] Re: **Important** Migration guide Scala Actors -> Lift Actors

2009-11-17 Thread braver
On Nov 17, 2:26 pm, David Pollak 
wrote:
> Neither Lift Actors nor Scala Actors are meant for blocking IO.  So, reading
> in an Actor is just going to be pain.  You're a lot better off using a
> thread for reading and a separate thread for writing.

My reading actor is simply slurping a Source, then it feeds the
writer.

> A writing thread should never ask for input... the input should always be
> put in a queue and consumed by the thread doing the writing.

Indeed, that was my original design.  However I have millions of
lines, and in the case of a writer which inserts into a database, the
queue might get out of hand.

> > I can create the Lift actors for reader and writer, and then they will
> > start themselves to work forever.  How would I recreate the above
> > semantics to shut down on EOF?
>
> There's no such thing as "shut down" for Lift Actors.  They are like any
> other object in your JVM.  They respond to messages and when there are no
> more references to them, they get garbage collected.

So here's the crux of the question.  If I just create them in the main
driver, the reader slurps all lines of the input and waits for gimme
messages, the writer does them all and waits for exit.  How can I
declare them so they will be garbage collected?

Cheers,
Alexy

--

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=.




Re: [Lift] Missing dependency problems trying "Getting Started..."

2009-11-17 Thread David Pollak
Short answer:

In your pom.xml file, change the lift-core dependency to lift-webkit and
lift-mapper.

On Tue, Nov 17, 2009 at 11:24 AM, Donald McLean  wrote:

> When I tried the first exercise I ran into errors that I didn't
> understand so I tried the second part to see if it would be better.
>
> Following the directions for the second part (todo), everything worked
> great up to the "mvn jetty:run" part, where I get an error for an
> unresolved dependency:
>
> 1) org.igniterealtime.smack:smackx:jar:3.1.0
>
> It started with 2 (smack and smackx). I was able to fix smack using
> the directions provided by maven but those directions did NOT resolve
> the smackx problem.
>
> Any suggestions?
>
> --
> 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=.
>
>
>


-- 
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=.




[Lift] Missing dependency problems trying "Getting Started..."

2009-11-17 Thread Donald McLean
When I tried the first exercise I ran into errors that I didn't
understand so I tried the second part to see if it would be better.

Following the directions for the second part (todo), everything worked
great up to the "mvn jetty:run" part, where I get an error for an
unresolved dependency:

1) org.igniterealtime.smack:smackx:jar:3.1.0

It started with 2 (smack and smackx). I was able to fix smack using
the directions provided by maven but those directions did NOT resolve
the smackx problem.

Any suggestions?

-- 
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=.




Re: [Lift] Re: **Important** Migration guide Scala Actors -> Lift Actors

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 11:04 AM, braver  wrote:

> So what would be the scenario where you have two actors, one, the
> reader, reading stdin, and sending to the other, the writer, which
> then processes it line by line and writes stats?  They're now started
> in the main driver with start(), the reader, upon EOF, sends a special
> EXIT message to the writer, then exits itself; the writer exits upon
> receiving the EXIT, then the main thread exits too.  The writer send a
> "gimme" message to the reader every time it's ready to process, and
> the reader send a line to writer then.  If it has no line, it sends
> EXIT.
>

Neither Lift Actors nor Scala Actors are meant for blocking IO.  So, reading
in an Actor is just going to be pain.  You're a lot better off using a
thread for reading and a separate thread for writing.

A writing thread should never ask for input... the input should always be
put in a queue and consumed by the thread doing the writing.




> I can create the Lift actors for reader and writer, and then they will
> start themselves to work forever.  How would I recreate the above
> semantics to shut down on EOF?
>

There's no such thing as "shut down" for Lift Actors.  They are like any
other object in your JVM.  They respond to messages and when there are no
more references to them, they get garbage collected.


>
> Cheers,
> Alexy
>
> --
>
> 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=.
>
>
>


-- 
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=.




Re: [Lift] Re: More questions about dynamic image generation

2009-11-17 Thread Ross Mellgren
Sure, I'll send it along when I get home, as it's not on the computer  
I'm at now.

-Ross

On Nov 17, 2009, at 1:52 PM, Strom wrote:

> Actually, can I see the code you used? It's weird yours works and mine
> doesn't. I'd just like to compare.
>
> On Nov 17, 10:47 am, Strom  wrote:
>> Thanks Ross,
>> I looked up the mime type and save time in the DB (using postgres),
>> and mime type is "image/jpeg" while save time is non-zero. The save
>> time override is the current time in millis, so I don't think there
>> should be a 0 save time.
>>
>> Anyways, thanks for your help in this. I'll poke around a bit more,
>> and reply to this if I find out anything more.
>>
>> On Nov 16, 9:23 pm, Ross Mellgren  wrote:
>>
>>> I tried to hack your code into a lift-archetype-basic and  
>>> eventually had success but could not reproduce the problem  
>>> (theimagedownloaded as I intended). I did hardcode theimagedata  
>>> and mime type because I didn't want to try and wedge animagefile  
>>> into the H2 database. I did have one issue where the savetime on  
>>> theimagewas 0, and that caused it to generate 304 Not Modified.  
>>> You might want to make your savetime in the database is not 0.
>>
>>> -Ross
>>
>>> On Nov 16, 2009, at 9:03 PM, Strom wrote:
>>
 /**Image.scala **/
 objectImageextendsImagewith LongKeyedMetaMapper[Image] {
  override def dbTableName = "images"
 }
>>
 classImageextends LongKeyedMapper[Image] with IdPK {
  def getSingleton =Image
>>
  objectimageextends MappedBinary(this)
  object listing extends MappedLongForeignKey(this, Listing)
  object lookup extends MappedUniqueId(this, 16) {
override def dbIndexed_? = true
  }
  object saveTime extends MappedLong(this) {
override def defaultValue = Helpers.millis //TimeHelpers method
  }
  object mimeType extends MappedString(this, 256)
  def imageUrl : NodeSeq = {

  }
 }
>>
 /** ImageLogic.scala **/
 object ImageLogic {
  object TestImage {
def unapply(in: String): Option[Image] =
  Image.find(By(Image.lookup, in.trim))
  }
>>
  def matcher: LiftRules.DispatchPF = {
case req @ Req("image" :: TestImage(img) :: Nil, _,  
 GetRequest) =>
  () => serveImage(img, req)
  }
>>
  def serveImage(img:Image, req: Req) : Box[LiftResponse] = {
if (req.testIfModifiedSince(img.saveTime)) {
  //if not modified, optimized to tell browser to use last good
 version
  Full(InMemoryResponse(
new Array[Byte](0),
List("Last-Modified" -> toInternetDate 
 (img.saveTime.is)),
Nil,
HttpCode.NotModified))
} else {
  //serve theimage
  Full(InMemoryResponse(
img.image.is,
List("Last-Modified" -> toInternetDate(img.saveTime.is),
 "Content-Type" -> img.mimeType.is,
 "Content-Length" -> img.image.is.length.toString),
 Nil /*cookies*/,
 HttpCode.Ok)
  )
}
  }//end serveImage
>>
 }//end object ImageLogic
>>
 /** Template HTML **/
 
  Details
  
  





  
 
>>
 /** ListingDetailsPage snippet **/
 class ListingDetailsPage {
  def summary(xhtml : NodeSeq) : NodeSeq  = S.param("listingId")  
 match
 {
case Full(listingId) => {
Listing.find(By(Listing.id, listingId.toLong)) match {
  case Full(l) => {
  bind("listing", xhtml,
   "title" -> l.title.asHtml,
   "desc" -> l.description.asHtml,
   "image" -> bindImages(l.images))
}
  case _ => Text("Could not find any listing with id:
 "+listingId)
}
  }
case _ => {
Text("No listing id provided")
  }
  } //end listingId match, summary method
>>
  private def bindImages(images: List[Image]) : NodeSeq = {
if(images.isEmpty) {
  Text("Noimageor default")
} else {
  images(0).imageUrl
}
  }
>>
 } //end class
>>
 On Nov 16, 5:53 pm, Strom  wrote:
> Thanks Ross,
> I'll try to get some code up in a bit. In the meantime, can you
> explain how to use Firebug to check the content type? I looked  
> under
> the HTML and DOM inspectors and didn't find how to look for it.
>>
> Also, the error I'm getting is an XML parsing error:
> XML Parsing Error: no element found
> Location:http://localhost:8080//image/2WAW0HOHBIG03VYR
> Line Number 1, Column 1
>>
> Probably doesn't help too much, but thought I'd share before  
> getting
> some code up.
>>
> On Nov 16, 5:19 pm, Ross Mellgren  wrote:
>>
>> Any chance you could post your code or a reproducible example  
>> so we can poke a

[Lift] Re: **Important** Migration guide Scala Actors -> Lift Actors

2009-11-17 Thread braver
So what would be the scenario where you have two actors, one, the
reader, reading stdin, and sending to the other, the writer, which
then processes it line by line and writes stats?  They're now started
in the main driver with start(), the reader, upon EOF, sends a special
EXIT message to the writer, then exits itself; the writer exits upon
receiving the EXIT, then the main thread exits too.  The writer send a
"gimme" message to the reader every time it's ready to process, and
the reader send a line to writer then.  If it has no line, it sends
EXIT.

I can create the Lift actors for reader and writer, and then they will
start themselves to work forever.  How would I recreate the above
semantics to shut down on EOF?

Cheers,
Alexy

--

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=.




[Lift] Re: More questions about dynamic image generation

2009-11-17 Thread Strom
Actually, can I see the code you used? It's weird yours works and mine
doesn't. I'd just like to compare.

On Nov 17, 10:47 am, Strom  wrote:
> Thanks Ross,
> I looked up the mime type and save time in the DB (using postgres),
> and mime type is "image/jpeg" while save time is non-zero. The save
> time override is the current time in millis, so I don't think there
> should be a 0 save time.
>
> Anyways, thanks for your help in this. I'll poke around a bit more,
> and reply to this if I find out anything more.
>
> On Nov 16, 9:23 pm, Ross Mellgren  wrote:
>
> > I tried to hack your code into a lift-archetype-basic and eventually had 
> > success but could not reproduce the problem (theimagedownloaded as I 
> > intended). I did hardcode theimagedata and mime type because I didn't want 
> > to try and wedge animagefile into the H2 database. I did have one issue 
> > where the savetime on theimagewas 0, and that caused it to generate 304 Not 
> > Modified. You might want to make your savetime in the database is not 0.
>
> > -Ross
>
> > On Nov 16, 2009, at 9:03 PM, Strom wrote:
>
> > > /**Image.scala **/
> > > objectImageextendsImagewith LongKeyedMetaMapper[Image] {
> > >  override def dbTableName = "images"
> > > }
>
> > > classImageextends LongKeyedMapper[Image] with IdPK {
> > >  def getSingleton =Image
>
> > >  objectimageextends MappedBinary(this)
> > >  object listing extends MappedLongForeignKey(this, Listing)
> > >  object lookup extends MappedUniqueId(this, 16) {
> > >    override def dbIndexed_? = true
> > >  }
> > >  object saveTime extends MappedLong(this) {
> > >    override def defaultValue = Helpers.millis //TimeHelpers method
> > >  }
> > >  object mimeType extends MappedString(this, 256)
> > >  def imageUrl : NodeSeq = {
> > >    
> > >  }
> > > }
>
> > > /** ImageLogic.scala **/
> > > object ImageLogic {
> > >  object TestImage {
> > >    def unapply(in: String): Option[Image] =
> > >      Image.find(By(Image.lookup, in.trim))
> > >  }
>
> > >  def matcher: LiftRules.DispatchPF = {
> > >    case req @ Req("image" :: TestImage(img) :: Nil, _, GetRequest) =>
> > >      () => serveImage(img, req)
> > >  }
>
> > >  def serveImage(img:Image, req: Req) : Box[LiftResponse] = {
> > >    if (req.testIfModifiedSince(img.saveTime)) {
> > >      //if not modified, optimized to tell browser to use last good
> > > version
> > >      Full(InMemoryResponse(
> > >            new Array[Byte](0),
> > >            List("Last-Modified" -> toInternetDate(img.saveTime.is)),
> > >            Nil,
> > >            HttpCode.NotModified))
> > >    } else {
> > >      //serve theimage
> > >      Full(InMemoryResponse(
> > >            img.image.is,
> > >            List("Last-Modified" -> toInternetDate(img.saveTime.is),
> > >                 "Content-Type" -> img.mimeType.is,
> > >                 "Content-Length" -> img.image.is.length.toString),
> > >                 Nil /*cookies*/,
> > >                 HttpCode.Ok)
> > >      )
> > >    }
> > >  }//end serveImage
>
> > > }//end object ImageLogic
>
> > > /** Template HTML **/
> > > 
> > >  Details
> > >  
> > >  
> > >    
> > >    
> > >    
> > >    
> > >    
> > >  
> > > 
>
> > > /** ListingDetailsPage snippet **/
> > > class ListingDetailsPage {
> > >  def summary(xhtml : NodeSeq) : NodeSeq  = S.param("listingId") match
> > > {
> > >    case Full(listingId) => {
> > >        Listing.find(By(Listing.id, listingId.toLong)) match {
> > >          case Full(l) => {
> > >              bind("listing", xhtml,
> > >                   "title" -> l.title.asHtml,
> > >                   "desc" -> l.description.asHtml,
> > >                   "image" -> bindImages(l.images))
> > >            }
> > >          case _ => Text("Could not find any listing with id:
> > > "+listingId)
> > >        }
> > >      }
> > >    case _ => {
> > >        Text("No listing id provided")
> > >      }
> > >  } //end listingId match, summary method
>
> > >  private def bindImages(images: List[Image]) : NodeSeq = {
> > >    if(images.isEmpty) {
> > >      Text("Noimageor default")
> > >    } else {
> > >      images(0).imageUrl
> > >    }
> > >  }
>
> > > } //end class
>
> > > On Nov 16, 5:53 pm, Strom  wrote:
> > >> Thanks Ross,
> > >> I'll try to get some code up in a bit. In the meantime, can you
> > >> explain how to use Firebug to check the content type? I looked under
> > >> the HTML and DOM inspectors and didn't find how to look for it.
>
> > >> Also, the error I'm getting is an XML parsing error:
> > >> XML Parsing Error: no element found
> > >> Location:http://localhost:8080//image/2WAW0HOHBIG03VYR
> > >> Line Number 1, Column 1
>
> > >> Probably doesn't help too much, but thought I'd share before getting
> > >> some code up.
>
> > >> On Nov 16, 5:19 pm, Ross Mellgren  wrote:
>
> > >>> Any chance you could post your code or a reproducible example so we can 
> > >>> poke at it?
>
> > >>> If you're getting an XML error looking at theimageURL directly, I 
> > >>> suspect that something i

[Lift] overriding ConnectionManager.newSuperConnection

2009-11-17 Thread opyate
Hello Lifters,

I overrode newSuperConnection like so:

--START--
  object DBVendor extends ConnectionManager {
def newConnection(name: ConnectionIdentifier): Box[Connection]
= {
  try {
Class.forName(dbDriver)
val dm =  DriverManager.getConnection(dbConnString,
dbUser, dbPass)
Full(dm)
  } catch {
case e => {
  e.printStackTrace
  Empty
}
  }
}
def releaseConnection(conn: Connection) {conn.close}

override def newSuperConnection(name: ConnectionIdentifier):
Box[SuperConnection] = {
val c: Connection = newConnection(name).open_!
def release = () => releaseConnection(c)
Full(new SuperConnection(c, release, Full(schema) ))
}
  }
--END--

...where "schema" is defined beforehand.

Now, I have to read/write to a Postgres table which is in a schema,
e.g. "schemaname.tablename"

When I run my Lift code, I get the following exception:

Caught and thrown by:
Message: org.postgresql.util.PSQLException: ERROR: relation
"tablename" does not exist

However, if I change the model from this:

override def dbTableName = "tablename"

to this:

override def dbTableName = "schemaname.tablename"

...then things start working, but this is obviously not the intended
way to achieve this, right?

Please let me know what I'm doing wrong.

Thanks,
Juan

--

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=.




[Lift] Re: More questions about dynamic image generation

2009-11-17 Thread Strom
Thanks Ross,
I looked up the mime type and save time in the DB (using postgres),
and mime type is "image/jpeg" while save time is non-zero. The save
time override is the current time in millis, so I don't think there
should be a 0 save time.

Anyways, thanks for your help in this. I'll poke around a bit more,
and reply to this if I find out anything more.

On Nov 16, 9:23 pm, Ross Mellgren  wrote:
> I tried to hack your code into a lift-archetype-basic and eventually had 
> success but could not reproduce the problem (theimagedownloaded as I 
> intended). I did hardcode theimagedata and mime type because I didn't want to 
> try and wedge animagefile into the H2 database. I did have one issue where 
> the savetime on theimagewas 0, and that caused it to generate 304 Not 
> Modified. You might want to make your savetime in the database is not 0.
>
> -Ross
>
> On Nov 16, 2009, at 9:03 PM, Strom wrote:
>
> > /**Image.scala **/
> > objectImageextendsImagewith LongKeyedMetaMapper[Image] {
> >  override def dbTableName = "images"
> > }
>
> > classImageextends LongKeyedMapper[Image] with IdPK {
> >  def getSingleton =Image
>
> >  objectimageextends MappedBinary(this)
> >  object listing extends MappedLongForeignKey(this, Listing)
> >  object lookup extends MappedUniqueId(this, 16) {
> >    override def dbIndexed_? = true
> >  }
> >  object saveTime extends MappedLong(this) {
> >    override def defaultValue = Helpers.millis //TimeHelpers method
> >  }
> >  object mimeType extends MappedString(this, 256)
> >  def imageUrl : NodeSeq = {
> >    
> >  }
> > }
>
> > /** ImageLogic.scala **/
> > object ImageLogic {
> >  object TestImage {
> >    def unapply(in: String): Option[Image] =
> >      Image.find(By(Image.lookup, in.trim))
> >  }
>
> >  def matcher: LiftRules.DispatchPF = {
> >    case req @ Req("image" :: TestImage(img) :: Nil, _, GetRequest) =>
> >      () => serveImage(img, req)
> >  }
>
> >  def serveImage(img:Image, req: Req) : Box[LiftResponse] = {
> >    if (req.testIfModifiedSince(img.saveTime)) {
> >      //if not modified, optimized to tell browser to use last good
> > version
> >      Full(InMemoryResponse(
> >            new Array[Byte](0),
> >            List("Last-Modified" -> toInternetDate(img.saveTime.is)),
> >            Nil,
> >            HttpCode.NotModified))
> >    } else {
> >      //serve theimage
> >      Full(InMemoryResponse(
> >            img.image.is,
> >            List("Last-Modified" -> toInternetDate(img.saveTime.is),
> >                 "Content-Type" -> img.mimeType.is,
> >                 "Content-Length" -> img.image.is.length.toString),
> >                 Nil /*cookies*/,
> >                 HttpCode.Ok)
> >      )
> >    }
> >  }//end serveImage
>
> > }//end object ImageLogic
>
> > /** Template HTML **/
> > 
> >  Details
> >  
> >  
> >    
> >    
> >    
> >    
> >    
> >  
> > 
>
> > /** ListingDetailsPage snippet **/
> > class ListingDetailsPage {
> >  def summary(xhtml : NodeSeq) : NodeSeq  = S.param("listingId") match
> > {
> >    case Full(listingId) => {
> >        Listing.find(By(Listing.id, listingId.toLong)) match {
> >          case Full(l) => {
> >              bind("listing", xhtml,
> >                   "title" -> l.title.asHtml,
> >                   "desc" -> l.description.asHtml,
> >                   "image" -> bindImages(l.images))
> >            }
> >          case _ => Text("Could not find any listing with id:
> > "+listingId)
> >        }
> >      }
> >    case _ => {
> >        Text("No listing id provided")
> >      }
> >  } //end listingId match, summary method
>
> >  private def bindImages(images: List[Image]) : NodeSeq = {
> >    if(images.isEmpty) {
> >      Text("Noimageor default")
> >    } else {
> >      images(0).imageUrl
> >    }
> >  }
>
> > } //end class
>
> > On Nov 16, 5:53 pm, Strom  wrote:
> >> Thanks Ross,
> >> I'll try to get some code up in a bit. In the meantime, can you
> >> explain how to use Firebug to check the content type? I looked under
> >> the HTML and DOM inspectors and didn't find how to look for it.
>
> >> Also, the error I'm getting is an XML parsing error:
> >> XML Parsing Error: no element found
> >> Location:http://localhost:8080//image/2WAW0HOHBIG03VYR
> >> Line Number 1, Column 1
>
> >> Probably doesn't help too much, but thought I'd share before getting
> >> some code up.
>
> >> On Nov 16, 5:19 pm, Ross Mellgren  wrote:
>
> >>> Any chance you could post your code or a reproducible example so we can 
> >>> poke at it?
>
> >>> If you're getting an XML error looking at theimageURL directly, I suspect 
> >>> that something is wrong with your Content-Type, therefore with your 
> >>> img.mimeType. Perhaps use Firebug or the like to see what Content-Type 
> >>> you're getting back? It should always beimage/png orimage/jpeg or 
> >>> something along those lines -- if it's something else then the browser 
> >>> may try to interpret the result in whatever what it can.
>
> >>> If everything is going to the right pla

Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread David Pollak
On Mon, Nov 16, 2009 at 11:08 PM, Naftoli Gugenheim wrote:

> I agree. I would to see a 2.0 or 3.0 or something eventually with a lot of
> names improved.


If you want to improve names, propose it on this list.  Kris just opened up
a thread on that and you've been silent.

Now is the time to improve method names.  Now is the time to suggest
alternative class names.  It's not going to be wholesale breakage, but the
really bad stuff can be renamed and the rest can be politely deprecated.


> But it's up to DPP because it's his project.
>
>
Please note how I approached this conversation.  I didn't say "no."  I
didn't say, "over my dead body."  I gave my perspective on how much Lift has
progressed since 1.0... and I think I've got the experience with Lift to be
able to say that.  I give a lot of deference to Heiko in terms of his OSGi
experience.  I have my opinion, but I'm listening and being swayed.

So, yes, I have made some decisions that have gone counter to others.  Yes,
I do have the final word.  But think about our conversation when you wanted
to add XML for configuring menus in SiteMap.  Did I say, "no"?  I said,
"It's not the way I'd do things, but add it and let's see if people adopt
it."  When Marius abstracted the Servlet stuff out of Lift, he went about it
in a way different than I would have, but I think his results are awesome.
There are lots of decisions about Lift that are not my personal inclination,
but if they hold together then they work.  When things don't work or there's
a particular corner case (e.g., Alex's changes to the type erasure issue in
Req that I have 2+ years of experience with and he has none), I pull out my
veto stamp.  Maybe it feels like I do this a lot, but I think that's
generally because of lot of stuff happens without a lot of disagreement and
it's only when I have to disagree with folks who I have a ton of respect
for, there's an "energy spike" on the list and that's what people remember.

More broadly, Lift mentally hangs together pretty well.  Yes, there's room
for improvement.  Yes, there are folks with more FP experience than I have
who can and are lending excellent perspectives to the code base (take a look
at Kris's recent additions).  But there's general coherence across the
framework.

Keeping something hanging together well and keeping people who have no
reason to participate except that they want to motivated is non-trivial.
Pile onto this the fact that most of the committers are probably the
smartest guys in their class.  They are among the top 1% of coders in
whatever company they work for.  Each of the committers is remarkable on
his/her own.  So, we've got a collection of folks who are 3 standard
deviations out in their field who are all opinionated and used to being
right almost all the time.  I have the challenge of keeping this tremendous
group of people aligned and motivated.

Now, intersect this with the current time-constraints.  I have been a
nanny-less single parent for nearly the past month.  Derek is traveling with
his family and Marius and Tim are busy at work.  Debby's been occupied with
other gigs so I have less process help than I usually do.  I have to balance
between debates, supporting the increasing number of production sites (and,
yes, Naftoli, I have supported your production site... I was sitting in this
line: http://www.uplifting.me/the-h1n1-vaccine-line coding fixes for your
tickets to receive a "the names you chose, they're not so good" feedback
from you), the Scala 2.8 port, and the flood of newbies on the list.  So,
yeah, I don't spend 2+ hours a day debating... I make shorter fuse
decisions.

But, the "it's DPP's ball and he'll do with it what he wants" kind of
feedback bugs me at a very, very core level.


> -
> Jonathan Ferguson wrote:
>
> I was thinking about this earlier, if there is to be a 2.0 I would hope
> there was a chance to remove deprecated code.
>

Which particular deprecated code are you thinking.


> Also consider making breaking
> changes @dpp hasn't been in favour of making to date.
>

Which changes are you thinking about?


> Not to annoy him. As
> 1.X to 2.X is a big enough change that people who don't want to move can
> stay with a stable 1.X and those of us who are running HEAD/TRUNK whatever
> these new fangled git kids call it nowadays can keep racing along.
>

I'm not sure we have the resources to support a 1.X and a 2.X and a 2.7.x
and a 2.8.x branch.  If there are any folks who want to step up and maintain
a branch (or if there's money to hire someone), it's something worth a
discussion, but I don't think there's anyone I know of who could maintain a
1.X branch if we're going to get radical with a 2.X.  I think it's one
branch.


>
> Jono.
>
> 2009/11/17 Heiko Seeberger 
>
> > 2009/11/17 David Pollak 
> >
> >> The current Lift is not a major change to Lift 1.0, it's a minor
> >> progression and a lot of tuning of the developer experience.
> >>
> >
> > There are br

Re: [Lift] Re: Lots of compile-time cruft

2009-11-17 Thread Kris Nuttycombe
Very nice!

On Tue, Nov 17, 2009 at 10:16 AM, David Pollak
 wrote:
> Okay, there's a simple answer that satisfies everyone:
>
> case class ParamCalcInfo(paramNames: List[String],
>     params: Map[String, List[String]],
>     uploadedFiles: List[FileParamHolder],
>     body: Box[Array[Byte]])
>
>
>   lazy val ParamCalcInfo(paramNames: List[String],
>     params: Map[String, List[String]],
>     uploadedFiles: List[FileParamHolder],
>     body: Box[Array[Byte]]) = paramCalculator()
>
> No type erasure issues because the case class defines the types.  Optional
> (and in my opinion, necessary for at the very least documentation purposes)
> type declarations on the variables.  Better compiler enforcement than
> tuples.
>
> On Mon, Nov 16, 2009 at 10:30 PM, Kris Nuttycombe
>  wrote:
>>
>> On Mon, Nov 16, 2009 at 11:13 PM, David Pollak
>>  wrote:
>> >
>> >
>> > On Mon, Nov 16, 2009 at 5:01 PM, Alex Boisvert 
>> > wrote:
>> >>
>> >> On Mon, Nov 16, 2009 at 4:26 PM, David Pollak
>> >>  wrote:
>> >>>
>> >>> Speaking of warnings, which do you prefer (see patch below):
>> 
>>  1) Explicit types on val extractors (as it is today)
>>  2) One-liner with no types (proposed)
>> 
>>  We could save 4 warnings...
>> >>>
>> >>> Here's the cost of the 4 warnings:
>> >>>
>> >>> If you remove the type information and the lazy calculator thing
>> >>> changes
>> >>> how it does calculations, you'll silently get changed types (this has
>> >>> happened before) and that breaks things.  On the other hand, if we
>> >>> leave the
>> >>> code with explicit types, we'll get a match warning (with the type
>> >>> erasure
>> >>> stuff turned back off) if the type change.
>> >>
>> >> You get breakage if the types change in an incompatible manner in both
>> >> cases.
>> >>
>> >> I don't see how you get any added safety by adding the types
>> >> explicitly.
>> >
>> > You get type-safety in downstream code... the code that is accessing the
>> > variables.  You also avoid type inferencer problems.  The type
>> > inferencer
>> > doesn't always give you what you expect (it's not like Haskell).  Being
>> > explicit about what you expect is going to insure that the compiler does
>> > the
>> > right thing, even if it issues a spurious warning.
>> >
>> > So, why am I harping on this?
>>
>> The thing is, the compiler really *doesn't* do the right thing if you
>> supply the types. In fact, it will do the wrong thing if you change
>> the upstream code more frequently than it will do the right thing.
>>
>> Case in point: this compiles without complaint:
>>
>> object Test {
>>    class A
>>    class B extends A
>>
>>    val (a: A, b: B) = (new A, new A);
>> }
>>
>> It will fail at runtime with a MatchError or ClassCastException or
>> something equally nasty. If the types were not annotated, then the
>> downstream code would fail to compile.
>>
>> Kris
>>
>> > (1) This code was stuff I worked on to get right back in 2007.  It's
>> > stable
>> > and despite the aesthetic displeasure of a spurious warning, it does not
>> > need to change.
>> > (2) This code reflects a lot of work "getting it right" with the Scala
>> > compiler back when the Scala compiler was less stable.  I know the code
>> > currently works and I don't remember what kind of weirdness other
>> > variations
>> > on the code caused, but I don't want to find out if there are latent
>> > issues
>> > with the Scala compiler.
>> > (3) From a priority standpoint, this is suboptimal.  It's suboptimal for
>> > me
>> > to have to sell you on why it should not be changed.  It is suboptimal
>> > because there are open tickets for some real issues that real users need
>> > addressed.  If your bent is more oriented to getting to know the code,
>> > there's plenty of ScalaDocs and higher level documentation to write.
>> > (4) from a readibility standpoint, I like the code the way it is and
>> > it's
>> > most likely that if there's a problem or enhancement in that part of the
>> > code, it's me or Marius that're going to be fixing it.
>> >
>> >
>> >
>> >>
>> >> In both cases, the compiler has the same information about the types
>> >> and
>> >> perform the same amount of type checking for you.
>> >
>> >
>> >
>> >>
>> >> alex
>> >>
>> >> --
>> >>
>> >> 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=.
>> >
>> >
>> >
>> > --
>> > 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.
>> > T

Re: [Lift] Using Rewrite for proxy func

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 12:59 AM, maku  wrote:

> Hi,
>
> I'm new with Lift and have a question about rewrites.
>
> I would like to use Lift as a kind of proxy. e.g. a GWT client sends
> HTTP requests (GET,PUT,POST,DELETE's) with a special URI e.g.
>
> http://myhost:8080/xyz
>
> what I want is to forward the request (maybe after some checks) to
> another server (-> a couchdb -> e.g. http://myhost:5984/xyzdb/xyz)
>
> Is this possible with rewrites.


You also need an HTTP client library like Dispatch to make the HTTP
requests.


> What would be the best way to do this
> in Lift?
>
> My current (non Lift) approach is to use a servlet and apache's
> httpclient.
>

A reasonable approach.  Lift's rewrite are not web server style
proxy/reverse proxy style rewrites.

Thanks,

David


>
> TIA
> 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=.
>
>
>


-- 
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=.




[Lift] New feature: RequestMemoize & SesssionMemoize

2009-11-17 Thread David Pollak
Folks,

I've added request and session scope memoization helpers: RequestMemoize and
SessionMemoize.

These classes will help you cache values during the scope of a request or a
session (I think that latter is less valuable, but that's just me).

You can uses these like RequestVar and SessionVar:

object lookupCache extends RequestMemoize[String, Box[BlogPost]]

You can check on the existence of a value:

lookupCache.get("33"): Box[Box[BlogPost]]

Check for existence or create if not found:

lookupCache.get("33", BlogPost.find(33L))

Backing these structures is a RequestVar or SessionVar that contains an LRU
hashtable that defaults to 200 slots.

If you want to change the number of slots in the LRU hashtable:

object lookupCache extends RequestMemoize[String, Box[BlogPost]] {
  override protected def cacheSize: Int = 15 // max 15 items in cache
}

These items and extractors can be used during the rewrite phase to cache DB
entities and other "long" calculations:

object BlogPage {
  def unapply(page: String): Option[BlogPost] = lookupCache.get(page,
BlogPost.find(page))
}

case RewriteRequest(ParsePath("blog" :: "edit" :: BlogPage(page) :: Nil, _,
_,_), _, _) => // page will be an instance of BlogPost

I know Jeppe's be straying onto the Scala list asking about things like this
(you can run, but you can't hide... ;-) ).  I think this will help him and
others.

If you guys have any feature requests/enhancements, please let me know.

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=.




[Lift] Re: problems with tomcat

2009-11-17 Thread DavidV
I skipped the Test portion of mvn package by removing the testCompile
goal from my pom file under the maven-scala-plugin.  War packaging is
now working correctly, but the webapp still isn't deploying on the
remote Tomcat server...will keep at it and will post my solution if I
find one...  I think it still has to do with my database connection

On Nov 17, 10:41 am, DavidV  wrote:
> More specifically, I am trying to follow the stack trace to lead me to
> some sort of URL so that I can see where and why this connection is
> trying to be made.  I'm not sure why the AppTest needs to make a
> connection in the first place.  Can I just skip the Test portion of
> the mvn package command?  Or do I have hard code the proxy settings
> somewhere other than in my maven settings.xml file?  I'm still
> struggling with this problem...
>
> On Nov 16, 10:54 am, DavidV  wrote:
>
> > For the time being I have code that compiles correctly and I am
> > leaving eclipse completely out of the picture.  I am running Windows
> > Vista 64bit. I have quit eclipse and tried to run a "mvn clean
> > install" to rebuild my project, but I get the exact same error that I
> > previously posted (ConnectException) regarding the AppTest failure
> > when the install command executes the "TESTS".  Therefore, the build
> > fails.
> > ...
> > ---
> >  T E S T S
> > ---
> > Running net.genomas.lift.test.AppTest
> > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.199
> > sec <<< FA
> > ILURE!
>
> > Results :
>
> > Tests in error:
> >   testXml(net.genomas.lift.test.AppTest)
>
> > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
>
> > [INFO]
> > 
> > [ERROR] BUILD FAILURE
> > [INFO]
> > 
> > [INFO] There are test failures.
>
> > ...
>
> > If I run the project with "mvn cleantomcat:run" it works fine because
> > it doesn't execute the "TESTS" step.
>
> > I think that my problems with remotetomcatserver may stem from
> > eclipse messing up the correct maven packaging of the .war file.  I'm
> > still trying to figure out what is causing this ConnectException
> > whenever AppTest.scala is executed that is preventing me from
> > performing a normal "mvn package"
>
> > On Nov 13, 6:39 pm, David Pollak 
> > wrote:
>
> > > On Fri, Nov 13, 2009 at 9:15 AM, DavidV  
> > > wrote:
>
> > > > When running Lift-1.0.2 and Scala-2.7.5 I am able to compile and run
> > > > my code through maven.  However, I am concerned about my inability to
> > > > run the "mvn clean package" command successfully without first running
> > > > the "clean" command in eclipse.
>
> > > Yeah... Eclipse is generally a problem.
>
> > > Are you running Windows or Linux/Mac?
>
> > > Can you quite Eclipses before doing a build.
>
> > > >  I am afraid that this extra eclipse
> > > > step may be interfering with the proper creation of the .war file
> > > > which may be contributing to the problem.  When I try to execute "mvn
> > > > clean package" without eclipse I get the following error appearing in
> > > > my surefire-report:
>
> > > > ---
> > > > Test set: net.genomas.lift.test.AppTest
>
> > > > ---
> > > > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.251
> > > > sec <<< FAILURE!
> > > > testXml(net.genomas.lift.test.AppTest)  Time elapsed: 1.228 sec  <<<
> > > > ERROR!
> > > > java.net.ConnectException: Connection refused: connect
> > > >        at java.net.PlainSocketImpl.socketConnect(Native Method)
> > > >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> > > >        at 
> > > > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:
> > > > 195)
> > > >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> > > >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> > > >        at java.net.Socket.connect(Socket.java:525)
> > > >        at java.net.Socket.connect(Socket.java:475)
> > > >        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
> > > >        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
> > > >        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
> > > >        at sun.net.www.http.HttpClient.(HttpClient.java:233)
> > > >        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
> > > >        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
> > > >        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient
> > > > (HttpURLConnection.java:860)
> > > >        at sun.net.www.protocol.http.HttpURLConnection.plainConnect
> > > > (HttpURLConnection.java:801)
> > > >        at sun.net.www.protocol.http.HttpURLConnectio

Re: [Lift] Re: Lots of compile-time cruft

2009-11-17 Thread David Pollak
Okay, there's a simple answer that satisfies everyone:

case class ParamCalcInfo(paramNames: List[String],
params: Map[String, List[String]],
uploadedFiles: List[FileParamHolder],
body: Box[Array[Byte]])


  lazy val ParamCalcInfo(paramNames: List[String],
params: Map[String, List[String]],
uploadedFiles: List[FileParamHolder],
body: Box[Array[Byte]]) = paramCalculator()

No type erasure issues because the case class defines the types.  Optional
(and in my opinion, necessary for at the very least documentation purposes)
type declarations on the variables.  Better compiler enforcement than
tuples.

On Mon, Nov 16, 2009 at 10:30 PM, Kris Nuttycombe  wrote:

> On Mon, Nov 16, 2009 at 11:13 PM, David Pollak
>  wrote:
> >
> >
> > On Mon, Nov 16, 2009 at 5:01 PM, Alex Boisvert 
> > wrote:
> >>
> >> On Mon, Nov 16, 2009 at 4:26 PM, David Pollak
> >>  wrote:
> >>>
> >>> Speaking of warnings, which do you prefer (see patch below):
> 
>  1) Explicit types on val extractors (as it is today)
>  2) One-liner with no types (proposed)
> 
>  We could save 4 warnings...
> >>>
> >>> Here's the cost of the 4 warnings:
> >>>
> >>> If you remove the type information and the lazy calculator thing
> changes
> >>> how it does calculations, you'll silently get changed types (this has
> >>> happened before) and that breaks things.  On the other hand, if we
> leave the
> >>> code with explicit types, we'll get a match warning (with the type
> erasure
> >>> stuff turned back off) if the type change.
> >>
> >> You get breakage if the types change in an incompatible manner in both
> >> cases.
> >>
> >> I don't see how you get any added safety by adding the types explicitly.
> >
> > You get type-safety in downstream code... the code that is accessing the
> > variables.  You also avoid type inferencer problems.  The type inferencer
> > doesn't always give you what you expect (it's not like Haskell).  Being
> > explicit about what you expect is going to insure that the compiler does
> the
> > right thing, even if it issues a spurious warning.
> >
> > So, why am I harping on this?
>
> The thing is, the compiler really *doesn't* do the right thing if you
> supply the types. In fact, it will do the wrong thing if you change
> the upstream code more frequently than it will do the right thing.
>
> Case in point: this compiles without complaint:
>
> object Test {
>class A
>class B extends A
>
>val (a: A, b: B) = (new A, new A);
> }
>
> It will fail at runtime with a MatchError or ClassCastException or
> something equally nasty. If the types were not annotated, then the
> downstream code would fail to compile.
>
> Kris
>
> > (1) This code was stuff I worked on to get right back in 2007.  It's
> stable
> > and despite the aesthetic displeasure of a spurious warning, it does not
> > need to change.
> > (2) This code reflects a lot of work "getting it right" with the Scala
> > compiler back when the Scala compiler was less stable.  I know the code
> > currently works and I don't remember what kind of weirdness other
> variations
> > on the code caused, but I don't want to find out if there are latent
> issues
> > with the Scala compiler.
> > (3) From a priority standpoint, this is suboptimal.  It's suboptimal for
> me
> > to have to sell you on why it should not be changed.  It is suboptimal
> > because there are open tickets for some real issues that real users need
> > addressed.  If your bent is more oriented to getting to know the code,
> > there's plenty of ScalaDocs and higher level documentation to write.
> > (4) from a readibility standpoint, I like the code the way it is and it's
> > most likely that if there's a problem or enhancement in that part of the
> > code, it's me or Marius that're going to be fixing it.
> >
> >
> >
> >>
> >> In both cases, the compiler has the same information about the types and
> >> perform the same amount of type checking for you.
> >
> >
> >
> >>
> >> alex
> >>
> >> --
> >>
> >> 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=.
> >
> >
> >
> > --
> > 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=.
> >
>
> --
>
> You rece

Re: [Lift] Problem with issue 182

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 7:01 AM, Jeppe Nejsum Madsen wrote:

> Hi,
>
> Just updated to latest snapshot and noticed
> http://github.com/dpp/liftweb/issues/closed/#issue/182
>
> Imo, this is a bad idea since it makes it impossible to mixin Crudify
> to get easy user editing/listing.
>
> It's not a big problem for me since I have made my own Crudifyjust
> noticed it since I started out based on the original code :-)
>

Good catch.

Derek opened the ticket... it's his call as to what to do about this one.


>
> /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=.
>
>
>


-- 
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=.




Re: [Lift] Re: *** BREAKING CHANGES *** to Loc & LocParam

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 7:30 AM, Kris Nuttycombe
wrote:

> On Tue, Nov 17, 2009 at 7:37 AM, Jeppe Nejsum Madsen 
> wrote:
> > On Nov 17, 12:11 am, David Pollak 
> > wrote:
> >> On Mon, Nov 16, 2009 at 3:10 PM, Kris Nuttycombe
> >> wrote:
> >>
> >>
> >>
> >>
> >>
> >> > On Mon, Nov 16, 2009 at 4:02 PM, David Pollak
> >> >  wrote:
> >>
> >> > > On Mon, Nov 16, 2009 at 2:20 PM, Kris Nuttycombe <
> >> > kris.nuttyco...@gmail.com>
> >> > > wrote:
> >>
> >> > >> On Mon, Nov 16, 2009 at 3:13 PM, David Pollak
> >> > >>  wrote:
> >>
> >> > >> > On Mon, Nov 16, 2009 at 2:12 PM, Kris Nuttycombe
> >> > >> > 
> >> > >> > wrote:
> >>
> >> > >> >> Hi, all,
> >>
> >> > >> >> I was just informed that my changes broke MetaMegaProtoUser
> >> > >> >> interaction. I've reverted the commit until I can get that
> sorted
> >> > out.
> >>
> >> > >> > How was it broken?
> >>
> >> > >> It's something to do with how the login form is processed - at the
> >> > >> moment I haven't figured out anything more with that. Essentially,
> the
> >> > >> login fails silently and returns the user to the login form upon
> >> > >> submission.
> >>
> >> > > That sounds like a deeper issue with MetaProtoUser.  I'd keep your
> >> > changes
> >> > > and see why MegaProtoUser is failing.
> >>
> >> > Absolutely; I just figured I didn't want to leave people with broken
> >> > code while I figure it out since I'm not that familiar with
> >> > MegaProtoUser and am not sure how long that will take.
> >>
> >> Please check the code back in and get me a test case and I'll debug it.
> >>
> >> I've got about 20 tickets I'm working on right now... one more ain't
> gonna
> >> kill me. ;-)
> >
> > Did this ever get resolved? I'm still seeing this after an update to
> > latest. This is pretty major, so I looked into it and found this:
> >
> > 1) The Template LocParam defined on loginMenuLoc is never called on
> > form post, so the login method is never called during post. I assume
> > this worked before?
> > 2) If I change the bind for login to include a function that calls
> > login on submit, the login process works
> >
> > Not sure what the correct semantics are wrt 1) abovebut something
> > definately seem to have changed...
> >
> > /Jeppe
>
> I just noticed that David committed a fix. Thanks, David!
>

Certainly.  And thank you for your excellent enhancements to SiteMap.
Sometimes there's minor pain when there's forward progress... I'm here to
support thoughtful changes and the community when those changes have minor
issues.


>
> Kris
>
> --
>
> 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=.
>
>
>


-- 
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=.




Re: [Lift] RequestVar doesn't work in the Lift1.1-SNAPSHOT ?

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 8:23 AM, Neil.Lv  wrote:

> Hi all,
>
>  The RequestVar doesn't work in the Lift1.1-SNAPSHOT,
>
>   The error message is:
> ###
> object creation impossible, since method testWasSet in trait
> AnyVarTrait of type (String)Boolean is not defined
>  object currentItemVar extends RequestVar[Item]({
> ###
>
>  The code is :
> ###
>  object currentItemVar extends RequestVar[Item]({
>Item.getItemById(S.param("id").toString.toLong)
>  })
> ###
>
>  When updating the lift1.1's jars file, this code is broken.
>
>  Any help must be appreciated!
>

Please do a "mvn -U clean install"


>
> 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=.
>
>
>


-- 
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=.




[Lift] RequestVar doesn't work in the Lift1.1-SNAPSHOT ?

2009-11-17 Thread Neil.Lv
Hi all,

  The RequestVar doesn't work in the Lift1.1-SNAPSHOT,

   The error message is:
###
object creation impossible, since method testWasSet in trait
AnyVarTrait of type (String)Boolean is not defined
  object currentItemVar extends RequestVar[Item]({
###

  The code is :
###
  object currentItemVar extends RequestVar[Item]({
Item.getItemById(S.param("id").toString.toLong)
  })
###

  When updating the lift1.1's jars file, this code is broken.

  Any help must be appreciated!

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=.




Re: [Lift] Re: replay prevention tokens

2009-11-17 Thread Kris Nuttycombe
On Tue, Nov 17, 2009 at 7:25 AM, David Pollak
 wrote:
> The problem was related to some of the recent changes to SiteMap... there
> was a lazy var that should have been a def... so particular user-supplied
> functions were called only once.
>
> I've checked in a fix to this issue and it's being built right now:
> http://hudson.scala-tools.org/job/Lift/1409/
>
> If you continue to have issue, I'll be back online at ~ 8:30am PST (gotta
> get the kids to school).  I can cycle with if there are any more failing use
> cases.
>
> Sorry for the inconvenience.

Yikes, I wasn't expecting the dependencies on that side effect. Okay,
lesson learned. :P

Thanks for sorting that out for me. I apologize for the inconvenience.

Kris

> On Tue, Nov 17, 2009 at 5:45 AM, opyate  wrote:
>>
>> Thanks Indrajit.
>>
>> It could have very well been a code change introduced in the past day
>> or so, because I reverted my POM to 1.1-M7 (from 1.1-SNAPSHOT) and all
>> is fine now.
>>
>> The only override I have in my User companion object is:
>>
>> --START--
>>
>> override def logUserIn(who: User) {
>>    super.logUserIn(who)
>>    loadcert(S.param("password").open_!)
>>  }
>>
>>  private def loadcert(pw: String) = {
>>    import _root_.com.opyate.ken.util.crypto._
>>
>>    User.currentUser.map({user =>
>>      User.currentUser.open_!.securityModuleVar.is match {
>>        case Full(s) if s.isInitialised => {
>>          S.notice("Your private key was successfully initialised.")
>>        }
>>        case Empty => {
>>          try {
>>            val certPath = System.getProperty("certs")
>>            Log.debug("Loading certs from specified path " + certPath)
>>            // Since DBEntries need crypto functionality, it can be
>> argued that the error
>>            // should occur here.
>>            if (certPath == null) {
>>              val err = "Certs path not defined. Please define system
>> property -Dcerts=/path/to/certs"
>>              Log.error(err)
>>              S.error(err)
>>              S.redirectTo("/")
>>            } else {
>>              Log.debug("certs path is " + certPath)
>>            }
>>
>>            val sec = new Security()
>>            sec.setCryptoUtil(new CryptoUtil())
>>            val keyUtil = new KeyUtil()
>>            keyUtil.setPrivateKeyFile(certPath + "/" +
>> User.currentUser.open_!.email.toString);
>>            keyUtil.setPrivateKeyPassword(pw);
>>            keyUtil.setPublicKeyFile(certPath + "/x509.key");
>>            sec.setKeyUtil(keyUtil)
>>            User.currentUser.open_!.securityModuleVar(Full(sec))
>>
>>            // quick test
>>            {
>>              val sUnenc = "unencrypted text"
>>              val sEnc = sec.encrypt(sUnenc)
>>              val sDec = sec.decrypt(sEnc)
>>              assert(sDec == sUnenc)
>>            }
>>
>>            S.notice("Your private key was successfully initialised.")
>>          } catch {
>>            case e => {
>>
>>              S.warning("There was a problem initialising your private
>> key: " + e.getMessage)
>>            }
>>          }
>>        }
>>        case _ => {
>>          S.warning("There was a problem initialising your private
>> key.")
>>        }
>>      }
>>    }) openOr S.warning("There was a problem initialising your private
>> key.")
>>  }
>>
>> --END--
>>
>> This code is a work in progress, and uses the password from the login
>> form to initialise the user's private key (for decrypting sensitive
>> stuff later on).
>>
>> I would love to help find the problem, but I have a showcase tomorrow
>> (this is it!), so perhaps after.
>>
>> Thanks,
>> Juan
>>
>> On Nov 17, 12:26 pm, Indrajit Raychaudhuri 
>> wrote:
>> > See formFuncName in net/liftweb/http/S.scala (lift-webkit).
>> >
>> > Cheers, Indrajit
>> >
>> > On 17/11/09 5:25 PM, opyate wrote:
>> >
>> >
>> >
>> > > Hello Lifters,
>> >
>> > > Could someone please point out which part of the Lift code takes care
>> > > of generating unique names for form elements? (I'll delve in in the
>> > > interim)
>> >
>> > > I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
>> > > always) and since about an hour ago my login form doesn't render with
>> > > new tokens, and subsequent login attempts are ignored.
>> >
>> > > I am overriding a few of the login methods in ProtoUser and want to
>> > > investigate if I'm breaking anything.
>> >
>> > > Thanks,
>> > > Juan
>> >
>> > > --
>> >
>> > > 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
>> > > athttp://groups.google.com/group/liftweb?hl=.
>>
>> --
>>
>> 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 

[Lift] Re: Hosting problem, could PHP hosting front end the Liftweb? or is there cheap Liftweb hosting?

2009-11-17 Thread TylerWeir
If you just need a box to run a test app, pick one from 
http://www.lowendbox.com/.

I'm about to pull the trigger on a tinyvps.ca slice.
They're based in Toronto, as I am.

On Nov 17, 8:55 am, Jim Barrows  wrote:
> I use rackspace cloud servers (rackspacecloud.com) for my hosting.  runs me
> about 55/month for a medium sized server.  They have an API etc for
> autostarting servers, and shutting them down.
> Then you have the spring source
> stuffthat runs on
> Amazon, but gives you pushbutton deployment and autoscaling
> etc.
>
>
>
>
>
> On Mon, Nov 16, 2009 at 9:45 PM, philip  wrote:
> > Hi,
>
> > I will explain my problem, generally it is easy and cheap to get a PHP
> > hosting account, often my new customers for websites have a PHP
> > hosting as they are on the cheaper end of websites.
> > My real server is using dyndns and is located "at home".
>
> > Although I have one server, I cannot host many domains on it. So my
> > thought is that if I could write a PHP script I could use that to
> > "mirror" my real server, also conbined with a .htaccess. So a request
> > going to the PHP server hosting the domain would be re-directed to my
> > real server and the content sent back to the client.
> > I guess a iframe would work, but thats ugly. There's a few ways to do
> > this.
>
> > What about the Javascript and Ajax, could that work cross-domain? For
> > example, going directly to server rather than proxy by the PHP
> > hosting?
>
> > Well I'll try it out some time soon and put some followup info on
> > here.
>
> > This is all because its not so easy to get cheap Liftweb hosting! ...
> > or does anyone have a solution for that?
>
> > Thanks, Philip
>
> > --
>
> > 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=.
>
> --
> 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=.




[Lift] Re: problems with tomcat

2009-11-17 Thread DavidV
More specifically, I am trying to follow the stack trace to lead me to
some sort of URL so that I can see where and why this connection is
trying to be made.  I'm not sure why the AppTest needs to make a
connection in the first place.  Can I just skip the Test portion of
the mvn package command?  Or do I have hard code the proxy settings
somewhere other than in my maven settings.xml file?  I'm still
struggling with this problem...

On Nov 16, 10:54 am, DavidV  wrote:
> For the time being I have code that compiles correctly and I am
> leaving eclipse completely out of the picture.  I am running Windows
> Vista 64bit. I have quit eclipse and tried to run a "mvn clean
> install" to rebuild my project, but I get the exact same error that I
> previously posted (ConnectException) regarding the AppTest failure
> when the install command executes the "TESTS".  Therefore, the build
> fails.
> ...
> ---
>  T E S T S
> ---
> Running net.genomas.lift.test.AppTest
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.199
> sec <<< FA
> ILURE!
>
> Results :
>
> Tests in error:
>   testXml(net.genomas.lift.test.AppTest)
>
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
>
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO] There are test failures.
>
> ...
>
> If I run the project with "mvn cleantomcat:run" it works fine because
> it doesn't execute the "TESTS" step.
>
> I think that my problems with remotetomcatserver may stem from
> eclipse messing up the correct maven packaging of the .war file.  I'm
> still trying to figure out what is causing this ConnectException
> whenever AppTest.scala is executed that is preventing me from
> performing a normal "mvn package"
>
> On Nov 13, 6:39 pm, David Pollak 
> wrote:
>
> > On Fri, Nov 13, 2009 at 9:15 AM, DavidV  wrote:
>
> > > When running Lift-1.0.2 and Scala-2.7.5 I am able to compile and run
> > > my code through maven.  However, I am concerned about my inability to
> > > run the "mvn clean package" command successfully without first running
> > > the "clean" command in eclipse.
>
> > Yeah... Eclipse is generally a problem.
>
> > Are you running Windows or Linux/Mac?
>
> > Can you quite Eclipses before doing a build.
>
> > >  I am afraid that this extra eclipse
> > > step may be interfering with the proper creation of the .war file
> > > which may be contributing to the problem.  When I try to execute "mvn
> > > clean package" without eclipse I get the following error appearing in
> > > my surefire-report:
>
> > > ---
> > > Test set: net.genomas.lift.test.AppTest
>
> > > ---
> > > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.251
> > > sec <<< FAILURE!
> > > testXml(net.genomas.lift.test.AppTest)  Time elapsed: 1.228 sec  <<<
> > > ERROR!
> > > java.net.ConnectException: Connection refused: connect
> > >        at java.net.PlainSocketImpl.socketConnect(Native Method)
> > >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> > >        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:
> > > 195)
> > >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> > >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> > >        at java.net.Socket.connect(Socket.java:525)
> > >        at java.net.Socket.connect(Socket.java:475)
> > >        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
> > >        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
> > >        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
> > >        at sun.net.www.http.HttpClient.(HttpClient.java:233)
> > >        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
> > >        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
> > >        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient
> > > (HttpURLConnection.java:860)
> > >        at sun.net.www.protocol.http.HttpURLConnection.plainConnect
> > > (HttpURLConnection.java:801)
> > >        at sun.net.www.protocol.http.HttpURLConnection.connect
> > > (HttpURLConnection.java:726)
> > >        at sun.net.www.protocol.http.HttpURLConnection.getInputStream
> > > (HttpURLConnection.java:1049)
> > >        at
> > > com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity
> > > (XMLEntityManager.java:677)
> > >        at
> > > com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity
> > > (XMLEntityManager.java:1315)
> > >        at
> > > com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity
> > > (XMLEntityManager.java:1282)
> > >        at
> > > co

Re: [Lift] Re: *** BREAKING CHANGES *** to Loc & LocParam

2009-11-17 Thread Kris Nuttycombe
On Tue, Nov 17, 2009 at 7:37 AM, Jeppe Nejsum Madsen  wrote:
> On Nov 17, 12:11 am, David Pollak 
> wrote:
>> On Mon, Nov 16, 2009 at 3:10 PM, Kris Nuttycombe
>> wrote:
>>
>>
>>
>>
>>
>> > On Mon, Nov 16, 2009 at 4:02 PM, David Pollak
>> >  wrote:
>>
>> > > On Mon, Nov 16, 2009 at 2:20 PM, Kris Nuttycombe <
>> > kris.nuttyco...@gmail.com>
>> > > wrote:
>>
>> > >> On Mon, Nov 16, 2009 at 3:13 PM, David Pollak
>> > >>  wrote:
>>
>> > >> > On Mon, Nov 16, 2009 at 2:12 PM, Kris Nuttycombe
>> > >> > 
>> > >> > wrote:
>>
>> > >> >> Hi, all,
>>
>> > >> >> I was just informed that my changes broke MetaMegaProtoUser
>> > >> >> interaction. I've reverted the commit until I can get that sorted
>> > out.
>>
>> > >> > How was it broken?
>>
>> > >> It's something to do with how the login form is processed - at the
>> > >> moment I haven't figured out anything more with that. Essentially, the
>> > >> login fails silently and returns the user to the login form upon
>> > >> submission.
>>
>> > > That sounds like a deeper issue with MetaProtoUser.  I'd keep your
>> > changes
>> > > and see why MegaProtoUser is failing.
>>
>> > Absolutely; I just figured I didn't want to leave people with broken
>> > code while I figure it out since I'm not that familiar with
>> > MegaProtoUser and am not sure how long that will take.
>>
>> Please check the code back in and get me a test case and I'll debug it.
>>
>> I've got about 20 tickets I'm working on right now... one more ain't gonna
>> kill me. ;-)
>
> Did this ever get resolved? I'm still seeing this after an update to
> latest. This is pretty major, so I looked into it and found this:
>
> 1) The Template LocParam defined on loginMenuLoc is never called on
> form post, so the login method is never called during post. I assume
> this worked before?
> 2) If I change the bind for login to include a function that calls
> login on submit, the login process works
>
> Not sure what the correct semantics are wrt 1) abovebut something
> definately seem to have changed...
>
> /Jeppe

I just noticed that David committed a fix. Thanks, David!

Kris

--

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=.




[Lift] Re: *** BREAKING CHANGES *** to Loc & LocParam

2009-11-17 Thread Jeppe Nejsum Madsen


On Nov 17, 3:37 pm, Jeppe Nejsum Madsen  wrote:
> On Nov 17, 12:11 am, David Pollak 
> wrote:

[...]

> Did this ever get resolved? I'm still seeing this after an update to
> latest. This is pretty major, so I looked into it and found this:
>
> 1) The Template LocParam defined on loginMenuLoc is never called on
> form post, so the login method is never called during post. I assume
> this worked before?
> 2) If I change the bind for login to include a function that calls
> login on submit, the login process works

Saw your post in the other thread. The latest update seems to have
solved the issue...

/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=.




[Lift] Problem with issue 182

2009-11-17 Thread Jeppe Nejsum Madsen
Hi,

Just updated to latest snapshot and noticed
http://github.com/dpp/liftweb/issues/closed/#issue/182

Imo, this is a bad idea since it makes it impossible to mixin Crudify
to get easy user editing/listing. 

It's not a big problem for me since I have made my own Crudifyjust
noticed it since I started out based on the original code :-)

/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=.




[Lift] Re: *** BREAKING CHANGES *** to Loc & LocParam

2009-11-17 Thread Jeppe Nejsum Madsen
On Nov 17, 12:11 am, David Pollak 
wrote:
> On Mon, Nov 16, 2009 at 3:10 PM, Kris Nuttycombe
> wrote:
>
>
>
>
>
> > On Mon, Nov 16, 2009 at 4:02 PM, David Pollak
> >  wrote:
>
> > > On Mon, Nov 16, 2009 at 2:20 PM, Kris Nuttycombe <
> > kris.nuttyco...@gmail.com>
> > > wrote:
>
> > >> On Mon, Nov 16, 2009 at 3:13 PM, David Pollak
> > >>  wrote:
>
> > >> > On Mon, Nov 16, 2009 at 2:12 PM, Kris Nuttycombe
> > >> > 
> > >> > wrote:
>
> > >> >> Hi, all,
>
> > >> >> I was just informed that my changes broke MetaMegaProtoUser
> > >> >> interaction. I've reverted the commit until I can get that sorted
> > out.
>
> > >> > How was it broken?
>
> > >> It's something to do with how the login form is processed - at the
> > >> moment I haven't figured out anything more with that. Essentially, the
> > >> login fails silently and returns the user to the login form upon
> > >> submission.
>
> > > That sounds like a deeper issue with MetaProtoUser.  I'd keep your
> > changes
> > > and see why MegaProtoUser is failing.
>
> > Absolutely; I just figured I didn't want to leave people with broken
> > code while I figure it out since I'm not that familiar with
> > MegaProtoUser and am not sure how long that will take.
>
> Please check the code back in and get me a test case and I'll debug it.
>
> I've got about 20 tickets I'm working on right now... one more ain't gonna
> kill me. ;-)

Did this ever get resolved? I'm still seeing this after an update to
latest. This is pretty major, so I looked into it and found this:

1) The Template LocParam defined on loginMenuLoc is never called on
form post, so the login method is never called during post. I assume
this worked before?
2) If I change the bind for login to include a function that calls
login on submit, the login process works

Not sure what the correct semantics are wrt 1) abovebut something
definately seem to have changed...

/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=.




Re: [Lift] How to output un-escaped content from the database

2009-11-17 Thread David Pollak
On Tue, Nov 17, 2009 at 6:25 AM, philip  wrote:

> Hi,
>
> I am making a CMS, I have content in the database and I need to output
> it directly as HTML.
> It appears this is outputting my content as escaped HTML. Thats a good
> thing right, as it prevents hacking attacks, but I really want that
> HTML, how can I get it?
>

scala.xml.Unparsed

This will insert an unparsed stream of Chars into your XML page.

Use it with extreme care.


>
> class Content
> {
>  def display(in: NodeSeq): NodeSeq =
>{
>  val name = S.attr("name") openOr "0"
>  // Get the site content from the database
>  val content:SiteContent = SiteContent.findByUniqueName(name)
> openOr new SiteContent
>  // Return the content inside a DIV
>  {content.page_Content_Html}
>

{Unparsed(content.page_Content_Html)}


>}
> }
>
> Thanks!, Philip
>
> --
>
> 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=.
>
>
>


-- 
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=.




Re: [Lift] Re: replay prevention tokens

2009-11-17 Thread David Pollak
The problem was related to some of the recent changes to SiteMap... there
was a lazy var that should have been a def... so particular user-supplied
functions were called only once.

I've checked in a fix to this issue and it's being built right now:
http://hudson.scala-tools.org/job/Lift/1409/

If you continue to have issue, I'll be back online at ~ 8:30am PST (gotta
get the kids to school).  I can cycle with if there are any more failing use
cases.

Sorry for the inconvenience.

On Tue, Nov 17, 2009 at 5:45 AM, opyate  wrote:

> Thanks Indrajit.
>
> It could have very well been a code change introduced in the past day
> or so, because I reverted my POM to 1.1-M7 (from 1.1-SNAPSHOT) and all
> is fine now.
>
> The only override I have in my User companion object is:
>
> --START--
>
> override def logUserIn(who: User) {
>super.logUserIn(who)
>loadcert(S.param("password").open_!)
>  }
>
>  private def loadcert(pw: String) = {
>import _root_.com.opyate.ken.util.crypto._
>
>User.currentUser.map({user =>
>  User.currentUser.open_!.securityModuleVar.is match {
>case Full(s) if s.isInitialised => {
>  S.notice("Your private key was successfully initialised.")
>}
>case Empty => {
>  try {
>val certPath = System.getProperty("certs")
>Log.debug("Loading certs from specified path " + certPath)
>// Since DBEntries need crypto functionality, it can be
> argued that the error
>// should occur here.
>if (certPath == null) {
>  val err = "Certs path not defined. Please define system
> property -Dcerts=/path/to/certs"
>  Log.error(err)
>  S.error(err)
>  S.redirectTo("/")
>} else {
>  Log.debug("certs path is " + certPath)
>}
>
>val sec = new Security()
>sec.setCryptoUtil(new CryptoUtil())
>val keyUtil = new KeyUtil()
>keyUtil.setPrivateKeyFile(certPath + "/" +
> User.currentUser.open_!.email.toString);
>keyUtil.setPrivateKeyPassword(pw);
>keyUtil.setPublicKeyFile(certPath + "/x509.key");
>sec.setKeyUtil(keyUtil)
>User.currentUser.open_!.securityModuleVar(Full(sec))
>
>// quick test
>{
>  val sUnenc = "unencrypted text"
>  val sEnc = sec.encrypt(sUnenc)
>  val sDec = sec.decrypt(sEnc)
>  assert(sDec == sUnenc)
>}
>
>S.notice("Your private key was successfully initialised.")
>  } catch {
>case e => {
>
>  S.warning("There was a problem initialising your private
> key: " + e.getMessage)
>}
>  }
>}
>case _ => {
>  S.warning("There was a problem initialising your private
> key.")
>}
>  }
>}) openOr S.warning("There was a problem initialising your private
> key.")
>  }
>
> --END--
>
> This code is a work in progress, and uses the password from the login
> form to initialise the user's private key (for decrypting sensitive
> stuff later on).
>
> I would love to help find the problem, but I have a showcase tomorrow
> (this is it!), so perhaps after.
>
> Thanks,
> Juan
>
> On Nov 17, 12:26 pm, Indrajit Raychaudhuri 
> wrote:
> > See formFuncName in net/liftweb/http/S.scala (lift-webkit).
> >
> > Cheers, Indrajit
> >
> > On 17/11/09 5:25 PM, opyate wrote:
> >
> >
> >
> > > Hello Lifters,
> >
> > > Could someone please point out which part of the Lift code takes care
> > > of generating unique names for form elements? (I'll delve in in the
> > > interim)
> >
> > > I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
> > > always) and since about an hour ago my login form doesn't render with
> > > new tokens, and subsequent login attempts are ignored.
> >
> > > I am overriding a few of the login methods in ProtoUser and want to
> > > investigate if I'm breaking anything.
> >
> > > Thanks,
> > > Juan
> >
> > > --
> >
> > > 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 athttp://
> groups.google.com/group/liftweb?hl=.
>
> --
>
> 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=.
>
>
>


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

[Lift] How to output un-escaped content from the database

2009-11-17 Thread philip
Hi,

I am making a CMS, I have content in the database and I need to output
it directly as HTML.
It appears this is outputting my content as escaped HTML. Thats a good
thing right, as it prevents hacking attacks, but I really want that
HTML, how can I get it?

class Content
{
  def display(in: NodeSeq): NodeSeq =
{
  val name = S.attr("name") openOr "0"
  // Get the site content from the database
  val content:SiteContent = SiteContent.findByUniqueName(name)
openOr new SiteContent
  // Return the content inside a DIV
  {content.page_Content_Html}
}
}

Thanks!, Philip

--

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=.




Re: [Lift] Re: Call it Lift 2.0

2009-11-17 Thread Jim Barrows
On Mon, Nov 16, 2009 at 11:13 PM, Heiko Seeberger <
heiko.seeber...@googlemail.com> wrote:

> I think version numbers are idiotic, and created by the marketing
>> department, and not engineers.
>>
>
> I strongly disagree: An appropriate version strategy is not at all about
> marketing but expresses valuable information. In OSGi increasing the major
> version means breaking changes in the API, increasing the minor version
> means nonbreaking changes in the API and increasing the micro version means
> no changes to the API but only changes of the implementation. Further these
> versions are used to declare dependencies between modules (OSGi bundles)
> which results in a high degree of trust that different modules work
> seamlessly together. As Lift also is to support OSGi (already some support
> in place) it would be beneficial to stick to this version policy.
>


Version numbers only guarantee that the number is different.  What you call
"no changes to the API, but changes to the implementation', I call
"completely destroy my expectations of how this works, and therefore creates
a show stopper bug for me."  Which, by your logic should have been a more
major number.  And this entire argument proves my point.  I can counter
every argument you have for your scheme with real world epic fails that
happened because one person version of minor, is another persons version of
major.

The behavior of a method, it's implementation is part of the contract I have
with the library.  If you change the behavior I depend on, then that's
major.  No matter how minor  you might think the change.  Moving from a
hashmap to a list is a huge change, for a sufficiently large set of data for
instance.  I can think of several hundred other "minor" implementation
changes you can make, that can have drastic consequences to the calling
code.  So, just because you, or some committee think that the change is
"minor", I still have to thoroughly test everything that uses your library.
So calling it minor doesn't do me any good.

As to your "As Lift also is to support OSGi (already some support in place)
it would be beneficial to stick to this version policy" comment.  I counter
with "Lift works on Ubuntu it would be beneficial to stick to this version
policy" and of course "Lift runs on scala  it would be beneficial to stick
to this version policy", or better yet "Lift runs  on the Java VM it would
be beneficial to stick to this version policy."  All three of my arguments
have far more to do with Lift running then OSGI does.

Most important it's not KISS.  At least Ubuntu's year.month is simple.  Most
importantly it tells you that you need to test your stuff to make sure it
works because stuff has changed.  That's what I really need to know, that
and how old is my library.  How old is version 2.3.1?  A year?  two years?
6 months?  How do I know when to go looking for an updated version of the
library?



> I think a 2.0 needs more time with a 2.0 mindset.
>
> Once 2.0 is on the table there may be more redesign involved.
>
>
> I disagree: Versions should not express a mindset but information about
> (non)breaking API changes. That's all, no magic, no marketing, no mindset.
>
> Heiko Seeberger
>
> My job: weiglewilczek.com
> My blog: heikoseeberger.name
> Follow me: twitter.com/hseeberger
> OSGi on Scala: scalamodules.org
> Lift, the simply functional web framework: liftweb.net
>
> --
> 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=.
>



-- 
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=.




Re: [Lift] Hosting problem, could PHP hosting front end the Liftweb? or is there cheap Liftweb hosting?

2009-11-17 Thread Jim Barrows
I use rackspace cloud servers (rackspacecloud.com) for my hosting.  runs me
about 55/month for a medium sized server.  They have an API etc for
autostarting servers, and shutting them down.
Then you have the spring source
stuffthat runs on
Amazon, but gives you pushbutton deployment and autoscaling
etc.

On Mon, Nov 16, 2009 at 9:45 PM, philip  wrote:

> Hi,
>
> I will explain my problem, generally it is easy and cheap to get a PHP
> hosting account, often my new customers for websites have a PHP
> hosting as they are on the cheaper end of websites.
> My real server is using dyndns and is located "at home".
>
> Although I have one server, I cannot host many domains on it. So my
> thought is that if I could write a PHP script I could use that to
> "mirror" my real server, also conbined with a .htaccess. So a request
> going to the PHP server hosting the domain would be re-directed to my
> real server and the content sent back to the client.
> I guess a iframe would work, but thats ugly. There's a few ways to do
> this.
>
> What about the Javascript and Ajax, could that work cross-domain? For
> example, going directly to server rather than proxy by the PHP
> hosting?
>
> Well I'll try it out some time soon and put some followup info on
> here.
>
> This is all because its not so easy to get cheap Liftweb hosting! ...
> or does anyone have a solution for that?
>
> Thanks, Philip
>
> --
>
> 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=.
>
>
>


-- 
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=.




[Lift] Re: replay prevention tokens

2009-11-17 Thread opyate
Ah, thanks Jeppe :-)

I'll pop over to 1.1-SNAPSHOT later this week, then.

On Nov 17, 1:45 pm, opyate  wrote:
> Thanks Indrajit.
>
> It could have very well been a code change introduced in the past day
> or so, because I reverted my POM to 1.1-M7 (from 1.1-SNAPSHOT) and all
> is fine now.
>
> The only override I have in my User companion object is:
>
> --START--
>
> override def logUserIn(who: User) {
>     super.logUserIn(who)
>     loadcert(S.param("password").open_!)
>   }
>
>   private def loadcert(pw: String) = {
>     import _root_.com.opyate.ken.util.crypto._
>
>     User.currentUser.map({user =>
>       User.currentUser.open_!.securityModuleVar.is match {
>         case Full(s) if s.isInitialised => {
>           S.notice("Your private key was successfully initialised.")
>         }
>         case Empty => {
>           try {
>             val certPath = System.getProperty("certs")
>             Log.debug("Loading certs from specified path " + certPath)
>             // Since DBEntries need crypto functionality, it can be
> argued that the error
>             // should occur here.
>             if (certPath == null) {
>               val err = "Certs path not defined. Please define system
> property -Dcerts=/path/to/certs"
>               Log.error(err)
>               S.error(err)
>               S.redirectTo("/")
>             } else {
>               Log.debug("certs path is " + certPath)
>             }
>
>             val sec = new Security()
>             sec.setCryptoUtil(new CryptoUtil())
>             val keyUtil = new KeyUtil()
>             keyUtil.setPrivateKeyFile(certPath + "/" +
> User.currentUser.open_!.email.toString);
>             keyUtil.setPrivateKeyPassword(pw);
>             keyUtil.setPublicKeyFile(certPath + "/x509.key");
>             sec.setKeyUtil(keyUtil)
>             User.currentUser.open_!.securityModuleVar(Full(sec))
>
>             // quick test
>             {
>               val sUnenc = "unencrypted text"
>               val sEnc = sec.encrypt(sUnenc)
>               val sDec = sec.decrypt(sEnc)
>               assert(sDec == sUnenc)
>             }
>
>             S.notice("Your private key was successfully initialised.")
>           } catch {
>             case e => {
>
>               S.warning("There was a problem initialising your private
> key: " + e.getMessage)
>             }
>           }
>         }
>         case _ => {
>           S.warning("There was a problem initialising your private
> key.")
>         }
>       }
>     }) openOr S.warning("There was a problem initialising your private
> key.")
>   }
>
> --END--
>
> This code is a work in progress, and uses the password from the login
> form to initialise the user's private key (for decrypting sensitive
> stuff later on).
>
> I would love to help find the problem, but I have a showcase tomorrow
> (this is it!), so perhaps after.
>
> Thanks,
> Juan
>
> On Nov 17, 12:26 pm, Indrajit Raychaudhuri 
> wrote:
>
>
>
> > See formFuncName in net/liftweb/http/S.scala (lift-webkit).
>
> > Cheers, Indrajit
>
> > On 17/11/09 5:25 PM, opyate wrote:
>
> > > Hello Lifters,
>
> > > Could someone please point out which part of the Lift code takes care
> > > of generating unique names for form elements? (I'll delve in in the
> > > interim)
>
> > > I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
> > > always) and since about an hour ago my login form doesn't render with
> > > new tokens, and subsequent login attempts are ignored.
>
> > > I am overriding a few of the login methods in ProtoUser and want to
> > > investigate if I'm breaking anything.
>
> > > Thanks,
> > > Juan
>
> > > --
>
> > > 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 
> > > athttp://groups.google.com/group/liftweb?hl=.

--

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=.




[Lift] Re: replay prevention tokens

2009-11-17 Thread opyate
Thanks Indrajit.

It could have very well been a code change introduced in the past day
or so, because I reverted my POM to 1.1-M7 (from 1.1-SNAPSHOT) and all
is fine now.

The only override I have in my User companion object is:

--START--

override def logUserIn(who: User) {
super.logUserIn(who)
loadcert(S.param("password").open_!)
  }

  private def loadcert(pw: String) = {
import _root_.com.opyate.ken.util.crypto._

User.currentUser.map({user =>
  User.currentUser.open_!.securityModuleVar.is match {
case Full(s) if s.isInitialised => {
  S.notice("Your private key was successfully initialised.")
}
case Empty => {
  try {
val certPath = System.getProperty("certs")
Log.debug("Loading certs from specified path " + certPath)
// Since DBEntries need crypto functionality, it can be
argued that the error
// should occur here.
if (certPath == null) {
  val err = "Certs path not defined. Please define system
property -Dcerts=/path/to/certs"
  Log.error(err)
  S.error(err)
  S.redirectTo("/")
} else {
  Log.debug("certs path is " + certPath)
}

val sec = new Security()
sec.setCryptoUtil(new CryptoUtil())
val keyUtil = new KeyUtil()
keyUtil.setPrivateKeyFile(certPath + "/" +
User.currentUser.open_!.email.toString);
keyUtil.setPrivateKeyPassword(pw);
keyUtil.setPublicKeyFile(certPath + "/x509.key");
sec.setKeyUtil(keyUtil)
User.currentUser.open_!.securityModuleVar(Full(sec))

// quick test
{
  val sUnenc = "unencrypted text"
  val sEnc = sec.encrypt(sUnenc)
  val sDec = sec.decrypt(sEnc)
  assert(sDec == sUnenc)
}

S.notice("Your private key was successfully initialised.")
  } catch {
case e => {

  S.warning("There was a problem initialising your private
key: " + e.getMessage)
}
  }
}
case _ => {
  S.warning("There was a problem initialising your private
key.")
}
  }
}) openOr S.warning("There was a problem initialising your private
key.")
  }

--END--

This code is a work in progress, and uses the password from the login
form to initialise the user's private key (for decrypting sensitive
stuff later on).

I would love to help find the problem, but I have a showcase tomorrow
(this is it!), so perhaps after.

Thanks,
Juan

On Nov 17, 12:26 pm, Indrajit Raychaudhuri 
wrote:
> See formFuncName in net/liftweb/http/S.scala (lift-webkit).
>
> Cheers, Indrajit
>
> On 17/11/09 5:25 PM, opyate wrote:
>
>
>
> > Hello Lifters,
>
> > Could someone please point out which part of the Lift code takes care
> > of generating unique names for form elements? (I'll delve in in the
> > interim)
>
> > I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
> > always) and since about an hour ago my login form doesn't render with
> > new tokens, and subsequent login attempts are ignored.
>
> > I am overriding a few of the login methods in ProtoUser and want to
> > investigate if I'm breaking anything.
>
> > Thanks,
> > Juan
>
> > --
>
> > 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 
> > athttp://groups.google.com/group/liftweb?hl=.

--

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=.




Re: [Lift] replay prevention tokens

2009-11-17 Thread Jeppe Nejsum Madsen
opyate  writes:

[...]

> I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
> always) and since about an hour ago my login form doesn't render with
> new tokens, and subsequent login attempts are ignored.
>
> I am overriding a few of the login methods in ProtoUser and want to
> investigate if I'm breaking anything.

This is probably caused by these changes: 

http://groups.google.com/group/liftweb/browse_thread/thread/4ba3f0b12b2c412c

I'm seeing the same issue


/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=.




Re: [Lift] replay prevention tokens

2009-11-17 Thread Indrajit Raychaudhuri
See formFuncName in net/liftweb/http/S.scala (lift-webkit).

Cheers, Indrajit

On 17/11/09 5:25 PM, opyate wrote:
> Hello Lifters,
>
> Could someone please point out which part of the Lift code takes care
> of generating unique names for form elements? (I'll delve in in the
> interim)
>
> I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
> always) and since about an hour ago my login form doesn't render with
> new tokens, and subsequent login attempts are ignored.
>
> I am overriding a few of the login methods in ProtoUser and want to
> investigate if I'm breaking anything.
>
> Thanks,
> Juan
>
> --
>
> 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=.
>
>

--

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=.




[Lift] Re: How to use Box

2009-11-17 Thread opyate
On Nov 12, 1:55 pm, Ferdinand Chan  wrote:
> Opyate,
>
> Thanks for the example. But my scala knowledge seems not good enough
> to understand it.

Here's an excerpt from Box's Javadoc (http://scala-tools.org/scaladocs/
liftweb/1.0/net/liftweb/util/Box.html - this is v1.0 so I recommend
cloning the latest Lift code and looking at the doc and implementation
there):

The Box class is a container which is able to declare if it is Full
(containing a single non-null value) or Empty. It serves the same
purpose as the Option class from Scala standard library but adds
several features:
* you can transform it to a Failure object if it is Empty (with the ?~
method)
* you can chain failure messages on Failure Boxes
* you "run" a function on your Box, with a default value: Full(1).run
("zero") { x: String, y: Int => y.toString }
* you can "pass" a Box to a function for side effects: Full(1) $ { x:
Box[Int] => println(x openOr 0) }

So, essentially it's the same as Option, like so:

Option  : Box
Some   : Full
None: Empty

...but with extra bells and whistles.
Then, as you saw, there are various ways to "open" the Box and use
what's inside it :-)


>
> Will try to re-read it couple of times and try to understand it
>
> Cheers,
>
> Ferdinand
>
> On Nov 12, 8:06 pm, opyate  wrote:
>
>
>
> > Hey Ferdinand,
>
> > Here are a couple of examples:
>
> > import _root_.net.liftweb.common._
>
> >   val boxExample: Box[Int] => Int = {
> >     case Full(x) => x
> >     case Empty => 0
> >   }
>
> >   def boxExample2(boxedInt: Box[Int]): Int = {
> >     boxedInt.map({i =>
> >       i
> >     }) openOr 0
> >   }
>
> > On Nov 12, 12:28 am, Naftoli Gugenheim  wrote:
>
> > > What do you want to happen if you call "value" on an Empty?
>
> > > -
>
> > > Ferdinand Chan wrote:
>
> > > Wondering what's the normal practice of using a Box. As a Java
> > > developer, I always want to get the boxed value by a method named
> > > "Value" like
>
> > > val optionalContent = Full("This is optional")
>
> > > Log.info( " The optional content is " + optionalContent.value)
>
> > > But I know its not a valid way to do so in lift ( same for Option in
> > > Scala)
>
> > > From the book programming in Scala , there's an example
>
> > > val withDefault: Option[Int] => Int = {
> > > case Some(x) => x
> > > case None => 0
>
> > > }
>
> > > which suggest the use of match to retrieve the value of the boxed
> > > content. It make sense to me and I'm totally agree with the advantage
> > > of using match + option (Box) combination.
>
> > > However, as a newbie to Scala, I'm so tempted to use something
> > > like .Value to retrieve the box value .
>
> > > So, what's the normal way to use Box ?? Could someone kindly provide
> > > some example on how to use ? I tried to look through some source code
> > > of Lift but its not easy for a newbie :)
>
> > > 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=.




Re: [Lift] Re: Hitting a compiler bug (it seems)

2009-11-17 Thread Jeppe Nejsum Madsen
DMB  writes:

> Hmm, apparently all generators must be of the same type or down-cast
> to the same type. So
>
> def masters = for {
> sy <- selectedYear
> sm <- selectedMonth
> m = Master.getMastersWithTags(sy, sm)
> } yield m
>
> m.get // Do something with the list
>
> does the trick, but it's non-idiomatic.

Maybe. I was a bit surprised with this at first, but now it seems I'm
used to it :-) 

It boils down to the fact that for comprehensions are syntactic sugar on
top of map/flatMap/filter. You can see how the translation is done here:
http://programming-scala.labs.oreilly.com/ch13.html#OptionsAndForComprehensions

In essence, the result of the for{} yield has the same collection as
found in the first generator. In your case the first generator has type
Option[T] so the result of the expression is Option[Y] (where possibly X
!= Y)

/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=.




[Lift] replay prevention tokens

2009-11-17 Thread opyate
Hello Lifters,

Could someone please point out which part of the Lift code takes care
of generating unique names for form elements? (I'll delve in in the
interim)

I'm bleeding edge at the moment (1.1-SNAPSHOT and "mvn -U clean"
always) and since about an hour ago my login form doesn't render with
new tokens, and subsequent login attempts are ignored.

I am overriding a few of the login methods in ProtoUser and want to
investigate if I'm breaking anything.

Thanks,
Juan

--

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=.




Re: [Lift] Call it Lift 2.0

2009-11-17 Thread Eric Bowman
Sun doesn't bump the version unless they break backwards compatibility,
which they have (mostly) never done since JVM 1.0.  Those classfiles
still run!

Heiko Seeberger wrote:
> Hi,
>
> There has been a large amount of new stuff and also some breaking
> changes since Lift 1.0. As an OSGi guy I suggest we call the next
> version Lift 2.0, because increasing the major version number will
> show the world that there are breaking changes and/or cool new
> features. At least, this is how versions are used in OSGi land. OK, I
> know that Sun follows another version strategy (keeping the major
> version fixed to 1 forever) and the Scala folks also seem to be stick
> to 2.x (quite a lot people would like 2.8 to be 3.0), but IMHO this is
> no reason for Lift to follow the same mislead strategy. So what do you
> think?
>
> Heiko
>
> My job: weiglewilczek.com 
> My blog: heikoseeberger.name 
> Follow me: twitter.com/hseeberger 
> OSGi on Scala: scalamodules.org 
> Lift, the simply functional web framework: liftweb.net
> 
>
> --~--~-~--~~~---~--~~
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To post to this group, send email to liftweb@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
> -~--~~~~--~~--~--~---
>


-- 
Eric Bowman
Boboco Ltd
ebow...@boboco.ie
http://www.boboco.ie/ebowman/pubkey.pgp
+35318394189/+353872801532

--

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=.




[Lift] Using Rewrite for proxy func

2009-11-17 Thread maku
Hi,

I'm new with Lift and have a question about rewrites.

I would like to use Lift as a kind of proxy. e.g. a GWT client sends
HTTP requests (GET,PUT,POST,DELETE's) with a special URI e.g.

http://myhost:8080/xyz

what I want is to forward the request (maybe after some checks) to
another server (-> a couchdb -> e.g. http://myhost:5984/xyzdb/xyz)

Is this possible with rewrites. What would be the best way to do this
in Lift?

My current (non Lift) approach is to use a servlet and apache's
httpclient.

TIA
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=.




Re: [Lift] Ajax + Comet Chat across a Cluster

2009-11-17 Thread Margaret
use rabbitMQ

well, would u like give us your app url


-
mawei...@gmail.com
13585201588
http://maweis.com




On Tue, Nov 17, 2009 at 5:02 PM, aw  wrote:
> I am looking to add a Chat feature to my Lift app, demonstrating the
> Ajax + Comet whiz bang...  However, I do need to persist my chat
> messages (to a database), and I will have a cluster of (at least) 2
> nodes.  As a result, what recommendation is there to share an Ajax
> event across the cluster so that each node can respond with its Comet
> actor?
>
> Should I just go with JMS or database polling?  (Note that I expect to
> deploy on Tomcat...)
>
> --
>
> 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=.
>
>
>

--

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=.




[Lift] Re: mvn jetty:run silent error

2009-11-17 Thread Marcin Jurczuk
Today everything is OK.
Weird ...maybe moon phase was wrong yesterday : )


On 16 Lis, 18:39, Marcin Jurczuk  wrote:
> I dont' have any of variables mentioned by you (MAVEN_OPTS,JAVA_OPTS)
> Spaces in Windows paths are typical and for last 2 moths since I dig
> in lift there was no such problem.
>
> Marcin,
>
> On 16 Lis, 18:35, David Pollak  wrote:
>
> > On Mon, Nov 16, 2009 at 9:27 AM, Marcin Jurczuk  wrote:
>
> > > What spaces ..I don't see any spaces
>
> > -Xbootclasspath/a:C:
> > \Documents and Settings
> > uk\.m2\repository\org\scala-
> > lang\scala-library\2.7.7\scala-
> > library-2.7.7.jar
>
> > > ...and yesterday everything worked
> > > ok.
>
> > Do you have any MAVEN_OPTS or JAVA_OPTS or suchlike environment variables
> > set?
>
> > > About variables you were asked:
> > > S:\NetBeansProjects\lab-lift>echo %SCALA_HOME%
> > > C:\Program Files\scala
>
> > > S:\NetBeansProjects\lab-lift>echo %JAVA_HOME%
> > > C:\Program Files\Java\jre6
>
> > > S:\NetBeansProjects\lab-lift>
> > > scala bin, maven bin, and java bin are in %PATH%
>
> > > On 16 Lis, 18:10, David Pollak  wrote:
> > > > I'm just guessing here... but it looks like the spaces in path names is
> > > > causing confusion.
>
> > > > What are your environment variables?
>
> > > > On Mon, Nov 16, 2009 at 8:59 AM, Marcin Jurczuk 
> > > wrote:
>
> > > > > Hi group,
>
> > > > > I have weird problem with my lab-lift app. Since yesterday I can't
> > > > > bring up jetty up and running. There is no errro just after execute
> > > > > mvn jetty:run I'm getting prompt from cli after few seconds.
>
> > > > > Here is output from jety:run
> > > > > ===
> > > > > S:\NetBeansProjects\lab-lift>mvn jetty:run
> > > > > [INFO] Scanning for projects...
> > > > > [INFO]
>
> > > 
> > > > > [INFO] Building lab-lift
> > > > > [INFO]    task-segment: [jetty:run]
> > > > > [INFO]
>
> > > 
> > > > > [INFO] Preparing jetty:run
> > > > > [INFO] [resources:resources {execution: default-resources}]
> > > > > [WARNING] Using platform encoding (Cp1250 actually) to copy filtered
> > > > > resources, i.e. build is
> > > > > rm dependent!
> > > > > [INFO] Copying 0 resource
> > > > > [INFO] [yuicompressor:compress {execution: default}]
> > > > > [INFO] nb warnings: 0, nb errors: 0
> > > > > [INFO] [compiler:compile {execution: default-compile}]
> > > > > [INFO] Nothing to compile - all classes are up to date
> > > > > [INFO] [scala:compile {execution: default}]
> > > > > [INFO] Checking for multiple versions of scala
> > > > > [INFO] includes = [**/*.scala,**/*.java,]
> > > > > [INFO] excludes = []
> > > > > [INFO] Compiling 4 source files to S:\NetBeansProjects\lab-lift\target
> > > > > \classes
> > > > > [WARNING] jvmArgs are ignored when run in process :-classpath
> > > > > [WARNING] jvmArgs are ignored when run in process :
> > > > > [WARNING] jvmArgs are ignored when run in process 
> > > > > :-Xbootclasspath/a:C:
> > > > > \Documents and Settings
> > > > > uk\.m2\repository\org\scala-lang\scala-library\2.7.7\scala-
> > > > > library-2.7.7.jar
> > > > > S:\NetBeansProjects\lab-lift>
> > > > > 
> > > > > There is no error, no message even when using -e switch to maven..
> > > > > Any idea what can be wrong ?
> > > > > I deleted all maven repository, everything was downloaded again -
> > > > > problem still exists.
>
> > > > --
> > > > 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
>
> > --
> > 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=.




[Lift] Re: Hitting a compiler bug (it seems)

2009-11-17 Thread DMB
Hmm, apparently all generators must be of the same type or down-cast
to the same type. So

def masters = for {
sy <- selectedYear
sm <- selectedMonth
m = Master.getMastersWithTags(sy, sm)
} yield m

m.get // Do something with the list

does the trick, but it's non-idiomatic.

On Nov 17, 1:39 am, DMB  wrote:
> Darn it, apparently I'm not "getting" the more complex cases of for
> comprehensions at all. Returning a Box[Tag] from that function
> affected several other functions which expected Tag or null. So rather
> than pulling the value out of the box, I decided to modify the
> functions, borrowing heavily from the rewrite provided by David.
>
> Here's a fragment of a function which is supposed to get me a sequence
> of Master objects. Note that getMastersWithTags returns a (possibly
> empty) List[Master]:
>
>         def masters = for {
>             sy <- selectedYear
>             sm <- selectedMonth
>             m <- Master.getMastersWithTags(sy, sm)
>         } yield m
>
> Intuitively, this should produce a (possibly empty) sequence of object
> of type Master, right? First, selectedYear would be unboxed, then (if
> there's a year) the selected month, and then, if both values are
> available, the for loop should in theory iterate over the list
> produced by Master.getMastersWithTags(sy, sm) and produce a sequence
> of objects.
>
> NetBeans says:
>
> type mismatch:
>    found: List[Master]
>    required: net.liftweb.common.Box[?]
>
> and I'm not sure what exactly this means. Could someone clarify?
>
> On Nov 16, 10:51 pm, DMB  wrote:
>
> > Nice! And you're right. I'm trying to program in Scala as if it were
> > C# with a weird implementation of LINQ. And C# it is not.
>
> > But the thread was not really about this. The thread was about a bug
> > in the compiler, which still stands. And you can pry my return
> > statements out of my cold, dead hands. :-)
>
> > On Nov 16, 9:42 pm, David Pollak 
> > wrote:
>
> > > If you see the "return" statement in your program, you are likely doing
> > > something wrong.  It means that it's time to refactor your code so 
> > > there's a
> > > single return point from your method.  Using null is a red flag (use 
> > > Option
> > > or Box) and using vars (rather than vals) is a yellow flag.
>
> > > So, let's go through your code:
>
> > >    def findTagWithName(tags: List[Tag], name: String) : Tag = {
> > >        val t = tags.find(x => x.name == name)
> > >         return t.getOrElse(null)
> > >    }
>
> > > becomes:
>
> > >    def findTagWithName(tags: List[Tag], name: String): Box[Tag] =
> > >         tags.find(x => x.name == name)
>
> > >    def getCookieValue(name: String, default: String) : String = {
> > >        for(cookie <- S.findCookie(name); v <- cookie.value) {
> > >            return v
> > >        }
> > >        return default
> > >    }
>
> > > becomes:
>
> > >    def getCookieValue(name: String, default: String): String =
> > >        (for(cookie <- S.findCookie(name); v <- cookie.value)
> > >            yield v) openOr default
>
> > >    def getParamValue(name: String, default: String) : String = {
> > >        for(v <- S.param(name)) {
> > >            return v
> > >        }
> > >        return default
> > >    }
>
> > > becomes:
>
> > >    def getParamValue(name: String, default: String): String =
> > >       S.param(name) openOr default
> > > - Show quoted text -
>
> > >    def getSelectedTag(tags: List[Tag], cookieName: String, urlParam: 
> > > String)
> > > : Tag = {
> > >        var t : Tag = null
> > >        try {
> > >            if(tags.length == 0) {
> > >                return null
> > >            }
>
> > >            // See if tag name is present in the URL
> > >            val tagName = getParamValue(urlParam, "")
> > >            // If yes, check if a tag with this name is present in tags
> > >            t = findTagWithName(tags, tagName)
> > >            // If it is, write out the right cookie and return
> > >            if(t != null) {
> > >                return t
> > >            }
>
> > >            // if no, check the corresponding cookie
> > >            val cv = getCookieValue(cookieName, "")
> > >            if(cv != null) {
> > >                // and check if the tag with a name stored in cookie is
> > > present in tags
> > >                t = findTagWithName(tags, cv)
> > >                if(t != null) {
> > >                    return t
> > >                }
> > >            }
>
> > >            // otherwise just select the last tag from the list and write 
> > > out
> > > the cookie
> > >            t = tags.last
> > >            return t
> > >        } finally {
> > >            if(t != null) {
> > >                var c = HTTPCookie(cookieName, t.name).setMaxAge(365 * 24 *
> > > 60 * 60)
> > >                S.addCookie(c)
> > >            }
> > >        }
> > >    }
>
> > > becomes:
>
> > >    def getSelectedTag(tags: List[Tag], cookieName: String, urlParam:
>

Re: [Lift] Hosting problem, could PHP hosting front end the Liftweb? or is there cheap Liftweb hosting?

2009-11-17 Thread Thiébaut Champenier
> This is all because its not so easy to get cheap Liftweb hosting! ...
> or does anyone have a solution for that?
>

I don’t know how cheap this is going to be once out of beta, but at
stax.netthey have lift support.

--

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=.




Re: [Lift] Ajax + Comet Chat across a Cluster

2009-11-17 Thread Timothy Perrett
Considered Akka actors?

Whatever you do, dont do database polling - that would be a hacky solution. 

On 17 Nov 2009, at 09:02, aw wrote:

> I am looking to add a Chat feature to my Lift app, demonstrating the
> Ajax + Comet whiz bang...  However, I do need to persist my chat
> messages (to a database), and I will have a cluster of (at least) 2
> nodes.  As a result, what recommendation is there to share an Ajax
> event across the cluster so that each node can respond with its Comet
> actor?
> 
> Should I just go with JMS or database polling?  (Note that I expect to
> deploy on Tomcat...)
> 
> --
> 
> 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=.
> 
> 
> 

--

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=.




[Lift] Re: Hitting a compiler bug (it seems)

2009-11-17 Thread DMB
Darn it, apparently I'm not "getting" the more complex cases of for
comprehensions at all. Returning a Box[Tag] from that function
affected several other functions which expected Tag or null. So rather
than pulling the value out of the box, I decided to modify the
functions, borrowing heavily from the rewrite provided by David.

Here's a fragment of a function which is supposed to get me a sequence
of Master objects. Note that getMastersWithTags returns a (possibly
empty) List[Master]:

def masters = for {
sy <- selectedYear
sm <- selectedMonth
m <- Master.getMastersWithTags(sy, sm)
} yield m

Intuitively, this should produce a (possibly empty) sequence of object
of type Master, right? First, selectedYear would be unboxed, then (if
there's a year) the selected month, and then, if both values are
available, the for loop should in theory iterate over the list
produced by Master.getMastersWithTags(sy, sm) and produce a sequence
of objects.

NetBeans says:

type mismatch:
   found: List[Master]
   required: net.liftweb.common.Box[?]

and I'm not sure what exactly this means. Could someone clarify?

On Nov 16, 10:51 pm, DMB  wrote:
> Nice! And you're right. I'm trying to program in Scala as if it were
> C# with a weird implementation of LINQ. And C# it is not.
>
> But the thread was not really about this. The thread was about a bug
> in the compiler, which still stands. And you can pry my return
> statements out of my cold, dead hands. :-)
>
> On Nov 16, 9:42 pm, David Pollak 
> wrote:
>
> > If you see the "return" statement in your program, you are likely doing
> > something wrong.  It means that it's time to refactor your code so there's a
> > single return point from your method.  Using null is a red flag (use Option
> > or Box) and using vars (rather than vals) is a yellow flag.
>
> > So, let's go through your code:
>
> >    def findTagWithName(tags: List[Tag], name: String) : Tag = {
> >        val t = tags.find(x => x.name == name)
> >         return t.getOrElse(null)
> >    }
>
> > becomes:
>
> >    def findTagWithName(tags: List[Tag], name: String): Box[Tag] =
> >         tags.find(x => x.name == name)
>
> >    def getCookieValue(name: String, default: String) : String = {
> >        for(cookie <- S.findCookie(name); v <- cookie.value) {
> >            return v
> >        }
> >        return default
> >    }
>
> > becomes:
>
> >    def getCookieValue(name: String, default: String): String =
> >        (for(cookie <- S.findCookie(name); v <- cookie.value)
> >            yield v) openOr default
>
> >    def getParamValue(name: String, default: String) : String = {
> >        for(v <- S.param(name)) {
> >            return v
> >        }
> >        return default
> >    }
>
> > becomes:
>
> >    def getParamValue(name: String, default: String): String =
> >       S.param(name) openOr default
> > - Show quoted text -
>
> >    def getSelectedTag(tags: List[Tag], cookieName: String, urlParam: String)
> > : Tag = {
> >        var t : Tag = null
> >        try {
> >            if(tags.length == 0) {
> >                return null
> >            }
>
> >            // See if tag name is present in the URL
> >            val tagName = getParamValue(urlParam, "")
> >            // If yes, check if a tag with this name is present in tags
> >            t = findTagWithName(tags, tagName)
> >            // If it is, write out the right cookie and return
> >            if(t != null) {
> >                return t
> >            }
>
> >            // if no, check the corresponding cookie
> >            val cv = getCookieValue(cookieName, "")
> >            if(cv != null) {
> >                // and check if the tag with a name stored in cookie is
> > present in tags
> >                t = findTagWithName(tags, cv)
> >                if(t != null) {
> >                    return t
> >                }
> >            }
>
> >            // otherwise just select the last tag from the list and write out
> > the cookie
> >            t = tags.last
> >            return t
> >        } finally {
> >            if(t != null) {
> >                var c = HTTPCookie(cookieName, t.name).setMaxAge(365 * 24 *
> > 60 * 60)
> >                S.addCookie(c)
> >            }
> >        }
> >    }
>
> > becomes:
>
> >    def getSelectedTag(tags: List[Tag], cookieName: String, urlParam:
> > String): Box[Tag] = {
> >             // See if tag name is present in the URL
> >        def tagForParam =
> >         for {
> >           param <- S.param(urlParam)
> >           tag <- tags.find(_.name == param)
> >         } yield tag
>
> >       // check the corresponding cookie
> >       def tagForCookie =
> >         for {
> >           cookie <- S.findCookie(cookieName)
> >           value <- cookie.value
> >           tag <- tags.find(_.name == value)
> >         } yield tag
>
> >      val tag = tagForParam or tagForCookie or tags.lastOption
>
> >      tag.foreach( t =>
> >         S.addCookie

[Lift] Re: Database handling during rewrite

2009-11-17 Thread Jeppe Nejsum Madsen


On Nov 16, 7:46 pm, David Pollak 
wrote:
> On Mon, Nov 16, 2009 at 2:24 AM, Jeppe Nejsum Madsen wrote:
>
>
>
> > Hi,
>
> > I've solved my issues with using SessionVars during rewrite, but during
> > this, I noted that quite a few DB connections are created during the
> > rewrite phase: It seems every Mapper query opens a connection, executes
> > the query and then closes the connection.
>
> Yes.  The rewrite phase happens before any scope (other than request var).
> The "around" stuff is part of the S scope... so you don't get the
> transactional wrapping.
>
> After seeing all the thrashing that's going on here, I think I'm going to
> introduce a second re-write phase after the S scope has been entered.
> Basically, there'll be a stateless rewrite phase so you can do a rewrite
> that's going to deal with determining if it's a Lift request (or should be
> passed to the servlet filter chain) and to see if it matches the stateless
> stuff.
>
> The second rewrite phase will be within the S scope and have the
> SessionVars, etc. wrapped around it.
>
> I think this will address your issues.  Sound good?

Sounds great! While not completely understanding all implications, I
think this will solve the issues.

I could imagine scenarios where it would be beneficial to have a
single transaction that spans both rewrite phases, but can't think of
a good use case atm :-)

/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=.




[Lift] Ajax + Comet Chat across a Cluster

2009-11-17 Thread aw
I am looking to add a Chat feature to my Lift app, demonstrating the
Ajax + Comet whiz bang...  However, I do need to persist my chat
messages (to a database), and I will have a cluster of (at least) 2
nodes.  As a result, what recommendation is there to share an Ajax
event across the cluster so that each node can respond with its Comet
actor?

Should I just go with JMS or database polling?  (Note that I expect to
deploy on Tomcat...)

--

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=.




Re: [Lift] Re: How to "catch" sub-path urls and only render one page?

2009-11-17 Thread Thiébaut Champenier
Something like that yes, but it looks like a lot of repetition.
You can try to match like that:
  case RewriteRequest(ParsePath("page" :: rest, _, _,_), _,_) =>
and then build your map from the rest list, for example like that:
  Map() ++ (List("level1", "level2", "level3", "level4") zip rest)
this should be equivalent to your code.

Apparently we’re not in the same time zone ;-)

--

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=.




[Lift] Re: Call it Lift 2.0

2009-11-17 Thread Indrajit Raychaudhuri


On Nov 17, 11:38 am, Heiko Seeberger 
wrote:
> 2009/11/17 David Pollak 
>
> > The current Lift is not a major change to Lift 1.0, it's a minor
> > progression and a lot of tuning of the developer experience.
>
> There are breaking changes to the API which in the version policy suggested
> by me (the OSGi way) means increasing the major version number. OK, of
> course we need not stick to this particular version policy, but it would be
> beneficial to have one. What about: Increasing the minor version number
> (e.g. 1.0 -> 1.1) means breaking changes to the API. Increasing the micro
> version number (e.g. 1.1.0 -> 1.1.1) means *no* breaking changes to the API.

+1 This is the standpoint that's most aligned with the de-facto policy
that we have had with 1.0 series. We sure can follow this for 1.1
series too.
The only addition could be to start with an actual micro version
(1.1.0 instead of 1.1).

The other situation where a software bumps up to next higher version
is when it move to a major upstream products (and breaks backward
compatibility for the better).

Seeing through Lift, we can possibly state:

Lift 1.1.x: on Java 5/6 and Scala 2.7/2.8 [supports 2.8.x but backward
compatible with 2.7.x]
Lift 2.0.x: on Java 6 and Scala 2.8 [moving away from backward
compatibility with Java < 6 and Scala < 2.8.x and hence *major*
backward incompatible change]

- Indrajit

>
> Heiko
>
> My job: weiglewilczek.com
> My blog: heikoseeberger.name
> Follow me: twitter.com/hseeberger
> OSGi on Scala: scalamodules.org
> Lift, the simply functional web framework: liftweb.net

--

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=.