Re: [Lift] S.params disappear?

2010-02-04 Thread Naftoli Gugenheim
Just to double-check, can you acces the form data via the HTTPRequest?

-
chasc...@munat.com wrote:

Straight from the headers:

Content-Type: application/x-www-form-urlencoded; charset=UTF-8

It's a regular form with four text fields. Simple.

Wireshark shows that the packets are arriving at the server with the
parameters intact in the header. Adding a valve to the server.xml file
allowed me to determine that they were present in Tomcat on a POST
request, but missing from the PUT.

Proxy is through Apache 2. I can see no reason that Apache would strip
parts of the header from a PUT, so my presumption is that Tomcat is
discarding them. I've got a discussion going on the Tomcat users list, but
I'm 90% sure it's not Lift. Does the Lift filter engage before a valve?

Chas.


 Are you sending Content-Type: application/x-www-form-urlencoded or
 multipart/form-data (as appropriate for the body)?

 -Ross

 On Feb 3, 2010, at 2:48 PM, c...@munat.com wrote:

 I have a lift app that works perfectly when I use mvn jetty:run. Then I
 package it into a war and load it up in Tomcat 6 on the server, and when
 I
 do, suddenly it won't work.

 The issue is with the S.params. I have a form that submits via an Ajax
 PUT
 request. The params are sent in the header just fine. As I said, works
 like a charm on Jetty. But when it gets to Tomcat, the entity is saved
 with blank attributes... i.e., everything worked but the
 S.param(whatever) showed up blank. I tested this by doing
 S.param(whatever).openOr(Phooey) and, indeed, that attribute was set
 to Phooey on the new entity.

 Tomcat issue? Or am I missing something obvious? This form is running on
 a
 subdomain, so that's where I'm looking now (in server.xml).

 TIA,
 Chas.

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



Re: [Lift] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Jeppe Nejsum Madsen
Jonathan Ferguson j...@spiralarm.com writes:

 I would like to have the list view of one of my model objects as my home
 page.

 Can this done with out having the home page redirect to /mymodel/list ?

I don't think you can change the native URL of CRUDify list, but you
could add a rewrite (not redirect). See

http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework

/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] Facebook Application

2010-02-04 Thread Timothy Perrett

Seems like this would be a good task to assign to one of the new / free of task 
committers? It probably wouldn't take a huge amount of work to clean it up 
right? Ideally we want to avoid having modules in Lift that are totally 
unsupported :-)

Cheers, Tim

On 3 Feb 2010, at 22:52, David Pollak wrote:

 The current Lift Facebook support is old and growing cobwebs.  Jorge Ortiz, 
 the guy who wrote most of the code, might have some additional thoughts.
 
 My suggestion is looking for a Java-based FB library and using that within 
 your Lift app.
 
 Sorry.
 
 David

-- 
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: S.params disappear?

2010-02-04 Thread Timothy Perrett
Yeah, try dumping the Req instance and seeing what is there - if its
empty, then you can be sure its Tomcat causing the problem and not
Lift.

Cheers, Tim

On Feb 4, 8:03 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Just to double-check, can you acces the form data via the HTTPRequest?

 -

 chasc...@munat.com wrote:

 Straight from the headers:

 Content-Type: application/x-www-form-urlencoded; charset=UTF-8

 It's a regular form with four text fields. Simple.

 Wireshark shows that the packets are arriving at the server with the
 parameters intact in the header. Adding a valve to the server.xml file
 allowed me to determine that they were present in Tomcat on a POST
 request, but missing from the PUT.

 Proxy is through Apache 2. I can see no reason that Apache would strip
 parts of the header from a PUT, so my presumption is that Tomcat is
 discarding them. I've got a discussion going on the Tomcat users list, but
 I'm 90% sure it's not Lift. Does the Lift filter engage before a valve?

 Chas.





  Are you sending Content-Type: application/x-www-form-urlencoded or
  multipart/form-data (as appropriate for the body)?

  -Ross

  On Feb 3, 2010, at 2:48 PM, c...@munat.com wrote:

  I have a lift app that works perfectly when I use mvn jetty:run. Then I
  package it into a war and load it up in Tomcat 6 on the server, and when
  I
  do, suddenly it won't work.

  The issue is with the S.params. I have a form that submits via an Ajax
  PUT
  request. The params are sent in the header just fine. As I said, works
  like a charm on Jetty. But when it gets to Tomcat, the entity is saved
  with blank attributes... i.e., everything worked but the
  S.param(whatever) showed up blank. I tested this by doing
  S.param(whatever).openOr(Phooey) and, indeed, that attribute was set
  to Phooey on the new entity.

  Tomcat issue? Or am I missing something obvious? This form is running on
  a
  subdomain, so that's where I'm looking now (in server.xml).

  TIA,
  Chas.

  --
  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 
 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: lift-Json doesn't appear to be correctly handling attributes.

2010-02-04 Thread Joni Freeman
Thanks,

The fix is on review board now. Should be in master pretty soon. Note,
I made two changes to the test case you provided.

The expected result of example1 is:
{word:content,self:http://localhost:8080/word/
example,term:example,available:true}

The transformation converts XML attributes to fields in resulting JSON
object. The reason for this rule is that it keeps transformation more
stable. That is, these both will generate structurally equivalent
JSON:
wordfoo/word  - {word:foo}
word attr=barfoo/word   - {word:foo,attr:bar}

The expected result of example2 is:
{word:null,self:http://localhost:8080/word/
example,term:example,available:true}

Field word is null since there's no content: word .../word

Cheers Joni


On Feb 3, 11:31 pm, Jonathan Ferguson j...@spiralarm.com wrote:
 Thanks Joni,

 I've opened a ticket  http://github.com/dpp/liftweb/issues/issue/323.

 Cheers
 Jono

 On 3 February 2010 17:46, Joni Freeman freeman.j...@gmail.com wrote:

  Hi Jonathan,

  Yes, definitely a bug. Could you please open a ticket (http://
  github.com/dpp/liftweb/issues) and I will take a look at it. And
  thanks for the test case!

  Cheers Joni

  On Feb 3, 3:41 am, Jonathan Ferguson j...@spiralarm.com wrote:
   When converting XML to Json attributes are being lost, given the below
  XML
   document, we would expect
   {word:{word:content,self:http://localhost:8080/word/example
   ,term:example,available:true}}
   where as we get {word:content}
   example XML:
   word term=example self=http://localhost:8080/word/example;
   available=truecontent/word

   This is been tested on M1 and trunk.

   Thanks in advance.

   To repeat

   // From the command line, adjust paths as needed

   $scala -cp

  /Users/jono/.m2/repository/com/thoughtworks/paranamer/paranamer/2.0/paranamer-2.0.jar:/Users/jono/.m2/repository/net/liftweb/lift-json/2.0-SNAPSHOT/lift-json-2.0-SNAPSHOT.jar

   import scala.xml._
   import net.liftweb.json.JsonAST._
   import net.liftweb.json.Printer
   import net.liftweb.json.Xml

   val example1 = word term=example self=
 http://localhost:8080/word/example;
   available=truecontent/word
   val expected1 = {word:{word:content,self:
 http://localhost:8080/word/example
  ,term:example,available:true}}
   val got1 = Printer.compact(render(Xml.toJson(example1)))

   val example2 = word term=example self=
 http://localhost:8080/word/example;
   available=true/word
   val expected2 = {word:{word:content,self:
 http://localhost:8080/word/example
  ,term:example,available:true}}
   val got2 = Printer.compact(render(Xml.toJson(example2)))

   // Add to src/test/scala/net/liftweb/json/XmlBugs.scala

     Jono's XML with attributes parses correctly in {
   val example1 = word term=example self=
 http://localhost:8080/word/example;
   available=truecontent/word
   val expected1 = {word:{word:content,self:
 http://localhost:8080/word/example
  ,term:example,available:true}}

   val example2 = word term=example self=
 http://localhost:8080/word/example;
   available=true/word
   val expected2 = {word:{word:content,self:
 http://localhost:8080/word/example
  ,term:example,available:true}}

       Printer.compact(render(toJson(example1))) mustEqual expected1
       Printer.compact(render(toJson(example2))) mustEqual expected2
     }

   Here is what I get when I run the example provided.

   $scala -cp

  /Users/jono/.m2/repository/com/thoughtworks/paranamer/paranamer/2.0/paranamer-2.0.jar:/Users/jono/.m2/repository/net/liftweb/lift-json/2.0-SNAPSHOT/lift-json-2.0-SNAPSHOT.jar
   Welcome to Scala version 2.7.7.final (Java HotSpot(TM) 64-Bit Server VM,
   Java 1.6.0_17).
   Type in expressions to have them evaluated.
   Type :help for more information.

   scala import scala.xml._
   import scala.xml._

   scala import net.liftweb.json.JsonAST._
   import net.liftweb.json.JsonAST._

   scala import net.liftweb.json.Printer
   import net.liftweb.json.Printer

   scala import net.liftweb.json.Xml
   import net.liftweb.json.Xml

   scala

   scala val example1 = word term=example self=
 http://localhost:8080/word/example; available=truecontent/word
   example1: scala.xml.Elem = word self=
 http://localhost:8080/word/example;
   term=example available=truecontent/word

   scala val expected1 = {word:{word:content,self:
 http://localhost:8080/word/example
  ,term:example,available:true}}
   expected1: java.lang.String = {word:{word:content,self:
 http://localhost:8080/word/example,term:example,available:true}}

   scala val got1 = Printer.compact(render(Xml.toJson(example1)))
   got1: String = {word:content}

   scala

   Jono

   P.S I thought I had a fix, but it broke one of HarryH's tests.

   scala

   scala val example2 = word term=example self=
 http://localhost:8080/word/example; available=true/word
   example2: scala.xml.Elem = word self=
 http://localhost:8080/word/example;
   term=example available=true/word

   scala val expected2 = {word:{word:content,self:
 http://localhost:8080/word/example
  

[Lift] [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Channing Walton

Hi,
I've added some comet-fu in my lift app but I've found that it now takes a
minute or so for jetty to shut down.

Is there something I should have done to enable things to shutdown quicker?

Channing
-- 
View this message in context: 
http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27450451.html
Sent from the liftweb mailing list archive at Nabble.com.

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



Re: [Lift] [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Timothy Perrett

Are you seeing a stack trace?

Cheers, Tim


On 4 Feb 2010, at 10:15, Channing Walton wrote:

 
 Hi,
 I've added some comet-fu in my lift app but I've found that it now takes a
 minute or so for jetty to shut down.
 
 Is there something I should have done to enable things to shutdown quicker?
 
 Channing
 -- 
 View this message in context: 
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27450451.html
 Sent from the liftweb mailing list archive at Nabble.com.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=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: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Channing Walton

No, it eventually quits peacefully.


Timothy Perrett wrote:
 
 
 Are you seeing a stack trace?
 
 Cheers, Tim
 
 
 On 4 Feb 2010, at 10:15, Channing Walton wrote:
 
 
 Hi,
 I've added some comet-fu in my lift app but I've found that it now takes
 a
 minute or so for jetty to shut down.
 
 Is there something I should have done to enable things to shutdown
 quicker?
 
 Channing
 -- 
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27450451.html
 Sent from the liftweb mailing list archive at Nabble.com.
 
 -- 
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=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.
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27450729.html
Sent from the liftweb mailing list archive at Nabble.com.

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



[Lift] Lift Deployment

2010-02-04 Thread Arie
Hi, this is my first post to this group.  First off, I'm new to web
frameworks, lift and linux, I have however got a war file and
persistently been trying to get my compiled war file to run on my
linux box.  I compiled the war file using mvn compile.  My problem is
that after having tried to run glassfish, tomcat and jetty and spent
hours googling about configurations, and looking in this group I still
have not been successful in deploying my war file (the IRC channel is
mostly unresponsive too).  Obviously mvn jetty:run works, and I've had
limited success in getting glassfish to run in non-production mode
(http://wiki.glassfish.java.net/Wiki.jsp?
page=GettingStartedWithLiftOnGlassFish).

What I'm asking therefore is firstly: what is the simplest way to
deploy my war file, and secondly the steps by which I should do this.
It seems that jetty is the simplest way, this post -
http://www.mail-archive.com/liftweb@googlegroups.com/msg01296.html -
makes mention of nginx, which I have also not been able to make work.
Do I need a 'front-end' (I'm not familiar with this), and if so how do
I implement this?

I understand I may be asking the wrong questions, so a few pointers
would be great.

-- 
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: Lift Deployment

2010-02-04 Thread Timothy Perrett
Arie,

Getting your deployment server setup is the first thing. Getting
Jetty, Glassfish or others working is not really a question for this
list, but when they are running (see the respective container
documentation) you should just be able to drop  the compiled war file
(created with mvn clean package) into the web app deployer. Again,
you need to read that container documentation.

You dont need a front end server like NGINX, its just that most people
prefer one for flexibility of having multiple upstream servers /
backends etc.

I would start with Jetty, and deploy the war into webapps... from
there it should be available at http://host:8080/yourwebapp/

Of course, if you dont want to host yourself, i would recommend
stax.net those guys are great and have an integrated lift setup.

Cheers, Tim

On Feb 4, 11:29 am, Arie arie.lake...@gmail.com wrote:
 Hi, this is my first post to this group.  First off, I'm new to web
 frameworks, lift and linux, I have however got a war file and
 persistently been trying to get my compiled war file to run on my
 linux box.  I compiled the war file using mvn compile.  My problem is
 that after having tried to run glassfish, tomcat and jetty and spent
 hours googling about configurations, and looking in this group I still
 have not been successful in deploying my war file (the IRC channel is
 mostly unresponsive too).  Obviously mvn jetty:run works, and I've had
 limited success in getting glassfish to run in non-production mode
 (http://wiki.glassfish.java.net/Wiki.jsp?
 page=GettingStartedWithLiftOnGlassFish).

 What I'm asking therefore is firstly: what is the simplest way to
 deploy my war file, and secondly the steps by which I should do this.
 It seems that jetty is the simplest way, this post 
 -http://www.mail-archive.com/liftweb@googlegroups.com/msg01296.html-
 makes mention of nginx, which I have also not been able to make work.
 Do I need a 'front-end' (I'm not familiar with this), and if so how do
 I implement this?

 I understand I may be asking the wrong questions, so a few pointers
 would be great.

-- 
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] Single Table Inheritance

2010-02-04 Thread Mads Hartmann
Hello Everyone,

I'm currently trying to figure out how to map objects with inheritance
using the Mapper framework. I've got a Lab and a Scientist who inherit
from Source.

As I understand there's no direct way to do inheritance using the
Mapper framework so I'm trying to figure out how to implement 'Single
Table Inheritance'.

Right now I'm trying to create a single trait (Source) for the values
that they share called BaseSource and my idea is to mix it in both Lab
and Scientist. I would then define the table name of both scientist
and lab to be the same - I think this would work but what I'm not sure
of is the following:

- If both Scientist and Lab mixes in the IdPK trait and use the same
table, will the id still be unique?
- A Discovery has a source, how do i create MappedLongForeignKey to
the table they share (lab, scientist)?

I hope you'll be able to help me out :)

Thanks,
Mads Hartmann Jensen

-- 
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: Accessing innerHTML during bind?

2010-02-04 Thread Tim Maxwell
Hi David,

There really are a lot of paths available with scala/lift, aren't
there?

After looking at what you wrote, here's what I came up with that works
well/is functional and compact, in case anyone else is wondering about
it.

  def links(html:NodeSeq): NodeSeq={

Product.findActive.foldLeft(html) {
  (html, prod) = bind(links,html,
force_+prod.product -{x:NodeSeq = {a href={/forced?
product=+prod.product}{x}/a}}
  )
}
  }

Product is a JPA entity class, findactive returns a list of products.

If anyone has suggestions, please share.

Cheers,
Tim

On Feb 3, 5:08 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, Feb 3, 2010 at 12:44 PM, Tim Maxwell truthspi...@gmail.com wrote:
  Hi folks,

  I am trying to do binds based on a list of products. The point is to
  create links that can be wrapped around existing text or images.
  Something like this:

  signup:links.force_PRODThis is the link text our marketing dept.
  creates/signup:link

  Here's what I have so far in the snippet related to it:

   def links(html:NodeSeq): NodeSeq={

     val productBinds:Seq[BindParam] = Product.findActive.flatMap{
       prod = List[BindParam] (  TheBindParam( force_+prod.product,
  SHtml.link(/forced?product=+prod.product, ()=() , _ ) )  )
     }
     bind(links , html, productBinds: _*)

 It's so cool to see how people stuff in Lift...

 Within your function, you can get the element that's being bound with:

 BindHelpers.currentNode: Box[Elem]

 On the other hand, if you're looking to get the children of the node
 currently being bound:

  FuncBindParam(force_+prod.product, body = a
 href={/forced?product=+Helpers.urlEncode(prod.product)}{body}/a)

 Hope this helps.

 Thanks,

 David





   }

  Cheers,
  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.comliftweb%2bunsubscr...@googlegroups.com 
  
  .
  For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.

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



Re: [Lift] Re: Accessing innerHTML during bind?

2010-02-04 Thread Ross Mellgren
I think this new version will be slower than your original one, as each call to 
bind will visit the entire input XHTML. Why not use your original formulation 
but instead of TheBindParam, use FuncBindParam (which is the sugar-free version 
of body = ... that David describes)?

-Ross

On Feb 4, 2010, at 10:28 AM, Tim Maxwell wrote:

 Hi David,
 
 There really are a lot of paths available with scala/lift, aren't
 there?
 
 After looking at what you wrote, here's what I came up with that works
 well/is functional and compact, in case anyone else is wondering about
 it.
 
  def links(html:NodeSeq): NodeSeq={
 
Product.findActive.foldLeft(html) {
  (html, prod) = bind(links,html,
force_+prod.product -{x:NodeSeq = {a href={/forced?
 product=+prod.product}{x}/a}}
  )
}
  }
 
 Product is a JPA entity class, findactive returns a list of products.
 
 If anyone has suggestions, please share.
 
 Cheers,
 Tim
 
 On Feb 3, 5:08 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, Feb 3, 2010 at 12:44 PM, Tim Maxwell truthspi...@gmail.com wrote:
 Hi folks,
 
 I am trying to do binds based on a list of products. The point is to
 create links that can be wrapped around existing text or images.
 Something like this:
 
 signup:links.force_PRODThis is the link text our marketing dept.
 creates/signup:link
 
 Here's what I have so far in the snippet related to it:
 
  def links(html:NodeSeq): NodeSeq={
 
val productBinds:Seq[BindParam] = Product.findActive.flatMap{
  prod = List[BindParam] (  TheBindParam( force_+prod.product,
 SHtml.link(/forced?product=+prod.product, ()=() , _ ) )  )
}
bind(links , html, productBinds: _*)
 
 It's so cool to see how people stuff in Lift...
 
 Within your function, you can get the element that's being bound with:
 
 BindHelpers.currentNode: Box[Elem]
 
 On the other hand, if you're looking to get the children of the node
 currently being bound:
 
  FuncBindParam(force_+prod.product, body = a
 href={/forced?product=+Helpers.urlEncode(prod.product)}{body}/a)
 
 Hope this helps.
 
 Thanks,
 
 David
 
 
 
 
 
  }
 
 Cheers,
 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.comliftweb%2bunsubscr...@googlegroups.com 
 
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.
 
 --
 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.
 

-- 
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] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Naftoli Gugenheim
It's not overridable?

-
Jeppe Nejsum Madsenje...@ingolfs.dk wrote:

Jonathan Ferguson j...@spiralarm.com writes:

 I would like to have the list view of one of my model objects as my home
 page.

 Can this done with out having the home page redirect to /mymodel/list ?

I don't think you can change the native URL of CRUDify list, but you
could add a rewrite (not redirect). See

http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework

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

-- 
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] Single Table Inheritance

2010-02-04 Thread Jeppe Nejsum Madsen
Mads Hartmann mads...@gmail.com writes:

 Hello Everyone,

 I'm currently trying to figure out how to map objects with inheritance
 using the Mapper framework. I've got a Lab and a Scientist who inherit
 from Source.

 As I understand there's no direct way to do inheritance using the
 Mapper framework so I'm trying to figure out how to implement 'Single
 Table Inheritance'.

 Right now I'm trying to create a single trait (Source) for the values
 that they share called BaseSource and my idea is to mix it in both Lab
 and Scientist. I would then define the table name of both scientist
 and lab to be the same - I think this would work but what I'm not sure
 of is the following:

 - If both Scientist and Lab mixes in the IdPK trait and use the same
 table, will the id still be unique?
 - A Discovery has a source, how do i create MappedLongForeignKey to
 the table they share (lab, scientist)?

 I hope you'll be able to help me out :)

I can't say I follow the above :-) Do you want to share tables, code or
both? Maybe list the table structure and explain how you would like to
map it

/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] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Jeppe Nejsum Madsen
Naftoli Gugenheim naftoli...@gmail.com writes:

 It's not overridable?

Actually, I think it is :-)

You might be able to just 

override lazy val listPath = Nil

/Jeppe


 -
 Jeppe Nejsum Madsenje...@ingolfs.dk wrote:

 Jonathan Ferguson j...@spiralarm.com writes:

 I would like to have the list view of one of my model objects as my home
 page.

 Can this done with out having the home page redirect to /mymodel/list ?

 I don't think you can change the native URL of CRUDify list, but you
 could add a rewrite (not redirect). See

 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework

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

-- 
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: jQuery 1.4

2010-02-04 Thread Jeppe Nejsum Madsen
On Wed, Jan 27, 2010 at 7:38 PM, Jonathan Hoffman jonhoff...@gmail.com wrote:
 I think that makes sense.    How is this-- should we leave the default to
 1.3.2 for now?


What's the status on this? Afaics, the default is still 1.4? I would
like to get back on the bleeding edge :-), but need to stay on 2.0-M1
due to some incompatibilities with 1.4

/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] Single Table Inheritance

2010-02-04 Thread Mads Hartmann Jensen

hello Jeppe,

In my project I've got the following three models: A discovery, a  
Scientist and a lab. The Discovery has been invented by someone, this  
is either a single scientist or sometimes a lab - This is easily done  
through inheritance (would create a superclass named source) but I'm  
not sure how to do this so it maps nicely to the database.


Scientist and Lab only share one attribute so what I'm most interested  
in is to be able express that a Discovery has s source that can be  
either a lab or scientist :)


Hope this explains my problem more clearly, thanks for the help

Mads Hartmann

Sent from my iPhone

On 04/02/2010, at 18.17, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:


Mads Hartmann mads...@gmail.com writes:


Hello Everyone,

I'm currently trying to figure out how to map objects with  
inheritance
using the Mapper framework. I've got a Lab and a Scientist who  
inherit

from Source.

As I understand there's no direct way to do inheritance using the
Mapper framework so I'm trying to figure out how to implement 'Single
Table Inheritance'.

Right now I'm trying to create a single trait (Source) for the values
that they share called BaseSource and my idea is to mix it in both  
Lab

and Scientist. I would then define the table name of both scientist
and lab to be the same - I think this would work but what I'm not  
sure

of is the following:

- If both Scientist and Lab mixes in the IdPK trait and use the same
table, will the id still be unique?
- A Discovery has a source, how do i create MappedLongForeignKey to
the table they share (lab, scientist)?

I hope you'll be able to help me out :)


I can't say I follow the above :-) Do you want to share tables, code  
or

both? Maybe list the table structure and explain how you would like to
map it

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




--
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] Single Table Inheritance

2010-02-04 Thread Naftoli Gugenheim

-
Mads Hartmann Jensenmads...@gmail.com wrote:

hello Jeppe,

In my project I've got the following three models: A discovery, a  
Scientist and a lab. The Discovery has been invented by someone, this  
is either a single scientist or sometimes a lab - This is easily done  
through inheritance (would create a superclass named source) but I'm  
not sure how to do this so it maps nicely to the database.

Scientist and Lab only share one attribute so what I'm most interested  
in is to be able express that a Discovery has s source that can be  
either a lab or scientist :)

Hope this explains my problem more clearly, thanks for the help

Mads Hartmann

Sent from my iPhone

On 04/02/2010, at 18.17, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 Mads Hartmann mads...@gmail.com writes:

 Hello Everyone,

 I'm currently trying to figure out how to map objects with  
 inheritance
 using the Mapper framework. I've got a Lab and a Scientist who  
 inherit
 from Source.

 As I understand there's no direct way to do inheritance using the
 Mapper framework so I'm trying to figure out how to implement 'Single
 Table Inheritance'.

 Right now I'm trying to create a single trait (Source) for the values
 that they share called BaseSource and my idea is to mix it in both  
 Lab
 and Scientist. I would then define the table name of both scientist
 and lab to be the same - I think this would work but what I'm not  
 sure
 of is the following:

 - If both Scientist and Lab mixes in the IdPK trait and use the same
 table, will the id still be unique?
 - A Discovery has a source, how do i create MappedLongForeignKey to
 the table they share (lab, scientist)?

 I hope you'll be able to help me out :)

 I can't say I follow the above :-) Do you want to share tables, code  
 or
 both? Maybe list the table structure and explain how you would like to
 map it

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


-- 
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: Out of Memory Errors Building Lift

2010-02-04 Thread Peter Robinett
Thanks Jono, but unfortunately that didn't help.

Peter

On Feb 3, 6:53 pm, Jonathan Ferguson j...@spiralarm.com wrote:
 Try upgrading to the latest version of maven (2.2.1 or later ). I was having
 a simliar issue.

 Cheers
 Jono

 j...@192-168-1-69:~ $mvn -version
 Apache Maven 2.2.1 (r801777; 2009-08-07 05:16:01+1000)
 Java version: 1.6.0_17
 Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
 Default locale: en_US, platform encoding: utf8
 OS name: mac os x version: 10.6.2 arch: x86_64 Family: mac
 j...@192-168-1-69:~ $

 On 4 February 2010 13:09, Peter Robinett pe...@bubblefoundry.com wrote:



  Hi all,

  I seem to be to doing something wrong, as I keep getting out of memory
  errors when trying to build Lift from source. My command is:
  mvn -DXmx1024m -U clean install

  Am I missing something obvious? I've tried with 1024 and 2048
  megabytes of memory. I'm running Java 1.6.0_17 and Maven 2.2.0 on OS X
  (10.6) and have 4 gigabytes of physical memory.

  Peter

  --
  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: Out of Memory Errors Building Lift

2010-02-04 Thread Peter Robinett
Hmm, I see that it's always when running YUI Compressor on lift-
webkit. I actually had issues with YUI Compressor in the past (http://
groups.google.com/group/liftweb/browse_thread/thread/
f338204c6ee02dd3/3025b5ef300b4ee2) but this time I'm running the Sun
JVM, not OpenJDK.

Peter

On Feb 4, 11:19 am, Peter Robinett pe...@bubblefoundry.com wrote:
 Thanks Jono, but unfortunately that didn't help.

 Peter

 On Feb 3, 6:53 pm, Jonathan Ferguson j...@spiralarm.com wrote:



  Try upgrading to the latest version of maven (2.2.1 or later ). I was having
  a simliar issue.

  Cheers
  Jono

  j...@192-168-1-69:~ $mvn -version
  Apache Maven 2.2.1 (r801777; 2009-08-07 05:16:01+1000)
  Java version: 1.6.0_17
  Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
  Default locale: en_US, platform encoding: utf8
  OS name: mac os x version: 10.6.2 arch: x86_64 Family: mac
  j...@192-168-1-69:~ $

  On 4 February 2010 13:09, Peter Robinett pe...@bubblefoundry.com wrote:

   Hi all,

   I seem to be to doing something wrong, as I keep getting out of memory
   errors when trying to build Lift from source. My command is:
   mvn -DXmx1024m -U clean install

   Am I missing something obvious? I've tried with 1024 and 2048
   megabytes of memory. I'm running Java 1.6.0_17 and Maven 2.2.0 on OS X
   (10.6) and have 4 gigabytes of physical memory.

   Peter

   --
   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] Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread harryh
At least in my use case this is not idea as I am loading JSON
serialized mapper objects from memcached and the fields are not, in
fact, dirty.  There should possibly be some sort of higher level
mechanism that I can use to indicate that this is the case?

-harryh

-- 
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] Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread Ross Mellgren
How about:

myMappedObject.runSafe {
 myMappedObject.allFields.foreach(_.resetDirty)
}

?

-Ross

On Feb 4, 2010, at 2:50 PM, harryh wrote:

 At least in my use case this is not idea as I am loading JSON
 serialized mapper objects from memcached and the fields are not, in
 fact, dirty.  There should possibly be some sort of higher level
 mechanism that I can use to indicate that this is the case?
 
 -harryh
 
 -- 
 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.



Re: [Lift] Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 11:50 AM, harryh har...@gmail.com wrote:

 At least in my use case this is not idea as I am loading JSON
 serialized mapper objects from memcached and the fields are not, in
 fact, dirty.  There should possibly be some sort of higher level
 mechanism that I can use to indicate that this is the case?


There are a couple of options:


   - A global flag indicating that the fields are marked clean/dirty on
   deserialization
   - Serializing the dirty-state of each field (e.g., field_name_$dirty:
   true)
   - A thread-local flag for the default dirty/clean

Got a preference?



 -harryh

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



Re: [Lift] [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 2:15 AM, Channing Walton channingwal...@mac.comwrote:


 Hi,
 I've added some comet-fu in my lift app but I've found that it now takes a
 minute or so for jetty to shut down.


How are you shutting down your Jetty server?



 Is there something I should have done to enable things to shutdown quicker?

 Channing
 --
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27450451.html
 Sent from the liftweb mailing list archive at Nabble.com.

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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] Re: Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread harryh
 - Serializing the dirty-state of each field (e.g., field_name_$dirty:
 true)

This further increases the size of the serialized objects which is not
ideal

  - A thread-local flag for the default dirty/clean
   - A global flag indicating that the fields are marked clean/dirty on
   deserialization

And these seem no good due to the user of global variables

What about option 4:

- change the deserialize function to take an extra parameter
indicating whether the fields should be marked dirty or not.

?

-- 
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: Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 12:41 PM, harryh har...@gmail.com wrote:

  - Serializing the dirty-state of each field (e.g., field_name_$dirty:
  true)

 This further increases the size of the serialized objects which is not
 ideal

   - A thread-local flag for the default dirty/clean
- A global flag indicating that the fields are marked clean/dirty on
deserialization

 And these seem no good due to the user of global variables

 What about option 4:

 - change the deserialize function to take an extra parameter
 indicating whether the fields should be marked dirty or not.


Sure... Please update the ticket:
https://www.assembla.com/spaces/liftweb/tickets/2-Mapper-objects-deserialized-from-json-have-all-of-their-fields-marked-dirty-



 ?

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



Re: [Lift] S.params disappear?

2010-02-04 Thread David Pollak
Sounds to me like a Tomcat issue... I think we're relying on the container
to parse the body correctly.

On Wed, Feb 3, 2010 at 9:15 PM, c...@munat.com wrote:

 It's POST vs. PUT. I'm using AJAX, so I can do PUTs.

 The two are identical, except:

 POST instead of PUT

 The POST version includes:

 Pragma: no-cache
 Cache-Control: no-cache

 which the PUT does not. In other words, the headers are identical except
 for the above.

 In Jetty, no problem. In Tomcat, the params are ignored. They do not show
 up in S.params. At all.

 I can't imagine that this is a Lift issue, unless Tomcat makes params
 available differently for PUTs than for POSTs, but Jetty does not, and I'm
 the first guy to do PUTs to Lift on Tomcat. But I've emailed the Tomcat
 users list and we'll see if it's something simple. If not, I'll put
 something on GitHub.

 Chas.


  Is it a POST or a GET?
 
  On Wed, Feb 3, 2010 at 11:44 PM, c...@munat.com wrote:
 
  Thanks, David.
 
  That's a non-trivial exercise for me, so let me chase down another lead
  at
  the moment. If that proves fruitless, I'll bite the bullet and get
  something up on GitHub.
 
  Chas.
 
   Please put together a reproduceable example on GitHub (works in Jetty,
   doesn't work in Tomcat) and we'll look at it.
  
   On Wed, Feb 3, 2010 at 11:48 AM, c...@munat.com wrote:
  
   I have a lift app that works perfectly when I use mvn jetty:run. Then
  I
   package it into a war and load it up in Tomcat 6 on the server, and
  when
   I
   do, suddenly it won't work.
  
   The issue is with the S.params. I have a form that submits via an
  Ajax
   PUT
   request. The params are sent in the header just fine. As I said,
  works
   like a charm on Jetty. But when it gets to Tomcat, the entity is
  saved
   with blank attributes... i.e., everything worked but the
   S.param(whatever) showed up blank. I tested this by doing
   S.param(whatever).openOr(Phooey) and, indeed, that attribute was
  set
   to Phooey on the new entity.
  
   Tomcat issue? Or am I missing something obvious? This form is running
  on
   a
   subdomain, so that's where I'm looking now (in server.xml).
  
   TIA,
   Chas.
  
   --
   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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 
  liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
 liftweb%252bunsubscr...@googlegroups.comliftweb%25252bunsubscr...@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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.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 

Re: [Lift] Re: Out of Memory Errors Building Lift

2010-02-04 Thread Jeppe Nejsum Madsen
Peter Robinett pe...@bubblefoundry.com writes:

 Hmm, I see that it's always when running YUI Compressor on lift-
 webkit. I actually had issues with YUI Compressor in the past (http://
 groups.google.com/group/liftweb/browse_thread/thread/
 f338204c6ee02dd3/3025b5ef300b4ee2) but this time I'm running the Sun
 JVM, not OpenJDK.

I have essentially the same setup as you. I have

MAVEN_OPTS='-Xmx1624m -XX:MaxPermSize=128m'

and can do a 'mvn -U clean install

/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: Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 12:47 PM, Ross Mellgren dri...@gmail.com wrote:

 I reopened it since I marked it invalid pending the ML discussion.

 Added a comment with the ML discussion.


Excellent!



 -Ross

 On Feb 4, 2010, at 3:45 PM, David Pollak wrote:



 On Thu, Feb 4, 2010 at 12:41 PM, harryh har...@gmail.com wrote:

  - Serializing the dirty-state of each field (e.g., field_name_$dirty:
  true)

 This further increases the size of the serialized objects which is not
 ideal

   - A thread-local flag for the default dirty/clean
- A global flag indicating that the fields are marked clean/dirty on
deserialization

 And these seem no good due to the user of global variables

 What about option 4:

 - change the deserialize function to take an extra parameter
 indicating whether the fields should be marked dirty or not.


 Sure... Please update the ticket:

 https://www.assembla.com/spaces/liftweb/tickets/2-Mapper-objects-deserialized-from-json-have-all-of-their-fields-marked-dirty-



 ?

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


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



Re: [Lift] Single Table Inheritance

2010-02-04 Thread David Pollak
Please take a look at the MegaProtoUser and MegaMetaProtoUser code for
examples of how to create traits that can be mixed into classes.

Does that help?

On Thu, Feb 4, 2010 at 9:58 AM, Mads Hartmann Jensen mads...@gmail.comwrote:

 hello Jeppe,

 In my project I've got the following three models: A discovery, a Scientist
 and a lab. The Discovery has been invented by someone, this is either a
 single scientist or sometimes a lab - This is easily done through
 inheritance (would create a superclass named source) but I'm not sure how to
 do this so it maps nicely to the database.

 Scientist and Lab only share one attribute so what I'm most interested in
 is to be able express that a Discovery has s source that can be either a lab
 or scientist :)

 Hope this explains my problem more clearly, thanks for the help

 Mads Hartmann

 Sent from my iPhone


 On 04/02/2010, at 18.17, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  Mads Hartmann mads...@gmail.com writes:

  Hello Everyone,

 I'm currently trying to figure out how to map objects with inheritance
 using the Mapper framework. I've got a Lab and a Scientist who inherit
 from Source.

 As I understand there's no direct way to do inheritance using the
 Mapper framework so I'm trying to figure out how to implement 'Single
 Table Inheritance'.

 Right now I'm trying to create a single trait (Source) for the values
 that they share called BaseSource and my idea is to mix it in both Lab
 and Scientist. I would then define the table name of both scientist
 and lab to be the same - I think this would work but what I'm not sure
 of is the following:

 - If both Scientist and Lab mixes in the IdPK trait and use the same
 table, will the id still be unique?
 - A Discovery has a source, how do i create MappedLongForeignKey to
 the table they share (lab, scientist)?

 I hope you'll be able to help me out :)


 I can't say I follow the above :-) Do you want to share tables, code or
 both? Maybe list the table structure and explain how you would like to
 map it

 /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 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: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Channing Walton

ah, thats a good question. I am using sbt and its jetty-stop. I'll find out
what its doing.



bearfeeder wrote:
 
 On Thu, Feb 4, 2010 at 2:15 AM, Channing Walton
 channingwal...@mac.comwrote:
 

 Hi,
 I've added some comet-fu in my lift app but I've found that it now takes
 a
 minute or so for jetty to shut down.


 How are you shutting down your Jetty server?
 

-- 
View this message in context: 
http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27459820.html
Sent from the liftweb mailing list archive at Nabble.com.

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



Re: [Lift] Re: Mapper objects deserialized from json have all of their fields marked dirty

2010-02-04 Thread Ross Mellgren
P.S. Hooray for ticket system that doesn't suck!

-Ross

On Feb 4, 2010, at 3:54 PM, David Pollak wrote:

 
 
 On Thu, Feb 4, 2010 at 12:47 PM, Ross Mellgren dri...@gmail.com wrote:
 I reopened it since I marked it invalid pending the ML discussion.
 
 Added a comment with the ML discussion.
 
 Excellent!
  
 
 -Ross
 
 On Feb 4, 2010, at 3:45 PM, David Pollak wrote:
 
 
 
 On Thu, Feb 4, 2010 at 12:41 PM, harryh har...@gmail.com wrote:
  - Serializing the dirty-state of each field (e.g., field_name_$dirty:
  true)
 
 This further increases the size of the serialized objects which is not
 ideal
 
   - A thread-local flag for the default dirty/clean
- A global flag indicating that the fields are marked clean/dirty on
deserialization
 
 And these seem no good due to the user of global variables
 
 What about option 4:
 
 - change the deserialize function to take an extra parameter
 indicating whether the fields should be marked dirty or not.
 
 Sure... Please update the ticket: 
 https://www.assembla.com/spaces/liftweb/tickets/2-Mapper-objects-deserialized-from-json-have-all-of-their-fields-marked-dirty-
  
 
 ?
 
 --
 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, 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.
 
 
 -- 
 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, 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.

-- 
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: Out of Memory Errors Building Lift

2010-02-04 Thread Naftoli Gugenheim
Dll fragmentation?

-
Jeppe Nejsum Madsenje...@ingolfs.dk wrote:

Peter Robinett pe...@bubblefoundry.com writes:

 Hmm, I see that it's always when running YUI Compressor on lift-
 webkit. I actually had issues with YUI Compressor in the past (http://
 groups.google.com/group/liftweb/browse_thread/thread/
 f338204c6ee02dd3/3025b5ef300b4ee2) but this time I'm running the Sun
 JVM, not OpenJDK.

I have essentially the same setup as you. I have

MAVEN_OPTS='-Xmx1624m -XX:MaxPermSize=128m'

and can do a 'mvn -U clean install

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

-- 
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: Facebook Application

2010-02-04 Thread celestocalculus
Thanks David and Timothy. I'll just Java the facebook application. ;-)

On Feb 4, 10:22 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Seems like this would be a good task to assign to one of the new / free of 
 task committers? It probably wouldn't take a huge amount of work to clean it 
 up right? Ideally we want to avoid having modules in Lift that are totally 
 unsupported :-)

 Cheers, Tim

 On 3 Feb 2010, at 22:52, David Pollak wrote:



  The current Lift Facebook support is old and growing cobwebs.  Jorge Ortiz, 
  the guy who wrote most of the code, might have some additional thoughts.

  My suggestion is looking for a Java-based FB library and using that within 
  your Lift app.

  Sorry.

  David

-- 
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: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 1:11 PM, Channing Walton channingwal...@mac.comwrote:


 ah, thats a good question. I am using sbt and its jetty-stop. I'll find out
 what its doing.


I'm pretty sure Lift cancels the Comet connections during the Servlet unload
process.





 bearfeeder wrote:
 
  On Thu, Feb 4, 2010 at 2:15 AM, Channing Walton
  channingwal...@mac.comwrote:
 
 
  Hi,
  I've added some comet-fu in my lift app but I've found that it now takes
  a
  minute or so for jetty to shut down.
 
 
  How are you shutting down your Jetty server?
 

 --
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27459820.html
 Sent from the liftweb mailing list archive at Nabble.com.

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.



Re: [Lift] Re: Accessing innerHTML during bind?

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 7:32 AM, Ross Mellgren dri...@gmail.com wrote:

 I think this new version will be slower than your original one, as each
 call to bind will visit the entire input XHTML. Why not use your original
 formulation but instead of TheBindParam, use FuncBindParam (which is the
 sugar-free version of body = ... that David describes)?


Yeah... the bind operation is O(n log m) where 'n' is the number of element
nodes and m is the number of things to be bound.  Using foldLeft, you're
making that O(n m)  Then again, if the code is understandable for you, then
a couple of nanoseconds here and there are not overly important.



 -Ross

 On Feb 4, 2010, at 10:28 AM, Tim Maxwell wrote:

  Hi David,
 
  There really are a lot of paths available with scala/lift, aren't
  there?
 
  After looking at what you wrote, here's what I came up with that works
  well/is functional and compact, in case anyone else is wondering about
  it.
 
   def links(html:NodeSeq): NodeSeq={
 
 Product.findActive.foldLeft(html) {
   (html, prod) = bind(links,html,
 force_+prod.product -{x:NodeSeq = {a href={/forced?
  product=+prod.product}{x}/a}}
   )
 }
   }
 
  Product is a JPA entity class, findactive returns a list of products.
 
  If anyone has suggestions, please share.
 
  Cheers,
  Tim
 
  On Feb 3, 5:08 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Wed, Feb 3, 2010 at 12:44 PM, Tim Maxwell truthspi...@gmail.com
 wrote:
  Hi folks,
 
  I am trying to do binds based on a list of products. The point is to
  create links that can be wrapped around existing text or images.
  Something like this:
 
  signup:links.force_PRODThis is the link text our marketing dept.
  creates/signup:link
 
  Here's what I have so far in the snippet related to it:
 
   def links(html:NodeSeq): NodeSeq={
 
 val productBinds:Seq[BindParam] = Product.findActive.flatMap{
   prod = List[BindParam] (  TheBindParam( force_+prod.product,
  SHtml.link(/forced?product=+prod.product, ()=() , _ ) )  )
 }
 bind(links , html, productBinds: _*)
 
  It's so cool to see how people stuff in Lift...
 
  Within your function, you can get the element that's being bound with:
 
  BindHelpers.currentNode: Box[Elem]
 
  On the other hand, if you're looking to get the children of the node
  currently being bound:
 
   FuncBindParam(force_+prod.product, body = a
  href={/forced?product=+Helpers.urlEncode(prod.product)}{body}/a)
 
  Hope this helps.
 
  Thanks,
 
  David
 
 
 
 
 
   }
 
  Cheers,
  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.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@googlegroups.com
  .
  For more options, visit this group at
  http://groups.google.com/group/liftweb?hl=en.
 
  --
  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.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.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: Tomcat/Apache ESME: Shutdown Problems

2010-02-04 Thread David Pollak
On Wed, Feb 3, 2010 at 11:33 PM, aw anth...@whitford.com wrote:

 I just noticed this:

 Feb 3, 2010 10:49:23 PM org.apache.coyote.http11.Http11NioProtocol
 destroy
 INFO: Stopping Coyote HTTP/1.1 on http-8080
 Feb 3, 2010 11:19:20 PM org.apache.catalina.loader.WebappClassLoader
 loadClass
 INFO: Illegal access: this web application instance has been stopped
 already.  Could not load net.liftweb.http.SessionMaster$$anonfun$1$
 $anonfun$apply$11$$anonfun$apply$12.  The eventual following stack
 trace is caused by an error thrown for debugging purposes as well as
 to attempt to terminate the thread which caused the illegal access,
 and has no functional impact.
 java.lang.IllegalStateException
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
 1370)
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
 1329)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 319)
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
 $11.apply(LiftSession.scala:162)
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
 $11.apply(LiftSession.scala:159)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.Iterator$$anon$7.foreach(Iterator.scala:36)
at net.liftweb.http.SessionMaster$$anonfun
 $1.apply(LiftSession.scala:159)
at net.liftweb.http.SessionMaster$$anonfun
 $1.apply(LiftSession.scala:136)
at net.liftweb.actor.LiftActor
 $class.execTranslate(LiftActor.scala:252)
at net.liftweb.http.SessionMaster
 $.execTranslate(LiftSession.scala:91)
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb
 $actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:147)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
 $apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
 $apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon
 $2.run(LiftActor.scala:42)
at java.util.concurrent.ThreadPoolExecutor
 $Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
 $Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
 Exception in thread pool-2-thread-4 java.lang.NoClassDefFoundError:
 net/liftweb/http/SessionMaster$$anonfun$1$$anonfun$apply$11$$anonfun
 $apply$12
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
 $11.apply(LiftSession.scala:162)
at net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply
 $11.apply(LiftSession.scala:159)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.Iterator$$anon$7.foreach(Iterator.scala:36)
at net.liftweb.http.SessionMaster$$anonfun
 $1.apply(LiftSession.scala:159)
at net.liftweb.http.SessionMaster$$anonfun
 $1.apply(LiftSession.scala:136)
at net.liftweb.actor.LiftActor
 $class.execTranslate(LiftActor.scala:252)
at net.liftweb.http.SessionMaster
 $.execTranslate(LiftSession.scala:91)
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb
 $actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:147)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
 $apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun
 $apply$1.apply(LiftActor.scala:114)
at net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon
 $2.run(LiftActor.scala:42)
at java.util.concurrent.ThreadPoolExecutor
 $Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
 $Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.ClassNotFoundException:
 net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11$$anonfun
 $apply$12
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
 1484)
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
 1329)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
 319)
... 15 more

 Maybe there is a shutdown order issue?


Interesting.

I think what's happening is that during the execution of the shutdown hook,
a new class is attempting to be loaded.  Why?  Because every function in
Scala is represented by a JVM class... and functions are very, very common
to define in code (e.g., a for comprehension, etc.)  So, I think that the
shutdown hook is trying to instantiate an anonymous inner class (in Java
parlance), the class is not loaded, so the Classloader attempts to load the
class, but the servlet is supposed to be shutting down, so Tomcat's
classloader isn't allowing the class to be loaded.  That's just my guess.



 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to 

Re: [Lift] How to make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Ross Mellgren
RedirectTo should automatically prepend the context path. Could you try writing 
a quick snippet that dumps S.request.map(_.contextPath), 
S.session.map(_.contextPath) and finally S.contextPath and see what they output?

-Ross

On Feb 4, 2010, at 5:03 PM, Java1Guy wrote:

 This sure seems like it should be a simple problem, but I sure can't
 find the answer.
 
 I have a simple CometActor page with an ajaxButton on it.  I want the
 button to go to a different page.  No problem - except when I deploy
 it into a jetty container where it isn't in the root context, it
 doesn't work!
 
SHtml.ajaxButton(
Text(Home),
() = RedirectTo(/index)
),
 
 works fine in mvn jetty:run but when deployed it doesn't get the URL
 re-writing facility?
 
 Tried RedirectTo(S.hostAndPath+/index) - no help.
 and RedirectTo(S.contextPath+/index) - no help.
 
 I even found some code here which seemed to suggest a fix:
val loc = (for {
   loc - SiteMap.findLoc(Login)
   path - loc.createDefaultPath
} yield path.text) openOr /
 But this doesn't compile in the 2.0-M1 world...
 Shouldn't this be simple?
 
 Thanks in advance,
 Mark
 
 -- 
 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.



Re: [Lift] How to make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 2:06 PM, Ross Mellgren dri...@gmail.com wrote:

 RedirectTo should automatically prepend the context path. Could you try
 writing a quick snippet that dumps S.request.map(_.contextPath),
 S.session.map(_.contextPath) and finally S.contextPath and see what they
 output?


Okay... so this is a bug.

**Marius** heads up!

We made a change a little while ago to abstract Lift away from the
particular container it's running in and the context path is calculated
dynamically based on the current request rather than being set statically at
Lift Servlet load time.

CometActors do not run in the scope of any HTTP requests.  I'm guessing that
the context path is not getting to the CometActor.

Please file a ticket at
https://liftweb.assembla.com/spaces/liftweb/ticketsand Marius will
look into it.



 -Ross

 On Feb 4, 2010, at 5:03 PM, Java1Guy wrote:

  This sure seems like it should be a simple problem, but I sure can't
  find the answer.
 
  I have a simple CometActor page with an ajaxButton on it.  I want the
  button to go to a different page.  No problem - except when I deploy
  it into a jetty container where it isn't in the root context, it
  doesn't work!
 
 SHtml.ajaxButton(
 Text(Home),
 () = RedirectTo(/index)
 ),
 
  works fine in mvn jetty:run but when deployed it doesn't get the URL
  re-writing facility?
 
  Tried RedirectTo(S.hostAndPath+/index) - no help.
  and RedirectTo(S.contextPath+/index) - no help.
 
  I even found some code here which seemed to suggest a fix:
 val loc = (for {
loc - SiteMap.findLoc(Login)
path - loc.createDefaultPath
 } yield path.text) openOr /
  But this doesn't compile in the 2.0-M1 world...
  Shouldn't this be simple?
 
  Thanks in advance,
  Mark
 
  --
  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.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Re: How to make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Java1Guy
From mvn jetty:run:
Here's request map: Full()Here's session map: Full()and finally
S.contextPath:
From jetty
Here's request map: Full(/mt)Here's session map: Full(/mt)and finally
S.contextPath: /mt
WTF?

My actor code is:
bind(f, defaultXml,
nakedHomeButton -
SHtml.ajaxButton(
Text(Home),
() = RedirectTo(/index)
),
homeButton -
SHtml.ajaxButton(
Text(Home),
() = RedirectTo(S.hostAndPath+/index)
),
hiddenButton -
SHtml.ajaxButton(
Text(Hidden),
() = RedirectTo(S.contextPath+/hidden)
)
  )

And ALL of them do NOT put in the /mt...
(FWIW, i'm on Jetty 6.1.20, Scala 2.7.7 and Lift 2.0-M1)

Thanks for looking!

-- 
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: Re: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Channing Walton


bearfeeder wrote:
 
 On Thu, Feb 4, 2010 at 1:11 PM, Channing Walton
 channingwal...@mac.comwrote:
 

 ah, thats a good question. I am using sbt and its jetty-stop. I'll find
 out
 what its doing.

 
 I'm pretty sure Lift cancels the Comet connections during the Servlet
 unload
 process.
 

Actually I'm seeing the same thing with RunWebApp. Methinks there is a
problem with my comet, I copied the pattern from somewhere else so it may
well be wrong. Here it is:

(apologies for the names - imagination is escaping me)

class NewIssuesPump extends CometActor { 
  
  def render =
div id=recent_deals
 ul
  { Deal.recentDeals.map(d = li{d.name} 
{d.created.asHtml}/li) }
 /ul
/div
  
  override def lowPriority = {
case Tick = reRender(false)
  }
  
  override def localSetup {
super.localSetup()
NewIssuesPumpMaster ! SubscribePump(this)
  } 
  
  override def localShutdown {
NewIssuesPumpMaster ! UnsubPump(this)
super.localShutdown()
  }
} 

case object Tick
case class SubscribePump(pump : NewIssuesPump) 
case class UnsubPump(pump: NewIssuesPump)

object NewIssuesPumpMaster extends LiftActor {
  
  private var pumps : List[NewIssuesPump] = Nil
  
  override def messageHandler = { 
  case SubscribePump(pump) = pumps  ::= pump
  case UnsubPump(pump) = pumps -= pump 
  case Tick = pumps.foreach(_ ! Tick)
}
}

-- 
View this message in context: 
http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27460808.html
Sent from the liftweb mailing list archive at Nabble.com.

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



[Lift] Re: How to make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Java1Guy
FWIW, my Jetty config I tried to make as simple as possible:
Set name=contextPath/mt/Set
Set name=warSystemProperty name=jetty.home default=.//
webapps/menutest-1.0-SNAPSHOT.war/Set
Set name=extractWARfalse/Set
Set name=copyWebDirfalse/Set
Set name=defaultsDescriptorSystemProperty name=jetty.home
default=.//etc/webdefault.xml/Set

-- 
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 make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Ross Mellgren
So are you saying that if you run it via jetty:run it doesn't behave properly, 
but it does if you run it from jetty outside of mvn?

Or that in both cases it does not behave? I'm not sure exactly what you mean by 
from jetty so I think it might be important.

To set your context path from mvn jetty:run, you can use contextPath in pom.xml:

project ...
...
build
...
plugins
plugin
groupIdorg.mortbay.jetty/groupId
artifactIdmaven-jetty-plugin/artifactId
configuration
contextPath/mt/contextPath
/configuration
/plugin
...
/plugins
...
/build
...
/project

-Ross

On Feb 4, 2010, at 5:31 PM, Java1Guy wrote:

 From mvn jetty:run:
 Here's request map: Full()Here's session map: Full()and finally
 S.contextPath:
 From jetty
 Here's request map: Full(/mt)Here's session map: Full(/mt)and finally
 S.contextPath: /mt
 WTF?
 
 My actor code is:
bind(f, defaultXml,
nakedHomeButton -
SHtml.ajaxButton(
Text(Home),
() = RedirectTo(/index)
),
homeButton -
SHtml.ajaxButton(
Text(Home),
() = RedirectTo(S.hostAndPath+/index)
),
hiddenButton -
SHtml.ajaxButton(
Text(Hidden),
() = RedirectTo(S.contextPath+/hidden)
)
  )
 
 And ALL of them do NOT put in the /mt...
 (FWIW, i'm on Jetty 6.1.20, Scala 2.7.7 and Lift 2.0-M1)
 
 Thanks for looking!
 
 -- 
 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.



Re: [Lift] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Jonathan Ferguson
I wasn't able to override listPath, Ill have a bit more of a play to make
sure I'm not doing anything to silly; trying to get /crudify/path to  / .
Rewrite worked wonderfully.

Cheers
Jono

On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 Naftoli Gugenheim naftoli...@gmail.com writes:

  It's not overridable?

 Actually, I think it is :-)

 You might be able to just

 override lazy val listPath = Nil

 /Jeppe

 
  -
  Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
 
  Jonathan Ferguson j...@spiralarm.com writes:
 
  I would like to have the list view of one of my model objects as my home
  page.
 
  Can this done with out having the home page redirect to /mymodel/list ?
 
  I don't think you can change the native URL of CRUDify list, but you
  could add a rewrite (not redirect). See
 
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
 
  /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.



-- 
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: Re: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 2:31 PM, Channing Walton channingwal...@mac.comwrote:



 bearfeeder wrote:
 
  On Thu, Feb 4, 2010 at 1:11 PM, Channing Walton
  channingwal...@mac.comwrote:
 
 
  ah, thats a good question. I am using sbt and its jetty-stop. I'll find
  out
  what its doing.
 
 
  I'm pretty sure Lift cancels the Comet connections during the Servlet
  unload
  process.
 

 Actually I'm seeing the same thing with RunWebApp. Methinks there is a
 problem with my comet, I copied the pattern from somewhere else so it may
 well be wrong. Here it is:

 (apologies for the names - imagination is escaping me)

 class NewIssuesPump extends CometActor {

  def render =
div id=recent_deals
 ul
  { Deal.recentDeals.map(d = li{d.name}
 {d.created.asHtml}/li) }


I would recommend against this pattern.  It's less than optimal to make an
external call during the render process.

It's much better to send the recentDeals data to the CometActor via a
message.  That way, the CometActor isn't blocking on the RDBMS and you don't
have 20 or 50 different CometActors all making the same RDBMS call at once.

The Tick pattern is only good for a clock... it's very bad for other
patterns.

But this is not causing the problem (unless the query is taking a minute).

If you can tell me how the Jetty process is getting the message to shutdown,
I'll try to reproduce the issue.


 /ul
/div

  override def lowPriority = {
case Tick = reRender(false)
  }

  override def localSetup {
super.localSetup()
NewIssuesPumpMaster ! SubscribePump(this)
  }

  override def localShutdown {
NewIssuesPumpMaster ! UnsubPump(this)
super.localShutdown()
  }
 }

 case object Tick
 case class SubscribePump(pump : NewIssuesPump)
 case class UnsubPump(pump: NewIssuesPump)

 object NewIssuesPumpMaster extends LiftActor {

  private var pumps : List[NewIssuesPump] = Nil

  override def messageHandler = {
  case SubscribePump(pump) = pumps  ::= pump
  case UnsubPump(pump) = pumps -= pump
  case Tick = pumps.foreach(_ ! Tick)
}
 }

 --
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27460808.html
 Sent from the liftweb mailing list archive at Nabble.com.

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.



Re: [Lift] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Naftoli Gugenheim
What about index :: Nil ?

Also worst case scenario you could have a snippet that returns 
MyEntity.showAllTemplate() embedded in your index.html.

-
Jonathan Fergusonj...@spiralarm.com wrote:

I wasn't able to override listPath, Ill have a bit more of a play to make
sure I'm not doing anything to silly; trying to get /crudify/path to  / .
Rewrite worked wonderfully.

Cheers
Jono

On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 Naftoli Gugenheim naftoli...@gmail.com writes:

  It's not overridable?

 Actually, I think it is :-)

 You might be able to just

 override lazy val listPath = Nil

 /Jeppe

 
  -
  Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
 
  Jonathan Ferguson j...@spiralarm.com writes:
 
  I would like to have the list view of one of my model objects as my home
  page.
 
  Can this done with out having the home page redirect to /mymodel/list ?
 
  I don't think you can change the native URL of CRUDify list, but you
  could add a rewrite (not redirect). See
 
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
 
  /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.



-- 
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: Re: Re: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Channing Walton

Thanks for the advice, I'll definitely rethink the pattern.

I'm actually seeing the problem when I use RunWebApp. When I press a key
RunWebApp should shut down but it just hangs for me.



bearfeeder wrote:
 
 On Thu, Feb 4, 2010 at 2:31 PM, Channing Walton
 channingwal...@mac.comwrote:
 
 Actually I'm seeing the same thing with RunWebApp. Methinks there is a
 problem with my comet, I copied the pattern from somewhere else so it may
 well be wrong. Here it is:

 (apologies for the names - imagination is escaping me)

 class NewIssuesPump extends CometActor {

  def render =
div id=recent_deals
 ul
  { Deal.recentDeals.map(d = li{d.name}
 {d.created.asHtml}/li) }

 
 I would recommend against this pattern.  It's less than optimal to make an
 external call during the render process.
 
 It's much better to send the recentDeals data to the CometActor via a
 message.  That way, the CometActor isn't blocking on the RDBMS and you
 don't
 have 20 or 50 different CometActors all making the same RDBMS call at
 once.
 
 The Tick pattern is only good for a clock... it's very bad for other
 patterns.
 
 But this is not causing the problem (unless the query is taking a minute).
 
 If you can tell me how the Jetty process is getting the message to
 shutdown,
 I'll try to reproduce the issue.
 
 
 /ul
/div

  override def lowPriority = {
case Tick = reRender(false)
  }

  override def localSetup {
super.localSetup()
NewIssuesPumpMaster ! SubscribePump(this)
  }

  override def localShutdown {
NewIssuesPumpMaster ! UnsubPump(this)
super.localShutdown()
  }
 }

 case object Tick
 case class SubscribePump(pump : NewIssuesPump)
 case class UnsubPump(pump: NewIssuesPump)

 object NewIssuesPumpMaster extends LiftActor {

  private var pumps : List[NewIssuesPump] = Nil

  override def messageHandler = {
  case SubscribePump(pump) = pumps  ::= pump
  case UnsubPump(pump) = pumps -= pump
  case Tick = pumps.foreach(_ ! Tick)
}
 }

 --
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27460808.html
 Sent from the liftweb mailing list archive at Nabble.com.

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27461062.html
Sent from the liftweb mailing list archive at Nabble.com.

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



[Lift] Re: How to make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Java1Guy
Ross: no, the opposite.  in mvn jetty:run all is well since it is in
the root context. (?)
When I deploy the war to jetty and use the /mt context all the
ajaxButtons insist on going to the root.

PS - although i've had trouble before, 2.0-M1 seems *more* broken :(

On Feb 4, 3:37 pm, Ross Mellgren dri...@gmail.com wrote:
 So are you saying that if you run it via jetty:run it doesn't behave 
 properly, but it does if you run it from jetty outside of mvn?

 Or that in both cases it does not behave? I'm not sure exactly what you mean 
 by from jetty so I think it might be important.

 To set your context path from mvn jetty:run, you can use contextPath in 
 pom.xml:

 project ...
     ...
     build
         ...
         plugins
             plugin
                 groupIdorg.mortbay.jetty/groupId
                 artifactIdmaven-jetty-plugin/artifactId
                 configuration
                     contextPath/mt/contextPath
                 /configuration
             /plugin
             ...
         /plugins
         ...
     /build
     ...
 /project

 -Ross

-- 
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: Re: Re: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 2:51 PM, Channing Walton channingwal...@mac.comwrote:


 Thanks for the advice, I'll definitely rethink the pattern.

 I'm actually seeing the problem when I use RunWebApp. When I press a key
 RunWebApp should shut down but it just hangs for me.


What is RunWebApp?




 bearfeeder wrote:
 
  On Thu, Feb 4, 2010 at 2:31 PM, Channing Walton
  channingwal...@mac.comwrote:
 
  Actually I'm seeing the same thing with RunWebApp. Methinks there is a
  problem with my comet, I copied the pattern from somewhere else so it
 may
  well be wrong. Here it is:
 
  (apologies for the names - imagination is escaping me)
 
  class NewIssuesPump extends CometActor {
 
   def render =
 div id=recent_deals
  ul
   { Deal.recentDeals.map(d = li{d.name}
  {d.created.asHtml}/li) }
 
 
  I would recommend against this pattern.  It's less than optimal to make
 an
  external call during the render process.
 
  It's much better to send the recentDeals data to the CometActor via a
  message.  That way, the CometActor isn't blocking on the RDBMS and you
  don't
  have 20 or 50 different CometActors all making the same RDBMS call at
  once.
 
  The Tick pattern is only good for a clock... it's very bad for other
  patterns.
 
  But this is not causing the problem (unless the query is taking a
 minute).
 
  If you can tell me how the Jetty process is getting the message to
  shutdown,
  I'll try to reproduce the issue.
 
 
  /ul
 /div
 
   override def lowPriority = {
 case Tick = reRender(false)
   }
 
   override def localSetup {
 super.localSetup()
 NewIssuesPumpMaster ! SubscribePump(this)
   }
 
   override def localShutdown {
 NewIssuesPumpMaster ! UnsubPump(this)
 super.localShutdown()
   }
  }
 
  case object Tick
  case class SubscribePump(pump : NewIssuesPump)
  case class UnsubPump(pump: NewIssuesPump)
 
  object NewIssuesPumpMaster extends LiftActor {
 
   private var pumps : List[NewIssuesPump] = Nil
 
   override def messageHandler = {
   case SubscribePump(pump) = pumps  ::= pump
   case UnsubPump(pump) = pumps -= pump
   case Tick = pumps.foreach(_ ! Tick)
 }
  }
 
  --
  View this message in context:
 
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27460808.html
  Sent from the liftweb mailing list archive at Nabble.com.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
  liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27461062.html
 Sent from the liftweb mailing list archive at Nabble.com.

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.



Re: [Lift] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Naftoli Gugenheim
What does wasn't able to mean?
Did you write
override lazy val listPath = List(index)
?

-
Jonathan Fergusonj...@spiralarm.com wrote:

I wasn't able to override listPath, Ill have a bit more of a play to make
sure I'm not doing anything to silly; trying to get /crudify/path to  / .
Rewrite worked wonderfully.

Cheers
Jono

On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

 Naftoli Gugenheim naftoli...@gmail.com writes:

  It's not overridable?

 Actually, I think it is :-)

 You might be able to just

 override lazy val listPath = Nil

 /Jeppe

 
  -
  Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
 
  Jonathan Ferguson j...@spiralarm.com writes:
 
  I would like to have the list view of one of my model objects as my home
  page.
 
  Can this done with out having the home page redirect to /mymodel/list ?
 
  I don't think you can change the native URL of CRUDify list, but you
  could add a rewrite (not redirect). See
 
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
 
  /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.



-- 
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 make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Java1Guy
I think David's analysis is exactly right: CometActors do not run in
the scope of any HTTP requests.  I'm guessing that
the context path is not getting to the CometActor.

As the button text I put S.contextPath+/index and sure enough, it
shows /index - even though the above output shows that to the
normal snippet, the context path is set.

Cheers, Mark

-- 
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] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread David Pollak
On Thu, Feb 4, 2010 at 2:58 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 What does wasn't able to mean?
 Did you write
 override lazy val listPath = List(index)


This is the wrong answer.  Jeppe gave the correct answer.


 ?

 -
 Jonathan Fergusonj...@spiralarm.com wrote:

 I wasn't able to override listPath, Ill have a bit more of a play to make
 sure I'm not doing anything to silly; trying to get /crudify/path to  / .
 Rewrite worked wonderfully.

 Cheers
 Jono

 On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  Naftoli Gugenheim naftoli...@gmail.com writes:
 
   It's not overridable?
 
  Actually, I think it is :-)
 
  You might be able to just
 
  override lazy val listPath = Nil
 
  /Jeppe
 
  
   -
   Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
  
   Jonathan Ferguson j...@spiralarm.com writes:
  
   I would like to have the list view of one of my model objects as my
 home
   page.
  
   Can this done with out having the home page redirect to /mymodel/list
 ?
  
   I don't think you can change the native URL of CRUDify list, but you
   could add a rewrite (not redirect). See
  
  
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
  
   /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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.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] Re: Re: Re: Re: [lift] Comet making jetty take a long time to shutdown

2010-02-04 Thread Channing Walton

RunWebApp was produced in test/scala when I created the lift project using
the basic archetype.

http://github.com/mrxtravis/liftweb/blob/master/lift-archetype-basic/src/main/resources/archetype-resources/src/test/scala/RunWebApp.scala




bearfeeder wrote:
 
 On Thu, Feb 4, 2010 at 2:51 PM, Channing Walton
 channingwal...@mac.comwrote:
 

 Thanks for the advice, I'll definitely rethink the pattern.

 I'm actually seeing the problem when I use RunWebApp. When I press a key
 RunWebApp should shut down but it just hangs for me.


 What is RunWebApp?
 
 


 bearfeeder wrote:
 
  On Thu, Feb 4, 2010 at 2:31 PM, Channing Walton
  channingwal...@mac.comwrote:
 
  Actually I'm seeing the same thing with RunWebApp. Methinks there is a
  problem with my comet, I copied the pattern from somewhere else so it
 may
  well be wrong. Here it is:
 
  (apologies for the names - imagination is escaping me)
 
  class NewIssuesPump extends CometActor {
 
   def render =
 div id=recent_deals
  ul
   { Deal.recentDeals.map(d = li{d.name}
  {d.created.asHtml}/li) }
 
 
  I would recommend against this pattern.  It's less than optimal to make
 an
  external call during the render process.
 
  It's much better to send the recentDeals data to the CometActor via a
  message.  That way, the CometActor isn't blocking on the RDBMS and you
  don't
  have 20 or 50 different CometActors all making the same RDBMS call at
  once.
 
  The Tick pattern is only good for a clock... it's very bad for other
  patterns.
 
  But this is not causing the problem (unless the query is taking a
 minute).
 
  If you can tell me how the Jetty process is getting the message to
  shutdown,
  I'll try to reproduce the issue.
 
 
  /ul
 /div
 
   override def lowPriority = {
 case Tick = reRender(false)
   }
 
   override def localSetup {
 super.localSetup()
 NewIssuesPumpMaster ! SubscribePump(this)
   }
 
   override def localShutdown {
 NewIssuesPumpMaster ! UnsubPump(this)
 super.localShutdown()
   }
  }
 
  case object Tick
  case class SubscribePump(pump : NewIssuesPump)
  case class UnsubPump(pump: NewIssuesPump)
 
  object NewIssuesPumpMaster extends LiftActor {
 
   private var pumps : List[NewIssuesPump] = Nil
 
   override def messageHandler = {
   case SubscribePump(pump) = pumps  ::= pump
   case UnsubPump(pump) = pumps -= pump
   case Tick = pumps.foreach(_ ! Tick)
 }
  }
 
  --
  View this message in context:
 
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27460808.html
  Sent from the liftweb mailing list archive at Nabble.com.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Lift group.
  To post to this group, send email to lift...@googlegroups.com.
  To unsubscribe from this group, send email to
 
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27461062.html
 Sent from the liftweb mailing list archive at Nabble.com.

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.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.
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Comet-making-jetty-take-a-long-time-to-shutdown-tp27450451p27461200.html
Sent from the liftweb mailing list 

[Lift] Re: Out of Memory Errors Building Lift

2010-02-04 Thread Peter Robinett
Thanks, Jeppe, that did the trick. I swear, JVM options are such a
dark art!

Peter

On Feb 4, 12:49 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Peter Robinett pe...@bubblefoundry.com writes:
  Hmm, I see that it's always when running YUI Compressor on lift-
  webkit. I actually had issues with YUI Compressor in the past (http://
  groups.google.com/group/liftweb/browse_thread/thread/
  f338204c6ee02dd3/3025b5ef300b4ee2) but this time I'm running the Sun
  JVM, not OpenJDK.

 I have essentially the same setup as you. I have

 MAVEN_OPTS='-Xmx1624m -XX:MaxPermSize=128m'

 and can do a 'mvn -U clean install

 /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 make JsCmds.RedirectTo context path sensitive?

2010-02-04 Thread Ross Mellgren
Yes very well could be. I was part of the email chain when Marius implemented 
these changes and I thought that this was why LiftSession has a copy of the 
contextPath. Taking a quick glance at the code it should work with that, but 
Marius should definitely comment since he's most familiar with those changes.

-Ross

On Feb 4, 2010, at 5:59 PM, Java1Guy wrote:

 I think David's analysis is exactly right: CometActors do not run in
 the scope of any HTTP requests.  I'm guessing that
 the context path is not getting to the CometActor.
 
 As the button text I put S.contextPath+/index and sure enough, it
 shows /index - even though the above output shows that to the
 normal snippet, the context path is set.
 
 Cheers, Mark
 
 -- 
 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.



Re: [Lift] Re: Out of Memory Errors Building Lift

2010-02-04 Thread Jonathan Ferguson
I believe it is maven not passing the JVM options through to the forked
compile processes. Glad you got it working.

Jono

On 5 February 2010 10:07, Peter Robinett pe...@bubblefoundry.com wrote:

 Thanks, Jeppe, that did the trick. I swear, JVM options are such a
 dark art!

 Peter

 On Feb 4, 12:49 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
  Peter Robinett pe...@bubblefoundry.com writes:
   Hmm, I see that it's always when running YUI Compressor on lift-
   webkit. I actually had issues with YUI Compressor in the past (http://
   groups.google.com/group/liftweb/browse_thread/thread/
   f338204c6ee02dd3/3025b5ef300b4ee2) but this time I'm running the Sun
   JVM, not OpenJDK.
 
  I have essentially the same setup as you. I have
 
  MAVEN_OPTS='-Xmx1624m -XX:MaxPermSize=128m'
 
  and can do a 'mvn -U clean install
 
  /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] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Jonathan Ferguson
I may have had

override lazy val listPath = List(/)

On 5 February 2010 09:58, Naftoli Gugenheim naftoli...@gmail.com wrote:

 What does wasn't able to mean?
 Did you write
 override lazy val listPath = List(index)
 ?

 -
 Jonathan Fergusonj...@spiralarm.com wrote:

 I wasn't able to override listPath, Ill have a bit more of a play to make
 sure I'm not doing anything to silly; trying to get /crudify/path to  / .
 Rewrite worked wonderfully.

 Cheers
 Jono

 On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  Naftoli Gugenheim naftoli...@gmail.com writes:
 
   It's not overridable?
 
  Actually, I think it is :-)
 
  You might be able to just
 
  override lazy val listPath = Nil
 
  /Jeppe
 
  
   -
   Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
  
   Jonathan Ferguson j...@spiralarm.com writes:
  
   I would like to have the list view of one of my model objects as my
 home
   page.
  
   Can this done with out having the home page redirect to /mymodel/list
 ?
  
   I don't think you can change the native URL of CRUDify list, but you
   could add a rewrite (not redirect). See
  
  
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
  
   /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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.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] Is it possible to use CRUDify snippets on non CRUDified pages?

2010-02-04 Thread Jonathan Ferguson
Is there are reason one or more correct than the other?

Is it style or something else ?

Cheers

Jono

On 5 February 2010 10:01, David Pollak feeder.of.the.be...@gmail.comwrote:



 On Thu, Feb 4, 2010 at 2:58 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 What does wasn't able to mean?
 Did you write
 override lazy val listPath = List(index)


 This is the wrong answer.  Jeppe gave the correct answer.


 ?

 -
 Jonathan Fergusonj...@spiralarm.com wrote:

 I wasn't able to override listPath, Ill have a bit more of a play to make
 sure I'm not doing anything to silly; trying to get /crudify/path to  / .
 Rewrite worked wonderfully.

 Cheers
 Jono

 On 5 February 2010 04:45, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  Naftoli Gugenheim naftoli...@gmail.com writes:
 
   It's not overridable?
 
  Actually, I think it is :-)
 
  You might be able to just
 
  override lazy val listPath = Nil
 
  /Jeppe
 
  
   -
   Jeppe Nejsum Madsenje...@ingolfs.dk wrote:
  
   Jonathan Ferguson j...@spiralarm.com writes:
  
   I would like to have the list view of one of my model objects as my
 home
   page.
  
   Can this done with out having the home page redirect to /mymodel/list
 ?
  
   I don't think you can change the native URL of CRUDify list, but you
   could add a rewrite (not redirect). See
  
  
 
 http://blog.getintheloop.eu/2009/5/3/url-rewriting-with-the-lift-framework
  
   /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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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
 liftweb%2bunsubscr...@googlegroups.comliftweb%252bunsubscr...@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.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] Re: Single Table Inheritance

2010-02-04 Thread Mads Hartmann
Yeah that helped, my lab and scientist now looks like this:

/--- code

trait BaseSourceTrait[ T :BaseSourceTrait[T] ] extends
LongKeyedMapper[T] {

self: T =

override def primaryKeyField = id
object id extends MappedLongIndex(this)

object name extends MappedPoliteString(this, 256)
object sourceType extends MappedEnum(this,SourceTypes)

object SourceTypes extends Enumeration {
val Scientist = Value(Scientist)
val Lab = Value(Lab)
}
}

class Scientist extends BaseSourceTrait[Scientist] {

  def getSingleton = Scientist

  object birth extends MappedInt(this)
  object death extends MappedInt(this)
  object nationality extends MappedPoliteString(this, 128)

}
object Scientist extends Scientist with LongKeyedMetaMapper[Scientist]
{
override def dbTableName = Source
}


class Lab extends BaseSourceTrait[Lab] {

  def getSingleton = Lab

  object institution extends MappedLongForeignKey(this, Institution)

}
object Lab extends Lab with LongKeyedMetaMapper[Lab] {
override def dbTableName = Source
}

/--- code ends

My only problem now is that I can't figure out how to implement the
following:

A Discovery (a mapped class) needs to have a foreign key to the source
that made the discovery, this could be either a lab or a scientist, so
normally i would have a field with a reference to the super-class of
both Scientist and Lab - However, I don't have a super-class, I just
have a trait :)

I would like to be able to write something like this:

/--- code starts again

class Discovery extends LongKeyedMapper[Discovery] with IdPK {

def getSingleton = Discovery

// primatives
object description extends MappedDateTime(this)
object year extends MappedInt(this)
object reference extends MappedPoliteString(this, 128)

// relationships
object source extends MappedLongForeignKey(this, BaseSourceTrait) //
-- this is what i want.

}
object Discovery extends Discovery with LongKeyedMetaMapper[Discovery]

/--- code ends

As always I truely appreciate the help you guys are giving me :)

Thanks,
Mads Hartmann Jensen

On Feb 4, 9:56 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 Please take a look at the MegaProtoUser and MegaMetaProtoUser code for
 examples of how to create traits that can be mixed into classes.

 Does that help?

 On Thu, Feb 4, 2010 at 9:58 AM, Mads Hartmann Jensen mads...@gmail.comwrote:





  hello Jeppe,

  In my project I've got the following three models: A discovery, a Scientist
  and a lab. The Discovery has been invented by someone, this is either a
  single scientist or sometimes a lab - This is easily done through
  inheritance (would create a superclass named source) but I'm not sure how to
  do this so it maps nicely to the database.

  Scientist and Lab only share one attribute so what I'm most interested in
  is to be able express that a Discovery has s source that can be either a lab
  or scientist :)

  Hope this explains my problem more clearly, thanks for the help

  Mads Hartmann

  Sent from my iPhone

  On 04/02/2010, at 18.17, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

   Mads Hartmann mads...@gmail.com writes:

   Hello Everyone,

  I'm currently trying to figure out how to map objects with inheritance
  using the Mapper framework. I've got a Lab and a Scientist who inherit
  from Source.

  As I understand there's no direct way to do inheritance using the
  Mapper framework so I'm trying to figure out how to implement 'Single
  Table Inheritance'.

  Right now I'm trying to create a single trait (Source) for the values
  that they share called BaseSource and my idea is to mix it in both Lab
  and Scientist. I would then define the table name of both scientist
  and lab to be the same - I think this would work but what I'm not sure
  of is the following:

  - If both Scientist and Lab mixes in the IdPK trait and use the same
  table, will the id still be unique?
  - A Discovery has a source, how do i create MappedLongForeignKey to
  the table they share (lab, scientist)?

  I hope you'll be able to help me out :)

  I can't say I follow the above :-) Do you want to share tables, code or
  both? Maybe list the table structure and explain how you would like to
  map it

  /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] Suggestion to extend Comet (ListenerManager) to selectively update subscribers

2010-02-04 Thread Heiko Seeberger
Hi,

In the current state the ListenerManager will always update all subscribers.
I have got a use case where only certain subscribers should be updated.
Therefore I suggest to extend the ListenerManager such that there can be an
optional partial function that determines which subscribers will be updated.
This change will not break the current API and will not affect the default
behavior.

I have already implemented a prototype solution but would like to know your
opinion first. So what do you think? Any objections up-front?

Cheers,

Heiko

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

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



[Lift] Flot 0.6 Upgrade Breaking Change Question

2010-02-04 Thread Peter Robinett
Hello all,

Please tell me if you are using the lift-flot module. I am working on
upgrading it to Flot 0.6 and as Aaron noted[1], Flot has switched to a
slightly new format of specifying options. However, they have kept
backwards compatibility, meaning that we could upgrade to the latest
version of Flot without changing the way series options are specified.
Would you prefer to have a breaking change in lift-flot now in order
to ensure future compatibility or would you like to put off this
change until a future version of Flot drops support for this now
depreciated format?

Peter

[1]: 
http://groups.google.com/group/liftweb/browse_thread/thread/a25a93f55c181475

-- 
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: Suggestion to extend Comet (ListenerManager) to selectively update subscribers

2010-02-04 Thread Peter Robinett
Heiko, I would love this and would use it often, but I'm not sure it's
such a general use case that it should be part of Lift. What do other
people think?

Peter

On Feb 4, 4:05 pm, Heiko Seeberger heiko.seeber...@googlemail.com
wrote:
 Hi,

 In the current state the ListenerManager will always update all subscribers.
 I have got a use case where only certain subscribers should be updated.
 Therefore I suggest to extend the ListenerManager such that there can be an
 optional partial function that determines which subscribers will be updated.
 This change will not break the current API and will not affect the default
 behavior.

 I have already implemented a prototype solution but would like to know your
 opinion first. So what do you think? Any objections up-front?

 Cheers,

 Heiko

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

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



Re: [Lift] Re: Single Table Inheritance

2010-02-04 Thread Naftoli Gugenheim
Does my approach not work?

-
Mads Hartmannmads...@gmail.com wrote:

Yeah that helped, my lab and scientist now looks like this:

/--- code

trait BaseSourceTrait[ T :BaseSourceTrait[T] ] extends
LongKeyedMapper[T] {

self: T =

override def primaryKeyField = id
object id extends MappedLongIndex(this)

object name extends MappedPoliteString(this, 256)
object sourceType extends MappedEnum(this,SourceTypes)

object SourceTypes extends Enumeration {
val Scientist = Value(Scientist)
val Lab = Value(Lab)
}
}

class Scientist extends BaseSourceTrait[Scientist] {

  def getSingleton = Scientist

  object birth extends MappedInt(this)
  object death extends MappedInt(this)
  object nationality extends MappedPoliteString(this, 128)

}
object Scientist extends Scientist with LongKeyedMetaMapper[Scientist]
{
override def dbTableName = Source
}


class Lab extends BaseSourceTrait[Lab] {

  def getSingleton = Lab

  object institution extends MappedLongForeignKey(this, Institution)

}
object Lab extends Lab with LongKeyedMetaMapper[Lab] {
override def dbTableName = Source
}

/--- code ends

My only problem now is that I can't figure out how to implement the
following:

A Discovery (a mapped class) needs to have a foreign key to the source
that made the discovery, this could be either a lab or a scientist, so
normally i would have a field with a reference to the super-class of
both Scientist and Lab - However, I don't have a super-class, I just
have a trait :)

I would like to be able to write something like this:

/--- code starts again

class Discovery extends LongKeyedMapper[Discovery] with IdPK {

def getSingleton = Discovery

// primatives
object description extends MappedDateTime(this)
object year extends MappedInt(this)
object reference extends MappedPoliteString(this, 128)

// relationships
object source extends MappedLongForeignKey(this, BaseSourceTrait) //
-- this is what i want.

}
object Discovery extends Discovery with LongKeyedMetaMapper[Discovery]

/--- code ends

As always I truely appreciate the help you guys are giving me :)

Thanks,
Mads Hartmann Jensen

On Feb 4, 9:56 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 Please take a look at the MegaProtoUser and MegaMetaProtoUser code for
 examples of how to create traits that can be mixed into classes.

 Does that help?

 On Thu, Feb 4, 2010 at 9:58 AM, Mads Hartmann Jensen mads...@gmail.comwrote:





  hello Jeppe,

  In my project I've got the following three models: A discovery, a Scientist
  and a lab. The Discovery has been invented by someone, this is either a
  single scientist or sometimes a lab - This is easily done through
  inheritance (would create a superclass named source) but I'm not sure how to
  do this so it maps nicely to the database.

  Scientist and Lab only share one attribute so what I'm most interested in
  is to be able express that a Discovery has s source that can be either a lab
  or scientist :)

  Hope this explains my problem more clearly, thanks for the help

  Mads Hartmann

  Sent from my iPhone

  On 04/02/2010, at 18.17, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

   Mads Hartmann mads...@gmail.com writes:

   Hello Everyone,

  I'm currently trying to figure out how to map objects with inheritance
  using the Mapper framework. I've got a Lab and a Scientist who inherit
  from Source.

  As I understand there's no direct way to do inheritance using the
  Mapper framework so I'm trying to figure out how to implement 'Single
  Table Inheritance'.

  Right now I'm trying to create a single trait (Source) for the values
  that they share called BaseSource and my idea is to mix it in both Lab
  and Scientist. I would then define the table name of both scientist
  and lab to be the same - I think this would work but what I'm not sure
  of is the following:

  - If both Scientist and Lab mixes in the IdPK trait and use the same
  table, will the id still be unique?
  - A Discovery has a source, how do i create MappedLongForeignKey to
  the table they share (lab, scientist)?

  I hope you'll be able to help me out :)

  I can't say I follow the above :-) Do you want to share tables, code or
  both? Maybe list the table structure and explain how you would like to
  map it

  /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 

[Lift] Re: Upgrade to Flot 0.6

2010-02-04 Thread Peter Robinett
Hi Aaron,

I've pushed the simplest update possible to my branch here:
http://github.com/dpp/liftweb/tree/pr1001_issue_322. I will make the
series options change if there are no significant dissenting voices in
the thread I created[1]. In the meantime, do. The flotDemo app seems
to work without any changes.

What do you think?

Peter

[1]: http://groups.google.com/group/liftweb/t/ba7e0f76042ff562

On Feb 3, 6:30 am, Aaron Valade a...@alum.mit.edu wrote:
 I've created a ticket here:

 http://github.com/dpp/liftweb/issues/issue/322

 Thanks again!
 - Aaron



 On Tue, Feb 2, 2010 at 10:10 PM, Peter Robinett pe...@bubblefoundry.com 
 wrote:
  You're welcome. I'm happy to look into adding Flot plugin support, but
  please open a ticket on GitHub (http://github.com/dpp/liftweb/issues).

  Peter

  On Feb 1, 10:22 am, Aaron Valade a...@alum.mit.edu wrote:
  Thanks Peter!

  One of the other things that changed between Flot 0.4 and 0.6 is that
  a plugin structure was introduced and some functionality was pushed
  out of the core and into a plugin, specifically the selection
  functionality which can be used for zooming and other interactions
  with the charted data.  I hate to tack on requests for more work, but
  if you get a chance, I'd appreciate if you could add functionality to
  the Lift Flot Widget to allow use of these plugins. I'm in the process
  of making some small changes with the Flot Widget to support these
  plugins in my local fork of Lift and would be happy to share what I've
  done, if that's allowed.  Otherwise, I'd be very eager to provide
  additional testing of any capabilities that you make available or any
  other help that I can provide within the guidelines of the Lift
  project.

  Thanks,
  - A

  On Mon, Feb 1, 2010 at 12:28 PM, Peter Robinett pe...@bubblefoundry.com 
  wrote:
   Ok guys, I'll work on this in the next few days (I'm out of town right
   now).

   Peter

   On Jan 31, 3:20 pm, Timothy Perrett timo...@getintheloop.eu wrote:
   It seems like peter will take ownership of this and make it happen
   ASAP so a patch / diff should not be needed.

   Peter, please confirm when you will roll this in a branch and put it
   on review board?

   Cheers, Tim

   Sent from my iPhone

   On 31 Jan 2010, at 22:48, Aaron Valade aval...@gmail.com wrote:

I'm more than happy to submit the patch under the Lift IP policy,
but I understand if you don't feel comfortable with that. And I can
submit it anyway that works for you. I'm just looking to help give
back to everyone that's helped me out. Albeit in a very, very small
way.

Sent from my iPhone

On Jan 31, 2010, at 5:43 PM, David Pollak 
feeder.of.the.be...@gmail.com
 wrote:

Peter,

Please keep in mind the Lift IP policy.  We don't pull from other
repositories nor do we accept patches.  We'll have to do the Flot
0.6 ourselves.

Thanks,

David

On Fri, Jan 29, 2010 at 4:44 PM, Peter Robinett 
pe...@bubblefoundry.com
 wrote:
Aaron, thanks so much for taking the initiative to upgrade Flot, it's
something that I've been meaning to do. Just skimming over your
changes, everything looks good. As for not using the packed excanvas
file, that should be ok since Lift runs the YUI compressor by default
on all Javascript files (correct, David?). Of course, broken URLs
need
to be fixed.

David, how do we go about merging these changes?

Peter

On Jan 29, 3:32 pm, Aaron Valade a...@alum.mit.edu wrote:
 There is one break that my commit made which I just realized
after I
 had sent this email in that I deleted the excanvas.pack.js file and
 dropped in the excanvas.js that was included with the Flot 0.6
 distribution but didn't rename it to be excanvas.pack.js and didn't
 change the path in the Flot.scala file.

 I can make an additional commit that fixes this, if it pleases
the court. :-)

 - A

 On Fri, Jan 29, 2010 at 6:15 PM, David Pollak

 feeder.of.the.be...@gmail.com wrote:
  Peter,

  What do you think of the upgrade (given that you're the most
Flot-ish Lift
  committer)?

  Thanks,

  David

  On Fri, Jan 29, 2010 at 12:32 PM, Aaron Valade
a...@alum.mit.edu wrote:

  Hello all,
  I needed to use some of the recent functionality in the Flot
jQuery
  plugin which is version 0.6.  The Flot lift-widget is
currently at
  0.4.  So I upgraded it to use the new version and I've posted
the
  commit on github:

 http://github.com/avalade/liftweb/commit/fa3d76fb72a7f74d13265e4039f0
...

  Version 0.6 of Flot does make one breaking change which
requires some
  of the options which were previously described as a top level
  attributes on the FlotOptions object to be pushed inside of a
new
  attribute called FlotSeriesOptions.  I've made the appropriate
changes
  to the various example Flot charts 

[Lift] Mapped(Date)(Time) formatter/parser

2010-02-04 Thread Naftoli Gugenheim
David and all,
QUESTION 1
I'm working on issue #258. Here are two options for an overridable parser 
(applies to formatting too):
1. def parse(s: String): Box[Date] = ConversionRules.parseDate()(s)
2. def parse: String=Box[Date] = ConversionRules.parseDate()

What are the pros and cons, and which should I use?

QUESTION 2
MappedDate and MappedDateTime apparently were parsing via LiftRules in 
setFromAny, while buildSetStringValue etc. were using (Time)Helpers.toDate. Is 
there a reason not to change it? Or, should toDate use ConversionRules?

Thanks.

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



[Lift] **IMPORTANT** HOLD OFF CREATING TICKETS ON ASSEMBLA

2010-02-04 Thread Naftoli Gugenheim
Indrajit and I are working on importing tickets into Assembla. The first
ticket on GitHub is #3 and there are now two on Assembla.
So please don't create any Assembla tickets until further notice.
Thanks!

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



[Lift] Re: Single Table Inheritance

2010-02-04 Thread Mads Hartmann
Hey Naftoli,
I think something might have broken your first message, It's a blank
message if you view it through the web-interface:
http://groups.google.com/group/liftweb/browse_thread/thread/e2317e5dbaad4a65

If you have a solution I would love to hear it :)

On Feb 5, 1:52 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Does my approach not work?

 -

 Mads Hartmannmads...@gmail.com wrote:

 Yeah that helped, my lab and scientist now looks like this:

 /--- code

 trait BaseSourceTrait[ T :BaseSourceTrait[T] ] extends
 LongKeyedMapper[T] {

         self: T =

         override def primaryKeyField = id
         object id extends MappedLongIndex(this)

         object name extends MappedPoliteString(this, 256)
         object sourceType extends MappedEnum(this,SourceTypes)

         object SourceTypes extends Enumeration {
                 val Scientist = Value(Scientist)
                 val     Lab = Value(Lab)
         }

 }

 class Scientist extends BaseSourceTrait[Scientist] {

   def getSingleton = Scientist

   object birth extends MappedInt(this)
   object death extends MappedInt(this)
   object nationality extends MappedPoliteString(this, 128)

 }

 object Scientist extends Scientist with LongKeyedMetaMapper[Scientist]
 {
         override def dbTableName = Source

 }

 class Lab extends BaseSourceTrait[Lab] {

   def getSingleton = Lab

   object institution extends MappedLongForeignKey(this, Institution)

 }

 object Lab extends Lab with LongKeyedMetaMapper[Lab] {
         override def dbTableName = Source

 }

 /--- code ends

 My only problem now is that I can't figure out how to implement the
 following:

 A Discovery (a mapped class) needs to have a foreign key to the source
 that made the discovery, this could be either a lab or a scientist, so
 normally i would have a field with a reference to the super-class of
 both Scientist and Lab - However, I don't have a super-class, I just
 have a trait :)

 I would like to be able to write something like this:

 /--- code starts again

 class Discovery extends LongKeyedMapper[Discovery] with IdPK {

         def getSingleton = Discovery

         // primatives
         object description extends MappedDateTime(this)
         object year extends MappedInt(this)
         object reference extends MappedPoliteString(this, 128)

         // relationships
         object source extends MappedLongForeignKey(this, BaseSourceTrait) //
 -- this is what i want.

 }

 object Discovery extends Discovery with LongKeyedMetaMapper[Discovery]

 /--- code ends

 As always I truely appreciate the help you guys are giving me :)

 Thanks,
 Mads Hartmann Jensen

 On Feb 4, 9:56 pm, David Pollak feeder.of.the.be...@gmail.com wrote:





  Please take a look at the MegaProtoUser and MegaMetaProtoUser code for
  examples of how to create traits that can be mixed into classes.

  Does that help?

  On Thu, Feb 4, 2010 at 9:58 AM, Mads Hartmann Jensen 
  mads...@gmail.comwrote:

   hello Jeppe,

   In my project I've got the following three models: A discovery, a 
   Scientist
   and a lab. The Discovery has been invented by someone, this is either a
   single scientist or sometimes a lab - This is easily done through
   inheritance (would create a superclass named source) but I'm not sure how 
   to
   do this so it maps nicely to the database.

   Scientist and Lab only share one attribute so what I'm most interested in
   is to be able express that a Discovery has s source that can be either a 
   lab
   or scientist :)

   Hope this explains my problem more clearly, thanks for the help

   Mads Hartmann

   Sent from my iPhone

   On 04/02/2010, at 18.17, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

    Mads Hartmann mads...@gmail.com writes:

    Hello Everyone,

   I'm currently trying to figure out how to map objects with inheritance
   using the Mapper framework. I've got a Lab and a Scientist who inherit
   from Source.

   As I understand there's no direct way to do inheritance using the
   Mapper framework so I'm trying to figure out how to implement 'Single
   Table Inheritance'.

   Right now I'm trying to create a single trait (Source) for the values
   that they share called BaseSource and my idea is to mix it in both Lab
   and Scientist. I would then define the table name of both scientist
   and lab to be the same - I think this would work but what I'm not sure
   of is the following:

   - If both Scientist and Lab mixes in the IdPK trait and use the same
   table, will the id still be unique?
   - A Discovery has a source, how do i create MappedLongForeignKey to
   the table they share (lab, scientist)?

   I hope you'll be able to help me out :)

   I can't say I follow the above :-) Do you want to share tables, code or
   both? Maybe list the table structure and explain how you would like to
   map 

[Lift] UML Diagram from existing lift application

2010-02-04 Thread Dick Hirsch
On the esme-dev mailing list, we've got a request for a class/uml
diagram for our lift-based server code. Does anyone know of a tool
(maven-plugin?) that could provide such functionality?

Thanks.

D.

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