[Lift] Re: Debugging CometActors?

2008-12-10 Thread David Pollak
On Wed, Dec 10, 2008 at 7:51 PM, Jorge Ortiz <[EMAIL PROTECTED]> wrote:

> Yeah, something like that :)
>
> In the absence of props files, where does Log.error go? It's not showing up
> in the console...


Hmmm how about adding an additional handler to ActorWatcher to dump out
more info?


>
>
> And even then, something is kinda funky. After my actor dies, ctrl-c won't
> fully kill Jetty. I have to kill -9 it from another Terminal to make it
> fully die.
>
> --j
>
> On Wed, Dec 10, 2008 at 9:40 PM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>> You mean like:
>>
>> object ActorWatcher extends Actor {
>>   def act = loop {
>> react {
>>   case Exit(actor: Actor, why: Throwable) =>
>> failureFuncs.foreach(f => tryo(f(actor, why)))
>>   case _ =>
>> }
>>   }
>>
>>   private def startAgain(a: Actor, ignore: Throwable) {a.start}
>>
>>   private def logActorFailure(actor: Actor, why: Throwable) {
>> Log.error("The ActorWatcher restarted "+actor+" because "+why, why)
>>   }
>>
>>   /**
>>* If there's something to do in addition to starting the actor up,
>> pre-pend the
>>* actor to this List
>>*/
>>   var failureFuncs: List[(Actor, Throwable) => Unit] = logActorFailure _
>> ::
>>   startAgain _ :: Nil
>>
>>   this.start
>>   this.trapExit = true
>> }
>>
>>
>> Which CometActors link themselves to on startup?
>>
>> On Wed, Dec 10, 2008 at 7:32 PM, Jorge Ortiz <[EMAIL PROTECTED]>wrote:
>>
>>> Is there a good way to debug CometActors? Right now if a CometActor
>>> throws an exception, it gets swallowed silently, kills the actor, and Lift
>>> hangs waiting for a response from the now-dead actor until the timeout kicks
>>> in.
>>>
>>> If there aren't any debug mechanisms, are there any objections to me
>>> committing some code that will catch exceptions thrown by the actor and
>>> logging them for debugging purposes?
>>>
>>> --j
>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Collaborative Task Management http://much4.us
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Debugging CometActors?

2008-12-10 Thread Jorge Ortiz
Yeah, something like that :)

In the absence of props files, where does Log.error go? It's not showing up
in the console...

And even then, something is kinda funky. After my actor dies, ctrl-c won't
fully kill Jetty. I have to kill -9 it from another Terminal to make it
fully die.

--j

On Wed, Dec 10, 2008 at 9:40 PM, David Pollak <[EMAIL PROTECTED]
> wrote:

> You mean like:
>
> object ActorWatcher extends Actor {
>   def act = loop {
> react {
>   case Exit(actor: Actor, why: Throwable) =>
> failureFuncs.foreach(f => tryo(f(actor, why)))
>   case _ =>
> }
>   }
>
>   private def startAgain(a: Actor, ignore: Throwable) {a.start}
>
>   private def logActorFailure(actor: Actor, why: Throwable) {
> Log.error("The ActorWatcher restarted "+actor+" because "+why, why)
>   }
>
>   /**
>* If there's something to do in addition to starting the actor up,
> pre-pend the
>* actor to this List
>*/
>   var failureFuncs: List[(Actor, Throwable) => Unit] = logActorFailure _ ::
>   startAgain _ :: Nil
>
>   this.start
>   this.trapExit = true
> }
>
>
> Which CometActors link themselves to on startup?
>
> On Wed, Dec 10, 2008 at 7:32 PM, Jorge Ortiz <[EMAIL PROTECTED]>wrote:
>
>> Is there a good way to debug CometActors? Right now if a CometActor throws
>> an exception, it gets swallowed silently, kills the actor, and Lift hangs
>> waiting for a response from the now-dead actor until the timeout kicks in.
>>
>> If there aren't any debug mechanisms, are there any objections to me
>> committing some code that will catch exceptions thrown by the actor and
>> logging them for debugging purposes?
>>
>> --j
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Debugging CometActors?

2008-12-10 Thread David Pollak
You mean like:

object ActorWatcher extends Actor {
  def act = loop {
react {
  case Exit(actor: Actor, why: Throwable) =>
failureFuncs.foreach(f => tryo(f(actor, why)))
  case _ =>
}
  }

  private def startAgain(a: Actor, ignore: Throwable) {a.start}

  private def logActorFailure(actor: Actor, why: Throwable) {
Log.error("The ActorWatcher restarted "+actor+" because "+why, why)
  }

  /**
   * If there's something to do in addition to starting the actor up,
pre-pend the
   * actor to this List
   */
  var failureFuncs: List[(Actor, Throwable) => Unit] = logActorFailure _ ::
  startAgain _ :: Nil

  this.start
  this.trapExit = true
}


Which CometActors link themselves to on startup?

On Wed, Dec 10, 2008 at 7:32 PM, Jorge Ortiz <[EMAIL PROTECTED]> wrote:

> Is there a good way to debug CometActors? Right now if a CometActor throws
> an exception, it gets swallowed silently, kills the actor, and Lift hangs
> waiting for a response from the now-dead actor until the timeout kicks in.
>
> If there aren't any debug mechanisms, are there any objections to me
> committing some code that will catch exceptions thrown by the actor and
> logging them for debugging purposes?
>
> --j
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Debugging CometActors?

2008-12-10 Thread Jorge Ortiz
Is there a good way to debug CometActors? Right now if a CometActor throws
an exception, it gets swallowed silently, kills the actor, and Lift hangs
waiting for a response from the now-dead actor until the timeout kicks in.

If there aren't any debug mechanisms, are there any objections to me
committing some code that will catch exceptions thrown by the actor and
logging them for debugging purposes?

--j

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven problem - can't make ToDo example work - or even get off the ground.

2008-12-10 Thread Erick Fleming
What version of Maven are you using (mvn -version)?

Also, it may seem silly but you need to be connected to the internet for
Maven to work properly.

On Wed, Dec 10, 2008 at 6:29 PM, mike beckerle <[EMAIL PROTECTED]> wrote:

>
> Ok, that helped. Lots happened butI still get a bunch of errors.
> I can follow the instructions here in that it can't seem to download
> scala, but the lift-related stuff is a surprise to me.
>
> ...mike
>
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] Failed to resolve artifact.
>
> Missing:
> --
> 1) org.scala-lang:scala-library:jar:2.7.2
>
>  Try downloading the file manually from the project website.
>
>  Then, install it using the command:
>  mvn install:install-file -DgroupId=org.scala-lang -
> DartifactId=scala-library -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/
> to/file
>
>  Alternatively, if you host your own repository you can deploy the
> file there:
>  mvn deploy:deploy-file -DgroupId=org.scala-lang -
> DartifactId=scala-library -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/
> to/file -Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>1) com.liftworkshop:todo:war:1.0-SNAPSHOT
>2) org.scala-lang:scala-library:jar:2.7.2
>
> 2) net.liftweb:lift-core:jar:0.10-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-
> core -Dversion=0.10-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-
> core -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
> Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>1) com.liftworkshop:todo:war:1.0-SNAPSHOT
>2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
>
> 3) net.liftweb:lift-util:jar:0.10-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-
> util -Dversion=0.10-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-
> util -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
> Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>1) com.liftworkshop:todo:war:1.0-SNAPSHOT
>2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
>3) net.liftweb:lift-util:jar:0.10-SNAPSHOT
>
> 4) net.liftweb:lift-webkit:jar:0.10-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 -Dversion=0.10-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 -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
> Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>1) com.liftworkshop:todo:war:1.0-SNAPSHOT
>2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
>3) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT
>
> 5) net.liftweb:lift-mapper:jar:0.10-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 -Dversion=0.10-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 -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
> Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>1) com.liftworkshop:todo:war:1.0-SNAPSHOT
>2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
>3) net.liftweb:lift-mapper:jar:0.10-SNAPSHOT
>
> 6) net.liftweb:lift-machine:jar:0.10-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-
> machine -Dversion=0.10-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-
> machine -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
> Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>1) com.liftworkshop:todo:war:1.0-SNAPSHOT
>2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
>3) net.liftweb:lift-machine:jar:

[Lift] Re: maven problem - can't make ToDo example work - or even get off the ground.

2008-12-10 Thread Matt Harrington

Mike,

Did you set up your settings.xml file?

http://liftweb.net/index.php/Maven_Mini_Guide

I temporarily removed mine, and "todo" still builds and runs for me,
but that could be because I already had everything downloaded.

---Matt

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven problem - can't make ToDo example work - or even get off the ground.

2008-12-10 Thread mike beckerle

Ok, that helped. Lots happened butI still get a bunch of errors.
I can follow the instructions here in that it can't seem to download
scala, but the lift-related stuff is a surprise to me.

...mike

[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

Missing:
--
1) org.scala-lang:scala-library:jar:2.7.2

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=org.scala-lang -
DartifactId=scala-library -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/
to/file

  Alternatively, if you host your own repository you can deploy the
file there:
  mvn deploy:deploy-file -DgroupId=org.scala-lang -
DartifactId=scala-library -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/
to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) org.scala-lang:scala-library:jar:2.7.2

2) net.liftweb:lift-core:jar:0.10-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-
core -Dversion=0.10-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-
core -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) net.liftweb:lift-core:jar:0.10-SNAPSHOT

3) net.liftweb:lift-util:jar:0.10-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-
util -Dversion=0.10-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-
util -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
3) net.liftweb:lift-util:jar:0.10-SNAPSHOT

4) net.liftweb:lift-webkit:jar:0.10-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 -Dversion=0.10-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 -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
3) net.liftweb:lift-webkit:jar:0.10-SNAPSHOT

5) net.liftweb:lift-mapper:jar:0.10-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 -Dversion=0.10-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 -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
3) net.liftweb:lift-mapper:jar:0.10-SNAPSHOT

6) net.liftweb:lift-machine:jar:0.10-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-
machine -Dversion=0.10-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-
machine -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -
Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) com.liftworkshop:todo:war:1.0-SNAPSHOT
2) net.liftweb:lift-core:jar:0.10-SNAPSHOT
3) net.liftweb:lift-machine:jar:0.10-SNAPSHOT

7) net.liftweb:lift-record:jar:0.10-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-
record -Dversion=0.10-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

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

[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread TylerWeir

I'm glad it's up and running for you Dano.

On Dec 10, 7:14 pm, Dano <[EMAIL PROTECTED]> wrote:
> It WORKS! This is really cool.  I put the call to the
> MainGenericRunner.main function in a thread object and called start
> ().  I then did an import of my class and called a function and voila,
> it returned the expected value while the lift program is running in
> the other thread.  Poor man's debugger without having to add print()
> all over your code!
>
> So below is the complete sequence.  Thanks to Josh and Tyler for their
> support!
>
> % mvn scala:console
>
> scala> import scala.tools.nsc.MainGenericRunner
>
> scala> import org.codehaus.classworlds.Launcher
>
> scala> new bootstrap.liftweb.Boot().boot
>
> scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
> local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
> usr/local/apache-maven/apache-maven-2.0.9",
> "org.codehaus.classworlds.Launcher", "jetty:run").toArray
>
> scala> object ConsoleThread extends Thread { override def run =
> MainGenericRunner.main(args)}
>
> scala> ConsoleThread.start()
>
> scala> 
>
> On Dec 10, 3:47 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > Ok.  I got the app to run by adding 'jetty:run' as an argument after
> > the Launcher class.  However, the interpreter does not return to the
> > command prompt I stop it using -C.  Maybe I need to spawn a
> > thread with the expression 'MainGenericRunner.main(args)'.
>
> > Dan
>
> > On Dec 10, 3:28 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > > Nice catch.  Thanks Josh.
>
> > > Very close now.  For those that want to know, the sequence is below.
> > > Somehow mvn is not seeing the 'jetty:run' goal.
>
> > > % mvn scala:console jetty:run
>
> > > scala> import scala.tools.nsc.MainGenericRunner
>
> > > scala> import org.codehaus.classworlds.Launcher
>
> > > scala> new bootstrap.liftweb.Boot().boot
>
> > > scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
> > > local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
> > > usr/local/apache-maven/apache-maven-2.0.9",
> > > "org.codehaus.classworlds.Launcher").toArray
>
> > > scala> MainGenericRunner.main(args)
>
> > > [INFO] Scanning for projects...
> > > [INFO]
> > > 
> > > [ERROR] BUILD FAILURE
> > > [INFO]
> > > 
> > > [INFO]
>
> > > You must specify at least one goal. Try 'mvn install' to build or 'mvn
> > > -?' for options
> > > Seehttp://maven.apache.orgformoreinformation.
>
> > > [INFO]
> > > 
> > > [INFO] For more information, run Maven with the -e switch
> > > [INFO]
> > > 
> > > [INFO] Total time: < 1 second
> > > [INFO] Finished at: Wed Dec 10 15:18:31 PST 2008
> > > [INFO] Final Memory: 17M/162M
> > > [INFO]
> > > 
> > > [INFO]
> > > 
> > > [ERROR] BUILD FAILURE
>
> > > On Dec 10, 12:25 pm, "Josh Suereth" <[EMAIL PROTECTED]> wrote:
>
> > > > Typo in codehause, it should be org.codehaus.classworlds.Launcher.
>
> > > > On Wed, Dec 10, 2008 at 2:36 PM, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi Tyler!
>
> > > > > I am trying to run my lift app which I usually do by issuing 'mvn
> > > > > jetty:run'.  I believe this runs the class
> > > > > org.codehause.classworlds.Launcher with the arguments "-
> > > > > Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
> > > > > m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".
>
> > > > > Currently, I am trying to run MainGenericRunner.main(args) where I am
> > > > > stuffing the above into the args.  It complains that "error: value
> > > > > codehause is not a member of package org.  So maybe I just have to
> > > > > figure out how to import that class.
>
> > > > > Thanks.
>
> > > > > Dan
>
> > > > > On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> > > > > > What are you attempting?
>
> > > > > > if you run: import com.your.classpath.model._
> > > > > > You should be able to create and play with model objects.
>
> > > > > > What are you looking to do?
>
> > > > > > On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hello Lifters,
>
> > > > > > > I am looking into using the maven scala:console plugin as an aid 
> > > > > > > to
> > > > > > > debugging with the hope that I can start my lift app thru the 
> > > > > > > console,
> > > > > > > and then after it comes up, be able to issue calls to 'static' 
> > > > > > > methods
> > > > > > > which will return data which can help me see what is going on.  My
> > > > > > > attempts to use NetBeans as a debugger for my lift app have failed
> > > > > > > miserably.  I need a robust simple way to debu

[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread Dano

It WORKS! This is really cool.  I put the call to the
MainGenericRunner.main function in a thread object and called start
().  I then did an import of my class and called a function and voila,
it returned the expected value while the lift program is running in
the other thread.  Poor man's debugger without having to add print()
all over your code!

So below is the complete sequence.  Thanks to Josh and Tyler for their
support!

% mvn scala:console

scala> import scala.tools.nsc.MainGenericRunner

scala> import org.codehaus.classworlds.Launcher

scala> new bootstrap.liftweb.Boot().boot

scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
usr/local/apache-maven/apache-maven-2.0.9",
"org.codehaus.classworlds.Launcher", "jetty:run").toArray

scala> object ConsoleThread extends Thread { override def run =
MainGenericRunner.main(args)}

scala> ConsoleThread.start()

scala> 



On Dec 10, 3:47 pm, Dano <[EMAIL PROTECTED]> wrote:
> Ok.  I got the app to run by adding 'jetty:run' as an argument after
> the Launcher class.  However, the interpreter does not return to the
> command prompt I stop it using -C.  Maybe I need to spawn a
> thread with the expression 'MainGenericRunner.main(args)'.
>
> Dan
>
> On Dec 10, 3:28 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > Nice catch.  Thanks Josh.
>
> > Very close now.  For those that want to know, the sequence is below.
> > Somehow mvn is not seeing the 'jetty:run' goal.
>
> > % mvn scala:console jetty:run
>
> > scala> import scala.tools.nsc.MainGenericRunner
>
> > scala> import org.codehaus.classworlds.Launcher
>
> > scala> new bootstrap.liftweb.Boot().boot
>
> > scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
> > local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
> > usr/local/apache-maven/apache-maven-2.0.9",
> > "org.codehaus.classworlds.Launcher").toArray
>
> > scala> MainGenericRunner.main(args)
>
> > [INFO] Scanning for projects...
> > [INFO]
> > 
> > [ERROR] BUILD FAILURE
> > [INFO]
> > 
> > [INFO]
>
> > You must specify at least one goal. Try 'mvn install' to build or 'mvn
> > -?' for options
> > Seehttp://maven.apache.orgformore information.
>
> > [INFO]
> > 
> > [INFO] For more information, run Maven with the -e switch
> > [INFO]
> > 
> > [INFO] Total time: < 1 second
> > [INFO] Finished at: Wed Dec 10 15:18:31 PST 2008
> > [INFO] Final Memory: 17M/162M
> > [INFO]
> > 
> > [INFO]
> > 
> > [ERROR] BUILD FAILURE
>
> > On Dec 10, 12:25 pm, "Josh Suereth" <[EMAIL PROTECTED]> wrote:
>
> > > Typo in codehause, it should be org.codehaus.classworlds.Launcher.
>
> > > On Wed, Dec 10, 2008 at 2:36 PM, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Tyler!
>
> > > > I am trying to run my lift app which I usually do by issuing 'mvn
> > > > jetty:run'.  I believe this runs the class
> > > > org.codehause.classworlds.Launcher with the arguments "-
> > > > Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
> > > > m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".
>
> > > > Currently, I am trying to run MainGenericRunner.main(args) where I am
> > > > stuffing the above into the args.  It complains that "error: value
> > > > codehause is not a member of package org.  So maybe I just have to
> > > > figure out how to import that class.
>
> > > > Thanks.
>
> > > > Dan
>
> > > > On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> > > > > What are you attempting?
>
> > > > > if you run: import com.your.classpath.model._
> > > > > You should be able to create and play with model objects.
>
> > > > > What are you looking to do?
>
> > > > > On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello Lifters,
>
> > > > > > I am looking into using the maven scala:console plugin as an aid to
> > > > > > debugging with the hope that I can start my lift app thru the 
> > > > > > console,
> > > > > > and then after it comes up, be able to issue calls to 'static' 
> > > > > > methods
> > > > > > which will return data which can help me see what is going on.  My
> > > > > > attempts to use NetBeans as a debugger for my lift app have failed
> > > > > > miserably.  I need a robust simple way to debug and the console 
> > > > > > plug-
> > > > > > in seems like a good way to go.
>
> > > > > > Per the instructions located athttp://
> > > > scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> > > > > > I have done the following:
>
> > > > > >     % mvn scala:console jetty:run
> > > > > >

[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread Dano

Ok.  I got the app to run by adding 'jetty:run' as an argument after
the Launcher class.  However, the interpreter does not return to the
command prompt I stop it using -C.  Maybe I need to spawn a
thread with the expression 'MainGenericRunner.main(args)'.

Dan

On Dec 10, 3:28 pm, Dano <[EMAIL PROTECTED]> wrote:
> Nice catch.  Thanks Josh.
>
> Very close now.  For those that want to know, the sequence is below.
> Somehow mvn is not seeing the 'jetty:run' goal.
>
> % mvn scala:console jetty:run
>
> scala> import scala.tools.nsc.MainGenericRunner
>
> scala> import org.codehaus.classworlds.Launcher
>
> scala> new bootstrap.liftweb.Boot().boot
>
> scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
> local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
> usr/local/apache-maven/apache-maven-2.0.9",
> "org.codehaus.classworlds.Launcher").toArray
>
> scala> MainGenericRunner.main(args)
>
> [INFO] Scanning for projects...
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO]
>
> You must specify at least one goal. Try 'mvn install' to build or 'mvn
> -?' for options
> Seehttp://maven.apache.orgfor more information.
>
> [INFO]
> 
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> 
> [INFO] Total time: < 1 second
> [INFO] Finished at: Wed Dec 10 15:18:31 PST 2008
> [INFO] Final Memory: 17M/162M
> [INFO]
> 
> [INFO]
> 
> [ERROR] BUILD FAILURE
>
> On Dec 10, 12:25 pm, "Josh Suereth" <[EMAIL PROTECTED]> wrote:
>
> > Typo in codehause, it should be org.codehaus.classworlds.Launcher.
>
> > On Wed, Dec 10, 2008 at 2:36 PM, Dano <[EMAIL PROTECTED]> wrote:
>
> > > Hi Tyler!
>
> > > I am trying to run my lift app which I usually do by issuing 'mvn
> > > jetty:run'.  I believe this runs the class
> > > org.codehause.classworlds.Launcher with the arguments "-
> > > Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
> > > m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".
>
> > > Currently, I am trying to run MainGenericRunner.main(args) where I am
> > > stuffing the above into the args.  It complains that "error: value
> > > codehause is not a member of package org.  So maybe I just have to
> > > figure out how to import that class.
>
> > > Thanks.
>
> > > Dan
>
> > > On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> > > > What are you attempting?
>
> > > > if you run: import com.your.classpath.model._
> > > > You should be able to create and play with model objects.
>
> > > > What are you looking to do?
>
> > > > On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello Lifters,
>
> > > > > I am looking into using the maven scala:console plugin as an aid to
> > > > > debugging with the hope that I can start my lift app thru the console,
> > > > > and then after it comes up, be able to issue calls to 'static' methods
> > > > > which will return data which can help me see what is going on.  My
> > > > > attempts to use NetBeans as a debugger for my lift app have failed
> > > > > miserably.  I need a robust simple way to debug and the console plug-
> > > > > in seems like a good way to go.
>
> > > > > Per the instructions located athttp://
> > > scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> > > > > I have done the following:
>
> > > > >     % mvn scala:console jetty:run
> > > > >     
> > > > >     scala> new bootstrap.liftweb.Boot().boot
>
> > > > > However, jetty is not running yet and I am not sure how to prod into
> > > > > life.
>
> > > > > Has anyone tried this or have any suggestions?
>
> > > > > Thanks in advance.
>
> > > > > Dano
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven problem - can't make ToDo example work - or even get off the ground.

2008-12-10 Thread Jorge Ortiz
You need to cd into the project directory

  cd todo

--j

On Wed, Dec 10, 2008 at 5:30 PM, mike beckerle <[EMAIL PROTECTED]> wrote:

>
> Lifters,
>
> I tried to follow David Pollack's ToDo example to start trying out
> lift.
>
> It dies on me before we even get started. I am running maven 2.0.9 on
> Ubuntu.
>
> Any help resolving this greatly appreciated.
>
> The first big mvn command succeeds:
>
>  mvn archetype:create -U \
>  -DarchetypeGroupId=net.liftweb \
> -DarchetypeArtifactId=lift-archetype-basic \
> -DarchetypeVersion=0.10-SNAPSHOT \
> -DremoteRepositories=http://scala-tools.org/repo-snapshots \
> -DgroupId=com.liftworkshop -DartifactId=todo
>
> The next step fails:
>
> mvn jetty:run
>
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'jetty'.
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does
> not exist or no valid version could be found
> [INFO]
> 
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> 
> [INFO] Total time: < 1 second
> [INFO] Finished at: Tue Dec 09 18:54:24 EST 2008
> [INFO] Final Memory: 1M/4M
> [INFO]
> 
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] maven problem - can't make ToDo example work - or even get off the ground.

2008-12-10 Thread mike beckerle

Lifters,

I tried to follow David Pollack's ToDo example to start trying out
lift.

It dies on me before we even get started. I am running maven 2.0.9 on
Ubuntu.

Any help resolving this greatly appreciated.

The first big mvn command succeeds:

 mvn archetype:create -U \
 -DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-basic \
-DarchetypeVersion=0.10-SNAPSHOT \
-DremoteRepositories=http://scala-tools.org/repo-snapshots \
-DgroupId=com.liftworkshop -DartifactId=todo

The next step fails:

mvn jetty:run

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does
not exist or no valid version could be found
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: < 1 second
[INFO] Finished at: Tue Dec 09 18:54:24 EST 2008
[INFO] Final Memory: 1M/4M
[INFO]


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread Dano

Nice catch.  Thanks Josh.

Very close now.  For those that want to know, the sequence is below.
Somehow mvn is not seeing the 'jetty:run' goal.

% mvn scala:console jetty:run

scala> import scala.tools.nsc.MainGenericRunner

scala> import org.codehaus.classworlds.Launcher

scala> new bootstrap.liftweb.Boot().boot

scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
usr/local/apache-maven/apache-maven-2.0.9",
"org.codehaus.classworlds.Launcher").toArray

scala> MainGenericRunner.main(args)

[INFO] Scanning for projects...
[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO]

You must specify at least one goal. Try 'mvn install' to build or 'mvn
-?' for options
See http://maven.apache.org for more information.

[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: < 1 second
[INFO] Finished at: Wed Dec 10 15:18:31 PST 2008
[INFO] Final Memory: 17M/162M
[INFO]

[INFO]

[ERROR] BUILD FAILURE

On Dec 10, 12:25 pm, "Josh Suereth" <[EMAIL PROTECTED]> wrote:
> Typo in codehause, it should be org.codehaus.classworlds.Launcher.
>
> On Wed, Dec 10, 2008 at 2:36 PM, Dano <[EMAIL PROTECTED]> wrote:
>
> > Hi Tyler!
>
> > I am trying to run my lift app which I usually do by issuing 'mvn
> > jetty:run'.  I believe this runs the class
> > org.codehause.classworlds.Launcher with the arguments "-
> > Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
> > m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".
>
> > Currently, I am trying to run MainGenericRunner.main(args) where I am
> > stuffing the above into the args.  It complains that "error: value
> > codehause is not a member of package org.  So maybe I just have to
> > figure out how to import that class.
>
> > Thanks.
>
> > Dan
>
> > On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> > > What are you attempting?
>
> > > if you run: import com.your.classpath.model._
> > > You should be able to create and play with model objects.
>
> > > What are you looking to do?
>
> > > On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > Hello Lifters,
>
> > > > I am looking into using the maven scala:console plugin as an aid to
> > > > debugging with the hope that I can start my lift app thru the console,
> > > > and then after it comes up, be able to issue calls to 'static' methods
> > > > which will return data which can help me see what is going on.  My
> > > > attempts to use NetBeans as a debugger for my lift app have failed
> > > > miserably.  I need a robust simple way to debug and the console plug-
> > > > in seems like a good way to go.
>
> > > > Per the instructions located athttp://
> > scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> > > > I have done the following:
>
> > > >     % mvn scala:console jetty:run
> > > >     
> > > >     scala> new bootstrap.liftweb.Boot().boot
>
> > > > However, jetty is not running yet and I am not sure how to prod into
> > > > life.
>
> > > > Has anyone tried this or have any suggestions?
>
> > > > Thanks in advance.
>
> > > > Dano
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Problem with recursive MetaMapper types

2008-12-10 Thread Joachim A.

David,
thank you!  This worked out of the box.

Regards,
Joachim

> Important stuff in Bold.  Most notably, the type inferencer gets Lists
> wrong sometimes.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Problem with recursive MetaMapper types

2008-12-10 Thread David Pollak
 trait AbstractPersistentChannel[T <: AbstractPersistentChannel[T]] extends
LongKeyedMapper[T] {
self: T =>
  }

  trait AbstractPersistentMetaChannel[T <: AbstractPersistentChannel[T]]
 extends
  LongKeyedMetaMapper[T] {  self: T with AbstractPersistentMetaChannel[T]
=>}


class ChannelA extends AbstractPersistentChannel[ChannelA] with IdPK {
  def getSingleton = ChannelA
}
class ChannelB extends AbstractPersistentChannel[ChannelB]  with IdPK {
  def getSingleton = ChannelB
}

// And there are some objects which use that trait:

object ChannelA extends ChannelA with
AbstractPersistentMetaChannel[ChannelA]
object ChannelB extends ChannelB with
AbstractPersistentMetaChannel[ChannelB]

*type SomeMetaT = (AbstractPersistentMetaChannel[T] forSome {type T <:
AbstractPersistentChannel[T]})*
// I now have a list of those and have a can to store an element of that
list::
   var cType: Can[SomeMetaT] = Full(ChannelA)

   def showForm: JsCmd = {
 val form = cType.map(_.create.toForm(Empty, c => c.save())) openOr
Nil
JsCmds.Noop
   }

def createTypeSelect: Seq[(SomeMetaT, String)] = {
* List[(SomeMetaT, String)]*((ChannelA, "Channel A"),
  (ChannelB, "Channel B"))
}

Important stuff in Bold.  Most notably, the type inferencer gets Lists wrong
sometimes.

On Wed, Dec 10, 2008 at 1:42 PM, Joachim A. <[EMAIL PROTECTED]>wrote:

>
> David,
> that works much better. With a little help the compiler almost made it ;)
> There's now another problem with that I can't fix atm (I snipped the
> packages
> away).
>
> [WARNING] Channels.scala:83: error: type mismatch;
> [WARNING]  found   : ChannelA.type (with underlying type object ChannelA)
> [WARNING]  required: SomeMetaT
> [WARNING]   List((ChannelA, "Channel A"), (ChannelB, "Channel B"))
> [WARNING] ^
>
> //The code:
>
> type SomeMetaT = T forSome {type T <:
> AbstractPersistentMetaChannel[AbstractPersistentChannel[T]]}
>
> def createTypeSelect: Seq[(SomeMetaT, String)] = {
>  List((ChannelA, Channel A"), (ChannelB, "Channel B"))
> }
>
>
> // the classes and objects:
> object ChannelA extends ChannelA with
> AbstractPersistentMetaChannel[ChannelA]
> class ChannelA extends AbstractPersistentChannel[ChannelA] {...}
>
> Thanks for your help,
> Joachim
>
>
>
>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why JPA?

2008-12-10 Thread Derek Chen-Becker
I definitely think there's a place for extended EMs, so please don't think
that I'm trying to discourage you. I just want to make sure that you're
aware of the tradeoffs when you use an EM across sessions. If you get things
working, or even if you run into problems, please post to the list so that
we can work things out and others can benefit from the process. We're
working on making JPA more transparent and easier to use under Lift, so any
information on how people are using it and what kind of obstacles they're
running into is valuable.

Cheers!

Derek

On Tue, Dec 9, 2008 at 6:40 PM, philip <[EMAIL PROTECTED]> wrote:

>
> Hi Derek,
>
> Yes I don't really understand the lifecycle of stateful snippet. Only
> understand what I've seen in demo code, and really don't fully
> understand.
> My thinking is that its an object that hangs around as long as its
> used on the page, but hangs around on the server side as-if it is in a
> http session. Also it contains data that is shown on the page.
>
> Well I will play around with extended in code in Liftweb and see what
> happens, thats the only want I can be sure. From what I see in SEAM,
> they like it a lot and I have to do a SEAM project starting today so
> I'll know more about it.
>
> I used to work for a document management company, we did Hibernate
> years ago in the server side, a few things annoyed me. Also especially
> on a golf related project had simular problems.
> 1. When user A reads document, user B writes document, user A now
> attempts to write - using merge it over-writes user B's changes.
> 2. Couldn't navigate lazy associations on subsquent call-backs without
> re-loading from the database
>
> Thanks, Philip
>
>
> On Dec 10, 4:25 am, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> > I think you misunderstand the lifecycle of a stateful snippet. A stateful
> > snippet has specific techniques to keep it resident (using this.link,
> > this.redirect, etc) so you have to be careful about how you use it or you
> > lose the instance. The HTTP session would be the most appropriate place
> for
> > a JPA EM that crosses request boundaries because it will *always* be
> > available to snippets (I had forgotten about the EXTENDED type, I've
> never
> > used it).
> >
> > Another issue, orthogonal to how you keep the session around, is that
> when
> > you hold a session open you're also holding a transaction open unless you
> > use RESOURCE_LOCAL transactions (unmanaged JDBC connections,
> essentially).
> > That has implications on data visibility to other connections, how you
> > handle exceptions, etc.
> >
> > Don't get me wrong, I think that there's a place for extended JPA EMs, I
> > just want to make sure you're aware of all of the tradeoffs so that you
> > don't get any nasty surprises. It's my opinion that for most use cases
> > opening a session for each request (and the merge/getReference that doing
> it
> > this way implies) is the best way to do it. JPA providers are usually
> pretty
> > intelligent about efficiently using database operations to keep things
> > coherent, so I don't think that "avoiding merge" is necessarily a
> worthwhile
> > goal in and of itself.
> >
> > Cheers,
> >
> > Derek
> >
> >
> >
> > On Tue, Dec 9, 2008 at 6:39 AM, philip <[EMAIL PROTECTED]> wrote:
> >
> > > Hi Derek,
> >
> > > I think I found the solution to the problem I am thinking of.
> > > Its called JPA Extended Persistence Context. Its suggested that a
> > > extended persistence context be created which starts at some time and
> > > ends at some time and is stored in HttpSession. From the bits I read
> > > they said its no good to store in a Stateful Session Bean because the
> > > bean may be passivated and the context lost. Well we are not using
> > > stateful session bean so it doesn't matter, we can put it in the
> > > session or put it on some object that hands around like a session such
> > > as a ... in our case I believe a Snippet.
> >
> > > So in the JPA demo, you would then open as
> > >  override def openEM () = {
> > >val em = factory.createEntityManager
> > > (PersistenceContextType.EXTENDED)
> > >em.getTransaction().begin()
> > >em
> > >  }
> >
> > > So then I would suggest the em be stored in the snippet which is a
> > > stateful thing that hangs around.
> > > According to the docs, many transactions can happen on the em, until
> > > em.close() is called and therefore it is then flushed to the database.
> > > NORMALLY Extended persistence context is managed by the container,
> > > SEAM or EJB this is called container managed, but in our case we can
> > > do our own management. In EJB its something insane like this
> > > @Stateful
> > > @Remote(ShoppingCart.class)
> > > public class ShoppingCartBean implements ShoppingCart
> > > {
> > >   @PersistenceContext(type=PersistenceContextType.EXTENDED)
> > > EntityManager em;
> > > ...
> > > But we do it ourselves...
> > > Why do this? The benefit is that you can keep using the same JPA
> > > obje

[Lift] Re: Problem with recursive MetaMapper types

2008-12-10 Thread Joachim A.

David,
that works much better. With a little help the compiler almost made it ;)
There's now another problem with that I can't fix atm (I snipped the packages 
away).

[WARNING] Channels.scala:83: error: type mismatch;
[WARNING]  found   : ChannelA.type (with underlying type object ChannelA)
[WARNING]  required: SomeMetaT
[WARNING]   List((ChannelA, "Channel A"), (ChannelB, "Channel B"))
[WARNING] ^

//The code:

type SomeMetaT = T forSome {type T <: 
AbstractPersistentMetaChannel[AbstractPersistentChannel[T]]}

def createTypeSelect: Seq[(SomeMetaT, String)] = {
  List((ChannelA, Channel A"), (ChannelB, "Channel B"))
}


// the classes and objects:
object ChannelA extends ChannelA with AbstractPersistentMetaChannel[ChannelA]
class ChannelA extends AbstractPersistentChannel[ChannelA] {...}

Thanks for your help,
Joachim





--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Charles F. Munat

I'm not even sure there is a problem.

I have a complicated multi-page survey and on one page there is a table 
with multiple rows where each row is a separate object. You can add new 
blank rows and delete rows. To make it all more complicated, each field 
updates the database using AJAX onChange or onBlur.

One of the beta testers backed up to this page and the ajax row device 
failed, which caused all the scripts to shut down, which was a complete 
disaster since nothing was being updated (and there is no submit button).

I have not been able to duplicate this, and since this survey is only 
for two weeks and a few dozen people, I may just ask them to avoid the 
back button. But I was considering expiring pages so that when you 
backed up it forced a reload of the page (after that everything works fine).

Does this make any sense?

(Oh, and just to complicate things a bit more, I'm passing the survey 
back and forth in the URL via a guid, so it's more like /page_one/x, 
/page_two/x, etc. I make a hit on the database and reload the survey 
via a JPA query each time just to be sure I have the most up-to-date 
copy, and also so the users can link to the survey pages and come back 
to them later.)

Chas.

Tim Perrett wrote:
> Chas,
> 
> Can you detail exactly what the problem is when a user backs up? Do
> you have URLs like:
> 
> /questions-one
> /questions-two
> /questions-three
> 
> etc?
> 
> Users using the back button is a common problem faced by web-dev's the
> world over. Id be interested to hear exactly what your problem is and
> how using cache headers will help you?
> 
> IMO, cache headers like ETag and Cache-Control have a specific use and
> im not sure they are the right solution for your problem. For
> instance, I might use the caching headers as part of a conditional get
> strategy in a rest api...
> 
> Cheers
> 
> Tim
> > 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Charles F. Munat

I guess what I'm looking to do is mark pages expired, so when you back 
up you get either an expired message or an automatic reload. But I'm not 
sure this is necessary and hope to avoid it. Would be good to know how 
to do it, though.

There's a pretty interesting discussion about caching here:

http://www.mnot.net/cache_docs/#CONTROL

There's also a discussion here...

http://forums.asp.net/p/1013531/1898631.aspx

(using ASP.net) and they suggest the following:

AppendHeader("Cache-Control", "no-cache; private;
   no-store; must-revalidate; max-stale=0; post-check=0;
   pre-check=0; max-age=0"); // HTTP 1.1

AppendHeader("Pragma", "no-cache"); // HTTP 1.1

AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1

AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1

Hope that helps.

Chas.

David Pollak wrote:
> Charles,
> 
> Lift is supposed to mark all pages as non-cached.  If it's not doing 
> that, then there's a defect in Lift.
> 
> Can I ask that you give me a list of things I can send to the browser 
> (headers, meta-tags, etc.) that will indicate that the browser should 
> not cache the page.  I'll insure that all those things are sent.
> 
> Thanks,
> 
> David
> 
> On Wed, Dec 10, 2008 at 11:23 AM, Charles F. Munat <[EMAIL PROTECTED] 
> > wrote:
> 
> 
> Actually, I have a multi-page survey that updates the database when you
> change each field (there are no submit buttons). It works pretty well,
> but if the user backs up to a page after many changes have been made...
> 
> I'm not sure I'll do anything more than just tell them not to use the
> back button on the forms, but it might be better to force a reload of
> the page where possible. If I can expire it in the cache (or prevent it
> from being cached), then that should eliminate the problem.
> 
> That's my thinking anyway.
> 
> Thanks for the tip.
> 
> Chas.
> 
> Tim Perrett wrote:
>  > Chas,
>  >
>  > Look in HttpResppnse.scala - you'll see the LiftResponse subclasses
>  > that are setting custom headers and things. Also see TextResponse etc
>  > for more examples ( all in net.liftweb.http )
>  >
>  > I'm guessing you need this for some API or such?
>  >
>  > Cheers
>  >
>  > Tim
>  >
>  > Sent from my iPhone
>  >
>  > On 10 Dec 2008, at 02:00, "Charles F. Munat" <[EMAIL PROTECTED]
> > wrote:
>  >
>  >> I want to (attempt to) prevent the browser from caching certain
>  >> pages as
>  >> there is a problem if the user backs up to them. I can do this with
>  >> HTTP
>  >> headers, of course.
>  >>
>  >> Question: Is this functionality built-in to Lift? I could find
> nothing
>  >> on the wiki. If not, how does one set the HTTP headers on a page
> (and
>  >> from where)?
>  >>
>  >> Thanks.
>  >>
>  >> Chas.
>  >>
>  >
>  > >
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Problem with recursive MetaMapper types

2008-12-10 Thread David Pollak
How about:

  trait AbstractPersistentChannel[T <: AbstractPersistentChannel[T]] extends
LongKeyedMetaMapper[T] {  self: T =>}
  trait AbstractPersistentMetaChannel[T <: AbstractPersistentChannel[T]]
extends
LongKeyedMetaMapper[T] {  self: T =>}


class ChannelA extends AbstractPersistentChannel[ChannelA]
class ChannelB extends AbstractPersistentChannel[ChannelB]

// And there are some objects which use that trait:
object ChannelA extends ChannelA with
AbstractPersistentMetaChannel[ChannelA]
object ChannelB extends ChannelB with
AbstractPersistentMetaChannel[ChannelB]

type SomeMetaT = T forSome {type T <: AbstractPersistentMetaChannel[T]}
// I now have a list of those and have a can to store an element of that
list::
   var cType: Can[AbstractPersistentMetaChannel[SomeMetaT]] = Empty

   def showForm: JsCmd = {
 val form = cType.map(_.create.toForm(Empty, c => c.save())) openOr
Nil
JsCmds.Noop
   }


On Wed, Dec 10, 2008 at 11:41 AM, Joachim A.
<[EMAIL PROTECTED]>wrote:

>
> Hi,
> I hope this is not off-topic here.
> I have the problem that I can't find a type declaration for a collection of
> MetaMappers so that create.save  works on the meta mapper.
>
> I have a base class for a certain kind of mappers and the same for the meta
> class (I don't show the MetaMappers which are used here):
>
> trait AbstractPersistentMetaChannel[T <: AbstractPersistentChannel[T]]
> extends
> LongKeyedMetaMapper[T] {  self: T =>}
>
> And there are some objects which use that trait:
> object ChannelA extends ChannelA with
> AbstractPersistentMetaChannel[ChannelA]
> object ChannelB extends ChannelB with
> AbstractPersistentMetaChannel[ChannelB]
>
> I now have a list of those and have a can to store an element of that
> list::
>var cType: Can[AbstractPersistentMetaChannel[_ <:
> AbstractPersistentChannel[_]]] = Empty
>
>def showForm: JsCmd = {
>  val form = cType.map(_.create.toForm(Empty, c => c.save)) openOr
> NodeSeq.Empty
> //...
>}
>
> The compiler complains:
> [WARNING] Channels.scala:74: error: value save is not a member of _$2
> [WARNING]   val form = cType.map(t => t.create.toForm(Empty, c =>
> {c.save;ChannelList.startChannel(c)})) openOr NodeSeq.Empty
>
>
> Is there any way to define the type of cType so that save works?
>
> Hopefully I was able to explain the problem :) Any helps is appreciated,
> Joachim
>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread Josh Suereth
Typo in codehause, it should be org.codehaus.classworlds.Launcher.



On Wed, Dec 10, 2008 at 2:36 PM, Dano <[EMAIL PROTECTED]> wrote:

>
> Hi Tyler!
>
> I am trying to run my lift app which I usually do by issuing 'mvn
> jetty:run'.  I believe this runs the class
> org.codehause.classworlds.Launcher with the arguments "-
> Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
> m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".
>
> Currently, I am trying to run MainGenericRunner.main(args) where I am
> stuffing the above into the args.  It complains that "error: value
> codehause is not a member of package org.  So maybe I just have to
> figure out how to import that class.
>
> Thanks.
>
>
> Dan
>
> On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> > What are you attempting?
> >
> > if you run: import com.your.classpath.model._
> > You should be able to create and play with model objects.
> >
> > What are you looking to do?
> >
> > On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
> >
> > > Hello Lifters,
> >
> > > I am looking into using the maven scala:console plugin as an aid to
> > > debugging with the hope that I can start my lift app thru the console,
> > > and then after it comes up, be able to issue calls to 'static' methods
> > > which will return data which can help me see what is going on.  My
> > > attempts to use NetBeans as a debugger for my lift app have failed
> > > miserably.  I need a robust simple way to debug and the console plug-
> > > in seems like a good way to go.
> >
> > > Per the instructions located athttp://
> scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> > > I have done the following:
> >
> > > % mvn scala:console jetty:run
> > > 
> > > scala> new bootstrap.liftweb.Boot().boot
> >
> > > However, jetty is not running yet and I am not sure how to prod into
> > > life.
> >
> > > Has anyone tried this or have any suggestions?
> >
> > > Thanks in advance.
> >
> > > Dano
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Problem with recursive MetaMapper types

2008-12-10 Thread Joachim A.

Hi,
I hope this is not off-topic here.
I have the problem that I can't find a type declaration for a collection of 
MetaMappers so that create.save  works on the meta mapper.

I have a base class for a certain kind of mappers and the same for the meta 
class (I don't show the MetaMappers which are used here):

trait AbstractPersistentMetaChannel[T <: AbstractPersistentChannel[T]] extends 
LongKeyedMetaMapper[T] {  self: T =>}

And there are some objects which use that trait:
object ChannelA extends ChannelA with AbstractPersistentMetaChannel[ChannelA]
object ChannelB extends ChannelB with AbstractPersistentMetaChannel[ChannelB]

I now have a list of those and have a can to store an element of that list::
var cType: Can[AbstractPersistentMetaChannel[_ <: 
AbstractPersistentChannel[_]]] = Empty

def showForm: JsCmd = {
  val form = cType.map(_.create.toForm(Empty, c => c.save)) openOr 
NodeSeq.Empty
//...
}

The compiler complains:
[WARNING] Channels.scala:74: error: value save is not a member of _$2
[WARNING]   val form = cType.map(t => t.create.toForm(Empty, c => 
{c.save;ChannelList.startChannel(c)})) openOr NodeSeq.Empty


Is there any way to define the type of cType so that save works? 

Hopefully I was able to explain the problem :) Any helps is appreciated,
Joachim


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Tim Perrett

Chas,

Can you detail exactly what the problem is when a user backs up? Do
you have URLs like:

/questions-one
/questions-two
/questions-three

etc?

Users using the back button is a common problem faced by web-dev's the
world over. Id be interested to hear exactly what your problem is and
how using cache headers will help you?

IMO, cache headers like ETag and Cache-Control have a specific use and
im not sure they are the right solution for your problem. For
instance, I might use the caching headers as part of a conditional get
strategy in a rest api...

Cheers

Tim
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread Dano

Hi Tyler!

I am trying to run my lift app which I usually do by issuing 'mvn
jetty:run'.  I believe this runs the class
org.codehause.classworlds.Launcher with the arguments "-
Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".

Currently, I am trying to run MainGenericRunner.main(args) where I am
stuffing the above into the args.  It complains that "error: value
codehause is not a member of package org.  So maybe I just have to
figure out how to import that class.

Thanks.


Dan

On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> What are you attempting?
>
> if you run: import com.your.classpath.model._
> You should be able to create and play with model objects.
>
> What are you looking to do?
>
> On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > Hello Lifters,
>
> > I am looking into using the maven scala:console plugin as an aid to
> > debugging with the hope that I can start my lift app thru the console,
> > and then after it comes up, be able to issue calls to 'static' methods
> > which will return data which can help me see what is going on.  My
> > attempts to use NetBeans as a debugger for my lift app have failed
> > miserably.  I need a robust simple way to debug and the console plug-
> > in seems like a good way to go.
>
> > Per the instructions located 
> > athttp://scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> > I have done the following:
>
> >     % mvn scala:console jetty:run
> >     
> >     scala> new bootstrap.liftweb.Boot().boot
>
> > However, jetty is not running yet and I am not sure how to prod into
> > life.
>
> > Has anyone tried this or have any suggestions?
>
> > Thanks in advance.
>
> > Dano
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Loc, trailing slashes, and index files

2008-12-10 Thread David Pollak
On Tue, Dec 9, 2008 at 2:58 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> Awesome!
>
> Derek
>
> PS - I just got two of the same email from you at 4:25 and 4:38. Did you
> hit send twice or is something going on with the list?


I was on my EVDO modem in a poor coverage area and GMail told me that it
failed to deliver the message, so I hit "Send" again and I guess GMail
didn't de-dup the messages. :-)


>
>
> On Tue, Dec 9, 2008 at 4:38 PM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>> I looks like a defect to me.  I'll work on fixing it Thursday.
>>
>> On Tue, Dec 9, 2008 at 2:04 PM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>>
>>> This is both a comment and a question. I'd like to be able to have a Menu
>>> with a Loc pointing at "/help/". By using the strPairToLink method on the
>>> Loc object, I can use it as both an entry into the help system. This allows
>>> me to effectively bring up "/help/index" due to Lift converting trailing
>>> slashes to "/index", and I can use the boolean parameter to allow access to
>>> all files under the help subdirectory. In order to make this work, though, I
>>> need to define the menu like:
>>>
>>> val helpMenu = Menu(Loc("HelpHome", ("help" :: "" :: Nil) -> true,
>>> "Help"))
>>>
>>> Note the empty string as part of the path definition. If I omit this,
>>> then files under the help subdirectory are accessible, but the link
>>> generated by Menu.builder is "/help". Because it omits the trailing slash it
>>> seems that Lift tries to open the directory as a template XML file and I get
>>> an internal server error (500, stack trace at the end of the email). My
>>> question is whether this is the intended way of doing what I want, or if
>>> I've missed some other way to define this in a single Menu entry (yes, I
>>> could do two, with one hidden). With a server like apache, if I request a
>>> directory without the trailing slash it will respond with a 301 redirect to
>>> the same URL, but with a trailing slash. Should Lift be modified to follow
>>> this behavior?
>>>
>>> One more related issue is that even if I define my Menu as I've shown
>>> above, if I try to use "/help" in the URL without the trailing slash, I get
>>> a directory listing instead of the index.html, which I would expect.
>>>
>>> I'm not sure if this is all under Lift's purview or if some of it should
>>> be handled by chaining in the filter.
>>>
>>> Derek
>>>
>>> PS - Here's the stack trace if I omit the fake "slash":
>>>
>>> ERROR - Exception being returned to browser when processing Req(List(),
>>> Map(), ParsePath(List(help),,true,false), , GetRequest, null)
>>> java.lang.IllegalArgumentException: line 1 does not exist
>>> at scala.io.Source.getLine(Source.scala:280)
>>> at scala.io.Source.report(Source.scala:368)
>>> at scala.io.Source.reportError(Source.scala:355)
>>> at scala.io.Source.reportError(Source.scala:344)
>>> at
>>> scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1113)
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Collaborative Task Management http://much4.us
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread David Pollak
Charles,

Lift is supposed to mark all pages as non-cached.  If it's not doing that,
then there's a defect in Lift.

Can I ask that you give me a list of things I can send to the browser
(headers, meta-tags, etc.) that will indicate that the browser should not
cache the page.  I'll insure that all those things are sent.

Thanks,

David

On Wed, Dec 10, 2008 at 11:23 AM, Charles F. Munat <[EMAIL PROTECTED]> wrote:

>
> Actually, I have a multi-page survey that updates the database when you
> change each field (there are no submit buttons). It works pretty well,
> but if the user backs up to a page after many changes have been made...
>
> I'm not sure I'll do anything more than just tell them not to use the
> back button on the forms, but it might be better to force a reload of
> the page where possible. If I can expire it in the cache (or prevent it
> from being cached), then that should eliminate the problem.
>
> That's my thinking anyway.
>
> Thanks for the tip.
>
> Chas.
>
> Tim Perrett wrote:
> > Chas,
> >
> > Look in HttpResppnse.scala - you'll see the LiftResponse subclasses
> > that are setting custom headers and things. Also see TextResponse etc
> > for more examples ( all in net.liftweb.http )
> >
> > I'm guessing you need this for some API or such?
> >
> > Cheers
> >
> > Tim
> >
> > Sent from my iPhone
> >
> > On 10 Dec 2008, at 02:00, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> >
> >> I want to (attempt to) prevent the browser from caching certain
> >> pages as
> >> there is a problem if the user backs up to them. I can do this with
> >> HTTP
> >> headers, of course.
> >>
> >> Question: Is this functionality built-in to Lift? I could find nothing
> >> on the wiki. If not, how does one set the HTTP headers on a page (and
> >> from where)?
> >>
> >> Thanks.
> >>
> >> Chas.
> >>
> >
> > >
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Charles F. Munat

Actually, I have a multi-page survey that updates the database when you 
change each field (there are no submit buttons). It works pretty well, 
but if the user backs up to a page after many changes have been made...

I'm not sure I'll do anything more than just tell them not to use the 
back button on the forms, but it might be better to force a reload of 
the page where possible. If I can expire it in the cache (or prevent it 
from being cached), then that should eliminate the problem.

That's my thinking anyway.

Thanks for the tip.

Chas.

Tim Perrett wrote:
> Chas,
> 
> Look in HttpResppnse.scala - you'll see the LiftResponse subclasses  
> that are setting custom headers and things. Also see TextResponse etc  
> for more examples ( all in net.liftweb.http )
> 
> I'm guessing you need this for some API or such?
> 
> Cheers
> 
> Tim
> 
> Sent from my iPhone
> 
> On 10 Dec 2008, at 02:00, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> 
>> I want to (attempt to) prevent the browser from caching certain  
>> pages as
>> there is a problem if the user backs up to them. I can do this with  
>> HTTP
>> headers, of course.
>>
>> Question: Is this functionality built-in to Lift? I could find nothing
>> on the wiki. If not, how does one set the HTTP headers on a page (and
>> from where)?
>>
>> Thanks.
>>
>> Chas.
>>
> 
> > 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread TylerWeir

What are you attempting?

if you run: import com.your.classpath.model._
You should be able to create and play with model objects.

What are you looking to do?

On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
> Hello Lifters,
>
> I am looking into using the maven scala:console plugin as an aid to
> debugging with the hope that I can start my lift app thru the console,
> and then after it comes up, be able to issue calls to 'static' methods
> which will return data which can help me see what is going on.  My
> attempts to use NetBeans as a debugger for my lift app have failed
> miserably.  I need a robust simple way to debug and the console plug-
> in seems like a good way to go.
>
> Per the instructions located 
> athttp://scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> I have done the following:
>
>     % mvn scala:console jetty:run
>     
>     scala> new bootstrap.liftweb.Boot().boot
>
> However, jetty is not running yet and I am not sure how to prod into
> life.
>
> Has anyone tried this or have any suggestions?
>
> Thanks in advance.
>
> Dano
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] maven plugin - scala:console - how to for lift apps - debugging aid

2008-12-10 Thread Dano

Hello Lifters,

I am looking into using the maven scala:console plugin as an aid to
debugging with the hope that I can start my lift app thru the console,
and then after it comes up, be able to issue calls to 'static' methods
which will return data which can help me see what is going on.  My
attempts to use NetBeans as a debugger for my lift app have failed
miserably.  I need a robust simple way to debug and the console plug-
in seems like a good way to go.

Per the instructions located at 
http://scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
I have done the following:

% mvn scala:console jetty:run

scala> new bootstrap.liftweb.Boot().boot

However, jetty is not running yet and I am not sure how to prod into
life.

Has anyone tried this or have any suggestions?

Thanks in advance.


Dano
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: a simple screencast for making a sample app

2008-12-10 Thread David Pollak
Very nice work!

Thanks,

David

On Dec 8, 2008 1:40 AM, "Matt Harrington" <[EMAIL PROTECTED]> wrote:


I made a little screencast about creating a sample
"lift-archetype-basic" application.  I hadn't made a screencast
before, and it was actually trickier than I thought it'd be.  It's
challenging to read from a script and work at the terminal at the same
time.

It's mostly about installing Maven, and if you've ever built a sample
Lift app you won't get anything out of it, but perhaps absolute
beginners will find it helpful:

http://www.vimeo.com/2461367

I envision 3 parts, and started with part II.  Part I will be a brief
overview of Lift & Scala, and Part III will be about NetBeans.

---Matt


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Expiring pages via HTTP headers

2008-12-10 Thread Tim Perrett

Chas,

Look in HttpResppnse.scala - you'll see the LiftResponse subclasses  
that are setting custom headers and things. Also see TextResponse etc  
for more examples ( all in net.liftweb.http )

I'm guessing you need this for some API or such?

Cheers

Tim

Sent from my iPhone

On 10 Dec 2008, at 02:00, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:

>
> I want to (attempt to) prevent the browser from caching certain  
> pages as
> there is a problem if the user backs up to them. I can do this with  
> HTTP
> headers, of course.
>
> Question: Is this functionality built-in to Lift? I could find nothing
> on the wiki. If not, how does one set the HTTP headers on a page (and
> from where)?
>
> Thanks.
>
> Chas.
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: a simple screencast for making a sample app

2008-12-10 Thread David Bernard

Great initiative/job.

You could try an approach like wink (http://www.debugmode.com/wink/)
no voice/sond but info bubble to add after recording, a mix between
slideshow and video (I don't know if it's possible on Mac).

/davidB


On Wed, Dec 10, 2008 at 04:18, Matt Harrington <[EMAIL PROTECTED]> wrote:
>
> On Tue, Dec 9, 2008 at 8:58 AM, Dano <[EMAIL PROTECTED]> wrote:
>>
>> Matt,
>>
>> This is great.  I am looking forward to your Netbeans screencast.
>>
>> Thanks.
>>
>>
>> Dan
>
> I shot 75% of the NetBeans one last night, but screencasts are
> definitely more challenging than I first thought.  It's tricky reading
> from a script and doing something on the screen at the same time.  If
> I just wing it without a script, I end up rambling and saying "uhh" a
> lot, and the whole thing gets too lengthy.  I'm going to try a
> different strategy tonight.  Some people first capture the video, and
> then later add a voiceover track.  Might be easier to stay on topic
> that way.
>
> ---Matt
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: a simple screencast for making a sample app

2008-12-10 Thread Matt Harrington

On Tue, Dec 9, 2008 at 8:58 AM, Dano <[EMAIL PROTECTED]> wrote:
>
> Matt,
>
> This is great.  I am looking forward to your Netbeans screencast.
>
> Thanks.
>
>
> Dan

I shot 75% of the NetBeans one last night, but screencasts are
definitely more challenging than I first thought.  It's tricky reading
from a script and doing something on the screen at the same time.  If
I just wing it without a script, I end up rambling and saying "uhh" a
lot, and the whole thing gets too lengthy.  I'm going to try a
different strategy tonight.  Some people first capture the video, and
then later add a voiceover track.  Might be easier to stay on topic
that way.

---Matt

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Why JPA?

2008-12-10 Thread philip

Hi Derek,

Yes I don't really understand the lifecycle of stateful snippet. Only
understand what I've seen in demo code, and really don't fully
understand.
My thinking is that its an object that hangs around as long as its
used on the page, but hangs around on the server side as-if it is in a
http session. Also it contains data that is shown on the page.

Well I will play around with extended in code in Liftweb and see what
happens, thats the only want I can be sure. From what I see in SEAM,
they like it a lot and I have to do a SEAM project starting today so
I'll know more about it.

I used to work for a document management company, we did Hibernate
years ago in the server side, a few things annoyed me. Also especially
on a golf related project had simular problems.
1. When user A reads document, user B writes document, user A now
attempts to write - using merge it over-writes user B's changes.
2. Couldn't navigate lazy associations on subsquent call-backs without
re-loading from the database

Thanks, Philip


On Dec 10, 4:25 am, "Derek Chen-Becker" <[EMAIL PROTECTED]> wrote:
> I think you misunderstand the lifecycle of a stateful snippet. A stateful
> snippet has specific techniques to keep it resident (using this.link,
> this.redirect, etc) so you have to be careful about how you use it or you
> lose the instance. The HTTP session would be the most appropriate place for
> a JPA EM that crosses request boundaries because it will *always* be
> available to snippets (I had forgotten about the EXTENDED type, I've never
> used it).
>
> Another issue, orthogonal to how you keep the session around, is that when
> you hold a session open you're also holding a transaction open unless you
> use RESOURCE_LOCAL transactions (unmanaged JDBC connections, essentially).
> That has implications on data visibility to other connections, how you
> handle exceptions, etc.
>
> Don't get me wrong, I think that there's a place for extended JPA EMs, I
> just want to make sure you're aware of all of the tradeoffs so that you
> don't get any nasty surprises. It's my opinion that for most use cases
> opening a session for each request (and the merge/getReference that doing it
> this way implies) is the best way to do it. JPA providers are usually pretty
> intelligent about efficiently using database operations to keep things
> coherent, so I don't think that "avoiding merge" is necessarily a worthwhile
> goal in and of itself.
>
> Cheers,
>
> Derek
>
>
>
> On Tue, Dec 9, 2008 at 6:39 AM, philip <[EMAIL PROTECTED]> wrote:
>
> > Hi Derek,
>
> > I think I found the solution to the problem I am thinking of.
> > Its called JPA Extended Persistence Context. Its suggested that a
> > extended persistence context be created which starts at some time and
> > ends at some time and is stored in HttpSession. From the bits I read
> > they said its no good to store in a Stateful Session Bean because the
> > bean may be passivated and the context lost. Well we are not using
> > stateful session bean so it doesn't matter, we can put it in the
> > session or put it on some object that hands around like a session such
> > as a ... in our case I believe a Snippet.
>
> > So in the JPA demo, you would then open as
> >  override def openEM () = {
> >    val em = factory.createEntityManager
> > (PersistenceContextType.EXTENDED)
> >    em.getTransaction().begin()
> >    em
> >  }
>
> > So then I would suggest the em be stored in the snippet which is a
> > stateful thing that hangs around.
> > According to the docs, many transactions can happen on the em, until
> > em.close() is called and therefore it is then flushed to the database.
> > NORMALLY Extended persistence context is managed by the container,
> > SEAM or EJB this is called container managed, but in our case we can
> > do our own management. In EJB its something insane like this
> > @Stateful
> > @Remote(ShoppingCart.class)
> > public class ShoppingCartBean implements ShoppingCart
> > {
> >   @PersistenceContext(type=PersistenceContextType.EXTENDED)
> > EntityManager em;
> > ...
> > But we do it ourselves...
> > Why do this? The benefit is that you can keep using the same JPA
> > object references without doing a merge. So if you have a Employee
> > object which is a JPA/Hibernate object, and you changed its data and
> > you want to save it to the database, merge is not needed.
> > Why is that good? Because merge normally re-loads an entity from the
> > database at the merge call, then it overwrites the entity contents and
> > you might loose data that was previously written by another user!
> > (unless you used a version number). In our case without merge, then
> > the entity that was originally used by the EM is still in use. It is
> > not a detached entity. Also you can navigate lazy relationships from
> > request to request, from an Employee to a Manager which is really good
> > as you can just display a list of Employees, then when someone clicks
> > on the manager link of the employee it