[Lift] Template help

2009-11-11 Thread aw

I need to create a snippet sequence that looks something like this:

a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
/a

The anchor needs to be generated using SHtml.link, and name 
description need to be bound.  As a result, I end up with a template
sequence like this:

b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
/b1:link

Then, I need snippet code that does something like:

bind(b1, xhtml,
  link - SHtml.link(S.contextPath, () = clicked(b), bind(b2,
chooseTemplate(b1, link, xhtml), name - Text(b.name),
description - Text(b.description) ))

Yuk...  I'm just not happy with this.  Sure, I could make it a little
more readable, but this still seems unnecessarily complex and
verbose.  I also really don't like how the view logic is dictating my
binding logic.  In other words, if I wanted to change my view
organization, there is a high chance that I also need to change my
binding logic -- and that just isn't right...

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



[Lift] XmlResponse with cookies

2009-11-11 Thread Atsuhiko Yamanaka

Hi,

I need XmlResponse with cookies, but have gotten following error.

  $ mvn scala:console

  scala import _root_.net.liftweb.http._
  import _root_.net.liftweb.http._

  scala new XmlResponse(foo /){
   |   override def cookies = S.responseCookies
   | }
  console:8: error: type mismatch;
   found   : List[net.liftweb.http.provider.HTTPCookie]
   required: object Nil
 override def cookies = S.responseCookies
 ^

It will be nice, if XmlResonse#cookies is defined as follows,

  case class XmlResponse(xml: Node) extends NodeResponse {
def docType = Empty
def code = 200
def headers = List(Content-Type - text/xml; charset=utf-8)
def cookies: List[HTTPCookie] = Nil// !!
def out = xml
  }

If it is allowed, I'll commit it after the review process.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/
twitter: http://twitter.com/ymnk

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



[Lift] Re: XmlResponse with cookies

2009-11-11 Thread Timothy Perrett

Wouldn't a more appropriate idiom be to use overloaded apply methods in a 
companion object?

That is:

def apply(node: NodeSeq): XmlResponse
def apply(node: NodeSeq, cookies: List[HTTPCookie]): XmlResponse

Thoughts?

Cheers, Tim

On 11 Nov 2009, at 10:21, Atsuhiko Yamanaka wrote:

 
 Hi,
 
 I need XmlResponse with cookies, but have gotten following error.
 
  $ mvn scala:console
 
  scala import _root_.net.liftweb.http._
  import _root_.net.liftweb.http._
 
  scala new XmlResponse(foo /){
   |   override def cookies = S.responseCookies
   | }
  console:8: error: type mismatch;
   found   : List[net.liftweb.http.provider.HTTPCookie]
   required: object Nil
 override def cookies = S.responseCookies
 ^
 
 It will be nice, if XmlResonse#cookies is defined as follows,
 
  case class XmlResponse(xml: Node) extends NodeResponse {
def docType = Empty
def code = 200
def headers = List(Content-Type - text/xml; charset=utf-8)
def cookies: List[HTTPCookie] = Nil// !!
def out = xml
  }
 
 If it is allowed, I'll commit it after the review process.
 
 
 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
+1-415-578-3454
 Skype callto://jcraft/
 twitter: http://twitter.com/ymnk
 
  
 


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



[Lift] Re: javax.mail 1.4.3-SNAPSHOT

2009-11-11 Thread Indrajit Raychaudhuri

Fixed, and in master.

http://github.com/dpp/liftweb/commit/0cac04cb0d05c07a222d07f980ecf9946ec49588

Cheers, Indrajit

On Nov 7, 9:41 am, aw anth...@whitford.com wrote:
 Looking at this:  http://download.java.net/maven/2/javax/mail/mail/
 it would seem that Sun is close to releasing JavaMail 1.4.3.

 Technically, I don't think there is anything wrong with Lift's
 dependency declaration for javax.mail.  Truly, the root issue is that
 Sun should not have published a SNAPSHOT to their public Maven 2
 repository.

 I did log an issue, however, for the mentioning of 
 javax.activation:http://github.com/dpp/liftweb/issues/#issue/168
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] does AutoComplete work ?

2009-11-11 Thread Christophe Dehlinger
Hi,

does AutoComplete work ?

I tried running the lift-example from snapshot on a local server,
autocompletion isn't happening on the AJAX Samples page. The rest of the
Ajax stuff works fine.
AC does work on http://demo.liftweb.net/ajax though, so the problem doesn't
seem to be browser-related.

I also tried overriding autocomplete_? in a MappedEnum in 1.1-M7. I did get
a text field instead of a combo, but no autocompletion.

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



[Lift] Re: Novell Pulse, front end by Lift

2009-11-11 Thread David LaPalomento

I'm glad to hear you like what you've seen so far with Pulse!  I don't
think we could do half the stuff we're doing without Lift backing us
up.  Stay tuned, we'll have more than a video to share with the group
soon :)

David

On Nov 8, 3:54 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Kudos everyone - the fact that organisations are building saleable  
 products on Lift is a testament to the quality of the platform so  
 early on in its life; as a team we should take real pride in this :-)

 Cheers, Tim

 On 8 Nov 2009, at 18:06, David Pollak wrote:



  Folks,

  Last week, Novell announced their new groupware product, 
  Pulse:http://www.novell.com/products/pulse/

  Pulse's UI was built with Lift.  If you have time to watch the demo,  
  it's very impressive... quite frankly, I was blown away... I didn't  
  think web browsers could do that, Lift or no.

  So, congrats to the Pulse team and congrats to the Lift community  
  for giving feedback that made Lift a platform that could build such  
  an app and congrats to the Lift committers to listening to community  
  feedback and building the Lift platform.

  Thanks,

  David

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



[Lift] Re: Novell Pulse, front end by Lift

2009-11-11 Thread TylerWeir

I'm a little late to the party, but Pulse is really quite amazing.
Well done all.

David LaP, I eagerly await anything you have to share.

Tyler

On Nov 11, 1:14 am, David LaPalomento dlapalome...@gmail.com wrote:
 I'm glad to hear you like what you've seen so far with Pulse!  I don't
 think we could do half the stuff we're doing without Lift backing us
 up.  Stay tuned, we'll have more than a video to share with the group
 soon :)

 David

 On Nov 8, 3:54 pm, Timothy Perrett timo...@getintheloop.eu wrote:



  Kudos everyone - the fact that organisations are building saleable  
  products on Lift is a testament to the quality of the platform so  
  early on in its life; as a team we should take real pride in this :-)

  Cheers, Tim

  On 8 Nov 2009, at 18:06, David Pollak wrote:

   Folks,

   Last week, Novell announced their new groupware product, 
   Pulse:http://www.novell.com/products/pulse/

   Pulse's UI was built with Lift.  If you have time to watch the demo,  
   it's very impressive... quite frankly, I was blown away... I didn't  
   think web browsers could do that, Lift or no.

   So, congrats to the Pulse team and congrats to the Lift community  
   for giving feedback that made Lift a platform that could build such  
   an app and congrats to the Lift committers to listening to community  
   feedback and building the Lift platform.

   Thanks,

   David

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



[Lift] Re: ManyToMany decision

2009-11-11 Thread Jim Barrows
On Tue, Nov 10, 2009 at 2:16 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 Hello.
 When I wrote ManyToMany a couple of months ago, I designed it to internally
 hold a collection of join table records, and to act as a collection of
 elements of the child table.
 For example, given Volunteer and VolunteerGroup where volunteers can be in
 multiple groups, Volunteer.volunteerGroups implements a collection of
 VolunteerGroups, but internally it's actually managing a collection of
 VolunteerVolunteerGroups (the join table).


I don't think you really need to maintain the pivot table list
(VolunteerVolunteerGroups) at all.  If you maintain the Many-to-Many as part
of the object, and use a standard naming convention then you don't really
need this extra list running around.  You can still build the SQL correctly
knowing only the objects involved.


 The current implementation throws an error (Predef.error) when it tries to
 get the child element via the join record and it doesn't exist. Thus any
 page accessing corrupted data will not display if the error is not caught. I
 plan, G-d willing, to change the implementation to silently skip such
 records.
 But the occurrence that reminded me of the defect also brought another
 point to my attention. To my knowledge Lift's schemifier does not correctly
 generate foreign key constraints for all databases (at least not at the
 point in time it schemified my H2 database... :) ) so we need a way for
 ManyToMany to keep things in sync. ManyToMany helps, to an extent, because
 when its MappedManyToMany members are initialized, it puts them in a list,
 and it propagates saves and deletes. So if you have a ManyToMany Mapper
 instance that contains a MappedManyToMany that has been initialized, and you
 call delete_! on the Mapper, it will delete all the associated join table
 entries. But it's not enough.

1. That can only happen if both sides of the relationship use
MappedManyToMany. Is there some way to enforce this? I was thinking of 
 using
a combination of (a) requiring the foreign MetaMapper to extends 
 ManyToMany,
and (b) when a MappedManyToMany is initialized, it should check that the
foreign MetaMapper/ManyToMany actually contains a MappedManyToMany 
 referring
to the current MappedManyToMany. (a) is not sufficient without (b), and (b)
has the same problem as #2 below, that objects are lazy.


I think you're right here.  Both sides have to have the mapping.. however I
don't think there is a good clean way to detect this without a compiler
plugin of some kind.




1. There is a basic problem, which is that since objects are lazy, if
you haven't referenced the MappedManyToMany field, delete_! will not be 
 able
to propagate to the join entries.


As you traverse the deleteing side, doesn't the other side get initialized
as well?


 #2 and #1.b can be solved by using reflection to initialize the
 MappedManyToMany members eagerly, just as MetaMapper does for all
 MappedFields. (MappedManyToMany is not a MappedField.) Now the advantage to
 having them lazy is that if you don't reference them they don't query the
 database. This advantage can be retained though by implementing the
 collection internally to populate lazily, much as MappedOneToMany already
 is.

 Thoughts?


I think your maintaining to much information that can be deduced from the
context.



 Thanks,
   Naftoli Gugenheim



 



-- 
James A Barrows

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



[Lift] Re: Unit testing a RESTful webservice with Lift

2009-11-11 Thread Alex Black

What are you unhappy about? Those tests look pretty simple and slick
to me!

It looks like the JettyTestServer is a singleton inside the test suite
- what happens if you have another test suite? I think you'd then hit
the same problem that I did, when the second test suite tries to fire
up Jetty it will fail because Lift has already been initialized.

- Alex

On Nov 10, 2:25 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 I've just committed simple API test code up to the ESME project.  The key
 pieces are at:

 http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca...http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca...

 After spending 30 minutes with the Lift TestKit, I'm wicked unhappy with
 it... but that will change later today. ;-)



 On Tue, Nov 10, 2009 at 9:51 AM, Alex Black a...@alexblack.ca wrote:

  My first unit test worked fine, but my second one dies:

  ERROR - Failed to Boot
  java.lang.IllegalStateException: Cannot modify after boot.
         at net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:885)
         at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:892)
         at net.liftweb.http.RulesSeq$$anon$3.prepend(LiftRules.scala:872)
  

  Presumably because it has already loaded and started Lift, and my
  second unit test fires up Jetty again trying to start Lift again which
  I take it is not supported.

  So, I figure I should either:
  a. refactor my tests so that I only create one jetty and lift instance
  ever
  - this will probably require 'resetting' the service somehow to ensure
  a blank slate between each unit test, not sure how I get a hold of the
  instance in question for that

  b. somehow launch jetty/lift differently, or force lift to cleanup?

  On Nov 9, 10:50 pm, Jonathan Ferguson j...@spiralarm.com wrote:
   We fire up Jetty populate a temp database and then run a batch of tests.
   Seems to work well for us.

   Jono

   2009/11/10 Alex Black a...@alexblack.ca

Can anyone suggest some good examples or strategies to use to test a
webservice written with Lift?

I've started down the path of firing up Jetty in a unit test, then
just hitting it with say a GET and checking the response.  Whats a
good way of firing up Jetty?  It looks like using ServletTester would
be the way to go:

 http://www.christianschenk.org/blog/testing-web-applications-with-jetty/

could that work with Lift?

- Alex

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



[Lift] Re: XmlResponse with cookies

2009-11-11 Thread David Pollak
On Wed, Nov 11, 2009 at 2:21 AM, Atsuhiko Yamanaka 
atsuhiko.yaman...@gmail.com wrote:


 Hi,

 I need XmlResponse with cookies, but have gotten following error.

  $ mvn scala:console

  scala import _root_.net.liftweb.http._
  import _root_.net.liftweb.http._

  scala new XmlResponse(foo /){
   |   override def cookies = S.responseCookies
   | }
  console:8: error: type mismatch;
   found   : List[net.liftweb.http.provider.HTTPCookie]
   required: object Nil
 override def cookies = S.responseCookies
 ^

 It will be nice, if XmlResonse#cookies is defined as follows,

  case class XmlResponse(xml: Node) extends NodeResponse {
def docType = Empty
def code = 200
def headers = List(Content-Type - text/xml; charset=utf-8)
def cookies: List[HTTPCookie] = Nil// !!
def out = xml
  }

 If it is allowed, I'll commit it after the review process.


Go for it!

Thanks for finding the issue and being willing to fix it!




 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
+1-415-578-3454
 Skype callto://jcraft/
 twitter: http://twitter.com/ymnk

 



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



[Lift] Re: Unit testing a RESTful webservice with Lift

2009-11-11 Thread David Pollak
On Wed, Nov 11, 2009 at 7:09 AM, Alex Black a...@alexblack.ca wrote:


 What are you unhappy about? Those tests look pretty simple and slick
 to me!


Yeah, but with this change: http://reviewboard.liftweb.net/r/95/

You'll get:

 Login in {
  for{
login - post(/api/login, token - token) !@ Failed to
log in if (testSuccess(login))
status - login.get(/api/status) !@ Failed to get status
if (testSuccess(status))
  } {
(status.xml \ user \ @id).text must_== theUser.id.toString
  }
}



 It looks like the JettyTestServer is a singleton inside the test suite
 - what happens if you have another test suite? I think you'd then hit
 the same problem that I did, when the second test suite tries to fire
 up Jetty it will fail because Lift has already been initialized.


The example in ESME is a singleton, but the start method is actually a lazy
val, so you can call it from any test, but it will only be triggered once
per run per classloader.  Does this give you what you want?  If not, it'll
be some mucking around with multiple classloaders.





 - Alex

 On Nov 10, 2:25 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I've just committed simple API test code up to the ESME project.  The key
  pieces are at:
 
 
 http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca...http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca.
 ..
 
  After spending 30 minutes with the Lift TestKit, I'm wicked unhappy with
  it... but that will change later today. ;-)
 
 
 
  On Tue, Nov 10, 2009 at 9:51 AM, Alex Black a...@alexblack.ca wrote:
 
   My first unit test worked fine, but my second one dies:
 
   ERROR - Failed to Boot
   java.lang.IllegalStateException: Cannot modify after boot.
  at
 net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:885)
  at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:892)
  at
 net.liftweb.http.RulesSeq$$anon$3.prepend(LiftRules.scala:872)
   
 
   Presumably because it has already loaded and started Lift, and my
   second unit test fires up Jetty again trying to start Lift again which
   I take it is not supported.
 
   So, I figure I should either:
   a. refactor my tests so that I only create one jetty and lift instance
   ever
   - this will probably require 'resetting' the service somehow to ensure
   a blank slate between each unit test, not sure how I get a hold of the
   instance in question for that
 
   b. somehow launch jetty/lift differently, or force lift to cleanup?
 
   On Nov 9, 10:50 pm, Jonathan Ferguson j...@spiralarm.com wrote:
We fire up Jetty populate a temp database and then run a batch of
 tests.
Seems to work well for us.
 
Jono
 
2009/11/10 Alex Black a...@alexblack.ca
 
 Can anyone suggest some good examples or strategies to use to test
 a
 webservice written with Lift?
 
 I've started down the path of firing up Jetty in a unit test, then
 just hitting it with say a GET and checking the response.  Whats a
 good way of firing up Jetty?  It looks like using ServletTester
 would
 be the way to go:
 
  
 http://www.christianschenk.org/blog/testing-web-applications-with-jetty/
 
 could that work with Lift?
 
 - Alex
 
  --
  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
 



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



[Lift] Re: Novell Pulse, front end by Lift

2009-11-11 Thread David Pollak
On Wed, Nov 11, 2009 at 5:55 AM, TylerWeir tyler.w...@gmail.com wrote:


 I'm a little late to the party, but Pulse is really quite amazing.
 Well done all.

 David LaP, I eagerly await anything you have to share.


Me2



 Tyler

 On Nov 11, 1:14 am, David LaPalomento dlapalome...@gmail.com wrote:
  I'm glad to hear you like what you've seen so far with Pulse!  I don't
  think we could do half the stuff we're doing without Lift backing us
  up.  Stay tuned, we'll have more than a video to share with the group
  soon :)
 
  David
 
  On Nov 8, 3:54 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 
 
 
   Kudos everyone - the fact that organisations are building saleable
   products on Lift is a testament to the quality of the platform so
   early on in its life; as a team we should take real pride in this :-)
 
   Cheers, Tim
 
   On 8 Nov 2009, at 18:06, David Pollak wrote:
 
Folks,
 
Last week, Novell announced their new groupware product, Pulse:
 http://www.novell.com/products/pulse/
 
Pulse's UI was built with Lift.  If you have time to watch the demo,

it's very impressive... quite frankly, I was blown away... I didn't
think web browsers could do that, Lift or no.
 
So, congrats to the Pulse team and congrats to the Lift community
for giving feedback that made Lift a platform that could build such
an app and congrats to the Lift committers to listening to community

feedback and building the Lift platform.
 
Thanks,
 
David
 
--
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
 



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



[Lift] Re: lift-json bug (in Xml.toJson)

2009-11-11 Thread David Pollak
I think a fix to this was pushed this morning.  Once this job is finished:
http://hudson.scala-tools.org/job/Lift/1367/ It should be available on
SNAPSHOT.


On Tue, Nov 10, 2009 at 1:49 PM, harryh har...@gmail.com wrote:


 This is on M7:

 scala import
 scala.xml.Elem
 import scala.xml.Elem

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

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

 scala def go(e: Elem) = Printer.pretty(render(Xml.toJson
 (e)))
 go: (scala.xml.Elem)String

 scala tipsgroup type=Nearbytipid10/id/tip/group/
 tips
 res0: scala.xml.Elem = tipsgroup type=Nearbytipid10/id/
 tip/group/tips

 scala go
 (res0)
 res1: String = { tips:{ group:{ type:Nearby, tip:
 { id:10 } }, type:Nearby } }

 Note how Nearby appears twice in res1 but only once in res0

 -harryh

 



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



[Lift] Re: Template help

2009-11-11 Thread David Pollak
On Wed, Nov 11, 2009 at 12:35 AM, aw anth...@whitford.com wrote:


 I need to create a snippet sequence that looks something like this:

 a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
 /a

 The anchor needs to be generated using SHtml.link, and name 
 description need to be bound.  As a result, I end up with a template
 sequence like this:

 b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
 /b1:link

 Then, I need snippet code that does something like:

 bind(b1, xhtml,
  link - SHtml.link(S.contextPath, () = clicked(b), bind(b2,
 chooseTemplate(b1, link, xhtml), name - Text(b.name),
 description - Text(b.description) ))


Why are you using S.contextPath?  But:

bind(b1, xhtml,
   link - kids = SHtml.link(/, () = clicked(b),
   bind(b2, kids, name - b.name.is, description - b.description.is
)))




 Yuk...  I'm just not happy with this.  Sure, I could make it a little
 more readable, but this still seems unnecessarily complex and
 verbose.  I also really don't like how the view logic is dictating my
 binding logic.  In other words, if I wanted to change my view
 organization, there is a high chance that I also need to change my
 binding logic -- and that just isn't right...

 Is there a better strategy?
 



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



[Lift] Re: Issue 164: S.notice, S.error, etc. broken from within AJAX/JSON calls

2009-11-11 Thread David Pollak
It's stuck on review board.

We're thinking of a M7.1 release because M7 is pretty broken with this issue
and the Session-related issue that Harry reported.

On Wed, Nov 11, 2009 at 9:18 AM, Ross Mellgren dri...@gmail.com wrote:

 Hey, any news on when this change will be pushed? I compiled a local copy
 and verified the fix works with my larger application, but I can't seem to
 get Maven to consistently keep my copy of 1.1-SNAPSHOT around and not
 download the new copies from scala-tools.org (I'm a Maven newbie, so I'm
 open to the possibility that I suck).

 -Ross


 On Nov 7, 2009, at 9:52 AM, David Pollak wrote:



 On Fri, Nov 6, 2009 at 1:26 PM, Ross Mellgren dri...@gmail.com wrote:

 I can confirm that my app now works correctly. Is there already a date set
 for M8? Or will this make it in to the M7 post release? I prefer to use
 milestones this late into dev, to avoid new errors popping up.


 The M7 post-release was only for a particular issue for a particular user
 and it turns out that their issue was a non-Lift issue.

 M8 will be out in early December (we target the first Wednesday of the
 month).

 Is you app in production (actual end users using it)?  We have a policy of
 heightened support for production apps and this issue is non-trivial, so it
 may be work an ancillary release if it's hitting you in production.



 -Ross

 On Nov 6, 2009, at 3:38 PM, David Pollak wrote:



 On Fri, Nov 6, 2009 at 12:37 PM, Ross Mellgren dri...@gmail.com wrote:

 On Nov 6, 2009, at 3:24 PM, David Pollak wrote:

 On Fri, Nov 6, 2009 at 12:03 PM, Ross Mellgren dri...@gmail.com wrote:

 Paytronix Systems, Inc.

 Centrally hosted gift and loyalty card solution -- standard-ish 2-3
 tier, SQL server backend, JBoss (mostly as servlet container) middleware
 exposing web and web services, custom POS integration software at
 restaurants. You've probably seen a bunch of our customers.


 Right... you told me this already... sorry for forgetting.


 No problem. My boss (Stefan Kochi) might be sending you an email soon.

 Also, your fix is up in dpp_issue_164 on GitHub.


 Thanks! I take it it'll go through the usual review board cycle?


 Yes, it's up on review board now, but you can pull the dpp_issue_164
 branch and do a local build.



 -Ross




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





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





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



[Lift] Re: Unit testing a RESTful webservice with Lift

2009-11-11 Thread Alex Black
Looks nice.

Singleton - ah, yes, that sounds like it will work well, good call.

On Wed, Nov 11, 2009 at 12:05 PM, David Pollak 
feeder.of.the.be...@gmail.com wrote:



 On Wed, Nov 11, 2009 at 7:09 AM, Alex Black a...@alexblack.ca wrote:


 What are you unhappy about? Those tests look pretty simple and slick
 to me!


 Yeah, but with this change: http://reviewboard.liftweb.net/r/95/

 You'll get:

  Login in {
   for{
 login - post(/api/login, token - token) !@ Failed to log in 
 if (testSuccess(login))
 status - login.get(/api/status) !@ Failed to get status if 
 (testSuccess(status))
   } {
 (status.xml \ user \ @id).text must_== theUser.id.toString
   }
 }



 It looks like the JettyTestServer is a singleton inside the test suite
 - what happens if you have another test suite? I think you'd then hit
 the same problem that I did, when the second test suite tries to fire
 up Jetty it will fail because Lift has already been initialized.


 The example in ESME is a singleton, but the start method is actually a lazy
 val, so you can call it from any test, but it will only be triggered once
 per run per classloader.  Does this give you what you want?  If not, it'll
 be some mucking around with multiple classloaders.





 - Alex

 On Nov 10, 2:25 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I've just committed simple API test code up to the ESME project.  The
 key
  pieces are at:
 
 
 http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca...http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/sca.
 ..
 
  After spending 30 minutes with the Lift TestKit, I'm wicked unhappy with
  it... but that will change later today. ;-)
 
 
 
  On Tue, Nov 10, 2009 at 9:51 AM, Alex Black a...@alexblack.ca wrote:
 
   My first unit test worked fine, but my second one dies:
 
   ERROR - Failed to Boot
   java.lang.IllegalStateException: Cannot modify after boot.
  at
 net.liftweb.http.RulesSeq$class.safe_$qmark(LiftRules.scala:885)
  at net.liftweb.http.RulesSeq$class.prepend(LiftRules.scala:892)
  at
 net.liftweb.http.RulesSeq$$anon$3.prepend(LiftRules.scala:872)
   
 
   Presumably because it has already loaded and started Lift, and my
   second unit test fires up Jetty again trying to start Lift again which
   I take it is not supported.
 
   So, I figure I should either:
   a. refactor my tests so that I only create one jetty and lift instance
   ever
   - this will probably require 'resetting' the service somehow to ensure
   a blank slate between each unit test, not sure how I get a hold of the
   instance in question for that
 
   b. somehow launch jetty/lift differently, or force lift to cleanup?
 
   On Nov 9, 10:50 pm, Jonathan Ferguson j...@spiralarm.com wrote:
We fire up Jetty populate a temp database and then run a batch of
 tests.
Seems to work well for us.
 
Jono
 
2009/11/10 Alex Black a...@alexblack.ca
 
 Can anyone suggest some good examples or strategies to use to test
 a
 webservice written with Lift?
 
 I've started down the path of firing up Jetty in a unit test, then
 just hitting it with say a GET and checking the response.  Whats a
 good way of firing up Jetty?  It looks like using ServletTester
 would
 be the way to go:
 
  
 http://www.christianschenk.org/blog/testing-web-applications-with-jetty/
 
 could that work with Lift?
 
 - Alex
 
  --
  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




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

 



-- 
http://blog.alexblack.ca
http://twitter.com/waterlooalex

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



[Lift] Re: ManyToMany decision

2009-11-11 Thread Naftoli Gugenheim

To clarify: The fundamental purpose of ManyToMany, like OneToMany, is that 
rather than dealing with children of an entity as they are in the database at 
a given moment, instead, they should have similar semantics to a MappedField: 
You load it from the database, modify it to your hearts content, and then 
decide whether you want to save it or not. For example, calling set() on a 
MappedField does not write immediately to the database, and it's a good thing 
too--imagine a multi-page form where you can go back and forth to different 
screens, or a single page form that uses submit buttons that perform some 
action but you stay on the same page. You don't want the user's changes to go 
the database unless he clicks Save. So too, one often wants to edit a list on 
one screen. There should be submit buttons to add records, etc., but if you 
don't click save it shouldn't go to the database.
So MappedOneToMany and MappedManyToMany act as collections, internally keeping 
track of which records were inserted or removed, but not performing a create or 
delete until the field is saved. So in other words they act as multi-valued 
fields.
There are two ways MappedManyToMany can do this. It can hold a list of join 
table records, or child table records. Either way it will have to look up the 
other at times.
Now in order for saves and deletes on the ManyToMany Mapper to be propagated to 
the MappedManyToMany fields, it has to have a list of them. The list only gets 
populated when code references the field, causing it to be initialized and add 
itself to the list of m-n fields.
So we make all of these proposed changes?

-
Jim Barrowsjim.barr...@gmail.com wrote:

On Tue, Nov 10, 2009 at 2:16 PM, Naftoli Gugenheim naftoli...@gmail.comwrote:

 Hello.
 When I wrote ManyToMany a couple of months ago, I designed it to internally
 hold a collection of join table records, and to act as a collection of
 elements of the child table.
 For example, given Volunteer and VolunteerGroup where volunteers can be in
 multiple groups, Volunteer.volunteerGroups implements a collection of
 VolunteerGroups, but internally it's actually managing a collection of
 VolunteerVolunteerGroups (the join table).


I don't think you really need to maintain the pivot table list
(VolunteerVolunteerGroups) at all.  If you maintain the Many-to-Many as part
of the object, and use a standard naming convention then you don't really
need this extra list running around.  You can still build the SQL correctly
knowing only the objects involved.


 The current implementation throws an error (Predef.error) when it tries to
 get the child element via the join record and it doesn't exist. Thus any
 page accessing corrupted data will not display if the error is not caught. I
 plan, G-d willing, to change the implementation to silently skip such
 records.
 But the occurrence that reminded me of the defect also brought another
 point to my attention. To my knowledge Lift's schemifier does not correctly
 generate foreign key constraints for all databases (at least not at the
 point in time it schemified my H2 database... :) ) so we need a way for
 ManyToMany to keep things in sync. ManyToMany helps, to an extent, because
 when its MappedManyToMany members are initialized, it puts them in a list,
 and it propagates saves and deletes. So if you have a ManyToMany Mapper
 instance that contains a MappedManyToMany that has been initialized, and you
 call delete_! on the Mapper, it will delete all the associated join table
 entries. But it's not enough.

1. That can only happen if both sides of the relationship use
MappedManyToMany. Is there some way to enforce this? I was thinking of 
 using
a combination of (a) requiring the foreign MetaMapper to extends 
 ManyToMany,
and (b) when a MappedManyToMany is initialized, it should check that the
foreign MetaMapper/ManyToMany actually contains a MappedManyToMany 
 referring
to the current MappedManyToMany. (a) is not sufficient without (b), and (b)
has the same problem as #2 below, that objects are lazy.


I think you're right here.  Both sides have to have the mapping.. however I
don't think there is a good clean way to detect this without a compiler
plugin of some kind.




1. There is a basic problem, which is that since objects are lazy, if
you haven't referenced the MappedManyToMany field, delete_! will not be 
 able
to propagate to the join entries.


As you traverse the deleteing side, doesn't the other side get initialized
as well?


 #2 and #1.b can be solved by using reflection to initialize the
 MappedManyToMany members eagerly, just as MetaMapper does for all
 MappedFields. (MappedManyToMany is not a MappedField.) Now the advantage to
 having them lazy is that if you don't reference them they don't query the
 database. This advantage can be retained though by implementing the
 collection internally to populate lazily, much as 

[Lift] Re: Issue 164: S.notice, S.error, etc. broken from within AJAX/JSON calls

2009-11-11 Thread Ross Mellgren
M7.1 would be extremely helpful to me as I'm trying to move a project  
into QA and I'm loathe to use a moving target for QA. However, if need  
be I can stick with a working SNAPSHOT up until M8, if M8 is really  
coming around first week Dec.

-Ross

On Nov 11, 2009, at 12:21 PM, David Pollak wrote:

 It's stuck on review board.

 We're thinking of a M7.1 release because M7 is pretty broken with  
 this issue and the Session-related issue that Harry reported.

 On Wed, Nov 11, 2009 at 9:18 AM, Ross Mellgren dri...@gmail.com  
 wrote:
 Hey, any news on when this change will be pushed? I compiled a local  
 copy and verified the fix works with my larger application, but I  
 can't seem to get Maven to consistently keep my copy of 1.1-SNAPSHOT  
 around and not download the new copies from scala-tools.org (I'm a  
 Maven newbie, so I'm open to the possibility that I suck).

 -Ross


 On Nov 7, 2009, at 9:52 AM, David Pollak wrote:



 On Fri, Nov 6, 2009 at 1:26 PM, Ross Mellgren dri...@gmail.com  
 wrote:
 I can confirm that my app now works correctly. Is there already a  
 date set for M8? Or will this make it in to the M7 post release? I  
 prefer to use milestones this late into dev, to avoid new errors  
 popping up.

 The M7 post-release was only for a particular issue for a  
 particular user and it turns out that their issue was a non-Lift  
 issue.

 M8 will be out in early December (we target the first Wednesday of  
 the month).

 Is you app in production (actual end users using it)?  We have a  
 policy of heightened support for production apps and this issue is  
 non-trivial, so it may be work an ancillary release if it's hitting  
 you in production.


 -Ross

 On Nov 6, 2009, at 3:38 PM, David Pollak wrote:



 On Fri, Nov 6, 2009 at 12:37 PM, Ross Mellgren dri...@gmail.com  
 wrote:
 On Nov 6, 2009, at 3:24 PM, David Pollak wrote:
 On Fri, Nov 6, 2009 at 12:03 PM, Ross Mellgren dri...@gmail.com  
 wrote:
 Paytronix Systems, Inc.

 Centrally hosted gift and loyalty card solution -- standard-ish  
 2-3 tier, SQL server backend, JBoss (mostly as servlet container)  
 middleware exposing web and web services, custom POS integration  
 software at restaurants. You've probably seen a bunch of our  
 customers.

 Right... you told me this already... sorry for forgetting.

 No problem. My boss (Stefan Kochi) might be sending you an email  
 soon.

 Also, your fix is up in dpp_issue_164 on GitHub.

 Thanks! I take it it'll go through the usual review board cycle?

 Yes, it's up on review board now, but you can pull the  
 dpp_issue_164 branch and do a local build.


 -Ross



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




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




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



[Lift] Re: Template help

2009-11-11 Thread Naftoli Gugenheim

You might need to surround the kids = ... function with parenthesis.

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

On Wed, Nov 11, 2009 at 12:35 AM, aw anth...@whitford.com wrote:


 I need to create a snippet sequence that looks something like this:

 a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
 /a

 The anchor needs to be generated using SHtml.link, and name 
 description need to be bound.  As a result, I end up with a template
 sequence like this:

 b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
 /b1:link

 Then, I need snippet code that does something like:

 bind(b1, xhtml,
  link - SHtml.link(S.contextPath, () = clicked(b), bind(b2,
 chooseTemplate(b1, link, xhtml), name - Text(b.name),
 description - Text(b.description) ))


Why are you using S.contextPath?  But:

bind(b1, xhtml,
   link - kids = SHtml.link(/, () = clicked(b),
   bind(b2, kids, name - b.name.is, description - b.description.is
)))




 Yuk...  I'm just not happy with this.  Sure, I could make it a little
 more readable, but this still seems unnecessarily complex and
 verbose.  I also really don't like how the view logic is dictating my
 binding logic.  In other words, if I wanted to change my view
 organization, there is a high chance that I also need to change my
 binding logic -- and that just isn't right...

 Is there a better strategy?
 



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



[Lift] Re: Template help

2009-11-11 Thread aw

OK, your suggestion definitely makes the snippet code more readable,
but I fear I didn't make my point clear because the snippet code still
is highly coupled with the view layout.

Imagine that I want to change my view from this:

a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
/a

to this:

span class=namename/span
span class=commentdescription/span
a href=next
span class=arrow/
/a

This would mean that I need to change my template from:

b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
/b1:link

to this:

span class=nameb:name//span
span class=commentb:description//span
b:link
span class=arrow/
/b:link

And then I need to update my code from:

bind(b1, xhtml,
   link - kids = SHtml.link(next, () = clicked(b),
   bind(b2, kids, name - b.name.is, description -
b.description.is
)))

to something like this:

bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
)))


My complaint is that reorganizing the view is tending to require code
changes at the snippet level.  And that just doesn't seem right to me.

At first, I thought that I could leverage the recursive nature of
snippets.  In other words, I thought I could avoid the b1 and b2
binding keys and simply use b, then when the first round contained
more b variables to bind, it would recurse.  Alas, this didn't work
(I'm sorry, but I don't recall the error message).  But this was what
I was thinking:

b:link
span class=nameb:name//span
span class=commentb:description//span
span class=arrow/
/b:link

or this:

span class=nameb:name//span
span class=commentb:description//span
b:link
span class=arrow/
/b:link

and the code would remain this:

bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
)))


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



[Lift] Re: Template help

2009-11-11 Thread Ross Mellgren

You can do a recursive bind, but you must make it explicit:

def mySnippet(xhtml: NodeSeq): NodeSeq = {
 def doBind(xhtml: NodeSeq): NodeSeq =
 bind(b, xhtml,
  link - { (kids: NodeSeq) = SHtml.link(next, () =  
clicked(b), doBind(kids)) },
  name - the name,
  description - the description)
 doBind(xhtml)
}

-Ross

On Nov 11, 2009, at 1:21 PM, aw wrote:


 OK, your suggestion definitely makes the snippet code more readable,
 but I fear I didn't make my point clear because the snippet code still
 is highly coupled with the view layout.

 Imagine that I want to change my view from this:

 a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
 /a

 to this:

 span class=namename/span
 span class=commentdescription/span
 a href=next
span class=arrow/
 /a

 This would mean that I need to change my template from:

 b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
 /b1:link

 to this:

 span class=nameb:name//span
 span class=commentb:description//span
 b:link
span class=arrow/
 /b:link

 And then I need to update my code from:

 bind(b1, xhtml,
   link - kids = SHtml.link(next, () = clicked(b),
   bind(b2, kids, name - b.name.is, description -
 b.description.is
 )))

 to something like this:

 bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
 )))


 My complaint is that reorganizing the view is tending to require code
 changes at the snippet level.  And that just doesn't seem right to me.

 At first, I thought that I could leverage the recursive nature of
 snippets.  In other words, I thought I could avoid the b1 and b2
 binding keys and simply use b, then when the first round contained
 more b variables to bind, it would recurse.  Alas, this didn't work
 (I'm sorry, but I don't recall the error message).  But this was what
 I was thinking:

 b:link
span class=nameb:name//span
span class=commentb:description//span
span class=arrow/
 /b:link

 or this:

 span class=nameb:name//span
 span class=commentb:description//span
 b:link
span class=arrow/
 /b:link

 and the code would remain this:

 bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
 )))


 


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



[Lift] Re: Template help

2009-11-11 Thread Jim Barrows
On Wed, Nov 11, 2009 at 11:21 AM, aw anth...@whitford.com wrote:


 OK, your suggestion definitely makes the snippet code more readable,
 but I fear I didn't make my point clear because the snippet code still
 is highly coupled with the view layout.


If this was a MVC type framework, I think you're point would be valid.  But
it isn't a MVC framework.  The snippet is tightly coupled to the xhtml,
because it's the dynamic part of the xhtml.

The best way to mitigate these kinds of changes is to design the UI first,
then build the snippets.   That way, you're not rearranging as often.
See this article for a better understanding:
http://wiki.liftweb.net/index.php?title=Lift_View_First


 Imagine that I want to change my view from this:

 a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
 /a

 to this:

 span class=namename/span
 span class=commentdescription/span
 a href=next
 span class=arrow/
 /a

 This would mean that I need to change my template from:

 b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
 /b1:link

 to this:

 span class=nameb:name//span
 span class=commentb:description//span
 b:link
span class=arrow/
 /b:link

 And then I need to update my code from:

 bind(b1, xhtml,
   link - kids = SHtml.link(next, () = clicked(b),
bind(b2, kids, name - b.name.is, description -
 b.description.is
 )))

 to something like this:

 bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
 )))


 My complaint is that reorganizing the view is tending to require code
 changes at the snippet level.  And that just doesn't seem right to me.

 At first, I thought that I could leverage the recursive nature of
 snippets.  In other words, I thought I could avoid the b1 and b2
 binding keys and simply use b, then when the first round contained
 more b variables to bind, it would recurse.  Alas, this didn't work
 (I'm sorry, but I don't recall the error message).  But this was what
 I was thinking:

 b:link
span class=nameb:name//span
span class=commentb:description//span
span class=arrow/
 /b:link

 or this:

 span class=nameb:name//span
 span class=commentb:description//span
 b:link
span class=arrow/
 /b:link

 and the code would remain this:

 bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
 )))


 



-- 
James A Barrows

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



[Lift] Re: Template help

2009-11-11 Thread Naftoli Gugenheim

I didn't see Tim's blog post, but another option is to bind in two passes. 
First bind the outer level: b1:link should become an SHtml.link, preserving the 
same set of child elements. So here use a NodeSeq function: kids = 
SHtml.link(..., kids). Then pass the resulting NodeSeq to a bind invocation 
that transforms your other elements.
You can place this in one statement, by using one call to bind as the NodeSeq 
argument to the other call. And you can use the implicit in BindPlus to chain 
bind calls:
xhtml.bind(prefix, bindParams ... ).bind(pre2, ...)
That said, I think there is a fundamental, inevitable tension between 
separation of view and logic, and repetition (not really your point). I tried 
to address this, as it applies to Mapper fields, to a small extent in 
ModelView. However if anyone has better ideas of how to do things I'm very 
interested to hear!



-
Timothy Perretttimo...@getintheloop.eu wrote:


Take a look at:

http://logji.blogspot.com/2009/09/composable-bindings-in-lift.html

and then:

http://logji.blogspot.com/2009/10/composable-bindings-in-lift-part-ii.html

Sounds like this could provide a more flexible implementation pattern for your 
use case.

Cheers, Tim


On 11 Nov 2009, at 18:21, aw wrote:

 
 OK, your suggestion definitely makes the snippet code more readable,
 but I fear I didn't make my point clear because the snippet code still
 is highly coupled with the view layout.
 
 Imagine that I want to change my view from this:
 
 a href=next
span class=namename/span
span class=commentdescription/span
span class=arrow/
 /a
 
 to this:
 
 span class=namename/span
 span class=commentdescription/span
 a href=next
span class=arrow/
 /a
 
 This would mean that I need to change my template from:
 
 b1:link
span class=nameb2:name//span
span class=commentb2:description//span
span class=arrow/
 /b1:link
 
 to this:
 
 span class=nameb:name//span
 span class=commentb:description//span
 b:link
span class=arrow/
 /b:link
 
 And then I need to update my code from:
 
 bind(b1, xhtml,
   link - kids = SHtml.link(next, () = clicked(b),
   bind(b2, kids, name - b.name.is, description -
 b.description.is
 )))
 
 to something like this:
 
 bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
 )))
 
 
 My complaint is that reorganizing the view is tending to require code
 changes at the snippet level.  And that just doesn't seem right to me.
 
 At first, I thought that I could leverage the recursive nature of
 snippets.  In other words, I thought I could avoid the b1 and b2
 binding keys and simply use b, then when the first round contained
 more b variables to bind, it would recurse.  Alas, this didn't work
 (I'm sorry, but I don't recall the error message).  But this was what
 I was thinking:
 
 b:link
span class=nameb:name//span
span class=commentb:description//span
span class=arrow/
 /b:link
 
 or this:
 
 span class=nameb:name//span
 span class=commentb:description//span
 b:link
span class=arrow/
 /b:link
 
 and the code would remain this:
 
 bind(b, xhtml,
   name - b.name.is,
   description - b.description.is,
   link - kids = SHtml.link(next, () = clicked(b))
 )))
 
 
  
 




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



[Lift] Minor Bug? MappedString.valUnique should return one FieldError

2009-11-11 Thread jon

Hi,

I'm currently adding a uniqueness requirement to a field, but there
are duplicate entries (for empty string) in my database already.
Currently valUnique maps each match it found to a FieldError, but
should probably return one FieldError regardless of how many matches
it finds.

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



[Lift] New Milestone coming soon

2009-11-11 Thread David Pollak
Folks,

There are two critical issues with M7:

   - Issue 164 http://github.com/dpp/liftweb/issues#issue/164  JSON/Ajax
   messages do not carry Notices back to the client.
   - The Session manager is not initialized properly.  Basically, this means
   that sessions will be expired by the web container, but not by Lift and
   GUIDs that map to functions on the server side are not removed until the
   session is terminated.

We're planning to do an M7.1 release later this week (probably Friday).

If there are other *critical* defects (stuff that means you can't use M7 in
production), please speak now.

Thanks,

David

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



[Lift] ScalaTest in Lift archetypes

2009-11-11 Thread Bill Venners

Hi,

I was talking with David Pollak the other night about putting some
ScalaTest examples into the Lift archetypes. He said I should post to
the list. Can anyone out there let me know how we might go about that?

Thanks.

Bill

Bill Venners
Artima, Inc.
http://www.artima.com

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



[Lift] How to use Box

2009-11-11 Thread Ferdinand Chan

Wondering what's the normal practice of using a Box. As a Java
developer, I always want to get the boxed value by a method named
Value like

val optionalContent = Full(This is optional)

Log.info(  The optional content is  + optionalContent.value)

But I know its not a valid way to do so in lift ( same for Option in
Scala)

From the book programming in Scala , there's an example

val withDefault: Option[Int] = Int = {
case Some(x) = x
case None = 0
}

which suggest the use of match to retrieve the value of the boxed
content. It make sense to me and I'm totally agree with the advantage
of using match + option (Box) combination.

However, as a newbie to Scala, I'm so tempted to use something
like .Value to retrieve the box value .

So, what's the normal way to use Box ?? Could someone kindly provide
some example on how to use ? I tried to look through some source code
of Lift but its not easy for a newbie :)

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



[Lift] Re: How to use Box

2009-11-11 Thread David Pollak
http://blog.lostlake.org/index.php?/archives/50-The-Scala-Option-class-and-how-lift-uses-it.html

The for comprehension is your friend.

On Wed, Nov 11, 2009 at 2:40 PM, Ferdinand Chan unique...@gmail.com wrote:


 Wondering what's the normal practice of using a Box. As a Java
 developer, I always want to get the boxed value by a method named
 Value like

 val optionalContent = Full(This is optional)

 Log.info(  The optional content is  + optionalContent.value)

 But I know its not a valid way to do so in lift ( same for Option in
 Scala)

 From the book programming in Scala , there's an example

 val withDefault: Option[Int] = Int = {
 case Some(x) = x
 case None = 0
 }

 which suggest the use of match to retrieve the value of the boxed
 content. It make sense to me and I'm totally agree with the advantage
 of using match + option (Box) combination.

 However, as a newbie to Scala, I'm so tempted to use something
 like .Value to retrieve the box value .

 So, what's the normal way to use Box ?? Could someone kindly provide
 some example on how to use ? I tried to look through some source code
 of Lift but its not easy for a newbie :)

 Thanks
 



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



[Lift] Re: ScalaTest in Lift archetypes

2009-11-11 Thread Timothy Perrett

Bill, can I propose you and I get together at devoxx and discuss the  
options?

I belive my talk is not long after yours!

Cheers, Tim

Sent from my iPhone

On 11 Nov 2009, at 21:50, Bill Venners b...@artima.com wrote:


 Hi,

 I was talking with David Pollak the other night about putting some
 ScalaTest examples into the Lift archetypes. He said I should post to
 the list. Can anyone out there let me know how we might go about that?

 Thanks.

 Bill
 
 Bill Venners
 Artima, Inc.
 http://www.artima.com

 


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



[Lift] Re: New Milestone coming soon

2009-11-11 Thread Jim McBeath

OracleDriver doesn't work with CRUDify when attempting to view a
list of entries, it gets an SQL error due to use of LIMIT/OFFSET,
which Oracle does not support.  Defining brokenLimit_? = true
in OracleDriver makes it work for me.  I can do this myself by including
my own copy of Driver.scala, so I don't know if it counts as critical,
but it seems like a pretty localized (and thus low-risk) change.

--
Jim

On Wed, Nov 11, 2009 at 11:54:46AM -0800, David Pollak wrote:
 Date: Wed, 11 Nov 2009 11:54:46 -0800
 From: David Pollak feeder.of.the.be...@gmail.com
 To: liftweb liftweb@googlegroups.com
 Subject: [Lift] New Milestone coming soon
 
Folks,
 
There are two critical issues with M7:
 
  * Issue 164Â http://github.com/dpp/liftweb/issues#issue/164
 JSON/Ajax messages do not carry Notices back to the client.
  * The Session manager is not initialized properly. Â Basically, this
means that sessions will be expired by the web container, but not
by Lift and GUIDs that map to functions on the server side are not
removed until the session is terminated.
 
We're planning to do an M7.1 release later this week (probably Friday).
If there are other *critical* defects (stuff that means you can't use
M7 in production), please speak now.
Thanks,
David
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
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 liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] ReviewBoard upgrade

2009-11-11 Thread Derek Chen-Becker
I'll be working in the morning (US Mountain time) on upgrading ReviewBoard,
just in case anyone notices any hiccups.

Derek

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



[Lift] Re: 503 for url: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

2009-11-11 Thread ctrlspace

Sorry for what may seem like a stupid question, but I am very new to
scala/lift.

PCDataXmlParser solved my issue with w3 dtd but I am now getting a
parse error when I get a http stream.

:96:5: '' not allowed in attrib valuegoogle_ad_type =
text_image;^
Exception in thread main java.lang.ExceptionInInitializerError
at ca.ctrlspace.loveItHateItWeb.xml.UpcDatabaseFeed.main
(UpcDatabaseFeed.scala)
Caused by: java.lang.IllegalArgumentException: line 97 does not exist
at scala.io.Source.getLine(Source.scala:280)
at scala.io.Source.report(Source.scala:368)
at scala.io.Source.reportError(Source.scala:355)
at scala.io.Source.reportError(Source.scala:344)
at scala.xml.parsing.MarkupParser$class.reportSyntaxError
(MarkupParser.scala:1113)
at net.liftweb.util.PCDataXmlParser.reportSyntaxError
(PCDataMarkupParser.scala:91)

it looks like the following is causing this:

  script type=text/javascript!--
google_ad_client = pub-2938286402422382;
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = 160x600_as;
google_ad_type = text_image;
google_ad_channel = ;
google_color_border = ff;
google_color_bg = ff;
google_color_link = cc;
google_color_url = cc;
google_color_text = 00;
//--/script

Is it possible to ask PCDataXmlParser not to grab certain xml
elements?
What is the proper way to use PCDataXmlParser?

As an aside why does PCDataXmlParser not give the w3 dtd exception?

Thanks,

Chris.

On Nov 9, 11:33 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 It's not an issue of Lift's output working with XML.load, it's an issue of
 the W3C blocking the Java libraries.  This has nothing to do with Lift or
 the XML Lift emits.

 If you want to parse XML and not run into that problem, use
 net.liftweb.util.PCDataXmlParser





 On Mon, Nov 9, 2009 at 7:11 PM, Alex Black a...@alexblack.ca wrote:

  I read these two:

 http://old.nabble.com/Exception-loading-XML-with-DTD-td25213294.html

 http://stackoverflow.com/questions/1096285/is-scala-java-not-respecti...

  Not sure what the answer is, some ugly work arounds are presented...

  Presumably Lift's XML output *should* work with XML.Load?

  - Alex

  On Nov 9, 10:01 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
   Don't know but it's been asked so you should be able to search for it;
  I'm not sure whether on this list or scala-user or both.

   -

   Alex Blacka...@alexblack.ca wrote:

   Exception:

   java.io.IOException: Server returned HTTP response code: 503 for URL:
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
           at sun.net.www.protocol.http.HttpURLConnection.getInputStream
   (HttpURLConnection.java:1313)
           at

  com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity
   (XMLEntityManager.java:677)
           at
   com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity
   (XMLEntityManager.java:1315)
           at
   com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity
   (XMLEntityManager.java:1282)
           at
   com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource
   (XMLDTDScannerImpl.java:283)
           at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
   $DTDDriver.dispatch(XMLDocumentScannerImpl.java:1193)
           at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
   $DTDDriver.next(XMLDocumentScannerImpl.java:1090)
           at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
   $PrologDriver.next(XMLDocumentScannerImpl.java:1003)
           at
  com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
   (XMLDocumentScannerImpl.java:648)
           at

  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan 
  Document
   (XMLDocumentFragmentScannerImpl.java:510)
           at
  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
   (XML11Configuration.java:807)
           at
  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
   (XML11Configuration.java:737)
           at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse
   (XMLParser.java:107)
           at
  com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
   (AbstractSAXParser.java:1205)
           at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
   $JAXPSAXParser.parse(SAXParserImpl.java:522)
           at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
           at
  scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292)
           at scala.xml.parsing.NoBindingFactoryAdapter.loadXML
   (NoBindingFactoryAdapter.scala:60)
           at scala.xml.XML$.load(XML.scala:72)
           at
  com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply
   (ServerTest.scala:16)
           at
  com.snapsort.dataServer.api.ServerTest$$anonfun$testBasic$1.apply
   (ServerTest.scala:14)
           at 

[Lift] Re: How to use Box

2009-11-11 Thread Naftoli Gugenheim

What do you want to happen if you call value on an Empty?

-
Ferdinand Chanunique...@gmail.com wrote:


Wondering what's the normal practice of using a Box. As a Java
developer, I always want to get the boxed value by a method named
Value like

val optionalContent = Full(This is optional)

Log.info(  The optional content is  + optionalContent.value)

But I know its not a valid way to do so in lift ( same for Option in
Scala)

From the book programming in Scala , there's an example

val withDefault: Option[Int] = Int = {
case Some(x) = x
case None = 0
}

which suggest the use of match to retrieve the value of the boxed
content. It make sense to me and I'm totally agree with the advantage
of using match + option (Box) combination.

However, as a newbie to Scala, I'm so tempted to use something
like .Value to retrieve the box value .

So, what's the normal way to use Box ?? Could someone kindly provide
some example on how to use ? I tried to look through some source code
of Lift but its not easy for a newbie :)

Thanks


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



[Lift] Re: CometActor and render

2009-11-11 Thread jack

one more thing: I also ran the code without the piece that retrieves
web pages and gets their length. Instead I just had the Calculator
class sleep for 10 seconds (which is longer than the http request
takes) and then return a random number. This worked fine. I can't see
what the difference is.

On Nov 11, 11:26 pm, Jack Widman jack.wid...@gmail.com wrote:
 David,

 I have attached my code. It runs but does not behave as I intended it to.
 The code does a web search on the term scala and displays a list of URLs
 of the results. Next to each URL it says Page Length : -1. A process is
 running in the background which takes each URL, goes out and gets the page
 and takes the length of the page. The length of that page is then supposed
 to immediately appear on the page next to that URL. I put the lengths on a
 queue, as they come in, and I have the Comet page poll the queue and display
 the results. It would probably be better to have the results send a message
 to the Comet class so the page is only re-rendered when there is a change
 but for now I am polling.

 I can see the lengths coming in and being put on the queue, but the Comet
 page is not getting them till they are all retrieved. (This takes way too
 long and nothing changes on the screen till its too late). I need them to
 appear as they come in. Occasionally I can see a length being retrieved and
 the Comet page finds it but even then it is not displayed until all the
 lengths are in.   I know this is not very clear but I think it will be clear
 from the code.

 I also know there are a lot of places in the code which can be improved and
 I welcome all of your input but what I would love is to have these numbers
 appear on the page as they they are retrieved. I have been stumped by this
 for a while and I suspect that somebody who knows Lift well might see the
 problem right away.

 The class that retrieves the page lengths is called Calculator and the queue
 is called SourceQueue. The classes are pretty small so hopefully it will be
 clear what is going on. I want you to know I think it is incredible how
 responsive you and the group are and I look forward to using Lift in the
 future.

 Thanks so much.

 Jack

 On Tue, Nov 10, 2009 at 1:27 AM, David Pollak feeder.of.the.be...@gmail.com

  wrote:

  On Mon, Nov 9, 2009 at 10:10 PM, Jack Widman jack.wid...@gmail.comwrote:

  The only difference between your working code and mine is that mine has a
  process in the background that is always running and puts Foo objects on a
  queue whenever they are ready. Where can I start this long running process
  so that it doesn't interfere with the lowPriority method that takes things
  off the queue and rerenders the page. I tried starting the process in its
  own Actor that I start in localSetup but it seems somehow to be blocking 
  the
  lowPriority method from doing its thing.

  I have no idea what this means... sorry.

  Please post actual runnable code and we can help you debug.

  On Sun, Nov 8, 2009 at 11:35 PM, David Pollak 
  feeder.of.the.be...@gmail.com wrote:

  Jack,

  I reproduced your code and it seems to work fine.  I've enclosed a
  working copy.

  Some comments about your code:

     - The foos variable and the foo variable may be getting confused in
     the code... the render method may be rendering the same thing based on 
  the
     unchanging foos variable.
     - Doing null testing is a sign that you have logic errors in your
     code.  I strongly recommend using either Box or Option for everything 
  that
     can logically not contain a value/reference.  If you're bridging out 
  to Java
     code and are expecting null from the Java code, write a small bridge 
  that
     will wrapper the Java return values in Box/Option.
     - You have a case class (Tick) that contains no parameters.  Please
     use a case object instead.
     - Your Tick look is a spin loop.  You fire a Tick message as part of
     processing the Tick message.  I would suggest that if you're polling, 
  that
     you have a reasonable poll interval, otherwise you'll starve your CPU.
     Further, having reRender on each loop through means that you're 
  forcing a
     lot of bytes over the wire rather than only doing a reRender on changed
     values.

  Thanks,

  David

  On Sun, Nov 8, 2009 at 3:47 PM, Jack Widman jack.wid...@gmail.comwrote:

  Sorry. Here it is:   As I said, I know that when render is called,
  foo.getValue has the right value. But it does not show on the screen, 
  unless
  I refresh the browser.

  package com.foo.comet

  import net.liftweb._
  import http._
  import js._
  import JsCmds._
  import net.liftweb.util._
  import net.liftweb.http._
  import _root_.scala.xml._
  import scala.actors._
  import com.authoritude.snippet._
  import scala.collection.mutable.Queue
  import net.liftweb.http.SessionVar

  class MyComet extends CometActor {

    override def defaultPrefix = Full(auth)

    private var foos = FooManager.getFoos