[Lift] Re: has anyone seen this exception?

2009-08-27 Thread Ross Mellgren
That error sounds like it's probably that the remote server is  
disconnecting prematurely, or is not handling Transfer-Encoding:  
Chunked as HttpURLConnection expects.

Have you tried getting whatever URL it's trying with wget or curl?

-Ross

On Aug 27, 2009, at 7:28 PM, Jack Widman wrote:

> Here is the code I am using. The exception is happening at line 12,  
> the line that goes
>   line = br.readLine()
>  The exception is happening alot. Any ideas?
>
> package com.authoritude.snippet
>
> import java.io.{InputStreamReader, BufferedInputStream,  
> BufferedReader, OutputStreamWriter, InputStream}
>
> object StreamUtil {
>   def streamToString(stream: InputStream): String = {
> val buf = new StringBuilder
> val br = new BufferedReader(new InputStreamReader(stream))
> var line: String = null
> var eof = false
> while (! eof) {
>   line = br.readLine()
>   if (line == null) eof = true else
>   buf.append(line).append("\n")
> }
> buf.toString
>   }
> }
>
>
> On Thu, Aug 27, 2009 at 5:49 PM, David Pollak  > wrote:
> This happens sometimes when the client disconnects before the  
> communications with the server is complete.  I see them from time to  
> time and they indicate to me that the Internet is a random place.
>
>
> On Thu, Aug 27, 2009 at 12:06 PM, jack  wrote:
>
> Has anyone seen this error? I get it while transforming a Stream into
> a String. The stream is from an http request I just made.
>
> Message: java.io.IOException: Premature EOF
>sun.net.www.http.ChunkedInputStream.readAheadBlocking
> (ChunkedInputStream.java:556)
> 
> sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:
> 600)
> 
> sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)
>java.io.FilterInputStream.read(FilterInputStream.java:133)
>sun.net.www.protocol.http.HttpURLConnection 
> $HttpInputStream.read
> (HttpURLConnection.java:2419)
>sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
>sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
>sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
>java.io.InputStreamReader.read(InputStreamReader.java:184)
>java.io.BufferedReader.fill(BufferedReader.java:153)
>java.io.BufferedReader.readLine(BufferedReader.java:316)
>java.io.BufferedReader.readLine(BufferedReader.java:379)
>com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12)
>
>
>
>
>
> -- 
> 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: Scope issues with CometActors

2009-08-27 Thread Spencer Uresk
That did the trick, and I understand what is going on much better now. Thank
you!

For some reason my brain is having trouble adjusting to the idea that you
can generate more sophisticated markup in Scala code. I'm still used to the
world of JSF and the like where all the markup is in a separate (non-code)
file and you use EL expressions to accomplish something similar, so this has
been a good example for me.

Thanks again,

- Spencer

On Thu, Aug 27, 2009 at 8:38 PM, David Pollak  wrote:

> 
> The optional name attribute allows you to have different comet actor names
> (e.g., one per person).  You can retrieve the CometActor's name via the name
> method, which returns a Box[String].
>
> In your CometActor, make sure to:
>
> override def lifespan = Full(5 minutes)
>
> This will make the particular CometActor go away if it does not appear on a
> page for a 5 minute span.
>
> This lets you have a different CometActor per person, but allows you to
> share a single CometActor instance for a given session for a given name
> across browser windows/tabs.
>
> I hope this helps and I'd suggest against using SessionVars for passing
> setup information to CometActors.
>
>
> On Thu, Aug 27, 2009 at 7:28 PM, Spencer Uresk  wrote:
>
>> Hey all,
>>
>> I'm trying to build an app that takes advantage of the Comet support in
>> Lift. This is a simple app that displays all messages from a given person
>> and shows new messages as they are added. At first, I struggled with trying
>> to pull the request parameter (the url looks like this - /person/1) into my
>> CometActor, and then I found a message on the lift board that talked about
>> the scope mismatch between the request scope and a CometActor, and
>> recommends setting a session variable that the CometActor then reads.
>>
>> The scope mismatch makes sense to me, so I tried the suggested way of
>> doing it, which worked. However, now when I go back to the home page and
>> select another person to view messages for, I still see the the old
>> messages. After some testing, it appears that CometActors on the same page
>> are not re-created if there is one already active. I can't seem to find any
>> method that gets called on it when the page is rendered either, and I am not
>> sure how to update the state of the CometActor so that it retrieves the
>> proper messages.
>>
>> Is there any documentation or examples for using CometActors in
>> conjunction with a request parameter like that? Or is there a better way
>> altogether for me to be doing this?
>>
>> Thank you,
>>
>> - Spencer
>>
>>
>>
>
>
> --
> 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: weirdness with stateful snippets and multiple forms on the page

2009-08-27 Thread David Pollak
Lift's multi-step wizard support is less than optimal.  I'm working with
some folks to improve the situation and it's part of the 1.1 roadmap.

On Thu, Aug 27, 2009 at 1:40 PM, harryh  wrote:

>
> Are stateful snippets considered a good way to do multi-step "wizard"
> like interfaces?  They seem like a good fit, but I'm running into 1
> annoying problem.  I'm seeting things up so in my .html file I have
> something like this:
>
> 
>  // HTML for step 1
> 
> 
>  // HTML for step 2
> 
>
> Then in the MyPage StatefulSnippet I return NodeSeq.Empty for 1 step,
> and actual contents for the other.
>
> The only issue is that for the "inactive" steps HTML like the
> following gets sent to the browser:
>
>  type="hidden" value="true" />


Yeah... that's a bug.  I'll have a fix committed up in a few.


>
>
> This isn't a huge deal really, but it's kind of annoying.  It almost
> seems like that  a  element with a form attribute shouldn't
> generate the  if the snippet function returns NodeSeq.Empty


That's defined behavior and it will be that way in just a minute.


>
>
> -harryh
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
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: has anyone seen this exception?

2009-08-27 Thread Jack Widman
Great. Thanks David. I'll try that.

On Fri, Aug 28, 2009 at 12:27 AM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

> I'd suggest that you use
> import net.liftweb.util.Helpers._
>
> def streamToString(stream: InputStream) = new
> String(readWholeStream(stream), "UTF-8")
>
> See if that makes things better.
>
>
> On Thu, Aug 27, 2009 at 4:28 PM, Jack Widman wrote:
>
>> Here is the code I am using. The exception is happening at line 12, the
>> line that goes  line =
>> br.readLine()
>>  The exception is happening alot. Any ideas?
>>
>> package com.authoritude.snippet
>>
>> import java.io.{InputStreamReader, BufferedInputStream, BufferedReader,
>> OutputStreamWriter, InputStream}
>>
>> object StreamUtil {
>>   def streamToString(stream: InputStream): String = {
>> val buf = new StringBuilder
>> val br = new BufferedReader(new InputStreamReader(stream))
>> var line: String = null
>> var eof = false
>> while (! eof) {
>>   line = br.readLine()
>>   if (line == null) eof = true else
>> buf.append(line).append("\n")
>> }
>> buf.toString
>>   }
>> }
>>
>>
>> On Thu, Aug 27, 2009 at 5:49 PM, David Pollak <
>> feeder.of.the.be...@gmail.com> wrote:
>>
>>> This happens sometimes when the client disconnects before the
>>> communications with the server is complete.  I see them from time to time
>>> and they indicate to me that the Internet is a random place.
>>>
>>> On Thu, Aug 27, 2009 at 12:06 PM, jack  wrote:
>>>

 Has anyone seen this error? I get it while transforming a Stream into
 a String. The stream is from an http request I just made.

 Message: java.io.IOException: Premature EOF
sun.net.www.http.ChunkedInputStream.readAheadBlocking
 (ChunkedInputStream.java:556)

  sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:
 600)

  sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)
java.io.FilterInputStream.read(FilterInputStream.java:133)
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
 (HttpURLConnection.java:2419)
sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
java.io.InputStreamReader.read(InputStreamReader.java:184)
java.io.BufferedReader.fill(BufferedReader.java:153)
java.io.BufferedReader.readLine(BufferedReader.java:316)
java.io.BufferedReader.readLine(BufferedReader.java:379)
com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12)



>>>
>>>
>>> --
>>> 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
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> 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: Ajax in ToDo application hanging

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 6:24 PM, Dorinel  wrote:

>
> Is there a way to update ToDo application to use 1.1-SNAPSHOT?


Edit your pom.xml file.

Change the Scala version to 2.7.5.  Change the net.liftweb dependencies to
1.1-SNAPSHOT and make sure the  tag contains:


  scala-tools.org.snapshots
  Scala-Tools Maven2 Repository for Snapshots
  http://scala-tools.org/repo-snapshots
  






>
>
> On Aug 28, 1:38 am, David Pollak 
> wrote:
> > On Thu, Aug 27, 2009 at 3:19 PM, Dorinel 
> wrote:
> >
> > > It's great!
> > > By the way, by default ToDo application runs on 1.1-SNAPSHOT?
> >
> > I think it uses 1.0 by default... but I prefer 1.1-SNAPSHOT because it's
> got
> > the most developer-friend features.
> >
> >
> >
> >
> >
> > > On Aug 27, 9:45 pm, David Pollak 
> > > wrote:
> > > > I've reproduced and fixed this issue.
> >
> > > > Thanks for reporting it.
> >
> > > > On Thu, Aug 27, 2009 at 9:13 AM, David Pollak <
> > > feeder.of.the.be...@gmail.com
> >
> > > > > wrote:
> > > > > I'm running tests from Firefox running locally, Chrome running
> locally
> > > and
> > > > > Safari running remotely to see if I can reproduce the issue (I'm
> > > running
> > > > > against Lift 1.1-SNAPSHOT)
> >
> > > > > On Thu, Aug 27, 2009 at 4:38 AM, Dorinel <
> dorinel.munte...@gmail.com
> > > >wrote:
> >
> > > > >> I was implementing application from
> > > > >>http://liftweb.net/docs/getting_started/mod_master.html
> > > > >> By the way,it's a great tutorial for lift much better than those
> which
> > > > >> were before and it explains a lot of things in comments clearly,
> thank
> > > > >> you for creating it.
> >
> > > > >> But when I left the todo application for about 2-3 hours, the ajax
> > > > >> which allows editing of the ToDo items stopped working. When I
> click
> > > > >> on checkbox it doesn't resort all items, the same it doesn't
> resort
> > > > >> (or redraw) when I'm changing priority from dropdown menu. Also
> when I
> > > > >> click desc to edit it - I can edit it but the result is not saved
> and
> > > > >> it doesn't exit edit mode when I'm editing another item.
> > > > >> When I do some actions, like checking a checkbox it seems that on
> > > > >> server side I have new rows like these:
> > > > >> INFO - Service request (POST) /ajax_request/F17795011372L0I/ took
> 1
> > > > >> Milliseconds
> >
> > > > >> Ajax starts working when I'm adding new todo item (because page
> > > > >> reloads) or I'm logging of and on.
> >
> > > > >> I've replicated this bug by leaving todo application running for
> night
> > > > >> and it was the same ajax not working when I wake up.
> >
> > > > >> Is this a known bug, or I have done something wrong when I typed
> ToDo
> > > > >> application from tutorial?
> >
> > > > > --
> > > > > 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, 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: has anyone seen this exception?

2009-08-27 Thread David Pollak
I'd suggest that you use
import net.liftweb.util.Helpers._

def streamToString(stream: InputStream) = new
String(readWholeStream(stream), "UTF-8")

See if that makes things better.

On Thu, Aug 27, 2009 at 4:28 PM, Jack Widman  wrote:

> Here is the code I am using. The exception is happening at line 12, the
> line that goes  line =
> br.readLine()
>  The exception is happening alot. Any ideas?
>
> package com.authoritude.snippet
>
> import java.io.{InputStreamReader, BufferedInputStream, BufferedReader,
> OutputStreamWriter, InputStream}
>
> object StreamUtil {
>   def streamToString(stream: InputStream): String = {
> val buf = new StringBuilder
> val br = new BufferedReader(new InputStreamReader(stream))
> var line: String = null
> var eof = false
> while (! eof) {
>   line = br.readLine()
>   if (line == null) eof = true else
> buf.append(line).append("\n")
> }
> buf.toString
>   }
> }
>
>
> On Thu, Aug 27, 2009 at 5:49 PM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>> This happens sometimes when the client disconnects before the
>> communications with the server is complete.  I see them from time to time
>> and they indicate to me that the Internet is a random place.
>>
>> On Thu, Aug 27, 2009 at 12:06 PM, jack  wrote:
>>
>>>
>>> Has anyone seen this error? I get it while transforming a Stream into
>>> a String. The stream is from an http request I just made.
>>>
>>> Message: java.io.IOException: Premature EOF
>>>sun.net.www.http.ChunkedInputStream.readAheadBlocking
>>> (ChunkedInputStream.java:556)
>>>
>>>  sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:
>>> 600)
>>>
>>>  sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)
>>>java.io.FilterInputStream.read(FilterInputStream.java:133)
>>>sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
>>> (HttpURLConnection.java:2419)
>>>sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
>>>sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
>>>sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
>>>java.io.InputStreamReader.read(InputStreamReader.java:184)
>>>java.io.BufferedReader.fill(BufferedReader.java:153)
>>>java.io.BufferedReader.readLine(BufferedReader.java:316)
>>>java.io.BufferedReader.readLine(BufferedReader.java:379)
>>>com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12)
>>>
>>>
>>>
>>
>>
>> --
>> 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
>>
>>
>>
>>
>
> >
>


-- 
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: Ajax in ToDo application hanging

2009-08-27 Thread Dorinel

Is there a way to update ToDo application to use 1.1-SNAPSHOT?

On Aug 28, 1:38 am, David Pollak 
wrote:
> On Thu, Aug 27, 2009 at 3:19 PM, Dorinel  wrote:
>
> > It's great!
> > By the way, by default ToDo application runs on 1.1-SNAPSHOT?
>
> I think it uses 1.0 by default... but I prefer 1.1-SNAPSHOT because it's got
> the most developer-friend features.
>
>
>
>
>
> > On Aug 27, 9:45 pm, David Pollak 
> > wrote:
> > > I've reproduced and fixed this issue.
>
> > > Thanks for reporting it.
>
> > > On Thu, Aug 27, 2009 at 9:13 AM, David Pollak <
> > feeder.of.the.be...@gmail.com
>
> > > > wrote:
> > > > I'm running tests from Firefox running locally, Chrome running locally
> > and
> > > > Safari running remotely to see if I can reproduce the issue (I'm
> > running
> > > > against Lift 1.1-SNAPSHOT)
>
> > > > On Thu, Aug 27, 2009 at 4:38 AM, Dorinel  > >wrote:
>
> > > >> I was implementing application from
> > > >>http://liftweb.net/docs/getting_started/mod_master.html
> > > >> By the way,it's a great tutorial for lift much better than those which
> > > >> were before and it explains a lot of things in comments clearly, thank
> > > >> you for creating it.
>
> > > >> But when I left the todo application for about 2-3 hours, the ajax
> > > >> which allows editing of the ToDo items stopped working. When I click
> > > >> on checkbox it doesn't resort all items, the same it doesn't resort
> > > >> (or redraw) when I'm changing priority from dropdown menu. Also when I
> > > >> click desc to edit it - I can edit it but the result is not saved and
> > > >> it doesn't exit edit mode when I'm editing another item.
> > > >> When I do some actions, like checking a checkbox it seems that on
> > > >> server side I have new rows like these:
> > > >> INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1
> > > >> Milliseconds
>
> > > >> Ajax starts working when I'm adding new todo item (because page
> > > >> reloads) or I'm logging of and on.
>
> > > >> I've replicated this bug by leaving todo application running for night
> > > >> and it was the same ajax not working when I wake up.
>
> > > >> Is this a known bug, or I have done something wrong when I typed ToDo
> > > >> application from tutorial?
>
> > > > --
> > > > 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

--~--~-~--~~~---~--~~
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: has anyone seen this exception?

2009-08-27 Thread Jack Widman
Here is the code I am using. The exception is happening at line 12, the line
that goes  line = br.readLine()
 The exception is happening alot. Any ideas?

package com.authoritude.snippet

import java.io.{InputStreamReader, BufferedInputStream, BufferedReader,
OutputStreamWriter, InputStream}

object StreamUtil {
  def streamToString(stream: InputStream): String = {
val buf = new StringBuilder
val br = new BufferedReader(new InputStreamReader(stream))
var line: String = null
var eof = false
while (! eof) {
  line = br.readLine()
  if (line == null) eof = true else
buf.append(line).append("\n")
}
buf.toString
  }
}


On Thu, Aug 27, 2009 at 5:49 PM, David Pollak  wrote:

> This happens sometimes when the client disconnects before the
> communications with the server is complete.  I see them from time to time
> and they indicate to me that the Internet is a random place.
>
> On Thu, Aug 27, 2009 at 12:06 PM, jack  wrote:
>
>>
>> Has anyone seen this error? I get it while transforming a Stream into
>> a String. The stream is from an http request I just made.
>>
>> Message: java.io.IOException: Premature EOF
>>sun.net.www.http.ChunkedInputStream.readAheadBlocking
>> (ChunkedInputStream.java:556)
>>
>>  sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:
>> 600)
>>
>>  sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)
>>java.io.FilterInputStream.read(FilterInputStream.java:133)
>>sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
>> (HttpURLConnection.java:2419)
>>sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
>>sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
>>sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
>>java.io.InputStreamReader.read(InputStreamReader.java:184)
>>java.io.BufferedReader.fill(BufferedReader.java:153)
>>java.io.BufferedReader.readLine(BufferedReader.java:316)
>>java.io.BufferedReader.readLine(BufferedReader.java:379)
>>com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12)
>>
>>
>>
>
>
> --
> 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] Using Lift to build a Web Service and the PUT HTTP method??

2009-08-27 Thread Alan M

I'm trying to use PUT with Lift and it seems to be working, except I
can't find the content I put.  I'm using jQuery on the front end (a
custom front-end) and firebug seems to think the data gets sent.
Although it doesn't show me the raw request, it adds a PUT tab that
shows the key and value(I couldn't get PUT in jQuery to work without a
key/value pair).  So where should I look for this data in the req?
I've used POST and GET before without problem, but I need to use PUT
here.  I looked in the body field and in the xml field (it is an xml
string being PUT).  BTW, I'm using Lift .11 and scala 2.7.2.

So anyone doing this?  If so where is the PUT data?

Oh also should I upgrade Lift?  Last time I did (from .9 to .11) it
was a lot of work.
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] authentication and access control

2009-08-27 Thread Chris Lewis

Lift users,

I'm curious what you all are using for user access control (Mapper users 
  excluded). I'm seriously evaluating lift for a project that will use 
JPA. My full time job uses Spring Security, which while nice in that it 
stays out of the way, is too clunky for my tastes. I haven't dissected 
how lift implements it with Mapper, but wanted to ask the group first. 
Thanks!

chris

--~--~-~--~~~---~--~~
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: Newbie Question design pattern for ORM in Lift

2009-08-27 Thread rstradling

git clone git://github.com/rstradling/DDLtoLiftORM.git  is the
location of the git code.

http://github.com/rstradling/DDLtoLiftORM is the web address

I hope this is helpful to others.

On Aug 27, 3:13 pm, rstradling  wrote:
> Thanks for the answers everyone.  What David hit upon about wanting
> objects to be subclassible is the conclusion I came to that would
> work..if it existed.  I was hoping there was a way. :(.  Well, I guess
> Naftoli has provided a possible solution but seems more involved than
> I have the experience for.
>
> I will resort to putting the stuff on the generated classes and let
> merge tools do the rest.
>
> Regarding sharing the codeI should be more specific in that it
> parses ddl.  To be honest, I hope you all are not hoping for
> muchbut I will get it up on github and when I do will reply to
> this thread with the location.
>
> On Aug 27, 1:35 pm, David Pollak 
> wrote:
>
> > On Thu, Aug 27, 2009 at 10:26 AM, rstradling wrote:
>
> > > With a parser combinator I wrote to parse .sql and it outputs scala
> > > orm files.
>
> > Care to share?  That'd be a pretty darned useful utility!
>
> > > Please note it is very specific to my needs (i.e. only
> > > works with certain grammars (INSERTS) but that particular grammar is
> > > all I needed to process at the time) but is written in a way that
> > > could be extended to the full grammar (at least that was my
> > > intent :)..
>
> > So... the problem is that objects in Scala are not subclassible.  What does
> > this mean?  For example:
>
> > trait Foo {
> >   object bar extends AnyRef
>
> > }
>
> > trait MyFoo extends Foo {
> >   override object bar {
> >     def cantDoIt = "sigh"
> >   }
>
> > }
>
> > Back in the Scala 2.5 days, there was some talk about allowing this to
> > happen, but it never did.  So, unfortunately, I can't think of a way for
> > your sql generator to create a superclass that could be subclassed and have
> > the effect that you want.
>
> > Sorry/
>
> > > On Aug 27, 1:09 pm, Naftoli Gugenheim  wrote:
> > > > How do you auto-generate them?
>
> > > > On Thu, Aug 27, 2009 at 1:03 PM, rstradling 
> > > wrote:
>
> > > > > I am using Lift 1.0 with the Mapper ORM module from Lift. I am a
> > > > > newbie to Scala and Lift.  I have auto-generated my ORM classes from
> > > > > a .sql file.  Given that these classes are auto-generated I would
> > > > > prefer not to edit them directly and provide additional functionality
> > > > > via inheritance.
>
> > > > > Say I have the following...
> > > > > class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK {
> > > > >   def getSingleton = StatGenerated
> > > > >   object errors extends MappedLong(this)
> > > > >   object hits extends MappedLong(this)
> > > > >   object AB extends MappedLong(this)
> > > > > }
>
> > > > > object StatGenerated extends StatGenerated with LongKeyedMetaMapper
> > > > > [StatGenerated] {
> > > > >   override def fieldOrder = List(errors, hits)
> > > > > }
>
> > > > > class Statistics extends StatGenerated {
> > > > >   def GetBattingAverage(id : Long) : float = {
> > > > >                val stat = Stat.findByKey(id)
> > > > >                stat.hits/stat.AB
> > > > >   }
> > > > > }
>
> > > > > Now what I would like to do is work with the Statistics class as my
> > > > > ORM object...
> > > > > But I believe everything that is ORM related is actually of type
> > > > > StatGenerated rather than Statistics.  i.e. findByKey will return me a
> > > > > StatGenerated rather than a Statistics class.  Is there any clever way
> > > > > around this that I am missing without either modifying the generated
> > > > > class or duplicating code?
>
> > --
> > 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: Scope issues with CometActors

2009-08-27 Thread David Pollak

The optional name attribute allows you to have different comet actor names
(e.g., one per person).  You can retrieve the CometActor's name via the name
method, which returns a Box[String].

In your CometActor, make sure to:

override def lifespan = Full(5 minutes)

This will make the particular CometActor go away if it does not appear on a
page for a 5 minute span.

This lets you have a different CometActor per person, but allows you to
share a single CometActor instance for a given session for a given name
across browser windows/tabs.

I hope this helps and I'd suggest against using SessionVars for passing
setup information to CometActors.

On Thu, Aug 27, 2009 at 7:28 PM, Spencer Uresk  wrote:

> Hey all,
>
> I'm trying to build an app that takes advantage of the Comet support in
> Lift. This is a simple app that displays all messages from a given person
> and shows new messages as they are added. At first, I struggled with trying
> to pull the request parameter (the url looks like this - /person/1) into my
> CometActor, and then I found a message on the lift board that talked about
> the scope mismatch between the request scope and a CometActor, and
> recommends setting a session variable that the CometActor then reads.
>
> The scope mismatch makes sense to me, so I tried the suggested way of doing
> it, which worked. However, now when I go back to the home page and select
> another person to view messages for, I still see the the old messages. After
> some testing, it appears that CometActors on the same page are not
> re-created if there is one already active. I can't seem to find any method
> that gets called on it when the page is rendered either, and I am not sure
> how to update the state of the CometActor so that it retrieves the proper
> messages.
>
> Is there any documentation or examples for using CometActors in conjunction
> with a request parameter like that? Or is there a better way altogether for
> me to be doing this?
>
> Thank you,
>
> - Spencer
>
> >
>


-- 
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] Fwd: [dpp/liftweb] 4bc64d: Stateful snippets work correctly with empty result...

2009-08-27 Thread David Pollak
Fix to the empty stateful snippet form issue.

-- Forwarded message --
From: 
Date: Thu, Aug 27, 2009 at 8:06 PM
Subject: [dpp/liftweb] 4bc64d: Stateful snippets work correctly with empty
result...
To: feeder.of.the.be...@gmail.com


Branch: refs/heads/master
Home:   http://github.com/dpp/liftweb

Commit: 4bc64d86fe7f01b603255d04ca18687fc732320b

http://github.com/dpp/liftweb/commit/4bc64d86fe7f01b603255d04ca18687fc732320b
Author: David Pollak 
Date:   2009-08-27 (Thu, 27 Aug 2009)

Changed paths:
 M lift/src/main/scala/net/liftweb/http/LiftSession.scala

Log Message:
---
Stateful snippets work correctly with empty results and forms





-- 
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: Modularization of Lift code

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 2:00 PM, glenn  wrote:

>
> David,
>
> Besides the very detailed discussion here about the problems of Boot
> initialization
> and the immutability of sitemap and liftrules, that strikes me as a
> sufficient
> barrier to real modularization.


Are you talking about modularization of web apps?  Are you talking about
being able to "plop in" a JAR file and do one or two bits of configuration
and have that JAR's features be part of your app?  If you are, with the
exception of the "where do my menu items go" issue, as long as you can do
the configuration in Boot, Lift allows for fully modular apps.

Rather than complaining the Lift doesn't offer what you need, please define
what you need in very specific terms (I need to intercept a GET request to a
URL, I need to intercept requests to a URL if certain conditions are met, I
need to include a tag in view code that invokes code in my module, etc.) or
point to another framework that allows for this plugin modularization.


> I hadn't thought about turning
> reuseable code into
> traits and assigning those around in jar files until you mentioned it.
> Not a bad idea.
>
> But I wouldn't feel comfortable incorporating third-party traits in my
> code unless
> I had the source to fall back on.


Why are traits any different than objects that you subclass?  As far as I
can tell, traits simply give you nearly multiple inheritance without the
headaches.  Why would you be any less willing to mix in a trait than to
subclass a class provided by another library?


>
>
> Example of poor encapsulation - just the fact that you can encapsulate
> snippets and templates. Without the
> source, how can a user ever hope to incorporate those.


I think that snippets are a near perfect encapsulation mechanism.  They are
simply a transformation of XHTML -> XHTML.  What could be more straight
forward?  What could be more encapsulated?  Further, Lift's mechanism of
associating HTML elements with functions means that there's no need to have
special URLs to handle forms or anything else.  My snippet can generate a
form that will be processed if it is submitted back to the server, no matter
what URL the form is submitted to.  In Rails and other MVC frameworks, the
POST/GET must be done to a specific controller in order for the parameters
to be correctly processed.  Why does this matter?

Well, in the ESME codebase, I just created an authentication plugin
mechanism that allows a plugin to define a part of a form that is to be
filled in as part of the signup process.  The signup process doesn't know
anything about the plugin or what fields the plugin needs.  The snippet that
handles the signup simply binds one element to the plugins part of the
sign-up.  The plugin manages its own portion of the form, manages its own
validation, manages its own saving, all without having to register as being
part of the controller.  This is highly modular.


> And then, to
> make them private, which is done...that's turning
> a headache into a nightmare.


Can you give me an example of a private snippet or a private template and
how you would use one?


>
>
> Yeah, as long as you work at the source-level, there is no problem.
> But that, in-and-of itself, is the problem. As you
> suggest, some, as yet unilluminated patterns, would be most helpful.


If I understood what you were trying to do, I could help you with patterns.

Code works best for me.  If you could put together templates and stubbed
Scala and make clear what you're trying to do and what Lift is not letting
you do, I could help you out.

Thanks,

David


>
>
> Glenn...
>
> On Aug 27, 12:11 pm, David Pollak 
> wrote:
> > On Thu, Aug 27, 2009 at 11:22 AM, glenn  wrote:
> >
> > > David,
> >
> > > Returning menu items from your init function is OK, but forces the
> > > user
> > > of your module to guess on function-call order
> >
> > I don't understand... what function call order are you talking about?
>  The
> > order in which the modules are initialized?  Something else?
> >
> > > , or be forced to glean
> > > it from
> > > the source, which he should not be required to do.
> >
> > > Putting code such as this, instead, in your init function helps, but
> > > does not eliminate that problem.
> >
> > What particular problem?
> >
> >
> >
> > > val sitemap = LiftRules.siteMap match {
> > >  case Full(sm) => LiftRules.setSiteMap(SiteMap(sm.menus :::
> > > Role.menus:_* ))
> > >  case _ => LiftRules.setSiteMap(SiteMap(Role.menus:_*))
> > >}
> >
> > Where are you proposing to put this code?
> >
> >
> >
> > > With it, you can sort of standardize your call-order, requiring that
> > > the init function
> > > be called immediately before
> >
> > Just to be precise, init() is a method on your module.  It's not a
> function.
> >
> >
> >
> > > S.addAround(DB.buildLoanWrapper)
> >
> > > in Boot,scala.
> >
> > > But, there is a larger issue at stake here, I fear, and that is that
> > > true modularization
> > > requires adherence t

[Lift] Scope issues with CometActors

2009-08-27 Thread Spencer Uresk
Hey all,

I'm trying to build an app that takes advantage of the Comet support in
Lift. This is a simple app that displays all messages from a given person
and shows new messages as they are added. At first, I struggled with trying
to pull the request parameter (the url looks like this - /person/1) into my
CometActor, and then I found a message on the lift board that talked about
the scope mismatch between the request scope and a CometActor, and
recommends setting a session variable that the CometActor then reads.

The scope mismatch makes sense to me, so I tried the suggested way of doing
it, which worked. However, now when I go back to the home page and select
another person to view messages for, I still see the the old messages. After
some testing, it appears that CometActors on the same page are not
re-created if there is one already active. I can't seem to find any method
that gets called on it when the page is rendered either, and I am not sure
how to update the state of the CometActor so that it retrieves the proper
messages.

Is there any documentation or examples for using CometActors in conjunction
with a request parameter like that? Or is there a better way altogether for
me to be doing this?

Thank you,

- 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: Small wiki contribution for log4j configuration

2009-08-27 Thread Richard Dallaway

Thanks David, Thanks Tim

I've added the page, and also copied over what appears to be relevant
from the old wiki page.

http://wiki.github.com/dpp/liftweb/how-to-configure-logging

Right: back to some coding now...
Cheers
Richard

On Thu, Aug 27, 2009 at 5:34 PM, Timothy Perrett wrote:
>
>
> Looks great to me! Add it to the lift wiki with the prefix "How To:" as that
> follows our convention.
>
> Cheers, Tim
>
> On 27/08/2009 15:56, "Richard Dallaway"  wrote:
>
>>
>> What's the protocol for making a Wiki contribution: just go in and do it?
>>
>> Turns out I'm not that brave.  I've pulled together the start of a
>> logging wiki entry, just covering what is (for me) the common case.
>> I've put it here for the moment...
>>
>> http://github.com/d6y/brightontide/wikis/configuring-logging
>>
>> ...because I wanted to experiment with the mark up language -- the
>> project has nothing to do with Lift.
>>
>> The old wiki content isn't quite right for what I'm seeing in 1.1
>> these days w.r.t modeName
>> (http://wiki.liftweb.net/index.php/HowTo_configure_logging)
>>
>> Richard
>>
>> >
>>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Ajax in ToDo application hanging

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 3:19 PM, Dorinel  wrote:

>
> It's great!
> By the way, by default ToDo application runs on 1.1-SNAPSHOT?


I think it uses 1.0 by default... but I prefer 1.1-SNAPSHOT because it's got
the most developer-friend features.


>
>
> On Aug 27, 9:45 pm, David Pollak 
> wrote:
> > I've reproduced and fixed this issue.
> >
> > Thanks for reporting it.
> >
> > On Thu, Aug 27, 2009 at 9:13 AM, David Pollak <
> feeder.of.the.be...@gmail.com
> >
> >
> >
> > > wrote:
> > > I'm running tests from Firefox running locally, Chrome running locally
> and
> > > Safari running remotely to see if I can reproduce the issue (I'm
> running
> > > against Lift 1.1-SNAPSHOT)
> >
> > > On Thu, Aug 27, 2009 at 4:38 AM, Dorinel  >wrote:
> >
> > >> I was implementing application from
> > >>http://liftweb.net/docs/getting_started/mod_master.html
> > >> By the way,it's a great tutorial for lift much better than those which
> > >> were before and it explains a lot of things in comments clearly, thank
> > >> you for creating it.
> >
> > >> But when I left the todo application for about 2-3 hours, the ajax
> > >> which allows editing of the ToDo items stopped working. When I click
> > >> on checkbox it doesn't resort all items, the same it doesn't resort
> > >> (or redraw) when I'm changing priority from dropdown menu. Also when I
> > >> click desc to edit it - I can edit it but the result is not saved and
> > >> it doesn't exit edit mode when I'm editing another item.
> > >> When I do some actions, like checking a checkbox it seems that on
> > >> server side I have new rows like these:
> > >> INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1
> > >> Milliseconds
> >
> > >> Ajax starts working when I'm adding new todo item (because page
> > >> reloads) or I'm logging of and on.
> >
> > >> I've replicated this bug by leaving todo application running for night
> > >> and it was the same ajax not working when I wake up.
> >
> > >> Is this a known bug, or I have done something wrong when I typed ToDo
> > >> application from tutorial?
> >
> > > --
> > > 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: Contributing to Lift

2009-08-27 Thread Timothy Perrett

Without doubt the most accesible way would be with writing wiki  
articles... We really lack documentation.

Provided you have a github account you can get cracking straight  
away :-)

Cheers, Tim




Sent from my iPhone

On 27 Aug 2009, at 17:41, Tim Dion  wrote:

>
> Hi all,
>
> I am a Smalltalker, looking to transition into Scala and Lift. How can
> I contribute to Lift?
>
>  Thanks,
>
>  Tim Dion
>  http://www.linkedin.com/pub/tim-dion-csdp/1/785/208
>
> >
>

--~--~-~--~~~---~--~~
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] weirdness with stateful snippets and multiple forms on the page

2009-08-27 Thread harryh

Are stateful snippets considered a good way to do multi-step "wizard"
like interfaces?  They seem like a good fit, but I'm running into 1
annoying problem.  I'm seeting things up so in my .html file I have
something like this:


  // HTML for step 1


  // HTML for step 2


Then in the MyPage StatefulSnippet I return NodeSeq.Empty for 1 step,
and actual contents for the other.

The only issue is that for the "inactive" steps HTML like the
following gets sent to the browser:



This isn't a huge deal really, but it's kind of annoying.  It almost
seems like that  a  element with a form attribute shouldn't
generate the  if the snippet function returns NodeSeq.Empty

-harryh

--~--~-~--~~~---~--~~
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: Modularization of Lift code

2009-08-27 Thread glenn

David,

Besides the very detailed discussion here about the problems of Boot
initialization
and the immutability of sitemap and liftrules, that strikes me as a
sufficient
barrier to real modularization. I hadn't thought about turning
reuseable code into
traits and assigning those around in jar files until you mentioned it.
Not a bad idea.

But I wouldn't feel comfortable incorporating third-party traits in my
code unless
I had the source to fall back on.

Example of poor encapsulation - just the fact that you can encapsulate
snippets and templates. Without the
source, how can a user ever hope to incorporate those. And then, to
make them private, which is done...that's turning
a headache into a nightmare.

Yeah, as long as you work at the source-level, there is no problem.
But that, in-and-of itself, is the problem. As you
suggest, some, as yet unilluminated patterns, would be most helpful.

Glenn...

On Aug 27, 12:11 pm, David Pollak 
wrote:
> On Thu, Aug 27, 2009 at 11:22 AM, glenn  wrote:
>
> > David,
>
> > Returning menu items from your init function is OK, but forces the
> > user
> > of your module to guess on function-call order
>
> I don't understand... what function call order are you talking about?  The
> order in which the modules are initialized?  Something else?
>
> > , or be forced to glean
> > it from
> > the source, which he should not be required to do.
>
> > Putting code such as this, instead, in your init function helps, but
> > does not eliminate that problem.
>
> What particular problem?
>
>
>
> > val sitemap = LiftRules.siteMap match {
> >      case Full(sm) => LiftRules.setSiteMap(SiteMap(sm.menus :::
> > Role.menus:_* ))
> >      case _ => LiftRules.setSiteMap(SiteMap(Role.menus:_*))
> >    }
>
> Where are you proposing to put this code?
>
>
>
> > With it, you can sort of standardize your call-order, requiring that
> > the init function
> > be called immediately before
>
> Just to be precise, init() is a method on your module.  It's not a function.
>
>
>
> > S.addAround(DB.buildLoanWrapper)
>
> > in Boot,scala.
>
> > But, there is a larger issue at stake here, I fear, and that is that
> > true modularization
> > requires adherence to rules of encapsulation and complete
> > documentation, two things
> > that are problematic in Scala code (perhaps due to its power and
> > complexity), unlike pure OOP.
>
> Ummm...  as far as I know, Scala is a pure OO language.  Everything in Scala
> is either the instance of a class (and object, but object is overloaded with
> Scala's use of it as a keyword for singleton) or a method.  There is nothing
> else in Scala.  In this way, Scala is like Smalltalk and Ruby.  It's not
> like Java where things exist in Java that are neither an instance nor a
> method (static methods, primitive types, etc.)
>
> There is nothing that we can't do in Scala to encapsulate anything... the
> issue that I see is "what do you want to encapsulate?"
>
>
>
> > When I've written before on this subject in this group, I've gotten a
> > lot of examples in the small
> > purporting to dispute my contention, but falling short. If you know
> > I'm wrong, fine ... let's see it.
> > If you just think I am, well...think harder.
>
> Let's separate Lift from Scala the language for a moment.  I'm no expert in
> PLT so I'm not going to argue encapsulation in Scala.
>
> I can argue about Lift's modularization and what its limitations are.
>
> The following things in Lift I know to be non-modular:
>
>    - Mapper: because one cannot subclass Mapper definitions, it's not really
>    modular.  Yes, I've built (and subclassed) ProtoUser, but it's a huge hack
>    and anything serious (e.g., subclassing an existing mapper and *changing*
>    the behavior of one on the fields) is not doable with Mapper.  This is
>    basically because I've never meant Mapper to be a serious OR mapping tool,
>    but more of an ActiveRecord clone where you can create a mapping between an
>    RDBMS and some sort of "record".  I use Mapper very successfully, but it's
>    not meant for the same things OO is meant for (subclassing) or what Mixins
>    are meant for.
>    - SiteMap:  SiteMap is frozen at boot time.  This means that OSGi modules
>    can't load and unload themselves and mutate the sitemap.  Because the
>    sitemap is fixed at boot time, it's also not possible for a module to 
> insert
>    menu items at an "appropriate" place in the menu hierarchy.
>    - LiftRules: like SiteMap, the LiftRules are fixed at boot time.  It's
>    not possible for modules to load/unload dynamically and change the various
>    PFs dynamically.
>
> I have a plan for fixing the LiftRules stuff so we can fully support OSGi
> modules.  I will likely extend that to supporting more dynamic sitemaps.
>
> More broadly, every time I've had Scala code that's "concrete" and needed to
> be made more runtime dynamic, the process has been simple, quick, and
> painless.  Breaking classes into traits and composing those traits into
> d

[Lift] Re: Contributing to Lift

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 9:41 AM, Tim Dion  wrote:

>
> Hi all,
>
> I am a Smalltalker, looking to transition into Scala and Lift.


Welcome.


> How can
> I contribute to Lift?


Initially by asking questions and then helping to document the answers on
the wiki.

Then by answering the questions of others on this mailing list.  We place a
premium on helping newbies become productive with Lift.

Let's take that as a starter.  Also, it looks like you're San Francisco
based... I rarely say, "No" to folks who offer to by me lunch. ;-)


>
>
>  Thanks,
>
>  Tim Dion
>  http://www.linkedin.com/pub/tim-dion-csdp/1/785/208
>
> >
>


-- 
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: Lift Record Documentation

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 11:48 AM, inca  wrote:

>
> Ok, thanks. Another question then. As far as I can see from sources,
> basic KeyedRecord trait depends on some Mapper classes. Does Record
> use Mapper for JDBC operations under the covers?

Yes.


>
>
> On 27 авг, 01:25, Timothy Perrett  wrote:
> > Its not the primary ORM at the moment. Although, its developing, and its
> > still simply awesome if you are not using JDBC storage.
> >
> > If you just need regular JDBC style connectivity, then use Mapper for
> now.
> >
> > Cheers, Tim
> >
> > On 26/08/2009 19:01, "inca"  wrote:
> >
> > > Is there any documentation available for Lift Record Framework? From
> > > liftbook: "The Record framework is relatively new to Lift. The plan is
> > > to move to Record as the primary ORM framework for Lift sometime after
> > > version 1.0". Is it the "primary ORM" now?
>
> >
>


-- 
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: Newbie Question design pattern for ORM in Lift

2009-08-27 Thread Naftoli Gugenheim
How do you auto-generate them?

On Thu, Aug 27, 2009 at 1:03 PM, rstradling  wrote:

>
> I am using Lift 1.0 with the Mapper ORM module from Lift. I am a
> newbie to Scala and Lift.  I have auto-generated my ORM classes from
> a .sql file.  Given that these classes are auto-generated I would
> prefer not to edit them directly and provide additional functionality
> via inheritance.
>
> Say I have the following...
> class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK {
>   def getSingleton = StatGenerated
>   object errors extends MappedLong(this)
>   object hits extends MappedLong(this)
>   object AB extends MappedLong(this)
> }
>
> object StatGenerated extends StatGenerated with LongKeyedMetaMapper
> [StatGenerated] {
>   override def fieldOrder = List(errors, hits)
> }
>
> class Statistics extends StatGenerated {
>   def GetBattingAverage(id : Long) : float = {
>val stat = Stat.findByKey(id)
>stat.hits/stat.AB
>   }
> }
>
>
> Now what I would like to do is work with the Statistics class as my
> ORM object...
> But I believe everything that is ORM related is actually of type
> StatGenerated rather than Statistics.  i.e. findByKey will return me a
> StatGenerated rather than a Statistics class.  Is there any clever way
> around this that I am missing without either modifying the generated
> class or duplicating code?
>
>
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Newbie Question design pattern for ORM in Lift

2009-08-27 Thread Naftoli Gugenheim
You could try making StatGenerated a trait and either extending
LongKeyedMapper or using a self type, and experiment with the fields as
objects in the trait or just defs that you override either with the object
(the actual field), or with an implementation that points to the
field.Subclassing
Mappers seems to get very tricky, because of the self types and its
ramifications.

On Thu, Aug 27, 2009 at 1:26 PM, rstradling  wrote:

>
> With a parser combinator I wrote to parse .sql and it outputs scala
> orm files.  Please note it is very specific to my needs (i.e. only
> works with certain grammars (INSERTS) but that particular grammar is
> all I needed to process at the time) but is written in a way that
> could be extended to the full grammar (at least that was my
> intent :)..
>
>
> On Aug 27, 1:09 pm, Naftoli Gugenheim  wrote:
> > How do you auto-generate them?
> >
> > On Thu, Aug 27, 2009 at 1:03 PM, rstradling 
> wrote:
> >
> > > I am using Lift 1.0 with the Mapper ORM module from Lift. I am a
> > > newbie to Scala and Lift.  I have auto-generated my ORM classes from
> > > a .sql file.  Given that these classes are auto-generated I would
> > > prefer not to edit them directly and provide additional functionality
> > > via inheritance.
> >
> > > Say I have the following...
> > > class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK {
> > >   def getSingleton = StatGenerated
> > >   object errors extends MappedLong(this)
> > >   object hits extends MappedLong(this)
> > >   object AB extends MappedLong(this)
> > > }
> >
> > > object StatGenerated extends StatGenerated with LongKeyedMetaMapper
> > > [StatGenerated] {
> > >   override def fieldOrder = List(errors, hits)
> > > }
> >
> > > class Statistics extends StatGenerated {
> > >   def GetBattingAverage(id : Long) : float = {
> > >val stat = Stat.findByKey(id)
> > >stat.hits/stat.AB
> > >   }
> > > }
> >
> > > Now what I would like to do is work with the Statistics class as my
> > > ORM object...
> > > But I believe everything that is ORM related is actually of type
> > > StatGenerated rather than Statistics.  i.e. findByKey will return me a
> > > StatGenerated rather than a Statistics class.  Is there any clever way
> > > around this that I am missing without either modifying the generated
> > > class or duplicating code?
>
> >
>

--~--~-~--~~~---~--~~
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: Ajax in ToDo application hanging

2009-08-27 Thread Dorinel

It's great!
By the way, by default ToDo application runs on 1.1-SNAPSHOT?

On Aug 27, 9:45 pm, David Pollak 
wrote:
> I've reproduced and fixed this issue.
>
> Thanks for reporting it.
>
> On Thu, Aug 27, 2009 at 9:13 AM, David Pollak 
>
>
> > wrote:
> > I'm running tests from Firefox running locally, Chrome running locally and
> > Safari running remotely to see if I can reproduce the issue (I'm running
> > against Lift 1.1-SNAPSHOT)
>
> > On Thu, Aug 27, 2009 at 4:38 AM, Dorinel wrote:
>
> >> I was implementing application from
> >>http://liftweb.net/docs/getting_started/mod_master.html
> >> By the way,it's a great tutorial for lift much better than those which
> >> were before and it explains a lot of things in comments clearly, thank
> >> you for creating it.
>
> >> But when I left the todo application for about 2-3 hours, the ajax
> >> which allows editing of the ToDo items stopped working. When I click
> >> on checkbox it doesn't resort all items, the same it doesn't resort
> >> (or redraw) when I'm changing priority from dropdown menu. Also when I
> >> click desc to edit it - I can edit it but the result is not saved and
> >> it doesn't exit edit mode when I'm editing another item.
> >> When I do some actions, like checking a checkbox it seems that on
> >> server side I have new rows like these:
> >> INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1
> >> Milliseconds
>
> >> Ajax starts working when I'm adding new todo item (because page
> >> reloads) or I'm logging of and on.
>
> >> I've replicated this bug by leaving todo application running for night
> >> and it was the same ajax not working when I wake up.
>
> >> Is this a known bug, or I have done something wrong when I typed ToDo
> >> application from tutorial?
>
> > --
> > 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] lift request param

2009-08-27 Thread DavidV

For the laboratory website I am building I need to keep track of
batches of samples as they are being processed, and would like to do
so with a request parameter in the URL.  Right now, I am manually
adding this parameter to every link:

object batch extends MappedLong(this) {
override def displayName = "Batch"
override def asHtml: Node = http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: (beginner question) Liftweb View folder

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 9:49 AM, Daniel Nelson  wrote:

> Hello,
>
> *Problem*
> I'm new to Lift/Scala and trying to understand/experiment with Lift's View
> folder.  I've not gotten past a 404 error on the browser (as it relates to
> the View folder; templates render fine).


I'd suggest using Lift 1.1-SNAPSHOT... you would have likely gotten a polite
error message.

In this case, I believe you have to add XmlFun/index to your sitemap in
Boot.scala


>
>
> *Background/Environment*
> I've been reading "Exploring Lift" (~Section 3.7) along with "What's the
> 'View' folder for?" from http://wiki.liftweb.net/index.php/FAQ.
>
> Following are the URL and corresponding class (in the View Folder and
> adapted from http://github.com/dpp/liftweb/...   
> here).
>
>
> The server is maven/jetty.
>
> I'm struggling to find other reading materials/examples which highlight my
> error(s); any help is appreciated.  Thanks!  Dan
>
> ~~~
>
> URL: http://localhost:8080/XmlFun/index
>
> package org.delreino.simplyLift.view
>
> import _root_.scala.xml.{Text, Node, NodeSeq}
> import _root_.net.liftweb.http._
> import S._
> import _root_.net.liftweb.util._
>
> class XmlFun extends LiftView {
> def dispatch = Map("index" -> render _)
> def render = {
> println ("XmlFun")
> Full(
> 
> XMLFun
> )
> }
> }
>
> >
>


-- 
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: Multiple sites, same login

2009-08-27 Thread Charles F. Munat

This is good to know about. Thanks!

Marc Boschma wrote:
> Maybe https://opensso.dev.java.net/ might be of interest? Might also  
> be a bit of work...
> 
> Marc
> 
> On 26/08/2009, at 2:53 AM, Charles F. Munat wrote:
> 
>> Now this is an interesting idea. I'll think about it...
>>
>> Thanks!
>>
>> Chas.
>>
>> David Pollak wrote:
>>>
>>> On Mon, Aug 24, 2009 at 3:23 PM, Charles F. Munat >> > wrote:
>>>
>>>
>>>I'm building two Lift applications that access the same back end
>>>database -- one is for the public site, and the other, which  
>>> will use a
>>>subdomain, is for administration of the public site.
>>>
>>>A third application will access a separate database, but will be  
>>> related
>>>to the previous two sites.
>>>
>>>Any suggestions as to how I might have one login that keeps the  
>>> user
>>>logged in across all these sites? Obviously, OpenID would work,  
>>> and
>>>there's complex stuff involving LDAP servers, etc., but I'd like  
>>> to keep
>>>it fairly simple.
>>>
>>>Ideas?
>>>
>>>
>>> You could put a cookie at the top level for the domain that's an
>>> encrypted mix of the user's primary key and the current time.  If the
>>> user comes to another one of the sites, it could examine the cookie  
>>> and
>>> see if it should create a session for the user.
>>>
>>>
>>>
>>>
>>>Thanks!
>>>Chas.
>>>
>>>
>>>
>>>
>>>
>>> -- 
>>> 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: Ext.Direct

2009-08-27 Thread Charles F. Munat

I haven't used Ext.Direct yet, but I am currently building a site (three 
sites, really) that uses Ext JS 3.0 for the front end.

One site is essentially a CRUD app. The back end is a PostgreSQL 
database. The middle layer is a Lift app that uses JPA/Hibernate to 
access the database. It provides a REST interface to the data that 
accepts and returns JSON. (I've hand written this but must learn more 
about Lift's JSON capabilities.)

The front end is pure Ext JS. All connections to the database are via 
AJAX-like calls (AJAJ?). The REST interface is pretty pure, using only 
GET, PUT, and DELETE.

(I like idempotency, so I don't use POST. The back end generates UUIDs 
and prepopulates the add forms with a UUID, then the create calls use 
the same URL as the update calls. If the object with that ID already 
exists, it is updated. If it doesn't, it is created. Thus all calls are 
idempotent. This also improves security, as you're, um, unlikely to 
guess a UUID.)

I'd be happy to talk to you about this. It's still in the early stages, 
but I have to debut it in a couple weeks if not sooner (what's new?), so 
I'll be zooming through the front end stuff over the next few days.

I plan for all future sites that I build in Lift to follow a similar 
pattern on the front end.

Chas.

Naftoli Gugenheim wrote:
> Has anyone used lift with Ext.JS forms/Ext.Direct?
> 
> 
> P.S. It would be neat if it could interact with Lift's JSON support. I wonder 
> what it would take.
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
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: Something you might find useful: easy lazy loading of page sections

2009-08-27 Thread Charles F. Munat

Nice!

David Pollak wrote:
> This is nifty... I think it's worthy of inclusion in Lift.  Thanks for 
> the suggestion!
> 
> On Wed, Aug 26, 2009 at 2:44 PM, harryh  > wrote:
> 
> 
> Let's say you have a bit of a page like so:
> 
> 
>  
> 
> 
> Now, let's assume that computing whatever is bound to 
> takes a long time (maybe it takes a network call, or a long database
> query, or whatever).  You don't want to hold up your entire page view
> on that so.
> 
> 
>  
>
>  
> 
> 
> Then in your Util snippet:
> 
> def lazyLoad(xhtml: NodeSeq) = {
>  val id = "lazy"+System.currentTimeMillis()
>  val (name, exp) = ajaxInvoke(() => { SetHtml(id, xhtml) })
>  
>  >
>{Script(OnLoad(exp.cmd))}
>  
> }
> 
> Feel free to critique if there is a better way of doing this.  It's
> working pretty good for me so far though.
> 
> -harryh
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> 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: has anyone seen this exception?

2009-08-27 Thread David Pollak
This happens sometimes when the client disconnects before the communications
with the server is complete.  I see them from time to time and they indicate
to me that the Internet is a random place.

On Thu, Aug 27, 2009 at 12:06 PM, jack  wrote:

>
> Has anyone seen this error? I get it while transforming a Stream into
> a String. The stream is from an http request I just made.
>
> Message: java.io.IOException: Premature EOF
>sun.net.www.http.ChunkedInputStream.readAheadBlocking
> (ChunkedInputStream.java:556)
>
>  sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:
> 600)
>
>  sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)
>java.io.FilterInputStream.read(FilterInputStream.java:133)
>sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
> (HttpURLConnection.java:2419)
>sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
>sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
>sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
>java.io.InputStreamReader.read(InputStreamReader.java:184)
>java.io.BufferedReader.fill(BufferedReader.java:153)
>java.io.BufferedReader.readLine(BufferedReader.java:316)
>java.io.BufferedReader.readLine(BufferedReader.java:379)
>com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12)
>
> >
>


-- 
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] Contributing to Lift

2009-08-27 Thread Tim Dion

Hi all,

I am a Smalltalker, looking to transition into Scala and Lift. How can
I contribute to Lift?

  Thanks,

  Tim Dion
  http://www.linkedin.com/pub/tim-dion-csdp/1/785/208

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

2009-08-27 Thread inca

Ok, thanks. Another question then. As far as I can see from sources,
basic KeyedRecord trait depends on some Mapper classes. Does Record
use Mapper for JDBC operations under the covers?

On 27 авг, 01:25, Timothy Perrett  wrote:
> Its not the primary ORM at the moment. Although, its developing, and its
> still simply awesome if you are not using JDBC storage.
>
> If you just need regular JDBC style connectivity, then use Mapper for now.
>
> Cheers, Tim
>
> On 26/08/2009 19:01, "inca"  wrote:
>
> > Is there any documentation available for Lift Record Framework? From
> > liftbook: "The Record framework is relatively new to Lift. The plan is
> > to move to Record as the primary ORM framework for Lift sometime after
> > version 1.0". Is it the "primary ORM" now?

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

2009-08-27 Thread David Pollak
On Wed, Aug 26, 2009 at 4:03 AM, Jeppe Nejsum Madsen wrote:

>
> Hi,
>
> I'm using POJT (plain old JDBC transactions :-) with a single db. I
> would like to:
>
> 1) Manually rollback changes if some validations fail
> 2) Have the tx rolled back if an error happens
>


>
>
> I think 1) can be achieved by DB.rollback(DefaultConnectionIdentifier),
> but in general, how do I get the current connection active for the
> request?


DB.use(DefaultConnectionIdentifier) {
  superConn =>
}


>
>
> 2) I think can be implemented by adding a handler to
> LiftRules.exceptionHandler and perform the steps in 1).


Actually, this used to be done automatically... and somehow the code that
did it went away... sigh.  Lemme see if I can check something in that'll fix
the situation.


>
>
> Are there any better ways to handle this?
>
> /Jeppe
>
>
>
>
> >
>


-- 
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: Newbie Question design pattern for ORM in Lift

2009-08-27 Thread rstradling

Thanks for the answers everyone.  What David hit upon about wanting
objects to be subclassible is the conclusion I came to that would
work..if it existed.  I was hoping there was a way. :(.  Well, I guess
Naftoli has provided a possible solution but seems more involved than
I have the experience for.

I will resort to putting the stuff on the generated classes and let
merge tools do the rest.

Regarding sharing the codeI should be more specific in that it
parses ddl.  To be honest, I hope you all are not hoping for
muchbut I will get it up on github and when I do will reply to
this thread with the location.


On Aug 27, 1:35 pm, David Pollak 
wrote:
> On Thu, Aug 27, 2009 at 10:26 AM, rstradling wrote:
>
>
>
> > With a parser combinator I wrote to parse .sql and it outputs scala
> > orm files.
>
> Care to share?  That'd be a pretty darned useful utility!
>
> > Please note it is very specific to my needs (i.e. only
> > works with certain grammars (INSERTS) but that particular grammar is
> > all I needed to process at the time) but is written in a way that
> > could be extended to the full grammar (at least that was my
> > intent :)..
>
> So... the problem is that objects in Scala are not subclassible.  What does
> this mean?  For example:
>
> trait Foo {
>   object bar extends AnyRef
>
> }
>
> trait MyFoo extends Foo {
>   override object bar {
>     def cantDoIt = "sigh"
>   }
>
> }
>
> Back in the Scala 2.5 days, there was some talk about allowing this to
> happen, but it never did.  So, unfortunately, I can't think of a way for
> your sql generator to create a superclass that could be subclassed and have
> the effect that you want.
>
> Sorry/
>
>
>
>
>
> > On Aug 27, 1:09 pm, Naftoli Gugenheim  wrote:
> > > How do you auto-generate them?
>
> > > On Thu, Aug 27, 2009 at 1:03 PM, rstradling 
> > wrote:
>
> > > > I am using Lift 1.0 with the Mapper ORM module from Lift. I am a
> > > > newbie to Scala and Lift.  I have auto-generated my ORM classes from
> > > > a .sql file.  Given that these classes are auto-generated I would
> > > > prefer not to edit them directly and provide additional functionality
> > > > via inheritance.
>
> > > > Say I have the following...
> > > > class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK {
> > > >   def getSingleton = StatGenerated
> > > >   object errors extends MappedLong(this)
> > > >   object hits extends MappedLong(this)
> > > >   object AB extends MappedLong(this)
> > > > }
>
> > > > object StatGenerated extends StatGenerated with LongKeyedMetaMapper
> > > > [StatGenerated] {
> > > >   override def fieldOrder = List(errors, hits)
> > > > }
>
> > > > class Statistics extends StatGenerated {
> > > >   def GetBattingAverage(id : Long) : float = {
> > > >                val stat = Stat.findByKey(id)
> > > >                stat.hits/stat.AB
> > > >   }
> > > > }
>
> > > > Now what I would like to do is work with the Statistics class as my
> > > > ORM object...
> > > > But I believe everything that is ORM related is actually of type
> > > > StatGenerated rather than Statistics.  i.e. findByKey will return me a
> > > > StatGenerated rather than a Statistics class.  Is there any clever way
> > > > around this that I am missing without either modifying the generated
> > > > class or duplicating code?
>
> --
> 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] has anyone seen this exception?

2009-08-27 Thread jack

Has anyone seen this error? I get it while transforming a Stream into
a String. The stream is from an http request I just made.

Message: java.io.IOException: Premature EOF
sun.net.www.http.ChunkedInputStream.readAheadBlocking
(ChunkedInputStream.java:556)
sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:
600)
sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)
java.io.FilterInputStream.read(FilterInputStream.java:133)
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read
(HttpURLConnection.java:2419)
sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
java.io.InputStreamReader.read(InputStreamReader.java:184)
java.io.BufferedReader.fill(BufferedReader.java:153)
java.io.BufferedReader.readLine(BufferedReader.java:316)
java.io.BufferedReader.readLine(BufferedReader.java:379)
com.abc.snippet.StreamUtil$.streamToString(StreamUtil.scala:12)

--~--~-~--~~~---~--~~
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: Modularization of Lift code

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 11:22 AM, glenn  wrote:

>
> David,
>
> Returning menu items from your init function is OK, but forces the
> user
> of your module to guess on function-call order


I don't understand... what function call order are you talking about?  The
order in which the modules are initialized?  Something else?


> , or be forced to glean
> it from
> the source, which he should not be required to do.
>
> Putting code such as this, instead, in your init function helps, but
> does not eliminate that problem.


What particular problem?


>
>
> val sitemap = LiftRules.siteMap match {
>  case Full(sm) => LiftRules.setSiteMap(SiteMap(sm.menus :::
> Role.menus:_* ))
>  case _ => LiftRules.setSiteMap(SiteMap(Role.menus:_*))
>}


Where are you proposing to put this code?


>
>
> With it, you can sort of standardize your call-order, requiring that
> the init function
> be called immediately before


Just to be precise, init() is a method on your module.  It's not a function.


>
>
> S.addAround(DB.buildLoanWrapper)
>
> in Boot,scala.
>
> But, there is a larger issue at stake here, I fear, and that is that
> true modularization
> requires adherence to rules of encapsulation and complete
> documentation, two things
> that are problematic in Scala code (perhaps due to its power and
> complexity), unlike pure OOP.


Ummm...  as far as I know, Scala is a pure OO language.  Everything in Scala
is either the instance of a class (and object, but object is overloaded with
Scala's use of it as a keyword for singleton) or a method.  There is nothing
else in Scala.  In this way, Scala is like Smalltalk and Ruby.  It's not
like Java where things exist in Java that are neither an instance nor a
method (static methods, primitive types, etc.)

There is nothing that we can't do in Scala to encapsulate anything... the
issue that I see is "what do you want to encapsulate?"


>
>
> When I've written before on this subject in this group, I've gotten a
> lot of examples in the small
> purporting to dispute my contention, but falling short. If you know
> I'm wrong, fine ... let's see it.
> If you just think I am, well...think harder.


Let's separate Lift from Scala the language for a moment.  I'm no expert in
PLT so I'm not going to argue encapsulation in Scala.

I can argue about Lift's modularization and what its limitations are.

The following things in Lift I know to be non-modular:

   - Mapper: because one cannot subclass Mapper definitions, it's not really
   modular.  Yes, I've built (and subclassed) ProtoUser, but it's a huge hack
   and anything serious (e.g., subclassing an existing mapper and *changing*
   the behavior of one on the fields) is not doable with Mapper.  This is
   basically because I've never meant Mapper to be a serious OR mapping tool,
   but more of an ActiveRecord clone where you can create a mapping between an
   RDBMS and some sort of "record".  I use Mapper very successfully, but it's
   not meant for the same things OO is meant for (subclassing) or what Mixins
   are meant for.
   - SiteMap:  SiteMap is frozen at boot time.  This means that OSGi modules
   can't load and unload themselves and mutate the sitemap.  Because the
   sitemap is fixed at boot time, it's also not possible for a module to insert
   menu items at an "appropriate" place in the menu hierarchy.
   - LiftRules: like SiteMap, the LiftRules are fixed at boot time.  It's
   not possible for modules to load/unload dynamically and change the various
   PFs dynamically.

I have a plan for fixing the LiftRules stuff so we can fully support OSGi
modules.  I will likely extend that to supporting more dynamic sitemaps.

More broadly, every time I've had Scala code that's "concrete" and needed to
be made more runtime dynamic, the process has been simple, quick, and
painless.  Breaking classes into traits and composing those traits into
different runtime configurations has by and large been a few minute to few
hour project.  Yeah, it may be considered "poor mans" DI to use traits and
the cake pattern, but I find that the type safety that Scala offers makes
the small extract Scala coding effort to be worth it vs. writing more
tests/configuring more runtime stuff/the weird errors that creep into the
code despite tests.


>
>
> This is not small potatoes  There are plenty of languages on the dust
> heap precisely because
> of the extension problem.


Can you be very detailed about what kind of problems you're seeing.  Maybe
the folks on this list can help you work through them and maybe we'll all
discover new Scala patterns.

Thanks,

David


>
>
> Glenn...
>
>
> On Aug 26, 2:53 pm, David Pollak 
> wrote:
> > On Wed, Aug 26, 2009 at 10:13 AM, glenn  wrote:
> >
> > > Timothy,
> >
> > > I'm still not convinced that Lift applications can be modularized as
> > > simply as you suggest.
> > > Do you have any samples of your MyLib.init? How do you handle the non-
> > > PF's, like schemify and setSiteMap?
> >
> > I typically return 

[Lift] Re: Ajax in ToDo application hanging

2009-08-27 Thread David Pollak
I've reproduced and fixed this issue.

Thanks for reporting it.

On Thu, Aug 27, 2009 at 9:13 AM, David Pollak  wrote:

> I'm running tests from Firefox running locally, Chrome running locally and
> Safari running remotely to see if I can reproduce the issue (I'm running
> against Lift 1.1-SNAPSHOT)
>
>
> On Thu, Aug 27, 2009 at 4:38 AM, Dorinel wrote:
>
>>
>> I was implementing application from
>> http://liftweb.net/docs/getting_started/mod_master.html
>> By the way,it's a great tutorial for lift much better than those which
>> were before and it explains a lot of things in comments clearly, thank
>> you for creating it.
>>
>> But when I left the todo application for about 2-3 hours, the ajax
>> which allows editing of the ToDo items stopped working. When I click
>> on checkbox it doesn't resort all items, the same it doesn't resort
>> (or redraw) when I'm changing priority from dropdown menu. Also when I
>> click desc to edit it - I can edit it but the result is not saved and
>> it doesn't exit edit mode when I'm editing another item.
>> When I do some actions, like checking a checkbox it seems that on
>> server side I have new rows like these:
>> INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1
>> Milliseconds
>>
>> Ajax starts working when I'm adding new todo item (because page
>> reloads) or I'm logging of and on.
>>
>> I've replicated this bug by leaving todo application running for night
>> and it was the same ajax not working when I wake up.
>>
>> Is this a known bug, or I have done something wrong when I typed ToDo
>> application from tutorial?
>>
>> >>
>>
>
>
> --
> 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
>



-- 
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: Small wiki contribution for log4j configuration

2009-08-27 Thread Timothy Perrett


Looks great to me! Add it to the lift wiki with the prefix "How To:" as that
follows our convention.

Cheers, Tim

On 27/08/2009 15:56, "Richard Dallaway"  wrote:

> 
> What's the protocol for making a Wiki contribution: just go in and do it?
> 
> Turns out I'm not that brave.  I've pulled together the start of a
> logging wiki entry, just covering what is (for me) the common case.
> I've put it here for the moment...
> 
> http://github.com/d6y/brightontide/wikis/configuring-logging
> 
> ...because I wanted to experiment with the mark up language -- the
> project has nothing to do with Lift.
> 
> The old wiki content isn't quite right for what I'm seeing in 1.1
> these days w.r.t modeName
> (http://wiki.liftweb.net/index.php/HowTo_configure_logging)
> 
> Richard
> 
> > 
> 



--~--~-~--~~~---~--~~
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: Small wiki contribution for log4j configuration

2009-08-27 Thread David Pollak
Richard,

Our new wiki is at http://wiki.github.com/dpp/liftweb

You're encouraged to copy stuff from the old wiki to the new wiki and update
content that's out of date and enhance any content.

Thanks,

David

On Thu, Aug 27, 2009 at 7:56 AM, Richard Dallaway wrote:

>
> What's the protocol for making a Wiki contribution: just go in and do it?
>
> Turns out I'm not that brave.  I've pulled together the start of a
> logging wiki entry, just covering what is (for me) the common case.
> I've put it here for the moment...
>
> http://github.com/d6y/brightontide/wikis/configuring-logging
>
> ...because I wanted to experiment with the mark up language -- the
> project has nothing to do with Lift.
>
> The old wiki content isn't quite right for what I'm seeing in 1.1
> these days w.r.t modeName
> (http://wiki.liftweb.net/index.php/HowTo_configure_logging)
>
> Richard
>
> >
>


-- 
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: Modularization of Lift code

2009-08-27 Thread glenn

Pardon,

This may be more of an issue with Scala, not Lift. So,
I apologize for polluting this group. I suppose I will
have to live with imperfect modularization capabilities,
and be sure to include the source with anything meant
to be reused.

Glenn...

On Aug 27, 11:22 am, glenn  wrote:
> David,
>
> Returning menu items from your init function is OK, but forces the
> user
> of your module to guess on function-call order, or be forced to glean
> it from
> the source, which he should not be required to do.
>
> Putting code such as this, instead, in your init function helps, but
> does not eliminate that problem.
>
> val sitemap = LiftRules.siteMap match {
>       case Full(sm) => LiftRules.setSiteMap(SiteMap(sm.menus :::
> Role.menus:_* ))
>       case _ => LiftRules.setSiteMap(SiteMap(Role.menus:_*))
>     }
>
> With it, you can sort of standardize your call-order, requiring that
> the init function
> be called immediately before
>
> S.addAround(DB.buildLoanWrapper)
>
> in Boot,scala.
>
> But, there is a larger issue at stake here, I fear, and that is that
> true modularization
> requires adherence to rules of encapsulation and complete
> documentation, two things
> that are problematic in Scala code (perhaps due to its power and
> complexity), unlike pure OOP.
>
> When I've written before on this subject in this group, I've gotten a
> lot of examples in the small
> purporting to dispute my contention, but falling short. If you know
> I'm wrong, fine ... let's see it.
> If you just think I am, well...think harder.
>
> This is not small potatoes  There are plenty of languages on the dust
> heap precisely because
> of the extension problem.
>
> Glenn...
>
> On Aug 26, 2:53 pm, David Pollak 
> wrote:
>
> > On Wed, Aug 26, 2009 at 10:13 AM, glenn  wrote:
>
> > > Timothy,
>
> > > I'm still not convinced that Lift applications can be modularized as
> > > simply as you suggest.
> > > Do you have any samples of your MyLib.init? How do you handle the non-
> > > PF's, like schemify and setSiteMap?
>
> > I typically return my menu items from my init function.  You can call
> > schemifier from within your init function.
>
> > > As for templates, I've learned that you can use the templating
> > > mechanism in Loc to eliminate the need for
> > > html files, but that's only a small part of the problem.
>
> > > Glenn...
>
> > > On Jul 27, 4:01 pm, Timothy Perrett  wrote:
> > > > Hi Glen...
>
> > > > I actually do a lot of this - we have a product at work and i've just
> > > > written a bunch of abstractions for work which just require me to do:
>
> > > > MyLib.init
>
> > > > In the boot file of a new application and then everything wires up - I
> > > > couldn't think of anything more straightforward?
>
> > > > The vast majority of stuff in lift is done with PF's, so you can
> > > > pretty much just write them in external jars, and import them - my 3rd
> > > > part stuff usually has a lift-webkit dependency so that I can just do
> > > > the LiftRules.disptach.append stuff directly in the init method, but
> > > > its really no biggy and saves boilerplate.
>
> > > > So given your example, this scheme should work right?
>
> > > > Cheers, Tim
>
> > > > On Jul 27, 11:52 pm, glenn  wrote:
>
> > > > > I'm interested in abstracting out useful features from my Lift
> > > > > applications for ease of reuse, but I haven't found an easy way to do
> > > > > it. I find myself creating a new Lift aplication for each feature,
> > > > > with all the baggage (bootstrapping, etc.), and I then have to do a
> > > > > lot of code modification to the application I'm adding the feature to
> > > > > in order to get it to work.
>
> > > > > For example, suppose I want to add role-based user login to an
> > > > > application that already has a User model just by dropping in a jar
> > > > > file with the new feature. I don't see how to do it without some
> > > > > boostrapping modifications.
>
> > > > > Has anyone really tried to modularize their Lift development. I'd be
> > > > > very interested in some suggestions.
>
> > --
> > 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: Modularization of Lift code

2009-08-27 Thread glenn

David,

Returning menu items from your init function is OK, but forces the
user
of your module to guess on function-call order, or be forced to glean
it from
the source, which he should not be required to do.

Putting code such as this, instead, in your init function helps, but
does not eliminate that problem.

val sitemap = LiftRules.siteMap match {
  case Full(sm) => LiftRules.setSiteMap(SiteMap(sm.menus :::
Role.menus:_* ))
  case _ => LiftRules.setSiteMap(SiteMap(Role.menus:_*))
}

With it, you can sort of standardize your call-order, requiring that
the init function
be called immediately before

S.addAround(DB.buildLoanWrapper)

in Boot,scala.

But, there is a larger issue at stake here, I fear, and that is that
true modularization
requires adherence to rules of encapsulation and complete
documentation, two things
that are problematic in Scala code (perhaps due to its power and
complexity), unlike pure OOP.

When I've written before on this subject in this group, I've gotten a
lot of examples in the small
purporting to dispute my contention, but falling short. If you know
I'm wrong, fine ... let's see it.
If you just think I am, well...think harder.

This is not small potatoes  There are plenty of languages on the dust
heap precisely because
of the extension problem.

Glenn...


On Aug 26, 2:53 pm, David Pollak 
wrote:
> On Wed, Aug 26, 2009 at 10:13 AM, glenn  wrote:
>
> > Timothy,
>
> > I'm still not convinced that Lift applications can be modularized as
> > simply as you suggest.
> > Do you have any samples of your MyLib.init? How do you handle the non-
> > PF's, like schemify and setSiteMap?
>
> I typically return my menu items from my init function.  You can call
> schemifier from within your init function.
>
>
>
>
>
> > As for templates, I've learned that you can use the templating
> > mechanism in Loc to eliminate the need for
> > html files, but that's only a small part of the problem.
>
> > Glenn...
>
> > On Jul 27, 4:01 pm, Timothy Perrett  wrote:
> > > Hi Glen...
>
> > > I actually do a lot of this - we have a product at work and i've just
> > > written a bunch of abstractions for work which just require me to do:
>
> > > MyLib.init
>
> > > In the boot file of a new application and then everything wires up - I
> > > couldn't think of anything more straightforward?
>
> > > The vast majority of stuff in lift is done with PF's, so you can
> > > pretty much just write them in external jars, and import them - my 3rd
> > > part stuff usually has a lift-webkit dependency so that I can just do
> > > the LiftRules.disptach.append stuff directly in the init method, but
> > > its really no biggy and saves boilerplate.
>
> > > So given your example, this scheme should work right?
>
> > > Cheers, Tim
>
> > > On Jul 27, 11:52 pm, glenn  wrote:
>
> > > > I'm interested in abstracting out useful features from my Lift
> > > > applications for ease of reuse, but I haven't found an easy way to do
> > > > it. I find myself creating a new Lift aplication for each feature,
> > > > with all the baggage (bootstrapping, etc.), and I then have to do a
> > > > lot of code modification to the application I'm adding the feature to
> > > > in order to get it to work.
>
> > > > For example, suppose I want to add role-based user login to an
> > > > application that already has a User model just by dropping in a jar
> > > > file with the new feature. I don't see how to do it without some
> > > > boostrapping modifications.
>
> > > > Has anyone really tried to modularize their Lift development. I'd be
> > > > very interested in some suggestions.
>
> --
> 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: 1.1-SNAPSHOT issue?

2009-08-27 Thread E. Biggs

Many 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] Overriding widgets stylesheets

2009-08-27 Thread Marius

Someone encountered the problem where he couldn't override the
stylesheet used by some widget. Damn I can't find any more that
thread ...

Anyways here it is:

1. Include the widget in your application say monthview.
2. The url to the stylesheet is: /classpath/calendars/monthview/
style.css
3. In order to override this put your changed style.css in WEB-INF/
classes/toserve/calendars/monthview/style.css

This works for me.

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: SparkLines broken in 1.1-SNAPSHOT

2009-08-27 Thread David Pollak
Fixed.  Thanks!

On Wed, Aug 26, 2009 at 10:28 PM, jon  wrote:

>
> Hi,
>
> Looks like the JS is being double escaped.
>
> Changed following methods to fix:
>
>  def onLoad(id: String, graphStyle: SparklineStyle.Value, data:
> JsArray, opts: JsObj) : NodeSeq = {
>
>   

[Lift] Re: Ajax in ToDo application hanging

2009-08-27 Thread David Pollak
I'm running tests from Firefox running locally, Chrome running locally and
Safari running remotely to see if I can reproduce the issue (I'm running
against Lift 1.1-SNAPSHOT)

On Thu, Aug 27, 2009 at 4:38 AM, Dorinel  wrote:

>
> I was implementing application from
> http://liftweb.net/docs/getting_started/mod_master.html
> By the way,it's a great tutorial for lift much better than those which
> were before and it explains a lot of things in comments clearly, thank
> you for creating it.
>
> But when I left the todo application for about 2-3 hours, the ajax
> which allows editing of the ToDo items stopped working. When I click
> on checkbox it doesn't resort all items, the same it doesn't resort
> (or redraw) when I'm changing priority from dropdown menu. Also when I
> click desc to edit it - I can edit it but the result is not saved and
> it doesn't exit edit mode when I'm editing another item.
> When I do some actions, like checking a checkbox it seems that on
> server side I have new rows like these:
> INFO - Service request (POST) /ajax_request/F17795011372L0I/ took 1
> Milliseconds
>
> Ajax starts working when I'm adding new todo item (because page
> reloads) or I'm logging of and on.
>
> I've replicated this bug by leaving todo application running for night
> and it was the same ajax not working when I wake up.
>
> Is this a known bug, or I have done something wrong when I typed ToDo
> application from tutorial?
>
> >
>


-- 
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: Newbie Question design pattern for ORM in Lift

2009-08-27 Thread rstradling

With a parser combinator I wrote to parse .sql and it outputs scala
orm files.  Please note it is very specific to my needs (i.e. only
works with certain grammars (INSERTS) but that particular grammar is
all I needed to process at the time) but is written in a way that
could be extended to the full grammar (at least that was my
intent :)..


On Aug 27, 1:09 pm, Naftoli Gugenheim  wrote:
> How do you auto-generate them?
>
> On Thu, Aug 27, 2009 at 1:03 PM, rstradling  wrote:
>
> > I am using Lift 1.0 with the Mapper ORM module from Lift. I am a
> > newbie to Scala and Lift.  I have auto-generated my ORM classes from
> > a .sql file.  Given that these classes are auto-generated I would
> > prefer not to edit them directly and provide additional functionality
> > via inheritance.
>
> > Say I have the following...
> > class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK {
> >   def getSingleton = StatGenerated
> >   object errors extends MappedLong(this)
> >   object hits extends MappedLong(this)
> >   object AB extends MappedLong(this)
> > }
>
> > object StatGenerated extends StatGenerated with LongKeyedMetaMapper
> > [StatGenerated] {
> >   override def fieldOrder = List(errors, hits)
> > }
>
> > class Statistics extends StatGenerated {
> >   def GetBattingAverage(id : Long) : float = {
> >                val stat = Stat.findByKey(id)
> >                stat.hits/stat.AB
> >   }
> > }
>
> > Now what I would like to do is work with the Statistics class as my
> > ORM object...
> > But I believe everything that is ORM related is actually of type
> > StatGenerated rather than Statistics.  i.e. findByKey will return me a
> > StatGenerated rather than a Statistics class.  Is there any clever way
> > around this that I am missing without either modifying the generated
> > class or duplicating code?

--~--~-~--~~~---~--~~
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] Newbie Question design pattern for ORM in Lift

2009-08-27 Thread rstradling

I am using Lift 1.0 with the Mapper ORM module from Lift. I am a
newbie to Scala and Lift.  I have auto-generated my ORM classes from
a .sql file.  Given that these classes are auto-generated I would
prefer not to edit them directly and provide additional functionality
via inheritance.

Say I have the following...
class StatGenerated extends LongKeyedMapper[StatGenerated] with IdPK {
   def getSingleton = StatGenerated
   object errors extends MappedLong(this)
   object hits extends MappedLong(this)
   object AB extends MappedLong(this)
}

object StatGenerated extends StatGenerated with LongKeyedMetaMapper
[StatGenerated] {
   override def fieldOrder = List(errors, hits)
}

class Statistics extends StatGenerated {
   def GetBattingAverage(id : Long) : float = {
val stat = Stat.findByKey(id)
stat.hits/stat.AB
   }
}


Now what I would like to do is work with the Statistics class as my
ORM object...
But I believe everything that is ORM related is actually of type
StatGenerated rather than Statistics.  i.e. findByKey will return me a
StatGenerated rather than a Statistics class.  Is there any clever way
around this that I am missing without either modifying the generated
class or duplicating code?






--~--~-~--~~~---~--~~
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] (beginner question) Liftweb View folder

2009-08-27 Thread Daniel Nelson
Hello,

*Problem*
I'm new to Lift/Scala and trying to understand/experiment with Lift's View
folder.  I've not gotten past a 404 error on the browser (as it relates to
the View folder; templates render fine).

*Background/Environment*
I've been reading "Exploring Lift" (~Section 3.7) along with "What's the
'View' folder for?" from http://wiki.liftweb.net/index.php/FAQ.

Following are the URL and corresponding class (in the View Folder and
adapted from http://github.com/dpp/liftweb/...
here).


The server is maven/jetty.

I'm struggling to find other reading materials/examples which highlight my
error(s); any help is appreciated.  Thanks!  Dan

~~~

URL: http://localhost:8080/XmlFun/index

package org.delreino.simplyLift.view

import _root_.scala.xml.{Text, Node, NodeSeq}
import _root_.net.liftweb.http._
import S._
import _root_.net.liftweb.util._

class XmlFun extends LiftView {
def dispatch = Map("index" -> render _)
def render = {
println ("XmlFun")
Full(

XMLFun
)
}
}

--~--~-~--~~~---~--~~
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: Props.userName minor minor minor suggestion

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 7:07 AM, Richard Dallaway wrote:

>
> As Props.userName is public, it would be good if it didn't include a
> trailing "." in the return value.  I see why it does for use in toTry
> but as a user of Lift it was a surprise to ask for Props.userName and
> see the "." on the end.
>
> The same applies for Props.hostName (even though there's S.hostName)
> and maybe Props.modeName.
>
> This came about because I was customizing a logging environment to use
> the SMTP Appender and I wanted to include a username and hostname as
> the sender of the SMTP error message.  I was happy to spot
> Props.userName (thank you IDE code completion) but confused to get a
> value of "richard." not "richard" as my username.  It is, of course
> trivial to get the values without the "." on the end, but just as a
> principle of least surprise it might be an idea to drop the trailing
> "." on these methods. Or make them private? :-O


Thanks for the suggestion.  See
http://github.com/dpp/liftweb/commit/10ff1518f66a15e4f4b06157c49acaacb3a4c9cb


>
>
> Cheers
> Richard
>
> >
>


-- 
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: GAE (google apps engine) Lift Eclipse Setup

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 7:49 AM, Andreas wrote:

>
> Hi,
>
> I have a working GAE Scala Eclipse setup based on:
>
> http://penguinparens.blogspot.com/2009/04/further-steps-scalagwtapp-engineeclipse.html
>
> How do I integrate the Lift framework from:
> http://github.com/ymnk/liftweb/tree/master
>

Not in direct answer to your question, but please use the main Lift
distribution at http://github.com/dpp/liftweb/tree/master  No fork is
officially supported and the latest fixes will be in the dpp/liftweb
repository.


>
> thanks
> Andreas
>
> >
>


-- 
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: some questions on lift

2009-08-27 Thread David Pollak
On Thu, Aug 27, 2009 at 6:08 AM, surfman  wrote:

>
> I am totally new and interested in scala & lift. what I have is a
> little Java knowledge. Aftering reading to-do application at the
> website, I got the following questions:
>
> 1) where and how to setup database? the tutorial never mentions
> database setup,


Your DB is defined in the DBVendor object found in Boot.scala.

By default, it uses Derby, but you can, via a properties file or changing
the code in DBVendor, choose whatever RDBMS you want to point you Lift
mapper classes to.  Alternatively, you can use JPA or other existing
persistence mechanisms.


>
>
> 2) how does lift support database migration? the tutorial says to use
> Schemifier, but what I am thinking is if I remove a column, merge db
> columns, etc. how does lift handle? or, where may I find such
> instructiion?


Each table and field has callbacks that are invoked during schemification.
Sorry... there's precious little documentation on Schemifier... care to
contribute some?


>
>
> 3) internationalization support. how does lift support this?
>
> 4) how does lift compare to Grails?  I have some experience on Grails.
> Developer may build an app in a extremely fast way. but, lift looks
> not as fast as Grails. The speed I mentioned is not app performance, I
> am talking about speed to build an app.


I have little experience with Grails, but my Rails experience (2 years) led
me to develop Lift.  I find that building Lift apps (especially Ajax and
Comet apps) is radically faster than with Rails.  In terms of CRUD apps, I
think Lift compares reasonably well with Rails, especially since Naftoli's
recent contributions.

Thanks,

David


>
>
> Forgive me if above questions are dummies. but it is really helpful
> for a real beginner like me. Thanks for any help on these questions.
>
> >
>


-- 
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] Small wiki contribution for log4j configuration

2009-08-27 Thread Richard Dallaway

What's the protocol for making a Wiki contribution: just go in and do it?

Turns out I'm not that brave.  I've pulled together the start of a
logging wiki entry, just covering what is (for me) the common case.
I've put it here for the moment...

http://github.com/d6y/brightontide/wikis/configuring-logging

...because I wanted to experiment with the mark up language -- the
project has nothing to do with Lift.

The old wiki content isn't quite right for what I'm seeing in 1.1
these days w.r.t modeName
(http://wiki.liftweb.net/index.php/HowTo_configure_logging)

Richard

--~--~-~--~~~---~--~~
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: some questions on lift

2009-08-27 Thread Timothy Perrett


HAHA - indeed I do... I've written so many articles on lift now I forget
what stuff is in the bag ;-)

Perhaps this will also be helpful: http://is.gd/sfyT

To be honest, ive not done a great deal with Mapper so someone else will
have to help you there (I usually use JPA)

Cheers, Tim



On 27/08/2009 14:32, "marius d."  wrote:

> 
> Tim has a magic articles bag :)
> 
> On Aug 27, 4:20 pm, Timothy Perrett  wrote:
>> Checkout my article here on how to localize with Lift:  http://is.gd/1NXGN
>> 
>> Cheers, Tim
>> 
>> On 27/08/2009 14:08, "surfman"  wrote:
>> 
>>> 3) internationalization support. how does lift support this?
> > 
> 



--~--~-~--~~~---~--~~
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] GAE (google apps engine) Lift Eclipse Setup

2009-08-27 Thread Andreas

Hi,

I have a working GAE Scala Eclipse setup based on:
http://penguinparens.blogspot.com/2009/04/further-steps-scalagwtapp-engineeclipse.html

How do I integrate the Lift framework from:
http://github.com/ymnk/liftweb/tree/master

thanks
Andreas

--~--~-~--~~~---~--~~
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] Props.userName minor minor minor suggestion

2009-08-27 Thread Richard Dallaway

As Props.userName is public, it would be good if it didn't include a
trailing "." in the return value.  I see why it does for use in toTry
but as a user of Lift it was a surprise to ask for Props.userName and
see the "." on the end.

The same applies for Props.hostName (even though there's S.hostName)
and maybe Props.modeName.

This came about because I was customizing a logging environment to use
the SMTP Appender and I wanted to include a username and hostname as
the sender of the SMTP error message.  I was happy to spot
Props.userName (thank you IDE code completion) but confused to get a
value of "richard." not "richard" as my username.  It is, of course
trivial to get the values without the "." on the end, but just as a
principle of least surprise it might be an idea to drop the trailing
"." on these methods. Or make them private? :-O

Cheers
Richard

--~--~-~--~~~---~--~~
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: some questions on lift

2009-08-27 Thread surfman

Wow! so quick reply. Thanks Tim!. I am going to look at it.

How about other concerns?



--~--~-~--~~~---~--~~
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: 1.1-SNAPSHOT issue?

2009-08-27 Thread David Pollak
Thanks.  Added a test.  Lift failed the test.  Fixed Lift.  Pushed the
source to GitHub.

On Thu, Aug 27, 2009 at 12:15 AM, E. Biggs  wrote:

>
> Ok here's the problem stripped down. The merge happens but the 
> node isn't being removed from the body
> Let me know if you'd like it in some other format.
>
> templates-hidden/outer.html:
>
> 
>  
>  
>  
>  
>
>  
> 
>
>
> inner.html:
>
> 
>  
>Inner
>  
> 
>
> renders:
>
> 
>  www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
> 
>  
>
>
> Inner
>
>
>  script>
> 
> 
>
>  
>Inner
>  
>
>
>
>