[Lift] Re: FileUploadIOException with streaming upload

2009-07-14 Thread Josh Suereth
What web server are you using for testing?   It's been a while, but I
remember having to configure 3 different file-size limits in our appliance.
We're using Apache-Tomcat forwarding though, so I'm not sure where things
would be for you necessarily.

Anyway, I remember the seeing the same issue, and tweaking a new-found
parameter that did the trick.  I'll try to find out from a coworker which
one that was.

- Josh

On Tue, Jul 14, 2009 at 8:20 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Guys,

 Im trying to test this new upload progress widget i've written and the
 obvious way to do that is use a big upload locally so it takes time
 and i can see it working. I configured my maxMimeSize to this:

 LiftRules.maxMimeSize = 30 * 1024 * 1024

 And I get the following error message when I upload a file that is
 larger than 8mb (small uploads work fine) - see below for exception...

 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.http.OnDiskFileParamHolder$.doUpload$1(Req.scala:74)
net.liftweb.http.OnDiskFileParamHolder$.apply(Req.scala:82)
eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
 (UploadProgress.scala:19)
eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
 (UploadProgress.scala:18)
net.liftweb.http.Req$$anonfun$3$$anon$1.next(Req.scala:157)
net.liftweb.http.Req$$anonfun$3$$anon$1.next(Req.scala:144)
scala.Iterator$class.toList(Iterator.scala:696)
net.liftweb.http.Req$$anonfun$3$$anon$1.toList(Req.scala:144)
net.liftweb.http.Req$$anonfun$3.apply(Req.scala:159)
net.liftweb.http.Req$$anonfun$3.apply(Req.scala:139)
net.liftweb.http.Req.x$16(Req.scala:328)
net.liftweb.http.Req.uploadedFiles(Req.scala:327)
net.liftweb.http.LiftSession.runParams(LiftSession.scala:330)
net.liftweb.http.LiftSession.processRequest(LiftSession.scala:558)
net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
 $dispatchStatefulRequest(LiftServlet.scala:239)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:909)

 Caught and thrown by:
 Message: org.apache.commons.fileupload.FileUploadBase
 $FileSizeLimitExceededException: The field F1052029947622ETF exceeds
 its maximum permitted  size of 7340032 characters.
org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl
 $FileItemStreamImpl$1.raiseError(FileUploadBase.java:746)
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.http.OnDiskFileParamHolder$.doUpload$1(Req.scala:74)
net.liftweb.http.OnDiskFileParamHolder$.apply(Req.scala:82)
eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
 (UploadProgress.scala:19)
eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
 (UploadProgress.scala:18)



 


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



[Lift] Re: FileUploadIOException with streaming upload

2009-07-14 Thread Timothy Perrett

Hey Josh,

That was my thinking too - im just using jetty locally with mvn
jetty:run - a bit of googling gives me:

-Dorg.mortbay.jetty.Request.maxFormContentSize=50

Whilst I can't verify if this is the latest for Jetty 6, it doesn't
appear to have any effect what-so-ever... Im not getting a trace /
response that indicates to me that its specifically a jetty problem
anywho.

I also tried running the server as root to see if it was a file write
permissions issue but that too had zero effect and the stack trace
persists.

Cheers, Tim



On Jul 14, 1:24 pm, Josh Suereth joshua.suer...@gmail.com wrote:
 What web server are you using for testing?   It's been a while, but I
 remember having to configure 3 different file-size limits in our appliance.
 We're using Apache-Tomcat forwarding though, so I'm not sure where things
 would be for you necessarily.

 Anyway, I remember the seeing the same issue, and tweaking a new-found
 parameter that did the trick.  I'll try to find out from a coworker which
 one that was.

 - Josh

 On Tue, Jul 14, 2009 at 8:20 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:





  Guys,

  Im trying to test this new upload progress widget i've written and the
  obvious way to do that is use a big upload locally so it takes time
  and i can see it working. I configured my maxMimeSize to this:

  LiftRules.maxMimeSize = 30 * 1024 * 1024

  And I get the following error message when I upload a file that is
  larger than 8mb (small uploads work fine) - see below for exception...

  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.http.OnDiskFileParamHolder$.doUpload$1(Req.scala:74)
         net.liftweb.http.OnDiskFileParamHolder$.apply(Req.scala:82)
         eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
  (UploadProgress.scala:19)
         eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
  (UploadProgress.scala:18)
         net.liftweb.http.Req$$anonfun$3$$anon$1.next(Req.scala:157)
         net.liftweb.http.Req$$anonfun$3$$anon$1.next(Req.scala:144)
         scala.Iterator$class.toList(Iterator.scala:696)
         net.liftweb.http.Req$$anonfun$3$$anon$1.toList(Req.scala:144)
         net.liftweb.http.Req$$anonfun$3.apply(Req.scala:159)
         net.liftweb.http.Req$$anonfun$3.apply(Req.scala:139)
         net.liftweb.http.Req.x$16(Req.scala:328)
         net.liftweb.http.Req.uploadedFiles(Req.scala:327)
         net.liftweb.http.LiftSession.runParams(LiftSession.scala:330)
         net.liftweb.http.LiftSession.processRequest(LiftSession.scala:558)
         net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
  $dispatchStatefulRequest(LiftServlet.scala:239)
         net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
         net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
         net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:909)

  Caught and thrown by:
  Message: org.apache.commons.fileupload.FileUploadBase
  $FileSizeLimitExceededException: The field F1052029947622ETF exceeds
  its maximum permitted  size of 7340032 characters.
         org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl
  $FileItemStreamImpl$1.raiseError(FileUploadBase.java:746)
         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.http.OnDiskFileParamHolder$.doUpload$1(Req.scala:74)
         net.liftweb.http.OnDiskFileParamHolder$.apply(Req.scala:82)
         eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
  (UploadProgress.scala:19)
         eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
  (UploadProgress.scala:18)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Accessing a StatefulSnippet instance from a custom dispatch

2009-07-14 Thread Ross Mellgren
The RequestVar sounds a bit more fun, but I'd rather not take your  
time -- I'm sure if the SessionVar becomes onerous I can toy with  
that. I have some concerns about stability of the image URLs,  
actually, so using a SessionVar with some stable names seems like a  
better idea.

I'm interested in learning how the state works in detail in lift  
though, so do you mind explaining why there might be multiple  
instances? I assumed that (session, snippet class) was one-to-one with  
snippet instances?

-Ross

On Jul 14, 2009, at 2:18 PM, David Pollak wrote:



 On Tue, Jul 14, 2009 at 10:50 AM, Ross Mellgren dri...@gmail.com  
 wrote:
 darn, I was hoping I could just get away with letting Lift manage  
 the session by virtue of managing the session snippet.

 There may be multiple stateful snippet instances for a given  
 stateful snippet within the system.  Figuring out which is which is  
 a non-trivial task for your image serving URL.

 If you really, really don't like the SessionVar idea, you can bind a  
 function to your /image request and that function can deposit a  
 reference to the current stateful snippet into a RequestVar that can  
 be accessed during the image serving process.  If you like that  
 answer better, give me a few days to whip up an example.


 Thanks for the advice.

 -Ross

 On Jul 13, 2009, at 6:38 PM, David Pollak wrote:



 On Mon, Jul 13, 2009 at 3:21 PM, Ross Mellgren dri...@gmail.com  
 wrote:

 Hi all,

 Is there any way to get a StatefulSnippet instance for a particular
 class in the current session? It looks like there's machinery in S,
 LiftRules, and LiftSession to get these but they're all marked
 private[http].

 I'm still getting used to Lift, so I could very well be approaching
 this the wrong way (using a custom dispatch) -- I have a snippet  
 which
 manages an image editing workflow. I'd like to create a dispatch  
 which
 serves up the current version of the image(s) to the user, so I need
 to dump back a raw response without any template processing.

 I could stuff the current image(s) in a SessionVar or perhaps use an
 injector and RequestVar, perhaps?

 Your best bet is to use a SessionVar.  Put the image or a pointer  
 to how to get the image in a SessionVar.


 -Ross






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









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

 


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



[Lift] Re: FileUploadIOException with streaming upload

2009-07-14 Thread David Pollak
Tim,

You need both these lines:

LiftRules.maxMimeSize = 30 * 1024 * 1024
LiftRules.maxMimeFileSize = LiftRules.maxMimeSize

The first defines the maximum acceptable size of *all* the pieces of the
MIME encoded POST and the second defines the maximum size of a given file in
the MIME stream.

Thanks,

David

On Tue, Jul 14, 2009 at 5:47 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Hey Josh,

 That was my thinking too - im just using jetty locally with mvn
 jetty:run - a bit of googling gives me:

 -Dorg.mortbay.jetty.Request.maxFormContentSize=50

 Whilst I can't verify if this is the latest for Jetty 6, it doesn't
 appear to have any effect what-so-ever... Im not getting a trace /
 response that indicates to me that its specifically a jetty problem
 anywho.

 I also tried running the server as root to see if it was a file write
 permissions issue but that too had zero effect and the stack trace
 persists.

 Cheers, Tim



 On Jul 14, 1:24 pm, Josh Suereth joshua.suer...@gmail.com wrote:
  What web server are you using for testing?   It's been a while, but I
  remember having to configure 3 different file-size limits in our
 appliance.
  We're using Apache-Tomcat forwarding though, so I'm not sure where
 things
  would be for you necessarily.
 
  Anyway, I remember the seeing the same issue, and tweaking a new-found
  parameter that did the trick.  I'll try to find out from a coworker which
  one that was.
 
  - Josh
 
  On Tue, Jul 14, 2009 at 8:20 AM, Timothy Perrett timo...@getintheloop.eu
 wrote:
 
 
 
 
 
   Guys,
 
   Im trying to test this new upload progress widget i've written and the
   obvious way to do that is use a big upload locally so it takes time
   and i can see it working. I configured my maxMimeSize to this:
 
   LiftRules.maxMimeSize = 30 * 1024 * 1024
 
   And I get the following error message when I upload a file that is
   larger than 8mb (small uploads work fine) - see below for exception...
 
   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.http.OnDiskFileParamHolder$.doUpload$1(Req.scala:74)
  net.liftweb.http.OnDiskFileParamHolder$.apply(Req.scala:82)
  eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
   (UploadProgress.scala:19)
  eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
   (UploadProgress.scala:18)
  net.liftweb.http.Req$$anonfun$3$$anon$1.next(Req.scala:157)
  net.liftweb.http.Req$$anonfun$3$$anon$1.next(Req.scala:144)
  scala.Iterator$class.toList(Iterator.scala:696)
  net.liftweb.http.Req$$anonfun$3$$anon$1.toList(Req.scala:144)
  net.liftweb.http.Req$$anonfun$3.apply(Req.scala:159)
  net.liftweb.http.Req$$anonfun$3.apply(Req.scala:139)
  net.liftweb.http.Req.x$16(Req.scala:328)
  net.liftweb.http.Req.uploadedFiles(Req.scala:327)
  net.liftweb.http.LiftSession.runParams(LiftSession.scala:330)
  
  net.liftweb.http.LiftSession.processRequest(LiftSession.scala:558)
  net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
   $dispatchStatefulRequest(LiftServlet.scala:239)
  
  net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
  
  net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:155)
  net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:909)
 
   Caught and thrown by:
   Message: org.apache.commons.fileupload.FileUploadBase
   $FileSizeLimitExceededException: The field F1052029947622ETF exceeds
   its maximum permitted  size of 7340032 characters.
  
  org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl
   $FileItemStreamImpl$1.raiseError(FileUploadBase.java:746)
  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.http.OnDiskFileParamHolder$.doUpload$1(Req.scala:74)
  net.liftweb.http.OnDiskFileParamHolder$.apply(Req.scala:82)
  eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
   (UploadProgress.scala:19)
  eu.getintheloop.example.lib.UploadProgress$$anonfun$init$2.apply
   (UploadProgress.scala:18)
 



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


[Lift] Re: Accessing a StatefulSnippet instance from a custom dispatch

2009-07-14 Thread David Pollak
On Tue, Jul 14, 2009 at 11:23 AM, Ross Mellgren dri...@gmail.com wrote:

 The RequestVar sounds a bit more fun, but I'd rather not take your time --
 I'm sure if the SessionVar becomes onerous I can toy with that. I have some
 concerns about stability of the image URLs, actually, so using a SessionVar
 with some stable names seems like a better idea.
 I'm interested in learning how the state works in detail in lift though, so
 do you mind explaining why there might be multiple instances? I assumed that
 (session, snippet class) was one-to-one with snippet instances?


Open two browser tabs and in each tab browse to:
http://demo.liftweb.net/arc

In the first browser tab, enter first and in the second enter second.
Click the submit button on each.

You'll see that the state of each browser tab is separate.

If you do a view source and look at the form... there's a hidden field in
the form.

What's happening under the covers is that the hidden field maps to a
function on the server.  The function tells the current Lift session that
if, during the processing of the current request, Lift finds a snippet named
whatever the name of the stateful snippet is named, don't create a new
instance, but use the instance that the function holds.  In this way, the
snippet maintains state because it's the same instance (with the same
instance variables, etc.)

But if you have two different browser windows, each has instantiated a new
stateful snippet and each of the hidden fields maps to a different function
that associates different instances of the stateful snippet with the snippet
name.


 -Ross

 On Jul 14, 2009, at 2:18 PM, David Pollak wrote:



 On Tue, Jul 14, 2009 at 10:50 AM, Ross Mellgren dri...@gmail.com wrote:

 darn, I was hoping I could just get away with letting Lift manage the
 session by virtue of managing the session snippet.


 There may be multiple stateful snippet instances for a given stateful
 snippet within the system.  Figuring out which is which is a non-trivial
 task for your image serving URL.

 If you really, really don't like the SessionVar idea, you can bind a
 function to your /image request and that function can deposit a reference to
 the current stateful snippet into a RequestVar that can be accessed during
 the image serving process.  If you like that answer better, give me a few
 days to whip up an example.



 Thanks for the advice.

 -Ross

 On Jul 13, 2009, at 6:38 PM, David Pollak wrote:



 On Mon, Jul 13, 2009 at 3:21 PM, Ross Mellgren dri...@gmail.com wrote:


 Hi all,

 Is there any way to get a StatefulSnippet instance for a particular
 class in the current session? It looks like there's machinery in S,
 LiftRules, and LiftSession to get these but they're all marked
 private[http].

 I'm still getting used to Lift, so I could very well be approaching
 this the wrong way (using a custom dispatch) -- I have a snippet which
 manages an image editing workflow. I'd like to create a dispatch which
 serves up the current version of the image(s) to the user, so I need
 to dump back a raw response without any template processing.

 I could stuff the current image(s) in a SessionVar or perhaps use an
 injector and RequestVar, perhaps?


 Your best bet is to use a SessionVar.  Put the image or a pointer to how
 to get the image in a SessionVar.



 -Ross






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









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





 



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

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



[Lift] Re: Code Review for Unique Key Constraints

2009-07-14 Thread Derek Chen-Becker
OK, it's merged. An example usage of the new GenericIndex is:

package com.test.model

import _root_.net.liftweb.mapper._

class DateItem extends Mapper[DateItem] with IdPK {
  def getSingleton = DateItem
  object timestamp extends MappedDateTime(this)
  object time extends MappedTime(this)
  object date extends MappedDate(this)
}

object DateItem extends DateItem with MetaMapper[DateItem] {
  override def fieldOrder = date :: time :: timestamp :: Nil
  override def dbIndexes = GenericIndex({ (table,columns) =
String.format(CREATE UNIQUE INDEX %s ON %s %s, myindex_ + table + _ +
columns.mkString(_), table, columns.mkString((, ,, )))},
IHaveValidatedThisSQL(Derek, 2009-07-13), date) :: Nil
}

It's basically up to you to generate the DDL statement based on the table
and column names.

Derek

On Mon, Jul 13, 2009 at 4:11 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 OK, on wip-dcb-unique-indices there's now a GenericIndex that should give
 you full flexibility to do whatever you want for an index. I'll hold until
 tomorrow to merge with trunk.

 Derek


 On Mon, Jul 13, 2009 at 9:26 AM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 I'll add a UserIndex type that will let you specify the creation of the
 index directly. Unique indices are generally supported across all DBs,
 AFAIK, so it makes it more clear to have a specific type.

 Derek


 On Mon, Jul 13, 2009 at 7:40 AM, Calen Pennington 
 calen.penning...@gmail.com wrote:


 Hey, I'm glad the code could make it in. One comment on your changes:
 It seems to me that using the pattern matching in ensureIndexes puts
 Lift in the position of maintaining support for various DBs, rather
 than letting the client code do it in a project by project basis (for
 instance, the FULLTEXT and SPACIAL index types that I mentioned, that
 are mysql specific.) Is there a reason that you preferred that over
 allowing client code to specify the index type?

 -Cale

 On Fri, Jul 10, 2009 at 5:32 PM, Derek Chen-Beckerdchenbec...@gmail.com
 wrote:
  I've pushed a smaller commit into the wip-dcb-unique-indices branch on
  GitHub that adds a UniqueIndex case class. Conceivably we could add
 other
  types of indices if there's a need. If no one has any objections to
 what
  I've added I can merge with trunk on Monday.
 
  Derek
 
  http://github.com/dpp/liftweb/tree/wip-dcb-unique-indices
 
  On Thu, Jul 9, 2009 at 9:44 PM, DFectuoso santiago1...@gmail.com
 wrote:
 
  I for one would like to say: Cool! Thanks! If i need unique indexes in
  the next couple of weeks i'll get this baby to the war( .war thats
  it ) =)
 
  On Jul 9, 11:30 am, Calen Pennington calen.penning...@gmail.com
  wrote:
   As mentioned is this issue
   (http://github.com/dpp/liftweb/issues#issue/19), and as came up on
 the
   list recently, Lift currently has no way to specify that a field or
 an
   index be unique. I've coded up a patch that addresses this, and
 could
   also be used for other index types on a project specific basis (for
   instance, FULLTEXT or SPATIAL indexes in mysql).
  
   -Cale
  
0001-Adding-the-ability-to-create-UNIQUE-indexes-over-sin.patch
   5KViewDownload
 
 
 
 
  
 

 




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



[Lift] Re: S.hostName?

2009-07-14 Thread David Pollak
On Tue, Jul 14, 2009 at 3:04 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 This looks a little suspicious:

   /**
* The host that the request was made on
*/
   def hostName: String = servletRequest.map(_.getServerName).openOr(
 nowhere_123.com)

 Is there a reason that this wouldn't be configured to just return a Box?


Because it was written in 2006 before I understood boxes and options...
darned legacy.




 Derek

 



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

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



[Lift] Re: S.hostName?

2009-07-14 Thread Derek Chen-Becker
Hmmm. Same thing on hostAndPath?

On Tue, Jul 14, 2009 at 4:07 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 I'm about to commit some documentation stuff in S.scala, so I can just
 modify it now.

 Derek


 On Tue, Jul 14, 2009 at 4:05 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Tue, Jul 14, 2009 at 3:04 PM, Derek Chen-Becker dchenbec...@gmail.com
  wrote:

 This looks a little suspicious:

   /**
* The host that the request was made on
*/
   def hostName: String = servletRequest.map(_.getServerName).openOr(
 nowhere_123.com)

 Is there a reason that this wouldn't be configured to just return a Box?


 Because it was written in 2006 before I understood boxes and options...
 darned legacy.




 Derek





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

 



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



[Lift] Re: S.hostName?

2009-07-14 Thread David Pollak
On Tue, Jul 14, 2009 at 3:12 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 Hmmm. Same thing on hostAndPath?


yep.




 On Tue, Jul 14, 2009 at 4:07 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 I'm about to commit some documentation stuff in S.scala, so I can just
 modify it now.

 Derek


 On Tue, Jul 14, 2009 at 4:05 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Tue, Jul 14, 2009 at 3:04 PM, Derek Chen-Becker 
 dchenbec...@gmail.com wrote:

 This looks a little suspicious:

   /**
* The host that the request was made on
*/
   def hostName: String = servletRequest.map(_.getServerName).openOr(
 nowhere_123.com)

 Is there a reason that this wouldn't be configured to just return a Box?


 Because it was written in 2006 before I understood boxes and options...
 darned legacy.




 Derek





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





 



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

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



[Lift] Jetty PermGen

2009-07-14 Thread Naftoli Gugenhem

After mvn jetty:run reloads my changes a number of times, it runs out of 
PermGen memory.
What is PermGen exactly and how can I prevent this from happening?

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



[Lift] Re: Jetty PermGen

2009-07-14 Thread David Pollak
PermGen is the Permanent Generation... it's where all the classes are stored
in the JVM.

There are two ways around the issue:

   - Use JavaRebel (which was fixed as of this morning to once again support
   Scala and you can get a free Scala license for it)
   - Increase the PermGen heap space in your JVM.  See
   
http://www.brokenbuild.com/blog/2006/08/04/java-jvm-gc-permgen-and-memory-options/

Thanks,

David

On Tue, Jul 14, 2009 at 3:26 PM, Naftoli Gugenhem naftoli...@gmail.comwrote:


 After mvn jetty:run reloads my changes a number of times, it runs out of
 PermGen memory.
 What is PermGen exactly and how can I prevent this from happening?

 



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

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



[Lift] Re: Jetty PermGen

2009-07-14 Thread Alex Boisvert
It typically means you are leaking classes through the classloader
hierarchy.

e.g.  A class in your webapp classloader is referenced in a parent
classloader.

Common culprits are JDBC drivers which should be placed in Jetty's bootstrap
classloader and not packaged in your webapp's lib directory (due to the way
JDBC drivers are initialized and referenced by DriverManager).

alex

On Tue, Jul 14, 2009 at 3:26 PM, Naftoli Gugenhem naftoli...@gmail.comwrote:


 After mvn jetty:run reloads my changes a number of times, it runs out of
 PermGen memory.
 What is PermGen exactly and how can I prevent this from happening?

 


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



[Lift] Re: ProtoUser and securing pages

2009-07-14 Thread Chris Lewis

I guess the first question I should have asked is how do I go about 
logging a user in. I have my user model, which now mixes in 
MegaProtoUser. I also persist instances, but I don't know how to start 
a user session. I noticed the logUserIn method - I assume that's where 
to start when I get back into the app later this evening, but I was 
wondering if there are any example apps that use this? I didnt see any 
in the current source, and, assuming it makes a difference, I'm using 1.0.

thanks again,
chris

David Pollak wrote:
 
 
 On Tue, Jul 14, 2009 at 9:20 AM, glenn gl...@exmbly.com 
 mailto:gl...@exmbly.com wrote:
 
 
 I do something similar in menu items to hide them for different user
 roles, but
 the error message: No Navigation Defined, is displayed if the right
 user isn't logged in.
 How do I turn this off?
 
 
 Upgrade based on the fix I just checked in. :-)
  
 
 
 
 
 On Jul 14, 4:02 am, Chris Lewis burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com wrote:
   Too easy! Thanks for the help David - I'll msg the channel when
 the app
   is on github. Fine job with Lift - it's been a joy so far!
  
   David Pollak wrote:
  
On Mon, Jul 13, 2009 at 8:57 PM, Chris Lewis
 burningodzi...@gmail.com mailto:burningodzi...@gmail.com
mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com wrote:
  
That'll get me started. User there however, must mixin
 MegaProtoUser
instead of ProtoUser right (getting compilation errors)?
  
Yeah... you have to build your User from
 MegaProtoUser/MetaMegaProtoUser.
  
I guess I'm interested in how/when/where the checking
 happens, but that
suggests I need to have a source dive. I do need secured
 pages in the
SiteMenu (which I can have once I work out the compilation
 issues), but
what if I need to secure a URL handled via custom dispatch,
 and so is
not in the menu?
  
Sitemap is for protecting XHTML pages... stuff that's rendered
 to the
browser.
  
If you have a custom dispatch, then you have to build the
 protection
logic into the dispatch:
  
case Req(my_page :: thing :: Nil, _, GetRequest) if
 User.loggedIn_?
= () = XmlResponse(helloworld/hello)
  
A little bonus of the app is a bookmarklet that
actually makes it useful, and it hits up that URL. The idea
 would be to
secure that URL in lift and if the user is logged it would
 just work.
  
I'll hack on it a bit more tomorrow - thanks again!
  
chris
  
David Pollak wrote:
  In Boot.scala, define your SiteMap as:
  
  // Build SiteMap
  val entries = Menu(Loc(Home, List(index),
 Home)) ::
  Menu(Loc(Protected, List(protected), Protected,
  If(User.loggedIn_? _, You must be loggd in to view this
 page))) ::
  User.sitemap
  
  Note the If() clause that tests if the user is logged
 in and
will not
  display the menu item or let you access that page.
  
  Is this what you're looking for?
  
  On Mon, Jul 13, 2009 at 8:23 PM, Chris Lewis
burningodzi...@gmail.com mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com mailto:burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com
mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com wrote:
  
  Hello list,
  
  I'm writing a lift app for a presentation Wednesday.
 It's a
simple
  little app that is all but done, missing only the
 ability to
secure
  pages. I've got a /really/ simple registration page
 (template
with a
  user name field, bound in a snippet that persists
 the User
model).
  What's missing is the ability to secure pages if the
 user is
logged in.
  I'm reading through the lift book and I just don't
 see in
there how it's
  done.
  
  FWIW, I'm working with lift 1.0. I switched to
 1.1-SNAPSHOT
and there
  were some strange query-related breakages, so for
 the sake of
the demo
  I'll stick with 1.0. I'm sorry if this question has been
asked 1000
  times - can anyone offer a good resource or example
 (logins,
logouts,
  secured pages)?
  
  Thanks! Lift is pretty cool so far :) - I'll github
 the app
   

[Lift] Re: ProtoUser and securing pages

2009-07-14 Thread David Pollak
On Tue, Jul 14, 2009 at 3:32 PM, Chris Lewis burningodzi...@gmail.comwrote:


 I guess the first question I should have asked is how do I go about
 logging a user in. I have my user model, which now mixes in
 MegaProtoUser. I also persist instances, but I don't know how to start
 a user session. I noticed the logUserIn method - I assume that's where
 to start when I get back into the app later this evening, but I was
 wondering if there are any example apps that use this? I didnt see any
 in the current source, and, assuming it makes a difference, I'm using 1.0.

 thanks again,
 chris


Chris,

Did you start your app based on one of the Lift templates?

If you take a look at line 27 of:
http://github.com/dpp/lift_1_1_sample/blob/master/src/main/scala/bootstrap/liftweb/Boot.scala

You'll see how the MegaProtoUser can manage its own menus.  From that, you
get login, logout, etc.

Does this help?

Thanks,

David




 David Pollak wrote:
 
 
  On Tue, Jul 14, 2009 at 9:20 AM, glenn gl...@exmbly.com
  mailto:gl...@exmbly.com wrote:
 
 
  I do something similar in menu items to hide them for different user
  roles, but
  the error message: No Navigation Defined, is displayed if the right
  user isn't logged in.
  How do I turn this off?
 
 
  Upgrade based on the fix I just checked in. :-)
 
 
 
 
 
  On Jul 14, 4:02 am, Chris Lewis burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com wrote:
Too easy! Thanks for the help David - I'll msg the channel when
  the app
is on github. Fine job with Lift - it's been a joy so far!
   
David Pollak wrote:
   
 On Mon, Jul 13, 2009 at 8:57 PM, Chris Lewis
  burningodzi...@gmail.com mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com wrote:
   
 That'll get me started. User there however, must mixin
  MegaProtoUser
 instead of ProtoUser right (getting compilation errors)?
   
 Yeah... you have to build your User from
  MegaProtoUser/MetaMegaProtoUser.
   
 I guess I'm interested in how/when/where the checking
  happens, but that
 suggests I need to have a source dive. I do need secured
  pages in the
 SiteMenu (which I can have once I work out the compilation
  issues), but
 what if I need to secure a URL handled via custom dispatch,
  and so is
 not in the menu?
   
 Sitemap is for protecting XHTML pages... stuff that's rendered
  to the
 browser.
   
 If you have a custom dispatch, then you have to build the
  protection
 logic into the dispatch:
   
 case Req(my_page :: thing :: Nil, _, GetRequest) if
  User.loggedIn_?
 = () = XmlResponse(helloworld/hello)
   
 A little bonus of the app is a bookmarklet that
 actually makes it useful, and it hits up that URL. The idea
  would be to
 secure that URL in lift and if the user is logged it would
  just work.
   
 I'll hack on it a bit more tomorrow - thanks again!
   
 chris
   
 David Pollak wrote:
   In Boot.scala, define your SiteMap as:
   
   // Build SiteMap
   val entries = Menu(Loc(Home, List(index),
  Home)) ::
   Menu(Loc(Protected, List(protected), Protected,
   If(User.loggedIn_? _, You must be loggd in to view this
  page))) ::
   User.sitemap
   
   Note the If() clause that tests if the user is logged
  in and
 will not
   display the menu item or let you access that page.
   
   Is this what you're looking for?
   
   On Mon, Jul 13, 2009 at 8:23 PM, Chris Lewis
 burningodzi...@gmail.com mailto:burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com mailto:burningodzi...@gmail.com
   mailto:burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com wrote:
   
   Hello list,
   
   I'm writing a lift app for a presentation Wednesday.
  It's a
 simple
   little app that is all but done, missing only the
  ability to
 secure
   pages. I've got a /really/ simple registration page
  (template
 with a
   user name field, bound in a snippet that persists
  the User
 model).
   What's missing is the ability to secure pages if the
  user is
 logged in.
   I'm reading through the lift book and I just don't
  see in
 there how it's
   done.
   
   FWIW, 

[Lift] Re: S.hostName?

2009-07-14 Thread Derek Chen-Becker
OK, docs and minor changes pushed. If someone is depending on things like
S.hostAndPath, S.hostName or S.contextPath, you'll need to update your code
to process a Box instead of a String.

Derek

On Tue, Jul 14, 2009 at 4:15 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Tue, Jul 14, 2009 at 3:12 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 Hmmm. Same thing on hostAndPath?


 yep.




 On Tue, Jul 14, 2009 at 4:07 PM, Derek Chen-Becker dchenbec...@gmail.com
  wrote:

 I'm about to commit some documentation stuff in S.scala, so I can just
 modify it now.

 Derek


 On Tue, Jul 14, 2009 at 4:05 PM, David Pollak 
 feeder.of.the.be...@gmail.com wrote:



 On Tue, Jul 14, 2009 at 3:04 PM, Derek Chen-Becker 
 dchenbec...@gmail.com wrote:

 This looks a little suspicious:

   /**
* The host that the request was made on
*/
   def hostName: String = servletRequest.map(_.getServerName).openOr(
 nowhere_123.com)

 Is there a reason that this wouldn't be configured to just return a
 Box?


 Because it was written in 2006 before I understood boxes and options...
 darned legacy.




 Derek





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









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

 


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



[Lift] Nice 404's?

2009-07-14 Thread DFectuoso

How can I implement nice 404's so instead of getting The Requested
URL /dsdsa was not found on this server  I Could have some HTML
there?

Pretty simple question =) (If there's a tutorial or documentation
about this out there just point me there and ill serve myself, sorry
for a simple post I just didn't find anything in the lift book/wiki/
google)

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



[Lift] Please back out the Box[] changes

2009-07-14 Thread David Pollak
Derek,

There's a lot of code that relies on the existing (admittedly broken)
implementation of host, hostAndPath, etc.

Can you back out the changes and leave things the way there were?

Thanks,

David

PS -- Every app I have broke.

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

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



[Lift] Re: Wiki Articles

2009-07-14 Thread Xavi Ramirez

Thanks Alex!  That exactly what we need.  Over the next couple of
days, I'm going to start organizing the existing wiki articles around
this outline.

In the mean time, is there a chance someone could help me get any of
the following done?
- Replace the wiki logo with the lift logo
- Add syntax highlighting
- Open up registration (I'll monitor the recently modified page daily
to keep the spam down)

Thanks,
Xavi

On Tue, Jul 14, 2009 at 1:47 PM, Alex Cruisea...@cluonflux.com wrote:

 Jeremy Day wrote:
 1. Logging in using various methods, i.e. basic authentication,
 OpenID, etc.
 2. Displaying or hiding information based on user credentials.
 3. Setting up simple AJAX calls, such as getting a list of search
 results based on and entered keyword.
 These are great suggestions for Examples that we'd like someone to
 build/identify; we can wire them up to Features as required.

 What's the feature tree?  Here's a strawman that will hopefully prompt
 further discussion.

 - Templating
  * Snippets etc.

 - Sitemap/Menus
  * Conditional display
  * Access control (does authn/authz belong in its own topic?)

 - Client-side interactivity
  * Comet
  * AJAX

 - Forms
  * Security
  * Callback validation
  * File upload

 - ORM
  * Mapper
  * Record

 - Services
  * REST
    ^ XML
    ^ JSON

 - I18n/L10n
  * In templates
  * ?

 - ...?

 -0xe1a

 


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



[Lift] Re: Google Analytics

2009-07-14 Thread Xavi Ramirez

Sorry, I didn't replay earlier, but it turns out that the operation
is not supported code: 9 error is related to the fact that the
default Google Analytics snippet uses document.write().  It turns out
that XHTML does not support document.write(), which causes Firefox to
chock.

Ultimately, I replaced the default Google Analytics snippet with this one:
script src=http://www.google-analytics.com/ga.js; type=text/javascript /
script type=text/javascript
//![CDATA[
try { var pageTracker = _gat._getTracker(UA-4384857-1);
pageTracker._trackPageview(); } catch(err) {}
//]]
/script

A full write up of my experiences with Google Analytics and Lift can
be found here:
http://www.the-xavi.com/articles/operation-is-not-supported-code-9

~Xavi

On Tue, Jul 7, 2009 at 4:34 PM, Xavi Ramirezxavi@gmail.com wrote:
 Thanks!  I ran into this exact problem.  Is there any way to get rid
 of it?  Is there a lift:production tag?

 Thanks,
 Xavi

 On Tue, Mar 17, 2009 at 5:22 PM, Charles F. Munatc...@munat.com wrote:

 OK, I have to stop posting this crap when it's 5:30 AM, I've been
 working for 18 hours straight, and my brain is fried.

 The problem was that I was looking at it on my development machine, not
 the production server. The Google Analytics code is tied to the URL. If
 the URL is wrong, it doesn't serve the script, so Firebug reports the
 error. I are dumb.

 Hopefully, though, my posting this will save some other person a hassle
 and a little public embarrassment.

 Chas.

 Derek Chen-Becker wrote:
 Can you send the beginning of the XHTML output, up to and including the
 GA script?

 Derek

 On Tue, Mar 17, 2009 at 6:31 AM, Charles F. Munat c...@munat.com
 mailto:c...@munat.com wrote:


     Is anyone else using Google Analytics? I am getting this strange
     JavaScript error:

     operation is not supported code: 9
      var pageTracker = _gat._getTracker(UA-5774043-2);

     The Google scripts are supposed to be placed right before the closing
     body tag, but Lift inserts its own script in there. I can't imagine how
     that would make a difference, but it is the only thing different from
     what Google recommends.

     Also, the analytics are not working.

     Any ideas?

     Chas.




 

 



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



[Lift] Re: lift presentation

2009-07-14 Thread Wilson MacGyver

Just want to report back, I gave the lift presentation to my local
java user group.
It went well. The comet-chat demo was a crowd pleaser.

I want to especially thank Marius and David for letting me use their material.
Fun times.

Thanks,
Mac

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



[Lift] Re: Please back out the Box[] changes

2009-07-14 Thread Naftoli Gugenhem

Isn't it easy to fix the apps with a find/replace?

-
David Pollakfeeder.of.the.be...@gmail.com wrote:

Derek,

There's a lot of code that relies on the existing (admittedly broken)
implementation of host, hostAndPath, etc.

Can you back out the changes and leave things the way there were?

Thanks,

David

PS -- Every app I have broke.

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



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



[Lift] Re: Nice 404's?

2009-07-14 Thread DFectuoso

I don't know how i missed that wiki page

I think :
// Redirect
LiftRules.uriNotFound.prepend{
  case (req, _) = PermRedirectResponse(404, req)
}

Is all i needed =) And yes the entry is understandable enought.

Thanks!


On Jul 14, 5:04 pm, Xavi Ramirez xavi@gmail.com wrote:
 Here's a quick 
 tutorial:http://wiki.liftweb.net/index.php/Setting_up_a_custom_404_page

 Not sure if it's comprehensive, but it's a nice start.

 Thanks,
 Xavi

 On Tue, Jul 14, 2009 at 7:00 PM, DFectuososantiago1...@gmail.com wrote:

  How can I implement nice 404's so instead of getting The Requested
  URL /dsdsa was not found on this server  I Could have some HTML
  there?

  Pretty simple question =) (If there's a tutorial or documentation
  about this out there just point me there and ill serve myself, sorry
  for a simple post I just didn't find anything in the lift book/wiki/
  google)

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



[Lift] Re: Jetty PermGen

2009-07-14 Thread Shanky Surana
How do you go about getting a free Scala license for JavaRebel (I was
previously using the license that stopped working on July 1st)?

Do you have to email them to get it, or is there a link where I can go to
download the license file?  I googled 'javarebel scala', and looked around
their site, but didn't find anything.

-Shanky

On Tue, Jul 14, 2009 at 6:31 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 PermGen is the Permanent Generation... it's where all the classes are
 stored in the JVM.

 There are two ways around the issue:

- Use JavaRebel (which was fixed as of this morning to once again
support Scala and you can get a free Scala license for it)
- Increase the PermGen heap space in your JVM.  See

 http://www.brokenbuild.com/blog/2006/08/04/java-jvm-gc-permgen-and-memory-options/

 Thanks,

 David

 On Tue, Jul 14, 2009 at 3:26 PM, Naftoli Gugenhem naftoli...@gmail.comwrote:


 After mvn jetty:run reloads my changes a number of times, it runs out of
 PermGen memory.
 What is PermGen exactly and how can I prevent this from happening?





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


 


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



[Lift] Re: ProtoUser and securing pages

2009-07-14 Thread Chris Lewis

Thanks for the assistance David, and to suresk in the IRC channel as 
well as tjweir (I was pointed to his example code). My app is where I 
wanted it for the demo. This week and next will be pretty slamming at 
work, but I will try to find some time to push the app to github soon.

sincerely,
chris

David Pollak wrote:
 
 
 On Tue, Jul 14, 2009 at 3:32 PM, Chris Lewis burningodzi...@gmail.com 
 mailto:burningodzi...@gmail.com wrote:
 
 
 I guess the first question I should have asked is how do I go about
 logging a user in. I have my user model, which now mixes in
 MegaProtoUser. I also persist instances, but I don't know how to start
 a user session. I noticed the logUserIn method - I assume that's where
 to start when I get back into the app later this evening, but I was
 wondering if there are any example apps that use this? I didnt see any
 in the current source, and, assuming it makes a difference, I'm
 using 1.0.
 
 thanks again,
 chris
 
 
 Chris,
 
 Did you start your app based on one of the Lift templates?
 
 If you take a look at line 27 of: 
 http://github.com/dpp/lift_1_1_sample/blob/master/src/main/scala/bootstrap/liftweb/Boot.scala
 
 You'll see how the MegaProtoUser can manage its own menus.  From that, 
 you get login, logout, etc.
 
 Does this help?
 
 Thanks,
 
 David
  
 
 
 
 David Pollak wrote:
  
  
   On Tue, Jul 14, 2009 at 9:20 AM, glenn gl...@exmbly.com
 mailto:gl...@exmbly.com
   mailto:gl...@exmbly.com mailto:gl...@exmbly.com wrote:
  
  
   I do something similar in menu items to hide them for
 different user
   roles, but
   the error message: No Navigation Defined, is displayed if the
 right
   user isn't logged in.
   How do I turn this off?
  
  
   Upgrade based on the fix I just checked in. :-)
  
  
  
  
  
   On Jul 14, 4:02 am, Chris Lewis burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com
   mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com wrote:
 Too easy! Thanks for the help David - I'll msg the channel
 when
   the app
 is on github. Fine job with Lift - it's been a joy so far!

 David Pollak wrote:

  On Mon, Jul 13, 2009 at 8:57 PM, Chris Lewis
   burningodzi...@gmail.com mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com mailto:burningodzi...@gmail.com
  mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com
   mailto:burningodzi...@gmail.com
 mailto:burningodzi...@gmail.com wrote:

  That'll get me started. User there however, must mixin
   MegaProtoUser
  instead of ProtoUser right (getting compilation errors)?

  Yeah... you have to build your User from
   MegaProtoUser/MetaMegaProtoUser.

  I guess I'm interested in how/when/where the checking
   happens, but that
  suggests I need to have a source dive. I do need secured
   pages in the
  SiteMenu (which I can have once I work out the
 compilation
   issues), but
  what if I need to secure a URL handled via custom
 dispatch,
   and so is
  not in the menu?

  Sitemap is for protecting XHTML pages... stuff that's
 rendered
   to the
  browser.

  If you have a custom dispatch, then you have to build the
   protection
  logic into the dispatch:

  case Req(my_page :: thing :: Nil, _, GetRequest) if
   User.loggedIn_?
  = () = XmlResponse(helloworld/hello)

  A little bonus of the app is a bookmarklet that
  actually makes it useful, and it hits up that URL.
 The idea
   would be to
  secure that URL in lift and if the user is logged it
 would
   just work.

  I'll hack on it a bit more tomorrow - thanks again!

  chris

  David Pollak wrote:
In Boot.scala, define your SiteMap as:

// Build SiteMap
val entries = Menu(Loc(Home, List(index),
   Home)) ::
Menu(Loc(Protected, List(protected),
 Protected,
If(User.loggedIn_? _, You must be loggd in to
 view this
   page))) ::
User.sitemap

Note the If() clause that tests if the user is
 logged
   in and
  will not
display the menu item or let you access that page.
 

[Lift] Snippet knowing all the possible parameters?

2009-07-14 Thread DFectuoso

I don't know if its possible, but lift have surprised me so many times
so far that it worth to ask.

I have a html lift binding that i would like to place on several
places of my web application like:
lift:Foo.Bar variable=value/
lift:Foo.Bar variable=value1/
lift:Foo.Bar variable=value2/

Is there any way for Foo.Bar to programaticly know all the possible
values that it could receive in variable(and those being value, value1
and value2 and if someone adds a new binding somewhere else with
value3 then value3 too)?

Its a long shot but if you have any idea please do tell!

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