[Lift] Re: JTA showSQL

2009-02-10 Thread Viktor Klang
Otherwise you can enable it in the logging:

log4j.logger.org.hibernate.SQL=DEBUG

On Tue, Feb 10, 2009 at 7:50 AM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 Interesting idea. I'll look into adding something like this (configurable
 at boot and/or runtime) into scalajpa.

 Derek


 On 2/9/09, Oliver ola...@gmail.com wrote:


 Hi Derek and interested parties

 I know there is a showSQL option that can be enabled with
 JTA/Hibernate but I find the output verbose and uninformative about
 parameter replacement.

 So, I have my own ScalaQuery that allows simple debugging - the main
 differences are -

 var queryParams: List[Pair[String,Any]] = Nil
/*  the following method needs to be called by the various
 SetParameter methods */
 def addParam(one: String,two: Any) = {
 query.setParameter(one, two)
 queryParams = (one, two) :: queryParams
 }
 /*
  output the query with parameters substitued, for debugging ...
  */
 def getQueryWithParams() = {
 var q = queryStr
 try {
 queryParams.foreach{v =
 var rep = v._2 match {
 case d: Date = '+SUtil.formatDate(d,
 dd/MM/)+'
 case s: String = '+s+'
 case x = if (x==null)  else x.toString
 }
 rep = rep.replaceAll(\\$, ddDollardd) // stupid bug
 q = q.replaceAll(:+v._1, rep)
 }
 q.replaceAll(ddDollardd, \\$)
 } catch {
 case e: Exception = q+ PARAMS +queryParams+  EXCEPTION +e
 }
 }

 With this I can log the query via
   Log.info(emailQuery.getQueryWithParams())

 Better still, (assuming execOnce exists in a utility object) when I
 only need to see the query once in the log
 /*
  execulte execFn, just once for the jvm.
  */
 val execOnceSet = scala.collection.mutable.Set()
 def execOnce(key: String, execFn: = Unit) = {
 if (!execOnceSet.contains(key)) {
 execOnceSet += key
 execFn
 }
 }

   execOnce(findByEmail,  Log.info(emailQuery.getQueryWithParams()) )


 You can add the functionality if you find it useful

 cheers
 Oliver


 



-- 
Viktor Klang
Senior Systems Analyst

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



[Lift] Re: JTA showSQL

2009-02-10 Thread Derek Chen-Becker
Yes, but that only works for Hibernate. I use Hibernate from everything, but
I'm trying to keep the library usable for any JPA provider.

Derek

On 2/10/09, Viktor Klang viktor.kl...@gmail.com wrote:

 Otherwise you can enable it in the logging:

 log4j.logger.org.hibernate.SQL=DEBUG

 On Tue, Feb 10, 2009 at 7:50 AM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 Interesting idea. I'll look into adding something like this (configurable
 at boot and/or runtime) into scalajpa.

 Derek


 On 2/9/09, Oliver ola...@gmail.com wrote:


 Hi Derek and interested parties

 I know there is a showSQL option that can be enabled with
 JTA/Hibernate but I find the output verbose and uninformative about
 parameter replacement.

 So, I have my own ScalaQuery that allows simple debugging - the main
 differences are -

 var queryParams: List[Pair[String,Any]] = Nil
/*  the following method needs to be called by the various
 SetParameter methods */
 def addParam(one: String,two: Any) = {
 query.setParameter(one, two)
 queryParams = (one, two) :: queryParams
 }
 /*
  output the query with parameters substitued, for debugging ...
  */
 def getQueryWithParams() = {
 var q = queryStr
 try {
 queryParams.foreach{v =
 var rep = v._2 match {
 case d: Date = '+SUtil.formatDate(d,
 dd/MM/)+'
 case s: String = '+s+'
 case x = if (x==null)  else x.toString
 }
 rep = rep.replaceAll(\\$, ddDollardd) // stupid bug
 q = q.replaceAll(:+v._1, rep)
 }
 q.replaceAll(ddDollardd, \\$)
 } catch {
 case e: Exception = q+ PARAMS +queryParams+  EXCEPTION
 +e
 }
 }

 With this I can log the query via
   Log.info(emailQuery.getQueryWithParams())

 Better still, (assuming execOnce exists in a utility object) when I
 only need to see the query once in the log
 /*
  execulte execFn, just once for the jvm.
  */
 val execOnceSet = scala.collection.mutable.Set()
 def execOnce(key: String, execFn: = Unit) = {
 if (!execOnceSet.contains(key)) {
 execOnceSet += key
 execFn
 }
 }

   execOnce(findByEmail,  Log.info(emailQuery.getQueryWithParams()) )


 You can add the functionality if you find it useful

 cheers
 Oliver






 --
 Viktor Klang
 Senior Systems Analyst

 


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



[Lift] Re: JTA showSQL

2009-02-10 Thread Viktor Klang
Is there a JPA defined way to turn loggin of DML on?

On Tue, Feb 10, 2009 at 3:45 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 Yes, but that only works for Hibernate. I use Hibernate from everything,
 but I'm trying to keep the library usable for any JPA provider.

 Derek

 On 2/10/09, Viktor Klang viktor.kl...@gmail.com wrote:

 Otherwise you can enable it in the logging:

 log4j.logger.org.hibernate.SQL=DEBUG

 On Tue, Feb 10, 2009 at 7:50 AM, Derek Chen-Becker dchenbec...@gmail.com
  wrote:

 Interesting idea. I'll look into adding something like this (configurable
 at boot and/or runtime) into scalajpa.

 Derek


 On 2/9/09, Oliver ola...@gmail.com wrote:


 Hi Derek and interested parties

 I know there is a showSQL option that can be enabled with
 JTA/Hibernate but I find the output verbose and uninformative about
 parameter replacement.

 So, I have my own ScalaQuery that allows simple debugging - the main
 differences are -

 var queryParams: List[Pair[String,Any]] = Nil
/*  the following method needs to be called by the various
 SetParameter methods */
 def addParam(one: String,two: Any) = {
 query.setParameter(one, two)
 queryParams = (one, two) :: queryParams
 }
 /*
  output the query with parameters substitued, for debugging ...
  */
 def getQueryWithParams() = {
 var q = queryStr
 try {
 queryParams.foreach{v =
 var rep = v._2 match {
 case d: Date = '+SUtil.formatDate(d,
 dd/MM/)+'
 case s: String = '+s+'
 case x = if (x==null)  else x.toString
 }
 rep = rep.replaceAll(\\$, ddDollardd) // stupid bug
 q = q.replaceAll(:+v._1, rep)
 }
 q.replaceAll(ddDollardd, \\$)
 } catch {
 case e: Exception = q+ PARAMS +queryParams+  EXCEPTION
 +e
 }
 }

 With this I can log the query via
   Log.info(emailQuery.getQueryWithParams())

 Better still, (assuming execOnce exists in a utility object) when I
 only need to see the query once in the log
 /*
  execulte execFn, just once for the jvm.
  */
 val execOnceSet = scala.collection.mutable.Set()
 def execOnce(key: String, execFn: = Unit) = {
 if (!execOnceSet.contains(key)) {
 execOnceSet += key
 execFn
 }
 }

   execOnce(findByEmail,  Log.info(emailQuery.getQueryWithParams()) )


 You can add the functionality if you find it useful

 cheers
 Oliver






 --
 Viktor Klang
 Senior Systems Analyst




 



-- 
Viktor Klang
Senior Systems Analyst

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



[Lift] Re: lift with MS Sequel

2009-02-10 Thread David Pollak
Folks,

Al Thompson just checked in support for SQL Server and Oracle.  Please test
these configurations.

Thanks,

David

On Mon, Feb 9, 2009 at 9:12 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Sun, Feb 8, 2009 at 10:16 PM, Amit Kumar Verma cdac.a...@gmail.comwrote:


 Hi,

 do lift support MSSQL db ?


 Lift's mapper currently supports PostgreSQL, MySQL, Derby, H2, etc.

 I'm expecting MS SQL and Oracle support by end of week.

 You can use JPA for other DB support.





 Thanks
 Amit Kumar Verma

 



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




-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] **Important** Please test 0.11-SNAPSHOT

2009-02-10 Thread David Pollak
Folks,

We are in the last few weeks before we launch Lift 1.0.

The current 0.11-SNAPSHOT is pretty much Lift 1.0, but I'd like to get it
tested as much as possible.

Please update your projects to use 0.11-SNAPSHOT and report whatever bugs
you can find.

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
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



Re: Fwd: [Lift] Cleaning up warnings

2009-02-10 Thread David Pollak
Eric,

You fixed it in 1.4.3-SNAPSHOT.

Please let us know when you've upgraded 1.4.3 to release.

Thanks,

David

On Mon, Feb 2, 2009 at 12:40 AM, etorreborre etorrebo...@gmail.com wrote:


 Hi David and Rickard,

 If you replace property(...) by Prop.forAll(...), the warnings should
 disappear.

 On the other hand I don't know why forAll(...) only doesn't work.

 Cheers,

 Eric.
 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: building lift from source --- warnings/errors expected?

2009-02-10 Thread David Pollak
Lee,

The build error on Macs problem is gone and we've been working on reducing
the number of warnings.

Thanks,

David

On Fri, Jan 30, 2009 at 7:36 PM, mighdoll leemighd...@gmail.com wrote:


 Hey folks, I'm trying to build the lift sources.  It mostly works, but
 I see more errors and warnings than I expected.  I'm wondering if my
 configuration is set up correctly.  Or do you see errors/warnings
 too?  Thx.

 mvn jetty:run in liftweb/sites/example seems to work.

 I've tried mvn clean, and deleting my .m2/repository.

 I tried mvn jetty:run in hellodarwin and got:

 ERROR - Failed to Boot
 net.liftweb.sitemap.SiteMapException: Location Hello1.1 defined twice
 Loc(Hello1.1, function, LinkText(function), List()) and Loc
 (Hello1.1, function, LinkText(function), List())
at net.liftweb.sitemap.SiteMap.addLoc(SiteMap.scala:36)
 ---


 Here are a few of the errors/warning when I try mvn install:

 Tests in error:
  wiki edit HomePage should not have HomePage content define
  wiki edit HomePage should allow edition of HomePage
 Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
 --

 [INFO] suggestion: remove the scalaVersion from pom.xml
 [ERROR] /home/lee/tools/liftweb/lift-widgets/src/main/scala
 --

 [WARNING] .../target/classes/toserve/tablesorter/
 jquery.tablesorter.js:line -1:column -1:Try to use a single 'var'
 statement per scope.
 --

 [WARNING] /home/lee/tools/liftweb/sites/hellolift/src/main/scala/com/
 hellolift/comet/DynamicBlogView.scala:35: warning: match is not
 exhaustive!
 [WARNING] missing combination  Empty
 [WARNING] missing combinationFailure
 [WARNING]
 [WARNING] name match {
 [WARNING] ^
 [WARNING] warning: there were unchecked warnings; re-run with -
 unchecked for details
 [WARNING] two warnings found
 --



 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Implementing RESTful web services using Lift

2009-02-10 Thread Dano

Chris/David,

Thanks very much for the example!

Have you two discussed how to mix authorization into this example?
When I talked with David about this topic, it seemed that restful
services couple credentials with the request.

For example, could you use BasicAuth with a username/password as part
of the URL via https?  If so, how would your example above be changed
to reflect that?

Thanks in advance.


Dan

On Feb 9, 4:51 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 Chris,
 Looks like you've been having way too much fun!

 Thanks,

 David

 On Mon, Feb 9, 2009 at 2:01 PM, Chris Richardson 



 chris.e.richard...@gmail.com wrote:
  Hi,

  I just started playing around with Scala and Lift and with @dpp's help
  wrote a simple RESTful web service.
  I wanted to share the code with this group and get feedback and suggestions
  about improvements.
  See below.
  Thanks.

  Chris

  In Boot.scala you register one or more WsEndpoints (a trait that is defined
  later).

  I was wondering whether Lift has a way to search and register them
  automatically?

  class Boot {

    def boot {

      val x :List[WsEndpoint] = List(ExampleApi)
      x.foreach ( endpoint = LiftRules.dispatch.append
  (endpoint.dispatchRules)  )

    }

  }

  

  Here is the class that defines methods that take parameters from the HTTP
  request and returns XML nodes.

  class ExampleApi {

       def doGet(id: String) : Node = {
         info3 id={id} /
        }

  }

  The companion object sets up the mapping rules, e.g. /api/item/1 -
  exampleApi.doGet(1)

  object ExampleApi extends WsEndpoint {

      val exampleApi = new ExampleApi()

      override def wsDispatchRules  =
          {
            case Req(api :: item :: id :: _, _, GetRequest) = () =
  exampleApi.doGet(id)
          }
  }

  WsEndpoint is a trait that handles the conversion from what Lift expects,
  i.e. () = Full[XmlResponse] to what is written above, i.e .() = Node

  trait WsEndpoint {

      def wsDispatchRules : PartialFunction[Req,() = Node]

      def dispatchRules : PartialFunction[Req,() = Full[XmlResponse]] = {
        new MyAdapter(wsDispatchRules)
      }

      abstract class PartialFunctionAdapter [F, T1, T2] (adaptee:
  PartialFunction[F, T1]) extends PartialFunction[F, T2] {
        override def isDefinedAt(r : F) = adaptee.isDefinedAt(r)

        override def apply(r : F)  = {
          converter(adaptee.apply(r))
        }

        def converter (x : T1) : T2

      }

      class MyAdapter(adaptee: PartialFunction[Req, () = Node])
          extends PartialFunctionAdapter[Req, () = Node, () =
  Full[XmlResponse] ](adaptee)   {

         override def converter (x : () = Node)  = {
          () = Full(XmlResponse(x()))
         }
      }
  }

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Implementing RESTful web services using Lift

2009-02-10 Thread Chris Richardson
Dano,

That's a good question.
I am looking at using these web services to expose functionality of an
application that is built using the Spring framework (sorry @dpp :-) ).
My default approach is to use Spring Security/Acegi filter to handle
authentication.
And, I would have passed the credentials using either HTTP BasicAuth or as
specially named URL query parameters

Chris


On Tue, Feb 10, 2009 at 2:22 PM, Dano olearydani...@gmail.com wrote:


 Chris/David,

 Thanks very much for the example!

 Have you two discussed how to mix authorization into this example?
 When I talked with David about this topic, it seemed that restful
 services couple credentials with the request.

 For example, could you use BasicAuth with a username/password as part
 of the URL via https?  If so, how would your example above be changed
 to reflect that?

 Thanks in advance.


 Dan

 On Feb 9, 4:51 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
  Chris,
  Looks like you've been having way too much fun!
 
  Thanks,
 
  David
 
  On Mon, Feb 9, 2009 at 2:01 PM, Chris Richardson 
 
 
 
  chris.e.richard...@gmail.com wrote:
   Hi,
 
   I just started playing around with Scala and Lift and with @dpp's help
   wrote a simple RESTful web service.
   I wanted to share the code with this group and get feedback and
 suggestions
   about improvements.
   See below.
   Thanks.
 
   Chris
 
   In Boot.scala you register one or more WsEndpoints (a trait that is
 defined
   later).
 
   I was wondering whether Lift has a way to search and register them
   automatically?
 
   class Boot {
 
 def boot {
 
   val x :List[WsEndpoint] = List(ExampleApi)
   x.foreach ( endpoint = LiftRules.dispatch.append
   (endpoint.dispatchRules)  )
 
 }
 
   }
 
   
 
   Here is the class that defines methods that take parameters from the
 HTTP
   request and returns XML nodes.
 
   class ExampleApi {
 
def doGet(id: String) : Node = {
  info3 id={id} /
 }
 
   }
 
   The companion object sets up the mapping rules, e.g. /api/item/1 -
   exampleApi.doGet(1)
 
   object ExampleApi extends WsEndpoint {
 
   val exampleApi = new ExampleApi()
 
   override def wsDispatchRules  =
   {
 case Req(api :: item :: id :: _, _, GetRequest) = () =
   exampleApi.doGet(id)
   }
   }
 
   WsEndpoint is a trait that handles the conversion from what Lift
 expects,
   i.e. () = Full[XmlResponse] to what is written above, i.e .() = Node
 
   trait WsEndpoint {
 
   def wsDispatchRules : PartialFunction[Req,() = Node]
 
   def dispatchRules : PartialFunction[Req,() = Full[XmlResponse]] =
 {
 new MyAdapter(wsDispatchRules)
   }
 
   abstract class PartialFunctionAdapter [F, T1, T2] (adaptee:
   PartialFunction[F, T1]) extends PartialFunction[F, T2] {
 override def isDefinedAt(r : F) = adaptee.isDefinedAt(r)
 
 override def apply(r : F)  = {
   converter(adaptee.apply(r))
 }
 
 def converter (x : T1) : T2
 
   }
 
   class MyAdapter(adaptee: PartialFunction[Req, () = Node])
   extends PartialFunctionAdapter[Req, () = Node, () =
   Full[XmlResponse] ](adaptee)   {
 
  override def converter (x : () = Node)  = {
   () = Full(XmlResponse(x()))
  }
   }
   }
 
  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift with MS Sequel

2009-02-10 Thread Tim Perrett

Awesome - I use both of these and get defo test the MSSQL drivers  
2moro (GMT)...

On 10 Feb 2009, at 18:51, David Pollak wrote:

 Folks,

 Al Thompson just checked in support for SQL Server and Oracle.   
 Please test these configurations.

 Thanks,

 David

 On Mon, Feb 9, 2009 at 9:12 AM, David Pollak feeder.of.the.be...@gmail.com 
  wrote:


 On Sun, Feb 8, 2009 at 10:16 PM, Amit Kumar Verma  
 cdac.a...@gmail.com wrote:

 Hi,

 do lift support MSSQL db ?

 Lift's mapper currently supports PostgreSQL, MySQL, Derby, H2, etc.

 I'm expecting MS SQL and Oracle support by end of week.

 You can use JPA for other DB support.




 Thanks
 Amit Kumar Verma





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



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

 

Tim Perrett
print application architect

t: +44 (0) 78144 34 791
e: he...@timperrett.com
w: timperrett.com






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



[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread Oliver

Doesn't look right and If I do this I get the following error -
constructor cannot be instantiated to the expected type

On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz jorge.or...@gmail.com wrote:
 Try (without the = sign):

 LiftRules.exceptionHandler.prepend {
case (mode, state, ex) = RedirectResponse(/error)
 }
 --j

 On Mon, Feb 9, 2009 at 10:47 PM, Oliver ola...@gmail.com wrote:

 If I try to use the following, I get a reassignment to Val error - any
 ideas?

 LiftRules.exceptionHandler.prepend = {
case (mode, state, ex) = RedirectResponse(/error)
 }

 On Wed, Dec 24, 2008 at 5:41 AM, Marius marius.dan...@gmail.com wrote:
 
  Folks,
 
  I just committed a couple of changes that may impact your application.
 
  1. LiftRules.logAndReturnExceptionToBrowser and
  LiftRules.browserResponseToException have been removed. These were two
  different variables that did pretty much the same thing in fact the
  first ultimately called the former. These have been replaced with:
 
 
  var exceptionHandler = RulesSeq[ExceptionHandlerPF]
 
  having
 
  type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
  Throwable), LiftResponse]
 
  By default a partial function is appended and it is the same code that
  used to be for LiftRules.browserResponseToException.
 
  So up until now probably your application was using something like:
 
  LiftRules.logAndReturnExceptionToBrowser = {
 case (state, ex) = RedirectResponse(/error)
  }
 
  now this turns into:
 
  LiftRules.exceptionHandler.prepend = {
 case (mode, state, ex) = RedirectResponse(/error)
  }
 
 
  2. More unification of Ajax notices with static notices. So far to
  apply styling information (css classes etc) to Ajax notices we used
  three LiftRules variables:
 
   var ajaxNoticeMeta: Can[AjaxMessageMeta]
   var ajaxWarningMeta: Can[AjaxMessageMeta]
   var ajaxErrorMeta: Can[AjaxMessageMeta]
 
  the motivation was that in order for Lift to send down the correct
  style information for Ajax/Comet notices it needed to maintain this
  information. Now I finally found time to do it. The above variables
  are gone. Instead the same styling information that you use for
  lift:msgs and lift:msg snippets will be applied for AJax and Comet
  notices. The styling information is captured when these snippets are
  executed and used whenever you're using notices for AJax response or
  from a Comet actor.
 
 
  Br's,
  Marius
  
 




 


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



[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread David Pollak
Oliver,

What version of Lift are you using?

Thanks,

David

On Tue, Feb 10, 2009 at 2:58 PM, Oliver ola...@gmail.com wrote:


 Doesn't look right and If I do this I get the following error -
 constructor cannot be instantiated to the expected type

 On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz jorge.or...@gmail.com
 wrote:
  Try (without the = sign):
 
  LiftRules.exceptionHandler.prepend {
 case (mode, state, ex) = RedirectResponse(/error)
  }
  --j
 
  On Mon, Feb 9, 2009 at 10:47 PM, Oliver ola...@gmail.com wrote:
 
  If I try to use the following, I get a reassignment to Val error - any
  ideas?
 
  LiftRules.exceptionHandler.prepend = {
 case (mode, state, ex) = RedirectResponse(/error)
  }
 
  On Wed, Dec 24, 2008 at 5:41 AM, Marius marius.dan...@gmail.com
 wrote:
  
   Folks,
  
   I just committed a couple of changes that may impact your application.
  
   1. LiftRules.logAndReturnExceptionToBrowser and
   LiftRules.browserResponseToException have been removed. These were two
   different variables that did pretty much the same thing in fact the
   first ultimately called the former. These have been replaced with:
  
  
   var exceptionHandler = RulesSeq[ExceptionHandlerPF]
  
   having
  
   type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
   Throwable), LiftResponse]
  
   By default a partial function is appended and it is the same code that
   used to be for LiftRules.browserResponseToException.
  
   So up until now probably your application was using something like:
  
   LiftRules.logAndReturnExceptionToBrowser = {
  case (state, ex) = RedirectResponse(/error)
   }
  
   now this turns into:
  
   LiftRules.exceptionHandler.prepend = {
  case (mode, state, ex) = RedirectResponse(/error)
   }
  
  
   2. More unification of Ajax notices with static notices. So far to
   apply styling information (css classes etc) to Ajax notices we used
   three LiftRules variables:
  
var ajaxNoticeMeta: Can[AjaxMessageMeta]
var ajaxWarningMeta: Can[AjaxMessageMeta]
var ajaxErrorMeta: Can[AjaxMessageMeta]
  
   the motivation was that in order for Lift to send down the correct
   style information for Ajax/Comet notices it needed to maintain this
   information. Now I finally found time to do it. The above variables
   are gone. Instead the same styling information that you use for
   lift:msgs and lift:msg snippets will be applied for AJax and Comet
   notices. The styling information is captured when these snippets are
   executed and used whenever you're using notices for AJax response or
   from a Comet actor.
  
  
   Br's,
   Marius
   
  
 
 
 
 
  
 

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread Oliver

I've just updated my code to rely on the stable version of lift 0.10
rather than an earlier snapshot.
Unfortunately the removal of LiftRules.logAndReturnExceptionToBrowser
and non working status of
LiftRules.exceptionHandler.prepend means my choices now are

1) To back out my reliance on the stable version of lift 0.10
2) To look at the source code for lift and try to figure out the problem
3) To remove my applications reliance on this code

I am going to be glad when Lift gets to version 1.0, because
presumably there will be less breaking changes (I hope)

On Wed, Feb 11, 2009 at 9:58 AM, Oliver ola...@gmail.com wrote:
 Doesn't look right and If I do this I get the following error -
 constructor cannot be instantiated to the expected type

 On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz jorge.or...@gmail.com wrote:
 Try (without the = sign):

 LiftRules.exceptionHandler.prepend {
case (mode, state, ex) = RedirectResponse(/error)
 }
 --j

 On Mon, Feb 9, 2009 at 10:47 PM, Oliver ola...@gmail.com wrote:

 If I try to use the following, I get a reassignment to Val error - any
 ideas?

 LiftRules.exceptionHandler.prepend = {
case (mode, state, ex) = RedirectResponse(/error)
 }

 On Wed, Dec 24, 2008 at 5:41 AM, Marius marius.dan...@gmail.com wrote:
 
  Folks,
 
  I just committed a couple of changes that may impact your application.
 
  1. LiftRules.logAndReturnExceptionToBrowser and
  LiftRules.browserResponseToException have been removed. These were two
  different variables that did pretty much the same thing in fact the
  first ultimately called the former. These have been replaced with:
 
 
  var exceptionHandler = RulesSeq[ExceptionHandlerPF]
 
  having
 
  type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
  Throwable), LiftResponse]
 
  By default a partial function is appended and it is the same code that
  used to be for LiftRules.browserResponseToException.
 
  So up until now probably your application was using something like:
 
  LiftRules.logAndReturnExceptionToBrowser = {
 case (state, ex) = RedirectResponse(/error)
  }
 
  now this turns into:
 
  LiftRules.exceptionHandler.prepend = {
 case (mode, state, ex) = RedirectResponse(/error)
  }
 
 
  2. More unification of Ajax notices with static notices. So far to
  apply styling information (css classes etc) to Ajax notices we used
  three LiftRules variables:
 
   var ajaxNoticeMeta: Can[AjaxMessageMeta]
   var ajaxWarningMeta: Can[AjaxMessageMeta]
   var ajaxErrorMeta: Can[AjaxMessageMeta]
 
  the motivation was that in order for Lift to send down the correct
  style information for Ajax/Comet notices it needed to maintain this
  information. Now I finally found time to do it. The above variables
  are gone. Instead the same styling information that you use for
  lift:msgs and lift:msg snippets will be applied for AJax and Comet
  notices. The styling information is captured when these snippets are
  executed and used whenever you're using notices for AJax response or
  from a Comet actor.
 
 
  Br's,
  Marius
  
 




 



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



[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread David Pollak
On Tue, Feb 10, 2009 at 3:13 PM, Oliver ola...@gmail.com wrote:


 I've just updated my code to rely on the stable version of lift 0.10
 rather than an earlier snapshot.
 Unfortunately the removal of LiftRules.logAndReturnExceptionToBrowser
 and non working status of
 LiftRules.exceptionHandler.prepend means my choices now are

 1) To back out my reliance on the stable version of lift 0.10
 2) To look at the source code for lift and try to figure out the problem
 3) To remove my applications reliance on this code


I just inserted:

LiftRules.exceptionHandler.prepend {
  case (mode, state, ex) = RedirectResponse(/error)
}

Into Boot.scala in a newly created Lift 0.10 app.  It worked without
complaint.

Please try doing an mvn -U clean install and see if that works.  I'm also
happy to look at your source off-list to see if I can puzzle through the
problem.

And, yes the API changes are going to be minimal from here on out.




 I am going to be glad when Lift gets to version 1.0, because
 presumably there will be less breaking changes (I hope)

 On Wed, Feb 11, 2009 at 9:58 AM, Oliver ola...@gmail.com wrote:
  Doesn't look right and If I do this I get the following error -
  constructor cannot be instantiated to the expected type
 
  On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz jorge.or...@gmail.com
 wrote:
  Try (without the = sign):
 
  LiftRules.exceptionHandler.prepend {
 case (mode, state, ex) = RedirectResponse(/error)
  }
  --j
 
  On Mon, Feb 9, 2009 at 10:47 PM, Oliver ola...@gmail.com wrote:
 
  If I try to use the following, I get a reassignment to Val error - any
  ideas?
 
  LiftRules.exceptionHandler.prepend = {
 case (mode, state, ex) = RedirectResponse(/error)
  }
 
  On Wed, Dec 24, 2008 at 5:41 AM, Marius marius.dan...@gmail.com
 wrote:
  
   Folks,
  
   I just committed a couple of changes that may impact your
 application.
  
   1. LiftRules.logAndReturnExceptionToBrowser and
   LiftRules.browserResponseToException have been removed. These were
 two
   different variables that did pretty much the same thing in fact the
   first ultimately called the former. These have been replaced with:
  
  
   var exceptionHandler = RulesSeq[ExceptionHandlerPF]
  
   having
  
   type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value, Req,
   Throwable), LiftResponse]
  
   By default a partial function is appended and it is the same code
 that
   used to be for LiftRules.browserResponseToException.
  
   So up until now probably your application was using something like:
  
   LiftRules.logAndReturnExceptionToBrowser = {
  case (state, ex) = RedirectResponse(/error)
   }
  
   now this turns into:
  
   LiftRules.exceptionHandler.prepend = {
  case (mode, state, ex) = RedirectResponse(/error)
   }
  
  
   2. More unification of Ajax notices with static notices. So far to
   apply styling information (css classes etc) to Ajax notices we used
   three LiftRules variables:
  
var ajaxNoticeMeta: Can[AjaxMessageMeta]
var ajaxWarningMeta: Can[AjaxMessageMeta]
var ajaxErrorMeta: Can[AjaxMessageMeta]
  
   the motivation was that in order for Lift to send down the correct
   style information for Ajax/Comet notices it needed to maintain this
   information. Now I finally found time to do it. The above variables
   are gone. Instead the same styling information that you use for
   lift:msgs and lift:msg snippets will be applied for AJax and Comet
   notices. The styling information is captured when these snippets are
   executed and used whenever you're using notices for AJax response or
   from a Comet actor.
  
  
   Br's,
   Marius
   
  
 
 
 
 
  
 
 

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread Oliver

My apologies, it works as shown by your code and in the way Jorge
described. I had changed simply cut and pasted Marius's example
and deleted it when it didn't work. Then I changed my own code without
modifying the case statement correctly. Sometimes I can't
add 1 + 1

On Wed, Feb 11, 2009 at 10:26 AM, David Pollak
feeder.of.the.be...@gmail.com wrote:


 On Tue, Feb 10, 2009 at 3:13 PM, Oliver ola...@gmail.com wrote:

 I've just updated my code to rely on the stable version of lift 0.10
 rather than an earlier snapshot.
 Unfortunately the removal of LiftRules.logAndReturnExceptionToBrowser
 and non working status of
 LiftRules.exceptionHandler.prepend means my choices now are

 1) To back out my reliance on the stable version of lift 0.10
 2) To look at the source code for lift and try to figure out the problem
 3) To remove my applications reliance on this code

 I just inserted:

 LiftRules.exceptionHandler.prepend {
   case (mode, state, ex) = RedirectResponse(/error)
 }

 Into Boot.scala in a newly created Lift 0.10 app.  It worked without
 complaint.

 Please try doing an mvn -U clean install and see if that works.  I'm also
 happy to look at your source off-list to see if I can puzzle through the
 problem.

 And, yes the API changes are going to be minimal from here on out.


 I am going to be glad when Lift gets to version 1.0, because
 presumably there will be less breaking changes (I hope)

 On Wed, Feb 11, 2009 at 9:58 AM, Oliver ola...@gmail.com wrote:
  Doesn't look right and If I do this I get the following error -
  constructor cannot be instantiated to the expected type
 
  On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz jorge.or...@gmail.com
  wrote:
  Try (without the = sign):
 
  LiftRules.exceptionHandler.prepend {
 case (mode, state, ex) = RedirectResponse(/error)
  }
  --j
 
  On Mon, Feb 9, 2009 at 10:47 PM, Oliver ola...@gmail.com wrote:
 
  If I try to use the following, I get a reassignment to Val error - any
  ideas?
 
  LiftRules.exceptionHandler.prepend = {
 case (mode, state, ex) = RedirectResponse(/error)
  }
 
  On Wed, Dec 24, 2008 at 5:41 AM, Marius marius.dan...@gmail.com
  wrote:
  
   Folks,
  
   I just committed a couple of changes that may impact your
   application.
  
   1. LiftRules.logAndReturnExceptionToBrowser and
   LiftRules.browserResponseToException have been removed. These were
   two
   different variables that did pretty much the same thing in fact the
   first ultimately called the former. These have been replaced with:
  
  
   var exceptionHandler = RulesSeq[ExceptionHandlerPF]
  
   having
  
   type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value,
   Req,
   Throwable), LiftResponse]
  
   By default a partial function is appended and it is the same code
   that
   used to be for LiftRules.browserResponseToException.
  
   So up until now probably your application was using something like:
  
   LiftRules.logAndReturnExceptionToBrowser = {
  case (state, ex) = RedirectResponse(/error)
   }
  
   now this turns into:
  
   LiftRules.exceptionHandler.prepend = {
  case (mode, state, ex) = RedirectResponse(/error)
   }
  
  
   2. More unification of Ajax notices with static notices. So far to
   apply styling information (css classes etc) to Ajax notices we used
   three LiftRules variables:
  
var ajaxNoticeMeta: Can[AjaxMessageMeta]
var ajaxWarningMeta: Can[AjaxMessageMeta]
var ajaxErrorMeta: Can[AjaxMessageMeta]
  
   the motivation was that in order for Lift to send down the correct
   style information for Ajax/Comet notices it needed to maintain this
   information. Now I finally found time to do it. The above variables
   are gone. Instead the same styling information that you use for
   lift:msgs and lift:msg snippets will be applied for AJax and Comet
   notices. The styling information is captured when these snippets are
   executed and used whenever you're using notices for AJax response or
   from a Comet actor.
  
  
   Br's,
   Marius
   
  
 
 
 
 
  
 
 





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: *** BREAKING CHANGES ***

2009-02-10 Thread David Pollak
On Tue, Feb 10, 2009 at 3:52 PM, Oliver ola...@gmail.com wrote:


 My apologies, it works as shown by your code and in the way Jorge
 described. I had changed simply cut and pasted Marius's example
 and deleted it when it didn't work. Then I changed my own code without
 modifying the case statement correctly. Sometimes I can't
 add 1 + 1


No worries.  We're here to help make you successful.



 On Wed, Feb 11, 2009 at 10:26 AM, David Pollak
 feeder.of.the.be...@gmail.com wrote:
 
 
  On Tue, Feb 10, 2009 at 3:13 PM, Oliver ola...@gmail.com wrote:
 
  I've just updated my code to rely on the stable version of lift 0.10
  rather than an earlier snapshot.
  Unfortunately the removal of LiftRules.logAndReturnExceptionToBrowser
  and non working status of
  LiftRules.exceptionHandler.prepend means my choices now are
 
  1) To back out my reliance on the stable version of lift 0.10
  2) To look at the source code for lift and try to figure out the problem
  3) To remove my applications reliance on this code
 
  I just inserted:
 
  LiftRules.exceptionHandler.prepend {
case (mode, state, ex) = RedirectResponse(/error)
  }
 
  Into Boot.scala in a newly created Lift 0.10 app.  It worked without
  complaint.
 
  Please try doing an mvn -U clean install and see if that works.  I'm also
  happy to look at your source off-list to see if I can puzzle through the
  problem.
 
  And, yes the API changes are going to be minimal from here on out.
 
 
  I am going to be glad when Lift gets to version 1.0, because
  presumably there will be less breaking changes (I hope)
 
  On Wed, Feb 11, 2009 at 9:58 AM, Oliver ola...@gmail.com wrote:
   Doesn't look right and If I do this I get the following error -
   constructor cannot be instantiated to the expected type
  
   On Tue, Feb 10, 2009 at 8:57 PM, Jorge Ortiz jorge.or...@gmail.com
   wrote:
   Try (without the = sign):
  
   LiftRules.exceptionHandler.prepend {
  case (mode, state, ex) = RedirectResponse(/error)
   }
   --j
  
   On Mon, Feb 9, 2009 at 10:47 PM, Oliver ola...@gmail.com wrote:
  
   If I try to use the following, I get a reassignment to Val error -
 any
   ideas?
  
   LiftRules.exceptionHandler.prepend = {
  case (mode, state, ex) = RedirectResponse(/error)
   }
  
   On Wed, Dec 24, 2008 at 5:41 AM, Marius marius.dan...@gmail.com
   wrote:
   
Folks,
   
I just committed a couple of changes that may impact your
application.
   
1. LiftRules.logAndReturnExceptionToBrowser and
LiftRules.browserResponseToException have been removed. These were
two
different variables that did pretty much the same thing in fact
 the
first ultimately called the former. These have been replaced with:
   
   
var exceptionHandler = RulesSeq[ExceptionHandlerPF]
   
having
   
type ExceptionHandlerPF = PartialFunction[(Props.RunModes.Value,
Req,
Throwable), LiftResponse]
   
By default a partial function is appended and it is the same code
that
used to be for LiftRules.browserResponseToException.
   
So up until now probably your application was using something
 like:
   
LiftRules.logAndReturnExceptionToBrowser = {
   case (state, ex) = RedirectResponse(/error)
}
   
now this turns into:
   
LiftRules.exceptionHandler.prepend = {
   case (mode, state, ex) = RedirectResponse(/error)
}
   
   
2. More unification of Ajax notices with static notices. So far
 to
apply styling information (css classes etc) to Ajax notices we
 used
three LiftRules variables:
   
 var ajaxNoticeMeta: Can[AjaxMessageMeta]
 var ajaxWarningMeta: Can[AjaxMessageMeta]
 var ajaxErrorMeta: Can[AjaxMessageMeta]
   
the motivation was that in order for Lift to send down the correct
style information for Ajax/Comet notices it needed to maintain
 this
information. Now I finally found time to do it. The above
 variables
are gone. Instead the same styling information that you use for
lift:msgs and lift:msg snippets will be applied for AJax and Comet
notices. The styling information is captured when these snippets
 are
executed and used whenever you're using notices for AJax response
 or
from a Comet actor.
   
   
Br's,
Marius

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

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
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 

[Lift] Build problems...

2009-02-10 Thread Marc Boschma
I just removed my maven repository in ~/.m2 , git clone git:// 
github.com/dpp/liftweb.git

and

Mac:liftweb marc$ mvn -e -U clean install
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Lift
[INFO]   Lift Utils
[INFO]   Lift WebKit
[INFO]   Lift Mapper
[INFO]   Lift Machine
[INFO]   Lift Record
[INFO]   Lift Textile
[INFO]   Lift Facebook
[INFO]   Lift AMQP
[INFO]   Lift XMPP
[INFO]   Lift Widgets
[INFO]   Lift OpenID
[INFO]   Lift OAuth
[INFO]   Lift PayPal
[INFO]   Lift TestKit
[INFO]   Lift Core (full lift)
[INFO]   Lift Sites
[INFO]   Lift Example
[INFO]   Skittr Example
[INFO]   HelloLift example application
[INFO]   HelloDarwin tutorial application
[INFO]   JPA Demo Master
[INFO]   JPADemo-spa
[INFO]   JPADemo-web
[INFO]   HTTP Authentication example
[INFO]   lift-archetype-blank
[INFO]   lift-archetype-basic
WAGON_VERSION: 1.0-beta-2
[INFO]  

[INFO] Building Lift
[INFO]task-segment: [clean, install]
[INFO]  

[INFO] artifact org.scala-tools:maven-scala-plugin: checking for  
updates from scala-tools.org
[INFO] artifact org.scala-tools:maven-scala-plugin: checking for  
updates from central
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin:  
checking for updates from scala-tools.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin:  
checking for updates from central
[INFO] [clean:clean]
[INFO] Deleting directory /Users/marc/src/lift/liftweb/target
[INFO] [scala:compile {execution: default}]
[WARNING] you don't define org.scala-lang:scala-library as a  
dependency of the project
[ERROR] /Users/marc/src/lift/liftweb/src/main/scala
[WARNING] No source files found.
[INFO] [scala:testCompile {execution: default}]
[WARNING] you don't define org.scala-lang:scala-library as a  
dependency of the project
[ERROR] /Users/marc/src/lift/liftweb/src/test/scala
[ERROR] /Users/marc/src/lift/liftweb/src/test/scala/../scala
[WARNING] No source files found.
[INFO] [site:attach-descriptor]
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive  
invocation.
[INFO] No goals needed for project - skipping
[INFO] [source:jar {execution: attach-sources}]
[INFO] [install:install]
[INFO] Installing /Users/marc/src/lift/liftweb/pom.xml to /Users/ 
marc/.m2/repository/net/liftweb/lift/0.11-SNAPSHOT/lift-0.11- 
SNAPSHOT.pom
[INFO]  

[INFO] Building Lift Utils
[INFO]task-segment: [clean, install]
[INFO]  

[INFO] artifact net.sf.alchim:yuicompressor-maven-plugin: checking for  
updates from scala-tools.org
[INFO] artifact net.sf.alchim:yuicompressor-maven-plugin: checking for  
updates from central
[INFO] [clean:clean]
[INFO] Deleting directory /Users/marc/src/lift/liftweb/lift-util/target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [yuicompressor:compress {execution: default}]
[INFO] nb warnings: 0, nb errors: 0
[INFO] snapshot org.specs:specs:1.4.3-SNAPSHOT: checking for updates  
from scala-tools.org
[INFO] snapshot org.specs:specs:1.4.3-SNAPSHOT: checking for updates  
from scala-tools.org.snapshots
[INFO] artifact org.mortbay.jetty:jetty: checking for updates from  
scala-tools.org
[INFO] artifact org.mortbay.jetty:jetty: checking for updates from  
scala-tools.org.snapshots
[INFO] artifact org.mortbay.jetty:jetty: checking for updates from  
central
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] suggestion: remove the scalaVersion from pom.xml
[ERROR] /Users/marc/src/lift/liftweb/lift-util/src/main/scala
[INFO] Compiling 32 source files to /Users/marc/src/lift/liftweb/lift- 
util/target/classes
[INFO]  

[ERROR] BUILD FAILURE
[INFO]  

[INFO] command line returned non-zero value:139
[INFO]  

[INFO] Trace
org.apache.maven.BuildFailureException: command line returned non-zero  
value:139
at  
org 
.apache 
.maven 
.lifecycle 
.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java: 
579)
at  
org 
.apache 
.maven 
.lifecycle 
.DefaultLifecycleExecutor 
.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at  
org 
.apache 
.maven 
.lifecycle 
.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at  
org 
.apache 
.maven 
.lifecycle 
.DefaultLifecycleExecutor 
.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at  
org 
.apache 
.maven 
.lifecycle 
.DefaultLifecycleExecutor 

[Lift] Re: JTA showSQL

2009-02-10 Thread Derek Chen-Becker
Everything I've ever seen has been provider-specific.

On 2/10/09, Viktor Klang viktor.kl...@gmail.com wrote:

 Is there a JPA defined way to turn loggin of DML on?

 On Tue, Feb 10, 2009 at 3:45 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 Yes, but that only works for Hibernate. I use Hibernate from everything,
 but I'm trying to keep the library usable for any JPA provider.

 Derek

 On 2/10/09, Viktor Klang viktor.kl...@gmail.com wrote:

 Otherwise you can enable it in the logging:

 log4j.logger.org.hibernate.SQL=DEBUG

 On Tue, Feb 10, 2009 at 7:50 AM, Derek Chen-Becker 
 dchenbec...@gmail.com wrote:

 Interesting idea. I'll look into adding something like this
 (configurable at boot and/or runtime) into scalajpa.

 Derek


 On 2/9/09, Oliver ola...@gmail.com wrote:


 Hi Derek and interested parties

 I know there is a showSQL option that can be enabled with
 JTA/Hibernate but I find the output verbose and uninformative about
 parameter replacement.

 So, I have my own ScalaQuery that allows simple debugging - the main
 differences are -

 var queryParams: List[Pair[String,Any]] = Nil
/*  the following method needs to be called by the various
 SetParameter methods */
 def addParam(one: String,two: Any) = {
 query.setParameter(one, two)
 queryParams = (one, two) :: queryParams
 }
 /*
  output the query with parameters substitued, for debugging ...
  */
 def getQueryWithParams() = {
 var q = queryStr
 try {
 queryParams.foreach{v =
 var rep = v._2 match {
 case d: Date = '+SUtil.formatDate(d,
 dd/MM/)+'
 case s: String = '+s+'
 case x = if (x==null)  else x.toString
 }
 rep = rep.replaceAll(\\$, ddDollardd) // stupid bug
 q = q.replaceAll(:+v._1, rep)
 }
 q.replaceAll(ddDollardd, \\$)
 } catch {
 case e: Exception = q+ PARAMS +queryParams+  EXCEPTION
 +e
 }
 }

 With this I can log the query via
   Log.info(emailQuery.getQueryWithParams())

 Better still, (assuming execOnce exists in a utility object) when I
 only need to see the query once in the log
 /*
  execulte execFn, just once for the jvm.
  */
 val execOnceSet = scala.collection.mutable.Set()
 def execOnce(key: String, execFn: = Unit) = {
 if (!execOnceSet.contains(key)) {
 execOnceSet += key
 execFn
 }
 }

   execOnce(findByEmail,  Log.info(emailQuery.getQueryWithParams()) )


 You can add the functionality if you find it useful

 cheers
 Oliver






 --
 Viktor Klang
 Senior Systems Analyst








 --
 Viktor Klang
 Senior Systems Analyst

 


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