Re: [Lift] **Potential breaking change**

2010-03-05 Thread Mads Hartmann Jensen
Tried to post this to lift-announce but I don't have permission - I did join 
the group though so not sure why. How do i optain permission? I think that Ross 
Mellgren is having the same issue 

Thanks
Mads Hartmann Jensen

On 04/03/2010, at 22.37, Mads Hartmann wrote:

 If 'blob' is not a keyword in your DB and you're currently using blob
 as a column name you should change it to blob_c
 
 This is a cause of fixing issue 402
 
 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.
 

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



[Lift] Newbie Q: how to append html on ajaxForm submission

2010-03-05 Thread Lukasz Kuczera
Hi Folks,
I've hard time to figure out how to append html snippet after ajaxForm
is submitted. I know how to make it in jQuery but i would prefer to
have it in one place. My code is: http://pastebin.com/wgAXd2ag

I would love to have AppendHtml(afterId: String, body: NodeSeq)
method.

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



[Lift] Re: Newbie Q: how to append html on ajaxForm submission

2010-03-05 Thread Lukasz Kuczera
So i've solved it on my own :D Using jQuery in Lift :D
Lift is so complex but once you wrap your head around it is so easy :D

http://pastebin.com/J5msUQ56

On Mar 5, 9:57 am, Lukasz Kuczera kuk...@gmail.com wrote:
 Hi Folks,
 I've hard time to figure out how to append html snippet after ajaxForm
 is submitted. I know how to make it in jQuery but i would prefer to
 have it in one place. My code is:http://pastebin.com/wgAXd2ag

 I would love to have AppendHtml(afterId: String, body: NodeSeq)
 method.

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



[Lift] Re: Newbie Q: how to append html on ajaxForm submission

2010-03-05 Thread ced
There is an AppendHtml object in net.liftweb.http.js.jquery.JqJsCmds
that generates a JsCmd.
AppendHtml(my-element-id, spanappend me/span)
Is this what you're looking for?


On 5 Mrz., 09:57, Lukasz Kuczera kuk...@gmail.com wrote:
 Hi Folks,
 I've hard time to figure out how to append html snippet after ajaxForm
 is submitted. I know how to make it in jQuery but i would prefer to
 have it in one place. My code is:http://pastebin.com/wgAXd2ag

 I would love to have AppendHtml(afterId: String, body: NodeSeq)
 method.

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



[Lift] Re: Newbie Q: how to append html on ajaxForm submission

2010-03-05 Thread Lukasz Kuczera
Thanks ced, I've used something like: JqId(new-comment) 
JqAppend(pPosted By: {author}br/{text}/p)
But AppendHtml is more eye pleasant :)

On Mar 5, 11:04 am, ced docpom...@googlemail.com wrote:
 There is an AppendHtml object in net.liftweb.http.js.jquery.JqJsCmds
 that generates a JsCmd.
 AppendHtml(my-element-id, spanappend me/span)
 Is this what you're looking for?

 On 5 Mrz., 09:57, Lukasz Kuczera kuk...@gmail.com wrote:



  Hi Folks,
  I've hard time to figure out how to append html snippet after ajaxForm
  is submitted. I know how to make it in jQuery but i would prefer to
  have it in one place. My code is:http://pastebin.com/wgAXd2ag

  I would love to have AppendHtml(afterId: String, body: NodeSeq)
  method.

-- 
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] **Potential breaking change**

2010-03-05 Thread Indrajit Raychaudhuri

Mads/Ross,

You have the requisite rights now. Feel free to post to lift-announce :)

Cheers, Indrajit


On 05/03/10 2:08 PM, Mads Hartmann Jensen wrote:

Tried to post this to lift-announce but I don't have permission - I did join 
the group though so not sure why. How do i optain permission? I think that Ross 
Mellgren is having the same issue

Thanks
Mads Hartmann Jensen

On 04/03/2010, at 22.37, Mads Hartmann wrote:


If 'blob' is not a keyword in your DB and you're currently using blob
as a column name you should change it to blob_c

This is a cause of fixing issue 402

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.





--
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] Customizing generated form elements without touching scala code

2010-03-05 Thread Julian Backes

Hi,

I'm trying to get my first form in Lift running and I'm having the 
following problem:


I use for example SHtml.text(..) to create a text input element. 
Unfortunately, this element has no specific class or id such that I can 
customize it using CSS or whatever.


I know that I can add some parameters to SHtml.text(..) which are passed 
to the generated form element but this means that I have style 
information in my scala code. And this is, in my opinion, very ugly.


Is there a better solution?

I could imagine something like e:myfield class=somecssclass/. This 
class information is accessible in scala so the form generator could 
automatically add it to the generated element...


Thanks in advance for your help!!

Julian

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



Re: [Lift] Customizing generated form elements without touching scala code

2010-03-05 Thread Jeppe Nejsum Madsen
On Fri, Mar 5, 2010 at 1:07 PM, Julian Backes
julianbac...@googlemail.com wrote:
 Hi,

 I'm trying to get my first form in Lift running and I'm having the following
 problem:

 I use for example SHtml.text(..) to create a text input element.
 Unfortunately, this element has no specific class or id such that I can
 customize it using CSS or whatever.

 I know that I can add some parameters to SHtml.text(..) which are passed to
 the generated form element but this means that I have style information in
 my scala code. And this is, in my opinion, very ugly.

Not sure if you mean having the classname in scala code is ugly? If
not you can pass a class as attribute.and style the class
externally

 Is there a better solution?

 I could imagine something like e:myfield class=somecssclass/.

Yes, if in your snippet you use -% instead of - to bind, attributes
will be preserved.

Or you can use FuncAttrBindParam to bind calculated values for attributes.

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



[Lift] Re: Customizing generated form elements without touching scala code

2010-03-05 Thread Marius
I disagree with the unglyness you are talking about just because
Snipets are UI elements. However you can preserve the attributes from
the markup such as:

def doit(xhtml: NodeSeq): NodeSeq = {

  bind(f, xhtml,
text -% SHtml.text(name, println _)
  )

}


and in the markup


lift:MySnippet.doit
   f:text class=abc size=3/
/lift:MySnippet.doit


On Mar 5, 2:07 pm, Julian Backes julianbac...@googlemail.com wrote:
 Hi,

 I'm trying to get my first form in Lift running and I'm having the
 following problem:

 I use for example SHtml.text(..) to create a text input element.
 Unfortunately, this element has no specific class or id such that I can
 customize it using CSS or whatever.

 I know that I can add some parameters to SHtml.text(..) which are passed
 to the generated form element but this means that I have style
 information in my scala code. And this is, in my opinion, very ugly.

 Is there a better solution?

 I could imagine something like e:myfield class=somecssclass/. This
 class information is accessible in scala so the form generator could
 automatically add it to the generated element...

 Thanks in advance for your help!!

 Julian

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



[Lift] email validation configuration

2010-03-05 Thread GA
Hello guys,

could you please let me know where I can find information about how to 
configure the email validation for the MegaProtoUser?

I do not know how to tell Lift about our SMTP server, Authentication data, etc. 
I was searching in the wiki and this list but I could not find anything.

Thanks in advance,

GA

-- 
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] email validation configuration

2010-03-05 Thread Jeppe Nejsum Madsen
On Fri, Mar 5, 2010 at 2:21 PM, GA my_li...@me.com wrote:
 Hello guys,

 could you please let me know where I can find information about how to 
 configure the email validation for the MegaProtoUser?

 I do not know how to tell Lift about our SMTP server, Authentication data, 
 etc. I was searching in the wiki and this list but I could not find anything.

Have a look at the Mailer object. Specifically, it reads either jndi
or the property mail.smtp.host for the hostname. Not sure if handles
authentication.

/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: Customizing generated form elements without touching scala code

2010-03-05 Thread Julian Backes
Thank you for your answer, also thanks to Jeppe who posted the same 
solution.


 I disagree with the unglyness you are talking about just because
 Snipets are UI elements.
I already read that and although I don't want to start a discussion on 
this, I want to share my opinion with you:
I already read in some blog entries and also here on the mailing list 
that lift completely avoids the problem of having business logic in your 
views/templates.
I think in general, this is a very good idea. On the other hand, many 
people say snippets are part of the view. In almost all examples I 
found, you can see business logic in the snippets. Is this really better 
now? I think you are still mixing business logic and UI stuff, just on a 
different level. Of course, you can seperate that but this adds 
unnecessary complexity to an application.
Or am I missing something? I'm still a beginner in the scala/lift 
world... :-)


Julian

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



Re: [Lift] Re: Newbie Q: how to append html on ajaxForm submission

2010-03-05 Thread David Pollak
On Fri, Mar 5, 2010 at 2:00 AM, Lukasz Kuczera kuk...@gmail.com wrote:

 So i've solved it on my own :D Using jQuery in Lift :D
 Lift is so complex but once you wrap your head around it is so easy :D


Glad you found the answer... and yes... it's good to build your own
JavaScript helpers for Lift.  Most of the JavaScript stuff that's currently
in Lift is based on the helpers I and some other committers have used...
thus they are not complete.

More generally, there's no need to prefix your email subjects with
Newbie.  We're all newbies on this list.  I asked a newbie question
about json yesterday and I've got more Lift experience than anyone else with
Lift. ;-)

Please ask polite questions (and yours are).  Please help others when you
know the answer.  Please help make this community better!



 http://pastebin.com/J5msUQ56

 On Mar 5, 9:57 am, Lukasz Kuczera kuk...@gmail.com wrote:
  Hi Folks,
  I've hard time to figure out how to append html snippet after ajaxForm
  is submitted. I know how to make it in jQuery but i would prefer to
  have it in one place. My code is:http://pastebin.com/wgAXd2ag
 
  I would love to have AppendHtml(afterId: String, body: NodeSeq)
  method.

 --
 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] email validation configuration

2010-03-05 Thread David Pollak
If you set the Mailer.authenticator in Boot, that will do authentication for
mail sending.

On Fri, Mar 5, 2010 at 5:33 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:

 On Fri, Mar 5, 2010 at 2:21 PM, GA my_li...@me.com wrote:
  Hello guys,
 
  could you please let me know where I can find information about how to
 configure the email validation for the MegaProtoUser?
 
  I do not know how to tell Lift about our SMTP server, Authentication
 data, etc. I was searching in the wiki and this list but I could not find
 anything.

 Have a look at the Mailer object. Specifically, it reads either jndi
 or the property mail.smtp.host for the hostname. Not sure if handles
 authentication.

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




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

2010-03-05 Thread Dano
I would never claim to be astute.  However, I did observe that
demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
bottom of the page.  I also observed that the Wizard example is still
broken (paste binary characters into 'First Name' and then click the
Next button).  I have not yet registered for an account with Assembla
but would be happy to file the bug.


Dan

On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:
 Check dpp's response as of 8:01

 -Ross

 On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:



  What version is the demo running?

  -
  Danoolearydani...@gmail.com wrote:

  Just saw that Lift 2.0-M3 was released.  I looked to see if the
  vulnerability was still present in demo.liftweb.net and I am still
  able to generate exceptions in the browser when I paste binary
  characters in the textfields for the Wizard, Wizard Challenge, and Arc
  Challenge examples in the Misc section.

  Don't know if this remaining problem is supposed to be handled by the
  application or framework, but thought I would make a post to alert the
  group.

  Dan

  On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
  The recent scala days conference activity may have cause the updates
  to this thread to escape notice.  Just wondering if there is concern
  about the remaining binary character problems I noted in my prior
  post.

  Thanks in advance.

  Dan

  On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:

  More information on this in case anyone is interested.  If you go to
  theliftdemo website, it appears the issue with characters is mostly
  addressed except for the Misc code section.   Specifically, the
  Wizard, Wizard Challenge and Arc Challenge #1 examples will
  generate XML parsing errors.

  For these problems, I am not sure if the issue if the example or the
  framework.  If the issue is with the example, it would be good to know
  whatLiftapps need to do to avoid getting bitten by binary characters
  entered into form fields.

  Thanks in advance.

  Dan

  On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:

  Hello,

  I was wondering if the fix for the control characters issue was
  included in 2.0-M2.  I just did a test with ourLiftapplication built
  with 2.0-M2 and I am still seeing problems (i.e. javascript exceptions
  - NS_ERROR_INVALID_POINTER).

  Thanks in advance.

  Dan

  On Feb 3, 9:08 am, David Pollak feeder.of.the.be...@gmail.com wrote:

  Thanks for pointing that out.  There are other problems as well... I'll 
  fix
  them (in both the Scala andLiftdiffs)

  On Wed, Feb 3, 2010 at 7:39 AM, Feng Zhang sharpzh...@gmail.com wrote:
  I found that in the fix, \n is changed to \t, while \t to \n. Is this
  desired behavior?

  Thank you,

  Feng

  On Wed, Feb 3, 2010 at 9:20 AM, Indrajit Raychaudhuri 
  indraj...@gmail.com
  wrote:

  1. Fix in head/master (2.0-SNAPSHOT) and prepone 2.0-M2.

  2. Backport in 1.0.x branch and spin 1.0.4. We haven't marked 1.0.x
  'unsupported' yet. Forcing apps to move to 2.0-M2 just for this
  vulnerability fix isn't fun.

  Cheers, Indrajit

  On 03/02/10 3:34 PM, Timothy Perrett wrote:

  +1

  Fix it in head, no need to back-port; M2 is only around the corner.

  Cheers, Tim

  On 3 Feb 2010, at 09:49, Jeppe Nejsum Madsen wrote:

   David Pollakfeeder.of.the.be...@gmail.com  writes:

   I'd like to get a sense of how important the community views this
  defect.
  Is it a backport the fix to every milestone and release 
  yesterday or
  is it
  a fix it in 2.0-M2 or someplace in between.

  For me, it's fix it in 2.0-SNAPSHOT

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

[Lift] Wow... Lift has some amazing stats

2010-03-05 Thread David Pollak
Folks,

I just looked at Lift's stats on ohloh.  ( http://www.ohloh.net/p/liftweb )
A couple of key items:

Very large, active development team

Over the past twelve months, 33
developershttp://www.ohloh.net/p/liftweb/contributorscontributed new
code to
 Lift http://www.ohloh.net/p/liftweb.

This is one of the largest open-source teams in the world, and is in the top
2% of all project teams on Ohloh.

For this measurement, Ohloh considered only recent changes to the code. Over
the entire history of the project, 45 developers have contributed.
Increasing year-over-year development activity

Over the last twelve months, Lift http://www.ohloh.net/p/liftweb has seen
a substantial increase in activity. This is probably good sign that interest
in this project is rising, and that the open source community has embraced
this project.

Ohloh makes this determination by comparing total number of commits made by
all developers during the most recent twelve months with the same figure for
the twelve months before that. The number of developers and total lines of
code are not considered.
So, a big thanks to the community for driving Lift and another big thanks to
the Lift committers for adding so much to Lift!

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

2010-03-05 Thread Naftoli Gugenheim
Can you reproduce the vulnerability in your own M3 app?

-
Danoolearydani...@gmail.com wrote:

I would never claim to be astute.  However, I did observe that
demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
bottom of the page.  I also observed that the Wizard example is still
broken (paste binary characters into 'First Name' and then click the
Next button).  I have not yet registered for an account with Assembla
but would be happy to file the bug.


Dan

On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:
 Check dpp's response as of 8:01

 -Ross

 On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:



  What version is the demo running?

  -
  Danoolearydani...@gmail.com wrote:

  Just saw that Lift 2.0-M3 was released.  I looked to see if the
  vulnerability was still present in demo.liftweb.net and I am still
  able to generate exceptions in the browser when I paste binary
  characters in the textfields for the Wizard, Wizard Challenge, and Arc
  Challenge examples in the Misc section.

  Don't know if this remaining problem is supposed to be handled by the
  application or framework, but thought I would make a post to alert the
  group.

  Dan

  On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
  The recent scala days conference activity may have cause the updates
  to this thread to escape notice.  Just wondering if there is concern
  about the remaining binary character problems I noted in my prior
  post.

  Thanks in advance.

  Dan

  On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:

  More information on this in case anyone is interested.  If you go to
  theliftdemo website, it appears the issue with characters is mostly
  addressed except for the Misc code section.   Specifically, the
  Wizard, Wizard Challenge and Arc Challenge #1 examples will
  generate XML parsing errors.

  For these problems, I am not sure if the issue if the example or the
  framework.  If the issue is with the example, it would be good to know
  whatLiftapps need to do to avoid getting bitten by binary characters
  entered into form fields.

  Thanks in advance.

  Dan

  On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:

  Hello,

  I was wondering if the fix for the control characters issue was
  included in 2.0-M2.  I just did a test with ourLiftapplication built
  with 2.0-M2 and I am still seeing problems (i.e. javascript exceptions
  - NS_ERROR_INVALID_POINTER).

  Thanks in advance.

  Dan

  On Feb 3, 9:08 am, David Pollak feeder.of.the.be...@gmail.com wrote:

  Thanks for pointing that out.  There are other problems as well... I'll 
  fix
  them (in both the Scala andLiftdiffs)

  On Wed, Feb 3, 2010 at 7:39 AM, Feng Zhang sharpzh...@gmail.com wrote:
  I found that in the fix, \n is changed to \t, while \t to \n. Is this
  desired behavior?

  Thank you,

  Feng

  On Wed, Feb 3, 2010 at 9:20 AM, Indrajit Raychaudhuri 
  indraj...@gmail.com
  wrote:

  1. Fix in head/master (2.0-SNAPSHOT) and prepone 2.0-M2.

  2. Backport in 1.0.x branch and spin 1.0.4. We haven't marked 1.0.x
  'unsupported' yet. Forcing apps to move to 2.0-M2 just for this
  vulnerability fix isn't fun.

  Cheers, Indrajit

  On 03/02/10 3:34 PM, Timothy Perrett wrote:

  +1

  Fix it in head, no need to back-port; M2 is only around the corner.

  Cheers, Tim

  On 3 Feb 2010, at 09:49, Jeppe Nejsum Madsen wrote:

   David Pollakfeeder.of.the.be...@gmail.com  writes:

   I'd like to get a sense of how important the community views this
  defect.
  Is it a backport the fix to every milestone and release 
  yesterday or
  is it
  a fix it in 2.0-M2 or someplace in between.

  For me, it's fix it in 2.0-SNAPSHOT

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

[Lift] Re: Lift security vulnerability

2010-03-05 Thread Dano
I can reproduce it in our application, but I think it is not
necessarily due to Lift.  This is what I am trying to sort out.  We
have client-side javascript which is sending JSON commands to the
server and things blow up once things come back from the server.  In
this case, Lift is not responsible for the rendering so I would say
this is an application issue.

I am poking at the demo lift application to try to flush out issues
common to the group and understand what is a framework issue and what
needs to be addressed by the application.

Thanks.


Dan

On Mar 5, 9:47 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 Can you reproduce the vulnerability in your own M3 app?

 -

 Danoolearydani...@gmail.com wrote:

 I would never claim to be astute.  However, I did observe that
 demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
 bottom of the page.  I also observed that the Wizard example is still
 broken (paste binary characters into 'First Name' and then click the
 Next button).  I have not yet registered for an account with Assembla
 but would be happy to file the bug.

 Dan

 On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:





  Check dpp's response as of 8:01

  -Ross

  On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:

   What version is the demo running?

   -
   Danoolearydani...@gmail.com wrote:

   Just saw that Lift 2.0-M3 was released.  I looked to see if the
   vulnerability was still present in demo.liftweb.net and I am still
   able to generate exceptions in the browser when I paste binary
   characters in the textfields for the Wizard, Wizard Challenge, and Arc
   Challenge examples in the Misc section.

   Don't know if this remaining problem is supposed to be handled by the
   application or framework, but thought I would make a post to alert the
   group.

   Dan

   On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
   The recent scala days conference activity may have cause the updates
   to this thread to escape notice.  Just wondering if there is concern
   about the remaining binary character problems I noted in my prior
   post.

   Thanks in advance.

   Dan

   On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:

   More information on this in case anyone is interested.  If you go to
   theliftdemo website, it appears the issue with characters is mostly
   addressed except for the Misc code section.   Specifically, the
   Wizard, Wizard Challenge and Arc Challenge #1 examples will
   generate XML parsing errors.

   For these problems, I am not sure if the issue if the example or the
   framework.  If the issue is with the example, it would be good to know
   whatLiftapps need to do to avoid getting bitten by binary characters
   entered into form fields.

   Thanks in advance.

   Dan

   On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:

   Hello,

   I was wondering if the fix for the control characters issue was
   included in 2.0-M2.  I just did a test with ourLiftapplication built
   with 2.0-M2 and I am still seeing problems (i.e. javascript exceptions
   - NS_ERROR_INVALID_POINTER).

   Thanks in advance.

   Dan

   On Feb 3, 9:08 am, David Pollak feeder.of.the.be...@gmail.com wrote:

   Thanks for pointing that out.  There are other problems as well... 
   I'll fix
   them (in both the Scala andLiftdiffs)

   On Wed, Feb 3, 2010 at 7:39 AM, Feng Zhang sharpzh...@gmail.com 
   wrote:
   I found that in the fix, \n is changed to \t, while \t to \n. Is this
   desired behavior?

   Thank you,

   Feng

   On Wed, Feb 3, 2010 at 9:20 AM, Indrajit Raychaudhuri 
   indraj...@gmail.com
   wrote:

   1. Fix in head/master (2.0-SNAPSHOT) and prepone 2.0-M2.

   2. Backport in 1.0.x branch and spin 1.0.4. We haven't marked 1.0.x
   'unsupported' yet. Forcing apps to move to 2.0-M2 just for this
   vulnerability fix isn't fun.

   Cheers, Indrajit

   On 03/02/10 3:34 PM, Timothy Perrett wrote:

   +1

   Fix it in head, no need to back-port; M2 is only around the corner.

   Cheers, Tim

   On 3 Feb 2010, at 09:49, Jeppe Nejsum Madsen wrote:

    David Pollakfeeder.of.the.be...@gmail.com  writes:

    I'd like to get a sense of how important the community views this
   defect.
   Is it a backport the fix to every milestone and release 
   yesterday or
   is it
   a fix it in 2.0-M2 or someplace in between.

   For me, it's fix it in 2.0-SNAPSHOT

   /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 

[Lift] BSON support in lift-json

2010-03-05 Thread Tim Nelson
I finally had the opportunity to look into the couchdb code and I must
say it is rather impressive.

I would like to utilize the code in JSONRecord.scala in scamongo [1].
However, MongoDB uses a variation of JSON they call BSON, which they
actually just published a spec [2] for, due to interest outside of
MongoDB. Basically, it adds support for date, ObjectId [3], binary
data, regular expressions, and code (JavaScript) data types.

My question is, what would it take to add support to lift-json for
these other data types? Is this even feasible?

Thanks,
Tim


[1] http://github.com/eltimn/scamongo
[2] http://bsonspec.org/
[3] http://www.mongodb.org/display/DOCS/Object+IDs

-- 
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] Wow... Lift has some amazing stats

2010-03-05 Thread Timothy Perrett
w00t!!

Go team - maybe one of these years we'll have a team meet ;-)

Cheers, Tim


On 5 Mar 2010, at 17:46, David Pollak wrote:

 Folks,
 
 I just looked at Lift's stats on ohloh.  ( http://www.ohloh.net/p/liftweb ) A 
 couple of key items:
 
 Very large, active development team
 
 Over the past twelve months, 33 developers contributed new code to Lift.
 
 This is one of the largest open-source teams in the world, and is in the top 
 2% of all project teams on Ohloh.
 
 For this measurement, Ohloh considered only recent changes to the code. Over 
 the entire history of the project, 45 developers have contributed.
 
 Increasing year-over-year development activity
 
 Over the last twelve months, Lift  has seen a substantial increase in 
 activity. This is probably good sign that interest in this project is rising, 
 and that the open source community has embraced this project.
 
 Ohloh makes this determination by comparing total number of commits made by 
 all developers during the most recent twelve months with the same figure for 
 the twelve months before that. The number of developers and total lines of 
 code are not considered.
 
 So, a big thanks to the community for driving Lift and another big thanks to 
 the Lift committers for adding so much to Lift!
 
 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 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] BSON support in lift-json

2010-03-05 Thread Timothy Perrett
Probably a sub-ordinate module would be preferable... one  that builds on the 
lift-json stuff and doesn't pollute the normal JSON usage. 

Joni, what are your thoughts?

Cheers, Tim

On 5 Mar 2010, at 17:59, Tim Nelson wrote:

 I finally had the opportunity to look into the couchdb code and I must
 say it is rather impressive.
 
 I would like to utilize the code in JSONRecord.scala in scamongo [1].
 However, MongoDB uses a variation of JSON they call BSON, which they
 actually just published a spec [2] for, due to interest outside of
 MongoDB. Basically, it adds support for date, ObjectId [3], binary
 data, regular expressions, and code (JavaScript) data types.
 
 My question is, what would it take to add support to lift-json for
 these other data types? Is this even feasible?
 
 Thanks,
 Tim
 
 
 [1] http://github.com/eltimn/scamongo
 [2] http://bsonspec.org/
 [3] http://www.mongodb.org/display/DOCS/Object+IDs
 
 -- 
 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: Wow... Lift has some amazing stats

2010-03-05 Thread Marius
I'm sooo proud being a little part of it ;)

On 5 mar., 19:46, David Pollak feeder.of.the.be...@gmail.com wrote:
 Folks,

 I just looked at Lift's stats on ohloh.  (http://www.ohloh.net/p/liftweb)
 A couple of key items:

 Very large, active development team

 Over the past twelve months, 33
 developershttp://www.ohloh.net/p/liftweb/contributorscontributed new
 code to
  Lift http://www.ohloh.net/p/liftweb.

 This is one of the largest open-source teams in the world, and is in the top
 2% of all project teams on Ohloh.

 For this measurement, Ohloh considered only recent changes to the code. Over
 the entire history of the project, 45 developers have contributed.
 Increasing year-over-year development activity

 Over the last twelve months, Lift http://www.ohloh.net/p/liftweb has seen
 a substantial increase in activity. This is probably good sign that interest
 in this project is rising, and that the open source community has embraced
 this project.

 Ohloh makes this determination by comparing total number of commits made by
 all developers during the most recent twelve months with the same figure for
 the twelve months before that. The number of developers and total lines of
 code are not considered.
 So, a big thanks to the community for driving Lift and another big thanks to
 the Lift committers for adding so much to Lift!

 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 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] BSON support in lift-json

2010-03-05 Thread Tim Nelson
I definitely agree with keeping the BSON code separate or possibly
having a strict JSON mode.

Tim

On Fri, Mar 5, 2010 at 12:13 PM, Timothy Perrett
timo...@getintheloop.eu wrote:
 Probably a sub-ordinate module would be preferable... one  that builds on the 
 lift-json stuff and doesn't pollute the normal JSON usage.

 Joni, what are your thoughts?

 Cheers, Tim

 On 5 Mar 2010, at 17:59, Tim Nelson wrote:

 I finally had the opportunity to look into the couchdb code and I must
 say it is rather impressive.

 I would like to utilize the code in JSONRecord.scala in scamongo [1].
 However, MongoDB uses a variation of JSON they call BSON, which they
 actually just published a spec [2] for, due to interest outside of
 MongoDB. Basically, it adds support for date, ObjectId [3], binary
 data, regular expressions, and code (JavaScript) data types.

 My question is, what would it take to add support to lift-json for
 these other data types? Is this even feasible?

 Thanks,
 Tim


 [1] http://github.com/eltimn/scamongo
 [2] http://bsonspec.org/
 [3] http://www.mongodb.org/display/DOCS/Object+IDs

 --
 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: Lift security vulnerability

2010-03-05 Thread Dano
I think I would like to amend my last post by asking if it is possible
that the lift-json library support the ability to strip out binary
characters since many times an application uses the results of JSON
operations to render back to the client.

Thanks.


Dan

On Mar 5, 9:53 am, Dano olearydani...@gmail.com wrote:
 I can reproduce it in our application, but I think it is not
 necessarily due to Lift.  This is what I am trying to sort out.  We
 have client-side javascript which is sending JSON commands to the
 server and things blow up once things come back from the server.  In
 this case, Lift is not responsible for the rendering so I would say
 this is an application issue.

 I am poking at the demo lift application to try to flush out issues
 common to the group and understand what is a framework issue and what
 needs to be addressed by the application.

 Thanks.

 Dan

 On Mar 5, 9:47 am, Naftoli Gugenheim naftoli...@gmail.com wrote:



  Can you reproduce the vulnerability in your own M3 app?

  -

  Danoolearydani...@gmail.com wrote:

  I would never claim to be astute.  However, I did observe that
  demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
  bottom of the page.  I also observed that the Wizard example is still
  broken (paste binary characters into 'First Name' and then click the
  Next button).  I have not yet registered for an account with Assembla
  but would be happy to file the bug.

  Dan

  On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:

   Check dpp's response as of 8:01

   -Ross

   On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:

What version is the demo running?

-
Danoolearydani...@gmail.com wrote:

Just saw that Lift 2.0-M3 was released.  I looked to see if the
vulnerability was still present in demo.liftweb.net and I am still
able to generate exceptions in the browser when I paste binary
characters in the textfields for the Wizard, Wizard Challenge, and Arc
Challenge examples in the Misc section.

Don't know if this remaining problem is supposed to be handled by the
application or framework, but thought I would make a post to alert the
group.

Dan

On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
The recent scala days conference activity may have cause the updates
to this thread to escape notice.  Just wondering if there is concern
about the remaining binary character problems I noted in my prior
post.

Thanks in advance.

Dan

On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:

More information on this in case anyone is interested.  If you go to
theliftdemo website, it appears the issue with characters is mostly
addressed except for the Misc code section.   Specifically, the
Wizard, Wizard Challenge and Arc Challenge #1 examples will
generate XML parsing errors.

For these problems, I am not sure if the issue if the example or the
framework.  If the issue is with the example, it would be good to know
whatLiftapps need to do to avoid getting bitten by binary characters
entered into form fields.

Thanks in advance.

Dan

On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:

Hello,

I was wondering if the fix for the control characters issue was
included in 2.0-M2.  I just did a test with ourLiftapplication built
with 2.0-M2 and I am still seeing problems (i.e. javascript 
exceptions
- NS_ERROR_INVALID_POINTER).

Thanks in advance.

Dan

On Feb 3, 9:08 am, David Pollak feeder.of.the.be...@gmail.com 
wrote:

Thanks for pointing that out.  There are other problems as well... 
I'll fix
them (in both the Scala andLiftdiffs)

On Wed, Feb 3, 2010 at 7:39 AM, Feng Zhang sharpzh...@gmail.com 
wrote:
I found that in the fix, \n is changed to \t, while \t to \n. Is 
this
desired behavior?

Thank you,

Feng

On Wed, Feb 3, 2010 at 9:20 AM, Indrajit Raychaudhuri 
indraj...@gmail.com
wrote:

1. Fix in head/master (2.0-SNAPSHOT) and prepone 2.0-M2.

2. Backport in 1.0.x branch and spin 1.0.4. We haven't marked 
1.0.x
'unsupported' yet. Forcing apps to move to 2.0-M2 just for this
vulnerability fix isn't fun.

Cheers, Indrajit

On 03/02/10 3:34 PM, Timothy Perrett wrote:

+1

Fix it in head, no need to back-port; M2 is only around the 
corner.

Cheers, Tim

On 3 Feb 2010, at 09:49, Jeppe Nejsum Madsen wrote:

 David Pollakfeeder.of.the.be...@gmail.com  writes:

 I'd like to get a sense of how important the community views 
this
defect.
Is it a backport the fix to every milestone and release 
yesterday or
is it
a fix it in 2.0-M2 or someplace in between.

For me, it's fix it in 2.0-SNAPSHOT

/Jeppe

--
You received this message because you are subscribed to 

Re: [Lift] Re: Lift security vulnerability

2010-03-05 Thread David Pollak
On Fri, Mar 5, 2010 at 9:32 AM, Dano olearydani...@gmail.com wrote:

 I would never claim to be astute.  However, I did observe that
 demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
 bottom of the page.  I also observed that the Wizard example is still
 broken (paste binary characters into 'First Name' and then click the
 Next button).  I have not yet registered for an account with Assembla
 but would be happy to file the bug.


I don't know what you mean by pasting binary characters into a field, but
I have updated the Arc Challenge code to:
class ArcChallenge extends StatefulSnippet {
  var dispatch: DispatchIt = {case _ = xhtml = ask}

  def control: String = (for (i - 0 until 65000) yield i.toChar).mkString

  /**
   * Step 1: Type in a Phrase.
   */
  def ask = {
p
Say Anything:
{text(, p = phrase = control + p + control)}
{submit(Submit, () = dispatch = {case _ = xhtml = think})}
/p
  }

  /**
   * Step 2: Show a link that takes you to the Phrase you entered.
   */
  def think = submit(Click here to see what you said,
 () = dispatch = {case _ = xhtml = answer})

  /**
   * Step 3: Show the phrase.
   */
  def answer = pYou said: {phrase}/p

  private var phrase = 
}
}
}

This code inserts characters 0 - 65,000 into the string to be sent back to
the browser, including every control character.

Once again, if you have a reproducible case (the exact steps that someone
must follow) to cause Lift to emit illegal XHTML, please open a defect on
Assembla




 Dan

 On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:
  Check dpp's response as of 8:01
 
  -Ross
 
  On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:
 
 
 
   What version is the demo running?
 
   -
   Danoolearydani...@gmail.com wrote:
 
   Just saw that Lift 2.0-M3 was released.  I looked to see if the
   vulnerability was still present in demo.liftweb.net and I am still
   able to generate exceptions in the browser when I paste binary
   characters in the textfields for the Wizard, Wizard Challenge, and Arc
   Challenge examples in the Misc section.
 
   Don't know if this remaining problem is supposed to be handled by the
   application or framework, but thought I would make a post to alert the
   group.
 
   Dan
 
   On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
   The recent scala days conference activity may have cause the updates
   to this thread to escape notice.  Just wondering if there is concern
   about the remaining binary character problems I noted in my prior
   post.
 
   Thanks in advance.
 
   Dan
 
   On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:
 
   More information on this in case anyone is interested.  If you go to
   theliftdemo website, it appears the issue with characters is mostly
   addressed except for the Misc code section.   Specifically, the
   Wizard, Wizard Challenge and Arc Challenge #1 examples will
   generate XML parsing errors.
 
   For these problems, I am not sure if the issue if the example or the
   framework.  If the issue is with the example, it would be good to
 know
   whatLiftapps need to do to avoid getting bitten by binary characters
   entered into form fields.
 
   Thanks in advance.
 
   Dan
 
   On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:
 
   Hello,
 
   I was wondering if the fix for the control characters issue was
   included in 2.0-M2.  I just did a test with ourLiftapplication built
   with 2.0-M2 and I am still seeing problems (i.e. javascript
 exceptions
   - NS_ERROR_INVALID_POINTER).
 
   Thanks in advance.
 
   Dan
 
   On Feb 3, 9:08 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 
   Thanks for pointing that out.  There are other problems as well...
 I'll fix
   them (in both the Scala andLiftdiffs)
 
   On Wed, Feb 3, 2010 at 7:39 AM, Feng Zhang sharpzh...@gmail.com
 wrote:
   I found that in the fix, \n is changed to \t, while \t to \n. Is
 this
   desired behavior?
 
   Thank you,
 
   Feng
 
   On Wed, Feb 3, 2010 at 9:20 AM, Indrajit Raychaudhuri 
 indraj...@gmail.com
   wrote:
 
   1. Fix in head/master (2.0-SNAPSHOT) and prepone 2.0-M2.
 
   2. Backport in 1.0.x branch and spin 1.0.4. We haven't marked
 1.0.x
   'unsupported' yet. Forcing apps to move to 2.0-M2 just for this
   vulnerability fix isn't fun.
 
   Cheers, Indrajit
 
   On 03/02/10 3:34 PM, Timothy Perrett wrote:
 
   +1
 
   Fix it in head, no need to back-port; M2 is only around the
 corner.
 
   Cheers, Tim
 
   On 3 Feb 2010, at 09:49, Jeppe Nejsum Madsen wrote:
 
David Pollakfeeder.of.the.be...@gmail.com  writes:
 
I'd like to get a sense of how important the community views
 this
   defect.
   Is it a backport the fix to every milestone and release
 yesterday or
   is it
   a fix it in 2.0-M2 or someplace in between.
 
   For me, it's fix it in 2.0-SNAPSHOT
 
   /Jeppe
 
   --
   You received this message because you are subscribed to the
 Google
   Groups 

Re: [Lift] Re: Lift security vulnerability

2010-03-05 Thread David Pollak
On Fri, Mar 5, 2010 at 10:26 AM, Dano olearydani...@gmail.com wrote:

 I think I would like to amend my last post by asking if it is possible
 that the lift-json library support the ability to strip out binary
 characters since many times an application uses the results of JSON
 operations to render back to the client.


Control characters are legal in JSON so it's not the place of the library to
strip out control characters.

If you're sending JSON strings that are supposed to be valid XHTML, then
it's up to your app to make sure the Strings are valid.  If you are using
Scala's XML literals and toString, you are hitting a bug in the XML
libraries that render incorrect Strings.  I have fixed the bug in the 2.8
branch, but there's no practical way to go back and make the fix part of
2.7.x.

If you use Lift's AltXML library to convert the XML to String.  Lift's
library also has the patch to ensure that XML - String is valid per this
W3C page: http://www.w3.org/International/questions/qa-controls



 Thanks.


 Dan

 On Mar 5, 9:53 am, Dano olearydani...@gmail.com wrote:
  I can reproduce it in our application, but I think it is not
  necessarily due to Lift.  This is what I am trying to sort out.  We
  have client-side javascript which is sending JSON commands to the
  server and things blow up once things come back from the server.  In
  this case, Lift is not responsible for the rendering so I would say
  this is an application issue.
 
  I am poking at the demo lift application to try to flush out issues
  common to the group and understand what is a framework issue and what
  needs to be addressed by the application.
 
  Thanks.
 
  Dan
 
  On Mar 5, 9:47 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 
 
 
   Can you reproduce the vulnerability in your own M3 app?
 
   -
 
   Danoolearydani...@gmail.com wrote:
 
   I would never claim to be astute.  However, I did observe that
   demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
   bottom of the page.  I also observed that the Wizard example is still
   broken (paste binary characters into 'First Name' and then click the
   Next button).  I have not yet registered for an account with Assembla
   but would be happy to file the bug.
 
   Dan
 
   On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:
 
Check dpp's response as of 8:01
 
-Ross
 
On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:
 
 What version is the demo running?
 
 -
 Danoolearydani...@gmail.com wrote:
 
 Just saw that Lift 2.0-M3 was released.  I looked to see if the
 vulnerability was still present in demo.liftweb.net and I am still
 able to generate exceptions in the browser when I paste binary
 characters in the textfields for the Wizard, Wizard Challenge, and
 Arc
 Challenge examples in the Misc section.
 
 Don't know if this remaining problem is supposed to be handled by
 the
 application or framework, but thought I would make a post to alert
 the
 group.
 
 Dan
 
 On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
 The recent scala days conference activity may have cause the
 updates
 to this thread to escape notice.  Just wondering if there is
 concern
 about the remaining binary character problems I noted in my prior
 post.
 
 Thanks in advance.
 
 Dan
 
 On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:
 
 More information on this in case anyone is interested.  If you go
 to
 theliftdemo website, it appears the issue with characters is
 mostly
 addressed except for the Misc code section.   Specifically, the
 Wizard, Wizard Challenge and Arc Challenge #1 examples will
 generate XML parsing errors.
 
 For these problems, I am not sure if the issue if the example or
 the
 framework.  If the issue is with the example, it would be good to
 know
 whatLiftapps need to do to avoid getting bitten by binary
 characters
 entered into form fields.
 
 Thanks in advance.
 
 Dan
 
 On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:
 
 Hello,
 
 I was wondering if the fix for the control characters issue was
 included in 2.0-M2.  I just did a test with ourLiftapplication
 built
 with 2.0-M2 and I am still seeing problems (i.e. javascript
 exceptions
 - NS_ERROR_INVALID_POINTER).
 
 Thanks in advance.
 
 Dan
 
 On Feb 3, 9:08 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 
 Thanks for pointing that out.  There are other problems as
 well... I'll fix
 them (in both the Scala andLiftdiffs)
 
 On Wed, Feb 3, 2010 at 7:39 AM, Feng Zhang 
 sharpzh...@gmail.com wrote:
 I found that in the fix, \n is changed to \t, while \t to \n.
 Is this
 desired behavior?
 
 Thank you,
 
 Feng
 
 On Wed, Feb 3, 2010 at 9:20 AM, Indrajit Raychaudhuri 
 indraj...@gmail.com
 wrote:
 
 

Re: [Lift] Re: Wow... Lift has some amazing stats

2010-03-05 Thread Timothy Perrett
Me too Marius... what the team has achieved is absolutely amazing. Without a 
shadow of a doubt being part of this amazing team has changed my life and im 
very, very proud to be a part of it. Long may it continue :-)

Cheers, Tim

On 5 Mar 2010, at 18:15, Marius wrote:

 I'm sooo proud being a little part of it ;)
 
 On 5 mar., 19:46, David Pollak feeder.of.the.be...@gmail.com wrote:
 Folks,
 
 I just looked at Lift's stats on ohloh.  (http://www.ohloh.net/p/liftweb)
 A couple of key items:
 
 Very large, active development team
 
 Over the past twelve months, 33
 developershttp://www.ohloh.net/p/liftweb/contributorscontributed new
 code to
  Lift http://www.ohloh.net/p/liftweb.
 
 This is one of the largest open-source teams in the world, and is in the top
 2% of all project teams on Ohloh.
 
 For this measurement, Ohloh considered only recent changes to the code. Over
 the entire history of the project, 45 developers have contributed.
 Increasing year-over-year development activity
 
 Over the last twelve months, Lift http://www.ohloh.net/p/liftweb has seen
 a substantial increase in activity. This is probably good sign that interest
 in this project is rising, and that the open source community has embraced
 this project.
 
 Ohloh makes this determination by comparing total number of commits made by
 all developers during the most recent twelve months with the same figure for
 the twelve months before that. The number of developers and total lines of
 code are not considered.
 So, a big thanks to the community for driving Lift and another big thanks to
 the Lift committers for adding so much to Lift!
 
 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 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: Lift security vulnerability

2010-03-05 Thread Timothy Perrett
Agreed - it works fine even with double byte characters...

Cheers, Tim

On 5 Mar 2010, at 18:41, David Pollak wrote:

 I don't know what you mean by pasting binary characters

-- 
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: LiftRules.rewrite, 404 error

2010-03-05 Thread Timothy Perrett
Why do you have // in the URL?

Cheers, Tim

On 4 Mar 2010, at 13:34, Gang wrote:

 Could somebody answer my question?  If it's too stupid a question to
 answer, please let me know that too.  It just seems to me that unless
 I add a link to SiteMap, the links(a tag) in my page just return
 404.  And I tried following URL rewrite without adding link to
 SiteMap, still 404 error.
 
 Thanks
 
 On Feb 28, 6:20 pm, Gang wangga...@gmail.com wrote:
 All,
 
 I have this rewrite returning 404 error.  Here are what I did:
 
 URL:  ../app-context-path//images/CBDU-1098-BCV?F1115261516749FQD=_
 
 Template:  src/main/webapp/viewImages.html
 
 LiftRules.rewrite.append( {
   case RewriteRequest(ParsePath(images :: sku :: Nil, _, _,_),
 _, _) =
 RewriteResponse(viewImages :: Nil, Map(imageId -
 sku))
 } )
 
 Are there any other settings I need to set?  I have looked around but
 couldn't find any other than the basics listed above.  Thanks in
 advance!
 
 -- 
 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: Response Optimizations too aggressive

2010-03-05 Thread Timothy Perrett
This really needs to go on the wiki! gold!

Cheers, Tim

On 4 Mar 2010, at 17:50, David Pollak wrote:

 
 
 On Thu, Mar 4, 2010 at 9:27 AM, aw anth...@whitford.com wrote:
 On Mar 4, 6:56 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
  How about
  LiftRules.stripComments.default.set( () = !Req.isIE)
  etc.?
 
 This is where Lift's FactoryMaker shines.  You can modify the behavior of 
 stripComments on a request-by-request basis.  You can have a snippet called 
 from your default template that tests the request and does:
 
 LiftRules.stripComments.request.set(S.request.map(!_.isIE) openOr false)
 
 But, as you point out, that means that CometActors will not get the right 
 settings... so you can set the rule on a session-by-session basis:
 
 LiftRules.stripComments.request.set(S.request.map(!_.isIE) openOr false)
 
 If that's not enough, you could also do the following in Boot.scala:
 
 object shouldStripComments extends SessionVar(S.request.map(!_.isIE) openOr 
 false)
 
 S.addAround(List(new LoanWrapper {
   def apply[T](f: = T): T = 
 LiftRules.stripComments.doWith(shouldStripComments.is)(f)
 }))
  
 The above code wraps each request with access to the shouldStripComments 
 Session Variable.
 
 The above vomit of different options is more for the benefit of those that 
 are confused by FactoryMaker and why it seems so complex... it's because it 
 offers a ton of different flexibility.
 
 Thanks,
 
 David
 
 
 Well, this doesn't quite work because I need a Req class instance, not
 just the static object.
 Also, to me, this determination is really at the Session level rather
 than the Request level as I don't expect it to change.  But of course
 I don't have a Session.isIE field...  What about Comet responses?  I
 have no Request in that scenario, but is it using the same code to
 produce the xhtml?
 
 I see that the Factory trait has a session-specific Maker and a
 request-specific Maker, but it is unclear to me how I can get that
 context.  I require more guidance.
 
 --
 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] Re: File Download

2010-03-05 Thread DavidV
I have recreated a number of StreamingResponse methods from both the
Loop link above and the Lift book and I still can't seem to get the
desired effect.  I have been able to get a PlainTextResponse to work
by using LiftRules.dispatch in the Boot, like so:

LiftRules.dispatch.prepend {
  case Req((analysis :: inprocess :: Nil), _, _) =
() = Full(PlainTextResponse(test))
}

However, I am unable to get any sort of streaming response to work in
the particular snippet which contains the data I would like to use.
Here are some of the methods I've tried:

  def textResponse: Box[LiftResponse] = {
println(TEXT RESPONSE)
val ab = text would go here
Full(PlainTextResponse(ab,
  (Content-Type - text/plain) :: Nil, 200
))
  }

  def streamingResponseFile: Box[LiftResponse] = {
println(STREAMING RESPONSE FILE)
val file: File = new File(
C:\\Source\\trunk\\eclipse\\testLift\\src\\main\\webapp\\images\
\ultra.png
)
val length = file.length
val fileInput = new java.io.FileInputStream(file)
Full(StreamingResponse(fileInput,
  () = { fileInput.close },
  length,
  (Content-Type - image/png) :: Nil,
  Nil,
  200)
)
  }

Do I have to make a LiftRules.dispatch function in the Boot in
addition to the StreamingResponse in my snippet?

I am trying to download plain text, but it is variable and dependent
on some parameters and other variables in the particular Snippet
class.  Would I have to pass that data into the boot method in order
to get the desired response?  I would prefer to handle it entirely in
the snippet itself.

Finally, I'm not really sure how exactly to handle the
Full(StreamingResponse) once I have created it in order to actually
download the data and save it to the client computer.  Although I
assume the browser will handle this one I've formatted the Response
correctly and actually have it working.

Thanks again,
David

On Mar 4, 11:13 am, Marius marius.dan...@gmail.com wrote:
 If you want todownloadthrough Lift than yes you can use
 StreamingResponse, or simply any other LiftResponse (depending on your
 mime-type) and use LiftRules.dispatch mechanism. But you could also
 let the container to serve thefile. By default Lift is trying to
 serve .html, .xhtml, .htm, .xml etc.. You can write your own rules by
 setting

 LiftRules.liftRequest = {
   case req = true // Pattern match whatever you like and return a
 Boolean

 }

 If Lift cannot find a resource for some reason and you want the
 container (or subsequent filters) to handle that you can set

 LiftRules.passNotFoundToChain = true

 On 4 mar., 17:09, DavidV david.v.villa...@gmail.com wrote:

  I am also looking todownloadafilefrom the server that is hosting
  my Lift web app.  There is a very useful fileUpload method in the
  SHtml class and I was wondering if there may be something similar for
  afiledownload?  I was unable to find anything, and searching for
  Lift or Scala Liftdownload on Google returns nothing but pages to
 downloadthe libraries, plugins or source code.  I suppose I could use
  the StreamingResponse, but I am already saving thefileI need to the
  server and it would be nice to be able todownloadit to any client
  computer with the typical Browse button, similar to the upload,
  Thanks,
  David

  On Feb 14, 3:58 pm, Gang wangga...@gmail.com wrote:

   Thanks Tim, that's exactly what I'm looking for!

   On Feb 14, 11:27 am, Timothy Perrett timo...@getintheloop.eu wrote:

See:

   http://blog.getintheloop.eu/2009/3/19/understanding-lift-s-streamingr...

Construct the CSV in memory and just then stuff it into a streaming 
response as a byte array.

Cheers, Tim

On 14 Feb 2010, at 16:18, Gang wrote:

 Hi,

 I have a question and it may not be a pure Lift one.  But since I'm
 working on a Lift app and this group is the most responsive one I have
 seen, might just try it here.

 I need todownloaddata from database in CSV format.  What is the best
 approach within Lift framework?  Do I have to write the data on the
 server somewhere and then provide user with a link?  I have tried to
 google scala, lift,filedownload..., but could not come up with
 what I'm looking for.  Maybe I didn't use the right key words in
 search?  Thanks in advance!

 Brs
 Gang

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

- Show quoted text -

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

[Lift] Re: Lift security vulnerability

2010-03-05 Thread Dano
I should have been more clear on 'pasting binary characters'.  At the
url http://www.webmasterworld.com/forum39/1098.htm, they talk about an
issue with binary characters.  I copied the 'square character' text
(which I have confirmed are binary) from that page into the Wizard
example on the demo lift site.

As to JSON, our client side code is sending JSON containing what the
user entered in the form.  Based on the above, it sounds like we
should strip the binary characters when processing the JSON commands.

Thanks.


Dan


On Mar 5, 10:49 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Fri, Mar 5, 2010 at 10:26 AM, Dano olearydani...@gmail.com wrote:
  I think I would like to amend my last post by asking if it is possible
  that the lift-json library support the ability to strip out binary
  characters since many times an application uses the results of JSON
  operations to render back to the client.

 Control characters are legal in JSON so it's not the place of the library to
 strip out control characters.

 If you're sending JSON strings that are supposed to be valid XHTML, then
 it's up to your app to make sure the Strings are valid.  If you are using
 Scala's XML literals and toString, you are hitting a bug in the XML
 libraries that render incorrect Strings.  I have fixed the bug in the 2.8
 branch, but there's no practical way to go back and make the fix part of
 2.7.x.

 If you use Lift's AltXML library to convert the XML to String.  Lift's
 library also has the patch to ensure that XML - String is valid per this
 W3C page:http://www.w3.org/International/questions/qa-controls





  Thanks.

  Dan

  On Mar 5, 9:53 am, Dano olearydani...@gmail.com wrote:
   I can reproduce it in our application, but I think it is not
   necessarily due to Lift.  This is what I am trying to sort out.  We
   have client-side javascript which is sending JSON commands to the
   server and things blow up once things come back from the server.  In
   this case, Lift is not responsible for the rendering so I would say
   this is an application issue.

   I am poking at the demo lift application to try to flush out issues
   common to the group and understand what is a framework issue and what
   needs to be addressed by the application.

   Thanks.

   Dan

   On Mar 5, 9:47 am, Naftoli Gugenheim naftoli...@gmail.com wrote:

Can you reproduce the vulnerability in your own M3 app?

-

Danoolearydani...@gmail.com wrote:

I would never claim to be astute.  However, I did observe that
demo.liftweb.net is now built using 2.0-M3 as is clearly listed at the
bottom of the page.  I also observed that the Wizard example is still
broken (paste binary characters into 'First Name' and then click the
Next button).  I have not yet registered for an account with Assembla
but would be happy to file the bug.

Dan

On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:

 Check dpp's response as of 8:01

 -Ross

 On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:

  What version is the demo running?

  -
  Danoolearydani...@gmail.com wrote:

  Just saw that Lift 2.0-M3 was released.  I looked to see if the
  vulnerability was still present in demo.liftweb.net and I am still
  able to generate exceptions in the browser when I paste binary
  characters in the textfields for the Wizard, Wizard Challenge, and
  Arc
  Challenge examples in the Misc section.

  Don't know if this remaining problem is supposed to be handled by
  the
  application or framework, but thought I would make a post to alert
  the
  group.

  Dan

  On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
  The recent scala days conference activity may have cause the
  updates
  to this thread to escape notice.  Just wondering if there is
  concern
  about the remaining binary character problems I noted in my prior
  post.

  Thanks in advance.

  Dan

  On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:

  More information on this in case anyone is interested.  If you go
  to
  theliftdemo website, it appears the issue with characters is
  mostly
  addressed except for the Misc code section.   Specifically, the
  Wizard, Wizard Challenge and Arc Challenge #1 examples will
  generate XML parsing errors.

  For these problems, I am not sure if the issue if the example or
  the
  framework.  If the issue is with the example, it would be good to
  know
  whatLiftapps need to do to avoid getting bitten by binary
  characters
  entered into form fields.

  Thanks in advance.

  Dan

  On Feb 17, 11:06 am, Dano olearydani...@gmail.com wrote:

  Hello,

  I was wondering if the fix for the control characters issue was
  included in 2.0-M2.  I just did a test with ourLiftapplication
  built
  

Re: [Lift] BSON support in lift-json

2010-03-05 Thread Ross Mellgren
The JSON stuff is mostly just an AST and encoding/decoding from the JSON wire 
format is almost just an addon. Then, it would be a matter of adding AST 
objects for those new things. Could be a use for phantom types ;-)

I'd be interested to hear Joni's view on how it might fit, since he's the most 
familiar.

-Ross

On Mar 5, 2010, at 1:26 PM, Tim Nelson wrote:

 I definitely agree with keeping the BSON code separate or possibly
 having a strict JSON mode.
 
 Tim
 
 On Fri, Mar 5, 2010 at 12:13 PM, Timothy Perrett
 timo...@getintheloop.eu wrote:
 Probably a sub-ordinate module would be preferable... one  that builds on 
 the lift-json stuff and doesn't pollute the normal JSON usage.
 
 Joni, what are your thoughts?
 
 Cheers, Tim
 
 On 5 Mar 2010, at 17:59, Tim Nelson wrote:
 
 I finally had the opportunity to look into the couchdb code and I must
 say it is rather impressive.
 
 I would like to utilize the code in JSONRecord.scala in scamongo [1].
 However, MongoDB uses a variation of JSON they call BSON, which they
 actually just published a spec [2] for, due to interest outside of
 MongoDB. Basically, it adds support for date, ObjectId [3], binary
 data, regular expressions, and code (JavaScript) data types.
 
 My question is, what would it take to add support to lift-json for
 these other data types? Is this even feasible?
 
 Thanks,
 Tim
 
 
 [1] http://github.com/eltimn/scamongo
 [2] http://bsonspec.org/
 [3] http://www.mongodb.org/display/DOCS/Object+IDs
 
 --
 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] Re: Lift security vulnerability

2010-03-05 Thread David Pollak
On Fri, Mar 5, 2010 at 12:06 PM, Dano olearydani...@gmail.com wrote:

 I should have been more clear on 'pasting binary characters'.  At the
 url http://www.webmasterworld.com/forum39/1098.htm, they talk about an
 issue with binary characters.  I copied the 'square character' text
 (which I have confirmed are binary) from that page into the Wizard
 example on the demo lift site.


Dan,

And I did the same thing and it caused no problems.  I also modified the
example code to print out the characters and they were in fact control
characters (1 and 4).  They can through the other side (back to my browser)
stripped from the XHTML.

As I said, if there is a reproducible case that you can show against Lift
2.0-M3 or 2.0-SNAPSHOT, open a ticket.  However, in the future, please do
not expect that I'll spend any more of my time addressing your issues.

David



 As to JSON, our client side code is sending JSON containing what the
 user entered in the form.  Based on the above, it sounds like we
 should strip the binary characters when processing the JSON commands.

 Thanks.


 Dan


 On Mar 5, 10:49 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Fri, Mar 5, 2010 at 10:26 AM, Dano olearydani...@gmail.com wrote:
   I think I would like to amend my last post by asking if it is possible
   that the lift-json library support the ability to strip out binary
   characters since many times an application uses the results of JSON
   operations to render back to the client.
 
  Control characters are legal in JSON so it's not the place of the library
 to
  strip out control characters.
 
  If you're sending JSON strings that are supposed to be valid XHTML, then
  it's up to your app to make sure the Strings are valid.  If you are using
  Scala's XML literals and toString, you are hitting a bug in the XML
  libraries that render incorrect Strings.  I have fixed the bug in the 2.8
  branch, but there's no practical way to go back and make the fix part of
  2.7.x.
 
  If you use Lift's AltXML library to convert the XML to String.  Lift's
  library also has the patch to ensure that XML - String is valid per this
  W3C page:http://www.w3.org/International/questions/qa-controls
 
 
 
 
 
   Thanks.
 
   Dan
 
   On Mar 5, 9:53 am, Dano olearydani...@gmail.com wrote:
I can reproduce it in our application, but I think it is not
necessarily due to Lift.  This is what I am trying to sort out.  We
have client-side javascript which is sending JSON commands to the
server and things blow up once things come back from the server.  In
this case, Lift is not responsible for the rendering so I would say
this is an application issue.
 
I am poking at the demo lift application to try to flush out issues
common to the group and understand what is a framework issue and what
needs to be addressed by the application.
 
Thanks.
 
Dan
 
On Mar 5, 9:47 am, Naftoli Gugenheim naftoli...@gmail.com wrote:
 
 Can you reproduce the vulnerability in your own M3 app?
 
 -
 
 Danoolearydani...@gmail.com wrote:
 
 I would never claim to be astute.  However, I did observe that
 demo.liftweb.net is now built using 2.0-M3 as is clearly listed at
 the
 bottom of the page.  I also observed that the Wizard example is
 still
 broken (paste binary characters into 'First Name' and then click
 the
 Next button).  I have not yet registered for an account with
 Assembla
 but would be happy to file the bug.
 
 Dan
 
 On Mar 4, 7:33 pm, Ross Mellgren dri...@gmail.com wrote:
 
  Check dpp's response as of 8:01
 
  -Ross
 
  On Mar 4, 2010, at 7:49 PM, Naftoli Gugenheim wrote:
 
   What version is the demo running?
 
   -
   Danoolearydani...@gmail.com wrote:
 
   Just saw that Lift 2.0-M3 was released.  I looked to see if the
   vulnerability was still present in demo.liftweb.net and I am
 still
   able to generate exceptions in the browser when I paste binary
   characters in the textfields for the Wizard, Wizard Challenge,
 and
   Arc
   Challenge examples in the Misc section.
 
   Don't know if this remaining problem is supposed to be handled
 by
   the
   application or framework, but thought I would make a post to
 alert
   the
   group.
 
   Dan
 
   On Feb 24, 11:49 am, Dano olearydani...@gmail.com wrote:
   The recent scala days conference activity may have cause the
   updates
   to this thread to escape notice.  Just wondering if there is
   concern
   about the remaining binary character problems I noted in my
 prior
   post.
 
   Thanks in advance.
 
   Dan
 
   On Feb 22, 1:34 pm, Dano olearydani...@gmail.com wrote:
 
   More information on this in case anyone is interested.  If
 you go
   to
   theliftdemo website, it appears the issue with characters is
   mostly
   addressed except 

[Lift] passwordReset bug or misunderstanding?

2010-03-05 Thread David Dearing
I'm a relative Lift newbie, but encountered something that seems like
an error or could just be a misunderstanding on my part.

In MetaMegaProtoUser's passwordReset(id: String) method, there is a
call to user.uniqueId.reset().save that occurs when the page loads and
a user is found.

Since the uniqueId is reset when the page is first visited (instead of
after validating the new password), any errors that occur (e.g.
password too short) are not shown because:

1. on error the page loads
2. the uniqueId (which is also the URL) no longer matches
3. the default case occurs, replacing the error with
password.link.invalid
4. the user to the homePage

It seems much more intuitive that the user should see the error and
stay on the password reset page.  Instead, I suggest moving the
user.uniqueId.reset().save call into the user.validate match on Nil,
replacing the simple user.save call.

dave

-- 
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 or Scala first?

2010-03-05 Thread Mini Naim
Hi guys:
I have a simple question, it's necessary to learn Scala first? or i
can go with Lift framework, without learn Scala language?

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.



Re: [Lift] Lift or Scala first?

2010-03-05 Thread Mads Hartmann Jensen
I would say it would be very wise to get the basics of scala before diving into 
Lift :) 

On 05/03/2010, at 18.19, Mini Naim wrote:

 Hi guys:
 I have a simple question, it's necessary to learn Scala first? or i
 can go with Lift framework, without learn Scala language?
 
 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.
 

-- 
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 or Scala first?

2010-03-05 Thread Lukasz Kuczera
As i posted in other thread lift is uber complex until you wrap your
head around it then its stupid simple. Scala is static so there is not
as much magic happening around as in groovy/ruby. But on the other
hand if you have any functional background it might be the good
option.

On Mar 5, 6:19 pm, Mini Naim minin...@gmail.com wrote:
 Hi guys:
 I have a simple question, it's necessary to learn Scala first? or i
 can go with Lift framework, without learn Scala language?

 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: Lift or Scala first?

2010-03-05 Thread Peter Robinett
Yes, yes, yes! David's book was a fantastic guide for me as I learned
Scala and Lift at the same time.

Going back to the original question, I've learned a language and a
framework at the same time twice (Lift and Scala, Pylons and Python)
and I'm torn. On one hand having lots of high quality example code and
defined goals really helped guide my learning but on the other hand
you have that much more to learn at all once. I guess it really
depends on your style of learning.

Just my two cents...

Peter

On Mar 5, 2:23 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
 I highly recommend first you read chapter 1-5 of Beginning Scala by
 David Pollak.

 then you are ready to start working through lift's tutorial, samples, etc.

 On Fri, Mar 5, 2010 at 12:19 PM, Mini Naim minin...@gmail.com wrote:
  Hi guys:
  I have a simple question, it's necessary to learn Scala first? or i
  can go with Lift framework, without learn Scala language?

  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 
  athttp://groups.google.com/group/liftweb?hl=en.

 --
 Omnem crede diem tibi diluxisse supremum.

-- 
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: LiftRules.rewrite, 404 error

2010-03-05 Thread Gang
That was just a typo, when I manually typed in the word app-context-
path.  Here is the real one,
http://localhost:8080/com.bestem_inventory_war_1.0-SNAPSHOT/images/CBDU-1098-BCV?F4219154671502KB=_

I compared this URL with the one coming with CRUDify, the Edit link.
There is nothing different except the Edit link works.  All I want is
a Show Image link on a page, when clicking goes to another page to
display a list of images.  Is using LiftRules.rewrite the right way to
go?

thanks

On Mar 5, 2:27 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Why do you have // in the URL?

 Cheers, Tim

 On 4 Mar 2010, at 13:34, Gang wrote:



  Could somebody answer my question?  If it's too stupid a question to
  answer, please let me know that too.  It just seems to me that unless
  I add a link to SiteMap, the links(a tag) in my page just return
  404.  And I tried following URL rewrite without adding link to
  SiteMap, still 404 error.

  Thanks

  On Feb 28, 6:20 pm, Gang wangga...@gmail.com wrote:
  All,

  I have this rewrite returning 404 error.  Here are what I did:

  URL:  ../app-context-path//images/CBDU-1098-BCV?F1115261516749FQD=_

  Template:  src/main/webapp/viewImages.html

  LiftRules.rewrite.append( {
        case RewriteRequest(ParsePath(images :: sku :: Nil, _, _,_),
  _, _) =
              RewriteResponse(viewImages :: Nil, Map(imageId -
  sku))
      } )

  Are there any other settings I need to set?  I have looked around but
  couldn't find any other than the basics listed above.  Thanks in
  advance!

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

2010-03-05 Thread aw
Is there a way to get a consolidated scaladocs for 2.0-M3, just like
http://scala-tools.org/scaladocs/liftweb/1.0/ ?
The above link, for example, is just for common.
It is a major pain to have to traverse through the various projects
finding the right package, and the 1.0 docs are too out of date.

-- 
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 or Scala first?

2010-03-05 Thread David Pollak
Try working through:
http://liftweb.net/docs/getting_started/mod_master.html

If you find yourself confused about stuff at the language/syntax level, then
by all means, buy my book. ;-)

On Fri, Mar 5, 2010 at 2:42 PM, Peter Robinett pe...@bubblefoundry.comwrote:

 Yes, yes, yes! David's book was a fantastic guide for me as I learned
 Scala and Lift at the same time.

 Going back to the original question, I've learned a language and a
 framework at the same time twice (Lift and Scala, Pylons and Python)
 and I'm torn. On one hand having lots of high quality example code and
 defined goals really helped guide my learning but on the other hand
 you have that much more to learn at all once. I guess it really
 depends on your style of learning.

 Just my two cents...

 Peter

 On Mar 5, 2:23 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
  I highly recommend first you read chapter 1-5 of Beginning Scala by
  David Pollak.
 
  then you are ready to start working through lift's tutorial, samples,
 etc.
 
  On Fri, Mar 5, 2010 at 12:19 PM, Mini Naim minin...@gmail.com wrote:
   Hi guys:
   I have a simple question, it's necessary to learn Scala first? or i
   can go with Lift framework, without learn Scala language?
 
   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.comliftweb%2bunsubscr...@googlegroups.com
 .
   For more options, visit this group athttp://
 groups.google.com/group/liftweb?hl=en.
 
  --
  Omnem crede diem tibi diluxisse supremum.

 --
 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] 2.0-M3 SLF4J Logging

2010-03-05 Thread aw
I just upgraded my code to M3 and also replaced my LOGGERs with the
new Loggable trait.  I am using LogBack (not Log4j).

I thought that with 2.0-M3, the following call would be deprecated and
no longer necessary:  Slf4jLogBoot.enable()
Alas, I discovered that it is still mandatory, otherwise I get a
NoClassDefFound exception for org.apache.log4j.Priority.
I thought SLF4J was enabled already, so I don't know why I need to
explicitly enable it.

Secondly, if you read the Wiki:  
http://wiki.github.com/dpp/liftweb/logging-in-lift
It says to exclude org.slf4j:slf4j-log4j12 from lift-mapper.
But I noticed that it is lift-webkit that has the dependency
(transitively from net.liftweb:lift-util) that needs to be excluded.
As a result, I have this instead:

dependency
groupIdnet.liftweb/groupId
artifactIdlift-webkit/artifactId
version2.0-M3/version
exclusions
exclusion
groupIdorg.slf4j/groupId
artifactIdslf4j-log4j12/artifactId
/exclusion
/exclusions
/dependency

I recommend updating the wiki entry.

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] 2.0-M3 JQuery 1.4

2010-03-05 Thread aw
I understand from Issue 363 that I can control which version of JQuery
to use.  I generally prefer the latest and greatest, and I see that I
am using 1.3.2, so I want to set it to 1.4.2.  According to this
thread:

http://groups.google.com/group/liftweb/browse_thread/thread/807a9397f1e3fa9?hl=en_US
I thought it was as easy as adding this line to boot:
LiftRules.jsArtifacts = JQuery14Artifacts

Alas, this doesn't seem to work for me as I am still getting 1.3.2...

Also, I see that Issue 311, which was closed in 2.0-M2, says that
1.4.1 is the default.  But I don't think that was the case, right?

Can somebody please tell me what I am missing?  This strikes me as a
good Wiki topic.  ;-)

-- 
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] superficial first impressions from a rails junkie

2010-03-05 Thread cageface
Like many other web developers, I abandoned some heavyweight Java web
frameworks about 6 years ago for Rails and have been working pretty
much exclusively in Rails ever since. However, I've always had a
secret lust for functional languages so when I heard about Scala and
Lift I decided to take a closer look. My first impression of the
community from studying this list and many other blogs, articles etc
is that it's a group of smart, dedicated folks that have generously
dedicated a lot of time and energy to making Lift a first-class
alternative to the more conventional options.

However, my first brush with the framework itself has so far left a
very different impression. I think one of the reasons Rails caught on
so quickly in the beginning was that it was marketed brilliantly. DHH
made Rails look so simple, stylish and intuitive that anybody drowning
in the bulk and complexity of Java web dev at the time couldn't help
but take notice. Lift, in contrast, and particularly for anybody with
a prior history in Java, seems very daunting and rough. The following
impressions are very much superficial first impressions and may really
have no deeper substance than that but I think first impressions count
for a lot in this sphere.

First, the liftweb.net site is nice. It's a clean, elegant,
contemporary design. So far so good. Let's click on getting started.
What's this? PDF? Who uses PDF? Nevermind, let's look at the HTML.
Gack! This looks like an academic LaTEX conversion from the 90s.
Layout and formatting are next to non-existent. This doesn't look like
the intro for a simple, ready-to-use tool.

Oh well, pushing past the wall of text intro we discover that we need
Maven. Alarms are starting to go off in the heads of many Java
refugees that remember Maven as the nadir of the XML-situp
overabstracted agony that was pre-Rails Java web dev. I imagine many
people have signed off by this point. We go download maven and press
on to the first actual command we can run, which is an impressively
cryptic 8-line mvn invocation that seems to take about 10 minutes to
download every single apache and codehaus jar file.

When this finally winds down we start the server and take a look at
our homely start page and bounce back to the docs. XHTML. Hmmm. Didn't
everybody give up on that a few years ago? HTML literals *in* the
code? All the snippets we're going to be editing live six levels
deep in the project directory structure? This will be fun with emacs/
vim...

By this point our enthusiasm is seriously waning but our dreams of an
expressive but statically typed platform keep us going on to the next
section anyway. We begin with another mvn invocation that mysteriously
fails. After futzing with it for a bit and googling around we discover
that there are spaces following each of the \ line continuations so we
copy and paste the whole thing into a file, clean it up, and invoke it
via sh. After this finishes we create the first model, which actually
looks pretty reasonable, similar to a Django model with a little more
boilerplate but nothing too intimidating. We discover to our chagrin
that we're going to have to manually add each model to the toplevel
Schemifier invocation in Boot.scala, which makes us grumpy. We skim
through the explanation of the views and we're not sure what to make
of the html binding approach. On one hand it looks pretty precise. On
the other hand it suggests an even tighter straightjacket than Django
templates. We reserve judgement.

We work through the next few instructions to come to the creation of
TD.scala only to be greeted by a *19* line file header:
package com.liftworkshop.snippet

import com.liftworkshop._
import model._

import net.liftweb._
import http._
import SHtml._
import S._

import js._
import JsCmds._

import mapper._

import util._
import Helpers._

import scala.xml.{NodeSeq, Text}

And at this point we give up and start quickly paging through the rest
of the tutorial only to come to this:
object priority extends MappedInt(this) {
   override def defaultValue = 5

   override def validations = validPriority _ :: super.validations

   def validPriority(in: Int): List[FieldError] =
   if (in  0  in = 10) Nil
   else List(FieldError(this, bPriority must be 1-10/b))

   override def _toForm = Full(select(ToDo.priorityList,
Full(is.toString),
f = set(f.toInt)))
 }

and we suddenly find a new appreciation for :validates_numericality_of
and we also wonder why our model should be specifying it's
representation in the form and we decide to go googling for whatever
the Scala equivalent of Sinatra is.

I apologize if this seems flippant but I really think that a lot of
people won't even push on this far, never mind having to do the
homework of learning the basics of scala first. I know that docs and
introductory materials aren't usually that much fun to work on and I
can imagine that the framework itself is much more polished and

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-05 Thread Luke Nezda
Hello,

Bumping my own post since I hadn't received any feedback on this in a
few weeks.  Maybe I didn't describe my issue well ?

Thanks in advance,
- Luke

On Feb 21, 8:12 pm, Luke  Nezda lne...@gmail.com wrote:
 Hello,

 I am new to Scala and Lift.  I am having a problem using 2 features
 together which seem to work fine individually.  Here's a simplified
 piece of the code:

 class Ajax {
   def someResult(q:String) = spansome results for query {q}.../
 span
   // searchField closure
   def searchField(xhtml: NodeSeq): NodeSeq = {
     // build up an ajax text box
     def doSearch(msg: NodeSeq) = {
       // doesn't compile with bind: searchBox -% doSearch _
       FocusOnLoad(SHtml.ajaxText(, q = SetHtml(resultz,
 someResult(q
       // compiles with bind: searchBox -% doSearch _
       // SHtml.ajaxText(, q = SetHtml(resultz, someResult(q)))
     }
     // bind the view to the functionality
     bind(ajax, xhtml,
          searchBox - doSearch _
          // doesn't compile if doSearch returns result of FocusOnLoad
          //searchBox -% doSearch _
          )
   }

 }

 and the template invocation:

 lift:surround with=default at=content
   lift:Ajax.searchField id_msgs=messages
       ajax:searchBox class=text type=search tabindex=1 /
       hr class=space/
       div id=resultz/div
       div id=messages/div
   /lift:Ajax.searchField
 /lift:surround

 My goal is an Ajax-enabled text input that gets focus when the page
 loads and has various attributes of the input element set.  I realize
 I can use the SHtml.ajaxText variant that takes attribute-value pairs,
 as in:

   FocusOnLoad(SHtml.ajaxText(, q = SetHtml(resultz,
 Yawni.query(q)), (class, text), (type, search), (tabindex,
 1)))

 but I'm trying to keep the various element attributes in the template.

 When I try to bind with:
   searchBox -% doSearch _
 instead of:
   searchBox - doSearch _

 I get the following compile error:

 snippet/Ajax.scala:109: error: overloaded method value -% with
 alternatives ((scala.xml.NodeSeq) =
 scala.xml.Elem)net.liftweb.util.Helpers.FuncBindParam and
 (Option[scala.xml.Elem])net.liftweb.util.Helpers.FuncBindParam and
 (net.liftweb.common.Box[scala.xml.Elem])net.liftweb.util.Helpers.FuncBindParam
 and (scala.xml.Elem)net.liftweb.util.Helpers.FuncBindParam cannot be
 applied to ((scala.xml.NodeSeq) = scala.xml.NodeSeq)
          searchBox -% doSearch _
                      ^
 one error found

 Between all the bind() and -()/-%() overloads and my general Scala /
 Lift ignorance, I can't understand what the right way to resolve this
 is.  I think it has something to do with FocusOnLoad returning a
 NodeSeq (input/script/) vs. an Element, but I don't know where to
 go from here...

 Thanks in advance,
 - Luke

-- 
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] superficial first impressions from a rails junkie

2010-03-05 Thread Warren Henning
tl;dr

Want a cookie for your efforts?

If you don't like Lift, don't use it. Problem solved. Hooray, turkey
for everyone!

-- 
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: superficial first impressions from a rails junkie

2010-03-05 Thread ngocdaothanh
I think with its power and number of developers, Lift can have a
better home page. At least better than this because it only has one
developer:
http://nitrogenproject.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: Problem with FocusOnLoad and passing attributes through bind

2010-03-05 Thread Marius


On 22 feb., 04:12, Luke  Nezda lne...@gmail.com wrote:
 Hello,

 I am new to Scala and Lift.  I am having a problem using 2 features
 together which seem to work fine individually.  Here's a simplified
 piece of the code:

 class Ajax {
   def someResult(q:String) = spansome results for query {q}.../
 span
   // searchField closure
   def searchField(xhtml: NodeSeq): NodeSeq = {
     // build up an ajax text box
     def doSearch(msg: NodeSeq) = {
       // doesn't compile with bind: searchBox -% doSearch _
       FocusOnLoad(SHtml.ajaxText(, q = SetHtml(resultz,
 someResult(q
       // compiles with bind: searchBox -% doSearch _
       // SHtml.ajaxText(, q = SetHtml(resultz, someResult(q)))
     }
     // bind the view to the functionality
     bind(ajax, xhtml,
          searchBox - doSearch _
          // doesn't compile if doSearch returns result of FocusOnLoad
          //searchBox -% doSearch _
          )
   }

 }

 and the template invocation:

 lift:surround with=default at=content
   lift:Ajax.searchField id_msgs=messages
       ajax:searchBox class=text type=search tabindex=1 /
       hr class=space/
       div id=resultz/div
       div id=messages/div
   /lift:Ajax.searchField
 /lift:surround

 My goal is an Ajax-enabled text input that gets focus when the page
 loads and has various attributes of the input element set.  I realize
 I can use the SHtml.ajaxText variant that takes attribute-value pairs,
 as in:

   FocusOnLoad(SHtml.ajaxText(, q = SetHtml(resultz,
 Yawni.query(q)), (class, text), (type, search), (tabindex,
 1)))

 but I'm trying to keep the various element attributes in the template.

 When I try to bind with:
   searchBox -% doSearch _
 instead of:
   searchBox - doSearch _

 I get the following compile error:

 snippet/Ajax.scala:109: error: overloaded method value -% with
 alternatives ((scala.xml.NodeSeq) =
 scala.xml.Elem)net.liftweb.util.Helpers.FuncBindParam and
 (Option[scala.xml.Elem])net.liftweb.util.Helpers.FuncBindParam and
 (net.liftweb.common.Box[scala.xml.Elem])net.liftweb.util.Helpers.FuncBindPa 
 ram
 and (scala.xml.Elem)net.liftweb.util.Helpers.FuncBindParam cannot be
 applied to ((scala.xml.NodeSeq) = scala.xml.NodeSeq)
          searchBox -% doSearch _
                      ^
 one error found

Why your doSearch function takes a msg parameter? ... it doesn't seam
to use it.

 doSearch _ is a partially applied function and acts as a (NodeSeq) =
NodeSeq however -% has only a definition like:

def -%(in: NodeSeq = Elem)

while  - also has

def -(in: NodeSeq = NodeSeq)

which is why you get the compile error. We should add the same
definition for NodeSeq = NodeSeq

You can simply say:

 searchBox -% doSearch

and have def doSearch: NodeSeq = ...

FocusOnLoad returns a NodeSeq because it returns a sequence of nodes
which conceptually cannot be converted to an elem. You could try to
have a Group(FocusOnLoad ...) ... but Group is a Node not an Elem.


 Between all the bind() and -()/-%() overloads and my general Scala /
 Lift ignorance, I can't understand what the right way to resolve this
 is.  I think it has something to do with FocusOnLoad returning a
 NodeSeq (input/script/) vs. an Element, but I don't know where to
 go from here...

 Thanks in advance,
 - Luke

-- 
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: superficial first impressions from a rails junkie

2010-03-05 Thread Marius
Yes we know ... we are working to change the Lift website but it's
going slower than I expected to.

On 6 mar., 08:34, ngocdaothanh ngocdaoth...@gmail.com wrote:
 I think with its power and number of developers, Lift can have a
 better home page. At least better than this because it only has one
 developer:http://nitrogenproject.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.