[Lift] Re: User Presence Heartbeat

2010-01-22 Thread Daniel Spiewak
This seems to work very nicely.  Well, it gives me lots of spurious
events, but a little bit of filtering based on active ListenerId(s)
and I'm golden.  Unfortunately, I've already run into two main
problems:

* It seems to be somewhat non-deterministic as to whether or not every
listener is closed when the browser is shut down (Firefox 3.6).  It's
possible that just one listener is remaining active (hasn't been
Unlisten'ed), which would prevent my presence system from firing.  Is
this to be expected?  Do I just need to wait a little longer for the
connection to time out?

* The Unlisten event does not *ever* seem to fire when the user logs
out.  The logout action redirects the user back to the login page,
which obviously wouldn't have a long-poll.  Nevertheless, my system
still thinks the logged-out user is active.  It's possible that I'm
filtering something or perhaps associating the event wrong; it would
depend on whether session var changes propagate prior to the Unlisten
event.  Any ideas here?

Daniel

On Jan 12, 12:46 pm, David Pollak 
wrote:
> I'm kind swamped today, but the simplest thing you can do is:
>
> private def notifyListen = {
>   MyUserThingy.gotAListenEventFor(User.currentUser)
>   false
>
> }
>
> private def notifyUnlisten = {
>   MyUserThingy.gotAnUnlistenEventFor(User.currentUser)
>   false
>
> }
>
> override def highPriority = {
>   case Listen(_, _, _) if notifyListen => ()
>   case Unlisten(_) if notifyUnlisten => ()
>
> }
>
> Each time the browser registers as a listener, you'll get a notification
> (the beginning of the long poll).  Each time the browser unregisters as a
> listener (the end of the long poll), you'll get a notification.
>
> This stuff is kinda internal and may change (although there's no plans to
> change the Listen/Unlisten logic).
>
> On Tue, Jan 12, 2010 at 10:25 AM, Daniel Spiewak wrote:
>
>
>
> > We're already using the Comet support within Lift quite extensively
> > across the board.  There are very, very few pages in our application
> > which do not have a CometActor embedded in them at some level of
> > nesting.
>
> > Daniel
>
> > On Jan 12, 12:08 pm, Naftoli Gugenheim  wrote:
> > > You are already using Comet, or just Lift?
>
> > > -
>
> > > Daniel Spiewak wrote:
>
> > > I'm looking to implement a user presence feature (think: Facebook or
> > > Gmail chat) in a Lift 1.0 application.  Ideally, I would like to avoid
> > > adding extraneous connections.  Is it possible to hook into the Lift
> > > Comet heartbeat which is already in use across our system?  I've
> > > looked at the source for CometActor, and it's just a little too
> > > obfuscated for me to figure this one out on my own.  :-)
>
> > > Alternatively, has anyone else implemented this sort of system in
> > > Lift?  If so, how did you go about it?  Any tips from the well-
> > > informed?
>
> > > Daniel
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > > For more options, visit this group athttp://
> > groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics

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



[Lift] Can sessions do this?

2010-01-22 Thread Nolan Darilek
I'm porting an app I've written in Ruby over to Scala and Lift, and I'm 
wondering if Lift and Java's sessions can accomplish what I'm attempting.


The app is mostly XMPP-based, though there is a web interface for 
configuration. Both run in the same process, because some changes from 
the web interface need to be reflected instantly in the XMPP interface, 
and I'd rather not have a separate message-passing layer out-of-process.


Users don't log in with a username and password. Instead, they send an 
XMPP command and are sent a temporary URL. The URL vanishes after a 
certain timeout, and can also be reset by resending the command.


In Ruby, I generate a GUID which I periodically time out, tracking last 
access times via the web app. I'm wondering, though, if Lift's sessions 
can achieve this? I'm not immediately sure where to look, but if anyone 
could give me pointers for the following requirements, that'd rock.


1. Visiting the app without a session ID param shouldn't generate a new 
session. Basically, index.html will just be mostly static, providing 
info on the service itself.


2. If the "config" command is sent via XMPP, the bot should first search 
all sessions for any matching the user's JID, destroying one if it 
exists. It should then create another, passing the user back a URL to 
the app with a jsessionid parameter. So I need to somehow associate 
arbitrary properties with sessions and find one based on those. Note 
that the sessions still need to be addressable via unique strings to 
maintain some level of security.


3. Visiting a URL with a jsessionid parameter should whipe out any 
sessions set in cookies. Actually, since the web configuration interface 
is just two forms, I'm likely fine with disabling cookie-based sessions 
entirely and just passing around jsessionids if that would make things 
easier.


Can anyone offer any pointers as to where to begin looking? Or am I 
totally off base here? I tried glancing over LiftSession, but that left 
me even more confused as to whether or not an XMPP app can create 
sessions and pass off their URLs.


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



[Lift] Re: intro mvn critique

2010-01-22 Thread Randinn
Nice work, easy to setup.

On Jan 23, 10:45 am, Tim Nelson  wrote:
> I've been meaning to do this for awhile:
>
> http://dl.dropbox.com/u/1154284/lift-mvn.html
>
> Feel free to add this to the main Lift site.
>
> Tim
>
> On Thu, Jan 21, 2010 at 6:35 PM, Raoul Duke  wrote:
> >> I wish, but no.  I've written my own shell script.
>
> > ugh.
>
> > could the html verison perhaps be improved to not have extra blank
> > lines which prevent me from successfully copy and pasting it into my
> > shell? :-)
>
> >http://liftweb.net/docs/getting_started/mod_master.html#x1-40001.2
>
> > sincerely.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
>
>

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



[Lift] Re: intro mvn critique

2010-01-22 Thread Randinn
That's what I usually use.

On Jan 23, 10:54 am, Jonathan Ferguson  wrote:
> What about using "mvn archetype:generate"?
>
> It gives a wizard style interface to create new projects.
>
> Jono
>
> 2010/1/23 Tim Nelson 
>
> > I've been meaning to do this for awhile:
>
> >http://dl.dropbox.com/u/1154284/lift-mvn.html
>
> > Feel free to add this to the main Lift site.
>
> > Tim
>
> > On Thu, Jan 21, 2010 at 6:35 PM, Raoul Duke  wrote:
> > >> I wish, but no.  I've written my own shell script.
>
> > > ugh.
>
> > > could the html verison perhaps be improved to not have extra blank
> > > lines which prevent me from successfully copy and pasting it into my
> > > shell? :-)
>
> > >http://liftweb.net/docs/getting_started/mod_master.html#x1-40001.2
>
> > > sincerely.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] intro mvn critique

2010-01-22 Thread Jonathan Ferguson
What about using "mvn archetype:generate"?

It gives a wizard style interface to create new projects.

Jono

2010/1/23 Tim Nelson 

> I've been meaning to do this for awhile:
>
> http://dl.dropbox.com/u/1154284/lift-mvn.html
>
> Feel free to add this to the main Lift site.
>
> Tim
>
> On Thu, Jan 21, 2010 at 6:35 PM, Raoul Duke  wrote:
> >> I wish, but no.  I've written my own shell script.
> >
> > ugh.
> >
> > could the html verison perhaps be improved to not have extra blank
> > lines which prevent me from successfully copy and pasting it into my
> > shell? :-)
> >
> > http://liftweb.net/docs/getting_started/mod_master.html#x1-40001.2
> >
> > sincerely.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] intro mvn critique

2010-01-22 Thread Tim Nelson
I've been meaning to do this for awhile:

http://dl.dropbox.com/u/1154284/lift-mvn.html

Feel free to add this to the main Lift site.

Tim

On Thu, Jan 21, 2010 at 6:35 PM, Raoul Duke  wrote:
>> I wish, but no.  I've written my own shell script.
>
> ugh.
>
> could the html verison perhaps be improved to not have extra blank
> lines which prevent me from successfully copy and pasting it into my
> shell? :-)
>
> http://liftweb.net/docs/getting_started/mod_master.html#x1-40001.2
>
> sincerely.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] getting started feedback

2010-01-22 Thread jlist9
I second this. In general I find the getting started guide very helpful.
It explains a lot of key concepts step by step. I'd just like to mention a
few things to be considered for future improvements:

1. it's nice to have the default menus in the sample to do project
but it looks like a little magic to me when I read the guide. If would
be great to explain a little bit how the menu works and what are
the options if you don't want the menu there, or ways to customize
an application in the context of how Lift works. This is usually not
a problem for page central frameworks such as Stripes, or page/component
central frameworks such as Wicket.

2. it'd be also very helpful to maybe briefly describe recommended ways
to do lift development with tools such as sbt, JRebel and eclipse, or other
IDEs. The tools and setups could be rather dynamic. I think the web page
is a better place for these things than the book. If not in the getting started
guide,  a separate FAQ or a link to a separate page from the getting started
guide would also do.

On Thu, Jan 21, 2010 at 10:37 PM, The Trav  wrote:
> Ok, so I'm trying out the lift framework, went through the guide
> without too much trouble.  Had a few points that threw me a bit.
>
> The biggest one is probably having a snippet named TD and a model
> named ToDo.
> It seems to me like it's trying to work around namespace collisions
> and/or potential confusion over namespaces, I think it would probably
> be a better idea to address that explicitly.
>
> What do people generally do for naming snippets?  Is naming them after
> the Model the exception rather than the rule?
>
> Another thing that got me was that it didn't address adding new pages
> past index.html which strikes me as somewhat incomplete...  After
> reading the getting started guide, I feel I'm going to have to find
> another document or two (or three) before I can do any meaningful work
> with the framework.
>
>
> Other than those two suggestions I found it a pretty good
> introduction, the framework is definitely pretty neat, and I like the
> mvn integration for getting started, very handy
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>
>

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



Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 12:57 PM, Naftoli Gugenheim wrote:

> Sorry for not being more precise.
> If I understood you, you said there are times where a function whose return
> value is *not* used,


You misunderstood me.


> but still code broke when the expected type was changed to the more correct
> Unit. Is that not what you were referring to when you said you don't
> remember why but it broke a lot of code?
>
> -
> David Pollak wrote:
>
> On Fri, Jan 22, 2010 at 10:36 AM, Naftoli Gugenheim  >wrote:
>
> > I'm curious to know the difference between returning Any or Unit, if you
> > remember. Is it possible it was a bug in Scala?
> >
>
> Returning Any returns the value of the last expression in the function.
> Returning Unit always returns the Unit instance.  In some places (I think
> when processing Ajax forms) we take the return value from the functions and
> try to determine if they are meant as JavaScript or somesuch to be sent
> back
> to the browser.
>
>
> >
> > -
> > David Pollak wrote:
> >
> > On Fri, Jan 22, 2010 at 2:22 AM, Marius  wrote:
> >
> > > This same thing is also touched by
> http://reviewboard.liftweb.net/r/184/
> > > (driven by Kris' post)
> > >
> > > Do you agree with these following statements:
> > >
> > > 1. The SHtml Ajax function should return JsCmd
> > >
> >
> > Yes.
> >
> >
> > > 2. The SHtml non Ajax function should return a Unit instead of Any
> > > (unless there are compelling reasons to keep Any)
> > >
> >
> > There is a compelling reason to keep Any.  I can't remember it right now,
> > but there is a really, really good reason (I've made the change to Unit
> in
> > the past and it broke a pile of stuff in my applications.)
> >
> >
> > >
> > > If so I could probably make the adjustments today since I'm on that
> > > defect anyways.
> > >
> > > Br's,
> > > Marius
> > >
> > > On Jan 22, 5:48 am, David Pollak 
> > > wrote:
> > > > On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
> > > >
> > > > felipero.maill...@gmail.com> wrote:
> > > > > That's a little better.. thanks
> > > >
> > > > Originally, the function returned Any... and this led to problems
> > (people
> > > > returning HTML, Strings, etc.)  It turns out that 95% of the time,
> you
> > > want
> > > > to do something to tell the user that the server did something
> (unless
> > > the
> > > > function sends a message to a CometActor), so using the type-system
> to
> > > make
> > > > sure Ajax functions returned JsCmds was the right answer.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > > greekscala wrote:
> > > >
> > > > >> Hello,
> > > >
> > > > >> know what you mean. You can use JsCmds._Noop to return "nohting"
> as
> > > > >> JsCmd.
> > > >
> > > > >> best regards
> > > >
> > > > >> On 18 Jan., 17:25, Felipe Rodrigues 
> > > > >> wrote:
> > > >
> > > > >>> Here is how I made it, but seems ugly:
> > > >
> > > > >>> SHtml.a(() => {serverSideFunction(t.text); Call("void",
> > Num(0)).cmd},
> > > t)
> > > >
> > > > >>> It is awkward having to add a JsCmd even when I don't need it.
> > > >
> > > > >>> Felipe
> > > >
> > > > >>> Naftoli Gugenheim wrote:
> > > >
> > > >  Never mind my question; I hadn't paid attention to the subject.
> > > >   -
> > > >  Felipe Rodrigues wrote:
> > > >   Hi all,
> > > >   I want to create a link which when clicked calls a server
> > side
> > > >  function.
> > > >  No need for JavaScript callback.
> > > >  I tried with no success:
> > > >   SHtml.a(() => {serverSideFunction(t.text)}, t)
> > > >   Any idea how can I accomplish that will be appreciated.
> > > >   Thanks,
> > > >   Felipe
> > > >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Lift" group.
> > > > > To post to this group, send email to lift...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > 
> 
> >
> > >
> > > 
> 
> >
> > 
> 
> >
> > >
> > > >
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/liftweb?hl=en.
> > > >
> > > > --
> > > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > Follow me:http://twitter.com/dpp
> > > > Surf the harmonics
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > 
> 
> >
> > >
> > > .
> > > For more options, visit this group at
> > > http://groups.google.com/group/liftweb?hl=en.
> > >
> > >
> >
> >
> > --
> > Lift, the simply functional web framework http://liftweb.net
> > Beginning Scala http://w

Re: [Lift] Re: Two new issues for TextileParser

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 2:02 PM, tommycli  wrote:

> My mistake. The last time I brought a bug up, you told me to file a
> bug on github - so I assumed it was general procedure.
>

GitHub's ticket system is not a good place to discuss things for a variety
of reasons.  In general, it's best to discuss stuff on this list first and
then open a defect with a reference to the thread.


>
> On Jan 18, 9:07 pm, David Pollak 
> wrote:
> > Please don't open tickets unless you discuss them on this list first.
> >
> >
> >
> > On Sun, Jan 17, 2010 at 6:45 PM, tommycli  wrote:
> > > I created two new issues for TextileParser.
> >
> > > 290. TextileParser molests divs
> >
> > > 291. TextileParser does not support notextile
> >
> > > Additionally, it'd be nice if TextileParser were implemented in a way
> > > such that it was extensible. The main issue is that it's just a
> > > singleton object, which cannot be extended.
> >
> > > Perhaps instead of:
> >
> > > object TextileParser
> >
> > > we could have:
> >
> > > class TextileParserCls {
> > >  ... real stuff...
> > > }
> >
> > > object TextileParser extends TextileParserCls
> >
> > > People could then extend the class and instantiate their own singleton
> > > if they wanted to extend the parser.
> >
> > > Thanks, and sorry if I'm becoming a bug on the Textile.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


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

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



[Lift] Re: Two new issues for TextileParser

2010-01-22 Thread tommycli
My mistake. The last time I brought a bug up, you told me to file a
bug on github - so I assumed it was general procedure.

On Jan 18, 9:07 pm, David Pollak 
wrote:
> Please don't open tickets unless you discuss them on this list first.
>
>
>
> On Sun, Jan 17, 2010 at 6:45 PM, tommycli  wrote:
> > I created two new issues for TextileParser.
>
> > 290. TextileParser molests divs
>
> > 291. TextileParser does not support notextile
>
> > Additionally, it'd be nice if TextileParser were implemented in a way
> > such that it was extensible. The main issue is that it's just a
> > singleton object, which cannot be extended.
>
> > Perhaps instead of:
>
> > object TextileParser
>
> > we could have:
>
> > class TextileParserCls {
> >  ... real stuff...
> > }
>
> > object TextileParser extends TextileParserCls
>
> > People could then extend the class and instantiate their own singleton
> > if they wanted to extend the parser.
>
> > Thanks, and sorry if I'm becoming a bug on the Textile.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics

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



[Lift] Re: getting started feedback

2010-01-22 Thread The Trav
> greekscala wrote:
> I had the same problems too. There is a free book on Lift 
> http://groups.google.com/group/the-lift-book this should be
> able to give you a good overview.
Thanks, I was downloading the book as I posted the feedback.
I gave the feedback anyway as I would expect a large number of people
won't go past the quickstart guide when evaluating the framework so if
popularity / ease of startup is important, then perhaps expanding the
guide, or explicitly linking to the book from the end of the guide
would be a good idea.


> Naftoli Gugenheim  wrote:
> Other snippet naming conventions or options are:
> - The model name is singular and the snippet name is plural
> - The snippet class is name XXXOps (for operations?)
> - Same name, but use a "partially qualified name." E.g., 
> mypackage.snippet.Author can import mypackage.model and refer to model.Author 
> with no ambiguity
> - Same name but import with an alias:
>   import mypackage.model.{Author => MAuthor}
> - Combination: import model aliased as "m," then refer to "m.Author."
Thanks for the suggestions, I wasn't aware of the import aliases or
partially qualified names as options.
I'm tossing up between partially qualified names and plural for
snippet now, ahh the curse of choices :)

Happy to see a lot of activity on the group.  Active communities make
a big positive difference to most projects.  Do you guys have a
freenode (or other irc) channel?
Or is it mostly just the google group?

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



[Lift] Re: Ideas for how to inject QueryParams into find() and findAll()

2010-01-22 Thread Franz Bettag
trait Customerize[A <: MetaMapper[A] with CustomerFields[A]] {

self: A with KeyedMetaMapper[Long, A] with CustomerFields[A] =>

def findForCustomer(params: QueryParam[A]*): Box[A] = {
var seq = Seq()
if (!User.isAdmin_?) seq += By(self.customer, User.customerId)
self.find((seq ++ params): _*)
}

def findAllForCustomer(params: QueryParam[A]*): List[A] = {
var seq = Seq()
if (!User.isAdmin_?) seq += By(self.customer, User.customerId)
self.findAll((seq ++ params): _*)
}

}


Now find() works too. Used MetaMapper instead of KeyedMetaMapper.

The self.customer problematic still exists ;)

On 22 Jan., 21:54, Franz Bettag  wrote:
> I've got this so far. The CustomerFields trait just appends the
> customer's object to the class.
> The Customerize trait is for extending the singleton.
>
> Firs thing, Jeppe wrote to use the find method, which doesn't seem to
> be available there. At least it doesn't find it.
> So i switched to findAll (which works), but the problem is, that the
> By-Clause i am trying to create, does not work.
>
> How can i get A's customer Property? self and A don't work. Even if i
> extend self: A with CustomerFields[A].
>
> trait Customerize[A <: MetaMapper[A] with CustomerFields[A]] {
>
>         self: A =>
>
>         def findForCustomer(params: QueryParam[A]*): A = {
>                 var seq = Seq(MaxRows(1))
>                 if (!User.isAdmin_?) seq += By(self.customer, User.customerId)
>                 self.findAll((seq ++ params): _*)
>         }
>
>         def findAllForCustomer(params: QueryParam[A]*): A = {
>                 var seq = Seq()
>                 if (!User.isAdmin_?) seq += By(self.customer, User.customerId)
>                 self.findAll((seq ++ params): _*)
>         }
>
> }
>
> trait CustomerFields[A <: Mapper[A]] {
>
>         this: A with Mapper[A] =>
>
>         private val thisTyped = this.asInstanceOf[A]
>
>         object customer extends MappedLongForeignKey(thisTyped, Customer)
> with LifecycleCallbacks {
>
>                 override def dbNotNull_? = true
>
>                 override def beforeCreate = {
>                         User.currentUser match {
>                                 case Full(u: User) => 
> Customer.find(By(Customer.id,
> u.customer.get)) match {
>                                         case Full(c: Customer) => this(c)
>                                         case _ => Log.error("Customer *not* 
> found! This shouldn't
> happen!"); false
>                                 }
>                                 case _ => Log.error("User *not* found! This 
> shouldn't happen!");
> false
>                         }
>                 }
>
>         }
>
> }
>
> On 21 Jan., 18:47, Franz Bettag  wrote:
>
> > I will implement it into my own MetaMapper-sub-trait so all of my
> > models can share the code.
>
> > Thank you all for your input!
>
> > On Jan 21, 9:44 am, Jeppe Nejsum Madsen  wrote:
>
> > > Naftoli Gugenheim  writes:
> > > > Why not define a new method?
> > > > def findByCurUser(params: QueryParam*) = 
> > > > User.currentUser.flatMap(user=> find((Seq(By(User.username, 
> > > > user.username.is)) ++ params): _*))
> > > > find returns a Box and currentUser does too, so flatMap flattens them 
> > > > into one. Basically find takes a varargs and you're passing a Seq 
> > > > instead using : _*, and that Seq contains the user and other params.
> > > > You could probably write params + By(User.username, user.username.is) 
> > > > instead of the reverse order, as it's shorter than the previous version.
>
> > > The problem with this solution is that you cannot use any of Lift's
> > > builtin stuff such as CRUDify.
>
> > > If you wan't to create a multitenant service with only a single set of 
> > > tables, you wan't do make damn
> > > sure that each customer only sees his/her own data :-)
>
> > > /Jeppe

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



Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Naftoli Gugenheim
Sorry for not being more precise.
If I understood you, you said there are times where a function whose return 
value is *not* used, but still code broke when the expected type was changed to 
the more correct Unit. Is that not what you were referring to when you said you 
don't remember why but it broke a lot of code?

-
David Pollak wrote:

On Fri, Jan 22, 2010 at 10:36 AM, Naftoli Gugenheim wrote:

> I'm curious to know the difference between returning Any or Unit, if you
> remember. Is it possible it was a bug in Scala?
>

Returning Any returns the value of the last expression in the function.
Returning Unit always returns the Unit instance.  In some places (I think
when processing Ajax forms) we take the return value from the functions and
try to determine if they are meant as JavaScript or somesuch to be sent back
to the browser.


>
> -
> David Pollak wrote:
>
> On Fri, Jan 22, 2010 at 2:22 AM, Marius  wrote:
>
> > This same thing is also touched by http://reviewboard.liftweb.net/r/184/
> > (driven by Kris' post)
> >
> > Do you agree with these following statements:
> >
> > 1. The SHtml Ajax function should return JsCmd
> >
>
> Yes.
>
>
> > 2. The SHtml non Ajax function should return a Unit instead of Any
> > (unless there are compelling reasons to keep Any)
> >
>
> There is a compelling reason to keep Any.  I can't remember it right now,
> but there is a really, really good reason (I've made the change to Unit in
> the past and it broke a pile of stuff in my applications.)
>
>
> >
> > If so I could probably make the adjustments today since I'm on that
> > defect anyways.
> >
> > Br's,
> > Marius
> >
> > On Jan 22, 5:48 am, David Pollak 
> > wrote:
> > > On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
> > >
> > > felipero.maill...@gmail.com> wrote:
> > > > That's a little better.. thanks
> > >
> > > Originally, the function returned Any... and this led to problems
> (people
> > > returning HTML, Strings, etc.)  It turns out that 95% of the time, you
> > want
> > > to do something to tell the user that the server did something (unless
> > the
> > > function sends a message to a CometActor), so using the type-system to
> > make
> > > sure Ajax functions returned JsCmds was the right answer.
> > >
> > >
> > >
> > >
> > >
> > > > greekscala wrote:
> > >
> > > >> Hello,
> > >
> > > >> know what you mean. You can use JsCmds._Noop to return "nohting" as
> > > >> JsCmd.
> > >
> > > >> best regards
> > >
> > > >> On 18 Jan., 17:25, Felipe Rodrigues 
> > > >> wrote:
> > >
> > > >>> Here is how I made it, but seems ugly:
> > >
> > > >>> SHtml.a(() => {serverSideFunction(t.text); Call("void",
> Num(0)).cmd},
> > t)
> > >
> > > >>> It is awkward having to add a JsCmd even when I don't need it.
> > >
> > > >>> Felipe
> > >
> > > >>> Naftoli Gugenheim wrote:
> > >
> > >  Never mind my question; I hadn't paid attention to the subject.
> > >   -
> > >  Felipe Rodrigues wrote:
> > >   Hi all,
> > >   I want to create a link which when clicked calls a server
> side
> > >  function.
> > >  No need for JavaScript callback.
> > >  I tried with no success:
> > >   SHtml.a(() => {serverSideFunction(t.text)}, t)
> > >   Any idea how can I accomplish that will be appreciated.
> > >   Thanks,
> > >   Felipe
> > >
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lift...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > 
> 
> >
> > >
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/liftweb?hl=en.
> > >
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> 
> >
> > .
> > For more options, visit this group at
> > http://groups.google.com/group/liftweb?hl=en.
> >
> >
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
> --
> You r

[Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Marius
Very well then. If you do recall the rationale for keeping Any for non
Ajax function, please let me/us know about it or add a comment in the
code as I get the feeling that this will raise up again in the future.

Br's,
Marius

On Jan 22, 8:36 pm, Naftoli Gugenheim  wrote:
> I'm curious to know the difference between returning Any or Unit, if you 
> remember. Is it possible it was a bug in Scala?
>
> -
>
> David Pollak wrote:
> On Fri, Jan 22, 2010 at 2:22 AM, Marius  wrote:
> > This same thing is also touched byhttp://reviewboard.liftweb.net/r/184/
> > (driven by Kris' post)
>
> > Do you agree with these following statements:
>
> > 1. The SHtml Ajax function should return JsCmd
>
> Yes.
>
> > 2. The SHtml non Ajax function should return a Unit instead of Any
> > (unless there are compelling reasons to keep Any)
>
> There is a compelling reason to keep Any.  I can't remember it right now,
> but there is a really, really good reason (I've made the change to Unit in
> the past and it broke a pile of stuff in my applications.)
>
>
>
>
>
> > If so I could probably make the adjustments today since I'm on that
> > defect anyways.
>
> > Br's,
> > Marius
>
> > On Jan 22, 5:48 am, David Pollak 
> > wrote:
> > > On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
>
> > > felipero.maill...@gmail.com> wrote:
> > > > That's a little better.. thanks
>
> > > Originally, the function returned Any... and this led to problems (people
> > > returning HTML, Strings, etc.)  It turns out that 95% of the time, you
> > want
> > > to do something to tell the user that the server did something (unless
> > the
> > > function sends a message to a CometActor), so using the type-system to
> > make
> > > sure Ajax functions returned JsCmds was the right answer.
>
> > > > greekscala wrote:
>
> > > >> Hello,
>
> > > >> know what you mean. You can use JsCmds._Noop to return "nohting" as
> > > >> JsCmd.
>
> > > >> best regards
>
> > > >> On 18 Jan., 17:25, Felipe Rodrigues 
> > > >> wrote:
>
> > > >>> Here is how I made it, but seems ugly:
>
> > > >>> SHtml.a(() => {serverSideFunction(t.text); Call("void", Num(0)).cmd},
> > t)
>
> > > >>> It is awkward having to add a JsCmd even when I don't need it.
>
> > > >>> Felipe
>
> > > >>> Naftoli Gugenheim wrote:
>
> > >  Never mind my question; I hadn't paid attention to the subject.
> > >       -
> > >  Felipe Rodrigues wrote:
> > >       Hi all,
> > >       I want to create a link which when clicked calls a server side
> > >  function.
> > >  No need for JavaScript callback.
> > >  I tried with no success:
> > >       SHtml.a(() => {serverSideFunction(t.text)}, t)
> > >       Any idea how can I accomplish that will be appreciated.
> > >       Thanks,
> > >       Felipe
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lift...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > liftweb+unsubscr...@googlegroups.com
> > 
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/liftweb?hl=en.
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/liftweb?hl=en.

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



[Lift] Re: Ideas for how to inject QueryParams into find() and findAll()

2010-01-22 Thread Franz Bettag
I've got this so far. The CustomerFields trait just appends the
customer's object to the class.
The Customerize trait is for extending the singleton.

Firs thing, Jeppe wrote to use the find method, which doesn't seem to
be available there. At least it doesn't find it.
So i switched to findAll (which works), but the problem is, that the
By-Clause i am trying to create, does not work.

How can i get A's customer Property? self and A don't work. Even if i
extend self: A with CustomerFields[A].

trait Customerize[A <: MetaMapper[A] with CustomerFields[A]] {

self: A =>

def findForCustomer(params: QueryParam[A]*): A = {
var seq = Seq(MaxRows(1))
if (!User.isAdmin_?) seq += By(self.customer, User.customerId)
self.findAll((seq ++ params): _*)
}

def findAllForCustomer(params: QueryParam[A]*): A = {
var seq = Seq()
if (!User.isAdmin_?) seq += By(self.customer, User.customerId)
self.findAll((seq ++ params): _*)
}


}


trait CustomerFields[A <: Mapper[A]] {

this: A with Mapper[A] =>

private val thisTyped = this.asInstanceOf[A]


object customer extends MappedLongForeignKey(thisTyped, Customer)
with LifecycleCallbacks {

override def dbNotNull_? = true

override def beforeCreate = {
User.currentUser match {
case Full(u: User) => 
Customer.find(By(Customer.id,
u.customer.get)) match {
case Full(c: Customer) => this(c)
case _ => Log.error("Customer *not* 
found! This shouldn't
happen!"); false
}
case _ => Log.error("User *not* found! This 
shouldn't happen!");
false
}
}

}

}

On 21 Jan., 18:47, Franz Bettag  wrote:
> I will implement it into my own MetaMapper-sub-trait so all of my
> models can share the code.
>
> Thank you all for your input!
>
> On Jan 21, 9:44 am, Jeppe Nejsum Madsen  wrote:
>
> > Naftoli Gugenheim  writes:
> > > Why not define a new method?
> > > def findByCurUser(params: QueryParam*) = User.currentUser.flatMap(user=> 
> > > find((Seq(By(User.username, user.username.is)) ++ params): _*))
> > > find returns a Box and currentUser does too, so flatMap flattens them 
> > > into one. Basically find takes a varargs and you're passing a Seq instead 
> > > using : _*, and that Seq contains the user and other params.
> > > You could probably write params + By(User.username, user.username.is) 
> > > instead of the reverse order, as it's shorter than the previous version.
>
> > The problem with this solution is that you cannot use any of Lift's
> > builtin stuff such as CRUDify.
>
> > If you wan't to create a multitenant service with only a single set of 
> > tables, you wan't do make damn
> > sure that each customer only sees his/her own data :-)
>
> > /Jeppe

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



Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 10:36 AM, Naftoli Gugenheim wrote:

> I'm curious to know the difference between returning Any or Unit, if you
> remember. Is it possible it was a bug in Scala?
>

Returning Any returns the value of the last expression in the function.
Returning Unit always returns the Unit instance.  In some places (I think
when processing Ajax forms) we take the return value from the functions and
try to determine if they are meant as JavaScript or somesuch to be sent back
to the browser.


>
> -
> David Pollak wrote:
>
> On Fri, Jan 22, 2010 at 2:22 AM, Marius  wrote:
>
> > This same thing is also touched by http://reviewboard.liftweb.net/r/184/
> > (driven by Kris' post)
> >
> > Do you agree with these following statements:
> >
> > 1. The SHtml Ajax function should return JsCmd
> >
>
> Yes.
>
>
> > 2. The SHtml non Ajax function should return a Unit instead of Any
> > (unless there are compelling reasons to keep Any)
> >
>
> There is a compelling reason to keep Any.  I can't remember it right now,
> but there is a really, really good reason (I've made the change to Unit in
> the past and it broke a pile of stuff in my applications.)
>
>
> >
> > If so I could probably make the adjustments today since I'm on that
> > defect anyways.
> >
> > Br's,
> > Marius
> >
> > On Jan 22, 5:48 am, David Pollak 
> > wrote:
> > > On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
> > >
> > > felipero.maill...@gmail.com> wrote:
> > > > That's a little better.. thanks
> > >
> > > Originally, the function returned Any... and this led to problems
> (people
> > > returning HTML, Strings, etc.)  It turns out that 95% of the time, you
> > want
> > > to do something to tell the user that the server did something (unless
> > the
> > > function sends a message to a CometActor), so using the type-system to
> > make
> > > sure Ajax functions returned JsCmds was the right answer.
> > >
> > >
> > >
> > >
> > >
> > > > greekscala wrote:
> > >
> > > >> Hello,
> > >
> > > >> know what you mean. You can use JsCmds._Noop to return "nohting" as
> > > >> JsCmd.
> > >
> > > >> best regards
> > >
> > > >> On 18 Jan., 17:25, Felipe Rodrigues 
> > > >> wrote:
> > >
> > > >>> Here is how I made it, but seems ugly:
> > >
> > > >>> SHtml.a(() => {serverSideFunction(t.text); Call("void",
> Num(0)).cmd},
> > t)
> > >
> > > >>> It is awkward having to add a JsCmd even when I don't need it.
> > >
> > > >>> Felipe
> > >
> > > >>> Naftoli Gugenheim wrote:
> > >
> > >  Never mind my question; I hadn't paid attention to the subject.
> > >   -
> > >  Felipe Rodrigues wrote:
> > >   Hi all,
> > >   I want to create a link which when clicked calls a server
> side
> > >  function.
> > >  No need for JavaScript callback.
> > >  I tried with no success:
> > >   SHtml.a(() => {serverSideFunction(t.text)}, t)
> > >   Any idea how can I accomplish that will be appreciated.
> > >   Thanks,
> > >   Felipe
> > >
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lift...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > 
> 
> >
> > >
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/liftweb?hl=en.
> > >
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> 
> >
> > .
> > For more options, visit this group at
> > http://groups.google.com/group/liftweb?hl=en.
> >
> >
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework

[Lift] Adding additional file extensions to be parsed from Req/ParsePath

2010-01-22 Thread andythedestroyer
I was working on a REST api for work yesterday didn't see a documented
way for me to have extensions other than the standard jpg/xml/json/png
extensions to be parsed from a Req. After looking though the source I
found it is easy to do with LIftRules so I thought I would post this.

in Boot.scala

// add extension for protocol buffers extension
LiftRules.explicitlyParsedSuffixes =
LiftRules.explicitlyParsedSuffixes + "proto"

Thats all.

-Andy

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



[Lift] Re: web site critique

2010-01-22 Thread cody koeninger


On Jan 21, 6:52 pm, Timothy Perrett  wrote:
> The site is not perfect, we know that... we are trying to work on it but 
> progress is slow for a variety of reasons.


If "lack of people to work on it" is one of those reasons, I'm willing
to help.

FWIW, I had no problem finding the getting started link, and found it
initially more useful than the lift book intro (although the
formatting on the first maven command could be fixed, since it wont c/
p cleanly from some browsers into a shell).

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



Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Naftoli Gugenheim
I'm curious to know the difference between returning Any or Unit, if you 
remember. Is it possible it was a bug in Scala?

-
David Pollak wrote:

On Fri, Jan 22, 2010 at 2:22 AM, Marius  wrote:

> This same thing is also touched by http://reviewboard.liftweb.net/r/184/
> (driven by Kris' post)
>
> Do you agree with these following statements:
>
> 1. The SHtml Ajax function should return JsCmd
>

Yes.


> 2. The SHtml non Ajax function should return a Unit instead of Any
> (unless there are compelling reasons to keep Any)
>

There is a compelling reason to keep Any.  I can't remember it right now,
but there is a really, really good reason (I've made the change to Unit in
the past and it broke a pile of stuff in my applications.)


>
> If so I could probably make the adjustments today since I'm on that
> defect anyways.
>
> Br's,
> Marius
>
> On Jan 22, 5:48 am, David Pollak 
> wrote:
> > On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
> >
> > felipero.maill...@gmail.com> wrote:
> > > That's a little better.. thanks
> >
> > Originally, the function returned Any... and this led to problems (people
> > returning HTML, Strings, etc.)  It turns out that 95% of the time, you
> want
> > to do something to tell the user that the server did something (unless
> the
> > function sends a message to a CometActor), so using the type-system to
> make
> > sure Ajax functions returned JsCmds was the right answer.
> >
> >
> >
> >
> >
> > > greekscala wrote:
> >
> > >> Hello,
> >
> > >> know what you mean. You can use JsCmds._Noop to return "nohting" as
> > >> JsCmd.
> >
> > >> best regards
> >
> > >> On 18 Jan., 17:25, Felipe Rodrigues 
> > >> wrote:
> >
> > >>> Here is how I made it, but seems ugly:
> >
> > >>> SHtml.a(() => {serverSideFunction(t.text); Call("void", Num(0)).cmd},
> t)
> >
> > >>> It is awkward having to add a JsCmd even when I don't need it.
> >
> > >>> Felipe
> >
> > >>> Naftoli Gugenheim wrote:
> >
> >  Never mind my question; I hadn't paid attention to the subject.
> >   -
> >  Felipe Rodrigues wrote:
> >   Hi all,
> >   I want to create a link which when clicked calls a server side
> >  function.
> >  No need for JavaScript callback.
> >  I tried with no success:
> >   SHtml.a(() => {serverSideFunction(t.text)}, t)
> >   Any idea how can I accomplish that will be appreciated.
> >   Thanks,
> >   Felipe
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


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

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

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



Re: [Lift] buildr?

2010-01-22 Thread Raoul Duke
> Don't know about buildr, but we've been using Gradle for a while. It
> comes with a Scala plugin.

ok, i think we should all admit that this is just getting funny.

:)

sincerely.

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



Re: [Lift] Re: getting started feedback

2010-01-22 Thread Naftoli Gugenheim
Other snippet naming conventions or options are:
- The model name is singular and the snippet name is plural
- The snippet class is name XXXOps (for operations?)
- Same name, but use a "partially qualified name." E.g., 
mypackage.snippet.Author can import mypackage.model and refer to model.Author 
with no ambiguity
- Same name but import with an alias:
  import mypackage.model.{Author => MAuthor}
- Combination: import model aliased as "m," then refer to "m.Author."


-
greekscala wrote:

Hello,

I had the same problems too. There is a free book on Lift
http://groups.google.com/group/the-lift-book this should be
able to give you a good overview.

best regards

On 22 Jan., 07:37, The Trav  wrote:
> Ok, so I'm trying out the lift framework, went through the guide
> without too much trouble.  Had a few points that threw me a bit.
>
> The biggest one is probably having a snippet named TD and a model
> named ToDo.
> It seems to me like it's trying to work around namespace collisions
> and/or potential confusion over namespaces, I think it would probably
> be a better idea to address that explicitly.
>
> What do people generally do for naming snippets?  Is naming them after
> the Model the exception rather than the rule?
>
> Another thing that got me was that it didn't address adding new pages
> past index.html which strikes me as somewhat incomplete...  After
> reading the getting started guide, I feel I'm going to have to find
> another document or two (or three) before I can do any meaningful work
> with the framework.
>
> Other than those two suggestions I found it a pretty good
> introduction, the framework is definitely pretty neat, and I like the
> mvn integration for getting started, very handy

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

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



Re: [Lift] buildr?

2010-01-22 Thread Timothy Perrett
Alex,

Can I suggest you distill your own learning onto the wiki? 

Cheers, Tim

On 22 Jan 2010, at 01:51, Alex Boisvert wrote:

> On Thu, Jan 21, 2010 at 5:17 PM, David Pollak  
> wrote:
> 
> 
> On Thu, Jan 21, 2010 at 5:03 PM, Raoul Duke  wrote:
> hi,
> 
> >> whatever came of buildr for lift? i haven't stumbled across the answer
> >> googling yet, but i'm still checking...
> >
> > We're not going to support Buildr for Lift.  Adding Ruby into the mix is a
> > non-starter from my perspective.  There is increasing sbt support for
> > Lift-based projects.
> 
> thanks for the info. i will go read up on sbt now!
> 
> [i saw your older response about disliking the ruby runtime -- i was
> wondering if anybody else had done a buildr branch nevertheless :-)
> e.g. http://github.com/aboisvert/liftweb# (and i wonder if jruby
> mitigates your ruby runtime concerns at all).]
> 
> Jruby is yet another download, install, configuration.  Making Lift as easy 
> as possible to get started with and keep going with is the priority.  Maven 
> gives us this.  Yes, the one line you have to copy/paste is a bear, but once 
> you've typed that, things work remarkably well with Maven.  Having to install 
> Jruby, is yet another barrier, yet another thing to support, etc.  
> 
>  i'm not arguing for use of buildr with lift, just providing 
> information 
> 
> buildr now has an all-in-one distribution (which uses jruby on the inside) 
> and requires no more install/configuration steps than maven.  granted, if you 
> already use maven, it's an extra step.
> 
> there's also an all-in-one-jar in the works which will make buildr even 
> easier to install and use.  this should be available soon after jruby 1.5.0 
> is out.
> 
> i use buildr + lift on a regular basis and find it a pleasant alternative to 
> maven.  if other people want to use buildr with lift, i'm happy to share and 
> help them out.
> 
> cheers,
> alex
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.

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



Re: [Lift] Welcome Jeppe to the Lift committers

2010-01-22 Thread Indrajit Raychaudhuri

Cool. Welcome on board Jeppe!

On 22/01/10 10:17 PM, Timothy Perrett wrote:

Massively overdue welcome Jeppe!


+1



What are you hoping to contribute to Lift?

Cheers, Tim

On 22 Jan 2010, at 16:25, David Pollak wrote:


Folks,

Please join me in welcoming Jeppe as a Lift Committer. He's been
helping people on the Lift list and contributing his thoughts to the
Lift community for a while... now it's time for him to contribute code
to Lift. Hooorraaayyy!

Thanks,

David

--
Lift, the simply functional web framework http://liftweb.net

Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

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


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


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



Re: [Lift] Welcome Jeppe to the Lift committers

2010-01-22 Thread Heiko Seeberger
Howdy!

On Friday, January 22, 2010, David Pollak  wrote:
> Folks,
>
> Please join me in welcoming Jeppe as a Lift Committer.  He's been helping 
> people on the Lift list and contributing his thoughts to the Lift community 
> for a while... now it's time for him to contribute code to Lift.  
> Hooorraaayyy!
>
> Thanks,
>
> David
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
>

-- 
Heiko Seeberger

Work: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net

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



Re: [Lift] Welcome Jeppe to the Lift committers

2010-01-22 Thread Timothy Perrett
Massively overdue welcome Jeppe!

What are you hoping to contribute to Lift?

Cheers, Tim

On 22 Jan 2010, at 16:25, David Pollak wrote:

> Folks,
> 
> Please join me in welcoming Jeppe as a Lift Committer.  He's been helping 
> people on the Lift list and contributing his thoughts to the Lift community 
> for a while... now it's time for him to contribute code to Lift.  
> Hooorraaayyy!
> 
> Thanks,
> 
> David
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.

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



Re: [Lift] Welcome Jeppe to the Lift committers

2010-01-22 Thread Ross Mellgren
welcome Jeppe!

-Ross

On Jan 22, 2010, at 11:25 AM, David Pollak wrote:

> Folks,
> 
> Please join me in welcoming Jeppe as a Lift Committer.  He's been helping 
> people on the Lift list and contributing his thoughts to the Lift community 
> for a while... now it's time for him to contribute code to Lift.  
> Hooorraaayyy!
> 
> Thanks,
> 
> David
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Surf the harmonics
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.

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



Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 2:22 AM, Marius  wrote:

> This same thing is also touched by http://reviewboard.liftweb.net/r/184/
> (driven by Kris' post)
>
> Do you agree with these following statements:
>
> 1. The SHtml Ajax function should return JsCmd
>

Yes.


> 2. The SHtml non Ajax function should return a Unit instead of Any
> (unless there are compelling reasons to keep Any)
>

There is a compelling reason to keep Any.  I can't remember it right now,
but there is a really, really good reason (I've made the change to Unit in
the past and it broke a pile of stuff in my applications.)


>
> If so I could probably make the adjustments today since I'm on that
> defect anyways.
>
> Br's,
> Marius
>
> On Jan 22, 5:48 am, David Pollak 
> wrote:
> > On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
> >
> > felipero.maill...@gmail.com> wrote:
> > > That's a little better.. thanks
> >
> > Originally, the function returned Any... and this led to problems (people
> > returning HTML, Strings, etc.)  It turns out that 95% of the time, you
> want
> > to do something to tell the user that the server did something (unless
> the
> > function sends a message to a CometActor), so using the type-system to
> make
> > sure Ajax functions returned JsCmds was the right answer.
> >
> >
> >
> >
> >
> > > greekscala wrote:
> >
> > >> Hello,
> >
> > >> know what you mean. You can use JsCmds._Noop to return "nohting" as
> > >> JsCmd.
> >
> > >> best regards
> >
> > >> On 18 Jan., 17:25, Felipe Rodrigues 
> > >> wrote:
> >
> > >>> Here is how I made it, but seems ugly:
> >
> > >>> SHtml.a(() => {serverSideFunction(t.text); Call("void", Num(0)).cmd},
> t)
> >
> > >>> It is awkward having to add a JsCmd even when I don't need it.
> >
> > >>> Felipe
> >
> > >>> Naftoli Gugenheim wrote:
> >
> >  Never mind my question; I hadn't paid attention to the subject.
> >   -
> >  Felipe Rodrigues wrote:
> >   Hi all,
> >   I want to create a link which when clicked calls a server side
> >  function.
> >  No need for JavaScript callback.
> >  I tried with no success:
> >   SHtml.a(() => {serverSideFunction(t.text)}, t)
> >   Any idea how can I accomplish that will be appreciated.
> >   Thanks,
> >   Felipe
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > liftweb+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/liftweb?hl=en.
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Surf the harmonics
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


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

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



[Lift] Welcome Jeppe to the Lift committers

2010-01-22 Thread David Pollak
Folks,

Please join me in welcoming Jeppe as a Lift Committer.  He's been helping
people on the Lift list and contributing his thoughts to the Lift community
for a while... now it's time for him to contribute code to Lift.
Hooorraaayyy!

Thanks,

David

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

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



[Lift] Re: getting started feedback

2010-01-22 Thread greekscala
Hello,

I had the same problems too. There is a free book on Lift
http://groups.google.com/group/the-lift-book this should be
able to give you a good overview.

best regards

On 22 Jan., 07:37, The Trav  wrote:
> Ok, so I'm trying out the lift framework, went through the guide
> without too much trouble.  Had a few points that threw me a bit.
>
> The biggest one is probably having a snippet named TD and a model
> named ToDo.
> It seems to me like it's trying to work around namespace collisions
> and/or potential confusion over namespaces, I think it would probably
> be a better idea to address that explicitly.
>
> What do people generally do for naming snippets?  Is naming them after
> the Model the exception rather than the rule?
>
> Another thing that got me was that it didn't address adding new pages
> past index.html which strikes me as somewhat incomplete...  After
> reading the getting started guide, I feel I'm going to have to find
> another document or two (or three) before I can do any meaningful work
> with the framework.
>
> Other than those two suggestions I found it a pretty good
> introduction, the framework is definitely pretty neat, and I like the
> mvn integration for getting started, very handy

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



Re: [Lift] Mindless work...

2010-01-22 Thread Indrajit Raychaudhuri
Sorry for the delay in response. Have been swamped with work activities 
in last couple of days.


On 22/01/10 2:22 AM, David Pollak wrote:

Folks,

It's looking like Scala 2.8 RC8 will become 2.8 Beta1 on Tuesday.

I'd like to get the Lift 2.8 branch up to date (and keep it up to date)
with the 2.0-SNAPSHOT branch as well as getting continuous builds on
Hudson and deployment in the scala-tools.org 
snapshots directory.

I think our best bet to get the 2.8 branch up to date with 2.0-SNAPSHOT
is to restart the port based on the work that Heiko is doing:
http://github.com/dpp/liftweb/issues#issue/292


Right, so the current intent is create another branch off master with 
irc_issue_292 merged in and restart the port from there. Those that 
don't work are being marked with 'FIXME 280'.




I have time to do the mindless work of doing the port tonight (my brain
will explode if it has to think, but mindless is okay).

So:

* Heiko -- how far along is the stuff in issue 292?  Is this code on
  the irc_issue_292 branch? Can I work on this branch tonight?


Issue 292 has been updated to add in some more stuff. Accordingly, 
irc_issue_292 is done and ready for RB blessing. I'll update the package 
structure for examples in course of the night. So, yes, feel free to 
work on irc_issue_292 or wait for it to (hopefully) merge to master and 
work off it.



* Indrajit -- Do you have the multi-thingy pom.xml stuff set up so
  we can build a 2.7.7 version and a 2.8 version with different
  names (2.0-SNAPSHOT and 2.0_S28-SNAPSHOT) from the same source
  tree?  What's the timing for getting Hudson all prepared?


Maven config is ready in my local branch. Once irc_issue_292 is merged 
to master I'll push this to github and have the hudson ready. I'll do it 
after the committers' call tonight.




Thanks,

David (who is very serious about making Lift on Scala 2.8 very successful)


Yay!



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


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


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



[Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Marius
This same thing is also touched by http://reviewboard.liftweb.net/r/184/
(driven by Kris' post)

Do you agree with these following statements:

1. The SHtml Ajax function should return JsCmd
2. The SHtml non Ajax function should return a Unit instead of Any
(unless there are compelling reasons to keep Any)

If so I could probably make the adjustments today since I'm on that
defect anyways.

Br's,
Marius

On Jan 22, 5:48 am, David Pollak 
wrote:
> On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues <
>
> felipero.maill...@gmail.com> wrote:
> > That's a little better.. thanks
>
> Originally, the function returned Any... and this led to problems (people
> returning HTML, Strings, etc.)  It turns out that 95% of the time, you want
> to do something to tell the user that the server did something (unless the
> function sends a message to a CometActor), so using the type-system to make
> sure Ajax functions returned JsCmds was the right answer.
>
>
>
>
>
> > greekscala wrote:
>
> >> Hello,
>
> >> know what you mean. You can use JsCmds._Noop to return "nohting" as
> >> JsCmd.
>
> >> best regards
>
> >> On 18 Jan., 17:25, Felipe Rodrigues 
> >> wrote:
>
> >>> Here is how I made it, but seems ugly:
>
> >>> SHtml.a(() => {serverSideFunction(t.text); Call("void", Num(0)).cmd}, t)
>
> >>> It is awkward having to add a JsCmd even when I don't need it.
>
> >>> Felipe
>
> >>> Naftoli Gugenheim wrote:
>
>  Never mind my question; I hadn't paid attention to the subject.
>       -
>  Felipe Rodrigues wrote:
>       Hi all,
>       I want to create a link which when clicked calls a server side
>  function.
>  No need for JavaScript callback.
>  I tried with no success:
>       SHtml.a(() => {serverSideFunction(t.text)}, t)
>       Any idea how can I accomplish that will be appreciated.
>       Thanks,
>       Felipe
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics

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



[Lift] getting started feedback

2010-01-22 Thread The Trav
Ok, so I'm trying out the lift framework, went through the guide
without too much trouble.  Had a few points that threw me a bit.

The biggest one is probably having a snippet named TD and a model
named ToDo.
It seems to me like it's trying to work around namespace collisions
and/or potential confusion over namespaces, I think it would probably
be a better idea to address that explicitly.

What do people generally do for naming snippets?  Is naming them after
the Model the exception rather than the rule?

Another thing that got me was that it didn't address adding new pages
past index.html which strikes me as somewhat incomplete...  After
reading the getting started guide, I feel I'm going to have to find
another document or two (or three) before I can do any meaningful work
with the framework.


Other than those two suggestions I found it a pretty good
introduction, the framework is definitely pretty neat, and I like the
mvn integration for getting started, very handy

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



[Lift] Re: [lift] [scala-internals] RC8 candidate for the first 2.8.0 beta

2010-01-22 Thread muskovin

When compiling in intellij I now get the following error:
I get this with the RC8 build and the nightly builds.
I didn't get this with build r20423.




Information:Compilation completed with 13 errors and 0 warnings
Information:13 errors
Information:0 warnings
Error:Scalac internal error: class
java.lang.reflect.InvocationTargetException
[sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25),
java.lang.reflect.Method.invoke(Method.java:597),
org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)][scala.tools.nsc.Settings.BooleanSetting(Settings.scala:281),
scala.tools.nsc.ScalacSettings$class.$init$(Settings.scala:822),
scala.tools.nsc.Settings.(Settings.scala:15),
scala.tools.nsc.Main$.process(Main.scala:49),
scala.tools.nsc.Main$.main(Main.scala:124),
scala.tools.nsc.Main.main(Main.scala),
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25),
java.lang.reflect.Method.invoke(Method.java:597),
org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)]
Error:sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Error:sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Error:java.lang.reflect.Method.invoke(Method.java:597)
Error:org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)
Error:Caused by java.lang.NoSuchMethodError:
scala.Function2.tupled()Lscala/Function1;
Error:scala.tools.nsc.Settings.BooleanSetting(Settings.scala:281)
Error:scala.tools.nsc.ScalacSettings$class.$init$(Settings.scala:822)
Error:scala.tools.nsc.Settings.(Settings.scala:15)
Error:scala.tools.nsc.Main$.process(Main.scala:49)
Error:scala.tools.nsc.Main$.main(Main.scala:124)
Error:scala.tools.nsc.Main.main(Main.scala)
-- 
View this message in context: 
http://old.nabble.com/Re%3A--scala-internals--RC8-candidate-for-the-first-2.8.0-beta-tp27262766p27269188.html
Sent from the liftweb mailing list archive at Nabble.com.

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



[Lift] Re: web site critique

2010-01-22 Thread Randinn
I would say you got that response because of your perceived attitude
in your previous post.

my $.02..

On Jan 22, 11:34 am, Raoul Duke  wrote:
> hi,
>
> On Thu, Jan 21, 2010 at 4:32 PM, David Pollak
>
>  wrote:
> > On Thu, Jan 21, 2010 at 4:29 PM, Raoul Duke  wrote:
> >>http://liftweb.net/download.html
> >> needs to tell me what (tf :-) to do next if i /do/ have mvn installed
> >> already.
> >http://liftweb.net/docs/getting_started.html
>
> i sincerely believe this response hilights the problem: you see what
> you know is already there, and fail to think like a total outsider
> coming to use the site. the link should be in the 'if you already have
> mvn installed' text in the body of the page as well as just at the top
> in the 'menu'.
>
> $0.02.

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



Re: [Lift] buildr?

2010-01-22 Thread Jeppe Nejsum Madsen
Raoul Duke  writes:

> whatever came of buildr for lift? i haven't stumbled across the answer
> googling yet, but i'm still checking...
>
> thanks.

Don't know about buildr, but we've been using Gradle for a while. It
comes with a Scala plugin.

It doesn't have the nice interactive features as sbt, but imo does a
very nice job if you're looking into more advanced build automation
scenarios...


/Jeppe

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