[Lift] Re: Future of the Lift wiki

2009-06-03 Thread marius d.

That's fantastic we have a couple of folks willing to contribute to
the wiki!

I'm cc-ing Debby as she's great with organizing things (in case she
doesn't watch this thread). Debby any thoughts ?


Br's,
Marius

On Jun 2, 5:16 pm, Bryan. germ...@gmail.com wrote:
 I too am willing to help.

 I really like the format of the django 
 documentation:http://docs.djangoproject.com/en/dev/.  Any other 
 recommendations out
 there?

 Thanks,
 Bryan

 On Jun 2, 6:57 am, Kevin Wright kev.lee.wri...@googlemail.com wrote:

  Mark me down :)

  On Tue, Jun 2, 2009 at 9:36 AM, marius d. marius.dan...@gmail.com wrote:

   I believe Debbie was asking the community for a few folks willing to
   garden the wiki. Anyone interested?

   Br's,
   Marius

   On Jun 2, 11:07 am, Timothy Perrett timo...@getintheloop.eu wrote:
Guys,

I know you chaps are quite new on this lift, so just to add a bit of
background - we've been here many, many times before with various
people pledging to fix and cleanup the wiki (myself included!)

After much discussion we decided that what was needed were gardeners -
not perhaps to write the articles themselves (as they may not be able
to if its about complex lift internals), but rather, to hassle the
commit team into churning out the required information that the
gardeners can distill onto the wiki. This involves going through the
current wiki and removing the old / irrelevant stuff.

Cheers, Tim

On Jun 2, 3:36 am, g-man gregor...@gmail.com wrote:

 Having gone through Rails, the Google App Engine with Django, and
 web2py over the last four years, I have seen it all as far as learning
 new frameworks goes, and I have posted a few ideas on that subject
 both here and on the book group.

 For those of us spoiled by the wealth of learning material on Rails,
 and to a lesser degree Django and web2py, all I can say is: 'Lift is a
 new framework, and a sophisticated one at that, which uses a new
 language derived from a convoluted one, and is at a relatively early
 stage of development, so therefore the designers are forging ahead to
 completion of the foundation, and thus there are few who can devote
 the time to creating the documentation we newcomers need.'

 My post on the book group defined the three classes of useful
 documents to be the Guidebook, the Encyclopedia, and the Cookbook. My
 role for the wiki is to hold Cookbook recipes which answer the most
 common 'how to' questions we encounter when building a website.

 In my personal learning quest, I am extending the 'ToDo' app by adding
 pieces of functionality, like many-to-many tagging, date manipulation,
 deletion, an admin interface, etc.

 As I come across solutions or questions, I post those on the group in
 order to help others and to get improvements and refinements from the
 members.

 David is right... Lift and Scala together are taking web applications
 to a whole new level of performance, so naturally it will take a
 little time to make things happen.

 By the way, today my copies of David's and Martin's Scala books
 arrived, and I urge all to purchase them yourselves!

 On Jun 1, 3:35 pm, Charles F. Munat c...@munat.com wrote:

  Hi, Xavi,

  One of my tasks is to come up with a good organization for the wiki
   and
  a site map, as well as a list of things we'd like to add to it.
  Unfortunately, with the coming Scala/Liftoff and OSB conferences,
   I've
  been swamped with other things. But I am working on it, albeit
   slowly.
  If you have any specific recommendations, please post them.

  Thanks!

  Chas.

  Xavi Ramirez wrote:
   Hello,

   I'm a bit confused about the future of the lift wiki.  What's the
   end
   goal?  In an ideal world is it supposed to be the main repository
   of
   lift knowledge, or just another documentation source?

   I personally feel that having one repository of knowledge is much
   more
   noob friendly.  Currently new members have to navigate through
   started
   guides, books, e-mail threads, scala docs, and personal blogs to
   find
   relative information.  Though the get started guided and book
   provide
   a good introduction, it's hard to progress from novice to
   intermediate
   with these fragmented resources.

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



[Lift] Re: How to remove leading text in Msgs.error

2009-06-05 Thread marius d.

The reason for that is that if the node text is empty (and yes we
explicitly trim it) we render the default text. To be honest I'm not a
fan of this approach either. I think it should be ok to just not
render a default text. Does anyone have any objections? If not I could
change this real quick, if yes let's talk about it.

Br's,
Marius

On Jun 5, 12:48 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Hi,

 I'm trying to remove the Notice, Error lead in text that is
 displayed when using the Msgs snippet, like this:

  lift:snippet type=msgs
           lift:notice_msg class=success/lift:notice_msg
           lift:error_msg class=error/lift:error_msg
           lift:warning_msg class=notice/lift:warning_msg
  /lift:snippet

 Looking at the code, it seems the default text is used if the specified
 text is empty, so I tried putting a nbsp; in there but this also seems
 to be swallowed.

 Is there anyway to do this (besides changing the default property
 values)??

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



[Lift] Re: How to remove leading text in Msgs.error

2009-06-05 Thread marius d.

Personally I don't think that a debug warning is necessary ... since
if the node is empty it is very intuitive for the user that nothing
will be rendered there which leads to an intended behavior.

Br's,
Marius

On Jun 5, 5:06 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 +1. If someone explicitly sets it to empty then we should honor that,
 although I wonder if we should emit a debug-level warning.

 Derek

 On Fri, Jun 5, 2009 at 7:26 AM, Bryan. germ...@gmail.com wrote:

  +1 on removing the default text.

  --Bryan

  On Jun 5, 6:46 am, marius d. marius.dan...@gmail.com wrote:
   The reason for that is that if the node text is empty (and yes we
   explicitly trim it) we render the default text. To be honest I'm not a
   fan of this approach either. I think it should be ok to just not
   render a default text. Does anyone have any objections? If not I could
   change this real quick, if yes let's talk about it.

   Br's,
   Marius

   On Jun 5, 12:48 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

Hi,

I'm trying to remove the Notice, Error lead in text that is
displayed when using the Msgs snippet, like this:

 lift:snippet type=msgs
          lift:notice_msg class=success/lift:notice_msg
          lift:error_msg class=error/lift:error_msg
          lift:warning_msg class=notice/lift:warning_msg
 /lift:snippet

Looking at the code, it seems the default text is used if the specified
text is empty, so I tried putting a nbsp; in there but this also seems
to be swallowed.

Is there anyway to do this (besides changing the default property
values)??

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



[Lift] Re: How to remove leading text in Msgs.error

2009-06-05 Thread marius d.

Oh right ..that  makes sense. Thanks Derek !

On Jun 5, 6:28 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Well, I meant for a period of time, since we're changing default behavior.
 If someone expects an empty node to render default messages and then
 upgrades to 1.1 and it stops spitting it out, that would be confusing. Kind
 of a deprecation warning, so to speak.

 Derek

 On Fri, Jun 5, 2009 at 8:25 AM, marius d. marius.dan...@gmail.com wrote:

  Personally I don't think that a debug warning is necessary ... since
  if the node is empty it is very intuitive for the user that nothing
  will be rendered there which leads to an intended behavior.

  Br's,
  Marius

  On Jun 5, 5:06 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
   +1. If someone explicitly sets it to empty then we should honor that,
   although I wonder if we should emit a debug-level warning.

   Derek

   On Fri, Jun 5, 2009 at 7:26 AM, Bryan. germ...@gmail.com wrote:

+1 on removing the default text.

--Bryan

On Jun 5, 6:46 am, marius d. marius.dan...@gmail.com wrote:
 The reason for that is that if the node text is empty (and yes we
 explicitly trim it) we render the default text. To be honest I'm not
  a
 fan of this approach either. I think it should be ok to just not
 render a default text. Does anyone have any objections? If not I
  could
 change this real quick, if yes let's talk about it.

 Br's,
 Marius

 On Jun 5, 12:48 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  Hi,

  I'm trying to remove the Notice, Error lead in text that is
  displayed when using the Msgs snippet, like this:

   lift:snippet type=msgs
            lift:notice_msg class=success/lift:notice_msg
            lift:error_msg class=error/lift:error_msg
            lift:warning_msg class=notice/lift:warning_msg
   /lift:snippet

  Looking at the code, it seems the default text is used if the
  specified
  text is empty, so I tried putting a nbsp; in there but this also
  seems
  to be swallowed.

  Is there anyway to do this (besides changing the default property
  values)??

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



[Lift] Re: How to remove leading text in Msgs.error

2009-06-05 Thread marius d.

Committed. Let me know if that works for you.

On Jun 5, 6:31 pm, marius d. marius.dan...@gmail.com wrote:
 Oh right ..that  makes sense. Thanks Derek !

 On Jun 5, 6:28 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:

  Well, I meant for a period of time, since we're changing default behavior.
  If someone expects an empty node to render default messages and then
  upgrades to 1.1 and it stops spitting it out, that would be confusing. Kind
  of a deprecation warning, so to speak.

  Derek

  On Fri, Jun 5, 2009 at 8:25 AM, marius d. marius.dan...@gmail.com wrote:

   Personally I don't think that a debug warning is necessary ... since
   if the node is empty it is very intuitive for the user that nothing
   will be rendered there which leads to an intended behavior.

   Br's,
   Marius

   On Jun 5, 5:06 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
+1. If someone explicitly sets it to empty then we should honor that,
although I wonder if we should emit a debug-level warning.

Derek

On Fri, Jun 5, 2009 at 7:26 AM, Bryan. germ...@gmail.com wrote:

 +1 on removing the default text.

 --Bryan

 On Jun 5, 6:46 am, marius d. marius.dan...@gmail.com wrote:
  The reason for that is that if the node text is empty (and yes we
  explicitly trim it) we render the default text. To be honest I'm not
   a
  fan of this approach either. I think it should be ok to just not
  render a default text. Does anyone have any objections? If not I
   could
  change this real quick, if yes let's talk about it.

  Br's,
  Marius

  On Jun 5, 12:48 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

   Hi,

   I'm trying to remove the Notice, Error lead in text that is
   displayed when using the Msgs snippet, like this:

    lift:snippet type=msgs
             lift:notice_msg class=success/lift:notice_msg
             lift:error_msg class=error/lift:error_msg
             lift:warning_msg class=notice/lift:warning_msg
    /lift:snippet

   Looking at the code, it seems the default text is used if the
   specified
   text is empty, so I tried putting a nbsp; in there but this also
   seems
   to be swallowed.

   Is there anyway to do this (besides changing the default property
   values)??

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



[Lift] Re: Snippets and Requests

2009-06-07 Thread marius d.

StatfulSnippet does not actually have session scope. It guarantees
that for the same request you get the same snippet instance. If for
some reason you still don't want a StatefulSnippet you can put your
results in a RequestVar, set the value when you process the form and
use it when render the page in binds.

Br's,
Marius

On Jun 6, 11:14 pm, Lance Walton lance.c.wal...@googlemail.com
wrote:
 Hi.

 From my various readings, I believed that a single instance of a
 snippet will be used for a particular request. I am trying to make use
 of this in order to implement a search feature in my app. So I have a
 template that looks like this:

 lift:surround with=default at=content
   h1Search/h1
   lift:SearchSnippet.nameSearch form=POST
     Name:nbsp;search:name/nbsp;nbsp;search:submit/
   /lift:SearchSnippet.nameSearch

   h1Results/h1
   divlift:SearchSnippet.searchResultsfires:list
     divresult:name//div
   /fires:list/lift:SearchSnippet.searchResults/div
 /lift:surround

 And my snippet looks like this:

 class SearchSnippet {
   var results : List[Result] = List()

   def nameSearch(xhtml : NodeSeq) : NodeSeq = {
     var name = 

     def process() {
       results = ... some stuff to get the results ...
     }

     bind(search, xhtml,
          name - SHtml.text(name, name = _),
          submit - SHtml.submit(Search, process))
   }

   def searchResults(xhtml : NodeSeq) : NodeSeq =
     results.flatMap(f = bindResult(f)(chooseTemplate(results,
 list, xhtml)))

   def bindResult(result : Result)(xhtml : NodeSeq) =
     bind(result, xhtml,
       name - result.name)

 }

 What I expected is that when the form is submitted, an instance of
 SearchSnippet will be created and 'results' will be populated. Then,
 when the results sectionof the template is processed, the
 'searchResults' method can bind the results. However, I never see any
 results, and a bit of debugging suggests that different instances are
 in play. Is this as expected?

 I don't think I want a StatefulSnippet because that seems to have
 session 'scope'.

 What to do?

 Regards,

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



[Lift] Re: Lift Jquery autocomplete *** API CHANGE CANDIDATE ***

2009-06-08 Thread marius d.

Other folks, please speak up ! :) ... I will soon migrate this into a
Lift widget.


Br's,
Marius

On Jun 6, 4:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 I think I'm using in one place in one project so my api breakage factor is
 low.  I'm okay with moving it unless someone else is going to feel real
 pain.

 On Jun 6, 2009 12:24 AM, Marius marius.dan...@gmail.com wrote:

 Is there a reason why the JQuery autocomplete is not a Lift widget but
 instead it lives in http/jquery package? .. I remember a long time ago
 me putting it in the jquery package to separate SHtml stuff that is
 dependent on JQuery to the others.

 Thoughts?

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



[Lift] Re: Attributes in Menu.item not rendered

2009-06-08 Thread marius d.

Do you see any behavior change if you put a text value such as:

lift:Menu.item name=helpMenu a:class=nav Some tex /
lift:Menu.item

Br's,
Marius

On Jun 8, 12:55 am, Ewan ehar...@gmail.com wrote:
 I'm trying to create a menu using CSS and links that is a 
 class=nav/ which accoring to the doco I should be able to do with
 lift:Menu.item name=helpMenu a:class=nav / where helpMenu has
 been defined in the sitemap.  The link renders but the attribute does
 not.

 Which incantation did I forget?

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



[Lift] Re: Google App Engine for Scala!

2009-06-08 Thread marius d.

Out of curiosity have you tried JDO with GAE? Does anyone have a
simple example?

Br's,
Marius

On Apr 11, 10:53 am, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com
wrote:
 Hi,

 On Fri, Apr 10, 2009 at 10:03 PM, David Pollak

 feeder.of.the.be...@gmail.com wrote:
  Thank you! Thank you! Thank you!
  I'd like to kiss you (but my wife might get upset)
  Next time you come to the Bay Area, I will buy you lunch or dinner!

 If I get an opportunity to be there in the future, I'll want to enjoy
 lunch with you!

  On Apr 10, 2009 1:46 AM, Atsuhiko Yamanaka atsuhiko.yaman...@gmail.com 
  wrote:
  As a proof of concept, I have succeeded to run lift-example on GAE/J,  it 
  is running at
   http://lift-example.appspot.com/index

  Of course, CometAcotr is not functional, and DB is not available
  because of jdbc usage.
  In this weekend, if possible, I will try JPA.

  Here is a fork of liftweb source code to run lift-example on GAE/J,
   http://github.com/ymnk/liftweb/tree/master

 It seems that JDBC API must not have be forbidden on GAE/J .
 I have succeeded to use H2 mem db by updating to its latest version[1] and
 now DB functionalities have worked on
  http://lift-example.appspot.com/index

 However, it is not adequate for the practical usages, of course.
 FYI, I found an interesting message[2] about a plan to implement
 JDBC to com.google.appengine.api.datastore wrapper

 PS. I will add CC to liftweb@googlegroups.com and further discussions
 should be there.

 [1]http://www.h2database.com/html/changelog.html
 [2]http://groups.google.com/group/google-appengine-java/msg/71278bbee901...

 Sincerely,
 --
 Atsuhiko Yamanaka
 JCraft,Inc.
 1-14-20 HONCHO AOBA-KU,
 SENDAI, MIYAGI 980-0014 Japan.
 Tel +81-22-723-2150
    +1-415-578-3454
 Fax +81-22-224-8773
 Skype callto://jcraft/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Programming in Scala #5, Lift Book #8, Beginning Scala #9

2009-06-08 Thread marius d.

On the apress site: http://apress.com/book/downloadfile/4390

Apress decided (we agreed) that the appendixes will not be included in
the first printing run in order to get the book ready for Java One.

Br's,
Marius

On Jun 8, 5:49 pm, Peter Bliznak bliz...@rogers.com wrote:
 As an loyalist to the cause I already have 3 of them . (yes = 2*scala + lift)

 Now for  The Definitive Guide to Lift - where is numerously mentioned 
 Appendix A..G ..
 I could not find it anywhere.

 P.

 
 From: TylerWeir tyler.w...@gmail.com
 To: Lift liftweb@googlegroups.com
 Sent: Monday, June 8, 2009 10:34:13 AM
 Subject: [Lift] Programming in Scala #5, Lift Book #8, Beginning Scala #9

 http://www.theserverside.com/news/thread.tss?thread_id=54862

 Quote:
 Here are the top 10 selling books at the JavaOne Bookstore. Are these
 a trend? You decide.

 1. JavaFX: Building Rich Internet Applications - Addison Wesley ISBN:
 013701287X
 2. Essential JavaFX - PTR (out June 11, 2009) ISBN: 0137042795
 3. Effective Java 2nd ed. - PTR ISBN: 0321356683
 4. Java Puzzlers - Addison Wesley ISBN: 032133678X
 5. Programming in Scala - Artima ISBN: 0981531601
 6. Java Concurrency in Practice - Addison Wesley ISBN:0321349601
 7. Beginning Java EE 5: From Novice to Professional - Apress ISBN:
 1590594703
 8. The Definitive Guide to Lift - Apress ISBN: 1430224215
 9. Beginning Scala - Apress ISBN: 1430219890
 10. OpenSolaris Bible - Wiley ISBN: 0470385480

 Another chance for me to thank everyone involved.
 - dpp for building the framework and being more helpful than any
 person should be expected to be.
 - Derek and Marius for being excellent co-authors and about 8 times
 smarter than me.

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



[Lift] Re: Attributes in Menu.item not rendered

2009-06-08 Thread marius d.

Oh do you use the same name 'helpMenu' for the current loc? a:
prefixed attributes are added only if loc.name != name.

On Jun 8, 1:30 pm, Ewan ehar...@gmail.com wrote:
 None I'm afraid.  I have:

 lift:Menu.item name=helpMenu a:class=navHelp Me!/
 lift:Menu.item

 which results in:

 a href=/help/Help Me!/a

 -- Ewan

 On Jun 8, 9:07 am, marius d. marius.dan...@gmail.com wrote:

  Do you see any behavior change if you put a text value such as:

  lift:Menu.item name=helpMenu a:class=nav Some tex /
  lift:Menu.item

  Br's,
  Marius

  On Jun 8, 12:55 am, Ewan ehar...@gmail.com wrote:

   I'm trying to create a menu using CSS and links that is a 
   class=nav/ which accoring to the doco I should be able to do with
   lift:Menu.item name=helpMenu a:class=nav / where helpMenu has
   been defined in the sitemap.  The link renders but the attribute does
   not.

   Which incantation did I forget?

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



[Lift] Re: Attributes in Menu.item not rendered

2009-06-08 Thread marius d.

Ewan,

I just committed a fix on master. The pattern matching was actually
failing and the attributes were never added. I gave it a try and
worked for me. Please test and let me know if it works for you

Br's,
Marius

On Jun 8, 6:58 pm, Ewan ehar...@gmail.com wrote:
 I think you mean and reading the src if the page I am on is the menu
 item in question don't render - correct?  If so then the attribute(s)
 are still not rendered from any part of the site and indeed the link
 itself is not rendered when on the page that the Loc points to.  Can
 you or anyone confirm that it works for them?

 Thx

 -- Ewan

 On Jun 8, 4:14 pm, marius d. marius.dan...@gmail.com wrote:

  Oh do you use the same name 'helpMenu' for the current loc? a:
  prefixed attributes are added only if loc.name != name.

  On Jun 8, 1:30 pm, Ewan ehar...@gmail.com wrote:

   None I'm afraid.  I have:

   lift:Menu.item name=helpMenu a:class=navHelp Me!/
   lift:Menu.item

   which results in:

   a href=/help/Help Me!/a

   -- Ewan

   On Jun 8, 9:07 am, marius d. marius.dan...@gmail.com wrote:

Do you see any behavior change if you put a text value such as:

lift:Menu.item name=helpMenu a:class=nav Some tex /
lift:Menu.item

Br's,
Marius

On Jun 8, 12:55 am, Ewan ehar...@gmail.com wrote:

 I'm trying to create a menu using CSS and links that is a 
 class=nav/ which accoring to the doco I should be able to do with
 lift:Menu.item name=helpMenu a:class=nav / where helpMenu has
 been defined in the sitemap.  The link renders but the attribute does
 not.

 Which incantation did I forget?

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



[Lift] Re: Great pictures from the Scala Lift Off

2009-06-08 Thread marius d.

Ohhh that's just great ... I wish I could have come. Who knows maybe
one day I'll make it.

Br's,
Marius

On Jun 8, 7:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 Folks,
 Ilya not only writes great IDE plugins, he takes good 
 pictures:http://picasaweb.google.com/ilyas239/Scalaliftoff09#

 Thanks,

 David

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: security

2009-06-10 Thread marius d.

Hi,

For most apps cannonicalization is not really necessary as the
character stream for form-url-encoded is UTF-8 by default as Lift uses
UTF-8 by default. Oh and the conversion from URL encoding to plain
UTF-8 content is really done by container and when we get the params
from the request object they are already well formed. Now if we're
talking about a higher level of validation that's a different story
and IMO this is an application aspect and not much a framework one.

Br's,
Marius

On Jun 10, 5:43 am, Oliver Lambert olambo...@gmail.com wrote:
 Looks like I might have a requirement for implementing OWASP secure coding
 practices, as described by

 http://www.sans.org/reading_room/whitepapers/application/rss/appsec_p...https://mail01.paycorp.com.au/owa/redir.aspx?C=a9af519a5b1b45909b8897...

 One thing that I definitively don't do and I believe Lift doesn't do out of
 the box is Canonicalize input
 before validation/filtering. I was looking into using OWASP
 ESAPIhttp://www.owasp.org/index.php/ESAPIbut I'm put off by it's use
 of
 property files and system resources.  Do any of you Canonicalize input, if
 so, do you use a Library? Does Lift
 need this feature, or any of the others described in the above document?

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



[Lift] Re: security

2009-06-10 Thread marius d.

Oh and about XSS Lift is safe by default.

Marius

On Jun 10, 9:39 am, marius d. marius.dan...@gmail.com wrote:
 Hi,

 For most apps cannonicalization is not really necessary as the
 character stream for form-url-encoded is UTF-8 by default as Lift uses
 UTF-8 by default. Oh and the conversion from URL encoding to plain
 UTF-8 content is really done by container and when we get the params
 from the request object they are already well formed. Now if we're
 talking about a higher level of validation that's a different story
 and IMO this is an application aspect and not much a framework one.

 Br's,
 Marius

 On Jun 10, 5:43 am, Oliver Lambert olambo...@gmail.com wrote:

  Looks like I might have a requirement for implementing OWASP secure coding
  practices, as described by

 http://www.sans.org/reading_room/whitepapers/application/rss/appsec_p...https://mail01.paycorp.com.au/owa/redir.aspx?C=a9af519a5b1b45909b8897...

  One thing that I definitively don't do and I believe Lift doesn't do out of
  the box is Canonicalize input
  before validation/filtering. I was looking into using OWASP
  ESAPIhttp://www.owasp.org/index.php/ESAPIbut I'm put off by it's use
  of
  property files and system resources.  Do any of you Canonicalize input, if
  so, do you use a Library? Does Lift
  need this feature, or any of the others described in the above document?

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



[Lift] Re: org.mortbay.util.ajax.Continuation on GAE/J

2009-06-10 Thread marius d.



On Jun 10, 7:27 pm, Alex Boisvert boisv...@intalio.com wrote:
 On Wed, Jun 10, 2009 at 9:15 AM, Atsuhiko Yamanaka 

 atsuhiko.yaman...@gmail.com wrote:

  Hi,

  On Thu, Jun 11, 2009 at 12:30 AM, David
  Pollakfeeder.of.the.be...@gmail.com wrote:
   Unfortunately, no.  In order to do this, we'd have to have a hard
  dependency
   on Jetty.  It may be possible to do an external continuations module and
  you
   are encouraged to research this.

  I agree with you that a hard dependecy on jetty is not acceptable.
  I will research that.

 Or perhaps have some sort of pluggable factory for continuations so the hard
 dependency can be moved into an optional module?  The factory class could be
 configured in web.xml as a servlet init-param.

I think that the less XML config things are there, the better. We can
simply have a trait and the specific implementation will be packaged
in a separate jar.file that can just exist is a by convension
location. Say 'plugins' folder. With a very simple classloader we can
easily achieve this flexibility (... I don't thing that this is a
candidate for OSGI plugins).


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



[Lift] Re: security

2009-06-11 Thread marius d.



On Jun 11, 2:45 am, Oliver Lambert olambo...@gmail.com wrote:
 On Wed, Jun 10, 2009 at 11:58 PM, David Pollak 



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

  On Tue, Jun 9, 2009 at 11:39 PM, marius d. marius.dan...@gmail.comwrote:

  Hi,

  For most apps cannonicalization is not really necessary as the
  character stream for form-url-encoded is UTF-8 by default as Lift uses
  UTF-8 by default. Oh and the conversion from URL encoding to plain
  UTF-8 content is really done by container and when we get the params
  from the request object they are already well formed. Now if we're
  talking about a higher level of validation that's a different story
  and IMO this is an application aspect and not much a framework one.

  And Lift does URL Decoding of the paths before presenting them as the Req()
  object.

  More broadly, Lift should provide all the features of ESAPI out of the box.
   If there are particular things that ESAPI offers that Lift doesn't, please
  flag them and we'll add them.

  I did a bunch of years as VPE and CTO at a web app security company.  In
  general, I've worked to make sure that Lift has security baked in and that
  the developer has to work to make the app insecure, rather than vice versa.
   If I missed a spot, Lift will be enhanced to make sure it does have
  security baked in.

 From my perspective Lift is secure, much more so than other frameworks I've
 used. The current set of Lift apps, that I've helped develop, have survived
 outsourced penetration testing without requiring any modifications at all.
 Great!

 I'm not a security expert, but I am being asked to consider ESAPI features.
 From my limited understanding, the UTF-8 encoding is fine and Lift protects
 the response from displaying any scripts or html that might have
 inadvertently been added to the database.  The problem is more what is being
 validated and how its being validated. I don't buy Marius's claim that this
 is somehow a higer order validation that is an application concern rather
 than a framework one. The internet has all the insecurities it has, because
 security has been left to the application developer.

The eligibility criteria from a web-string to be converted to String
object may differ greatly from application to application. This is why
so fat I disagree with you. In some contexts receiving scriptalert
('XSS')/script string is what application wants. Sometimes it is
not. Besides lift already protects us from XSS in great extent.


 As far a I can see, one problem lies when a string is obtained from the web
 page and instanciated into a String object.  For instance, if it comes in as
 scriptalert('XSS')/script, then its probably not what you want.  Why
 does it matter if something like this gets stored in your database - perhaps
 because it's one part of your security.  In addition if it comes in doubly
 encoded as

 %253Cscript%253Ealert('XSS')%253C%252Fscript%253E

 then its probably also not what you want.

 1) To stop double encoding, ESAPI suggests that you use cannonicalization to
 convert the strings to a similar format before validation.
 2) After, the input has been cannonicalized, ESAPI suggests that the input
 should be validated against a whitelist of allowed charaters.

 Now, I can't see that 1 or 2 is necessary if you are creating a number from
 the input, but perhaps it should be, if you are creating a ordinary String
 object. I also am not sure how much work would be involved in using a
 whitelist in a location aware multilingual way, but perhaps it could be done
 as a default.

I have nothing against ESAPI but as far as I'm concerned more
compelling and concrete use cases are needed for it to be incorporated
into the framework. As David said if there is a security hole
somewhere we're keen to know about it and fix it immediately.




  Br's,
  Marius

  On Jun 10, 5:43 am, Oliver Lambert olambo...@gmail.com wrote:
   Looks like I might have a requirement for implementing OWASP secure
  coding
   practices, as described by

   One thing that I definitively don't do and I believe Lift doesn't do out
  of
   the box is Canonicalize input
   before validation/filtering. I was looking into using OWASP
   ESAPIhttp://www.owasp.org/index.php/ESAPIbut I'm put off by it's use
   of
   property files and system resources.  Do any of you Canonicalize input,
  if
   so, do you use a Library? Does Lift
   need this feature, or any of the others described in the above document?

   cheers
   Oliver

  --
  Lift, the simply functional web frameworkhttp://liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890
  Follow me:http://twitter.com/dpp
  Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options

[Lift] Re: Wolfram Alpha integration for Lift

2009-06-11 Thread marius d.

Wolfram Alpha is WAY COOL !

I wish I could help but my spare time is problematic. Maybe I could
help sporadically? Would you be ok with that?

Br's,
Marius


On Jun 11, 7:02 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey chaps,

 Im going to start work on integration with the wolfram alpha engine
 that i've of late become most obsessed with as its the coolest thing
 since sliced bread...http://www.wolframalpha.com/

 New branch here:http://github.com/dpp/liftweb/tree/wip-tim-wolframalpha

 Anyone else in the commit team interested in working on this with me?

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



[Lift] Re: Wolfram Alpha integration for Lift

2009-06-11 Thread marius d.

Oh and people that are not Lift committers could potentially
join?  I'm sure there are lots of talents in Lift community.

Br's,
Marius

On Jun 11, 7:02 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey chaps,

 Im going to start work on integration with the wolfram alpha engine
 that i've of late become most obsessed with as its the coolest thing
 since sliced bread...http://www.wolframalpha.com/

 New branch here:http://github.com/dpp/liftweb/tree/wip-tim-wolframalpha

 Anyone else in the commit team interested in working on this with me?

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



[Lift] Re: JSON Rest API

2009-06-11 Thread marius d.

Just use a JsonResponse instead of XmlRresponse.
See definition:

object JsonResponse extends HeaderStuff {
  def apply(json: JsExp): LiftResponse = JsonResponse(json, headers,
cookies, 200)
}

and call it

JsonResponse(JsObj(..))

Br's,
Marius

On Jun 11, 8:25 pm, Makeable m...@makeable.co.uk wrote:
 I have followed through the book and have been successful in creating
 an XML API.
 How would I go about utilizing a JSONResponse instead?

 Kind Regards,

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



[Lift] Re: Lift Shopping Cart?

2009-06-12 Thread marius d.

There is a PayPal module I think.

Br's,
Marius

On Jun 12, 5:08 pm, David Persons dhwpers...@gmail.com wrote:
 I am experimenting with Lift / Scala and am thinking about using it
 for some projects in the future. Really like it. For a website I need
 shopping cart functionality. In last years post 'Making modular lift
 functionality' I read about plans for making a Lift shopping cart
 module. What is the status of this project? Is there a shopping cart
 example / project available which I can use / look at?

 Same question for a user Forum in Lift, is there a Lift Forum module?

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



[Lift] Re: Lift Jquery autocomplete *** API CHANGE CANDIDATE ***

2009-06-16 Thread marius d.

yes yes yes ... entirely my bad as I missed that out ...

I'll correct it very soon.

Marius

On Jun 16, 3:07 am, Bryan. germ...@gmail.com wrote:
 Hi Marius,

 I just updated to the tip and got a build failure:

 [WARNING] /home/bryan/public-repos/git/liftweb/sites/example/src/main/
 scala/net/liftweb/example/snippet/Ajax.scala:65: error: value
 autocomplete is not a member of object net.liftweb.http.jquery.JqSHtml
 [WARNING]          auto - JqSHtml.autocomplete(, buildQuery _, _
 = ()))

 --Bryan

 On Jun 15, 2:16 pm, marius d. marius.dan...@gmail.com wrote:

  Folks,

  I just made the autocomplete a Lift widget so it does not exist
  anymore in JqShtml object. Here is an example on how to use it:

  - For Ajax autocomplete
      AutoComplete(, (current, limit) = {
        println(current =  + current)
        (1 to limit).map(v = Value_ + v)
      }, s = println(submit  + s))

  - For pre-provided options list
     AutoComplete.autocompleteObj(/*same params as bfore*/)

  This may break your app but I think it is very easy to update it.

  I also fixed some bugs:
  1. It didn;t work if the container cookies were turned off
  2. hovering on the options list did not work on Ubuntu FF3 at least
  due to a capitalizated LI equality test.

  If you encounter any problems, please let me know.

  Br's,
  Marius

  On Jun 8, 12:34 pm, Kevin Wright kev.lee.wri...@googlemail.com
  wrote:

   +1

   As an evolving framework, it definitely makes more sense to favour
   consistency over backward compatibility at this stage

   On Mon, Jun 8, 2009 at 9:00 AM, marius d. marius.dan...@gmail.com wrote:

Other folks, please speak up ! :) ... I will soon migrate this into a
Lift widget.

Br's,
Marius

On Jun 6, 4:53 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 I think I'm using in one place in one project so my api breakage 
 factor
is
 low.  I'm okay with moving it unless someone else is going to feel 
 real
 pain.

 On Jun 6, 2009 12:24 AM, Marius marius.dan...@gmail.com wrote:

 Is there a reason why the JQuery autocomplete is not a Lift widget but
 instead it lives in http/jquery package? .. I remember a long time ago
 me putting it in the jquery package to separate SHtml stuff that is
 dependent on JQuery to the others.

 Thoughts?

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



[Lift] Re: Mapper or Record?

2009-06-16 Thread marius d.



On Jun 16, 3:17 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 On 16 Jun 2009, marius d. wrote:

  Lift Record currently is not implemented for DB interaction but it's
  targeted for 1.1 release.

 That probably explains why I couldn't find much when looking through the
 source :-)



  I'd say to start development using the Mapper and when Record is ready
  migrate to the Record. I would expect to be a fairly easy transition
  from Mapper to Record though.

 Ok, sounds good. Will mapper be extended in 1.1 or is it only bug fixing
 and all new development will happen in Record?

I wouldn't expect much new stuff on the Mapper area. It will be
maintained though for a long time. So new stuff should come for
Record ...


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



[Lift] Re: Firebug error message for AJAX

2009-06-17 Thread marius d.



On Jun 17, 12:53 am, Charles F. Munat c...@munat.com wrote:
 I have the import statment and the LiftRules.jsArtifacts = YUIArtifacts
 in Boot, but the script tag for the liftYUI.js script is not being
 inserted. I guess I could add it manually, but isn't Lift supposed to
 insert it?

Nope it doesn't insert it automatically ...


 Thanks!

 Chas.

 marius d. wrote:
  Also please see:http://wiki.liftweb.net/index.php/HowTo_use_Lift_with_YUI

  Marius

  On Jun 16, 11:58 pm, marius d. marius.dan...@gmail.com wrote:
  You need one more

  script src=/classpath/liftYUI.js type=text/javascript/script

  Br's,
  Marius

  On Jun 16, 11:30 pm, Charles F. Munat c...@munat.com wrote:

  I'm getting the following error in Firebug:
  YAHOO.lift is undefined
  url = YAHOO.lift.buildURI(addPageName('/...nSuccess(res);}, failure :
  onFailure });
  I have the following scripts:
  script src=/scripts/yahoo-dom-event/yahoo-dom-event.js
  type=text/javascript/script
  script src=/scripts/utilities/utilities.js
  type=text/javascript/script
  script src=/scripts/json/json-min.js type=text/javascript/script
  script src=/scripts/connection/connection-min.js
  type=text/javascript/script
  script type=text/javascript src=/ajax_request/liftAjax.js/script
  Any ideas?
  Chas.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: David and Lift @ QCon

2009-06-17 Thread marius d.

Really enjoined ! ... Thank David and congrats !

Br's,
Marius

On Jun 17, 5:41 pm, Viktor Klang viktor.kl...@gmail.com wrote:
 For those of us who weren't 
 there:http://www.infoq.com/interviews/Lift-Scala-David-Pollack

 Awesome interview Dave!

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



[Lift] Re: Lift + Javeline

2009-06-17 Thread marius d.

Just 2.1 version ... we'll try that out. It's still a mystery because
offline example works but wen putting it in lift fails only on FF. So
far there is no indication that Lift is doing anything wrong.


Br's,
Marius

On Jun 17, 4:14 pm, Matt Williams m...@makeable.co.uk wrote:
 Are you using the latest version from the repository?
 There were a few firefox fixes put in place a week or so ago.

 On Jun 17, 1:18 pm, Marius marius.dan...@gmail.com wrote:

  Hi all,

  We've been trying javeline (http://ajax.org/) with Lift and it's
  pretty needless to say how cool it is. It seems to work fine in
  Chrome, IE6/7, Safari but we're getting a strange JS error on FF3
  only.

  Seehttp://scalaliftapp.appspot.com/example2... or FF3 we're getting
  this.oDrag is null JS error. Did anyone experience this before?

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



[Lift] Re: QA, before merging code

2009-06-18 Thread marius d.

Oliver thanks for raising this flag. I'll try to look later on today
one more time at the code as I'm not sure I fully understand the
principles of your addition. I remember doing some comments on the
topic but haven't looked on your code for a while.

Are you willing to have a quick chat on it ?


Br's,
Marius

On Jun 18, 3:00 am, Oliver Lambert olambo...@gmail.com wrote:
 Hi,

 Seems theres been a little bit of discussion about methodologies of coding
 and development processes in the latest threads which is cool
 and makes me think about my current coding efforts.

 I created a branch a while ago where I put in my take on a slightly
 alternative (or complementary?) binding process (the particular code
 adds a bind by name to BindHelpers). I was hoping for some feedback from a
 few of you (David, Marius, and anyone else) before
 merging it back with the main site, as I feel what I have done might be
 contentious and I don't want to cause any problems.

 Whats the normal process of committing changes. Is the code QA'ed in some
 way or do I just do it,and wait for people to say #!.

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



[Lift] Re: Lift and Goat Rodeo

2009-06-18 Thread marius d.

Dave is there a reason why writes are allowed outside a transaction
boundaries ?

Br's,
Marius

On Jun 18, 10:19 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Folks,

 At the end of the Scala Lift Off, after I finished my third beer, Martin
 Odersky came over to me and asked, so, what's the future of Lift?

 I gave a hand-waving answer about the features for 1.1.  But Martin is not a
 hand-waving kind of guy and I think I owe him and the other folks in the
 Scala and Lift communities more.

 There's a lot more that's necessary for web app development than Lift, an
 abstraction to the HTTP request/response cycle, can provide.

 Over the last couple of years, I've been noticing trends in web development,
 in the needs of my various consulting gigs, and in some other projects.
 It's clear to me that it's time for a unified data and data management model
 that goes beyond OR mapping and that is scalably transactional.  I've put
 together a model that looks to the developer like STM but is backed with
 ZooKeeper and Cassandra.  I've blogged about it 
 athttp://blog.lostlake.org/index.php?/archives/94-Lift,-Goat-Rodeo-and-...

 Just as my web framework manifesto was the genesis of what has become Lift,
 I hope that my notions and ramblings in this blog post will become concrete,
 usable code over the next few months and a solid platform for building the
 next generation of web systems over the next few years... all built with
 Scala at their core.

 Thanks,

 David

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: BBCode2XHTML

2009-06-18 Thread marius d.

Isn't Lift XSS safe by default ? ... in the sense that it applies the
proper escaping.

Br's,
Marius

On Jun 18, 2:06 pm, Viktor Klang viktor.kl...@gmail.com wrote:
 Hi guys!

 I'm in dire need of an XSS-safe and generally harmless way of allowing
 end-users to add some markup to texts.
 In the spirit of re-use and lack of time, I wonder if any of you have any
 libraries to recommend that can transform a String maybe containing BBCode
 to the same string but with xhtml compliant markup.

 Googled it a bit and saw KefirBB 
 http://sourceforge.net/projects/kefir-bb/and
 JavaBBCode https://javabbcode.dev.java.net/ but none of them seem lean
 enough (I mean, how much code does it need to transform a String??)

 So what's it gonna be guys, is there a saviour out there or will I need to
 pull out the Scala REPL?

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



[Lift] Re: Lift and Goat Rodeo

2009-06-18 Thread marius d.

Sorry Dave but something still escapes me.

Transaction.write also takes a TRef parameter which is never used.
Furthermore nothing seems to prevent one to call new TRef... outside a
Transaction.

I assume the normal usage is:

val ref = new Ref(QString())

ref.map(tref = // do transactional reads and writes. Very cool)

but then I can do:

val tref = new TRef(ref)

tref(QString(new val)) ... but this does not seam to be
transactional since we're outside a transaction context?

Perhaps TRef.set should call Transaction.write from a ref.map( ... )
as this gives transaction wrapping?



Br's,
Marius

On Jun 18, 6:14 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Thu, Jun 18, 2009 at 4:23 AM, marius d. marius.dan...@gmail.com wrote:

  Dave is there a reason why writes are allowed outside a transaction
  boundaries ?

 Writes are not allowed outside of transactional boundaries.  You have to
 enter a transaction to get a TRef, a transactional reference.  You can only
 read or write via a TRef.





  Br's,
  Marius

  On Jun 18, 10:19 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   Folks,

   At the end of the Scala Lift Off, after I finished my third beer, Martin
   Odersky came over to me and asked, so, what's the future of Lift?

   I gave a hand-waving answer about the features for 1.1.  But Martin is
  not a
   hand-waving kind of guy and I think I owe him and the other folks in the
   Scala and Lift communities more.

   There's a lot more that's necessary for web app development than Lift, an
   abstraction to the HTTP request/response cycle, can provide.

   Over the last couple of years, I've been noticing trends in web
  development,
   in the needs of my various consulting gigs, and in some other projects.
   It's clear to me that it's time for a unified data and data management
  model
   that goes beyond OR mapping and that is scalably transactional.  I've put
   together a model that looks to the developer like STM but is backed with
   ZooKeeper and Cassandra.  I've blogged about it athttp://
  blog.lostlake.org/index.php?/archives/94-Lift,-Goat-Rodeo-and-...

   Just as my web framework manifesto was the genesis of what has become
  Lift,
   I hope that my notions and ramblings in this blog post will become
  concrete,
   usable code over the next few months and a solid platform for building
  the
   next generation of web systems over the next few years... all built with
   Scala at their core.

   Thanks,

   David

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

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Error reporting and early failure in lift ?

2009-06-19 Thread marius d.

Francois,

That is a very valid point and there is significant attention in lift
development to improve error reporting. In fact David made some really
significant steps in this area in 1.1-SNAPSHOT so that if an
unexpected error occurs in development mode there is a helpful message
rendered on the page. But sure lots of things can and will be done to
improve this.

Just wanted to say that we're fully aware of the situation.

Br's,
Marius

On Jun 19, 1:15 pm, fan...@gmail.com fan...@gmail.com wrote:
 Hello guys,

 I'm really new to lift application development, even if I try to follow
 the framework evolution almost since it's start. I'm coming from
 Tapestry 5 world, and so, I'm just discovering basic Lift features. For
 now, I can say that there is really cool things here, things that Scala
 make so simple, things in the AJAX land...

 But  one of the things I really liked in T5 and miss a lot with in first
 days of Lift is T5 awesome error reporting and early failure behaviour.

 You know, for now I'm playing with little examples, trying to modify the
 Pocket Change App of Lift book, this kind of things. And I have to say
 that a lot of my try are not successful.
 In T5, when something goes wrong, T5 takes me by the hand, show me the
 piece of template where the error happens, the faulty code, and give me
 advices on how to correct the problem. Moreover, T5 default behaviour is
 to fail early, so that less bad code is waiting for users to discover
 it - developers get big exceptions that they can't honestly ignore.

 There is (an really old) example of T5 error reporting 
 here:http://tapestryjava.blogspot.com/2007/09/itch-scratching-even-better-...
 Now, the report is even better than that, especially when compond
 components are involved.

 There is an other example of enhanced error reporting, this time in the
 console:http://tapestryjava.blogspot.com/2008/12/exception-reporting-why.html

 So, what the goal of the mail ? Well, just to bring the attention of
 core team on how it's important and great to have good feedback from the
 framework (error reporting, early failure) and I do believe that T5 is
 state of the art in that domain... So if you look for inspiration, it
 might be the good place to look at.

 When I will be (if I become) more versatile in Lift, perhaps I would be
 able to help improve in this domain, but for now, it's clearly out of my
 reach :)

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



[Lift] Re: So where is that OAuth?

2009-06-21 Thread marius d.

OAuth is not implemented yet in Lift still the project folder is
there. I think Dave wanted to put it there but never got the chance to
add it.

Br's,
Marius

On Jun 21, 9:29 am, DFectuoso santiago1...@gmail.com wrote:
 Im trying to integrate OAuth (with twitter) in one of my projects...
 and i saw the lift-oauth, but i cant find the code, documentation or
 examples around this module; so i guess either its somewhere else or
 people is doing their twitter integrations with other class(maybe
 java)...

 So what are you guys doing around OAuth and what could i do to get
 this rolling?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: So where is that OAuth?

2009-06-22 Thread marius d.



On Jun 22, 3:25 am, DFectuoso santiago1...@gmail.com wrote:
 Well i went ahead and learn a lot from the lift-openId implementation
 and understand what I would need to do have lift-OAuth working

 It seems like i could do two things:
 1) Get a OAuth java library that allows me to post, get, login and
 logout then create a OAuth.scala file where i create a trait of the
 OAuth Handler that would access to this methods, then create a object
 that extends from that trait; Then create a OAuthProtoUser.scala where
 I would have a trait for the MetaOAuthProtoUser with the Xhtml for
 login, override the menus that i would not use and perform the login
 and logout of the user as well as the post and get methods. Finally
 create a trait for the OAuthProtoUser that would allow me to store
 information about the user.

Besides Proto stuff we'd need an abstraction over OAuth artifacts.
Essentially a wrapper over their Java library.

 2) Go ahead and have the login,logout, post and get methods on the
 OAuth.scala actually do the logic to get the tokens without a java
 library, this would mean creating some way of signing a url and body
 to post and get stuff from the request, access and user-auth Token Url
 or an url in the service.

 I have absolutely no experience with scala, java or lift but I really
 want to get some(by doing this type of stuff). So what do you think is
 better(for me to learn, for lift and for you).

I think it would be a good exercise. Once you're done with it we could
probably review it and maybe it'll get its way into Lift if some
committer doesn't implement it in the mean time, but regardless would
be a good exercise for you.


 Also, what part of this abstraction(and how) is the one to set the
 consumer_key, secret_key and the request urls?

In OAuth world consumer secret and consumer key are somehow invariants
as they impersonate a trusted service. So I would put them into a
Scala object where user can just set these quantities from Boot.


 Finally; a uber noob question, what is the equivalent of curl(php) or
 urllib/urlopen(python) that i would use in the second option to
 actually make the http request to ther other site? I think its a
 servlet but some trivial example on this would really help me =)

You can just use HttpUrlConnection, or Apache Http client.


 On Jun 21, 7:18 am, marius d. marius.dan...@gmail.com wrote:

  OAuth is not implemented yet in Lift still the project folder is
  there. I think Dave wanted to put it there but never got the chance to
  add it.

  Br's,
  Marius

  On Jun 21, 9:29 am, DFectuoso santiago1...@gmail.com wrote:

   Im trying to integrate OAuth (with twitter) in one of my projects...
   and i saw the lift-oauth, but i cant find the code, documentation or
   examples around this module; so i guess either its somewhere else or
   people is doing their twitter integrations with other class(maybe
   java)...

   So what are you guys doing around OAuth and what could i do to get
   this rolling?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Thead safe part and transaction management in Lift

2009-06-24 Thread marius d.



On Jun 24, 12:10 pm, fan...@gmail.com fan...@gmail.com wrote:
 Hello guys,

 I'm following my path through lift, and there is some part that are
 still not really clear for me.

 First question: what parts of lift are thread safe ? In particular, does
 the request/response handling cycle is thread safe ? I thing so, but I
 didn't found any doc that assert that.

Yes it is thread safe. It is one of the most fundamental design scopes
of lift. Do you have any specifics in mind that you need answers?


 Second question: how transaction are handled with Lift default ORM
 layout ? I'm didn't see how we declare a transaction, and especially how
 one can handle rollbacks.

Please see DB.scala commit/rollback semantics are there.


 Any inputs or links toward resources answering these two points would be
 much appreciated !

 Thanks in advance,

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



[Lift] Re: Thead safe part and transaction management in Lift

2009-06-24 Thread marius d.



On Jun 24, 2:18 pm, fan...@gmail.com fan...@gmail.com wrote:
 marius d. a écrit :

  Yes it is thread safe. It is one of the most fundamental design scopes
  of lift. Do you have any specifics in mind that you need answers?

 No, in fact I took as an assumption the thread-safety of
 request/response (and I saw some thread local call in the lift code),
 but it was to be sure :)

We use thread locals quite a bit for request life cycle state
management. i.e. in S object, RequestVar etc. It is a concise model of
scoping state.


  Second question: how transaction are handled with Lift default ORM
  layout ? I'm didn't see how we declare a transaction, and especially how
  one can handle rollbacks.

  Please see DB.scala commit/rollback semantics are there.

 OK, I see the code, and I discover a buildLoanWrapper that perhaps I
 could call in Boot class, to have default behaviour for transaction.

 Thank you very much for your answers !

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



[Lift] Re: Stax

2009-06-24 Thread marius d.

Would be neat to have a Lift application template when creating a new
stax app. And the fact they are using Amazon EC2 is really great.

Br's,
Marius

On Jun 24, 4:53 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Folks,
 The folks in the ESME project have been hosting demo versions of ESME 
 onhttp://stax.net/

 I had the pleasure of speaking with the CEO of
 Stax yesterday.  I really like his vision of where he wants to take
 Stax.  Plus, I think that Stax offers everything that GAE offers plus
 a lot more flexibility and potential future growth.

 One of the things I'm not so good with is figuring out the details of
 what is needed for a given technology to be useful for an audience as
 broad as the Lift community... I don't know what kinds of things are
 necessary to have on the toolchain.

 Could a few of you play with Stax and put together a list of stuff you'd
 like to see in Stax with respect to Lift.  Having that list will help guide
 the Stax folks to making Lift support even better.

 Thanks,

 David

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift presentation

2009-06-25 Thread marius d.

I'm giving today a presentation for Transylvania JUG  ... I'll email
you my material.

Br's,
Marius

On Jun 25, 8:04 am, Wilson MacGyver wmacgy...@gmail.com wrote:
 Hi,

 I'm doing a presentation on lift to my local java user group next month.

 I'm wondering if any of you have slides on lift that I can borrow/leverage? :)

 Thanks,
 Mac

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



[Lift] Re: form element specific error messages

2009-06-26 Thread marius d.


 lift:Customer.newCustomer form=POST
   divnewCustomer:firstName/newCustomer:firstName/divlift:msg
id=firstNameError/
   divnewCustomer:lastName/newCustomer:lastName/divlift:msg
id=lastNameError/
   divnewCustomer:submit //div
 /lift:Customer.newCustomer


In your snippet when you need to set the error message just call:

S.error(firstname, an error message)


br's,
Marius

On Jun 26, 3:10 am, Trav wilhel...@gmail.com wrote:
 I have a form such as:

 lift:Customer.newCustomer form=POST
   divnewCustomer:firstName/newCustomer:firstName/div
   divnewCustomer:lastName/newCustomer:lastName/div
   divnewCustomer:submit //div
 /lift:Customer.newCustomer

 and a bind:

 bind(newCustomer, xhtml,
    firstName - text(XXX),
    lastName - text(XXX),
    submit - submit(XXX)
 )

 If I want to require that both first and last name are required, but
 the form is submitted with no last name, how anyone suggest that I put
 the error message *Required in the appropriate div tag next to the
 text box.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Warnings for missing binds?

2009-06-26 Thread marius d.

That would be nice ... but still what was the problem with unused bind
params? ... could you please elaborate a bit?

Br's,
Marius

On Jun 26, 6:32 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 I just spent the better part of half a day trying to track down an issue
 with binding that ended up being a subtle typo. I'm thinking of adding in
 some logging (in dev mode) for the bind function to warn about unused bind
 elements and unused bind params, just to better help locate issues like
 this. Any objections?

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



[Lift] Re: Warnings for missing binds?

2009-06-26 Thread marius d.

Ah right  ... by all means please add this.

On Jun 26, 7:57 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 I meant that it could warn you if your bind tag looks like:

 lift:bind name=content /

 But you made a mistake with your surround tag:

 lift:surround at=contet / (notice the misspelling)

 I was thinking that you would get two warnings:

    1. One that nothing had matched the content name
    2. One that there was an unused contet surround

 Derek

 On Fri, Jun 26, 2009 at 9:52 AM, marius d. marius.dan...@gmail.com wrote:

  That would be nice ... but still what was the problem with unused bind
  params? ... could you please elaborate a bit?

  Br's,
  Marius

  On Jun 26, 6:32 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
   I just spent the better part of half a day trying to track down an issue
   with binding that ended up being a subtle typo. I'm thinking of adding in
   some logging (in dev mode) for the bind function to warn about unused
  bind
   elements and unused bind params, just to better help locate issues like
   this. Any objections?

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



[Lift] Re: suggestion: I'm a brand spanking new user....some first impressions on 'getting started'

2009-06-27 Thread marius d.

You can also look son the examples application that come with Lift in
sites folder. Just get lift from github.

Br's,
Marius

On Jun 27, 6:22 am, g-man gregor...@gmail.com wrote:
 My path to learning was threefold:

 1. Do the 'ToDo' app tutorial, while studying the 'PocketChange' app
 from the book at the same time.

 2. Read the Lift book.

 3. Read David's and the 'Staircase' Scala books.

 I agree that, compared to the wealth of information, books, tutorials,
 videos, etc to be found on Rails, GAE-Django, and web2py, there is far
 less for Lift and Scala, but this is a young (and, in my opinion, much
 more advanced) framework, so it will take time.

 Tell us what you have learned, as I am doing on the group!

 On Jun 26, 6:14 pm, Rick ric...@gmail.com wrote:

  Today is my very first day that I planned to take a serious look at Lift.
  I've coded webapps in many different frameworks and plan to do a simple
  Employee app and add my 'how to' to the site I host 
  herehttp://www.learntechnology.net/content/main.jsp(whichmany of the 
  examples
  there show the same application being built with different frameworks.)

  Some users like myself might want to start by looking at an existing
  examples before going through the exact step by step as described in the
  user manual (which has  a broken link to the wiki by the way -yes, I
  submitted a bug report.)

  If I want to take that route there should be a quick way to find example
  projects with the source code. Finding these example was extremely
  tedious

  At some point a new user might go the wiki. ..
  you get to the wiki page looking for examples..
  you look at the content menu..
  you might try the 'cheat sheet getting started link'...
  cheat by examples has a link 'lift by examples', but that doesn't seem to
  really show example apps?
  BY CHANCE, I happened to see in a How To - how to run examples (which at
  first i thought why would I click this when I haven't even seen any
  examples?), but I clicked it anyway..
  Then on the how to run examples' link I was excited to see a list of some
  examples  (buried way to deep for a new user to find imo.)
  Yet only the war links work? None of the project links are active?

  Finding example apps to study and learn by is seemingly very difficult to
  do. Are there any out there? If so where?

  For new user, learning by examples is extremely important. I think a lot of
  new users will be turned off if it's difficult to find some example
  applications to study to learn from.

  I understand all of this is open source and I plan to write a tutorial once
  I learn it, but it would be nice to find some existing apps to start with.

  thanks for all the work done so far.

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



[Lift] Re: liftweb.net down now, and maven refuses to compile

2009-06-27 Thread marius d.

try maven -o 

Marius

On Jun 27, 11:46 am, Ellis ellis.whiteh...@gmail.com wrote:
 Maven is suddenly refusing to compile because scala-tools.org is
 down.  Can the liftweb-snapshot-1.1 POM be changed in order to let
 maven work in offline mode?

 Here's an excerpt of the error message when trying to run in offline
 mode:
 $ mvn -o -npu compile
 [INFO]
 NOTE: Maven is executing in offline mode. Any artifacts not already in
 your local
 repository will be
 inaccessible.
 ...
 [ERROR] BUILD
 ERROR
 [INFO]
 
 [INFO] Failed to resolve
 artifact.
 ...
 Missing:
 --
 1) net.liftweb:lift-util:jar:1.1-SNAPSHOT
 ...

 The files DO appear to be in my local repository, last updated via
 maven yesterday at 15:20 GMT:
 $ ls -1 /home/ellis/.m2/repository/net/liftweb/lift-util/1.1-SNAPSHOT/
 lift-util-1.1-SNAPSHOT.jar
 lift-util-1.1-SNAPSHOT.jar.sha1
 lift-util-1.1-SNAPSHOT-javadoc.jar.lastUpdated
 lift-util-1.1-SNAPSHOT.pom
 lift-util-1.1-SNAPSHOT.pom.sha1
 lift-util-1.1-SNAPSHOT-sources.jar
 lift-util-1.1-SNAPSHOT-sources.jar.sha1
 maven-metadata-scala-tools.org.snapshots.xml
 maven-metadata-scala-tools.org.snapshots.xml.sha1
 maven-metadata-scala-tools.org.xml
 resolver-status.properties

 Any ideas how to force maven to use the files that it was content to
 use yesterday?

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



[Lift] Re: liftweb.net down now, and maven refuses to compile

2009-06-27 Thread marius d.

dunno who can help .. I sent an email on scala-list but nothing yet

On Jun 27, 12:17 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 @marius Is there anyone around to checkup on scala-tools? DavidB  
 doesn't monitor the lift list much these days and I'm not sure if  
 there are any other non-American guys (I.e people who are awake now!)  
 to take a look at the server?

 Cheers, Tim

 Sent from my iPhone

 On 27 Jun 2009, at 10:06, marius d. marius.dan...@gmail.com wrote:



  try maven -o 

  Marius

  On Jun 27, 11:46 am, Ellis ellis.whiteh...@gmail.com wrote:
  Maven is suddenly refusing to compile because scala-tools.org is
  down.  Can the liftweb-snapshot-1.1 POM be changed in order to let
  maven work in offline mode?

  Here's an excerpt of the error message when trying to run in offline
  mode:
  $ mvn -o -npu compile
  [INFO]
  NOTE: Maven is executing in offline mode. Any artifacts not already  
  in
  your local
  repository will be
  inaccessible.
  ...
  [ERROR] BUILD
  ERROR
  [INFO]
  ---
  -
  [INFO] Failed to resolve
  artifact.
  ...
  Missing:
  --
  1) net.liftweb:lift-util:jar:1.1-SNAPSHOT
  ...

  The files DO appear to be in my local repository, last updated via
  maven yesterday at 15:20 GMT:
  $ ls -1 /home/ellis/.m2/repository/net/liftweb/lift-util/1.1-
  SNAPSHOT/
  lift-util-1.1-SNAPSHOT.jar
  lift-util-1.1-SNAPSHOT.jar.sha1
  lift-util-1.1-SNAPSHOT-javadoc.jar.lastUpdated
  lift-util-1.1-SNAPSHOT.pom
  lift-util-1.1-SNAPSHOT.pom.sha1
  lift-util-1.1-SNAPSHOT-sources.jar
  lift-util-1.1-SNAPSHOT-sources.jar.sha1
  maven-metadata-scala-tools.org.snapshots.xml
  maven-metadata-scala-tools.org.snapshots.xml.sha1
  maven-metadata-scala-tools.org.xml
  resolver-status.properties

  Any ideas how to force maven to use the files that it was content to
  use yesterday?

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



[Lift] Re: Turning on Logging for third-party libraries in Lift

2009-06-27 Thread marius d.

I think that simply putting log4j.xml in WEB-INF/classes folder does
the trick.

Br's,
Marius

On Jun 27, 3:06 am, Alan M alan.morten...@gmail.com wrote:
 I'm trying to enable log4j logging in a third party library (well
 third party to me.. it was developed in house) so that it logs it's
 output to the same place my Lift webapp logs.

 In the third party library, a log4j Logger is obtained and used but no
 setup is done, figuring the log4j config will be done by the app
 builder.

 Now I figured the root logger would catch it.. but it didn't seem to
 work.  So I added a specific logger with the exact string used in the
 third party code..  Still no output..

 Am I missing something about class loaders?  Or is there something
 about start-up that's messing with the getLogger method (it's actually
 in the method so it should be happening after Lift initializes
 everything)?  Or is there something else special about lift logging
 that won't let the library piggy back off of it?

 BTW, I should mention that Lift logging otherwise is working for me.
 By otherwise I mean when logging from any classes directly in the web-
 app classes directory.

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



[Lift] Re: liftweb.net down now, and maven refuses to compile

2009-06-27 Thread marius d.

Sorry

On Jun 27, 1:03 pm, Ellis ellis.whiteh...@gmail.com wrote:
  try maven -o 

 The point of my message was that maven -o doesn't work! :)

 On Jun 27, 11:06 am, marius d. marius.dan...@gmail.com wrote:

  try maven -o 

  Marius

  On Jun 27, 11:46 am, Ellis ellis.whiteh...@gmail.com wrote:

   Maven is suddenly refusing to compile because scala-tools.org is
   down.  Can the liftweb-snapshot-1.1 POM be changed in order to let
   maven work in offline mode?

   Here's an excerpt of the error message when trying to run in offline
   mode:
   $ mvn -o -npu compile
   [INFO]
   NOTE: Maven is executing in offline mode. Any artifacts not already in
   your local
   repository will be
   inaccessible.
   ...
   [ERROR] BUILD
   ERROR
   [INFO]
   
   [INFO] Failed to resolve
   artifact.
   ...
   Missing:
   --
   1) net.liftweb:lift-util:jar:1.1-SNAPSHOT
   ...

   The files DO appear to be in my local repository, last updated via
   maven yesterday at 15:20 GMT:
   $ ls -1 /home/ellis/.m2/repository/net/liftweb/lift-util/1.1-SNAPSHOT/
   lift-util-1.1-SNAPSHOT.jar
   lift-util-1.1-SNAPSHOT.jar.sha1
   lift-util-1.1-SNAPSHOT-javadoc.jar.lastUpdated
   lift-util-1.1-SNAPSHOT.pom
   lift-util-1.1-SNAPSHOT.pom.sha1
   lift-util-1.1-SNAPSHOT-sources.jar
   lift-util-1.1-SNAPSHOT-sources.jar.sha1
   maven-metadata-scala-tools.org.snapshots.xml
   maven-metadata-scala-tools.org.snapshots.xml.sha1
   maven-metadata-scala-tools.org.xml
   resolver-status.properties

   Any ideas how to force maven to use the files that it was content to
   use yesterday?

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



[Lift] Re: scala-tools.org down

2009-06-27 Thread marius d.

Thanks Derek.

On Jun 27, 6:54 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Hi all,
     DPP gave me access to the primary Xen server that everything else runs
 on, but I'm unable to reach it. This may either be a network failure or a
 total hardware failure, but it's unclear at this point. I'm going to call
 CalPop, the hosting provider, and see if they can look at the box.

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



[Lift] Re: Lift + Javeline

2009-06-28 Thread marius d.

Ok ... the problem was that lift automatically set by default text/x-
html content type. Looks like with FF this is not ok from javeline
perspective.

Setting LiftRules.useXhtmlMimeType = false

did the trick.

... just in case someone runs into the same issues.

Br's,
Marius

On Jun 18, 12:11 am, Matt Williams m...@makeable.co.uk wrote:
 Maybe an issue with the compressor?

 (although i dont see why that would just affect firefox)

 On Wed, 2009-06-17 at 14:00 -0700, marius d. wrote:
  Just 2.1 version ... we'll try that out. It's still a mystery because
  offline example works but wen putting it in lift fails only on FF. So
  far there is no indication that Lift is doing anything wrong.

  Br's,
  Marius

  On Jun 17, 4:14 pm, Matt Williams m...@makeable.co.uk wrote:
   Are you using the latest version from the repository?
   There were a few firefox fixes put in place a week or so ago.

   On Jun 17, 1:18 pm, Marius marius.dan...@gmail.com wrote:

Hi all,

We've been tryingjaveline(http://ajax.org/) with Lift and it's
pretty needless to say how cool it is. It seems to work fine in
Chrome, IE6/7, Safari but we're getting a strange JS error on FF3
only.

Seehttp://scalaliftapp.appspot.com/example2... or FF3 we're getting
this.oDrag is null JS error. Did anyone experience this before?

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



[Lift] Re: preso on monadic design patterns for the web

2009-06-28 Thread marius d.

Great, great talk !!! .. congrats Greg.

Br's,
Marius

On Jun 29, 2:05 am, Meredith Gregory lgreg.mered...@gmail.com wrote:
 All,

 The talk i recently gave on this topic is now available
 onlinehttp://www.vimeo.com/5318303
 .

 Best wishes,

 --greg

 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 1219 NW 83rd St
 Seattle, WA 98117

 +1 206.650.3740

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



[Lift] Re: Writing Facebook applications in Lift (cookies, Javascript GC, example code)

2009-06-29 Thread marius d.



On Jun 29, 1:13 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Steven,

 Welcome to lift.

 Lift doesn't use the JSESSIONID in the URL... that is, lift does not
 require it (at least this is my understanding, if im wrong please
 correct me someone) - so you should have no problems with the requests
 being re-written.

Actaully Lift is no different then a regular JEE web app. If you turn
off cookies from the container you'll witness URL rewriting and
JSESSIONID will be part of the URL.


 Regarding the GC stuff, it was added to improve memory usage of
 applications that run over a long period and to keep the heap size
 down. Marius or DPP would probably be able to give you more specifics
 but I think if your users are moving from page to page and you can
 cope with a slightly larger heap size then it shouldn't be too much of
 a problem. We did after all do without the GC stuff for quite sometime
 as it was only added recently.

Essentially Lift GC is about de-referencing unseen bound functions if
a certain period of time exceeds. There is a lightweight heart beat
mechanism where Ajax requests are sent to keep functions alive. Of
course bound function are associated with a generated page-id.


 Hope that helps

 Tim

 On Jun 28, 8:52 pm, Steven Murdoch sjmurd...@gmail.com wrote:

  Hi,

  I've been looking at Scala and Lift recently, and so far have been
  generally impressed. I'd like to write a Facebook application, both
  because I need one, and so I can learn more about Lift and Scala. I do
  have a few questions though, and I haven't been able to find answers
  in the documentation or mailing list.

  The first is about cookies and state. Facebook canvas applications
  return pages which are re-written by the Facebook servers, so the
  JSESSIONID cookie will not be present. As I understand it, that means
  I'll need to manage state myself. I was therefore thinking about
  returning pages from LiftRules.statelessDispatchTable (as described in
  the Lift book, 3.13).

  The problem here is that I'd need to return a LiftResponse directly,
  and wouldn't be able to use most of the Lift infrastructure. Is this
  the right way to do things? Is there some other way to suppress
  cookies
  and/or use Lift without them in the Facebook application context?

  My second question is also because Facebook suppresses Javascript when
  it processes web pages written in FBML. This means that the
  client-side code to do garbage collection of widgets won't run. I can
  disable the insertion using LiftRules.enableLiftGC, but will this
  trigger other problems?

  Finally, is there example code available for lift-facebook? It's great
  that Lift supports Facebook, but other than a small mention in the
  Lift book, I haven't been able to find any documentation. Some example
  code would be very useful in getting started. Is there any available?

  Thanks in advance,
  Steven Murdoch.

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



[Lift] Re: lift presentation

2009-06-29 Thread marius d.

I had it last Thursday  ... it was a ~ 40 Java  people ...very few
(colleagues of mine) that heard and try Scala  Lift ... I think it
went ok cause I got plenty of questions + some Java jokes about
Scala's syntax and principles but I expected that.

I guess most of the functional concept are hard to grasp by an
imperative mind ... at least not in 2 hours presentation :D

Br's,
Marius

On Jun 29, 7:35 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
 Thank you for the links. I'll be borrowing those too. :) And thanks forthe
 lift. :) (ducking from incoming tomatoes)

 On Mon, Jun 29, 2009 at 12:31 PM, David Pollak 



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

  On Thu, Jun 25, 2009 at 5:24 AM, Jeremy Day jeremy@gmail.com wrote:

  Guys,

  I just want to say that I haven't started using Lift yet but I already
  love it.  This community is very supportive and responsive.  Keep up the
  awesome work!

  Grin!  This is the kind of message (and thread) that makes coming home from
  vacation a very good thing!

  My most recent Lift/Scala preso is the dpp_osb.odp file in
 http://github.com/dpp/lift-samples/tree/61c376dc9f0d99113229894d4a5b8...

  Also, please seehttp://liftweb.blip.tv

  Basically, the preso is building the chat app in 40 lines of code in front
  of people, then discussing the Scala language features that make it
  possible.

  Jeremy

  On Thu, Jun 25, 2009 at 7:21 AM, Wilson MacGyver 
  wmacgy...@gmail.comwrote:

  heheh, no problem. I did the one on Scala back in Feb. :)

  On Thu, Jun 25, 2009 at 7:31 AM, Francois Armandfan...@gmail.com
  wrote:

   I did a presentation some weeks ago, the slides are under a creative
  common
   licence, so use them if you want !

 http://fanf42.blogspot.com/2009/06/tour-of-scala-ossgtp-paris-oss-use...

   OK, just ignore this message, it was a *Scala* presentation, not a
   *Lift* one - sorry, I read your post too quickly - and no, the fact
   that we were in Lift ml didn't make me find that strange :)

   --
   --
   Francois Armand
  http://fanf42.blogspot.com/

  --
  Omnem crede diem tibi diluxisse supremum.

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

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



[Lift] Re: can a Snippet call a Snippet?

2009-06-30 Thread marius d.

Can you paste some code?

Essentially we support nested snippets so your snippet can simply
return a markup containing another snippet and it will be invoked. If
you really want to manually invoke a snippet from another snippet and
if you are not using StatefulSnippets you can just instantiate the
class and call your function and pass it the right NodeSeq.

Br's,
Marius

On Jun 30, 5:36 am, g-man gregor...@gmail.com wrote:
 I am enhancing the Todo app by adding tags.

 I have retained the TD.scala snippet to manage the Todos on my page,
 and added a TG.scala snippet to handle tags on the same page, which
 works well for creating new and listing in both cases.

 Now I want to filter my Todos list by a Tag instance I select from my
 list, and therefore need to pass the id of the selected tag over from
 the TG snippet to the TD snippet, where it can be used as a filter
 argument for a find method.

 The problem is that scala says it cannot find snippet TD, whose method
 I am calling as TD.list from the TG.scala snippet. I have tried all
 kinds of explicit importing, but no luck.

 So,  can a snippet call a snippet, or is that controlled only from the
 web page?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: can a Snippet call a Snippet?

2009-06-30 Thread marius d.

Or you can use S.locateMappedSnippet ... but first try to see if
nested snippet won't do the trick for you ...

On Jun 30, 10:17 am, marius d. marius.dan...@gmail.com wrote:
 Can you paste some code?

 Essentially we support nested snippets so your snippet can simply
 return a markup containing another snippet and it will be invoked. If
 you really want to manually invoke a snippet from another snippet and
 if you are not using StatefulSnippets you can just instantiate the
 class and call your function and pass it the right NodeSeq.

 Br's,
 Marius

 On Jun 30, 5:36 am, g-man gregor...@gmail.com wrote:

  I am enhancing the Todo app by adding tags.

  I have retained the TD.scala snippet to manage the Todos on my page,
  and added a TG.scala snippet to handle tags on the same page, which
  works well for creating new and listing in both cases.

  Now I want to filter my Todos list by a Tag instance I select from my
  list, and therefore need to pass the id of the selected tag over from
  the TG snippet to the TD snippet, where it can be used as a filter
  argument for a find method.

  The problem is that scala says it cannot find snippet TD, whose method
  I am calling as TD.list from the TG.scala snippet. I have tried all
  kinds of explicit importing, but no luck.

  So,  can a snippet call a snippet, or is that controlled only from the
  web page?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Examples of ajaxForm(...)

2009-06-30 Thread marius d.

Imagine that your snippet has a bunch of form elements ... such as:


lift:Ajax.form

 f:inputFirstName/
 f:inputLastName/

/lift:Ajax.form

and your snippet function:

def form(xml: NodeSeq): NodeSeq = {

  ajxForm(bind(
   f, xml,
   inputFirstName -SHtml.text(, (s) = {//do something here})
   inputLastName -SHtml.text(, (s) = {//do something here})
  ) ++ SHtml.hidden(() = {
  // Do processing
}))
}

So to the snippet child nodes we append a hidden element where we have
our processing function. Note that Lift automatically serializes the
form elements as key/value pairs forming a HTTP query string. Hence in
your anonymous function fir the hidden element you can just do
whatever action you want. I actually added the hidden so that when
it's called all functions bound to you form lements were executed.


The other way of working with ajax forms is to actually use jsonForm.

Br's,
Marius

On Jun 30, 8:39 pm, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:
 Hi, all,

 I'm looking for some examples of uses of ajaxForm in cases where
 multiple form elements are included and processed on submit. Can
 someone point me in the right direction? The only examples I found in
 the example apps on github were related to Comet.

 Thanks,

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



[Lift] Re: Setting Session Timeout?

2009-07-01 Thread marius d.

LiftSession is bound to HttpSession through HttpSessionBindingListener
and HttpSessionActivationListener

This means that when the HTTP session terminates LiftSession will also
terminate. To verify your SessionVar that the session was purged you
can implement

override protected def onShutdown(session: CleanUpParam): Unit = {
...
}

where in case of SessionVar the session parameter is really a
LiftSession.


The LiftSession timeout is given by
HttpSession.getMaxInactiveInterval ... if that period is exceeded the
LiftSession is unbound from the HttpSession. Does not necessary means
that the HttpSession is removed by container ust that LiftSession is
terminated.


But is the problem the fact that HttpSession expired but you still had
the context in the SessionVar?

Br's,
Marius

On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote:
 I have recently started using a SessionVar and am quite happy to have
 the session wiped after some predefined interval.  As an experiment I
 changed the session timeout in the web.xml a la Java Servlets but this
 had no effect running on jetty and since I have read that a SessionVar
 is not just a wrapper around javax.servlet.http.HttpSession.  My
 question is then how can I configure the timeout interval?

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



[Lift] Re: Setting Session Timeout?

2009-07-01 Thread marius d.

You answered your own question :) ... Yes that is Lift GC mechanism.
You can of course turn it off in Boot by calling 
LiftRules.enableLiftGC=false  but I would not recommend it.

Is there a real use case why you need this or just tying to figure out
how Lift works ?

Br's,
Marius

On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote:
 Thanks Marius

 I basically wound the session timeout down to 5 mins in the web.xml
 and left it for about 30 mins but the sessionVar was still full.  Even
 after some hours of no use it was the same.  There is this constant
 ajax_request pinging going on - related?

 -- Ewan

 On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote:

  LiftSession is bound to HttpSession through HttpSessionBindingListener
  and HttpSessionActivationListener

  This means that when the HTTP session terminates LiftSession will also
  terminate. To verify your SessionVar that the session was purged you
  can implement

  override protected def onShutdown(session: CleanUpParam): Unit = {
  ...

  }

  where in case of SessionVar the session parameter is really a
  LiftSession.

  The LiftSession timeout is given by
  HttpSession.getMaxInactiveInterval ... if that period is exceeded the
  LiftSession is unbound from the HttpSession. Does not necessary means
  that the HttpSession is removed by container ust that LiftSession is
  terminated.

  But is the problem the fact that HttpSession expired but you still had
  the context in the SessionVar?

  Br's,
  Marius

  On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote:

   I have recently started using a SessionVar and am quite happy to have
   the session wiped after some predefined interval.  As an experiment I
   changed the session timeout in the web.xml a la Java Servlets but this
   had no effect running on jetty and since I have read that a SessionVar
   is not just a wrapper around javax.servlet.http.HttpSession.  My
   question is then how can I configure the timeout interval?

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



[Lift] Re: Setting Session Timeout?

2009-07-01 Thread marius d.

Well I think I can commit something very simple that could help you,

Currently session expiration mechanism considered only the time
threshold ... but the lift GC is keeping it alive. So we can have
LiftSession#terminateHint function that just marks a flag on this
LiftSession. SessionMaster can consider this and purge the session
properly at the next sessions scan. So you can have an actor where
you're sending messages via ActorPing such as:

ActorPing schedule(MyActor, Purge(S.session), 120 seconds)

When you receive the Purg message on the received LiftSession just
call session.terminateHint. (Note that S.session is a Box
[LiftSession])

The questions would be when am I going to do this scheduling? ... Well
probably right after you are setting a value on your SessionVar.



If someone has any objections about this please do let me know.
Otherwise I could probably commit this today.

Br's,
Marius


On Jul 1, 3:08 pm, Ewan ehar...@gmail.com wrote:
 My use case is that I want to save anonymous users' (users that have
 not logged on or registered) baskets in the session and don't care if
 they are removed after a period of inactivity.  In fact I would like
 the session to be expired after a while to encourage the user to sign
 up which if they do they get the benefit that the basket is persisted.

 --Ewan

 On Jul 1, 12:59 pm, marius d. marius.dan...@gmail.com wrote:

  You answered your own question :) ... Yes that is Lift GC mechanism.
  You can of course turn it off in Boot by calling 
  LiftRules.enableLiftGC=false  but I would not recommend it.

  Is there a real use case why you need this or just tying to figure out
  how Lift works ?

  Br's,
  Marius

  On Jul 1, 2:42 pm, Ewan ehar...@gmail.com wrote:

   Thanks Marius

   I basically wound the session timeout down to 5 mins in the web.xml
   and left it for about 30 mins but the sessionVar was still full.  Even
   after some hours of no use it was the same.  There is this constant
   ajax_request pinging going on - related?

   -- Ewan

   On Jul 1, 12:32 pm, marius d. marius.dan...@gmail.com wrote:

LiftSession is bound to HttpSession through HttpSessionBindingListener
and HttpSessionActivationListener

This means that when the HTTP session terminates LiftSession will also
terminate. To verify your SessionVar that the session was purged you
can implement

override protected def onShutdown(session: CleanUpParam): Unit = {
...

}

where in case of SessionVar the session parameter is really a
LiftSession.

The LiftSession timeout is given by
HttpSession.getMaxInactiveInterval ... if that period is exceeded the
LiftSession is unbound from the HttpSession. Does not necessary means
that the HttpSession is removed by container ust that LiftSession is
terminated.

But is the problem the fact that HttpSession expired but you still had
the context in the SessionVar?

Br's,
Marius

On Jul 1, 12:47 pm, Ewan ehar...@gmail.com wrote:

 I have recently started using a SessionVar and am quite happy to have
 the session wiped after some predefined interval.  As an experiment I
 changed the session timeout in the web.xml a la Java Servlets but this
 had no effect running on jetty and since I have read that a SessionVar
 is not just a wrapper around javax.servlet.http.HttpSession.  My
 question is then how can I configure the timeout interval?

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



[Lift] Re: Changes to ajax handling?

2009-07-01 Thread marius d.



On Jul 2, 12:40 am, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:
 To answer my own question, looking over the commit log 28595307 looks
 extremely suspicious. I can revert it locally but would prefer a
 mainline fix, and don't want to attempt it myself. Marius?

 Kris

 On Wed, Jul 1, 2009 at 3:33 PM, Kris

 Nuttycombekris.nuttyco...@gmail.com wrote:
  Hi, all,

  Have there been recent changes made to liftAjax.js? I am encountering
  new errors from an ajaxSelect() today that were not present yesterday.
  Firebug complains:

  Use of getBoxObjectFor() is deprecated. Try to use
  element.getBoundingClientRect() if possible.
  [Break on this error] undefined
  liftAjax.js (line 111)
  aboutToSend.responseType is null
  lift_doAjaxCycle()()liftAjax.js (line 111)
  lift_ajaxHandler()()liftAjax.js (line 21)
  onchange(change )add_trig...Gyw%3D%3D (line 2)
  [Break on this error] if (aboutToSend.responseType.toLowerCase() === json)

That is my commt but right now I don,t see how it affects other
things ... But I,ll definitely look on it today. Note that there is no
intent for ajax behavior changes .. Just an augmentation ...

  Thanks,

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



[Lift] Re: Changes to ajax handling?

2009-07-02 Thread marius d.

Corrected and pushed. Please do an update and give it a try.

Br's,
Marius

On Jul 2, 8:56 am, marius d. marius.dan...@gmail.com wrote:
 On Jul 2, 12:40 am, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:



  To answer my own question, looking over the commit log 28595307 looks
  extremely suspicious. I can revert it locally but would prefer a
  mainline fix, and don't want to attempt it myself. Marius?

  Kris

  On Wed, Jul 1, 2009 at 3:33 PM, Kris

  Nuttycombekris.nuttyco...@gmail.com wrote:
   Hi, all,

   Have there been recent changes made to liftAjax.js? I am encountering
   new errors from an ajaxSelect() today that were not present yesterday.
   Firebug complains:

   Use of getBoxObjectFor() is deprecated. Try to use
   element.getBoundingClientRect() if possible.
   [Break on this error] undefined
   liftAjax.js (line 111)
   aboutToSend.responseType is null
   lift_doAjaxCycle()()liftAjax.js (line 111)
   lift_ajaxHandler()()liftAjax.js (line 21)
   onchange(change )add_trig...Gyw%3D%3D (line 2)
   [Break on this error] if (aboutToSend.responseType.toLowerCase() === 
   json)

 That is my commt but right now I don,t see how it affects other
 things ... But I,ll definitely look on it today. Note that there is no
 intent for ajax behavior changes .. Just an augmentation ...

   Thanks,

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



[Lift] Re: Changes to ajax handling?

2009-07-03 Thread marius d.

Yeah that what happens when you're coding late in the night ... the
null monster bites you.

Marius

On Jul 2, 7:47 pm, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:
 Marius, that fix appears to work fine, thank you!

 Bloody nulls. :)

 Kris

 On Thu, Jul 2, 2009 at 7:17 AM, marius d.marius.dan...@gmail.com wrote:

  Corrected and pushed. Please do an update and give it a try.

  Br's,
  Marius

  On Jul 2, 8:56 am, marius d. marius.dan...@gmail.com wrote:
  On Jul 2, 12:40 am, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:

   To answer my own question, looking over the commit log 28595307 looks
   extremely suspicious. I can revert it locally but would prefer a
   mainline fix, and don't want to attempt it myself. Marius?

   Kris

   On Wed, Jul 1, 2009 at 3:33 PM, Kris

   Nuttycombekris.nuttyco...@gmail.com wrote:
Hi, all,

Have there been recent changes made to liftAjax.js? I am encountering
new errors from an ajaxSelect() today that were not present yesterday.
Firebug complains:

Use of getBoxObjectFor() is deprecated. Try to use
element.getBoundingClientRect() if possible.
[Break on this error] undefined
liftAjax.js (line 111)
aboutToSend.responseType is null
lift_doAjaxCycle()()liftAjax.js (line 111)
lift_ajaxHandler()()liftAjax.js (line 21)
onchange(change )add_trig...Gyw%3D%3D (line 2)
[Break on this error] if (aboutToSend.responseType.toLowerCase() === 
json)

  That is my commt but right now I don,t see how it affects other
  things ... But I,ll definitely look on it today. Note that there is no
  intent for ajax behavior changes .. Just an augmentation ...

Thanks,

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



[Lift] Re: using file-based data storage in Lift app

2009-07-04 Thread marius d.

Try LiftRules.loadResourceAsXml

Br's,
Marius

On Jul 4, 1:11 am, glenn gl...@exmbly.com wrote:
 I've searched this group and combed through the lift book for an
 answer, but found none - how to use file-based storage for data within
 Lift.

 For example, how would I call something like:

 def xml = XML.loadFile(fileName)

 without getting a java.io.FileNotFoundException?

 I tried storing the files in a directory under webapp, and even
 included the directory in the resource path in Boot.scala, like so:

 ResourceServer.allow({
       case contents :: _ = true

     })

 But that doesn't work.

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



[Lift] Re: Scala job site written in Lift + a newcomer's experience

2009-07-06 Thread marius d.

First of all, thank you for you kind words. Your website is just great
but I'd recommend publishing the link on sc...@listes.epfl.ch as well.

As far as Lift  Scala goes, yes Lift in may respects requires
understanding the Scala language and because Scala comes with new
things/concepts a little bit of study is needed and I don't think
programmers should fear that. After all I really think it worth it.

P.S.
I really like how the site looks like ... do you have a web designer
or you are that good ? ... I'm asking this because we'd need a new
face lilft for the Lift web site we need a persons with artistic
skills and if those are combined with Scala  Lift skills would be
perfect. Tim Perrett mainly manages Lift site so if you are interested
in collaborating with Tim I'm sure something good would come up. Tim,
any thoughts?

Br's,
Marius

On Jul 6, 7:36 am, Spencer Uresk sur...@gmail.com wrote:
 Hey all,

 I hope this isn't considered spammy, but I wanted to send out a link  
 to a new website I built using Lift and share my experiences as a  
 Scala and Lift newbie.

 I've played around with Scala off and on for over a year now, and also  
 looked at Lift once or twice during that time. After going to David  
 Pollak's session at JavaOne about Lift, I decided to buckle down and  
 actually create something with Scala and Lift, as I usually learn new  
 things best by trying to create something useful. Looking around, I  
 noticed there weren't any Scala-specific job sites and thought it  
 might be nice to create one.

 Going into it, I was a little concerned about HTML being embedded in  
 Scala code, as the workflow (in both my day job and for my side work)  
 is typically a designer cutting HTML and handing it to me to  
 implement. I made sure my designer gave me valid XHTML and was  
 pleasantly surprised at how easy it was to make my HTML code work in  
 Lift. Even the user signup and login forms, which I got from the  
 Mapper library, were easy to override with my HTML.

 On the other hand, I sort of underestimated the time investment  
 required to get a simple site working. Lift really does require a good  
 understanding of Scala, and I found myself frustrated by stupid things  
 because of it. In the past, when learning Groovy and Ruby, I've used  
 their respective frameworks to learn the language itself, and I found  
 that didn't work quite as well with Lift. I'm not really complaining -  
 I know that the time invested will pay off handsomely in the future -  
 just making an observation.

 Really, I can't complain too much about the time it took to get up to  
 speed - I was able to get a functioning, albeit simple, site developed  
 in basically a long weekend, without having prior experience with Lift  
 outside of messing with the examples for a few minutes. Here is the  
 site I made:

 http://www.scalacareers.com/

 Obviously it is pretty simple, but I hope it is useful. I have a bunch  
 of other features I want to add to it as I continue to learn Lift, but  
 if any of you have suggestions for me, please feel free to send them  
 on over.

 Thank you for creating such a useful framework and for being such a  
 friendly and helpful community - that really does make a big  
 difference when first approaching a new language and framework!

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

And if you deploy only http://lsug.org/main/  does it work correctly?

Br's,
Marius

On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
wrote:
 I have two webapps, hosted on the same 
 server:http://lsug.org/main/http://lsug.org/stage/

 Problem is, the menu works just fine on the stage site, but not on the main
 site.
 Which is odd, as these sites should be identical.  I just renamed stage.war
 to main.war and let tomcat auto-deploy it

 The site is using tomcat 6 via apache 2 (with mod_jk proxying)
 The problem also appears if I access tomcat directly (i.e. not via apache)

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

Looks like there is an influence there but it should really not be
since each web application is loaded by a separate classloader.

1. Do you have any jars that these webapps are sharing?
2. If you put some logs in Boot do you see the logs correctly? ... If
you call LiftRules.siteMap after you set the siteMap gdo you get back
the right SiteMap ?


Br's,
Marius

On Jul 6, 1:35 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
 Marius, should I be thinking that you have a theory on this one?

 On Mon, Jul 6, 2009 at 9:55 AM, Kevin Wright
 kev.lee.wri...@googlemail.comwrote:

  Interesting... yes it does

  On Mon, Jul 6, 2009 at 9:51 AM, marius d. marius.dan...@gmail.com wrote:

  And if you deploy onlyhttp://lsug.org/main/ does it work correctly?

  Br's,
  Marius

  On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
  wrote:
   I have two webapps, hosted on the same server:
 http://lsug.org/main/http://lsug.org/stage/

   Problem is, the menu works just fine on the stage site, but not on the
  main
   site.
   Which is odd, as these sites should be identical.  I just renamed
  stage.war
   to main.war and let tomcat auto-deploy it

   The site is using tomcat 6 via apache 2 (with mod_jk proxying)
   The problem also appears if I access tomcat directly (i.e. not via
  apache)

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

Oh btw. did you explicitly set the context path for each app ?

On Jul 6, 2:09 pm, marius d. marius.dan...@gmail.com wrote:
 Looks like there is an influence there but it should really not be
 since each web application is loaded by a separate classloader.

 1. Do you have any jars that these webapps are sharing?
 2. If you put some logs in Boot do you see the logs correctly? ... If
 you call LiftRules.siteMap after you set the siteMap gdo you get back
 the right SiteMap ?

 Br's,
 Marius

 On Jul 6, 1:35 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:

  Marius, should I be thinking that you have a theory on this one?

  On Mon, Jul 6, 2009 at 9:55 AM, Kevin Wright
  kev.lee.wri...@googlemail.comwrote:

   Interesting... yes it does

   On Mon, Jul 6, 2009 at 9:51 AM, marius d. marius.dan...@gmail.com wrote:

   And if you deploy onlyhttp://lsug.org/main/ does it work correctly?

   Br's,
   Marius

   On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
   wrote:
I have two webapps, hosted on the same server:
  http://lsug.org/main/http://lsug.org/stage/

Problem is, the menu works just fine on the stage site, but not on the
   main
site.
Which is odd, as these sites should be identical.  I just renamed
   stage.war
to main.war and let tomcat auto-deploy it

The site is using tomcat 6 via apache 2 (with mod_jk proxying)
The problem also appears if I access tomcat directly (i.e. not via
   apache)

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

Well I just deployed 2 different Lift apps in jetty and everything is
working fine.

Here is wild thought can you try changing the package names. I
know it shouldn't matter but this is an awkward case still.

Br's,
Marius

On Jul 6, 2:32 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
 I agree with your thinking that this looks like a classloading issue, but
 haven't (yet) tried any clever optimisations here :)
 The only shared jars are those supplied by default via java/tomcat.  When I
 get a moment though, it might be worth checking for the usual culprits
 (commons-logging, etc).

 I didn't try to read back the sitemap in my code, it's just two statically
 defined locs (see the source on github).  I can certainly attempt the
 readback for troubleshooting purposes, but still not sure how this can help
 us track down the issue if it fails...

 Context paths are not explicitly set, no custom context.xml files, nothing
 special in tomcat whatsoever - the two war files are auto-deployed and are
 identical (apart from their names, obviously)

 On Mon, Jul 6, 2009 at 12:18 PM, marius d. marius.dan...@gmail.com wrote:

  Oh btw. did you explicitly set the context path for each app ?

  On Jul 6, 2:09 pm, marius d. marius.dan...@gmail.com wrote:
   Looks like there is an influence there but it should really not be
   since each web application is loaded by a separate classloader.

   1. Do you have any jars that these webapps are sharing?
   2. If you put some logs in Boot do you see the logs correctly? ... If
   you call LiftRules.siteMap after you set the siteMap gdo you get back
   the right SiteMap ?

   Br's,
   Marius

   On Jul 6, 1:35 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:

Marius, should I be thinking that you have a theory on this one?

On Mon, Jul 6, 2009 at 9:55 AM, Kevin Wright
kev.lee.wri...@googlemail.comwrote:

 Interesting... yes it does

 On Mon, Jul 6, 2009 at 9:51 AM, marius d. marius.dan...@gmail.com
  wrote:

 And if you deploy onlyhttp://lsug.org/main/does it work correctly?

 Br's,
 Marius

 On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:
  I have two webapps, hosted on the same server:
http://lsug.org/main/http://lsug.org/stage/

  Problem is, the menu works just fine on the stage site, but not on
  the
 main
  site.
  Which is odd, as these sites should be identical.  I just renamed
 stage.war
  to main.war and let tomcat auto-deploy it

  The site is using tomcat 6 via apache 2 (with mod_jk proxying)
  The problem also appears if I access tomcat directly (i.e. not via
 apache)

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



[Lift] Re: Using AJAX calls in Lift Snippets

2009-07-06 Thread marius d.



On Jul 6, 5:44 pm, Gonzalo N gonn...@gmail.com wrote:
 Hello!

 I am having a problem with a javascript function that creates a new
 textarea from a snippet. I am using the Lift 1.0-SNAPSHOT version and
 the Scala version 2.7.4.
 Basically, what I am doing is creating a ajaxButton in a snippet, that
 calls a JavaScript function to create new textareas, like this:
 Snippet - Submit.scala
 class Submit {
         def createDescription (xhtml : NodeSeq) : NodeSeq = {
                
               def accept () = {
                     .
               }
                
                bind(createDescription, xhtml,
                    function_definition - SHtml.textarea(,
 function_definition = _, (id, functionDefinitionArea), (rows,
 6), (cols, 60), (maxlength, 1)),
                    buttonFunDef - SHtml.ajaxButton(Text(Add
 Function Definition), JE.Call(AddFunctionDefinition), () = {println
 (pressed); JsCmds.Noop}),
                     save - SHtml.submit(Submit, accept))
         }

 }

 Then in the javascript file, I have the function
 AddFunctionDefinition.js that :
 function AddFunctionDefinition() {
         var container = document.getElementById('function_def');
         var new_FD = document.createElement('li');

         new_FD.innerHTML = createDescription:function_definition /
         container.insertBefore(new_FD, container.firstChild);

 }

I'm a bit confused .. from a JS function you're trying to call a
snippet? createDescription:buttonFunDef / ... Snippets are processed
on server side (in Lift rendering pipeine) not on client side.


 Finally, in the html file, I call the Submit snippet and then creates
 the button:
 lift:Submit.createDescription form=post 
             ul
                 lispanh3Functions:/h3/span
                     ul id=function_def/ul
                     ul
                         licreateDescription:buttonFunDef //li
                     /ul
                 /li
             /ul
             h3createDescription:save //h3
 /lift:Submit.createDescription

 This button will call the JavaScript AddFunctionDefinition function to
 insert in the id = function_def the
 createDescription:function_definition /, but it doesn't happen! Does
 anyone know why?

 I've tried another alternative, I changed, in the JavaScript, the
 innerHTML to directly create a new textarea:
 new_FD.innerHTML = span class='file'h3Function Definition:/
 h3br /
 textarea id='functionDefinition' type='textarea' rows ='10'
 cols='120' maxlength='5' //span;

 This alternative will render the new textarea! But then I don't know
 how to get the data inserted in the textarea inside the snippet, more
 precisely in the accept function of Submit snippet, because when I
 press the submit button, it will send all data to the accept
 function.
 Some help and/or hints, would be very much appreciated.

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



[Lift] Re: Using AJAX calls in Lift Snippets

2009-07-06 Thread marius d.

Well this definition of ajaxButton that you use you are passing indeed
the AddFunctionDefinition function. But this function doesn;t do any
Ajax call. It receives a parameter (that is not declared btw) which is
essentially a function. You have to manually call this function in
order for the Ajax call to happen. This is a defer mechanism where
Lift passes that function that does the actual Ajax call to the user
function and the user function has to call this ajax function
received.

Note that when you ajax button is pressed the form is not submitted ..
but a simple Ajax call is made (if you would have called the function
provided to you as an argument to AddFunctionDefinition ) and only
this anonymous function gets executed:

{println(pressed); JsCmds.Noop}}

and here you are not returning anything back to browser.
What happens is this:

1. You click Add Function Definition button and
createDescription:function_definition / node is added to the DOM
tree. No Ajax request is made .. just a node in the DOM tree that has
no meaning for the browser.
2. When you click Submit the forsmis submitted and yo accept function
is called. The content of the text area is still empty cause no one
edited right?

So if you expected that by dynamically adding
createDescription:function_definition / nodes in the DOM tree will
actually be replaced with something this won't happen.

If you want to create dynamically new form elements from javascript
when pressing an ajax button you can probably do something like:

 buttonFunDef - SHtml.ajaxButton(Text(Add Function Definition),
() = {
   println(pressed);
  JsCrVar(func, Jx(li{SHtml.textarea(, function_definition = _,
(id, functionDefinitionArea), (rows,6), (cols, 60),
(maxlength, 1)}/li))).toJs) 
  (ElemById(function_def) ~ JsFunc(appendChild, Call(func,

}),

But the idea is:

1. When Add Function Definition button is pressed we return a JS
expression that does:
1.1 create a func variable that represents the function generated
by Jx(..) expression. It essentially create a document fragment
dynamically based on the NodeSeq given by  SHtml.textarea call
1.2 Obtain the function_def element and we're appending a child
node which is essentially an li element

2. Now when you're submitting the form that new text area should be
bounded to a new function that should be executed.


Note that I did not test the code just trying to explain the
priciples. For more references about Jx usages I'd recommend reading
the Lift book section 8.3 XML and JavaScript

Br's,
Marius

On Jul 6, 6:15 pm, Gonzalo N gonn...@gmail.com wrote:
 Hi.
 Probably I didn't explain well and I am sorry for that.
 I've created a simple form in Lift processed via a snippet that
 contains 3 form attributes: function_definition(a textarea),
 buttonFunDef(ajaxButton) and save(submit)
 In the HTML file I made the call to those attributes of the snippet,
 in which one of those attributes is an ajaxButton that runs a
 JavaScript function. This button, when pressed will call the
 JavaScript function to add in the HTML the other attribute of the
 snippet (more precisely the function_definition textarea). It sends
 the POST into the server, but when the page reloads it doesn't appear
 the snippet attribute and I wanted to know why.

 Best regards,
 Gonzalo N

 On Jul 6, 3:56 pm, marius d. marius.dan...@gmail.com wrote:

  On Jul 6, 5:44 pm, Gonzalo N gonn...@gmail.com wrote:

   Hello!

   I am having a problem with a javascript function that creates a new
   textarea from a snippet. I am using the Lift 1.0-SNAPSHOT version and
   the Scala version 2.7.4.
   Basically, what I am doing is creating a ajaxButton in a snippet, that
   calls a JavaScript function to create new textareas, like this:
   Snippet - Submit.scala
   class Submit {
           def createDescription (xhtml : NodeSeq) : NodeSeq = {
                  
                 def accept () = {
                       .
                 }
                  
                  bind(createDescription, xhtml,
                      function_definition - SHtml.textarea(,
   function_definition = _, (id, functionDefinitionArea), (rows,
   6), (cols, 60), (maxlength, 1)),
                      buttonFunDef - SHtml.ajaxButton(Text(Add
   Function Definition), JE.Call(AddFunctionDefinition), () = {println
   (pressed); JsCmds.Noop}),
                       save - SHtml.submit(Submit, accept))
           }

   }

   Then in the javascript file, I have the function
   AddFunctionDefinition.js that :
   function AddFunctionDefinition() {
           var container = document.getElementById('function_def');
           var new_FD = document.createElement('li');

           new_FD.innerHTML = createDescription:function_definition /
           container.insertBefore(new_FD, container.firstChild);

   }

  I'm a bit confused .. from a JS function you're trying to call a
  snippet? createDescription:buttonFunDef / ... Snippets are processed
  on server side

[Lift] Re: Problem with jQuery/JavaScript and Liftweb because of Doctype

2009-07-08 Thread marius d.

Actually I had the same problem with with Javeline on FF. Once I
changed the content-type in the HTTP response to text/html it worked
just fine.

Br's,
Marius

On Jul 8, 3:09 pm, Viktor Klang viktor.kl...@gmail.com wrote:
 We want lift to work on those platforms. We need a work-around



 On Wed, Jul 8, 2009 at 11:19 AM, fbettag fr...@bett.ag wrote:

  *Any Lift Project, not Problem. Sorry ;)

  On 8 Jul., 10:47, fbettag fr...@bett.ag wrote:
   The Problem isn't in Scala nor in Lift nor in jQuery. It's a Firefox
   bug when it gets Content-Type application/xhtml+xml. Same for Safari.

   Just try $(myobject).load(/some/url/from/lift/with/html/output)
   with JavaScript on any Lift problem.

   I don't know why you would want to debug a lift-app when all the links
   i've posted so far show problems with the Browser's implementation of
   application/html+xml, NOT lift.

   On 8 Jul., 05:03, David Pollak feeder.of.the.be...@gmail.com wrote:

2009/7/7 fbettag fr...@bett.ag

 Sorry this is giving me headaches. I don't even know what to look
 for.. :(
 The Problem is also described here:
http://www.nabble.com/Namespace-failure-td21982365s27240.html

 Is there anyway i can spoof the content-type for a comet actor from
 application/xhtml+xml to something else? like text/html or only
 application/xhtml.
 That would fix the issue for now.

I don't understand what the problem is.  Please write some code that
reproduces it so I can actually see *exactly* where the problem is
  happening
for you.  Only then can I debug it.

 best regards

 On 1 Jul., 04:58, David Pollak feeder.of.the.be...@gmail.com
  wrote:
  Please fork this projecthttp://
 github.com/dpp/lift_1_1_sample/tree/masterand
  provide
  an example of the failure.  I'll knock something together than
  overcomes the problem.

  2009/6/30 fbettag fr...@bett.ag

   To describe it a little cleaner:

   in Safari 4, whenever i try to $('#foo').load('/some.html'), it
  fails
   with Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7 since
  the
   content-type is text/html+xml.
   described here:

 http://groups.google.com/group/jquery-en/browse_thread/thread/de95e8a.
 ..

   in Firefox there is a similar problem (error up at the first
  post)
   which happens because FF kinda sees an error on the
  lift-generated
   XHTML/XML which is caused because the doctype seems to be strict
  by
   default (i guess).
   described here:

 http://fitzsimmons.ca/jquery-xhtml-11-strict-and-ns_error_invalid_poi.
 ..

   I put up some really simple stuff in 'some.html' with 4 html
  tags, and
   it fails on Safari and on Firefox.

   When i try to set the Doctype to transitional, the Browser seems
  to
   ignore it somehow, i guess it's because of the ?xml? tag that
  occurs
   before the doctype.

   Is anyone else here using $(..).load('url') on a lift'ed
  project?

   On Jun 30, 11:48 pm, David Pollak feeder.of.the.be...@gmail.com

   wrote:
What missing doctype?

2009/6/29 fbettag fr...@bett.ag

 On Safari i get Error: NO_MODIFICATION_ALLOWED_ERR: DOM
  Exception
 7.
 This seems to be a safari 4 specific problem due to
  content-type
 text/
 html+xml. See

http://groups.google.com/group/jquery-en/browse_thread/thread/de95e8a
  .
   ..

 On Jun 30, 7:39 am, fbettag fr...@bett.ag wrote:
  Hey guys, i've been having troubles with jQuery and
 Firefox/Safari
   due
  to the missing Doctype all night long:

  Uncaught exception: [Exception... Component returned
  failure
 code:
  0x80004003 (NS_ERROR_INVALID_POINTER)
  [nsIDOMNSHTMLElement.innerHTML]  nsresult: 0×80004003
  (NS_ERROR_INVALID_POINTER)  location: JS frame ::
http://yourserver/include/jquery.js
  :: anonymous :: line 11″  data: no]

  The issue is described here, altho it kinda is somehow
  faulty
 xml
   on
  my part:

http://fitzsimmons.ca/jquery-xhtml-11-strict-and-ns_error_invalid_poi
  .
   ..

  Is there any way to prepend a DocType? Searching the group
  didn't
   turn
  anything useful up.

  Best regards

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

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

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

 --
 

[Lift] Re: Problem with jQuery/JavaScript and Liftweb because of Doctype

2009-07-08 Thread marius d.

huh ?

On Jul 8, 3:32 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
 Puts us in the rather interesting position of being a Java-based framework
 that only works on internet explorer...

 On Wed, Jul 8, 2009 at 1:27 PM, marius d. marius.dan...@gmail.com wrote:

  Actually I had the same problem with with Javeline on FF. Once I
  changed the content-type in the HTTP response to text/html it worked
  just fine.

  Br's,
  Marius

  On Jul 8, 3:09 pm, Viktor Klang viktor.kl...@gmail.com wrote:
   We want lift to work on those platforms. We need a work-around

   On Wed, Jul 8, 2009 at 11:19 AM, fbettag fr...@bett.ag wrote:

*Any Lift Project, not Problem. Sorry ;)

On 8 Jul., 10:47, fbettag fr...@bett.ag wrote:
 The Problem isn't in Scala nor in Lift nor in jQuery. It's a Firefox
 bug when it gets Content-Type application/xhtml+xml. Same for Safari.

 Just try $(myobject).load(/some/url/from/lift/with/html/output)
 with JavaScript on any Lift problem.

 I don't know why you would want to debug a lift-app when all the
  links
 i've posted so far show problems with the Browser's implementation of
 application/html+xml, NOT lift.

 On 8 Jul., 05:03, David Pollak feeder.of.the.be...@gmail.com
  wrote:

  2009/7/7 fbettag fr...@bett.ag

   Sorry this is giving me headaches. I don't even know what to look
   for.. :(
   The Problem is also described here:
  http://www.nabble.com/Namespace-failure-td21982365s27240.html

   Is there anyway i can spoof the content-type for a comet actor
  from
   application/xhtml+xml to something else? like text/html or only
   application/xhtml.
   That would fix the issue for now.

  I don't understand what the problem is.  Please write some code
  that
  reproduces it so I can actually see *exactly* where the problem is
happening
  for you.  Only then can I debug it.

   best regards

   On 1 Jul., 04:58, David Pollak feeder.of.the.be...@gmail.com
wrote:
Please fork this projecthttp://
   github.com/dpp/lift_1_1_sample/tree/masterand
provide
an example of the failure.  I'll knock something together than
overcomes the problem.

2009/6/30 fbettag fr...@bett.ag

 To describe it a little cleaner:

 in Safari 4, whenever i try to $('#foo').load('/some.html'),
  it
fails
 with Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
  since
the
 content-type is text/html+xml.
 described here:

   http://groups.google.com/group/jquery-en/browse_thread/thread/de95e8a.
   ..

 in Firefox there is a similar problem (error up at the first
post)
 which happens because FF kinda sees an error on the
lift-generated
 XHTML/XML which is caused because the doctype seems to be
  strict
by
 default (i guess).
 described here:

   http://fitzsimmons.ca/jquery-xhtml-11-strict-and-ns_error_invalid_poi.
   ..

 I put up some really simple stuff in 'some.html' with 4 html
tags, and
 it fails on Safari and on Firefox.

 When i try to set the Doctype to transitional, the Browser
  seems
to
 ignore it somehow, i guess it's because of the ?xml? tag
  that
occurs
 before the doctype.

 Is anyone else here using $(..).load('url') on a lift'ed
project?

 On Jun 30, 11:48 pm, David Pollak 
  feeder.of.the.be...@gmail.com

 wrote:
  What missing doctype?

  2009/6/29 fbettag fr...@bett.ag

   On Safari i get Error: NO_MODIFICATION_ALLOWED_ERR: DOM
Exception
   7.
   This seems to be a safari 4 specific problem due to
content-type
   text/
   html+xml. See

 http://groups.google.com/group/jquery-en/browse_thread/thread/de95e8a
.
 ..

   On Jun 30, 7:39 am, fbettag fr...@bett.ag wrote:
Hey guys, i've been having troubles with jQuery and
   Firefox/Safari
 due
to the missing Doctype all night long:

Uncaught exception: [Exception... Component returned
failure
   code:
0x80004003 (NS_ERROR_INVALID_POINTER)
[nsIDOMNSHTMLElement.innerHTML]  nsresult: 0×80004003
(NS_ERROR_INVALID_POINTER)  location: JS frame ::
  http://yourserver/include/jquery.js
:: anonymous :: line 11″  data: no]

The issue is described here, altho it kinda is
  somehow
faulty
   xml
 on
my part:

 http://fitzsimmons.ca/jquery-xhtml-11-strict-and-ns_error_invalid_poi
.
 ..

Is there any way to prepend a DocType? Searching the
  group
didn't
 turn
anything useful up.

Best regards

  --
  Lift, the simply functional web frameworkhttp://
  liftweb.net
  Beginning Scalahttp://www.apress.com/book/view/1430219890

[Lift] Re: Problem with jQuery/JavaScript and Liftweb because of Doctype

2009-07-08 Thread marius d.

These are specific cases failing independent of Lift and perhaps even
JQuery. There are numerous Lift apps out there working fine on all
these browsers. From here making a statement that Lift is broken on FF
or Safari or Java-based framework that only works on internet
explorer .. is simply a fallacy.

Besides if you don't really need xhtml you can set it to html from
LiftRules.

Br's,
Marius

On Jul 8, 3:36 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
 If it's broken on firefox, and on safari, then I'm guessing that it's also
 broken on any other WebKit derived browser
 That leaves opera, chrome and IE, of which only IE has any serious market
 penetration...

 On Wed, Jul 8, 2009 at 1:34 PM, marius d. marius.dan...@gmail.com wrote:

  huh ?

  On Jul 8, 3:32 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
   Puts us in the rather interesting position of being a Java-based
  framework
   that only works on internet explorer...

   On Wed, Jul 8, 2009 at 1:27 PM, marius d. marius.dan...@gmail.com
  wrote:

Actually I had the same problem with with Javeline on FF. Once I
changed the content-type in the HTTP response to text/html it worked
just fine.

Br's,
Marius

On Jul 8, 3:09 pm, Viktor Klang viktor.kl...@gmail.com wrote:
 We want lift to work on those platforms. We need a work-around

 On Wed, Jul 8, 2009 at 11:19 AM, fbettag fr...@bett.ag wrote:

  *Any Lift Project, not Problem. Sorry ;)

  On 8 Jul., 10:47, fbettag fr...@bett.ag wrote:
   The Problem isn't in Scala nor in Lift nor in jQuery. It's a
  Firefox
   bug when it gets Content-Type application/xhtml+xml. Same for
  Safari.

   Just try
  $(myobject).load(/some/url/from/lift/with/html/output)
   with JavaScript on any Lift problem.

   I don't know why you would want to debug a lift-app when all the
links
   i've posted so far show problems with the Browser's
  implementation of
   application/html+xml, NOT lift.

   On 8 Jul., 05:03, David Pollak feeder.of.the.be...@gmail.com
wrote:

2009/7/7 fbettag fr...@bett.ag

 Sorry this is giving me headaches. I don't even know what to
  look
 for.. :(
 The Problem is also described here:
http://www.nabble.com/Namespace-failure-td21982365s27240.html

 Is there anyway i can spoof the content-type for a comet
  actor
from
 application/xhtml+xml to something else? like text/html or
  only
 application/xhtml.
 That would fix the issue for now.

I don't understand what the problem is.  Please write some code
that
reproduces it so I can actually see *exactly* where the problem
  is
  happening
for you.  Only then can I debug it.

 best regards

 On 1 Jul., 04:58, David Pollak 
  feeder.of.the.be...@gmail.com
  wrote:
  Please fork this projecthttp://
 github.com/dpp/lift_1_1_sample/tree/masterand
  provide
  an example of the failure.  I'll knock something together
  than
  overcomes the problem.

  2009/6/30 fbettag fr...@bett.ag

   To describe it a little cleaner:

   in Safari 4, whenever i try to
  $('#foo').load('/some.html'),
it
  fails
   with Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception
  7
since
  the
   content-type is text/html+xml.
   described here:

 http://groups.google.com/group/jquery-en/browse_thread/thread/de95e8a.
 ..

   in Firefox there is a similar problem (error up at the
  first
  post)
   which happens because FF kinda sees an error on the
  lift-generated
   XHTML/XML which is caused because the doctype seems to be
strict
  by
   default (i guess).
   described here:

 http://fitzsimmons.ca/jquery-xhtml-11-strict-and-ns_error_invalid_poi.
 ..

   I put up some really simple stuff in 'some.html' with 4
  html
  tags, and
   it fails on Safari and on Firefox.

   When i try to set the Doctype to transitional, the
  Browser
seems
  to
   ignore it somehow, i guess it's because of the ?xml?
  tag
that
  occurs
   before the doctype.

   Is anyone else here using $(..).load('url') on a
  lift'ed
  project?

   On Jun 30, 11:48 pm, David Pollak 
feeder.of.the.be...@gmail.com

   wrote:
What missing doctype?

2009/6/29 fbettag fr...@bett.ag

 On Safari i get Error: NO_MODIFICATION_ALLOWED_ERR:
  DOM
  Exception
 7.
 This seems to be a safari 4 specific problem due to
  content-type
 text/
 html+xml. See

   http://groups.google.com/group/jquery-en/browse_thread/thread/de95e8a
  .
   ..

 On Jun 30, 7:39 am, fbettag fr...@bett.ag wrote:
  Hey guys, i've been having troubles

[Lift] Re: Problem with jQuery/JavaScript and Liftweb because of Doctype

2009-07-08 Thread marius d.

Actually I added a while ago a fixCss feature that deals with root
relative paths where context path is pre-pended. Please see
LiftRules.fixCss.

Br's,
Marius

On Jul 8, 4:34 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
 Interesting take... There definitely seems to be a growing need for working
 with css files as something beyond static text files.

 I know we already have some limited processing in place for handling root
 paths, and the idea has been raised before that we could maybe merge
 multiple files into a single css for performance reasons.  Maybe this should
 be another driver towards offering richer CSS processing, it would be a good
 unique selling point!

 On Wed, Jul 8, 2009 at 2:17 PM, marius d. marius.dan...@gmail.com wrote:

  Lift does a lot of thing to properly cope with browsers idiosyncrasies
  (IE mostly ... doh .. :) ...) ... perhaps not using xhtml mimetype
  affects SVG usage ? ...Other case that I'm thinking of is to use CSS
  tricks that applies for certain browsers but only works for xhtml for
  instance:

  .myclass {
   height: 100px; // applicable on all browsers
   _height: 100px // applicable on IE6 only
   *height: 100px // applicable on IE7+
  }

  But I'm not sure if many people users are actually using this.

  Br's,
  Marius

  On Jul 8, 4:12 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
   Uh-oh, looks like I'm going to be flagged as a troll, I should have
   remembered the winking smiley ;)
   Especially as I'm working with Lift and Firefox myself!

   But there is a serious point here, to get lift into the mainstream I
  guess
   we have to work within the constraints of browser flaws.
   So are there any issues in defaulting to useXhtmlMimeType = false ?
   Maybe
   even add a small note in the JavaDoc to warn against problems in setting
  it
   to be true

   On Wed, Jul 8, 2009 at 2:03 PM, Matt Williams m...@makeable.co.uk
  wrote:

I dont understand what you mean. Internet explorer is what is
malfunctioning as its ignoring the (incorrectly set) content-type.
Simply set the correct content-type for the type of content you are
returning and you shouldn't have any problems.

Kevin Wright wrote:
 Puts us in the rather interesting position of being a Java-based
 framework that only works on internet explorer...

 On Wed, Jul 8, 2009 at 1:27 PM, marius d. marius.dan...@gmail.com
 mailto:marius.dan...@gmail.com wrote:

     Actually I had the same problem with with Javeline on FF. Once I
     changed the content-type in the HTTP response to text/html it
  worked
     just fine.

     Br's,
     Marius

     On Jul 8, 3:09 pm, Viktor Klang viktor.kl...@gmail.com
     mailto:viktor.kl...@gmail.com wrote:
      We want lift to work on those platforms. We need a work-around

      On Wed, Jul 8, 2009 at 11:19 AM, fbettag fr...@bett.ag
     mailto:fr...@bett.ag wrote:

       *Any Lift Project, not Problem. Sorry ;)

       On 8 Jul., 10:47, fbettag fr...@bett.ag
     mailto:fr...@bett.ag wrote:
    The Problem isn't in Scala nor in Lift nor in jQuery. It's
  a
     Firefox
    bug when it gets Content-Type application/xhtml+xml. Same
     for Safari.

    Just try
     $(myobject).load(/some/url/from/lift/with/html/output)
    with JavaScript on any Lift problem.

    I don't know why you would want to debug a lift-app when
  all
     the links
    i've posted so far show problems with the Browser's
     implementation of
    application/html+xml, NOT lift.

    On 8 Jul., 05:03, David Pollak
     feeder.of.the.be...@gmail.com
     mailto:feeder.of.the.be...@gmail.com wrote:

     2009/7/7 fbettag fr...@bett.ag mailto:fr...@bett.ag

      Sorry this is giving me headaches. I don't even know
     what to look
      for.. :(
      The Problem is also described here:

   http://www.nabble.com/Namespace-failure-td21982365s27240.html

      Is there anyway i can spoof the content-type for a
  comet
     actor from
      application/xhtml+xml to something else? like text/html
     or only
      application/xhtml.
      That would fix the issue for now.

     I don't understand what the problem is.  Please write
  some
     code that
     reproduces it so I can actually see *exactly* where the
     problem is
       happening
     for you.  Only then can I debug it.

      best regards

      On 1 Jul., 04:58, David Pollak
     feeder.of.the.be...@gmail.com mailto:
  feeder.of.the.be...@gmail.com

       wrote:
       Please fork this projecthttp://
      github.com/dpp/lift_1_1_sample/tree/masterand
     http://github.com/dpp/lift_1_1_sample/tree/masterand
       provide
       an example of the failure.  I'll

[Lift] Re: Web service with DB access - Lift required?

2009-07-09 Thread marius d.

You can also use REST + Record  Please see here:
http://groups.google.com/group/liftweb/browse_thread/thread/b125f9d4e9ca10c8/5f871b2cf9f7099b?lnk=gstq=REST+%26+Record#5f871b2cf9f7099b

It is a mechanism for automatically building Record objects from REST
query string params. Hence Lift already puts the data in a single
encapsulated context where you can apply validation etc. But Record
framework is not yet hooked up with DB so you'd still may want to use
Mapper framework.


Br's,
Marius

On Jul 9, 11:11 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Lift is perfect for these kind of REST abstractions... its what I do
 almost exclusively and I find Lift makes this process very smooth.

 My advice would be to go for a JSON api - nice and lightweight for
 streaming to an iPhone.

 Cheers, Tim

 On Jul 9, 1:43 am, Raphael erzengelr...@googlemail.com wrote:

  Hey,

  I'd like to build a simple web service that makes conference schedules
  and session data accessible to an iPhone client. The data is supposed
  to be stored in a MySQL db on the server. So at the moment, I am not
  planning on creating any form of web app / web site for that. However,
  that would be one of the next steps also.

  I just have looked at Lift briefly. Is it a good idea to use Lift for
  just that web service if there's no web site? Considering that buiding
  a web site to access the data also soon, would you suggest going
  straight to Lift?

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



[Lift] Re: Web service with DB access - Lift required?

2009-07-09 Thread marius d.



On Jul 9, 12:14 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Good point marius - I know DPP committed to completing record DB
 support before 1.1, but any ideas when he is planning to implement it?
 Id say thats the next big lift feature.

Not sure yet but AFAIK he's also thinking to integrate it with goat-
rodeo STM + Cassandra (similar with BigTable model) + ZooKeeper


 Cheers, Tim

 On Jul 9, 9:27 am, marius d. marius.dan...@gmail.com wrote:

  You can also use REST + Record  Please see 
  here:http://groups.google.com/group/liftweb/browse_thread/thread/b125f9d4e...

  It is a mechanism for automatically building Record objects from REST
  query string params. Hence Lift already puts the data in a single
  encapsulated context where you can apply validation etc. But Record
  framework is not yet hooked up with DB so you'd still may want to use
  Mapper framework.

  Br's,
  Marius

  On Jul 9, 11:11 am, Timothy Perrett timo...@getintheloop.eu wrote:

   Lift is perfect for these kind of REST abstractions... its what I do
   almost exclusively and I find Lift makes this process very smooth.

   My advice would be to go for a JSON api - nice and lightweight for
   streaming to an iPhone.

   Cheers, Tim

   On Jul 9, 1:43 am, Raphael erzengelr...@googlemail.com wrote:

Hey,

I'd like to build a simple web service that makes conference schedules
and session data accessible to an iPhone client. The data is supposed
to be stored in a MySQL db on the server. So at the moment, I am not
planning on creating any form of web app / web site for that. However,
that would be one of the next steps also.

I just have looked at Lift briefly. Is it a good idea to use Lift for
just that web service if there's no web site? Considering that buiding
a web site to access the data also soon, would you suggest going
straight to Lift?

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



[Lift] Re: Web service with DB access - Lift required?

2009-07-09 Thread marius d.

What conditions the existent Mapper does not currently satisfy in
terms of builds the objects and persists them to a DB? ... build
Mapper objects from query strings?

Br's,
Marius

On Jul 9, 3:13 pm, Raphael erzengelr...@googlemail.com wrote:
 So there is no framework like ActiveRecord in Rails that both builds
 the objects and persists them to a DB?

 On 9 Jul., 10:27, marius d. marius.dan...@gmail.com wrote:

  You can also use REST + Record  Please see 
  here:http://groups.google.com/group/liftweb/browse_thread/thread/b125f9d4e...

  It is a mechanism for automatically building Record objects from REST
  query string params. Hence Lift already puts the data in a single
  encapsulated context where you can apply validation etc. But Record
  framework is not yet hooked up with DB so you'd still may want to use
  Mapper framework.

  Br's,
  Marius

  On Jul 9, 11:11 am, Timothy Perrett timo...@getintheloop.eu wrote:

   Lift is perfect for these kind of REST abstractions... its what I do
   almost exclusively and I find Lift makes this process very smooth.

   My advice would be to go for a JSON api - nice and lightweight for
   streaming to an iPhone.

   Cheers, Tim

   On Jul 9, 1:43 am, Raphael erzengelr...@googlemail.com wrote:

Hey,

I'd like to build a simple web service that makes conference schedules
and session data accessible to an iPhone client. The data is supposed
to be stored in a MySQL db on the server. So at the moment, I am not
planning on creating any form of web app / web site for that. However,
that would be one of the next steps also.

I just have looked at Lift briefly. Is it a good idea to use Lift for
just that web service if there's no web site? Considering that buiding
a web site to access the data also soon, would you suggest going
straight to Lift?

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



[Lift] Re: Actor and clusters?

2009-07-10 Thread marius d.

Actors are local to the JVM. Scala also has RemoteActors but we don't
really use them. For a lift app in a cluster environment we have to
have sticky sessions concept and the reason is that functions bound to
a session and mostly the references they are holding are not
serialized  distributed. So assuming:

1. Session 1 is created on Node 1
2. If on a subsequent request (pertaining to the Session 1) load
balancer decides to dispatch the request on Node 2 you are loosing all
session context including bound functions etc.

This is why the load balancer must guarantee that all requests
pertaining to the same session needs to be dispatched on the same
node.

There were some efforts in the past to integrate Terracotta but I
guess there was a dead end somewhere.

You can of course build you own app to not use functions bound to a
session and only rely on DispatchPf style (somehow similar with Spring
controllers) but that's not very lift-ish. But in this case you can
persist your state in DB (which is common to all nodes) and when a
request comes you just fetch the context data from DB and set your
SessionVars. The problem with functions kept on the session is that
those function can be lambda expression referencing members from other
classes which are not serializable etc. And even if they somehow were
Java serialization is bad for performance.

The bottom line is that sticky sessions have the benefit of the
performance because there is no state that needs to be distributed and
replicated among all cluster nodes OR no need to persist the session
state. But the drawback is that requests pertaining to the same
session needs to be processed by the same node.

IMHO using Lift apps in a cluster env. without sticky sessions can be
a very tricky thing to achieve.

Br's,
Marius

On Jul 10, 6:32 am, DFectuoso santiago1...@gmail.com wrote:
 I'm hosting some experiments on Stax and right now im pondering over
 the idea of checking out how to have a database backed session so the
 SessionVars work in a cluster of 5 boxes; With that in mind, have
 anyone worked with actors and clustering? Is there some documentation
 around that? should it work out of the box, or some works of
 encouragement to try working on this terrain?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Typesafe JSON builder?

2009-07-10 Thread marius d.

Please take a look on JsObj.  But what is your exact use case? ...
generate JSON constructs from Scala and send then to browser?

Br's,
Marius

On Jul 9, 8:35 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Hi,

 Has anyone made a typesafe JSON builder?

 Many Javascript libraries provides support for extensive customization,
 usually via a JSON object
 (eg.http://www.jqplot.com/docs/files/optionsTutorial-txt.html#Options_Tut...

 It would be nice to generate this from Scala which would then give you
 type checking, IDE auto completion etc.

 Lacking concrete implementations, any ideas on the best way to approach
 this. I've 
 seenhttp://blog.rafaelferreira.net/2008/07/type-safe-builder-pattern-in-s...
 which looks like a viable (if a bit verbose) approach.

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



[Lift] Re: Actor and clusters?

2009-07-10 Thread marius d.



On Jul 10, 10:40 am, DFectuoso santiago1...@gmail.com wrote:
 Thanks, that was very useful, to enable sticky variables i would do
 something like (explain 
 herehttp://wiki.stax.net/w/index.php/Application_Clustering
 ) that?

 So bottom line? An actor can send a message an actor that is living in
 another JVM using sticky variables(or anything else) (sorry i don't
 know if that terracota, don't know what that is)

An actor can send messages to an actor in the same jvm (or better yet
part of the same class loader's delegation). With Scala's RemoteActors
(http://www.scala-lang.org/docu/files/api/index.html) you can send
messages remotely. But I think it is using Java serialization/
deserialization and personally I'd stay away of this. I'd probably use
other transports like AMQP or REST and keep working with actors
locally.

For terracotta you can read more here: http://www.terracotta.org/ ...
it is a great framework.


 On Jul 9, 11:53 pm, marius d. marius.dan...@gmail.com wrote:

  Actors are local to the JVM. Scala also has RemoteActors but we don't
  really use them. For a lift app in a cluster environment we have to
  have sticky sessions concept and the reason is that functions bound to
  a session and mostly the references they are holding are not
  serialized  distributed. So assuming:

  1. Session 1 is created on Node 1
  2. If on a subsequent request (pertaining to the Session 1) load
  balancer decides to dispatch the request on Node 2 you are loosing all
  session context including bound functions etc.

  This is why the load balancer must guarantee that all requests
  pertaining to the same session needs to be dispatched on the same
  node.

  There were some efforts in the past to integrate Terracotta but I
  guess there was a dead end somewhere.

  You can of course build you own app to not use functions bound to a
  session and only rely on DispatchPf style (somehow similar with Spring
  controllers) but that's not very lift-ish. But in this case you can
  persist your state in DB (which is common to all nodes) and when a
  request comes you just fetch the context data from DB and set your
  SessionVars. The problem with functions kept on the session is that
  those function can be lambda expression referencing members from other
  classes which are not serializable etc. And even if they somehow were
  Java serialization is bad for performance.

  The bottom line is that sticky sessions have the benefit of the
  performance because there is no state that needs to be distributed and
  replicated among all cluster nodes OR no need to persist the session
  state. But the drawback is that requests pertaining to the same
  session needs to be processed by the same node.

  IMHO using Lift apps in a cluster env. without sticky sessions can be
  a very tricky thing to achieve.

  Br's,
  Marius

  On Jul 10, 6:32 am, DFectuoso santiago1...@gmail.com wrote:

   I'm hosting some experiments on Stax and right now im pondering over
   the idea of checking out how to have a database backed session so the
   SessionVars work in a cluster of 5 boxes; With that in mind, have
   anyone worked with actors and clustering? Is there some documentation
   around that? should it work out of the box, or some works of
   encouragement to try working on this terrain?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread marius d.

liftAjax is dynamically generated and it does not represent static
content. Please see ScriptRenderer.scala. However is is a pretty small
script so I'm not sure how much we'll actually fain by minifying it.
Can you run a benchmark? Take from the browser the generated script,
minify it and the serve it statically to browser and see how much are
we saving.


Br's,
Marius

On Jul 10, 11:00 am, DFectuoso santiago1...@gmail.com wrote:
 I dont know how liftAjax.js is generated, or if it changes or not,
 also I have no idea (if it regenerated) how it could be minified, and
 I know that minification seem like a micro-optimization but...

 With just GZipping and Javascript minification working together, the
 load time dropped from 16 seconds to just under 10 seconds. I was
 absolutely extactic at the progress I was making so for and so was my
 client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

 For Google an increase in page load time from 0.4 second to 0.9
 seconds decreased traffic and ad revenues by 20%. For Amazon every 100
 ms increase in load times decreased sales with 
 1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

 So, analyzing a couple of lift apps with YSlow I find a couple of
 things that could be done to improve the average load time. Of course
 there's a lot of impact on how you do your css, where you host css and
 images(and how), compresion, server configuration, javascript and css
 performance and a lot of things on the application side; but it would
 be nice to make everything possible on the framework side to create
 that culture around every lift app =)

 So I wanted to throw that idea here and see how to help in this
 matter.

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



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread marius d.

Tim, sorry but I have to say that liftAjax.js IS generated dynamically
as I stated above :). It is not a script sitting somewhere but it
ultimately comes from ScriptRenderer.scala

Br's,
Marius

On Jul 10, 11:26 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey,

 liftAjax.js is not regenerated dynamically as far as im aware... By
 default, lift ships with the maven plugin for YUI compressor, so that
 should minify the CSS/JS in your webapp dir.

 Perhaps we should try and minify liftAjax.js during the build of
 lift... marius is probally the best man for this as this stuff is
 pretty much his baby.

 Cheers, Tim

 On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote:

  I dont know how liftAjax.js is generated, or if it changes or not,
  also I have no idea (if it regenerated) how it could be minified, and
  I know that minification seem like a micro-optimization but...

  With just GZipping and Javascript minification working together, the
  load time dropped from 16 seconds to just under 10 seconds. I was
  absolutely extactic at the progress I was making so for and so was my
  client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

  For Google an increase in page load time from 0.4 second to 0.9
  seconds decreased traffic and ad revenues by 20%. For Amazon every 100
  ms increase in load times decreased sales with 
  1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

  So, analyzing a couple of lift apps with YSlow I find a couple of
  things that could be done to improve the average load time. Of course
  there's a lot of impact on how you do your css, where you host css and
  images(and how), compresion, server configuration, javascript and css
  performance and a lot of things on the application side; but it would
  be nice to make everything possible on the framework side to create
  that culture around every lift app =)

  So I wanted to throw that idea here and see how to help in this
  matter.

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



[Lift] Re: Typesafe JSON builder?

2009-07-10 Thread marius d.



On Jul 10, 6:32 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Fri, Jul 10, 2009 at 1:44 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:





  marius d. marius.dan...@gmail.com writes:

   Please take a look on JsObj.

  That's what I'm using now and it's a pain:

  def generateOptions = JsObj(
       (title, My title),
       (series, JsArray(JsObj((Label,MyLabel,
       (seriesColors, JsArray(#00,#cc)),
       (axes, JsObj(
                 (xaxis, JsObj(
                   (renderer, JsVar($.jqplot.CategoryAxisRenderer)),
                   (ticks, JsArray(data.flatMap(series =
  {series.labels.map(v = v.toString)}) : _*))
                 )),
                 (yaxis, JsObj(
                   (min, 0),
                   (tickOptions, JsObj(
                     (formatString, %d)
                   ))
                 ))
         )),
       (seriesDefaults, JsObj(
         (renderer, JsVar($.jqplot.BarRenderer)),
         (rendererOptions, JsObj(
                 (barDirection, horizontal),
                 (barPadding, 8),
                 (barMargin,20),
                 (barWidth, 20)
         ))

       )))

 Looks like Lisp... :-)

 In all seriousness, one of the pieces of Goat Rodeo
 (http://goatrodeo.organdGoat Rodeo will become part of Lift once GR
 is stable) is objects that
 will know how to serialize themselves as JSON.  So, you'll get type safety
 and bi-direction serialization.  In the mean time, I think Marius has some
 stuff in Record that also does bi-directional JSON.

Correct Dave.Guys please see Record#asJson and Record#fromJSON






   But what is your exact use case? ...  generate JSON constructs from
   Scala and send then to browser?

  Yes, I want the above JSON object (which is just a subset of the full
  capabilities) to be generated in Scala, so I:

  - will get typechecking
  - Don't have to remember field names
  - Can't get autocompletion on valid values for things like
  - e.g. barDirection

  /Jeppe

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Standardizing widget APIs

2009-07-12 Thread marius d.

Well widgets don't have a whole lot of commonalities besides the init
() method. Regarding destroy() that would probably be helpful for
widgets that are communicating remotely with other services. The rest
of the widget functions are mostly very specific helper functions that
renders markup, JS script tags etc, and work with very specific data
models.


Br's
Marius

On Jul 12, 3:03 am, Timothy Perrett timo...@getintheloop.eu wrote:
  I'm not sure, depends I guess.
  Just a simple onLoad/onUnload callback could be enough...
  (The unload is to make sure not to leak mem if you're just reloading the
  webapp without restarting the server)

 That was my thinking - right now the pattern appears to be def init
 for booting the widget, so perhaps, init and destroy methods would be
 good appropriate. Like I said, just something to make this stuff a
 known, typeable quantity would be good.

  Java Specialist
  Scala Loudmouth
  Lift Committer

 What happened to your rouge architect signature?!

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



[Lift] Re: On GAE and Lift

2009-07-12 Thread marius d.



On Jul 12, 9:16 am, TakeTheStage forthepo...@gmail.com wrote:
 Hello, new to both Scala and Lift. After weighing several options,
 I've decided to create a new app using Lift, with GAE for hosting. As
 such, I chose Lift due to its support for concurrency, inherited from
 its Scala base.
 Ok, so I'm preaching to the choir.
 Here is my question: with the limitations imposed by GAE (no new
 threads) does Lift lose its scalability and concurrency advantages, or
 has David's alternate actor library (for Lift) taken care of this
 issue?

Not quite. LiftActors is still using Java threads via Java's executor
framework and in GAE you still can't use it AFAIK .Dave did not
replace ScalaActors with LiftActors except for a single place where
actors needed to be created and destroyed very often. And this happens
internally. CometActors are still Scala actors. If you can live
without Comet (and actors in general) and JDBC you can go ahead and
use GAE. Personally I would use http://stax.net/ ... no threading
restrictions and they provide MySql.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Sense check please!

2009-07-12 Thread marius d.


Why not use the progessListener from the LiftSession ?

Br's,
Marius

On Jul 12, 9:57 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey guys,

 Implementing this upload progress widget with comet, I just wanted a
 quick sense check about how to organize things.

 As the CometActor for a particular session will be instantiated adhoc,
 and the LiftRules.progessListener is global, my current thinking is to
 register a given comet actor with a singleton manager actor upon its
 instantiation. Giving a progressListener something like:

 LiftRules.progessListener = (pBytesRead, pContentLength, pItems) = {
   UploadProgressManager ! StatusUpdate(
     S.session.map(_.uniqueId).openOr(default),
     pBytesRead, pContentLength, pItems)

 }

 The idea being that when comet actors register with the manager actor
 they give there sessionId and then I can ensure that only upload
 progress for the current session goes to a given user (and user B
 doesnt get user A's upload progress).

 However, I cant help but feel this is a little messy? Thoughts?

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



[Lift] Re: external link to URL known at runtime

2009-07-13 Thread marius d.

Just use a href=your text here/a


Br's,
Marius

On Jul 13, 1:26 am, chrislewis burningodzi...@gmail.com wrote:
 Hello list,

 I need to generate a link from a field in a database. SHtml.link. I'm
 using bind like so:

     Track.findAll.flatMap(track =
       bind(track, xhtml,
         name - Text(track.name),
         viewUrl - link(track.viewUrl, () = { println
 (clicked!?) }, Text(track.name))
       )
     )

 This works, but 1) I don't want to supply a function to handle the
 click (it's purely external) and 2) lift is appending a generated
 query parameter to the link (like ?F1127503780829KJK=_). Is there some
 other way to create an external link? ExtLink won't work because I
 need this in binding contexts. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Snippet knowing all the possible parameters?

2009-07-15 Thread marius d.



On Jul 15, 8:10 am, DFectuoso santiago1...@gmail.com wrote:
 I don't know if its possible, but lift have surprised me so many times
 so far that it worth to ask.

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

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

No because each line over there is a different invocation of a
potentially stateless snippet meaning a new instance of Foo. Inside
your snippet you can use S.attr(variable) to get the value of the
variable.

But what is the use case? ... what are you trying to solve?


 Its a long shot but if you have any idea please do tell!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Ambiguous bind

2009-07-15 Thread marius d.

Since internally the BindParam-s are converted to a Map the last one
should be considered.

Marius

On Jul 15, 8:39 am, Naftoli Gugenhem naftoli...@gmail.com wrote:
 If a call to BindHelpers.bind has multiple bindings for the same element 
 label, which gets used? The last one?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: File upload streaming and progress monitoring ...

2009-07-18 Thread marius d.

A little more on this ...

Living the above synchronized blocks where they are but removing the
one from LiftSession.runParams  made it work properly. Looks like this
one was holding the lock while the file upload progress was happening.
Dave I'm not really sure why in runParams the the toRun is obtained
from a synchronized block ... is it because we'rreading from
messageCallback there ? ..cause otherwise the entire expression is
about functions composition that does not change any state.


Br's,
Marius

On Jul 18, 3:57 pm, Marius marius.dan...@gmail.com wrote:
 HI there,

 I know, there have been several other threads around the topic but I
 just wanted to yield somethings here. In the past few days I've been
 talking with Tim as he was having problems with his FileUpload widget.
 Even with short polling the progress was not reported even though the
 LiftSession.progressListener was properly called.

 Today I started to look into it and here is what I've done:

 1. Here is the markup:

   iframe id=upload_target name=upload_target src=# style=width:
 0;height:0;border:0px solid #fff;/iframe

   lift:Upload.render form=POST multipart=true id=upload_form
 target=upload_target
     f:inputFile/
     input type=submit value=Upload/
   /lift:Upload.render

   A simple snippet that uses the invisible iframe trick to upload
 stuff in the background. The so called Ajax upload. (I had to add
 the target attribute into the supported form snippet attributed but
 that's ok)

 2. In boot had something like:

     LiftSession.onSetupSession = ((session: LiftSession) = {
       session.progessListener = Full((chunk, total, index) = {
          Thread.sleep(100)
          println(index +  read  + chunk +  out of  + total +   +
 Thread.currentThread)
       })
     }) :: Nil

     Just monitor the progress ... and to make it last a little longer
 I'm sleeping for 100 milliseconds

 3. I set the GC polling to 10 seconds. The think is that GC polling
 would be just like the short polling for getting the progress status
 back in the browser.

 The behavior that I observed was that while I was uploading a 30 Mb +
 file the polling requests timed out after 5 secconds per
 LiftRules.ajaxPostTimeout. This means that our progress monitoring
 ajax request would have timed out as well. On the server side the
 execution got stuck until the upload was complete.
 LiftServlet.handleAjax was not called until the upload terminates.

 Initially I thought that this has to do to limited request channels
 that browser have but the thing is that we have several places in Lift
 code where we synchronize things. Such as LiftSession.getSession,
 LiftSession.fixSessionTime etc. Acquiring these locks made the
 progress polling to hang until the upload terminated. Of course
 removing th synchronized block made the polling to work right during
 the file upload. Now this was just for test ... I'm not suggesting to
 remove the synchronized blocks as  we'd loose consistency but this
 looks to stay in the way of properly dealing with multiple parallel
 request per same session like fileupload and progress monitoring.

 It appears that there is either a thread starvation situation or
 simply a lock that is held while upload is is progress.

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



[Lift] Re: File upload streaming and progress monitoring ...

2009-07-18 Thread marius d.

Just committed a fix ...

Br's,
Marius

On Jul 18, 4:10 pm, marius d. marius.dan...@gmail.com wrote:
 A little more on this ...

 Living the above synchronized blocks where they are but removing the
 one from LiftSession.runParams  made it work properly. Looks like this
 one was holding the lock while the file upload progress was happening.
 Dave I'm not really sure why in runParams the the toRun is obtained
 from a synchronized block ... is it because we'rreading from
 messageCallback there ? ..cause otherwise the entire expression is
 about functions composition that does not change any state.

 Br's,
 Marius

 On Jul 18, 3:57 pm, Marius marius.dan...@gmail.com wrote:

  HI there,

  I know, there have been several other threads around the topic but I
  just wanted to yield somethings here. In the past few days I've been
  talking with Tim as he was having problems with his FileUpload widget.
  Even with short polling the progress was not reported even though the
  LiftSession.progressListener was properly called.

  Today I started to look into it and here is what I've done:

  1. Here is the markup:

    iframe id=upload_target name=upload_target src=# style=width:
  0;height:0;border:0px solid #fff;/iframe

    lift:Upload.render form=POST multipart=true id=upload_form
  target=upload_target
      f:inputFile/
      input type=submit value=Upload/
    /lift:Upload.render

    A simple snippet that uses the invisible iframe trick to upload
  stuff in the background. The so called Ajax upload. (I had to add
  the target attribute into the supported form snippet attributed but
  that's ok)

  2. In boot had something like:

      LiftSession.onSetupSession = ((session: LiftSession) = {
        session.progessListener = Full((chunk, total, index) = {
           Thread.sleep(100)
           println(index +  read  + chunk +  out of  + total +   +
  Thread.currentThread)
        })
      }) :: Nil

      Just monitor the progress ... and to make it last a little longer
  I'm sleeping for 100 milliseconds

  3. I set the GC polling to 10 seconds. The think is that GC polling
  would be just like the short polling for getting the progress status
  back in the browser.

  The behavior that I observed was that while I was uploading a 30 Mb +
  file the polling requests timed out after 5 secconds per
  LiftRules.ajaxPostTimeout. This means that our progress monitoring
  ajax request would have timed out as well. On the server side the
  execution got stuck until the upload was complete.
  LiftServlet.handleAjax was not called until the upload terminates.

  Initially I thought that this has to do to limited request channels
  that browser have but the thing is that we have several places in Lift
  code where we synchronize things. Such as LiftSession.getSession,
  LiftSession.fixSessionTime etc. Acquiring these locks made the
  progress polling to hang until the upload terminated. Of course
  removing th synchronized block made the polling to work right during
  the file upload. Now this was just for test ... I'm not suggesting to
  remove the synchronized blocks as  we'd loose consistency but this
  looks to stay in the way of properly dealing with multiple parallel
  request per same session like fileupload and progress monitoring.

  It appears that there is either a thread starvation situation or
  simply a lock that is held while upload is is progress.

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



[Lift] Re: File upload streaming and progress monitoring ...

2009-07-18 Thread marius d.

Great. Let me know if I can help with anything.

Br's,
Marius

On Jul 18, 9:22 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Marius,

 This is awesome. Things are now working as expected - I knew this
 wasn't a browser connection issue causing the problems.

 The code in the widget package is pretty rubbish right now, but i just
 had time to hack together a hardcoded sample to make sure that your
 commit actually fix the problem... Im happy to report that it does
 indeed now work exactly as required.

 The next step is to work backwards and clean all the code up and fix
 the cross-browser issues as right now it works in firefox and IE but
 not in safari or chrome et al.

 Cheers, Tim

 On Jul 18, 3:08 pm, marius d. marius.dan...@gmail.com wrote:

  Just committed a fix ...

  Br's,
  Marius

  On Jul 18, 4:10 pm, marius d. marius.dan...@gmail.com wrote:

   A little more on this ...

   Living the above synchronized blocks where they are but removing the
   one from LiftSession.runParams  made it work properly. Looks like this
   one was holding the lock while the file upload progress was happening.
   Dave I'm not really sure why in runParams the the toRun is obtained
   from a synchronized block ... is it because we'rreading from
   messageCallback there ? ..cause otherwise the entire expression is
   about functions composition that does not change any state.

   Br's,
   Marius

   On Jul 18, 3:57 pm, Marius marius.dan...@gmail.com wrote:

HI there,

I know, there have been several other threads around the topic but I
just wanted to yield somethings here. In the past few days I've been
talking with Tim as he was having problems with his FileUpload widget.
Even with short polling the progress was not reported even though the
LiftSession.progressListener was properly called.

Today I started to look into it and here is what I've done:

1. Here is the markup:

  iframe id=upload_target name=upload_target src=# style=width:
0;height:0;border:0px solid #fff;/iframe

  lift:Upload.render form=POST multipart=true id=upload_form
target=upload_target
    f:inputFile/
    input type=submit value=Upload/
  /lift:Upload.render

  A simple snippet that uses the invisible iframe trick to upload
stuff in the background. The so called Ajax upload. (I had to add
the target attribute into the supported form snippet attributed but
that's ok)

2. In boot had something like:

    LiftSession.onSetupSession = ((session: LiftSession) = {
      session.progessListener = Full((chunk, total, index) = {
         Thread.sleep(100)
         println(index +  read  + chunk +  out of  + total +   +
Thread.currentThread)
      })
    }) :: Nil

    Just monitor the progress ... and to make it last a little longer
I'm sleeping for 100 milliseconds

3. I set the GC polling to 10 seconds. The think is that GC polling
would be just like the short polling for getting the progress status
back in the browser.

The behavior that I observed was that while I was uploading a 30 Mb +
file the polling requests timed out after 5 secconds per
LiftRules.ajaxPostTimeout. This means that our progress monitoring
ajax request would have timed out as well. On the server side the
execution got stuck until the upload was complete.
LiftServlet.handleAjax was not called until the upload terminates.

Initially I thought that this has to do to limited request channels
that browser have but the thing is that we have several places in Lift
code where we synchronize things. Such as LiftSession.getSession,
LiftSession.fixSessionTime etc. Acquiring these locks made the
progress polling to hang until the upload terminated. Of course
removing th synchronized block made the polling to work right during
the file upload. Now this was just for test ... I'm not suggesting to
remove the synchronized blocks as  we'd loose consistency but this
looks to stay in the way of properly dealing with multiple parallel
request per same session like fileupload and progress monitoring.

It appears that there is either a thread starvation situation or
simply a lock that is held while upload is is progress.

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



[Lift] Re: Article: Lift snippet selection - DispatchSnippet vs snippet reflection

2009-07-20 Thread marius d.

Good article but do you have some concrete benchmarks between Snippet
and DispatchSnippet? In modern JVM memory allocation is pretty cheap
due to heap preparation JVM makes and reflection invocation doesn't
bring too much overhead ... not anymore.

The article seams to present the two from an optimization perspective
but I don;t see much optimization here. Of course DispatchSnippet
invocation is faster but the question is how much. And for say
thousands of concurrent requests per cluster node I have the feeling
that the delta is not that significant. Furthermore these deltas
become totally negligible when during a request life cycle we're
hitting DB-s. remote services etc.

Personally I don't really agree regular snippets should be used in Dev
mode only, well not until I see some compelling numbers.


Br's,
Marius

On Jul 20, 3:36 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey guys,

 Just posted a new article about lift snippets:http://is.gd/1FbDw-
 perhaps it will help someone :-)

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



[Lift] Re: Feedback on presentation

2009-07-21 Thread marius d.

I like it, like it, like it ! :)

Br's,
Marius

On Jul 21, 1:05 am, Derek Chen-Becker dchenbec...@gmail.com wrote:
 I've attached the slides that I'll be using for my talk to the Boulder JUG
 in August. It's mainly cribbed from the excellent presentations that other
 people here have made, but I would appreciate any feedback on content or
 structure.

 Thanks,

 Derek

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



[Lift] Re: S.getHeaders, could i get some examples?

2009-07-21 Thread marius d.

+1 !

On Jul 21, 6:05 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 S.getHeader is for retrieving headers that are set in the *response*, not
 the request. I can update the docs to make that more clear, although it
 seems like this is confusing. Perhaps we should make a getRequestHeader
 method. Thoughts?

 Derek

 On Mon, Jul 20, 2009 at 7:49 PM, DFectuoso santiago1...@gmail.com wrote:

  for some reason S.getHeader(User-Agent) returns empty, but the
  second one(using the so useful for) did the trick, thanks!

  On Jul 20, 4:34 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   How about S.getHeader(User-Agent)?

   Or for {r - S.request; ua - r.userAgent} yield ua?

   On Mon, Jul 20, 2009 at 4:20 PM, DFectuoso santiago1...@gmail.com
  wrote:

Im trying to get information about the browser the user is using and
wanted to get some working snippets around S.getHeaders.

Can't get it to work ( S.getHeaders(List((User-Agent,))) returns
(User-Agent, )). I guess I'm not calling it right.

   --
   Lift, the simply functional web frameworkhttp://liftweb.net
   Beginning Scalahttp://www.apress.com/book/view/1430219890
   Follow me:http://twitter.com/dpp
   Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Template tags and properties

2009-07-22 Thread marius d.

Lift is not a MVC framework but a View First one. Snippets are the way
to generate dynamic content that will be woven into the resulting
markup. There is no design break in fact it is one of the most
fundamental design goals of Lift. Snippets work with markup building
blocks to generate the proper outcome. This is not a bad thing, quite
the opposite. However every framework out there can be used improperly
in this case using tons of markup in the snippets doesn't make too
much sense.

If you still feel that you want to make a comparison between Lift and
MVC snippets are not controllers. You can think of snippets as
rendering helpers that sits very close to the templates ...

Static Templates  + Snippets = Resulting Markup That Contains Dynamic
Content

Br's,
Marius

On Jul 22, 12:59 pm, José María josemariar...@gmail.com wrote:
 Doesn't this put view code (XML/Xhtml) in controller code? I've read
 many times
 in Lift doc about not puting logic in view but the reverse can be
 even
 worst, doing impossible to have a separate design. You can't broke
 logic but
 design.

 On Jul 21, 10:19 am, Timothy Perrett timo...@getintheloop.eu wrote:

  José,

  You'll need to do this from yoursnippetcode - we dont have any view
  logic in templates at all as that breaks lift view first model.

  For example:

  class YouSnippet {
    def example: NodeSeq = aHi/a % href - /mypath/ +
  someDynamicVar

  }

  In your template:

  lift:your_snippet.example /

  Does that make sense?

  Cheers, Tim

  On Jul 21, 10:11 am, José María josemariar...@gmail.com wrote:

   Hi,

   I suppose that this is something simple, how can I put a value inside
   a property in a template?

   Something like:

   a href=/mypath/myobject:id/myobject:idhi/a

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



[Lift] Re: Acceding object fields in template

2009-07-22 Thread marius d.

Not sure how much it worths but I'm having second thoughts about this
because it feels to me like it drifts away from the Lift's templating
idiom. Accessing arbitrary objects properties/methods seems to bring
lift closer to JSF kinds of things and I don't really see what problem
this actually solves as snippet invocation.

lift:product.name /

can simply return a Text(product.name) ... or with implicit
conversions just:

def name(xhtml: NodeSeq): NodeSeq = product.name

Bringing data objects into template giving them global page scope
seems to me that it kinda opens Pandora's box.

Maybe I'm paranoiac or just wrong but that's how I see it
currently 

Br's,
Marius

On Jul 22, 6:32 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Jose,

 At this point, Lift doesn't support this kind of functionality... but I
 think it's an interesting feature.

 Can you open a ticket for it athttp://github.com/dpp/liftweb/issues

 Thanks,

 David



 On Wed, Jul 22, 2009 at 3:02 AM, José María josemariar...@gmail.com wrote:

  Hi,

  Is it possible to access to the field of an object binded to a name in
  a template?

     bind(data , xhtml, product -- product)

  And then in the template:

    h1 id=Titledata:product.name //h1

  Thanks.

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A problem involving Lift and javascript dodged for now..

2009-07-22 Thread marius d.

Have you tried looking at tree widget in lift-widgets project? ...
We're using jquery.treeview ...

Br's,
Mairus

On Jul 22, 12:04 am, Alan M alan.morten...@gmail.com wrote:
 I'm using lift for web services and I need to serve a javascript
 driven front end from the same web server (don't feel like messing
 with proxies right now) and I figured someone on here would want to
 know what I ran into with serving static content.

 Basically I was trying to use jQuery and in particular a tree library
 called jsTree (it looks really feature rich and flexible).  Anyway, it
 turns out either the lift javascript or some conflict derived in part
 there from was munging things sufficiently so that everything seemed
 normal in the xhtml.. but a few of the classes where deleted.  This
 caused the entire jsTree to fail to render properly, making it non-
 functional.

 I'm not entirely sure why it did what it did, but until I stripped out
 Lift and ran it just as an empty servlet I couldn't see what was going
 on.  For some reason the lift served version stripped the class off of
 a ul (in my case it was only one, but I had a very simple tree).. the
 class for the ul was ltr and it's gone in the lift version.  This ul
 is generated by javascript using jQuery, so I'm not sure what's going
 on there.

 Anyway, I've decided since all my dynamic content is coming from other
 webapps, I might as well just serve my static content from a bare
 servlet, therefore cutting down on any variables.  (I've already
 wrestled with this for too long).  But if anyone is interested in
 following up, maybe with the jsTree guys, have at it.  They have a
 very friendly Google group as well :)

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



[Lift] Re: how to create a dynamic form in lift?

2009-07-23 Thread marius d.

There are several ways of doing it:

1. Use JSONForm (http://wiki.liftweb.net/index.php/
HowTo_use_JSON_forms) in conjunction with JSONHandler and create new
Input fields purely from JavaScript and adhere to your own naming
conversion.

2. Before submitting the form start an Ajax request to add a field. On
your Ajax request processing function you can create a new input
field, associate your field function and return the JS back to client
which will add the input field to your form. Hence when you are
submitting the form, all your bound functions will be executed.

Br's,
Marius

On Jul 23, 10:34 am, JanWillem Tulp janwillem.t...@gmail.com wrote:
 Hi community,

 I was wondering: what is a nice and efficient way to do the following
 in Lift:

 I would like to create a form where users can dynamically add fields
 for a specific type of data. For instance, say I have a form with the
 fields name, display name and date of birth. Of course, I can create a
 a snippet where I can do my validation and other handling. Now I want
 to add a button that adds an additional field, but I don't know
 beforehand how the input of this new form field should be handled. The
 options a user can pick from is fixed (for instance numeric field,
 text field, email field, etc.) so that I can write validation and
 handling for a specific type, but the user should be free to add as
 many fields as he likes, of any type he likes.

 Let me give you an example:

 the current form contains:

     name, display name, date of birth.

 One user clicks a button, and wants to add a phone number field, so
 that his form will display:

     name, display name, date of birth, phone number

 However, another user might add another type of field, for instance a
 zipcode field, so that his form will display:

     name, display name, date of birth, zipcode

 Of course, a field that expects a phone number should be validated
 differently than a field that expects a zipcode.

 How do I create this dynamic kind of form, since I can not map the
 form fields directly to a fixed set of objects in my snippets, because
 this is not known beforehand, but depends on user input. I hope you
 understand my question, and that you have some good suggestions.

 Thanks!

 JanWillem Tulp

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



[Lift] Re: How to use SHtml.ajaxCall?

2009-07-23 Thread marius d.

Oops typo:

 import net.liftweb.js.jquery._

should be

 import net.liftweb.http.js.jquery._

I just wrote the code in the mail (no IDE) to highlight the concept
not necessarily copy-paste-able :)

Br's,
Marius

On Jul 23, 5:29 pm, Dorinel dorinel.munte...@gmail.com wrote:
 marius d. wrote:
  Try:

  button type=button onclick={ajaxCall(JsRaw($('#whoField').attr
  ('value')), updateWho _)._2}{?(send)}/button

 This still is not working for me, it's what I get:

 use java command with args in file forced : false
 /home/dorin/work/scala/hello-lift/src/main/scala/net/liftweb/hello/
 snippet/HelloFormAjax.scala:22: error: ')' expected but string literal
 found.
         who - whoNode(world)

 When I'm trying your import:
  use java command with args in file forced : false
 /home/dorin/work/scala/hello-lift/src/main/scala/net/liftweb/hello/
 snippet/HelloFormAjax.scala:8: error: value js is not a member of
 package net.liftweb
 import net.liftweb.js.jquery._
                    ^
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: SQL dumping in log?

2009-07-23 Thread marius d.

I'm not sure if that logs the statements with the actual values. Does
it ?

Br's,
Marius

On Jul 23, 7:48 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 Jon jon.klei...@usit.uio.no writes:
  Hi,

  Is it possible to dump/log all SQL statements going to the database,
  so that one can see all the SELECTs, INSERTs etc.?

 Look into DB.addLogFunc

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



[Lift] Re: SQL dumping in log?

2009-07-23 Thread marius d.

Looking a the code looks to me that the query is just a toString call
for a Statement reference which won't yield what we'd expect. Just
spoke with Derek about this. He'll take a look on it and eventually
add this support soon enough.

Br's,
Marius

On Jul 23, 10:01 pm, Jon jon.klei...@usit.uio.no wrote:
 On Jul 23, 8:56 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:

  marius d. marius.dan...@gmail.com writes:
   I'm not sure if that logs the statements with the actual values. Does
   it ?

  Strange, just tried it because I definitely remember seeing values
  being logged, but turns out not all statements have values logged and it
  seem just queries are logged.

  /Jeppe

 I tried this:
 DB.addLogFunc((query, len) = Log.info(The query: +query+ took +len
 + milliseconds))

 ... and only got things like this:
 INFO - The query: b8450018-0122-a854-9ce5-00cde658 took 47
 milliseconds

 Not exactly what I was interested in. ;-)

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



[Lift] Re: how to create a dynamic form in lift?

2009-07-23 Thread marius d.

Naftoli, take a look on JsonForm  JsonHandler. It provides is A WAY
of allowing adding arbitrary fields to a form and process it on server
side in any way desired. Why? ... because with this mechanism you
don't need Lift's functions binding and inherently field naming
generation. My notes are NOT related to Mapper in fact this is
persistence agnostic.


Br's,
Marius

On Jul 23, 5:39 pm, Naftoli Gugenheim naftoli...@gmail.com wrote:
 You don't need javascript. Just use submit buttons for add field etc. 
 actions. If you need relationships to be kept track of but not actually 
 created, store the delta in your StatefulSnippet -- current, added, and 
 removed children lists; then display a list of actual items by concatening 
 current and added, and filtering actual.filter(a = removed.forall(a.ne)).
 If the relationships are more complex, you may want to wait for me to commit 
 my one-to-one and one-to-many additions to Mapper in the near future BH.
 I am actually doing something pretty similar, and I hope to commit soon a 
 number of utilities to make this easier.
 I'm assuming that you have tables and Mappers all set up to support this kind 
 of data structure?

 -

 marius d.marius.dan...@gmail.com wrote:

 There are several ways of doing it:

 1. Use JSONForm (http://wiki.liftweb.net/index.php/
 HowTo_use_JSON_forms) in conjunction with JSONHandler and create new
 Input fields purely from JavaScript and adhere to your own naming
 conversion.

 2. Before submitting the form start an Ajax request to add a field. On
 your Ajax request processing function you can create a new input
 field, associate your field function and return the JS back to client
 which will add the input field to your form. Hence when you are
 submitting the form, all your bound functions will be executed.

 Br's,
 Marius

 On Jul 23, 10:34 am, JanWillem Tulp janwillem.t...@gmail.com wrote:

  Hi community,

  I was wondering: what is a nice and efficient way to do the following
  in Lift:

  I would like to create a form where users can dynamically add fields
  for a specific type of data. For instance, say I have a form with the
  fields name, display name and date of birth. Of course, I can create a
  a snippet where I can do my validation and other handling. Now I want
  to add a button that adds an additional field, but I don't know
  beforehand how the input of this new form field should be handled. The
  options a user can pick from is fixed (for instance numeric field,
  text field, email field, etc.) so that I can write validation and
  handling for a specific type, but the user should be free to add as
  many fields as he likes, of any type he likes.

  Let me give you an example:

  the current form contains:

      name, display name, date of birth.

  One user clicks a button, and wants to add a phone number field, so
  that his form will display:

      name, display name, date of birth, phone number

  However, another user might add another type of field, for instance a
  zipcode field, so that his form will display:

      name, display name, date of birth, zipcode

  Of course, a field that expects a phone number should be validated
  differently than a field that expects a zipcode.

  How do I create this dynamic kind of form, since I can not map the
  form fields directly to a fixed set of objects in my snippets, because
  this is not known beforehand, but depends on user input. I hope you
  understand my question, and that you have some good suggestions.

  Thanks!

  JanWillem Tulp

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



<    1   2   3   4   5   6   >