[Lift] Re: Scope issues with CometActors

2009-08-28 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 feeder.of.the.be...@gmail.com
 wrote:

 lift:comet type=YourCometClass name={person_number} /
 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 sur...@gmail.com 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] 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: This is the official support channel for Lift

2009-07-10 Thread Spencer Uresk

    - GitHub... don't message me on GitHub.  None of the Lift committer will
    pull from your repository.  The Lift IP is clean which means that unless 
 you
    are a committer and you have written the code yourself, it doesn't get into
    Lift.  This allows businesses to use Lift knowing what the provenance of 
 the
    code is.

Sorry if I'm being dense, but does this include patches for small
enhancements and bug fixes?

For example, I posted a message on the list about some limitations in
the Mailer configuration. I made some small modifications to the class
so that it works better in shared vm environments, but I'd like to see
those changes (or at least similar functionality) make it back into
Lift because 1) I think it would be useful to other people, and 2)
maintaining my own Mailer for all my projects causes a maintenance
penalty that I'm interested in not paying in the long term. What is
the best thing I can do to help make that happen? In most communities
I've been involved with in the past, the answer is Submit a patch!,
but it appears that may not be the case here.

And FYI - the Mailer issue isn't really that critical, I'm just using
it as an example.

Thanks,

- 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: Scala job site written in Lift + a newcomer's experience

2009-07-08 Thread Spencer Uresk
Thanks!

The hosting experience is quite good - since it just results in a WAR, I was
able to drop it onto my dedicated server that runs a single Tomcat instance
with a bunch of Grails and plain Java web apps. It only took a few minutes
to setup and deploy. I really thought it would be fun to host it on Google's
App Engine, and I even had a Lift + JPA app working on there just fine, but
I decided I really wanted to leverage the authentication features in Mapper
and that prevented me from sticking with GAE.

The one problem I did run into was getting the Mailer to work properly. In
development, I just set the system properties needed to connect to google
apps for sending mail in the Boot class and didn't think anything of it.
Then when I went to deploy, I realized that Tomcat's security policy
wouldn't let me set those properties and it would be a bad idea anyway since
those would be shared across all apps. Fortunately, none of my other apps do
anything with email so I just set the properties in Tomcat's configuration
and it worked fine, but Mailer in the lift-util package really needs to be
modified to be able to use a jndi-based JavaMail session and/or ad-hoc
configuration instead of always relying on the system properties. Hopefully
I can get some time this weekend to work on that and submit a patch.

- Spencer

On Wed, Jul 8, 2009 at 1:40 AM, DFectuoso santiago1...@gmail.com wrote:



 Just joining the crowd saying Kudos! Great job!

 How is your hosting experience btw?

 


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



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

2009-07-06 Thread Spencer Uresk

Thanks, Marius.

The design was created by my designer - my design skills are
unbelievably terrible. I don't think she'd do the Lift site for free
(the one for the job site cost me a few hundred bucks), but if you
send me details of what you want, I may be able to work something out.
No promises though.

BTW - The book that you, Derek, and Tyler wrote was immensely helpful.

- Spencer

On Jul 6, 1:33 am, marius d. marius.dan...@gmail.com wrote:
 First of all, thank you for you kind words. Your website is just great
 but I'd recommend publishing the link on sc...@listes.epfl.ch as well.

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

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

 Br's,
 Marius

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

  Hey all,

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

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

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

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

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

 http://www.scalacareers.com/

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

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

  - Spencer



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



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

2009-07-06 Thread Spencer Uresk

Tyler,

Thanks, will do.

Choosing a good domain that isn't taken is one of the hardest parts of
building a new web application for me, and seeing good domains being
held onto without being used is particularly frustrating. I was
disappointed to see that scalajobs.com was already taken, although it
looks like the person who has registered it did so with the intent of
making a job site with it and just hasn't. I can empathize with that -
I've registered domains in the past and then not had enough time to
finish the site or got bored of it.

Feel free to point scala-jobs.com to it, if you'd like.

- Spencer

On Jul 6, 5:53 am, TylerWeir tyler.w...@gmail.com wrote:
 @spencer:

 Add a comment to this 
 thread:http://www.nabble.com/Scala-programmers-in-US--td24331451.html

 I registered scala-jobs.com (it appears someone is basically squating
 on scalajobs.com) thinking that I would put together a job board as
 well.

 If you don't mind, I'll point scala-jobs.com to your site.

 Ty

 On Jul 6, 5:17 am, Ellis ellis.whiteh...@gmail.com wrote:

  Nice. :)

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

   Hey all,

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

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

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

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

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

  http://www.scalacareers.com/

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

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

   - Spencer



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



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

2009-07-06 Thread Spencer Uresk

Mark,

Yes, I absolutely plan on writing some short tutorials once I feel a
little more comfortable with my knowledge in the area. I could also
release the code once I get it cleaned up a bit, if people think that
it would be useful or interesting having it as another Lift sample.

- Spencer

On Jul 6, 7:20 am, Mark Essel mes...@gmail.com wrote:
 If there was a way I could get an upload of your recent scala/lift
 knowledge I'd be much appreciated. Any chance you'll create some
 tutorials on the making of Spencer? I signed up on the site.
 I'm working on a project that matches social media status, user
 profile history, and eventually their influential social graph members
 to contextual nonintrusive ads.
 I've had to create the shell in php just to get a prototype working
 but I prefer building it in scala w/ lift (had some netbeans ant build
 issues with plain scala libs).

 On Jul 6, 12:36 am, Spencer Uresk sur...@gmail.com wrote:

  Hey all,

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

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

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

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

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

 http://www.scalacareers.com/

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

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

  - Spencer



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



[Lift] Re: Getting the generated id from a mapper instance

2009-07-05 Thread Spencer Uresk

Yep, it appears that was the mistake I somehow made.

Thanks!

- Spencer

On Jul 4, 2009, at 6:21 PM, Peter Robinett wrote:


 I think I got the same thing once before when referring to the
 companion object (singleton) instead of my specific instance. Perhaps
 you're doing the same thing?

 Peter Robinett

 On Jul 4, 2:14 am, Spencer Uresk sur...@gmail.com wrote:
 I'm having a bit of trouble with a mapper class I'm trying to make.
 Everything is working fine, except that I cannot get the id of the
 newly-saved class - it always returns the default value (-1L). Here  
 is
 what my class looks like:

 object Job extends Job with LongKeyedMetaMapper[Job] {

 }

 class Job extends LongKeyedMapper[Job] with IdPK {
 .. fields here...

 }

 Here is the save code I am trying:

 job.save
 Log.info(JOB ID:  + job.id)

 I've also tried:

 job.save
 val newJob = job.reload
 Log.info(JOB ID: + newJob.id)

 I'm using mySQL 5.1.

 Any ideas on why I'm never seeing the generated key, and what the
 correct approach would be?

 Thanks,

 - 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] Scala job site written in Lift + a newcomer's experience

2009-07-05 Thread Spencer Uresk

Hey all,

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

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

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

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

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

http://www.scalacareers.com/

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

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

- Spencer



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



[Lift] Getting the generated id from a mapper instance

2009-07-04 Thread Spencer Uresk

I'm having a bit of trouble with a mapper class I'm trying to make.  
Everything is working fine, except that I cannot get the id of the  
newly-saved class - it always returns the default value (-1L). Here is  
what my class looks like:

object Job extends Job with LongKeyedMetaMapper[Job] {

}

class Job extends LongKeyedMapper[Job] with IdPK {
.. fields here...
}

Here is the save code I am trying:

job.save
Log.info(JOB ID:  + job.id)

I've also tried:

job.save
val newJob = job.reload
Log.info(JOB ID: + newJob.id)

I'm using mySQL 5.1.

Any ideas on why I'm never seeing the generated key, and what the  
correct approach would be?

Thanks,

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