[Lift] Re: scalar queries in Lift/JPA

2009-04-24 Thread Bryan.

I've never tried this on a scalar query, but a constructor expression
example should be something like this:

select new com.chas.values.AnswerCount(t.answer, count(distinct
answer)) from ...

class AnswerCount(answer: String, count: Long) {
  private def nullToOption[T](v: T) = v match { case null = None case
_ = Some(v) }

  def getAnswer = nullToOption(answer)
  def getCount = nullToOption(count)
}

object AnswerCount {
  def unapply(ac: AnswerCount): Option[(Option[String], Option[Long])]
= {
Some(ac.getAnswer, ac.getCount)
  }
}

Sources:  
http://edocs.bea.com/kodo/docs41/full/html/ejb3_langref.html#ejb3_langref_constructor

On Apr 23, 4:11 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Oliver, I've never done anything like that in JPA or Hibernate. Is that
 actually possible? Can you create a class instance within a query?

 Derek

 On Thu, Apr 23, 2009 at 2:47 PM, Charles F. Munat c...@munat.com wrote:



  I'm not really sure how I would go about this, but I'll think about it
  when I have time to get back to that code.

  Thanks, Oliver.

  Chas.

  Oliver Lambert wrote:
   Is there anything to stop you defining an class/entity {answer: String,
   countAnswer: Int} and to directly create it from JPA (of course, it's
   read only).

   On Wed, Apr 22, 2009 at 9:36 AM, Charles F. Munat c...@munat.com
   mailto:c...@munat.com wrote:

       I was thinking tuples, but that didn't work. I'll try your
  suggestion.
       BTW, for anyone reading along, I forgot the group by clause in the
  query
       below.

       Chas.

       Derek Chen-Becker wrote:
         I think that the type would be Array[Any] and you'll get one
       String and
         Int for each row.

         Derek

         On Tue, Apr 21, 2009 at 3:37 PM, Charles F. Munat c...@munat.com
       mailto:c...@munat.com
         mailto:c...@munat.com mailto:c...@munat.com wrote:

             Anyone have a quick example of how to run a scalar query in
       JPA? I can't
             find anything in the JPA demo.

             I have this query:

             select t.answer, count(distinct answer) from Vote t where
       t.poll = :poll
             order by t.answer

             but how do I call it? I normally do:

             Model.createNamedQuery[...](findVoteCountAnswersByPoll,
       poll -
             poll).findAll

             But what is the type? And how do I get the results back out?

             I know I did this once before somewhere, but I can't remember
       where and
             I can't find it.

             Thanks!

             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: Binding Radio Button

2009-04-24 Thread sailormoo...@gmail.com

Thanks Timothy, but can you give an example of checkbox, because no
matter what I try, the binding function of checkbox doesn't seem to be
called when checkbox is set. I tried some trivious binding function,
but it's no effect still.

--~--~-~--~~~---~--~~
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: Binding Radio Button

2009-04-24 Thread sailormoo...@gmail.com


The example from the lift book doesn't work.

Listing 4.4: A checkbox example
SHtml.checkbox(false, if (_) frobnicate(), Full(snazzy), class -
woohoo)

and mine is

bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, if (_) option_list
= option_list ::: List(FlagEnum.TEST_MODE), id-test_mode))

doesn't work.

even with a simpler one (no if checking, and no list appending)
doesn't work.

bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, {x:Boolean =
option_list
=  List(FlagEnum.TEST_MODE)}, id-test_mode))

--~--~-~--~~~---~--~~
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: Binding Radio Button

2009-04-24 Thread Timothy Perrett

A checkbox should look like this:

  var booleanThing: Boolean = false

  def another(xhtml: NodeSeq): NodeSeq = {
bind(c,xhtml,
  checkbox - SHtml.checkbox(booleanThing, booleanThing = _) %
(class - myCSSclass)
)
  }

Cheers, Tim

On Apr 24, 2:16 am, sailormoo...@gmail.com sailormoo...@gmail.com
wrote:
 The example from the lift book doesn't work.

 Listing 4.4: A checkbox example
 SHtml.checkbox(false, if (_) frobnicate(), Full(snazzy), class -
 woohoo)

 and mine is

 bind(entry, xhtml,
       test_mode         - SHtml.checkbox(false, if (_) option_list
 = option_list ::: List(FlagEnum.TEST_MODE),     id-test_mode))

 doesn't work.

 even with a simpler one (no if checking, and no list appending)
 doesn't work.

 bind(entry, xhtml,
       test_mode         - SHtml.checkbox(false, {x:Boolean =
 option_list
 =  List(FlagEnum.TEST_MODE)},     id-test_mode))
--~--~-~--~~~---~--~~
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: Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread Timothy Perrett

Your confussing things I think. InMemoryResponse is a HTTP response
designed for use in conjunction with DispatchPF.

If your getting the PDF dynamically then you'll need to read the PDF
either into memory and return it from a url or do a streaming response
- checkout my blog post here about using StreamingResponse: http://is.gd/oCtt

So, lets assume that you made a dispatchPF so that your pdf was
dynamically served from:

/download/pdf/someId

Then from your snippet you can either just manually link to that URL
if you so wish.

Does that help?

Cheers, Tim

On Apr 24, 8:50 am, maku martin.kuhn...@gmail.com wrote:
 Hi,

 I would like to get a PDF document (produced via IText) from my app.
 It should be triggered via a submit button
 The PDF document should be presented in a separate browser window.

 In the lift book there is an example how to do this via a link and
 with mapping a request via LiftRules.dispatch.append to an
 InMemoryResponse (which works as expected).

 When I want to trigger this process via a submit button I can imagine
 to call a function in the form binding  of the submit button (in the
 snippet) . The function would be able to redirectTo the request
 mapping which returns an InMemoryResponse.

 To present the PDF in an new window / tab, I would define the submit
 button with submit(PDF,  pdf,(onClick,document.forms
 [0].target='_blank';)

 My questions:

 - Is this a proper solution?
 - Would it be possible to return the InMemoryRespone directly from the
 snippet (without the need to define a special request behaviour and
 to perform the redirectTo)

 Could anybody give me a hint?

 TIA
 Regards,
 Martin
--~--~-~--~~~---~--~~
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] Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread maku

Hi,

I would like to get a PDF document (produced via IText) from my app.
It should be triggered via a submit button
The PDF document should be presented in a separate browser window.

In the lift book there is an example how to do this via a link and
with mapping a request via LiftRules.dispatch.append to an
InMemoryResponse (which works as expected).

When I want to trigger this process via a submit button I can imagine
to call a function in the form binding  of the submit button (in the
snippet) . The function would be able to redirectTo the request
mapping which returns an InMemoryResponse.

To present the PDF in an new window / tab, I would define the submit
button with submit(PDF,  pdf,(onClick,document.forms
[0].target='_blank';)

My questions:

- Is this a proper solution?
- Would it be possible to return the InMemoryRespone directly from the
snippet (without the need to define a special request behaviour and
to perform the redirectTo)

Could anybody give me a hint?

TIA
Regards,
Martin

--~--~-~--~~~---~--~~
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] Thoughts on lift marketing [was A Lift preso]

2009-04-24 Thread Daniel Mueller

Thoughts about that presentation[1] (german): The slides indicate that
the presentation was for the W-JAX 2008 conference (Nov 2008), so it's
a bit older. While most of the stuff is nothing special (except that
he left out JPA in the persistence slides - was probably too new for
the submission deadline), I noted the conclusions (translated):
Negative (p. 118):
* no stable APIS
* proprietary
* [part of the] hype around Scala
* One man show
* [Steep] learning curve [because of] Scala
* [Missing] Scala tooling
* No roadmap
(for reference: the positive (p. 110) are: [good] use case for Scala,
close to HTTP, elegant because of Scala, and WOW effect)

And after some words from David Pollak (english, p. 122), the
applicability (p. 124):
* playground for Scala friends
* Initial effort [required] for non-Scala developers: high

Just what went through my mind when I read it (reordered):
* no stable APIS: Well, that was before 1.0 which should have been
expressed more clearly, but ...
* proprietary: Not more than any other OS lib out there... (and in the
generally accepted definition in the SE world, this statement is wrong
IMHO..)
* [part of the] hype around Scala: no comment
* [Steep] learning curve [because of] Scala: no comment
* [Missing] Scala tooling: This is being rectified in other parts of
the Scala community and I think it's improving a lot recently...

* One man show  no roadmap: both points are actually not true, or
definitely not true anymore. But... I think that to increase
'enterprise' adoption (meaning not just bleeding-edge/curious/driven/
self-reliant coders, or enterprises where the final decision is done
by someone not very close to code), it would help if lift would market
it's adoption among BigNames and big scale projects a bit more, and
also show (on the homepage) that it has a highly committed team and a
stable roadmap. I was pleased to find the quote from Michael Galpin,
eBay on the front page (and the other quotes), but I think a 'adopted
by/used in' link to the applications/companies that are using it (with
Logos where possible) would help a lot as well (Where exactly is that
list of life applications that is polled every once in a while on the
mailing list). And quotes about the responsiveness and helpfulness of
the mailing list would also deserve a special mention (on a special
page accessible from the homepage). A site that I really like in terms
of marketing effort: http://terracotta.org/ . ok, it's backed by a
company, but it's still quite clean and markets the product really
well.

I know that for most coders/developers/engineers looking to assess a
good technology, this is probably perceived as shadows and dust, but
for someone that is very likely betting a part of his yearly salary
bonus on the decision (because the cause loss/gain in time/money could
make or break his goals/carreer/raise), those considerations are very
important. Think of it simply as prudent marketing. The quality of
Lift's code and community *is* amazing. Let's just make it as easy as
possible for people to recognize that.
On a related note please don't forget one of the factors why Ruby on
Rails had an immense success as a framework: DHH is a very loud voice
talking about a framework and as a result this attracted a lot of
attention to it. IIRC the interesting side effect was that because of
the excellent 'marketing' and the attracted attention, the framework
actually attracted additional developer horsepower and matured a lot
faster.

And about the 'playground for Scala devs  high required initial
investment because of Scala', maybe it wouldn't hurt to defuse that a
bit as well. I really like the statement of Martin Odersky: In the
end it's just another jar on your classpath (ok, it's a bit more than
that, but...). Or maybe some excerpts from the mailing list/other
adopters about experiences while switching to Lift with no prior Scala
experience. True, that's basically something that applies to Scala in
the large and not just Lift, but I think that Lift is for Scala what
Rails is for Ruby: the flagship product and main attraction magnet.
Because Lift (and also Rails) is a framework used to solve problems
that a lot of people encounter in daily life (webapps). I personally
love what I can do with Scala for other problem domains, but those
domains are less close to what most developers work on on a daily
basis.

Oh, and I think that for the most part the marketing organized in
terms of conferences, papers, and books is pretty thorough. Would be
nice to see that in a news section to see what is going on with lift.

Just some thoughts.

Thanks for the amazing work,
Daniel

[1] http://www.slideshare.net/itemis/lift-mit-scala-ein-befrderungsmittel...

On Apr 23, 8:52 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 http://www.slideshare.net/itemis/lift-mit-scala-ein-befrderungsmittel...

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning 

[Lift] Re: Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread maku

Hi Tim,

thanks for responding.

I think I don't know enough.

O.k. I've to use StreamingResponse. What I would like to know is how
can I set the StreamingResponse instance as response served by lift
when my snippet handles the request triggered from the submit button.

In the pure servlet tech I would write to HttpServletResponse -- ...
response.getOutputStream().write(bytes);

TIA
Regards, Martin

On Apr 24, 11:29 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Your confussing things I think. InMemoryResponse is a HTTP response
 designed for use in conjunction with DispatchPF.

 If your getting the PDF dynamically then you'll need to read the PDF
 either into memory and return it from a url or do a streaming response
 - checkout my blog post here about using StreamingResponse:http://is.gd/oCtt

 So, lets assume that you made a dispatchPF so that your pdf was
 dynamically served from:

 /download/pdf/someId

 Then from your snippet you can either just manually link to that URL
 if you so wish.

 Does that help?

 Cheers, Tim

 On Apr 24, 8:50 am, maku martin.kuhn...@gmail.com wrote:

  Hi,

  I would like to get a PDF document (produced via IText) from my app.
  It should be triggered via a submit button
  The PDF document should be presented in a separate browser window.

  In the lift book there is an example how to do this via a link and
  with mapping a request via LiftRules.dispatch.append to an
  InMemoryResponse (which works as expected).

  When I want to trigger this process via a submit button I can imagine
  to call a function in the form binding  of the submit button (in the
  snippet) . The function would be able to redirectTo the request
  mapping which returns an InMemoryResponse.

  To present the PDF in an new window / tab, I would define the submit
  button with submit(PDF,  pdf,(onClick,document.forms
  [0].target='_blank';)

  My questions:

  - Is this a proper solution?
  - Would it be possible to return the InMemoryRespone directly from the
  snippet (without the need to define a special request behaviour and
  to perform the redirectTo)

  Could anybody give me a hint?

  TIA
  Regards,
  Martin

--~--~-~--~~~---~--~~
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: Binding Radio Button

2009-04-24 Thread Derek Chen-Becker
What doesn't work about the example? Do you get a compilation error, or it
just doesn't do what you want?

Derek

On Thu, Apr 23, 2009 at 7:16 PM, sailormoo...@gmail.com 
sailormoo...@gmail.com wrote:



 The example from the lift book doesn't work.

 Listing 4.4: A checkbox example
 SHtml.checkbox(false, if (_) frobnicate(), Full(snazzy), class -
 woohoo)

 and mine is

 bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, if (_) option_list
 = option_list ::: List(FlagEnum.TEST_MODE), id-test_mode))

 doesn't work.

 even with a simpler one (no if checking, and no list appending)
 doesn't work.

 bind(entry, xhtml,
  test_mode - SHtml.checkbox(false, {x:Boolean =
 option_list
 =  List(FlagEnum.TEST_MODE)}, id-test_mode))

 


--~--~-~--~~~---~--~~
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: Thoughts on lift marketing [was A Lift preso]

2009-04-24 Thread Heiko Seeberger

Mates,

Forget about that old presentation! I have seen it live and it is just
not relevant.

There will be ab Scala Day at W-JAX 09 (11 Nov) and I will give a
*very* positive talk there.

Cheers
Heiko

On 24/04/2009, Daniel Mueller dan.in.a.bot...@gmail.com wrote:

 Thoughts about that presentation[1] (german): The slides indicate that
 the presentation was for the W-JAX 2008 conference (Nov 2008), so it's
 a bit older. While most of the stuff is nothing special (except that
 he left out JPA in the persistence slides - was probably too new for
 the submission deadline), I noted the conclusions (translated):
 Negative (p. 118):
 * no stable APIS
 * proprietary
 * [part of the] hype around Scala
 * One man show
 * [Steep] learning curve [because of] Scala
 * [Missing] Scala tooling
 * No roadmap
 (for reference: the positive (p. 110) are: [good] use case for Scala,
 close to HTTP, elegant because of Scala, and WOW effect)

 And after some words from David Pollak (english, p. 122), the
 applicability (p. 124):
 * playground for Scala friends
 * Initial effort [required] for non-Scala developers: high

 Just what went through my mind when I read it (reordered):
 * no stable APIS: Well, that was before 1.0 which should have been
 expressed more clearly, but ...
 * proprietary: Not more than any other OS lib out there... (and in the
 generally accepted definition in the SE world, this statement is wrong
 IMHO..)
 * [part of the] hype around Scala: no comment
 * [Steep] learning curve [because of] Scala: no comment
 * [Missing] Scala tooling: This is being rectified in other parts of
 the Scala community and I think it's improving a lot recently...

 * One man show  no roadmap: both points are actually not true, or
 definitely not true anymore. But... I think that to increase
 'enterprise' adoption (meaning not just bleeding-edge/curious/driven/
 self-reliant coders, or enterprises where the final decision is done
 by someone not very close to code), it would help if lift would market
 it's adoption among BigNames and big scale projects a bit more, and
 also show (on the homepage) that it has a highly committed team and a
 stable roadmap. I was pleased to find the quote from Michael Galpin,
 eBay on the front page (and the other quotes), but I think a 'adopted
 by/used in' link to the applications/companies that are using it (with
 Logos where possible) would help a lot as well (Where exactly is that
 list of life applications that is polled every once in a while on the
 mailing list). And quotes about the responsiveness and helpfulness of
 the mailing list would also deserve a special mention (on a special
 page accessible from the homepage). A site that I really like in terms
 of marketing effort: http://terracotta.org/ . ok, it's backed by a
 company, but it's still quite clean and markets the product really
 well.

 I know that for most coders/developers/engineers looking to assess a
 good technology, this is probably perceived as shadows and dust, but
 for someone that is very likely betting a part of his yearly salary
 bonus on the decision (because the cause loss/gain in time/money could
 make or break his goals/carreer/raise), those considerations are very
 important. Think of it simply as prudent marketing. The quality of
 Lift's code and community *is* amazing. Let's just make it as easy as
 possible for people to recognize that.
 On a related note please don't forget one of the factors why Ruby on
 Rails had an immense success as a framework: DHH is a very loud voice
 talking about a framework and as a result this attracted a lot of
 attention to it. IIRC the interesting side effect was that because of
 the excellent 'marketing' and the attracted attention, the framework
 actually attracted additional developer horsepower and matured a lot
 faster.

 And about the 'playground for Scala devs  high required initial
 investment because of Scala', maybe it wouldn't hurt to defuse that a
 bit as well. I really like the statement of Martin Odersky: In the
 end it's just another jar on your classpath (ok, it's a bit more than
 that, but...). Or maybe some excerpts from the mailing list/other
 adopters about experiences while switching to Lift with no prior Scala
 experience. True, that's basically something that applies to Scala in
 the large and not just Lift, but I think that Lift is for Scala what
 Rails is for Ruby: the flagship product and main attraction magnet.
 Because Lift (and also Rails) is a framework used to solve problems
 that a lot of people encounter in daily life (webapps). I personally
 love what I can do with Scala for other problem domains, but those
 domains are less close to what most developers work on on a daily
 basis.

 Oh, and I think that for the most part the marketing organized in
 terms of conferences, papers, and books is pretty thorough. Would be
 nice to see that in a news section to see what is going on with lift.

 Just some thoughts.

 Thanks for the amazing work,
 

[Lift] Re: Thoughts on lift marketing [was A Lift preso]

2009-04-24 Thread David Pollak
On Fri, Apr 24, 2009 at 3:27 AM, Daniel Mueller
dan.in.a.bot...@gmail.comwrote:


 Thoughts about that presentation[1] (german): The slides indicate that
 the presentation was for the W-JAX 2008 conference (Nov 2008), so it's
 a bit older. While most of the stuff is nothing special (except that
 he left out JPA in the persistence slides - was probably too new for
 the submission deadline), I noted the conclusions (translated):
 Negative (p. 118):
 * no stable APIS
 * proprietary
 * [part of the] hype around Scala
 * One man show
 * [Steep] learning curve [because of] Scala
 * [Missing] Scala tooling
 * No roadmap
 (for reference: the positive (p. 110) are: [good] use case for Scala,
 close to HTTP, elegant because of Scala, and WOW effect)

 And after some words from David Pollak (english, p. 122), the
 applicability (p. 124):
 * playground for Scala friends
 * Initial effort [required] for non-Scala developers: high

 Just what went through my mind when I read it (reordered):
 * no stable APIS: Well, that was before 1.0 which should have been
 expressed more clearly, but ...
 * proprietary: Not more than any other OS lib out there... (and in the
 generally accepted definition in the SE world, this statement is wrong
 IMHO..)
 * [part of the] hype around Scala: no comment
 * [Steep] learning curve [because of] Scala: no comment
 * [Missing] Scala tooling: This is being rectified in other parts of
 the Scala community and I think it's improving a lot recently...

 * One man show  no roadmap: both points are actually not true, or
 definitely not true anymore. But... I think that to increase
 'enterprise' adoption (meaning not just bleeding-edge/curious/driven/
 self-reliant coders, or enterprises where the final decision is done
 by someone not very close to code), it would help if lift would market
 it's adoption among BigNames and big scale projects a bit more, and
 also show (on the homepage) that it has a highly committed team and a
 stable roadmap. I was pleased to find the quote from Michael Galpin,
 eBay on the front page (and the other quotes), but I think a 'adopted
 by/used in' link to the applications/companies that are using it (with
 Logos where possible) would help a lot as well (Where exactly is that
 list of life applications that is polled every once in a while on the
 mailing list). And quotes about the responsiveness and helpfulness of
 the mailing list would also deserve a special mention (on a special
 page accessible from the homepage). A site that I really like in terms
 of marketing effort: http://terracotta.org/ . ok, it's backed by a
 company, but it's still quite clean and markets the product really
 well.

 I know that for most coders/developers/engineers looking to assess a
 good technology, this is probably perceived as shadows and dust, but
 for someone that is very likely betting a part of his yearly salary
 bonus on the decision (because the cause loss/gain in time/money could
 make or break his goals/carreer/raise), those considerations are very
 important. Think of it simply as prudent marketing. The quality of
 Lift's code and community *is* amazing. Let's just make it as easy as
 possible for people to recognize that.
 On a related note please don't forget one of the factors why Ruby on
 Rails had an immense success as a framework: DHH is a very loud voice
 talking about a framework and as a result this attracted a lot of
 attention to it. IIRC the interesting side effect was that because of
 the excellent 'marketing' and the attracted attention, the framework
 actually attracted additional developer horsepower and matured a lot
 faster.

 And about the 'playground for Scala devs  high required initial
 investment because of Scala', maybe it wouldn't hurt to defuse that a
 bit as well. I really like the statement of Martin Odersky: In the
 end it's just another jar on your classpath (ok, it's a bit more than
 that, but...). Or maybe some excerpts from the mailing list/other
 adopters about experiences while switching to Lift with no prior Scala
 experience. True, that's basically something that applies to Scala in
 the large and not just Lift, but I think that Lift is for Scala what
 Rails is for Ruby: the flagship product and main attraction magnet.
 Because Lift (and also Rails) is a framework used to solve problems
 that a lot of people encounter in daily life (webapps). I personally
 love what I can do with Scala for other problem domains, but those
 domains are less close to what most developers work on on a daily
 basis.

 Oh, and I think that for the most part the marketing organized in
 terms of conferences, papers, and books is pretty thorough. Would be
 nice to see that in a news section to see what is going on with lift.

 Just some thoughts.


Daniel,

Thanks for your translation and your thoughts.  My German is pretty weak (my
grandparents used to speak German when they didn't want to to understand
what they were saying, so my ability to understand spoken 

[Lift] Re: Feedback on screen cast, please

2009-04-24 Thread marius d.

Very very nice ... and that is something that would probably keep
audience with the mouth open for a few minutes. However it's just like
showing  the dog a bone :) ... people would inherently wonder so maybe
a bit of more explanations on the wiring between the global chat
actor and the Comet actor would be helpful. I know it's trivial stuff
but still I think it worth it.

On a slightly different topic ... ListenerManager model ... I wonder
if we can do it simpler then call updateMessages and then have lift
call the createUpdate. For really simple case perhaps a publishMessage
(a_message) would be easier and would avoid keeping the private state
in the actor.I know it's pretty much classical pattern in the way it
is right now ... but maybe ... just maybe we can simplify it a bit
more.

Br's,
Marius

On Apr 24, 6:50 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Folks,

 I did a draft of a screencast for a real-time chat app.  It's 
 athttp://tunaforcats.com/LiftScreenCast.avi

 I'd like to get some critical feedback on it so I can improve it.

 Thanks,

 David

 PS -- What's the best output format?  AVI, QuickTime, Flash?

 --
 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] Feedback on screen cast, please

2009-04-24 Thread David Pollak
Folks,

I did a draft of a screencast for a real-time chat app.  It's at
http://tunaforcats.com/LiftScreenCast.avi

I'd like to get some critical feedback on it so I can improve it.

Thanks,

David

PS -- What's the best output format?  AVI, QuickTime, Flash?

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

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



[Lift] Re: Feedback on screen cast, please

2009-04-24 Thread bradford

I prefer QuickTime.

Thanks,
Bradford

On Apr 24, 12:21 pm, marius d. marius.dan...@gmail.com wrote:
 Very very nice ... and that is something that would probably keep
 audience with the mouth open for a few minutes. However it's just like
 showing  the dog a bone :) ... people would inherently wonder so maybe
 a bit of more explanations on the wiring between the global chat
 actor and the Comet actor would be helpful. I know it's trivial stuff
 but still I think it worth it.

 On a slightly different topic ... ListenerManager model ... I wonder
 if we can do it simpler then call updateMessages and then have lift
 call the createUpdate. For really simple case perhaps a publishMessage
 (a_message) would be easier and would avoid keeping the private state
 in the actor.I know it's pretty much classical pattern in the way it
 is right now ... but maybe ... just maybe we can simplify it a bit
 more.

 Br's,
 Marius

 On Apr 24, 6:50 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:

  Folks,

  I did a draft of a screencast for a real-time chat app.  It's 
  athttp://tunaforcats.com/LiftScreenCast.avi

  I'd like to get some critical feedback on it so I can improve it.

  Thanks,

  David

  PS -- What's the best output format?  AVI, QuickTime, Flash?

  --
  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: Feedback on screen cast, please

2009-04-24 Thread TylerWeir

The fact it's real-time is excellent.

It's the right amount of info/code to whet someone's appetite to dive
into Lift a bit more.  And since the amount of code is small, someone
would be able to follow along easily.

The areas of improvement would be upping to production levels a bit.
The PeepCode screencasts are what come to mind as a standard to aspire
to.

Nice stuff.  I've been knocking the idea around with Derek and Marius
for screencasts.  I think it's a logical extension of the book.

Ty

(I've never used Vista, so that's what it looks like :)


On Apr 24, 1:53 pm, bradford fingerm...@gmail.com wrote:
 I prefer QuickTime.

 Thanks,
 Bradford

 On Apr 24, 12:21 pm, marius d. marius.dan...@gmail.com wrote:

  Very very nice ... and that is something that would probably keep
  audience with the mouth open for a few minutes. However it's just like
  showing  the dog a bone :) ... people would inherently wonder so maybe
  a bit of more explanations on the wiring between the global chat
  actor and the Comet actor would be helpful. I know it's trivial stuff
  but still I think it worth it.

  On a slightly different topic ... ListenerManager model ... I wonder
  if we can do it simpler then call updateMessages and then have lift
  call the createUpdate. For really simple case perhaps a publishMessage
  (a_message) would be easier and would avoid keeping the private state
  in the actor.I know it's pretty much classical pattern in the way it
  is right now ... but maybe ... just maybe we can simplify it a bit
  more.

  Br's,
  Marius

  On Apr 24, 6:50 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:

   Folks,

   I did a draft of a screencast for a real-time chat app.  It's 
   athttp://tunaforcats.com/LiftScreenCast.avi

   I'd like to get some critical feedback on it so I can improve it.

   Thanks,

   David

   PS -- What's the best output format?  AVI, QuickTime, Flash?

   --
   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: Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread Timothy Perrett

Martin,

You need to write a DispatchPF and put that in your boot.scala file.

e.g

LiftRules.dispatch.append {
  case Req(my :: path :: Nil, pdf, GetRequest) =  // do
steaming response stuff here
}

Does that help?

Cheers, Tim

On Apr 24, 12:22 pm, maku martin.kuhn...@gmail.com wrote:
 Hi Tim,

 thanks for responding.

 I think I don't know enough.

 O.k. I've to use StreamingResponse. What I would like to know is how
 can I set the StreamingResponse instance as response served by lift
 when my snippet handles the request triggered from the submit button.

 In the pure servlet tech I would write to HttpServletResponse -- ...
 response.getOutputStream().write(bytes);

 TIA
 Regards, Martin

 On Apr 24, 11:29 am, Timothy Perrett timo...@getintheloop.eu wrote:



  Your confussing things I think. InMemoryResponse is a HTTP response
  designed for use in conjunction with DispatchPF.

  If your getting the PDF dynamically then you'll need to read the PDF
  either into memory and return it from a url or do a streaming response
  - checkout my blog post here about using StreamingResponse:http://is.gd/oCtt

  So, lets assume that you made a dispatchPF so that your pdf was
  dynamically served from:

  /download/pdf/someId

  Then from your snippet you can either just manually link to that URL
  if you so wish.

  Does that help?

  Cheers, Tim

  On Apr 24, 8:50 am, maku martin.kuhn...@gmail.com wrote:

   Hi,

   I would like to get a PDF document (produced via IText) from my app.
   It should be triggered via a submit button
   The PDF document should be presented in a separate browser window.

   In the lift book there is an example how to do this via a link and
   with mapping a request via LiftRules.dispatch.append to an
   InMemoryResponse (which works as expected).

   When I want to trigger this process via a submit button I can imagine
   to call a function in the form binding  of the submit button (in the
   snippet) . The function would be able to redirectTo the request
   mapping which returns an InMemoryResponse.

   To present the PDF in an new window / tab, I would define the submit
   button with submit(PDF,  pdf,(onClick,document.forms
   [0].target='_blank';)

   My questions:

   - Is this a proper solution?
   - Would it be possible to return the InMemoryRespone directly from the
   snippet (without the need to define a special request behaviour and
   to perform the redirectTo)

   Could anybody give me a hint?

   TIA
   Regards,
   Martin
--~--~-~--~~~---~--~~
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 screen cast, please

2009-04-24 Thread Derek Chen-Becker
Very nice. I don't think it matters whether it's AVI or Flash, but it would
definitely help to pick a good codec for screencasts so that it's not a
200MB file. You might even want to look at Wink:

http://www.debugmode.com/wink/

It does isolated screenshots, but in many cases that's clearer than a lossy
video codec.

Derek

On Fri, Apr 24, 2009 at 9:50 AM, David Pollak feeder.of.the.be...@gmail.com
 wrote:

 Folks,

 I did a draft of a screencast for a real-time chat app.  It's at
 http://tunaforcats.com/LiftScreenCast.avi

 I'd like to get some critical feedback on it so I can improve it.

 Thanks,

 David

 PS -- What's the best output format?  AVI, QuickTime, Flash?

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

 


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



[Lift] Re: Feedback on screen cast, please

2009-04-24 Thread marius d.

Oh and trait names were not very visible after code completion due to
net bean's coloring ... :(

Br's,
Marius

On Apr 24, 7:21 pm, marius d. marius.dan...@gmail.com wrote:
 Very very nice ... and that is something that would probably keep
 audience with the mouth open for a few minutes. However it's just like
 showing  the dog a bone :) ... people would inherently wonder so maybe
 a bit of more explanations on the wiring between the global chat
 actor and the Comet actor would be helpful. I know it's trivial stuff
 but still I think it worth it.

 On a slightly different topic ... ListenerManager model ... I wonder
 if we can do it simpler then call updateMessages and then have lift
 call the createUpdate. For really simple case perhaps a publishMessage
 (a_message) would be easier and would avoid keeping the private state
 in the actor.I know it's pretty much classical pattern in the way it
 is right now ... but maybe ... just maybe we can simplify it a bit
 more.

 Br's,
 Marius

 On Apr 24, 6:50 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:

  Folks,

  I did a draft of a screencast for a real-time chat app.  It's 
  athttp://tunaforcats.com/LiftScreenCast.avi

  I'd like to get some critical feedback on it so I can improve it.

  Thanks,

  David

  PS -- What's the best output format?  AVI, QuickTime, Flash?

  --
  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: Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread Derek Chen-Becker
A snippet, by definition, returns a scala.xml.NodeSeq, so there's not a
direct way to do it. I haven't tested the code, but you may be able to get
away with using the ResponseShortcutException object to force a particular
response like so:

def mySnippet (...) ... {
  def doSubmit () {
...
val myResponse = InMemoryResponse(...)
throw ResponseShortcutException.shortcutResponse(myResponse)
  }
  ...
}

Lift will catch the exception and (I think) use whatever LiftResponse has
been set to send back to the user. I'm not confident at all that this will
work, but it might :)

Derek

On Fri, Apr 24, 2009 at 1:07 PM, maku martin.kuhn...@gmail.com wrote:


 Tim,

 this doesn't help.

 It is  exactly the solution I use until now (and which I tried to
 explain in my first post). When I do it in this way how can I call it
 via a submit button. Please remember: I want to activate the pdf
 showing function via a submit button.

 The solution I use until now is:

 1) Defining a special request handling like you mentioned in your
 last post (LiftRules.dispatch.append)
 2) Performing a post request after pressing a submit button which call
 a method in my snippet.
 3) In my snippet I call a function which performs a REDIRECT to
 exactly the path defined in LiftRules.dispatch.apppend
 4) Returning the PDF

 What I would want to know is:
 Is it possible to do it simpler? Like in a pure servlet solution (or
 like I do it in JSF): I write the bytes directly to my
 HttpServletResponse.
 And my main question is: how can I do this from the snippet.

 Regards,
 Martin


 On 24 Apr., 20:20, Timothy Perrett timo...@getintheloop.eu wrote:
  Martin,
 
  You need to write a DispatchPF and put that in your boot.scala file.
 
  e.g
 
  LiftRules.dispatch.append {
case Req(my :: path :: Nil, pdf, GetRequest) =  // do
  steaming response stuff here
 
  }
 
  Does that help?
 
  Cheers, Tim
 
  On Apr 24, 12:22 pm, maku martin.kuhn...@gmail.com wrote:
 
   Hi Tim,
 
   thanks for responding.
 
   I think I don't know enough.
 
   O.k. I've to use StreamingResponse. What I would like to know is how
   can I set the StreamingResponse instance as response served by lift
   when my snippet handles the request triggered from the submit button.
 
   In the pure servlet tech I would write to HttpServletResponse -- ...
   response.getOutputStream().write(bytes);
 
   TIA
   Regards, Martin
 
   On Apr 24, 11:29 am, Timothy Perrett timo...@getintheloop.eu wrote:
 
Your confussing things I think. InMemoryResponse is a HTTP response
designed for use in conjunction with DispatchPF.
 
If your getting the PDF dynamically then you'll need to read the PDF
either into memory and return it from a url or do a streaming
 response
- checkout my blog post here about using StreamingResponse:
 http://is.gd/oCtt
 
So, lets assume that you made a dispatchPF so that your pdf was
dynamically served from:
 
/download/pdf/someId
 
Then from your snippet you can either just manually link to that URL
if you so wish.
 
Does that help?
 
Cheers, Tim
 
On Apr 24, 8:50 am, maku martin.kuhn...@gmail.com wrote:
 
 Hi,
 
 I would like to get a PDF document (produced via IText) from my
 app.
 It should be triggered via a submit button
 The PDF document should be presented in a separate browser window.
 
 In the lift book there is an example how to do this via a link and
 with mapping a request via LiftRules.dispatch.append to an
 InMemoryResponse (which works as expected).
 
 When I want to trigger this process via a submit button I can
 imagine
 to call a function in the form binding  of the submit button (in
 the
 snippet) . The function would be able to redirectTo the request
 mapping which returns an InMemoryResponse.
 
 To present the PDF in an new window / tab, I would define the
 submit
 button with submit(PDF,  pdf,(onClick,document.forms
 [0].target='_blank';)
 
 My questions:
 
 - Is this a proper solution?
 - Would it be possible to return the InMemoryRespone directly from
 the
 snippet (without the need to define a special request behaviour
 and
 to perform the redirectTo)
 
 Could anybody give me a hint?
 
 TIA
 Regards,
 Martin

 


--~--~-~--~~~---~--~~
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: Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread Timothy Perrett

Martin,

You now have all the information to complete this solution - I will
continue to provide help, however the best way forward is for you to
do some research in the list archive and try writing some code :-)

If you post some code that doesn't work I'll tell you how to fix it or
improve it, but I won't write it for you unfortunatly.

Cheers

Tim

On Apr 24, 8:07 pm, maku martin.kuhn...@gmail.com wrote:
 Tim,

 this doesn't help.

 It is  exactly the solution I use until now (and which I tried to
 explain in my first post). When I do it in this way how can I call it
 via a submit button. Please remember: I want to activate the pdf
 showing function via a submit button.

 The solution I use until now is:

 1) Defining a special request handling like you mentioned in your
 last post (LiftRules.dispatch.append)
 2) Performing a post request after pressing a submit button which call
 a method in my snippet.
 3) In my snippet I call a function which performs a REDIRECT to
 exactly the path defined in LiftRules.dispatch.apppend
 4) Returning the PDF

 What I would want to know is:
 Is it possible to do it simpler? Like in a pure servlet solution (or
 like I do it in JSF): I write the bytes directly to my
 HttpServletResponse.
 And my main question is: how can I do this from the snippet.

 Regards,
 Martin

 On 24 Apr., 20:20, Timothy Perrett timo...@getintheloop.eu wrote:

  Martin,

  You need to write a DispatchPF and put that in your boot.scala file.

  e.g

  LiftRules.dispatch.append {
    case Req(my :: path :: Nil, pdf, GetRequest) =  // do
  steaming response stuff here

  }

  Does that help?

  Cheers, Tim

  On Apr 24, 12:22 pm, maku martin.kuhn...@gmail.com wrote:

   Hi Tim,

   thanks for responding.

   I think I don't know enough.

   O.k. I've to use StreamingResponse. What I would like to know is how
   can I set the StreamingResponse instance as response served by lift
   when my snippet handles the request triggered from the submit button.

   In the pure servlet tech I would write to HttpServletResponse -- ...
   response.getOutputStream().write(bytes);

   TIA
   Regards, Martin

   On Apr 24, 11:29 am, Timothy Perrett timo...@getintheloop.eu wrote:

Your confussing things I think. InMemoryResponse is a HTTP response
designed for use in conjunction with DispatchPF.

If your getting the PDF dynamically then you'll need to read the PDF
either into memory and return it from a url or do a streaming response
- checkout my blog post here about using 
StreamingResponse:http://is.gd/oCtt

So, lets assume that you made a dispatchPF so that your pdf was
dynamically served from:

/download/pdf/someId

Then from your snippet you can either just manually link to that URL
if you so wish.

Does that help?

Cheers, Tim

On Apr 24, 8:50 am, maku martin.kuhn...@gmail.com wrote:

 Hi,

 I would like to get a PDF document (produced via IText) from my app.
 It should be triggered via a submit button
 The PDF document should be presented in a separate browser window.

 In the lift book there is an example how to do this via a link and
 with mapping a request via LiftRules.dispatch.append to an
 InMemoryResponse (which works as expected).

 When I want to trigger this process via a submit button I can imagine
 to call a function in the form binding  of the submit button (in the
 snippet) . The function would be able to redirectTo the request
 mapping which returns an InMemoryResponse.

 To present the PDF in an new window / tab, I would define the submit
 button with submit(PDF,  pdf,(onClick,document.forms
 [0].target='_blank';)

 My questions:

 - Is this a proper solution?
 - Would it be possible to return the InMemoryRespone directly from the
 snippet (without the need to define a special request behaviour and
 to perform the redirectTo)

 Could anybody give me a hint?

 TIA
 Regards,
 Martin
--~--~-~--~~~---~--~~
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: Question from a newbie: how to get a pdf document via submit button

2009-04-24 Thread Timothy Perrett

Derek,

Thats an interesting idea, but as you say, its not exactly best
practice as snippets are for returning NodeSeq.

@martin: You need to implementing a dispatchPF in your Boot.scala file
(google around in the mailing list, this has been discussed a lot),
then in your snippet just do a S.redirectTo inside your button submit
handler and redirect to the appropriate download url.

Cheers, Tim

On Apr 24, 8:59 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 A snippet, by definition, returns a scala.xml.NodeSeq, so there's not a
 direct way to do it. I haven't tested the code, but you may be able to get
 away with using the ResponseShortcutException object to force a particular
 response like so:

 def mySnippet (...) ... {
   def doSubmit () {
     ...
     val myResponse = InMemoryResponse(...)
     throw ResponseShortcutException.shortcutResponse(myResponse)
   }
   ...

 }

 Lift will catch the exception and (I think) use whatever LiftResponse has
 been set to send back to the user. I'm not confident at all that this will
 work, but it might :)

 Derek



 On Fri, Apr 24, 2009 at 1:07 PM, maku martin.kuhn...@gmail.com wrote:

  Tim,

  this doesn't help.

  It is  exactly the solution I use until now (and which I tried to
  explain in my first post). When I do it in this way how can I call it
  via a submit button. Please remember: I want to activate the pdf
  showing function via a submit button.

  The solution I use until now is:

  1) Defining a special request handling like you mentioned in your
  last post (LiftRules.dispatch.append)
  2) Performing a post request after pressing a submit button which call
  a method in my snippet.
  3) In my snippet I call a function which performs a REDIRECT to
  exactly the path defined in LiftRules.dispatch.apppend
  4) Returning the PDF

  What I would want to know is:
  Is it possible to do it simpler? Like in a pure servlet solution (or
  like I do it in JSF): I write the bytes directly to my
  HttpServletResponse.
  And my main question is: how can I do this from the snippet.

  Regards,
  Martin

  On 24 Apr., 20:20, Timothy Perrett timo...@getintheloop.eu wrote:
   Martin,

   You need to write a DispatchPF and put that in your boot.scala file.

   e.g

   LiftRules.dispatch.append {
     case Req(my :: path :: Nil, pdf, GetRequest) =  // do
   steaming response stuff here

   }

   Does that help?

   Cheers, Tim

   On Apr 24, 12:22 pm, maku martin.kuhn...@gmail.com wrote:

Hi Tim,

thanks for responding.

I think I don't know enough.

O.k. I've to use StreamingResponse. What I would like to know is how
can I set the StreamingResponse instance as response served by lift
when my snippet handles the request triggered from the submit button.

In the pure servlet tech I would write to HttpServletResponse -- ...
response.getOutputStream().write(bytes);

TIA
Regards, Martin

On Apr 24, 11:29 am, Timothy Perrett timo...@getintheloop.eu wrote:

 Your confussing things I think. InMemoryResponse is a HTTP response
 designed for use in conjunction with DispatchPF.

 If your getting the PDF dynamically then you'll need to read the PDF
 either into memory and return it from a url or do a streaming
  response
 - checkout my blog post here about using StreamingResponse:
 http://is.gd/oCtt

 So, lets assume that you made a dispatchPF so that your pdf was
 dynamically served from:

 /download/pdf/someId

 Then from your snippet you can either just manually link to that URL
 if you so wish.

 Does that help?

 Cheers, Tim

 On Apr 24, 8:50 am, maku martin.kuhn...@gmail.com wrote:

  Hi,

  I would like to get a PDF document (produced via IText) from my
  app.
  It should be triggered via a submit button
  The PDF document should be presented in a separate browser window.

  In the lift book there is an example how to do this via a link and
  with mapping a request via LiftRules.dispatch.append to an
  InMemoryResponse (which works as expected).

  When I want to trigger this process via a submit button I can
  imagine
  to call a function in the form binding  of the submit button (in
  the
  snippet) . The function would be able to redirectTo the request
  mapping which returns an InMemoryResponse.

  To present the PDF in an new window / tab, I would define the
  submit
  button with submit(PDF,  pdf,(onClick,document.forms
  [0].target='_blank';)

  My questions:

  - Is this a proper solution?
  - Would it be possible to return the InMemoryRespone directly from
  the
  snippet (without the need to define a special request behaviour
  and
  to perform the redirectTo)

  Could anybody give me a hint?

  TIA
  Regards,
  Martin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to 

[Lift] Re: Feedback on screen cast, please

2009-04-24 Thread Timothy Perrett

Or better still, just make a channel on Blip... then we could have a
whole series of Lift related screen casts in a single channel done
by various committers.

http://blip.tv/

Thoughts?

Cheers, Tim

On Apr 24, 8:48 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Very nice. I don't think it matters whether it's AVI or Flash, but it would
 definitely help to pick a good codec for screencasts so that it's not a
 200MB file. You might even want to look at Wink:

 http://www.debugmode.com/wink/

 It does isolated screenshots, but in many cases that's clearer than a lossy
 video codec.

 Derek

 On Fri, Apr 24, 2009 at 9:50 AM, David Pollak feeder.of.the.be...@gmail.com



  wrote:
  Folks,

  I did a draft of a screencast for a real-time chat app.  It's at
 http://tunaforcats.com/LiftScreenCast.avi

  I'd like to get some critical feedback on it so I can improve it.

  Thanks,

  David

  PS -- What's the best output format?  AVI, QuickTime, Flash?

  --
  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] timestamp versioning for including a javascript file

2009-04-24 Thread Lee Mighdoll
I'm trying to avoid having to clear the browser cache when I change a
javascript file.

One approach is to append a timestamp to the script src tag in the html
file.

  script id=json src=/classpath/json.js type=text/javascript/

becomes:

  script id=json src=/classpath/json.js?*12341234*
type=text/javascript/

Is there already a handy way to do this in lift (I'm told rails uses this
approach)?  Or is there a better way?  And if not, would this make a good
snippet?

Lee

--~--~-~--~~~---~--~~
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 screen cast, please

2009-04-24 Thread Patrick Down


When I viewed that on my Mac the audio was out of sync with what was
happening on the screen.  It might be some codec issue on my machine
since it was an AVI.

On Apr 24, 11:50 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Folks,

 I did a draft of a screencast for a real-time chat app.  It's 
 athttp://tunaforcats.com/LiftScreenCast.avi

 I'd like to get some critical feedback on it so I can improve it.

 Thanks,

 David

 PS -- What's the best output format?  AVI, QuickTime, Flash?

 --
 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: Binding Radio Button

2009-04-24 Thread sailormoo...@gmail.com

I didn't get a compilation error, but the function in the checkbox
(Boolean) = Any doesn't seem to be called

bind(c,xhtml,
  checkbox - SHtml.checkbox(booleanThing, booleanThing = _) %
(class - myCSSclass)
)

As the example, booleanThing is always false no matter if I clicked
the checkbox or not.
I don't know why though.

--~--~-~--~~~---~--~~
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: Comet - Unique to each page

2009-04-24 Thread David Pollak
On Thu, Apr 23, 2009 at 8:28 PM, bradford fingerm...@gmail.com wrote:


 Thanks again for your help.  If I call this ! ShutDown in my
 CometActor, it will redirect me back to the home page once ShutDown is
 received.

 Did you want me to open up a ticket for this?


This is correct behavior, no need for a ticket.




 Thanks,
 Bradford

 On Apr 23, 10:06 am, bradford fingerm...@gmail.com wrote:
  Thanks, David.  What haven't you thought about?!
 
  On Apr 23, 9:57 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:
 
   On Thu, Apr 23, 2009 at 6:45 AM, bradford fingerm...@gmail.com
 wrote:
 
Thanks, David.  I will play around with this when I get home.  I'll
open up a ticket at the same time as well, when I have sufficient
 time
to review the problem.  I'm looking to have the comet actor
automatically shutdown after it's pushed the 10th item to the server,
which looks like would be possible to do with a shutdown function.
 
   You can manually shut down your comet actor today.  Just do a actor !
   Shutdown and it will release its resources and unregister from the
 session.
 
Something I stumbled upon in my search:
   http://cometdproject.dojotoolkit.org/documentation/FAQs/multipleTabs
 
   Lift detects this too and will ping-pong the long polling from
 multiple
   windows... more HTTP requests, but lots of responsiveness.
 
   Chrome and FF 3.1+ do not have this 2 connection limit.  Lift will (at
 some
   point before 1.1 is released) do proper browser detection and not
 enforce
   the 2 connection limit for these browsers (because they don't have the
   limit).
 
   Further, you can set Lift up to do the Comet polling on a randomly
 named
   host such that each window/tab gets its own host (with DNS wildcarding)
 to
   poll on and in that situation, you also work around the 2 connection
 limit.
 
Thanks
 
On Apr 23, 9:12 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Wed, Apr 22, 2009 at 6:53 PM, bradford fingerm...@gmail.com
 wrote:
 
  I noticed in the chat demo that if you enter your name or chat
 into
  one tab, the same results will propagate to the other tab.  I
 need a
  short lived comet session that's unique to each tab -- I want to
  prevent one tab from mixing its data with another tab.  I
 understand
  that most user browser only allow for 2 HTTP connections at a
 time,
  but as I said, I have about 10 consecutive pushes to the server
 that
  I'll be making and then I want the comet connection to
 immediately
  terminate.
 
  Is this possible to do with the existing lift CometActor?  If so,
 any
  suggestions on where to begin?
 
 Each CometActor has a name.  You can have multiple CometActors with
 different names that represent different components.  In the Lift
 chat
 example on the Chat page, there are two separate components.  The
 second
one
 is identified with:
 
  lift:comet type=Chat *name=Other*Chat Text/lift:comet
 
 Please note the name attribute.
 
 For each page that you render, you can write a snippet or something
 that
 does:  def myNextCometGuy = lift:comet type=Chat
name={randomString(20)}
 /
 
 The big issue will be closing the comet actors down.  I've been
 planning
to
 put an optional timeout in CometActors (basically allow them to
 shut down
if
 they haven't had a listener attach to them in N minutes.)If you
 need
 this feature, please open a defect athttp://
github.com/dpp/liftweb/issues
 
 Thanks,
 
 David
 
  Thanks,
  Bradford
 
 --
 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 framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

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



[Lift] Re: Comet - Unique to each page

2009-04-24 Thread David Pollak
On Thu, Apr 23, 2009 at 8:28 PM, bradford fingerm...@gmail.com wrote:


 Thanks again for your help.  If I call this ! ShutDown in my
 CometActor, it will redirect me back to the home page once ShutDown is
 received.

 Did you want me to open up a ticket for this?


I just added code for:

class MyCometActor extends CometActor {
...
override def lifespan = Full(5 minutes)
}

If the CometActor does not appear on a page for 5 minutes, it will be shut
down.  THis should help you.




 Thanks,
 Bradford

 On Apr 23, 10:06 am, bradford fingerm...@gmail.com wrote:
  Thanks, David.  What haven't you thought about?!
 
  On Apr 23, 9:57 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:
 
   On Thu, Apr 23, 2009 at 6:45 AM, bradford fingerm...@gmail.com
 wrote:
 
Thanks, David.  I will play around with this when I get home.  I'll
open up a ticket at the same time as well, when I have sufficient
 time
to review the problem.  I'm looking to have the comet actor
automatically shutdown after it's pushed the 10th item to the server,
which looks like would be possible to do with a shutdown function.
 
   You can manually shut down your comet actor today.  Just do a actor !
   Shutdown and it will release its resources and unregister from the
 session.
 
Something I stumbled upon in my search:
   http://cometdproject.dojotoolkit.org/documentation/FAQs/multipleTabs
 
   Lift detects this too and will ping-pong the long polling from
 multiple
   windows... more HTTP requests, but lots of responsiveness.
 
   Chrome and FF 3.1+ do not have this 2 connection limit.  Lift will (at
 some
   point before 1.1 is released) do proper browser detection and not
 enforce
   the 2 connection limit for these browsers (because they don't have the
   limit).
 
   Further, you can set Lift up to do the Comet polling on a randomly
 named
   host such that each window/tab gets its own host (with DNS wildcarding)
 to
   poll on and in that situation, you also work around the 2 connection
 limit.
 
Thanks
 
On Apr 23, 9:12 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Wed, Apr 22, 2009 at 6:53 PM, bradford fingerm...@gmail.com
 wrote:
 
  I noticed in the chat demo that if you enter your name or chat
 into
  one tab, the same results will propagate to the other tab.  I
 need a
  short lived comet session that's unique to each tab -- I want to
  prevent one tab from mixing its data with another tab.  I
 understand
  that most user browser only allow for 2 HTTP connections at a
 time,
  but as I said, I have about 10 consecutive pushes to the server
 that
  I'll be making and then I want the comet connection to
 immediately
  terminate.
 
  Is this possible to do with the existing lift CometActor?  If so,
 any
  suggestions on where to begin?
 
 Each CometActor has a name.  You can have multiple CometActors with
 different names that represent different components.  In the Lift
 chat
 example on the Chat page, there are two separate components.  The
 second
one
 is identified with:
 
  lift:comet type=Chat *name=Other*Chat Text/lift:comet
 
 Please note the name attribute.
 
 For each page that you render, you can write a snippet or something
 that
 does:  def myNextCometGuy = lift:comet type=Chat
name={randomString(20)}
 /
 
 The big issue will be closing the comet actors down.  I've been
 planning
to
 put an optional timeout in CometActors (basically allow them to
 shut down
if
 they haven't had a listener attach to them in N minutes.)If you
 need
 this feature, please open a defect athttp://
github.com/dpp/liftweb/issues
 
 Thanks,
 
 David
 
  Thanks,
  Bradford
 
 --
 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 framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

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



[Lift] Re: Feedback on screen cast, please

2009-04-24 Thread Steve Lianoglou

On Apr 24, 3:23 pm, Patrick Down patrick.d...@gmail.com wrote:
 When I viewed that on my Mac the audio was out of sync with what was
 happening on the screen.  It might be some codec issue on my machine
 since it was an AVI.

This initially happened to me, too. But I got a phone call in the
middle of watching the movie, so I paused it for a while.

By the time I got back to the video, it was already completely loaded
(instead of playing while loading). I hopped back like 30 seconds and
hit play and the video + audio were back in sync.

Perhaps that will work for you.

-steve
--~--~-~--~~~---~--~~
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 screen cast, please

2009-04-24 Thread Warren Henning

On Fri, Apr 24, 2009 at 8:50 AM, David Pollak
feeder.of.the.be...@gmail.com wrote:
 I'd like to get some critical feedback on it so I can improve it.

I'm short on criticism - this was really cool.

You might want to comment on how much compile time there is when
you're rapidly updating a Lift application so people don't think you
spend half your development time waiting for the computer or
something.

I'd like to note that for some reason when I opened the machine on my
default media viewer, the video didn't work right although audio was
fine - VLC 0.8.6e, Windows XP SP2. Opening in QuickTime worked fine
though.

Warren

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