[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv
In the Boot.scala
###
class Boot {
  def boot {
if (!DB.jndiJdbcConnAvailable_?)
  DB.defineConnectionManager(DefaultConnectionIdentifier,
DBVendor)
...
  }
}

object WahDB extends ConnectionIdentifier {
  def jndiName = one
}
object WahereDB extends ConnectionIdentifier {
  def jndiName = two
}

object DBVendor extends ConnectionManager {
  ...
  private def createOne(name: ConnectionIdentifier): Box[Connection] =
try {
val dbUrl1: String = Props.get(db.url1) openOr
jdbc:derby:lift_example;create=true

val dbUrl2: String = Props.get(db.url2) openOr
jdbc:derby:lift_example;create=true

var dbUrl: String = dbUrl1

try{
   name match {
  case One = {
dbUrl = dbUrl1
  }
  case Two = {
dbUrl = dbUrl2
  }
  case lift = {
dbUrl = dbUrl1
  }
   }
} catch {
  case e : Exception = e.printStackTrace; Empty
}
   ...
  }
  ...

}

In the every models:
class User extends MegaProtoUser[User] {
  def getSingleton = User // what's the meta server

  ...

  override def dbCalculateConnectionIdentifier = {  //
## dbCalculateConnectionIdentifier
case _ = One
  }
}

class Blog extends LongKeyedMapper[Item] with IdPK {
  def getSingleton = Blog // what's the meta server

  ...

  override def dbCalculateConnectionIdentifier = {  //
## dbCalculateConnectionIdentifier
case _ = Two
  }
}
###

I add the override def dbCalculateConnectionIdentifier method in
every models

But everytime it uses the database One, never uses the database Two.

Thanks very much!

Cheers,
  Neil

On Dec 6, 3:02 pm, Neil.Lv anim...@gmail.com wrote:
   The two databases that have different structure of the tables, such
 as two applications databases.

 Cheers,
   Neil

 On Dec 6, 2:38 pm, Neil.Lv anim...@gmail.com wrote:

     Btw, there is the error message when the server is started.
  ###
  scala.MatchError: ConnectionIdentifier(lift)
  ###

  On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com wrote:

   Hi all,

     I want to use two databases, but i don't know how to configure it.

     Does anybody know that how to configure two database connection in
   Lift?

   1:
     I add two ConnectionIdentifier in the Boot.class
   ###
   object OneDB extends ConnectionIdentifier {

     def jndiName = one

   }

   object TwoDB extends ConnectionIdentifier {

     def jndiName = two

   }

   ###

   2: In the User model

      How can i write the code in the method,
   ###
     override def dbCalculateConnectionIdentifier = {
       Two
     }
   ###

     Thanks for any suggestion!

   Cheers,
     Neil

--

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




[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv

Here is the db url,

db.url1=jdbc:mysql://localhost:3306/blog1
db.url2=jdbc:mysql://localhost:3306/blog2

Cheers,
  Neil

On Dec 6, 4:00 pm, Neil.Lv anim...@gmail.com wrote:
 In the Boot.scala
 ###
 class Boot {
   def boot {
     if (!DB.jndiJdbcConnAvailable_?)
       DB.defineConnectionManager(DefaultConnectionIdentifier,
 DBVendor)
     ...
   }

 }

 object WahDB extends ConnectionIdentifier {
   def jndiName = one}

 object WahereDB extends ConnectionIdentifier {
   def jndiName = two

 }

 object DBVendor extends ConnectionManager {
   ...
   private def createOne(name: ConnectionIdentifier): Box[Connection] =
 try {
     val dbUrl1: String = Props.get(db.url1) openOr
     jdbc:derby:lift_example;create=true

     val dbUrl2: String = Props.get(db.url2) openOr
     jdbc:derby:lift_example;create=true

     var dbUrl: String = dbUrl1

     try{
            name match {
                   case One = {
                         dbUrl = dbUrl1
                   }
                   case Two = {
                     dbUrl = dbUrl2
                   }
                   case lift = {
                     dbUrl = dbUrl1
                   }
            }
     } catch {
       case e : Exception = e.printStackTrace; Empty
     }
    ...
   }
   ...

 }

 In the every models:
 class User extends MegaProtoUser[User] {
   def getSingleton = User // what's the meta server

   ...

   override def dbCalculateConnectionIdentifier = {  //
 ## dbCalculateConnectionIdentifier
     case _ = One
   }

 }

 class Blog extends LongKeyedMapper[Item] with IdPK {
   def getSingleton = Blog // what's the meta server

   ...

   override def dbCalculateConnectionIdentifier = {  //
 ## dbCalculateConnectionIdentifier
     case _ = Two
   }}

 ###

 I add the override def dbCalculateConnectionIdentifier method in
 every models

 But everytime it uses the database One, never uses the database Two.

 Thanks very much!

 Cheers,
   Neil

 On Dec 6, 3:02 pm, Neil.Lv anim...@gmail.com wrote:

    The two databases that have different structure of the tables, such
  as two applications databases.

  Cheers,
    Neil

  On Dec 6, 2:38 pm, Neil.Lv anim...@gmail.com wrote:

      Btw, there is the error message when the server is started.
   ###
   scala.MatchError: ConnectionIdentifier(lift)
   ###

   On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com wrote:

Hi all,

  I want to use two databases, but i don't know how to configure it.

  Does anybody know that how to configure two database connection in
Lift?

1:
  I add two ConnectionIdentifier in the Boot.class
###
object OneDB extends ConnectionIdentifier {

  def jndiName = one

}

object TwoDB extends ConnectionIdentifier {

  def jndiName = two

}

###

2: In the User model

   How can i write the code in the method,
###
  override def dbCalculateConnectionIdentifier = {
    Two
  }
###

  Thanks for any suggestion!

Cheers,
  Neil

--

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




Re: [Lift] re: what changes would need to be made so LIFT can work with HTML5

2009-12-06 Thread James Black
Thank you for your response.

I am new to LIFT, and I think the version of LIFT I am using, 1.0, is too
old for this to work properly, as I get an error about the fact that
java.lang.String is found and util.Box is required.

I tried to get my app to work with LIFT 1.1 but I had problems with CRUDify,
so which version should I use that will work properly with CRUDify and
setDocType?

On Sun, Dec 6, 2009 at 1:15 AM, Alex Boisvert alex.boisv...@gmail.comwrote:

 Have you tried calling S.setDocType(!DOCTYPE html) ?

 alex


 On Sat, Dec 5, 2009 at 8:29 PM, James Black planiturth...@gmail.comwrote:

 I tried to use HTML5 doctype and LIFT threw an error.

 It complained about line 1:

 !DOCTYPE html
 html
 ...
 /html

 --

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



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


--

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




[Lift] Managing templates with associated snippets?

2009-12-06 Thread Liam Clarke
Hi all,

I'm quite new to Lift, just working my way through a basic web-app
using the book, and my background is Django for fun, and Wicket at
work, so I'm probably writing code that resembles both of those, but
isn't necessarily ideal for Lift.

I was just wondering about how experienced Lift users manage their
snippets and templates - do you, as a matter of course break them down
into components, where one template corresponds to one snippet method
call, like Wicket's panels, or is it normal to only separate out
repeatedly used snippet templates, and just inline the one-use ones?

I'm asking because I note that I changed the prefix used on the inner
children of a template, my binding in the snippet will break, so
there's a tight coupling there, which is fine, but I just want to be
able to represent that coupling in my code's structure, sorta like how
a Wicket component's mark-up has the same name as the class and occurs
right beside it in the package.

Also, I'm using Intellij IDEA 8, which is near seamless with the Scala
and Maven support, but is there any additional Lift specific plugins
about for Intellij? I can't find any, but I figure there might be an
early alpha about - I only really want one for making Intellij aware
of the template/snippet bindings.

Thanks in advance,

Liam Clarke

--

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




[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv

  If i remove the  DB.defineConnectionManager
(DefaultConnectionIdentifier, DBVendor)

  This error message occurs.
###
java.lang.NullPointerException: Looking for Connection Identifier
ConnectionIden
tifier(lift) but failed to find either a JNDI data source with the
name lift or
a lift connection manager with the correct name
###

Cheers,
  Neil


On Dec 6, 7:54 pm, Tim Nelson tnell...@gmail.com wrote:
 Hi,

 This line configures the database connections:

 DB.defineConnectionManager(DefaultConnectionIdentifier,
 DBVendor)

 This is using only the DefaultConnectionIdentifier, which you don't
 want to use. You want to change this to use your 2 defined
 identifiers. Ie:

 DB.defineConnectionManager(OneDB, DBVendor)
 DB.defineConnectionManager(TwoDB, DBVendor)

 Tim

 On Sun, Dec 6, 2009 at 4:17 AM, Neil.Lv anim...@gmail.com wrote:

  Here is the db url,

  db.url1=jdbc:mysql://localhost:3306/blog1
  db.url2=jdbc:mysql://localhost:3306/blog2

  Cheers,
   Neil

  On Dec 6, 4:00 pm, Neil.Lv anim...@gmail.com wrote:
  In the Boot.scala
  ###
  class Boot {
    def boot {
      if (!DB.jndiJdbcConnAvailable_?)
        DB.defineConnectionManager(DefaultConnectionIdentifier,
  DBVendor)
      ...
    }

  }

  object WahDB extends ConnectionIdentifier {
    def jndiName = one}

  object WahereDB extends ConnectionIdentifier {
    def jndiName = two

  }

  object DBVendor extends ConnectionManager {
    ...
    private def createOne(name: ConnectionIdentifier): Box[Connection] =
  try {
      val dbUrl1: String = Props.get(db.url1) openOr
      jdbc:derby:lift_example;create=true

      val dbUrl2: String = Props.get(db.url2) openOr
      jdbc:derby:lift_example;create=true

      var dbUrl: String = dbUrl1

      try{
             name match {
                    case One = {
                          dbUrl = dbUrl1
                    }
                    case Two = {
                      dbUrl = dbUrl2
                    }
                    case lift = {
                      dbUrl = dbUrl1
                    }
             }
      } catch {
        case e : Exception = e.printStackTrace; Empty
      }
     ...
    }
    ...

  }

  In the every models:
  class User extends MegaProtoUser[User] {
    def getSingleton = User // what's the meta server

    ...

    override def dbCalculateConnectionIdentifier = {  //
  ## dbCalculateConnectionIdentifier
      case _ = One
    }

  }

  class Blog extends LongKeyedMapper[Item] with IdPK {
    def getSingleton = Blog // what's the meta server

    ...

    override def dbCalculateConnectionIdentifier = {  //
  ## dbCalculateConnectionIdentifier
      case _ = Two
    }}

  ###

  I add the override def dbCalculateConnectionIdentifier method in
  every models

  But everytime it uses the database One, never uses the database Two.

  Thanks very much!

  Cheers,
    Neil

  On Dec 6, 3:02 pm, Neil.Lv anim...@gmail.com wrote:

     The two databases that have different structure of the tables, such
   as two applications databases.

   Cheers,
     Neil

   On Dec 6, 2:38 pm, Neil.Lv anim...@gmail.com wrote:

   Btw, there is the error message when the server is started.
###
scala.MatchError: ConnectionIdentifier(lift)
###

On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com wrote:

 Hi all,

   I want to use two databases, but i don't know how to configure it.

   Does anybody know that how to configure two database connection in
 Lift?

 1:
   I add two ConnectionIdentifier in the Boot.class
 ###
 object OneDB extends ConnectionIdentifier {

   def jndiName = one

 }

 object TwoDB extends ConnectionIdentifier {

   def jndiName = two

 }

 ###

 2: In the User model

    How can i write the code in the method,
 ###
   override def dbCalculateConnectionIdentifier = {
     Two
   }
 ###

   Thanks for any suggestion!

 Cheers,
   Neil

  --

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

--

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




[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv

  I don't understand the jndiName whether the jndiName is whatever
string that i can specify ?

###
object OneDB extends ConnectionIdentifier {
  def jndiName = one
}
###

Cheers,
  Neil

On Dec 6, 7:54 pm, Tim Nelson tnell...@gmail.com wrote:
 Hi,

 This line configures the database connections:

 DB.defineConnectionManager(DefaultConnectionIdentifier,
 DBVendor)

 This is using only the DefaultConnectionIdentifier, which you don't
 want to use. You want to change this to use your 2 defined
 identifiers. Ie:

 DB.defineConnectionManager(OneDB, DBVendor)
 DB.defineConnectionManager(TwoDB, DBVendor)

 Tim

 On Sun, Dec 6, 2009 at 4:17 AM, Neil.Lv anim...@gmail.com wrote:

  Here is the db url,

  db.url1=jdbc:mysql://localhost:3306/blog1
  db.url2=jdbc:mysql://localhost:3306/blog2

  Cheers,
   Neil

  On Dec 6, 4:00 pm, Neil.Lv anim...@gmail.com wrote:
  In the Boot.scala
  ###
  class Boot {
    def boot {
      if (!DB.jndiJdbcConnAvailable_?)
        DB.defineConnectionManager(DefaultConnectionIdentifier,
  DBVendor)
      ...
    }

  }

  object WahDB extends ConnectionIdentifier {
    def jndiName = one}

  object WahereDB extends ConnectionIdentifier {
    def jndiName = two

  }

  object DBVendor extends ConnectionManager {
    ...
    private def createOne(name: ConnectionIdentifier): Box[Connection] =
  try {
      val dbUrl1: String = Props.get(db.url1) openOr
      jdbc:derby:lift_example;create=true

      val dbUrl2: String = Props.get(db.url2) openOr
      jdbc:derby:lift_example;create=true

      var dbUrl: String = dbUrl1

      try{
             name match {
                    case One = {
                          dbUrl = dbUrl1
                    }
                    case Two = {
                      dbUrl = dbUrl2
                    }
                    case lift = {
                      dbUrl = dbUrl1
                    }
             }
      } catch {
        case e : Exception = e.printStackTrace; Empty
      }
     ...
    }
    ...

  }

  In the every models:
  class User extends MegaProtoUser[User] {
    def getSingleton = User // what's the meta server

    ...

    override def dbCalculateConnectionIdentifier = {  //
  ## dbCalculateConnectionIdentifier
      case _ = One
    }

  }

  class Blog extends LongKeyedMapper[Item] with IdPK {
    def getSingleton = Blog // what's the meta server

    ...

    override def dbCalculateConnectionIdentifier = {  //
  ## dbCalculateConnectionIdentifier
      case _ = Two
    }}

  ###

  I add the override def dbCalculateConnectionIdentifier method in
  every models

  But everytime it uses the database One, never uses the database Two.

  Thanks very much!

  Cheers,
    Neil

  On Dec 6, 3:02 pm, Neil.Lv anim...@gmail.com wrote:

     The two databases that have different structure of the tables, such
   as two applications databases.

   Cheers,
     Neil

   On Dec 6, 2:38 pm, Neil.Lv anim...@gmail.com wrote:

   Btw, there is the error message when the server is started.
###
scala.MatchError: ConnectionIdentifier(lift)
###

On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com wrote:

 Hi all,

   I want to use two databases, but i don't know how to configure it.

   Does anybody know that how to configure two database connection in
 Lift?

 1:
   I add two ConnectionIdentifier in the Boot.class
 ###
 object OneDB extends ConnectionIdentifier {

   def jndiName = one

 }

 object TwoDB extends ConnectionIdentifier {

   def jndiName = two

 }

 ###

 2: In the User model

    How can i write the code in the method,
 ###
   override def dbCalculateConnectionIdentifier = {
     Two
   }
 ###

   Thanks for any suggestion!

 Cheers,
   Neil

  --

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

--

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




Re: [Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Tim Nelson
I think there might be a problem with the way you are specifying which
db to use in your mapper classes. Here's the relevant text from the
The Lift Book:

dbSelect... is used to find an instance by primary key, and takes a
partial function (typically a match clause) to determine which
connection to use.

dbCalculate... is used when a new instance is created to decide where
to store the new instance.

Those 2 methods are used for sharding. Are you sharding? If not I
think you just want to override dbDefaultConnectionIdentifier

Tim

On Sun, Dec 6, 2009 at 6:01 AM, Neil.Lv anim...@gmail.com wrote:

  If i remove the  DB.defineConnectionManager
 (DefaultConnectionIdentifier, DBVendor)

  This error message occurs.
 ###
 java.lang.NullPointerException: Looking for Connection Identifier
 ConnectionIden
 tifier(lift) but failed to find either a JNDI data source with the
 name lift or
 a lift connection manager with the correct name
 ###

 Cheers,
  Neil


 On Dec 6, 7:54 pm, Tim Nelson tnell...@gmail.com wrote:
 Hi,

 This line configures the database connections:

 DB.defineConnectionManager(DefaultConnectionIdentifier,
 DBVendor)

 This is using only the DefaultConnectionIdentifier, which you don't
 want to use. You want to change this to use your 2 defined
 identifiers. Ie:

 DB.defineConnectionManager(OneDB, DBVendor)
 DB.defineConnectionManager(TwoDB, DBVendor)

 Tim

 On Sun, Dec 6, 2009 at 4:17 AM, Neil.Lv anim...@gmail.com wrote:

  Here is the db url,

  db.url1=jdbc:mysql://localhost:3306/blog1
  db.url2=jdbc:mysql://localhost:3306/blog2

  Cheers,
   Neil

  On Dec 6, 4:00 pm, Neil.Lv anim...@gmail.com wrote:
  In the Boot.scala
  ###
  class Boot {
    def boot {
      if (!DB.jndiJdbcConnAvailable_?)
        DB.defineConnectionManager(DefaultConnectionIdentifier,
  DBVendor)
      ...
    }

  }

  object WahDB extends ConnectionIdentifier {
    def jndiName = one}

  object WahereDB extends ConnectionIdentifier {
    def jndiName = two

  }

  object DBVendor extends ConnectionManager {
    ...
    private def createOne(name: ConnectionIdentifier): Box[Connection] =
  try {
      val dbUrl1: String = Props.get(db.url1) openOr
      jdbc:derby:lift_example;create=true

      val dbUrl2: String = Props.get(db.url2) openOr
      jdbc:derby:lift_example;create=true

      var dbUrl: String = dbUrl1

      try{
             name match {
                    case One = {
                          dbUrl = dbUrl1
                    }
                    case Two = {
                      dbUrl = dbUrl2
                    }
                    case lift = {
                      dbUrl = dbUrl1
                    }
             }
      } catch {
        case e : Exception = e.printStackTrace; Empty
      }
     ...
    }
    ...

  }

  In the every models:
  class User extends MegaProtoUser[User] {
    def getSingleton = User // what's the meta server

    ...

    override def dbCalculateConnectionIdentifier = {  //
  ## dbCalculateConnectionIdentifier
      case _ = One
    }

  }

  class Blog extends LongKeyedMapper[Item] with IdPK {
    def getSingleton = Blog // what's the meta server

    ...

    override def dbCalculateConnectionIdentifier = {  //
  ## dbCalculateConnectionIdentifier
      case _ = Two
    }}

  ###

  I add the override def dbCalculateConnectionIdentifier method in
  every models

  But everytime it uses the database One, never uses the database Two.

  Thanks very much!

  Cheers,
    Neil

  On Dec 6, 3:02 pm, Neil.Lv anim...@gmail.com wrote:

     The two databases that have different structure of the tables, such
   as two applications databases.

   Cheers,
     Neil

   On Dec 6, 2:38 pm, Neil.Lv anim...@gmail.com wrote:

   Btw, there is the error message when the server is started.
###
scala.MatchError: ConnectionIdentifier(lift)
###

On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com wrote:

 Hi all,

   I want to use two databases, but i don't know how to configure it.

   Does anybody know that how to configure two database connection in
 Lift?

 1:
   I add two ConnectionIdentifier in the Boot.class
 ###
 object OneDB extends ConnectionIdentifier {

   def jndiName = one

 }

 object TwoDB extends ConnectionIdentifier {

   def jndiName = two

 }

 ###

 2: In the User model

    How can i write the code in the method,
 ###
   override def dbCalculateConnectionIdentifier = {
     Two
   }
 ###

   Thanks for any suggestion!

 Cheers,
   Neil

  --

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

 --

 You received this message because you are 

Re: [Lift] re: what changes would need to be made so LIFT can work with HTML5

2009-12-06 Thread Timothy Perrett
1.0 - 1.1 is a breaking change. We just decided to renmae 1.1 to 2.0  
because of all the breaking changes and subsequent work needed to  
migrate between versions.

Please see the breaking changes notifications posted at the top of  
this group - they will help you migrate.

Cheers, Tim

Sent from my iPhone

On 6 Dec 2009, at 07:54, James Black planiturth...@gmail.com wrote:

 Thank you for your response.

 I am new to LIFT, and I think the version of LIFT I am using, 1.0,  
 is too old for this to work properly, as I get an error about the  
 fact that java.lang.String is found and util.Box is required.

 I tried to get my app to work with LIFT 1.1 but I had problems with  
 CRUDify, so which version should I use that will work properly with  
 CRUDify and setDocType?

 On Sun, Dec 6, 2009 at 1:15 AM, Alex Boisvert  
 alex.boisv...@gmail.com wrote:
 Have you tried calling S.setDocType(!DOCTYPE html) ?

 alex


 On Sat, Dec 5, 2009 at 8:29 PM, James Black  
 planiturth...@gmail.com wrote:
 I tried to use HTML5 doctype and LIFT threw an error.

 It complained about line 1:

 !DOCTYPE html
 html
 ...
 /html

 --

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



 --

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

 --

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

--

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




[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv

  Yeah, i don't want to use sharding, i just want select some
information from another databases,

###
object Blog extends Blog with LongKeyedMetaMapper[Blog ] {
  ...
  override def dbDefaultConnectionIdentifier  = OneDB
  ...
}
###

  It doesn't work, maybe the code that i write is wrong ?

Cheers,
  Neil



On Dec 6, 8:28 pm, Tim Nelson tnell...@gmail.com wrote:
 I think there might be a problem with the way you are specifying which
 db to use in your mapper classes. Here's the relevant text from the
 The Lift Book:

 dbSelect... is used to find an instance by primary key, and takes a
 partial function (typically a match clause) to determine which
 connection to use.

 dbCalculate... is used when a new instance is created to decide where
 to store the new instance.

 Those 2 methods are used for sharding. Are you sharding? If not I
 think you just want to override dbDefaultConnectionIdentifier

 Tim

 On Sun, Dec 6, 2009 at 6:01 AM, Neil.Lv anim...@gmail.com wrote:

   If i remove the  DB.defineConnectionManager
  (DefaultConnectionIdentifier, DBVendor)

   This error message occurs.
  ###
  java.lang.NullPointerException: Looking for Connection Identifier
  ConnectionIden
  tifier(lift) but failed to find either a JNDI data source with the
  name lift or
  a lift connection manager with the correct name
  ###

  Cheers,
   Neil

  On Dec 6, 7:54 pm, Tim Nelson tnell...@gmail.com wrote:
  Hi,

  This line configures the database connections:

  DB.defineConnectionManager(DefaultConnectionIdentifier,
  DBVendor)

  This is using only the DefaultConnectionIdentifier, which you don't
  want to use. You want to change this to use your 2 defined
  identifiers. Ie:

  DB.defineConnectionManager(OneDB, DBVendor)
  DB.defineConnectionManager(TwoDB, DBVendor)

  Tim

  On Sun, Dec 6, 2009 at 4:17 AM, Neil.Lv anim...@gmail.com wrote:

   Here is the db url,

   db.url1=jdbc:mysql://localhost:3306/blog1
   db.url2=jdbc:mysql://localhost:3306/blog2

   Cheers,
    Neil

   On Dec 6, 4:00 pm, Neil.Lv anim...@gmail.com wrote:
   In the Boot.scala
   ###
   class Boot {
     def boot {
       if (!DB.jndiJdbcConnAvailable_?)
         DB.defineConnectionManager(DefaultConnectionIdentifier,
   DBVendor)
       ...
     }

   }

   object WahDB extends ConnectionIdentifier {
     def jndiName = one}

   object WahereDB extends ConnectionIdentifier {
     def jndiName = two

   }

   object DBVendor extends ConnectionManager {
     ...
     private def createOne(name: ConnectionIdentifier): Box[Connection] =
   try {
       val dbUrl1: String = Props.get(db.url1) openOr
       jdbc:derby:lift_example;create=true

       val dbUrl2: String = Props.get(db.url2) openOr
       jdbc:derby:lift_example;create=true

       var dbUrl: String = dbUrl1

       try{
              name match {
                     case One = {
                           dbUrl = dbUrl1
                     }
                     case Two = {
                       dbUrl = dbUrl2
                     }
                     case lift = {
                       dbUrl = dbUrl1
                     }
              }
       } catch {
         case e : Exception = e.printStackTrace; Empty
       }
      ...
     }
     ...

   }

   In the every models:
   class User extends MegaProtoUser[User] {
     def getSingleton = User // what's the meta server

     ...

     override def dbCalculateConnectionIdentifier = {  //
   ## dbCalculateConnectionIdentifier
       case _ = One
     }

   }

   class Blog extends LongKeyedMapper[Item] with IdPK {
     def getSingleton = Blog // what's the meta server

     ...

     override def dbCalculateConnectionIdentifier = {  //
   ## dbCalculateConnectionIdentifier
       case _ = Two
     }}

   ###

   I add the override def dbCalculateConnectionIdentifier method in
   every models

   But everytime it uses the database One, never uses the database Two.

   Thanks very much!

   Cheers,
     Neil

   On Dec 6, 3:02 pm, Neil.Lv anim...@gmail.com wrote:

  The two databases that have different structure of the tables, such
as two applications databases.

Cheers,
  Neil

On Dec 6, 2:38 pm, Neil.Lv anim...@gmail.com wrote:

    Btw, there is the error message when the server is started.
 ###
 scala.MatchError: ConnectionIdentifier(lift)
 ###

 On Dec 6, 1:47 pm, Neil.Lv anim...@gmail.com wrote:

  Hi all,

    I want to use two databases, but i don't know how to configure 
  it.

    Does anybody know that how to configure two database connection 
  in
  Lift?

  1:
    I add two ConnectionIdentifier in the Boot.class
  ###
  object OneDB extends ConnectionIdentifier {

    def jndiName = one

  }

  object TwoDB extends ConnectionIdentifier {

    def jndiName = two

  }

  ###

  2: In the User model

     How can i write the code in the method,
  ###
    override def 

[Lift] Re: Newbie question: class not foudn

2009-12-06 Thread itsjar
Thanks for the advice Alex.
I am pleases to see how many helpful people there are in this group.

--

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




[Lift] Re: Sharing data between snippet functions during a single HTTP request

2009-12-06 Thread Alex Black
 We made this change for Lift 1.1.  So, if you're using 1.1, the same
 instance of a snippet should be used for a given HTTP request.

Hi David, I've just switch from Lift 1.0 to Lift 1.1-M6, do you think
this change is in M6? It doesn't seem to be... I have many calls to my
snippet for a particular page, and I put a println statement in the
body of the snippet, and it gets called 18 times each request!

- Alex





  I'd imagine lift could even generate a requestVar representing each
  snippet for the developers, allowing snippets in a given HTTP request
  to access each other easily.

 I don't think this is technically possible within the bounds of the type
 system.





  On Nov 20, 11:09 am, Ross Mellgren dri...@gmail.com wrote:
   RequestVar is the standard way of doing this. For example

   object MySharedInformation {
        object myData extends RequestVar[List[Thing]](loadThings)
        //                               ^^^  ^^
        //                    Type of thing to store  How to initialize
   variable first time it's accessed

        private def loadThings: List[Thing] = ...

   }

   class Snippet1 {
        import MySharedInformation.myData
        def render(ns: NodeSeq): NodeSeq = {
            myData.is.map(thing = { ... })
        }

   }

   class Snippet2 {
        import MySharedInformation.myData
        ...

   }

   The lifetime of the value is during the current request processing and
   any AJAX calls related to it.

   If you really want to initialize it in a snippet, then use a Box with
   a RequestVar, like this:

   object MySharedInformation {
        object myData extends RequestVar[Box[List[Thing]]](Empty)

   }

   class LoaderSnippet {
        import MySharedInformation.myData
        def render(ns: NodeSeq): NodeSeq = {
            myData.set(Full(...))
        }

   }

   class ReaderSnippet {
        import MySharedInformation.myData
        def render(ns: NodeSeq): NodeSeq = {
            // If the data has not been loaded, default to an empty list
            val data = myData.is.openOr(Nil)
            ...
        }

   }

   class OtherReaderSnippet {
        import MySharedInformation.myData
        def render(ns: NodeSeq): NodeSeq = {
            // Do two entirely different things if the data has versus
   has not been loaded
            myData.is match {
                case Full(data) = // do something when the data has been
   loaded
                case _ = // do something when the data has not been loaded
            }
        }

   }

   HTH,
   -Ross

   On Nov 20, 2009, at 10:59 AM, Alex Black wrote:

I've got a template page, say foobar.html, that makes a number of
calls to functions in a snippet, e.g. mysnippet.foo1, mysnippet.foo2,
mysnippet.foo3.

I'd like to do some initial work in foo1, e.g. retrieve some data and
do some work on it, then in foo2 and foo3 display parts of that data.

Whats the easiest way to do this? I think I misunderstood the lift
book:

That means that for each request, Lift creates a new instance of the
snippet class to execute. Any changes you make to instance variables
will be discarded after the request is processed.

I thought this meant that for a given HTTP request, there would be one
(and only one) instance of my snippet, so I could call several of its
methods and they could all access the snippet's member variables,
which would then be discarded at the end of the request.

Am I going about this wrong? should I only have one snippet function
per template?

Thx

- Alex

--

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

  --

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

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

--

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




[Lift] Re: How can one bind value-less attributes?

2009-12-06 Thread Alex Black
 If you output null for theattributevalue, theattributeis not
 rendered:

I've just upgraded from 1.0 to 1.1-M6, and this doesn't seem to work
any more - could this be a bug in M6?

Message: scala.MatchError: null
scala.runtime.ScalaRunTime$.boxArray(ScalaRunTime.scala:136)
net.liftweb.util.BindHelpers$class.mix$1(BindHelpers.scala:612)
net.liftweb.util.BindHelpers$class.net$liftweb$util$BindHelpers$
$bindByNameMixIn(BindHelpers.scala:618)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$
$anonfun$apply$27.apply(BindHelpers.scala:440)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$
$anonfun$apply$27.apply(BindHelpers.scala:436)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:436)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
(BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
(BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
(BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
(BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
$1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
(BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:
449)
net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:
409)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:409)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:380)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)



 scala bind(stuff, input type=checkbox stuff:s=/, 
 AttrBindParam(s,Text(checked),checked))
 res11: scala.xml.NodeSeq = input type=checkbox checked=checked/input

 scala bind(stuff, input type=checkbox stuff:s=/, 
 AttrBindParam(s,null,selected))            
 res12: scala.xml.NodeSeq = input type=checkbox /input

 /Jeppe

--

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




Re: [Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Tim Nelson
I did some more digging and got a sample app to work. You can see the code here:
http://github.com/eltimn/lift_1_1_sample

There are 2 things I had to do. The first is to pass in the DbId when
calling Schemifier;

Schemifier.schemify(true, Log.infoF _, OneDB, User)
Schemifier.schemify(true, Log.infoF _, TwoDB, Dog)

This was the cause of the NPE earlier.

The second thing I did was to create 2 separate DBVendor objects. I
could not get this to work with one that matches on the
ConnectionIdentifier, like the example in The Lift Book. I didn't dig
into why this wasn't working, so it could be the way the code is
written.

DB.defineConnectionManager(OneDB, DBVendor_1)
DB.defineConnectionManager(TwoDB, DBVendor_2)

Tim

--

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




[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv

  Thanks Tim,

  I have tried it in my code but it doesn't work yet!

  The lift version is:  1.1-M7
  Scala Version is:  2.7.7

Cheers,
  Neil

On Dec 6, 10:52 pm, Tim Nelson tnell...@gmail.com wrote:
 I did some more digging and got a sample app to work. You can see the code 
 here:http://github.com/eltimn/lift_1_1_sample

 There are 2 things I had to do. The first is to pass in the DbId when
 calling Schemifier;

 Schemifier.schemify(true, Log.infoF _, OneDB, User)
 Schemifier.schemify(true, Log.infoF _, TwoDB, Dog)

 This was the cause of the NPE earlier.

 The second thing I did was to create 2 separate DBVendor objects. I
 could not get this to work with one that matches on the
 ConnectionIdentifier, like the example in The Lift Book. I didn't dig
 into why this wasn't working, so it could be the way the code is
 written.

 DB.defineConnectionManager(OneDB, DBVendor_1)
 DB.defineConnectionManager(TwoDB, DBVendor_2)

 Tim

--

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




[Lift] Re: How to configure two database connection in Lift?

2009-12-06 Thread Neil.Lv

  It works now, I missing the dbDefaultConnectionIdentifier definition
in the others models.

  Thank you very much!

  :)

Cheers,
  Neil

On Dec 7, 12:06 am, Neil.Lv anim...@gmail.com wrote:
   Thanks Tim,

   I have tried it in my code but it doesn't work yet!

   The lift version is:  1.1-M7
   Scala Version is:  2.7.7

 Cheers,
   Neil

 On Dec 6, 10:52 pm, Tim Nelson tnell...@gmail.com wrote:

  I did some more digging and got a sample app to work. You can see the code 
  here:http://github.com/eltimn/lift_1_1_sample

  There are 2 things I had to do. The first is to pass in the DbId when
  calling Schemifier;

  Schemifier.schemify(true, Log.infoF _, OneDB, User)
  Schemifier.schemify(true, Log.infoF _, TwoDB, Dog)

  This was the cause of the NPE earlier.

  The second thing I did was to create 2 separate DBVendor objects. I
  could not get this to work with one that matches on the
  ConnectionIdentifier, like the example in The Lift Book. I didn't dig
  into why this wasn't working, so it could be the way the code is
  written.

  DB.defineConnectionManager(OneDB, DBVendor_1)
  DB.defineConnectionManager(TwoDB, DBVendor_2)

  Tim

--

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




[Lift] Re: Newbie question: class not foudn

2009-12-06 Thread itsjar
I think the problem might be locates in the pom.xml

I recreated the problem and don't have any problems now.


On Dec 6, 2:21 pm, itsjar its...@gmail.com wrote:
 Thanks for the advice Alex.
 I am pleases to see how many helpful people there are in this group.

--

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




[Lift] Re: Unexpected type on a custom trait

2009-12-06 Thread Franz Bettag
Aaah! Thank you very much! That fixed it!


On 6 Dez., 07:42, Alex Boisvert alex.boisv...@gmail.com wrote:
 Your issue is that u.customer returns a MappedLongForeignKey instance, not
 a Customer.

 You probably want to use u.customer.get or u.customer.can or something
 like that.

 alex

 On Sat, Dec 5, 2009 at 5:50 PM, Franz Bettag fr...@bett.ag wrote:
  Heyho,

  i'm running 1.1-m7 and having the following issue. i am using the
  basic user model and created a model Customer like this:

  class Customer extends LongKeyedMapper[Customer] with IdPK {
         def getSingleton = Customer

         object name extends MappedString(this, 255)
         def users: List[User] = User.findAll(By(User.customer, this.id))

  }

  object Customer extends Customer with LongKeyedMetaMapper[Customer] {
         override def fieldOrder = List(name)
         override def dbIndexes = List(Index(IndexField(name)))

  }

  in my user model i got:
  object customer extends MappedLongForeignKey(this, Customer)

  the idea is, that i have a trait called Customerize which will add a
  customer-object/field into the desired model and that those fields get
  auto-set on create depending on User.currentUser.customer.

  So far it looks like this:

  trait CustomerFields[A : Mapper[A]] {
         this: A =

         private val thisTyped = this.asInstanceOf[A]

         object customer extends MappedLongForeignKey(thisTyped, Customer)
  with LifecycleCallbacks {
                 override def beforeCreate: Unit =
                         User.currentUser match {
                                 case Full(u: User) = {
                                                 u.customer match {
  -                                                     case Full(c:
  Customer) = this(c)
                                                         case _ = false
                                                 }
                                         }
                                 case _ = false
                         }

         }

  }

  The marked line errors like the following:

  [ERROR] Customerize.scala:49: error: constructor cannot be
  instantiated to expected type;
  [INFO]  found   : net.liftweb.common.Full[A]
  [INFO]  required: object u.customer
  [INFO]                                                  case Full(c:
  Customer) = this(c)

  [ERROR] Customerize.scala:49: error: not found: value c
  [INFO]                                                  case Full(c:
  Customer) = this(c)

  Any ideas/suggestions? :)

  best regards

  --

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

--

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




[Lift] Re: what changes would need to be made so LIFT can work with HTML5

2009-12-06 Thread Randinn
Here are a couple of places to look:

http://wiki.github.com/dpp/liftweb/10-11-possible-code-changes
http://groups.google.com/group/liftweb/browse_thread/thread/824f14038bedf425#

On Dec 6, 6:54 pm, James Black planiturth...@gmail.com wrote:
 Thank you for your response.

 I am new to LIFT, and I think the version of LIFT I am using, 1.0, is too
 old for this to work properly, as I get an error about the fact that
 java.lang.String is found and util.Box is required.

 I tried to get my app to work with LIFT 1.1 but I had problems with CRUDify,
 so which version should I use that will work properly with CRUDify and
 setDocType?

 On Sun, Dec 6, 2009 at 1:15 AM, Alex Boisvert alex.boisv...@gmail.comwrote:

  Have you tried calling S.setDocType(!DOCTYPE html) ?

  alex

  On Sat, Dec 5, 2009 at 8:29 PM, James Black planiturth...@gmail.comwrote:

  I tried to use HTML5 doctype and LIFT threw an error.

  It complained about line 1:

  !DOCTYPE html
  html
  ...
  /html

  --

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

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

--

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




Re: [Lift] Re: How can one bind value-less attributes?

2009-12-06 Thread Jeppe Nejsum Madsen
Alex Black a...@alexblack.ca writes:

 If you output null for theattributevalue, theattributeis not
 rendered:

 I've just upgraded from 1.0 to 1.1-M6, and this doesn't seem to work
 any more - could this be a bug in M6?

Maybe. The code I wrote worked in 1.1-SNAPSHOT at the time.you could
try this just to verify.

/Jeppe

[...]

 scala bind(stuff, input type=checkbox stuff:s=/, 
 AttrBindParam(s,Text(checked),checked))
 res11: scala.xml.NodeSeq = input type=checkbox checked=checked/input

 scala bind(stuff, input type=checkbox stuff:s=/, 
 AttrBindParam(s,null,selected))            
 res12: scala.xml.NodeSeq = input type=checkbox /input

--

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




[Lift] Newbie on Lift Scala: Build in class source code?

2009-12-06 Thread itsjar
Hi,

I'm considering building a web application with my software
engineering group in Lift.
However when I started with lift I was surprised that I received a
whole log in / sign up website by
just using the MegaProtoUser.
This was at first sight fun, but I started wondering (and I'm pretty
sure my professor will say the same): Do I really know what I just
did?.

So I decided to try and rebuild the Log in / Sign up thing from
scratch by using my own plain objects.
Ive been working on that for 2 days and It's been s frustrating.

I've been reading the lift book... Tutorials.. but all of them start
with the MegaProtoUser.
In 1.5 days time I only managed to make an index (signup) page with a
username/password field and a button which then redirects to a new
page.

Let me tell you in advance, I am totally new to Web developing.

Problems I have right now:
   - I have no idea if my code actually created a User in my database
and I have no idea how to check it...
   - I have no idea how to log in a user. I saw code in the sample
programs that compare the current logged in user with other users by
using a select statement. However retrieving the current user is based
upon the MegaProtoUser. I wonder how this is done behind my back since
I have no idea how to keep a variable of a 'logged in user' which
stays active across all pages..

Because of these problems I thought it might be useful to see the
source code of the classes..
Is it possible to see the scala source code of these classes?

Thanks,
itsjar


--

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




Re: [Lift] Foreign Key constraints are not created by schemify

2009-12-06 Thread Derek Chen-Becker
Absolutely. I have a PG 8.0, 8.1 and 8.3 instance set up for testing on my
home box because of the last time I made a PG-related change.

Derek

On Thu, Dec 3, 2009 at 2:48 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Thu, Dec 3, 2009 at 1:47 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 I agree on both points (foreign keys and documentation). Please open a
 ticket asking for proper foreign key support and I'll work on it next week.


 Please make sure it works on PG 8.0/8.1 as there is at least 1 Lift app in
 production against 8.0


 Derek


 On Wed, Dec 2, 2009 at 6:05 PM, Julian Backes 
 julianbac...@googlemail.com wrote:

 Hi Derek,

  It's been a long time since I looked at that particular code, so I may
  have misspoke. Having said that, if it's currently disabled in the
  driver I'm not sure why and I would want to review it before saying
 that
  it works properly in all cases.
 I think the problem here is that the user expects (like I did) foreign
 keys to be created if he uses mapper classes referencing other mapper
 classes. This behaviour should at least be mentioned somewhere in the
 documentation (btw, the documentation is in my opinion the biggest
 problems of Lift at the moment).
 I think, using a relational database without foreign keys is somehow not
 very useful because you never really know whether you have referential
 integrity...
 It would be great if you looked at the code and enabled it. This would
 really be an improvement for the mapper stuff in Lift 1.1

 Julian

 --

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



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




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

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.

 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.


--

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




[Lift] Race conditions / database transaction isolation levels

2009-12-06 Thread cody koeninger
Do mapper or record provide any assistance for avoiding race
conditions caused by the database transaction isolation level?  I
didn't notice anything in my initial skim of the lift book, and
grepping the code for obvious suspects like for update didn't return
anything.

If not, what are people with production lift apps doing?  Run postgres
in default read committed and cross your fingers?

--

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




Re: [Lift] Newbie on Lift Scala: Build in class source code?

2009-12-06 Thread Alex Boisvert
Part of the source for these objects is automatically created when you
generate your lift app using the Maven archetype.   For example, you'll find
the source to the User class unde
src/main/scala/com/liftworkshop/model/User.scala.

For classes that are part of the framework, such as MegaProtoUser etc.
you'll find the source on Github at http://github.com/dpp/liftweb/ and more
specifically look at ProtoUser.scala under
http://github.com/dpp/liftweb/tree/master/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/.
Also be sure to select the branch of Lift that you are using in order to
avoid confusion.

Good luck and keep asking question ;)
alex




On Sun, Dec 6, 2009 at 3:54 PM, itsjar its...@gmail.com wrote:

 Hi,

 I'm considering building a web application with my software
 engineering group in Lift.
 However when I started with lift I was surprised that I received a
 whole log in / sign up website by
 just using the MegaProtoUser.
 This was at first sight fun, but I started wondering (and I'm pretty
 sure my professor will say the same): Do I really know what I just
 did?.

 So I decided to try and rebuild the Log in / Sign up thing from
 scratch by using my own plain objects.
 Ive been working on that for 2 days and It's been s frustrating.

 I've been reading the lift book... Tutorials.. but all of them start
 with the MegaProtoUser.
 In 1.5 days time I only managed to make an index (signup) page with a
 username/password field and a button which then redirects to a new
 page.

 Let me tell you in advance, I am totally new to Web developing.

 Problems I have right now:
   - I have no idea if my code actually created a User in my database
 and I have no idea how to check it...
   - I have no idea how to log in a user. I saw code in the sample
 programs that compare the current logged in user with other users by
 using a select statement. However retrieving the current user is based
 upon the MegaProtoUser. I wonder how this is done behind my back since
 I have no idea how to keep a variable of a 'logged in user' which
 stays active across all pages..

 Because of these problems I thought it might be useful to see the
 source code of the classes..
 Is it possible to see the scala source code of these classes?

 Thanks,
 itsjar


 --

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




--

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




Re: [Lift] Re: How can one bind value-less attributes?

2009-12-06 Thread Alex Boisvert
Using the latest and greatest (master branch), I can't reproduce the
MatchError but I can reproduce the issue with the attribute being generated
if the value is null.

I'll fix it tomorrow morning.

alex


On Sun, Dec 6, 2009 at 5:59 AM, Alex Black a...@alexblack.ca wrote:

  If you output null for theattributevalue, theattributeis not
  rendered:

 I've just upgraded from 1.0 to 1.1-M6, and this doesn't seem to work
 any more - could this be a bug in M6?

 Message: scala.MatchError: null
scala.runtime.ScalaRunTime$.boxArray(ScalaRunTime.scala:136)
net.liftweb.util.BindHelpers$class.mix$1(BindHelpers.scala:612)
net.liftweb.util.BindHelpers$class.net$liftweb$util$BindHelpers$
 $bindByNameMixIn(BindHelpers.scala:618)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$
 $anonfun$apply$27.apply(BindHelpers.scala:440)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$
 $anonfun$apply$27.apply(BindHelpers.scala:436)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:436)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)

  net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:
 449)

  net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:
 409)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:409)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:380)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)


 
  scala bind(stuff, input type=checkbox stuff:s=/,
 AttrBindParam(s,Text(checked),checked))
  res11: scala.xml.NodeSeq = input type=checkbox
 checked=checked/input
 
  scala bind(stuff, input type=checkbox stuff:s=/,
 AttrBindParam(s,null,selected))
  res12: scala.xml.NodeSeq = input type=checkbox /input
 
  /Jeppe

 --

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




--

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




Re: [Lift] re: what changes would need to be made so LIFT can work with HTML5

2009-12-06 Thread James Black
I tried S.setDocType and got this error, using LIFT 1.0.1, with this bit of
code in Boot.scala:
class Boot {
  def boot {
if (!DB.jndiJdbcConnAvailable_?)
  DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor)

  S.setDocType(Box(List(!DOCTYPE html)))
...

2009-12-06 22:38:32.662:WARN::failed LiftFilter:
java.lang.AbstractMethodError
2009-12-06 22:38:32.662:WARN::failed
org.mortbay.jetty.plugin.jetty6pluginwebappcont...@519549e{/,C:\Users\owner\workspace\ResumeAppLift\src\main\webapp}:
java.lang.AbstractMethodError
2009-12-06 22:38:32.662:WARN::failed contexthandlercollect...@391a74ef:
java.lang.AbstractMethodError
2009-12-06 22:38:32.662:WARN::failed handlercollect...@77f31432:
java.lang.AbstractMethodError
2009-12-06 22:38:32.662:WARN::Error starting handlers
java.lang.AbstractMethodError
at scala.actors.Scheduler$.impl(Scheduler.scala:35)
at scala.actors.Scheduler$.execute(Scheduler.scala:101)
at scala.actors.Actor$class.start(Actor.scala:783)
at
net.liftweb.http.PointlessActorToWorkAroundBug$.start(LiftServlet.scala:702)
at
net.liftweb.http.PointlessActorToWorkAroundBug$.ctor(LiftServlet.scala:765)
at
net.liftweb.http.PointlessActorToWorkAroundBug$.init(LiftServlet.scala:774)
at
net.liftweb.http.PointlessActorToWorkAroundBug$.clinit(LiftServlet.scala)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:563)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at
org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
at
org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
at
org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
at
org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
at
org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
2009-12-06 22:38:32.686:INFO::Started selectchannelconnec...@0.0.0.0:8080

On Sun, Dec 6, 2009 at 1:15 AM, Alex Boisvert alex.boisv...@gmail.comwrote:

 Have 

Re: [Lift] re: what changes would need to be made so LIFT can work with HTML5

2009-12-06 Thread James Black
I forgot, this is in my default.html:
html xmlns:lift=http://liftweb.net/;
  head


On Sun, Dec 6, 2009 at 10:43 PM, James Black planiturth...@gmail.comwrote:

 I tried S.setDocType and got this error, using LIFT 1.0.1, with this bit of
 code in Boot.scala:
 class Boot {
   def boot {
 if (!DB.jndiJdbcConnAvailable_?)
   DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor)

   S.setDocType(Box(List(!DOCTYPE html)))
 ...

 2009-12-06 22:38:32.662:WARN::failed LiftFilter:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::failed
 org.mortbay.jetty.plugin.jetty6pluginwebappcont...@519549e{/,C:\Users\owner\workspace\ResumeAppLift\src\main\webapp}:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::failed contexthandlercollect...@391a74ef:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::failed handlercollect...@77f31432:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::Error starting handlers
 java.lang.AbstractMethodError
 at scala.actors.Scheduler$.impl(Scheduler.scala:35)
 at scala.actors.Scheduler$.execute(Scheduler.scala:101)
 at scala.actors.Actor$class.start(Actor.scala:783)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.start(LiftServlet.scala:702)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.ctor(LiftServlet.scala:765)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.init(LiftServlet.scala:774)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.clinit(LiftServlet.scala)
 at net.liftweb.http.LiftFilter.init(LiftServlet.scala:563)
 at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
 at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
 at
 org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
 at
 org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
 at
 org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
 at
 org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
 at
 org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
 at org.mortbay.jetty.Server.doStart(Server.java:224)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
 at
 org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
 at
 org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
 at
 org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
 at
 org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
 at
 org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
 at
 org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at
 

Re: [Lift] re: what changes would need to be made so LIFT can work with HTML5

2009-12-06 Thread David Pollak
Please do not use Lift 1.0.1.  It was a broken release.

If you are using Lift 1.0.2, please make sure that all of your Lift
references (in your pom.xml file) are set to 1.0.2 and that the Scala
version is set to 2.7.5.  Then do a mvn -U clean jetty:run

I cannot advise against using Lift 1.0.x strongly enough.

Please use Lift 1.1-M6 or 1.1-SNAPSHOT.  They are more stable and better
supported.

In terms of the S.setDocType method, it has not changed its signature since
1.0... it's still Box[String]

Please read
http://blog.lostlake.org/index.php?/archives/50-The-Scala-Option-class-and-how-lift-uses-it.html

In order to call the method, you would do:

S.setDocType(Full(!DOCTYPE html))

I'm not sure how your call worked, but it should not have.

In the future, when something is not working (e.g., CRUDify), please post
the error message that you are receiving.  For example, if you're getting a
compiler error on CRUDify, it's very likely that you mixed CRUDify into the
Mapper class rather than correctly mixing it into the MetaMapper object.

Thanks,

David


On Sun, Dec 6, 2009 at 7:43 PM, James Black planiturth...@gmail.com wrote:

 I tried S.setDocType and got this error, using LIFT 1.0.1, with this bit of
 code in Boot.scala:
 class Boot {
   def boot {
 if (!DB.jndiJdbcConnAvailable_?)
   DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor)

   S.setDocType(Box(List(!DOCTYPE html)))
 ...

 2009-12-06 22:38:32.662:WARN::failed LiftFilter:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::failed
 org.mortbay.jetty.plugin.jetty6pluginwebappcont...@519549e{/,C:\Users\owner\workspace\ResumeAppLift\src\main\webapp}:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::failed contexthandlercollect...@391a74ef:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::failed handlercollect...@77f31432:
 java.lang.AbstractMethodError
 2009-12-06 22:38:32.662:WARN::Error starting handlers
 java.lang.AbstractMethodError
 at scala.actors.Scheduler$.impl(Scheduler.scala:35)
 at scala.actors.Scheduler$.execute(Scheduler.scala:101)
 at scala.actors.Actor$class.start(Actor.scala:783)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.start(LiftServlet.scala:702)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.ctor(LiftServlet.scala:765)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.init(LiftServlet.scala:774)
 at
 net.liftweb.http.PointlessActorToWorkAroundBug$.clinit(LiftServlet.scala)
 at net.liftweb.http.LiftFilter.init(LiftServlet.scala:563)
 at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
 at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
 at
 org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
 at
 org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
 at
 org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
 at
 org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
 at
 org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
 at org.mortbay.jetty.Server.doStart(Server.java:224)
 at
 org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
 at
 org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
 at
 org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
 at
 org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
 at
 org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
 at
 org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
 at
 org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at
 

Re: [Lift] Re: How can one bind value-less attributes?

2009-12-06 Thread David Pollak
On Sun, Dec 6, 2009 at 7:25 PM, Alex Boisvert alex.boisv...@gmail.comwrote:

 Using the latest and greatest (master branch), I can't reproduce the
 MatchError but I can reproduce the issue with the attribute being generated
 if the value is null.


How about adding a Box alternative rather than perpetuating a paradigm based
on null?



 I'll fix it tomorrow morning.

 alex



 On Sun, Dec 6, 2009 at 5:59 AM, Alex Black a...@alexblack.ca wrote:

  If you output null for theattributevalue, theattributeis not
  rendered:

 I've just upgraded from 1.0 to 1.1-M6, and this doesn't seem to work
 any more - could this be a bug in M6?

 Message: scala.MatchError: null
scala.runtime.ScalaRunTime$.boxArray(ScalaRunTime.scala:136)
net.liftweb.util.BindHelpers$class.mix$1(BindHelpers.scala:612)
net.liftweb.util.BindHelpers$class.net$liftweb$util$BindHelpers$
 $bindByNameMixIn(BindHelpers.scala:618)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$
 $anonfun$apply$27.apply(BindHelpers.scala:440)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind$1$1$
 $anonfun$apply$27.apply(BindHelpers.scala:436)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:436)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:444)
net.liftweb.util.BindHelpers$$anonfun$bind$2$$anonfun$in_bind
 $1$1.apply(BindHelpers.scala:424)
scala.Seq$class.flatMap(Seq.scala:294)
scala.xml.NodeSeq.flatMap(NodeSeq.scala:34)
net.liftweb.util.BindHelpers$$anonfun$bind$2.in_bind$1
 (BindHelpers.scala:424)

  net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:
 449)

  net.liftweb.util.BindHelpers$$anonfun$bind$2.apply(BindHelpers.scala:
 409)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:409)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)
net.liftweb.util.BindHelpers$class.bind(BindHelpers.scala:380)
net.liftweb.util.Helpers$.bind(Helpers.scala:29)


 
  scala bind(stuff, input type=checkbox stuff:s=/,
 AttrBindParam(s,Text(checked),checked))
  res11: scala.xml.NodeSeq = input type=checkbox
 checked=checked/input
 
  scala bind(stuff, input type=checkbox stuff:s=/,
 AttrBindParam(s,null,selected))
  res12: scala.xml.NodeSeq = input type=checkbox /input
 
  /Jeppe

 --

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



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




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

--

You received this message because you are 

[Lift] seeing JVM BUG(s) - cancelling interestOps==0

2009-12-06 Thread Xuefeng Wu
Hi,

I always find the information from console:  seeing JVM BUG(s) - cancelling
interestOps==0

What's the reason?

I use jetty 6.1.21, and I'm afraid it will cause serious error if I deploy
the liftweb app in IBM WAS(WebSphere  App Server)

-- 
Scala中文社区:  http://groups.google.com/group/scalacn

--

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




Re: [Lift] seeing JVM BUG(s) - cancelling interestOps==0

2009-12-06 Thread David Pollak
On Sun, Dec 6, 2009 at 10:21 PM, Xuefeng Wu ben...@gmail.com wrote:

 Hi,

 I always find the information from console:  seeing JVM BUG(s) - cancelling
 interestOps==0

 What's the reason?

 I use jetty 6.1.21, and I'm afraid it will cause serious error if I deploy
 the liftweb app in IBM WAS(WebSphere  App Server)


http://dev.eclipse.org/mhonarc/lists/jetty-commit/msg00154.html

Looks like Jetty is detecting and working around a bug in the JVM:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6403933



 --
 Scala中文社区:  http://groups.google.com/group/scalacn

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




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

--

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




[Lift] Error when uploading large files

2009-12-06 Thread DMB
I'm getting this one in M7 when trying to upload a 8MB image file.
Smaller files work just fine. It would empirically seem that I'm
running against some kind of limit somewhere. If that's the case, is
there a way to raise the limit?

Message: org.apache.commons.fileupload.FileUploadBase
$FileUploadIOException
org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl
$FileItemStreamImpl$1.raiseError(FileUploadBase.java:753)
org.apache.commons.fileupload.util.LimitedInputStream.checkLimit
(LimitedInputStream.java:71)
org.apache.commons.fileupload.util.LimitedInputStream.read
(LimitedInputStream.java:128)
java.io.FilterInputStream.read(FilterInputStream.java:90)
net.liftweb.util.IoHelpers$class.readOnce$2(IOHelpers.scala:92)
net.liftweb.util.IoHelpers$class.readWholeStream(IOHelpers.scala:97)
net.liftweb.util.Helpers$.readWholeStream(Helpers.scala:30)
net.liftweb.http.LiftRules$$anonfun$45.apply(LiftRules.scala:1051)
net.liftweb.http.LiftRules$$anonfun$45.apply(LiftRules.scala:1050)
net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.next
(HTTPRequestServlet.scala:114)
net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.next
(HTTPRequestServlet.scala:98)
scala.Iterator$class.toList(Iterator.scala:696)
net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.toList
(HTTPRequestServlet.scala:98)
net.liftweb.http.provider.servlet.HTTPRequestServlet.extractFiles
(HTTPRequestServlet.scala:116)
net.liftweb.http.Req$$anonfun$5.apply(Req.scala:146)
net.liftweb.http.Req$$anonfun$5.apply(Req.scala:141)
net.liftweb.http.Req.x$18(Req.scala:319)
net.liftweb.http.Req.uploadedFiles(Req.scala:318)
net.liftweb.http.LiftSession.runParams(LiftSession.scala:303)
net.liftweb.http.LiftSession.processRequest(LiftSession.scala:489)
net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
$dispatchStatefulRequest(LiftServlet.scala:254)
net.liftweb.http.LiftServlet$$anonfun$3.apply(LiftServlet.scala:171)
net.liftweb.http.LiftServlet$$anonfun$3.apply(LiftServlet.scala:171)
net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:950)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
$anonfun$apply$24.apply(S.scala:1090)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:887)
SNIP

In case this helps, here's what I have in the form:
lift:surround with=default at=content
  lift:snippet type=upload_view:show form=post multipart=true
input type=file name=file_upload /
input value=Upload type=submit/
  /lift:snippet
/lift:surround

And here's how I retrieve the file from the request:
def show(xhtml: NodeSeq) : NodeSeq = {
for {
request - S.request if S.post_?
file - request.uploadedFiles.find(_.name ==
file_upload)
} acceptFile(file)
xhtml
}

--

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




[Lift] Re: Error when uploading large files

2009-12-06 Thread DMB
Never mind, found the setting:

LiftRules.maxMimeSize = 25 * 1024 * 1024
LiftRules.maxMimeFileSize = 25 * 1024 * 1024

On Dec 6, 10:48 pm, DMB combust...@gmail.com wrote:
 I'm getting this one in M7 when trying to upload a 8MB image file.
 Smaller files work just fine. It would empirically seem that I'm
 running against some kind of limit somewhere. If that's the case, is
 there a way to raise the limit?

 Message: org.apache.commons.fileupload.FileUploadBase
 $FileUploadIOException
         org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl
 $FileItemStreamImpl$1.raiseError(FileUploadBase.java:753)
         org.apache.commons.fileupload.util.LimitedInputStream.checkLimit
 (LimitedInputStream.java:71)
         org.apache.commons.fileupload.util.LimitedInputStream.read
 (LimitedInputStream.java:128)
         java.io.FilterInputStream.read(FilterInputStream.java:90)
         net.liftweb.util.IoHelpers$class.readOnce$2(IOHelpers.scala:92)
         net.liftweb.util.IoHelpers$class.readWholeStream(IOHelpers.scala:97)
         net.liftweb.util.Helpers$.readWholeStream(Helpers.scala:30)
         net.liftweb.http.LiftRules$$anonfun$45.apply(LiftRules.scala:1051)
         net.liftweb.http.LiftRules$$anonfun$45.apply(LiftRules.scala:1050)
         net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.next
 (HTTPRequestServlet.scala:114)
         net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.next
 (HTTPRequestServlet.scala:98)
         scala.Iterator$class.toList(Iterator.scala:696)
         net.liftweb.http.provider.servlet.HTTPRequestServlet$$anon$1.toList
 (HTTPRequestServlet.scala:98)
         net.liftweb.http.provider.servlet.HTTPRequestServlet.extractFiles
 (HTTPRequestServlet.scala:116)
         net.liftweb.http.Req$$anonfun$5.apply(Req.scala:146)
         net.liftweb.http.Req$$anonfun$5.apply(Req.scala:141)
         net.liftweb.http.Req.x$18(Req.scala:319)
         net.liftweb.http.Req.uploadedFiles(Req.scala:318)
         net.liftweb.http.LiftSession.runParams(LiftSession.scala:303)
         net.liftweb.http.LiftSession.processRequest(LiftSession.scala:489)
         net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
 $dispatchStatefulRequest(LiftServlet.scala:254)
         net.liftweb.http.LiftServlet$$anonfun$3.apply(LiftServlet.scala:171)
         net.liftweb.http.LiftServlet$$anonfun$3.apply(LiftServlet.scala:171)
         net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:950)
         net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
 $anonfun$apply$24.apply(S.scala:1090)
         net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:887)
 SNIP

 In case this helps, here's what I have in the form:
 lift:surround with=default at=content
   lift:snippet type=upload_view:show form=post multipart=true
     input type=file name=file_upload /
     input value=Upload type=submit/
   /lift:snippet
 /lift:surround

 And here's how I retrieve the file from the request:
     def show(xhtml: NodeSeq) : NodeSeq = {
         for {
             request - S.request if S.post_?
             file - request.uploadedFiles.find(_.name ==
 file_upload)
         } acceptFile(file)
         xhtml
     }

--

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




[Lift] I was giving a short interview for JavaBooks.org about Lift Scala

2009-12-06 Thread Marius
Hi,

After a long day I ended up giving this interview.

http://vimeo.com/7986506

Br's,
Marius

P.S. Please forgive my crappy English.

--

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