[Lift] No Navigation Defined in menu snippet

2009-07-06 Thread Kevin Wright
I have two webapps, hosted on the same server:
http://lsug.org/main/
http://lsug.org/stage/

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

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

Is this a known issue?

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



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

2009-07-06 Thread marius d.

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

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

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

Br's,
Marius

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

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

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

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

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

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

 http://www.scalacareers.com/

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

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

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Timothy Perrett

Wow, that really is strange!

Can you please post your sitemap? What version of Lift are you using?

Cheers, Tim

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

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

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

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



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

2009-07-06 Thread Timothy Perrett

Yeah if you have a designer which would be prepared to donate their
time for free then we would very much like to speak with them! Our
problem is getting creative time for free (as we are obviously a not
for profit outfit).

If we can get the design done (even just PSD or whatever) then we im
more than happy to get that into a working site - this is actually
something I want to do (rebuild the site) for 1.1... right now we just
need a designer.

Cheers, Tim

 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?

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



[Lift] Re: How to test/TDD lift apps?

2009-07-06 Thread Jeppe Nejsum Madsen

On Fri, Jul 3, 2009 at 6:43 PM, David
Pollakfeeder.of.the.be...@gmail.com wrote:
 Jeppe,

 Once I check in some code (in about 20 minutes), if you run Lift in Test
 mode (-Drun.mode=test), forms, etc. will have stable names which makes
 testing easier.

Thanks. I just tried this, and it seem something is not correct.
Here's a form field genrated by CRUDify:

input  name=f01000_a0f86e3b78187b55b8628a66fb3371113ddc295c
type=text maxlength=2 value=DK lift:field_name=vehicle:country
/

Firefox 3.5 complains about lift:field attribute.

Looking at the changes (and the example above) it seems that the field
name is still some psuedo random number. While this is better than
names changing between each request, I'm wondering if it's stable to
reordering  removing fields (my guess is no). It would be nice not to
change test cases just because we rearrange the form layout.

Moving forward, I'm not sure what the best solution is. I seem able to
specify the id attribute for forms that I create manually, but need
this also on CRUDify and other generated forms (and looking at the
above example, it seems it should be easy to eg. use the field_name).
In general, It would be nice for Lift to handle all this automatically
(as you've already started out to do), but if I have to add some
additional markup to make sure ids/names stay stable, I will prefer
that over test cases breaking if field ordering is changed.

/Jeppe

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Tobias Daub

Don't know if this is an accident, but since yesterday I'm getting this 
error too (and I didn't touched Boot.scala)?


 I have two webapps, hosted on the same server:
 http://lsug.org/main/
 http://lsug.org/stage/

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

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

 Is this a known issue?

 


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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Kevin Wright
sitemap is defined here:

http://github.com/kevinwright/lsug-website/blob/b3141386cb019cf11fc7eb985cce11e204086139/src/main/scala/bootstrap/liftweb/Boot.scala

using Lift 1.1-M1
There was some issue with 1.1-SNAPSHOT when I tried it about a week ago, I
forget what exactly


On Mon, Jul 6, 2009 at 8:58 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Wow, that really is strange!

 Can you please post your sitemap? What version of Lift are you using?

 Cheers, Tim

 On Jul 6, 8:17 am, Kevin Wright kev.lee.wri...@googlemail.com wrote:
  I have two webapps, hosted on the same server:
 http://lsug.org/main/http://lsug.org/stage/
 
  Problem is, the menu works just fine on the stage site, but not on the
 main
  site.
  Which is odd, as these sites should be identical.  I just renamed
 stage.war
  to main.war and let tomcat auto-deploy it
 
  The site is using tomcat 6 via apache 2 (with mod_jk proxying)
  The problem also appears if I access tomcat directly (i.e. not via
 apache)
 
  Is this a known issue?
 


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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

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

Br's,
Marius

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

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

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

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Kevin Wright
FWIW, I've had this error for a while now.  It looked like the virtual host
config was guilty at one point, and I also went through a phase of thinking
that it only occurred if I accessed the page via jk2 before hitting tomcat
directly (still not ruled that one out)

Various restarts and other bits of mucking around seemed to fix it then, but
I'm not entirely sure how.  It does look as though the problem persists once
it has occurred, so I'm wondering if it's something to do with the work
directory, or persisted session.

Switching to Jetty didn't seem to fix it either.



On Mon, Jul 6, 2009 at 8:54 AM, Tobias Daub hannes.flo...@gmx.li wrote:


 Don't know if this is an accident, but since yesterday I'm getting this
 error too (and I didn't touched Boot.scala)?


  I have two webapps, hosted on the same server:
  http://lsug.org/main/
  http://lsug.org/stage/
 
  Problem is, the menu works just fine on the stage site, but not on the
  main site.
  Which is odd, as these sites should be identical.  I just renamed
  stage.war to main.war and let tomcat auto-deploy it
 
  The site is using tomcat 6 via apache 2 (with mod_jk proxying)
  The problem also appears if I access tomcat directly (i.e. not via
 apache)
 
  Is this a known issue?
 
  


 


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



[Lift] Anyone out there using SBT?

2009-07-06 Thread Timothy Perrett

Hey Guys,

Is anyone out there using SBT for their lift projects? if so, how are
you finding it?

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Kevin Wright
Interesting... yes it does

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


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

 Br's,
 Marius

 On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:
  I have two webapps, hosted on the same server:
 http://lsug.org/main/http://lsug.org/stage/
 
  Problem is, the menu works just fine on the stage site, but not on the
 main
  site.
  Which is odd, as these sites should be identical.  I just renamed
 stage.war
  to main.war and let tomcat auto-deploy it
 
  The site is using tomcat 6 via apache 2 (with mod_jk proxying)
  The problem also appears if I access tomcat directly (i.e. not via
 apache)
 
  Is this a known issue?
 


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



[Lift] Re: Anyone out there using SBT?

2009-07-06 Thread Kevin Wright
Single Bullet Theory, or Swedish Bikini Team ?


On Mon, Jul 6, 2009 at 10:07 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Hey Guys,

 Is anyone out there using SBT for their lift projects? if so, how are
 you finding it?

 Cheers, Tim
 


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



[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread Ellis

Hi Eric,

Here are a few comments and suggestions.

- Honestly, I don't think that lift and scala are the right places for
you to start out.  The systems are very powerful, but relatively new,
and so they are still geared towards more experienced programmers.
- You'll need more than a month to become comfortable with an entirely
new programming environment.
- The java toolset can be confusing.  Try NetBeans; it's easier to
understand than Eclipse.
- An e-commerce program would take years to get right, but if that's
what inspires you, you might want to focus on just small parts of such
a program instead.

Cheers,
Ellis


On Jul 6, 5:13 am, eric cs eeri...@gmail.com wrote:
 Hi guys,

 I saw some posts on Scala website about helping newcomers and I was
 wondering if some of you would be kind enough to help me out to start
 with Scala/Lift.
 My main problem is I am not a programmer yet but I really really want
 to be, I've been studying Ruby/Rails, Php/Zend/Symfony,Mvc,Design
 Patterns,Uml,Sql and some Java. I read some books but I don't get my
 head to think like a programer.
 I really like OO,Design Patterns, Uml but I don't know how to apply
 that to a full application, how to link everything together,
 classes,objects(books about that?Not about those items but how to put
 everything together)...I know a lot of the theory and concepts but no
 practice.
 I have all july available to learn that 12 hours a day or more if
 necessary I just need a push, someone to teach/help me out.
 What's more, I saw a post saying that I could learn Scala from scratch
 without learning Java, it's possible, not so much with Groovy. If it's
 not what parts of Java do I need to know, in case some of you tell me
 learn Java first(the easy answer).Do I need a lot of experience in
 Java to jump in in Scala? I know it helps but I would like to finish
 my first e-commerce in august, 100% opensource in Scala if possible.

 P.s:I did 2 years of Computer Science C++ and 2 years of Civil
 Engineering over 12 years ago both unfinished.

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

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: Anyone out there using SBT?

2009-07-06 Thread Timothy Perrett

No, I was thinking more about Simple Build Tool ;-)

http://code.google.com/p/simple-build-tool/

Cheers, Tim

On Jul 6, 10:09 am, Kevin Wright kev.lee.wri...@googlemail.com
wrote:
 Single Bullet Theory, or Swedish Bikini Team ?

--~--~-~--~~~---~--~~
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: Becoming a Scala/Lift Guru

2009-07-06 Thread Viktor Klang
I say: Go Eric go!

Nothing is impossible with the right attitude!

On Mon, Jul 6, 2009 at 12:17 PM, Timothy Perrett timo...@getintheloop.euwrote:


 Ellis,

 Im afraid I disagree with you - Eric does not state what type of
 eComerce application he wants to create... IMO, this is very
 subjective. Lift ships out of the box with PayPal integration - one
 could say that a site which allows a user to pay via paypal is
 eCommerce... would you disagree?

 If Eric takes on advice from the Lift Book and perhaps a learning
 scala book like DPP's, then asks lift related questions on here when
 he needs specific help im sure he'll be fine... everyone has to start
 somewhere and saying Lift is only appropriate for hardcore programmers
 because its a new framework is wrong IMHO.

 Eric, good luck to you - the lift community is a great place to start
 your programming endeavors; you probably have a slightly steeper
 learning curve than most, but provided you have grit and determination
 there is nothing to say you will not reach your goals. Think
 positive.

 Cheers, Tim

 On Jul 6, 10:13 am, Ellis ellis.whiteh...@gmail.com wrote:
  Hi Eric,
 
  Here are a few comments and suggestions.
 
  - Honestly, I don't think that lift and scala are the right places for
  you to start out.  The systems are very powerful, but relatively new,
  and so they are still geared towards more experienced programmers.
  - You'll need more than a month to become comfortable with an entirely
  new programming environment.
  - The java toolset can be confusing.  Try NetBeans; it's easier to
  understand than Eclipse.
  - An e-commerce program would take years to get right, but if that's
  what inspires you, you might want to focus on just small parts of such
  a program instead.
 
  Cheers,
  Ellis
 
  On Jul 6, 5:13 am, eric cs eeri...@gmail.com wrote:
 
 
 
   Hi guys,
 
   I saw some posts on Scala website about helping newcomers and I was
   wondering if some of you would be kind enough to help me out to start
   with Scala/Lift.
   My main problem is I am not a programmer yet but I really really want
   to be, I've been studying Ruby/Rails, Php/Zend/Symfony,Mvc,Design
   Patterns,Uml,Sql and some Java. I read some books but I don't get my
   head to think like a programer.
   I really like OO,Design Patterns, Uml but I don't know how to apply
   that to a full application, how to link everything together,
   classes,objects(books about that?Not about those items but how to put
   everything together)...I know a lot of the theory and concepts but no
   practice.
   I have all july available to learn that 12 hours a day or more if
   necessary I just need a push, someone to teach/help me out.
   What's more, I saw a post saying that I could learn Scala from scratch
   without learning Java, it's possible, not so much with Groovy. If it's
   not what parts of Java do I need to know, in case some of you tell me
   learn Java first(the easy answer).Do I need a lot of experience in
   Java to jump in in Scala? I know it helps but I would like to finish
   my first e-commerce in august, 100% opensource in Scala if possible.
 
   P.s:I did 2 years of Computer Science C++ and 2 years of Civil
   Engineering over 12 years ago both unfinished.
 



-- 
Viktor Klang
Scala Loudmouth

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



[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread Eric Bowman

To this I would add:

The way to learn to program, is to program.  It takes a lot of time, and
a lot of hard work.  Reading books is good, and necessary, but it's not
enough.

Also, Lift really uses Scala to the max, so if you only have 30 days, I
would plan to spend the first half just becoming good at Scala.  Which
will take longer than 15 days!

Anyhow, being a guru is a life ambition.  It takes time, time, time
and more time.  All your time.  A history of unfinished is going to
work against you -- this will take serious dedication and stick-to-it-ness.

An insightful view from Google's Director of Research:
http://norvig.com/21-days.html


Naftoli Gugenhem wrote:
 I would say that the main advantage knowledge of Java over a similar language 
 gives you is knowledge of the Java environment and system, but you can pick 
 that up via scala too.
 As far as turning theory into actual programming, my personal advice is to 
 take one small sample, get it running, and then ask yourself questions like 
 Why does it do this? and What if I change this. Once you have a thorough 
 understanding of how the sample accomplishes what it was supposed to 
 accomplish, and how all the parts contribute to that, repeat with another 
 one. Along the way ask yourself, What if I want the computer to do xyz 
 (similar to sample x)? Also, play around in the interpreter trying different 
 permutations.
 Of course, it goes without saying to read the books and articles, not to 
 mention to ask all your questions on the scala-user list.
 Enjoy!

 -
 eric cseeri...@gmail.com wrote:


 Hi guys,

 I saw some posts on Scala website about helping newcomers and I was
 wondering if some of you would be kind enough to help me out to start
 with Scala/Lift.
 My main problem is I am not a programmer yet but I really really want
 to be, I've been studying Ruby/Rails, Php/Zend/Symfony,Mvc,Design
 Patterns,Uml,Sql and some Java. I read some books but I don't get my
 head to think like a programer.
 I really like OO,Design Patterns, Uml but I don't know how to apply
 that to a full application, how to link everything together,
 classes,objects(books about that?Not about those items but how to put
 everything together)...I know a lot of the theory and concepts but no
 practice.
 I have all july available to learn that 12 hours a day or more if
 necessary I just need a push, someone to teach/help me out.
 What's more, I saw a post saying that I could learn Scala from scratch
 without learning Java, it's possible, not so much with Groovy. If it's
 not what parts of Java do I need to know, in case some of you tell me
 learn Java first(the easy answer).Do I need a lot of experience in
 Java to jump in in Scala? I know it helps but I would like to finish
 my first e-commerce in august, 100% opensource in Scala if possible.

 P.s:I did 2 years of Computer Science C++ and 2 years of Civil
 Engineering over 12 years ago both unfinished.



 
   


-- 
Eric Bowman
Boboco Ltd
ebow...@boboco.ie
http://www.boboco.ie/ebowman/pubkey.pgp
+35318394189/+353872801532


--~--~-~--~~~---~--~~
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] Mapper: How to clone object fields?

2009-07-06 Thread Jeppe Nejsum Madsen

Hi,

What is the best way to copy values from one mapped object to another
(of the same type). The code below seems to work but I was wondering if
there's a better way?

  def insertOrUpdate(v:Vehicle) = Vehicle.find(By(vin, v.vin.is)) match {
  case Full(existing) = {
existing.getSingleton.mappedFields.foreach (f = v.fieldByName(f.name) 
match {
  case Full(field) if (!field.dbPrimaryKey_?) =  
f.asInstanceOf[MappedField[Any, 
Vehicle]].setFromAny(field.asInstanceOf[MappedField[Any, Vehicle]].is);
  case _ = 
  }
)
existing.save
existing
}
  case _ = v.save; v

/Jeppe

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



[Lift] Re: How to test/TDD lift apps?

2009-07-06 Thread Naftoli Gugenhem

I would like if in general you would be able to specify input names and have 
lift use those. Maybe FuncHolders could take an optional param?

-
Jeppe Nejsum Madsenje...@ingolfs.dk wrote:


On Fri, Jul 3, 2009 at 6:43 PM, David
Pollakfeeder.of.the.be...@gmail.com wrote:
 Jeppe,

 Once I check in some code (in about 20 minutes), if you run Lift in Test
 mode (-Drun.mode=test), forms, etc. will have stable names which makes
 testing easier.

Thanks. I just tried this, and it seem something is not correct.
Here's a form field genrated by CRUDify:

input  name=f01000_a0f86e3b78187b55b8628a66fb3371113ddc295c
type=text maxlength=2 value=DK lift:field_name=vehicle:country
/

Firefox 3.5 complains about lift:field attribute.

Looking at the changes (and the example above) it seems that the field
name is still some psuedo random number. While this is better than
names changing between each request, I'm wondering if it's stable to
reordering  removing fields (my guess is no). It would be nice not to
change test cases just because we rearrange the form layout.

Moving forward, I'm not sure what the best solution is. I seem able to
specify the id attribute for forms that I create manually, but need
this also on CRUDify and other generated forms (and looking at the
above example, it seems it should be easy to eg. use the field_name).
In general, It would be nice for Lift to handle all this automatically
(as you've already started out to do), but if I have to add some
additional markup to make sure ids/names stay stable, I will prefer
that over test cases breaking if field ordering is changed.

/Jeppe



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



[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread Timothy Perrett

Ellis,

Im afraid I disagree with you - Eric does not state what type of
eComerce application he wants to create... IMO, this is very
subjective. Lift ships out of the box with PayPal integration - one
could say that a site which allows a user to pay via paypal is
eCommerce... would you disagree?

If Eric takes on advice from the Lift Book and perhaps a learning
scala book like DPP's, then asks lift related questions on here when
he needs specific help im sure he'll be fine... everyone has to start
somewhere and saying Lift is only appropriate for hardcore programmers
because its a new framework is wrong IMHO.

Eric, good luck to you - the lift community is a great place to start
your programming endeavors; you probably have a slightly steeper
learning curve than most, but provided you have grit and determination
there is nothing to say you will not reach your goals. Think
positive.

Cheers, Tim

On Jul 6, 10:13 am, Ellis ellis.whiteh...@gmail.com wrote:
 Hi Eric,

 Here are a few comments and suggestions.

 - Honestly, I don't think that lift and scala are the right places for
 you to start out.  The systems are very powerful, but relatively new,
 and so they are still geared towards more experienced programmers.
 - You'll need more than a month to become comfortable with an entirely
 new programming environment.
 - The java toolset can be confusing.  Try NetBeans; it's easier to
 understand than Eclipse.
 - An e-commerce program would take years to get right, but if that's
 what inspires you, you might want to focus on just small parts of such
 a program instead.

 Cheers,
 Ellis

 On Jul 6, 5:13 am, eric cs eeri...@gmail.com wrote:



  Hi guys,

  I saw some posts on Scala website about helping newcomers and I was
  wondering if some of you would be kind enough to help me out to start
  with Scala/Lift.
  My main problem is I am not a programmer yet but I really really want
  to be, I've been studying Ruby/Rails, Php/Zend/Symfony,Mvc,Design
  Patterns,Uml,Sql and some Java. I read some books but I don't get my
  head to think like a programer.
  I really like OO,Design Patterns, Uml but I don't know how to apply
  that to a full application, how to link everything together,
  classes,objects(books about that?Not about those items but how to put
  everything together)...I know a lot of the theory and concepts but no
  practice.
  I have all july available to learn that 12 hours a day or more if
  necessary I just need a push, someone to teach/help me out.
  What's more, I saw a post saying that I could learn Scala from scratch
  without learning Java, it's possible, not so much with Groovy. If it's
  not what parts of Java do I need to know, in case some of you tell me
  learn Java first(the easy answer).Do I need a lot of experience in
  Java to jump in in Scala? I know it helps but I would like to finish
  my first e-commerce in august, 100% opensource in Scala if possible.

  P.s:I did 2 years of Computer Science C++ and 2 years of Civil
  Engineering over 12 years ago both unfinished.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Kevin Wright
Marius, should I be thinking that you have a theory on this one?


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

 Interesting... yes it does


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


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

 Br's,
 Marius

 On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:
  I have two webapps, hosted on the same server:
 http://lsug.org/main/http://lsug.org/stage/
 
  Problem is, the menu works just fine on the stage site, but not on the
 main
  site.
  Which is odd, as these sites should be identical.  I just renamed
 stage.war
  to main.war and let tomcat auto-deploy it
 
  The site is using tomcat 6 via apache 2 (with mod_jk proxying)
  The problem also appears if I access tomcat directly (i.e. not via
 apache)
 
  Is this a known issue?
 



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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

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

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


Br's,
Marius

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

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

  Interesting... yes it does

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

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

  Br's,
  Marius

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

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

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

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

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

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

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

 Br's,
 Marius

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

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

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

   Interesting... yes it does

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

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

   Br's,
   Marius

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

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

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

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread marius d.

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

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

Br's,
Marius

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

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

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

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

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

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

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

   Br's,
   Marius

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

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

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

 Interesting... yes it does

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

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

 Br's,
 Marius

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

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

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

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



[Lift] Rendering breakdown on Safari

2009-07-06 Thread Kjetil Valstadsve

Hi folks,

I have an obscure problem with rendering on Safari (both 3 and 4). I
get the same behavior using 1.1-M1 and 1.1-M3.

When I initiate any ajaxy traffic, be it a text field, a checkbox or a
drop-down, the entire content area literally collapses onto itself.
From what I can tell it happens upon the ajax call's return.  By
content I refer to the typical getting-started code with
lift:surround with=default at=content.

Visually, it appears as if all structuring caves in, and all the text
is printed as if everything were a single paragraph. No inputs are
visible, though e.g. the current values of drop-downs are shown.
Contents of text fields are not visible. Interestingly, the effect of
the ajax call has taken place - for instance, if I decrease a value
that limits the number of items to show in a list, the list is indeed
shorter in the miserably collapsed rendering. And, after issuing a
reload, everything returns to normal. Click on a checkbox again, and
everything collapses yet again.

I have tried various changes to tease out the cause, but nothing has
helped - moving it all back to index.html, removing all but a few
ajaxed components, dropping the login/logout menu items - but it is
really consistent. I wish I could get so predictable web app
development every day.

HTML-wise, the browser claims to be showing the exact same HTML before
and after the click, which is expected behavior. (At least Firefox
does it too.) After the reload, when things are showing as they
should, the HTML has updated all the id's of the ajaxified components.
Again, this is the behavior I see in other browsers. Everything looks
normal server-side as well, every request takes comparable amounts of
time across browsers etc.

I don't have an in-depth analysis yet, nor an example that isolates
the problem, at this stage I am just throwing it out hoping others may
have seen it, and/or solved it.

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread Kevin Wright
Thanks for your ongoing efforts :)

If you want to test with the LSUG app, feel free to grab it from github:
http://github.com/kevinwright/lsug-website/tree/master


Just to clarify, I'm working with continuous deplyment here.  The stage site
gets auto-deployed following a successful hudson build (and hudson is in
turn triggered by changes to the underlying source code).  If no problems
exist in staging then I can very quickly promote it to the main site (by
copying the war)

I really don't want to have any differences between the two apps (such as
package names), I don't even want for them to be produced by different
builds against the same source as this defeats much of the point in running
staged deployments.

Although it isn't so vital for LSUG, If I'm to successfully evangelise Lift
to my employers then I also need for this pattern to work on commercial
sites, where it is much more important that I can guarantee the production
site is identical to the site that passed user testing...



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


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

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

 Br's,
 Marius

 On Jul 6, 2:32 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
  I agree with your thinking that this looks like a classloading issue, but
  haven't (yet) tried any clever optimisations here :)
  The only shared jars are those supplied by default via java/tomcat.  When
 I
  get a moment though, it might be worth checking for the usual culprits
  (commons-logging, etc).
 
  I didn't try to read back the sitemap in my code, it's just two
 statically
  defined locs (see the source on github).  I can certainly attempt the
  readback for troubleshooting purposes, but still not sure how this can
 help
  us track down the issue if it fails...
 
  Context paths are not explicitly set, no custom context.xml files,
 nothing
  special in tomcat whatsoever - the two war files are auto-deployed and
 are
  identical (apart from their names, obviously)
 
  On Mon, Jul 6, 2009 at 12:18 PM, marius d. marius.dan...@gmail.com
 wrote:
 
   Oh btw. did you explicitly set the context path for each app ?
 
   On Jul 6, 2:09 pm, marius d. marius.dan...@gmail.com wrote:
Looks like there is an influence there but it should really not be
since each web application is loaded by a separate classloader.
 
1. Do you have any jars that these webapps are sharing?
2. If you put some logs in Boot do you see the logs correctly? ... If
you call LiftRules.siteMap after you set the siteMap gdo you get back
the right SiteMap ?
 
Br's,
Marius
 
On Jul 6, 1:35 pm, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:
 
 Marius, should I be thinking that you have a theory on this one?
 
 On Mon, Jul 6, 2009 at 9:55 AM, Kevin Wright
 kev.lee.wri...@googlemail.comwrote:
 
  Interesting... yes it does
 
  On Mon, Jul 6, 2009 at 9:51 AM, marius d. 
 marius.dan...@gmail.com
   wrote:
 
  And if you deploy onlyhttp://lsug.org/main/does it work
 correctly?
 
  Br's,
  Marius
 
  On Jul 6, 10:17 am, Kevin Wright kev.lee.wri...@googlemail.com
 
  wrote:
   I have two webapps, hosted on the same server:
 http://lsug.org/main/http://lsug.org/stage/
 
   Problem is, the menu works just fine on the stage site, but
 not on
   the
  main
   site.
   Which is odd, as these sites should be identical.  I just
 renamed
  stage.war
   to main.war and let tomcat auto-deploy it
 
   The site is using tomcat 6 via apache 2 (with mod_jk proxying)
   The problem also appears if I access tomcat directly (i.e. not
 via
  apache)
 
   Is this a known issue?
 


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



[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread eric cs

Guys,
Thank you very much for all your answers.
Having a community like that, I know is half way there for anyone.
I am very very very eager to learn, that's my number one priorite
right now and the e-commerce is an example to work with some real
application and apply logic and a database to learn how put the
classes together.
It's not a hobbie I found another passion in my life besides my wife,
my dog, my music and it's web programming.
I like it all since css,ajax to actionscript to back side languages
and the logic behind it.That's why I quit Civil Engineering and move
to Computer Science years ago, but some stuff happens yada,yada.yada,
here I am several years later trying to learn again.
I feel better and more prepared than before and without distractions.
I said a month but I have all the time in my hands right now so it
could be until 2010 if necessary, full time. I wish I could work doing
something like this sometime.
Before I even learn scala, I have to get the logic how to create an
app first in my head, like which items would an object and they will
related to each other then to a database,it's not about create a
simple program only,abstract,it's about how to put all little
programns together to create something, in this case could be an e-
commerce.Then I could learn the advanced concepts of Scala, functional
programming and stuff like that.
Maybe an e-commerce has a lot of logic involved is a good start to get
my head around programming web apps with that example.
I don't know if you guys understand what I meant,what I need to learn
first, but even a book that explains that would be good, I read some
books about design patterns and stuff but none of them applied in a
real application.
It's not even regular regular programming logic, I need to learn like
how a put a app in a modular way, one thing on top of eachother, I
don't know it that's the way to think about that, how classes will
interact with eachother,Interfaces.
Anyway, keep your advices coming and in case you know a book that
explains that would be awesome.
Thanks again.



wat
On Jul 6, 6:01 am, Eric Bowman ebow...@boboco.ie wrote:
 To this I would add:

 The way to learn to program, is to program.  It takes a lot of time, and
 a lot of hard work.  Reading books is good, and necessary, but it's not
 enough.

 Also, Lift really uses Scala to the max, so if you only have 30 days, I
 would plan to spend the first half just becoming good at Scala.  Which
 will take longer than 15 days!

 Anyhow, being a guru is a life ambition.  It takes time, time, time
 and more time.  All your time.  A history of unfinished is going to
 work against you -- this will take serious dedication and stick-to-it-ness.

 An insightful view from Google's Director of 
 Research:http://norvig.com/21-days.html





 Naftoli Gugenhem wrote:
  I would say that the main advantage knowledge of Java over a similar 
  language gives you is knowledge of the Java environment and system, but you 
  can pick that up via scala too.
  As far as turning theory into actual programming, my personal advice is to 
  take one small sample, get it running, and then ask yourself questions like 
  Why does it do this? and What if I change this. Once you have a 
  thorough understanding of how the sample accomplishes what it was supposed 
  to accomplish, and how all the parts contribute to that, repeat with 
  another one. Along the way ask yourself, What if I want the computer to do 
  xyz (similar to sample x)? Also, play around in the interpreter trying 
  different permutations.
  Of course, it goes without saying to read the books and articles, not to 
  mention to ask all your questions on the scala-user list.
  Enjoy!

  -
  eric cseeri...@gmail.com wrote:

  Hi guys,

  I saw some posts on Scala website about helping newcomers and I was
  wondering if some of you would be kind enough to help me out to start
  with Scala/Lift.
  My main problem is I am not a programmer yet but I really really want
  to be, I've been studying Ruby/Rails, Php/Zend/Symfony,Mvc,Design
  Patterns,Uml,Sql and some Java. I read some books but I don't get my
  head to think like a programer.
  I really like OO,Design Patterns, Uml but I don't know how to apply
  that to a full application, how to link everything together,
  classes,objects(books about that?Not about those items but how to put
  everything together)...I know a lot of the theory and concepts but no
  practice.
  I have all july available to learn that 12 hours a day or more if
  necessary I just need a push, someone to teach/help me out.
  What's more, I saw a post saying that I could learn Scala from scratch
  without learning Java, it's possible, not so much with Groovy. If it's
  not what parts of Java do I need to know, in case some of you tell me
  learn Java first(the easy answer).Do I need a lot of experience in
  Java to jump in in Scala? I know it helps but I would like to finish
  my first 

[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: Rendering breakdown on Safari

2009-07-06 Thread Kjetil Valstadsve

It's fairly generic, but I can't ship any of our data. So I will fork
it and provide a copy that exposes the issue with some mock data.

Kjetil

On Jul 6, 4:12 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 I have not seen this problem (although I've seen a couple of other Safari 4
 related issues... especially in SVG).

 If you want to privately send me a copy of your project I'll see if I can
 reproduce the issue.  If your project is proprietary, I can sign an NDA.  If
 there is an issue with Lift and Safari 4, I want to make sure it gets fixed
 ASAP.

 On Mon, Jul 6, 2009 at 5:09 AM, Kjetil Valstadsve valstad...@gmail.comwrote:







  Hi folks,

  I have an obscure problem with rendering on Safari (both 3 and 4). I
  get the same behavior using 1.1-M1 and 1.1-M3.

  When I initiate any ajaxy traffic, be it a text field, a checkbox or a
  drop-down, the entire content area literally collapses onto itself.
  From what I can tell it happens upon the ajax call's return.  By
  content I refer to the typical getting-started code with
  lift:surround with=default at=content.

  Visually, it appears as if all structuring caves in, and all the text
  is printed as if everything were a single paragraph. No inputs are
  visible, though e.g. the current values of drop-downs are shown.
  Contents of text fields are not visible. Interestingly, the effect of
  the ajax call has taken place - for instance, if I decrease a value
  that limits the number of items to show in a list, the list is indeed
  shorter in the miserably collapsed rendering. And, after issuing a
  reload, everything returns to normal. Click on a checkbox again, and
  everything collapses yet again.

  I have tried various changes to tease out the cause, but nothing has
  helped - moving it all back to index.html, removing all but a few
  ajaxed components, dropping the login/logout menu items - but it is
  really consistent. I wish I could get so predictable web app
  development every day.

  HTML-wise, the browser claims to be showing the exact same HTML before
  and after the click, which is expected behavior. (At least Firefox
  does it too.) After the reload, when things are showing as they
  should, the HTML has updated all the id's of the ajaxified components.
  Again, this is the behavior I see in other browsers. Everything looks
  normal server-side as well, every request takes comparable amounts of
  time across browsers etc.

  I don't have an in-depth analysis yet, nor an example that isolates
  the problem, at this stage I am just throwing it out hoping others may
  have seen it, and/or solved it.

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

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



[Lift] Re: Anyone out there using SBT?

2009-07-06 Thread TylerWeir

n8's dispatch uses it nicely:
http://databinder.net/dispatch/About

On Jul 6, 10:09 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Mon, Jul 6, 2009 at 2:07 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:



  Hey Guys,

  Is anyone out there using SBT for their lift projects? if so, how are
  you finding it?

 I plan to play with an SBT based project later this week.



  Cheers, Tim

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



[Lift] Using AJAX calls in Lift Snippets

2009-07-06 Thread Gonzalo N

Hello!

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

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

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

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

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

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

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

Regards,
Gonzalo N

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



[Lift] Re: Anyone out there using SBT?

2009-07-06 Thread Timothy Perrett


This is exactly why I've started looking at it because I was generally
impressed by the way he uses it.

Maven is totally the right tool for lift project management, and im not
suggesting moving that or anything, but im considering having a lift
archetype that uses SBT so people have the choice when developing their
applications.

Cheers, Tim

On 06/07/2009 15:38, TylerWeir tyler.w...@gmail.com wrote:

 n8's dispatch uses it nicely:
 http://databinder.net/dispatch/About



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



[Lift] Re: Using AJAX calls in Lift Snippets

2009-07-06 Thread marius d.



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

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

 }

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

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

 }

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


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

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

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

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

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



[Lift] Trigger object creation to send message to actor

2009-07-06 Thread Tobias Daub

Hi List,

I wanna send a message to an Actor everytime a new row is created in a 
specific table. The Actor is responsible to refresh a HTML page and 
display all the items from the table.

How do I do that?



thanks.

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



[Lift] Re: Using AJAX calls in Lift Snippets

2009-07-06 Thread Gonzalo N

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

Best regards,
Gonzalo N

On Jul 6, 3:56 pm, marius d. marius.dan...@gmail.com wrote:
 On Jul 6, 5:44 pm, Gonzalo N gonn...@gmail.com wrote:



  Hello!

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

  }

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

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

  }

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



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

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

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

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

  Regards,
  Gonzalo N

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



[Lift] Lift application startup problem:failed LiftFilter

2009-07-06 Thread Mike Maul

After making changes to move from SNAPSHOT-1.0 to SHAPSHOT-1.1
maven is refusing to start the LiftFilter

Also since the 'loan' patterns seemed to go away is the
LiftSession.onBeginServicing/endServicing an approiate place for
instantiating my JPA entity manager?

2009-07-06 10:42:00.703::WARN:  failed LiftFilter
java.lang.VerifyError: (class: net/liftweb/util/EmptyBox, method: open_
$bang signature: ()Ljava/lang/Object;) Can only throw Throwable
objects
at net.liftweb.http.LiftRules$.init(LiftRules.scala:231)
at net.liftweb.http.LiftRules$.clinit(LiftRules.scala)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:528)
at org.mortbay.jetty.servlet.FilterHolder.doStart
(FilterHolder.java:97)

Boot.scala
package bootstrap.liftweb

import _root_.net.liftweb.util._
import _root_.net.liftweb.http._
import _root_.net.liftweb.sitemap._
import _root_.net.liftweb.sitemap.Loc._
import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier,
DefaultConnectionIdentifier, ConnectionIdentifier}
import java.sql.{Connection, DriverManager}
import com.test.model.Model
import com.test.model.User
import com.test.model.Conv1w

/**
  * A class that's instantiated early and run.  It allows the
application
  * to modify lift's environment
  */
class Boot {
  def boot {
if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager
(DefaultConnectionIdentifier, DBVendor)
// where to search snippet
LiftRules.addToPackages(com.viper)

Schemifier.schemify(true, Log.infoF _, User, Conv1w)

 val entries = Menu(Loc(Home, List(index), Home)) ::
  Menu(Loc(Home, List(index),
Home)) ::
  Menu(Loc(Manage.2, List(manage,locations),
Manage Locations)) ::
  Menu(Loc(Manage.2.1, List(manage,addLocation),
Add Locations)) ::
  Menu(Loc(Manage.2.2,List(manage,editLocation),
Edit Locations)) ::
  Menu(Loc(Manage.2.3,List(manage,delete),
Delete Locations)) ::
  Menu(Loc(Manage.3,List(manage,edit),
Edit)) :: Nil

LiftRules.setSiteMap(SiteMap(entries:_*))

LiftSession.onBeginServicing = DBFactory.beginServicing _ ::
LiftSession.onBeginServicing

LiftSession.onEndServicing = DBFactory.endServicing _ ::
LiftSession.onEndServicing
  }
}


object DBVendor extends ConnectionManager {
  def newConnection(name: ConnectionIdentifier): Box[Connection] = {
try {
  Class.forName(org.postgresql.Driver)
  val dm = DriverManager.getConnection(jdbc:postgresql://
localhost/?user=)
  Full(dm)
} catch {
  case e : Exception = e.printStackTrace; Empty
}
  }
  def releaseConnection(conn: Connection) {conn.close}
}
object DBFactory {
 def beginServicing(session: LiftSession, req: Req) {
val em = Model.factory.createEntityManager()

  // Add EM into S scope
  Model.emVar.set(em)

  }

  def endServicing(session: LiftSession, req: Req,
   response: Box[LiftResponse]) {
Model.em.close()
  }
}


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



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

2009-07-06 Thread glenn

Thanks all for your comments on this issue. Based on what you've
written,
it seems that normal file io works fine in Lift as long as you don't
try to
affect the exploded war file in the process. In my case, I just simply
used XML.loadFile and XML.saveFull from scala directly, pointing to
a directory outside the war.

Thanks again for the help.



On Jul 5, 9:08 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 The broader issue is that how a WAR file is exploded (converted from WAR/Zip
 format to an on-disk representation) is a servlet-container specific issue.

 Putting an XML file in your WAR and reading from it is totally cool.  The
 abstraction that Marius pointed to is the correct one... and more generally,
 using Class.getResource is the way to find something in the WAR or JAR.

 Writing to something in your WAR is going to present all manner of problems
 including the above-mentioned servlet-container related issues as well as
 issues about being over-written on re-deployment.

 If you're looking to have an XML-based persistence mechanism, I'd suggest
 putting the full path to the XML store in your props file (there's a props
 file per user, per host, and per run-mode, so there's lots of possibilities)
 and use that to look for props.  Alternatively, put something in a dot
 directory that lives in the launching user's home directory (like Maven's
 .m2 directory) so it's in a well known location.

 On Sun, Jul 5, 2009 at 2:01 PM, Naftoli Gugenhem naftoli...@gmail.comwrote:





  My point was to help him diagnose his file not found, not to know where the
  server is storing his app. I assume he is using relative paths and they may
  not be relative to where they should be.

  -
  Timothy Perretttimo...@getintheloop.eu wrote:

  If you need to get the absolute path where the exploded war is living,
  you can get that via ServletContext I do believe. Generally speaking,
  Lift provides no mechanism for writing stuff to the filesystem and
  does not interfere with file i/o.

  Cheers, Tim

  On Jul 5, 9:15 pm, Naftoli Gugenhem naftoli...@gmail.com wrote:
   Why would lift interfere with file io? Resource server is probably for
  static http. If you're getting file not found I can't imagine it's lift's
  fault. Try dumping new java.io.File(.).listFiles() or .getAbsolutePath
  etc. to see what directory is the default. What kind of server are you
  using?

   -

   glenngl...@exmbly.com wrote:

   Thanks, Marius.

   Now, is there something similar for writing XML to a file. I saw
   nothing on LiftRules that
   seems to apply.

   Glenn...

   On Jul 4, 12:36 am, marius d. marius.dan...@gmail.com wrote:

Try LiftRules.loadResourceAsXml

Br's,
Marius

On Jul 4, 1:11 am, glenn gl...@exmbly.com wrote:

 I've searched this group and combed through the lift book for an
 answer, but found none - how to use file-based storage for data
  within
 Lift.

 For example, how would I call something like:

 def xml = XML.loadFile(fileName)

 without getting a java.io.FileNotFoundException?

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

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

     })

 But that doesn't work.

 Any help would be appreciated.

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

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



[Lift] Re: Lift application startup problem:failed LiftFilter

2009-07-06 Thread David Pollak
You have to make sure you update your pom.xml file to use Scala 2.7.4 with
Lift 1.1

Thanks,

David

On Mon, Jul 6, 2009 at 8:17 AM, Mike Maul mike.m...@gmail.com wrote:


 After making changes to move from SNAPSHOT-1.0 to SHAPSHOT-1.1
 maven is refusing to start the LiftFilter

 Also since the 'loan' patterns seemed to go away is the
 LiftSession.onBeginServicing/endServicing an approiate place for
 instantiating my JPA entity manager?

 2009-07-06 10:42:00.703::WARN:  failed LiftFilter
 java.lang.VerifyError: (class: net/liftweb/util/EmptyBox, method: open_
 $bang signature: ()Ljava/lang/Object;) Can only throw Throwable
 objects
at net.liftweb.http.LiftRules$.init(LiftRules.scala:231)
at net.liftweb.http.LiftRules$.clinit(LiftRules.scala)
at net.liftweb.http.LiftFilter.init(LiftServlet.scala:528)
at org.mortbay.jetty.servlet.FilterHolder.doStart
 (FilterHolder.java:97)
 
 Boot.scala
 package bootstrap.liftweb

 import _root_.net.liftweb.util._
 import _root_.net.liftweb.http._
 import _root_.net.liftweb.sitemap._
 import _root_.net.liftweb.sitemap.Loc._
 import _root_.net.liftweb.mapper.{DB, ConnectionManager, Schemifier,
 DefaultConnectionIdentifier, ConnectionIdentifier}
 import java.sql.{Connection, DriverManager}
 import com.test.model.Model
 import com.test.model.User
 import com.test.model.Conv1w

 /**
  * A class that's instantiated early and run.  It allows the
 application
  * to modify lift's environment
  */
 class Boot {
  def boot {
if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager
 (DefaultConnectionIdentifier, DBVendor)
// where to search snippet
LiftRules.addToPackages(com.viper)

Schemifier.schemify(true, Log.infoF _, User, Conv1w)

 val entries = Menu(Loc(Home, List(index), Home)) ::
  Menu(Loc(Home, List(index),
Home)) ::
  Menu(Loc(Manage.2, List(manage,locations),
Manage Locations)) ::
  Menu(Loc(Manage.2.1, List(manage,addLocation),
Add Locations)) ::
  Menu(Loc(Manage.2.2,List(manage,editLocation),
Edit Locations)) ::
  Menu(Loc(Manage.2.3,List(manage,delete),
Delete Locations)) ::
  Menu(Loc(Manage.3,List(manage,edit),
Edit)) :: Nil

LiftRules.setSiteMap(SiteMap(entries:_*))

LiftSession.onBeginServicing = DBFactory.beginServicing _ ::
LiftSession.onBeginServicing

LiftSession.onEndServicing = DBFactory.endServicing _ ::
LiftSession.onEndServicing
  }
 }


 object DBVendor extends ConnectionManager {
  def newConnection(name: ConnectionIdentifier): Box[Connection] = {
try {
  Class.forName(org.postgresql.Driver)
  val dm = DriverManager.getConnection(jdbc:postgresql://
 localhost/?user=)
  Full(dm)
} catch {
  case e : Exception = e.printStackTrace; Empty
}
  }
  def releaseConnection(conn: Connection) {conn.close}
 }
 object DBFactory {
  def beginServicing(session: LiftSession, req: Req) {
val em = Model.factory.createEntityManager()

  // Add EM into S scope
  Model.emVar.set(em)

  }

  def endServicing(session: LiftSession, req: Req,
   response: Box[LiftResponse]) {
Model.em.close()
  }
 }


 



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

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



[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread David Pollak
Eric,

It seems that you want to hike the Appalachain Trail
http://www.appalachiantrail.org/site/c.mqLTIYOwGlF/b.4805859/k.BFA3/Home.htmat
marathon speeds.  I'm not sure it can be done.  It took me 18 months with
Scala before I felt comfortable with it and my learning curve with new
languages is pretty good (it took 2 weeks to get comfortable with Ruby and 3
months before I felt that I had mastered it.)  I do not yet consider myself
a Scala guru, although I consider myself very skilled with it.

All of us have different learning styles, but I'm not sure that your goal of
understanding object hierarchies before sitting down to code is one that I'd
recommend.

I'd suggest playing with small pieces and getting them to work for you.
Perhaps the following order might be a starting place:

   - Install Scala 2.7.5 and just play with the REPL (the interactive
   interpreter.)  This will give you a good feeling of what can be done with
   Scala.  See how data can be manipulated. (3 or 4 days... perhaps assisted by
   *Beginning Scala*.)
   - Install Maven on your machine and create the Lift hello world app:
   http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp (1 to 2
   days... also use a normal text editor, not an IDE... installing IDEs can be
   a rats nest of problems... TextMate for the Mac is the best choice, but vi
   or emacs are also good if you already know them.)
   - Run through the ToDo example in Lift (5 or 6 days)

By this point, you should have a bucket full of questions.  Ask them.  Ask
them as your going.  Ask them when you get to breaking points.

As you're spending your two weeks touring through Scala and Lift, start
thinking about what you want to build.  Think from the UI back (that tends
to be the easiest for most people... then think about how to interact with
something and then go backward from it.)  Scala allows for better
composition of application (using smaller parts to make bigger
functionality rather than thinking about gross level object abstractions).
So, draw your UI on a piece of paper and then start writing down what pieces
each UI component needs.  You should be able to build a simple, piece by
piece screen that does what you want it to.  Once you've got it working,
think about how to combine and normalize pieces of functionality.

As always, we're here for you.  The Lift community will help you, but we ask
that you document your learning (perhaps via blog or wiki or Twitter) so
others have the benefit of the work you've done.

Thanks,

David

On Mon, Jul 6, 2009 at 6:14 AM, eric cs eeri...@gmail.com wrote:


 Guys,
 Thank you very much for all your answers.
 Having a community like that, I know is half way there for anyone.
 I am very very very eager to learn, that's my number one priorite
 right now and the e-commerce is an example to work with some real
 application and apply logic and a database to learn how put the
 classes together.
 It's not a hobbie I found another passion in my life besides my wife,
 my dog, my music and it's web programming.
 I like it all since css,ajax to actionscript to back side languages
 and the logic behind it.That's why I quit Civil Engineering and move
 to Computer Science years ago, but some stuff happens yada,yada.yada,
 here I am several years later trying to learn again.
 I feel better and more prepared than before and without distractions.
 I said a month but I have all the time in my hands right now so it
 could be until 2010 if necessary, full time. I wish I could work doing
 something like this sometime.
 Before I even learn scala, I have to get the logic how to create an
 app first in my head, like which items would an object and they will
 related to each other then to a database,it's not about create a
 simple program only,abstract,it's about how to put all little
 programns together to create something, in this case could be an e-
 commerce.Then I could learn the advanced concepts of Scala, functional
 programming and stuff like that.
 Maybe an e-commerce has a lot of logic involved is a good start to get
 my head around programming web apps with that example.
 I don't know if you guys understand what I meant,what I need to learn
 first, but even a book that explains that would be good, I read some
 books about design patterns and stuff but none of them applied in a
 real application.
 It's not even regular regular programming logic, I need to learn like
 how a put a app in a modular way, one thing on top of eachother, I
 don't know it that's the way to think about that, how classes will
 interact with eachother,Interfaces.
 Anyway, keep your advices coming and in case you know a book that
 explains that would be awesome.
 Thanks again.



 wat
 On Jul 6, 6:01 am, Eric Bowman ebow...@boboco.ie wrote:
  To this I would add:
 
  The way to learn to program, is to program.  It takes a lot of time, and
  a lot of hard work.  Reading books is good, and necessary, but it's not
  enough.
 
  Also, Lift really uses Scala to 

[Lift] Re: Using AJAX calls in Lift Snippets

2009-07-06 Thread marius d.

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

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

{println(pressed); JsCmds.Noop}}

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

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

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

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

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

}),

But the idea is:

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

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


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

Br's,
Marius

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

 Best regards,
 Gonzalo N

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

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

   Hello!

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

   }

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

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

   }

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

[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread Wilson MacGyver

I would echo David's comment. Scala is a powerful language with high
complexity budget. I think it's important to learn the fundamentals of
Scala first and build on top of it.

On Mon, Jul 6, 2009 at 11:52 AM, David
Pollakfeeder.of.the.be...@gmail.com wrote:
 Eric,

 It seems that you want to hike the Appalachain Trail at marathon speeds.
 I'm not sure it can be done.  It took me 18 months with Scala before I felt
 comfortable with it and my learning curve with new languages is pretty good
 (it took 2 weeks to get comfortable with Ruby and 3 months before I felt
 that I had mastered it.)  I do not yet consider myself a Scala guru,
 although I consider myself very skilled with it.

 All of us have different learning styles, but I'm not sure that your goal of
 understanding object hierarchies before sitting down to code is one that I'd
 recommend.

 I'd suggest playing with small pieces and getting them to work for you.
 Perhaps the following order might be a starting place:

 Install Scala 2.7.5 and just play with the REPL (the interactive
 interpreter.)  This will give you a good feeling of what can be done with
 Scala.  See how data can be manipulated. (3 or 4 days... perhaps assisted by
 Beginning Scala.)
 Install Maven on your machine and create the Lift hello world app:
 http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp (1 to 2
 days... also use a normal text editor, not an IDE... installing IDEs can be
 a rats nest of problems... TextMate for the Mac is the best choice, but vi
 or emacs are also good if you already know them.)
 Run through the ToDo example in Lift (5 or 6 days)

 By this point, you should have a bucket full of questions.  Ask them.  Ask
 them as your going.  Ask them when you get to breaking points.

 As you're spending your two weeks touring through Scala and Lift, start
 thinking about what you want to build.  Think from the UI back (that tends
 to be the easiest for most people... then think about how to interact with
 something and then go backward from it.)  Scala allows for better
 composition of application (using smaller parts to make bigger
 functionality rather than thinking about gross level object abstractions).
 So, draw your UI on a piece of paper and then start writing down what pieces
 each UI component needs.  You should be able to build a simple, piece by
 piece screen that does what you want it to.  Once you've got it working,
 think about how to combine and normalize pieces of functionality.

 As always, we're here for you.  The Lift community will help you, but we ask
 that you document your learning (perhaps via blog or wiki or Twitter) so
 others have the benefit of the work you've done.

 Thanks,

 David

 On Mon, Jul 6, 2009 at 6:14 AM, eric cs eeri...@gmail.com wrote:

 Guys,
 Thank you very much for all your answers.
 Having a community like that, I know is half way there for anyone.
 I am very very very eager to learn, that's my number one priorite
 right now and the e-commerce is an example to work with some real
 application and apply logic and a database to learn how put the
 classes together.
 It's not a hobbie I found another passion in my life besides my wife,
 my dog, my music and it's web programming.
 I like it all since css,ajax to actionscript to back side languages
 and the logic behind it.That's why I quit Civil Engineering and move
 to Computer Science years ago, but some stuff happens yada,yada.yada,
 here I am several years later trying to learn again.
 I feel better and more prepared than before and without distractions.
 I said a month but I have all the time in my hands right now so it
 could be until 2010 if necessary, full time. I wish I could work doing
 something like this sometime.
 Before I even learn scala, I have to get the logic how to create an
 app first in my head, like which items would an object and they will
 related to each other then to a database,it's not about create a
 simple program only,abstract,it's about how to put all little
 programns together to create something, in this case could be an e-
 commerce.Then I could learn the advanced concepts of Scala, functional
 programming and stuff like that.
 Maybe an e-commerce has a lot of logic involved is a good start to get
 my head around programming web apps with that example.
 I don't know if you guys understand what I meant,what I need to learn
 first, but even a book that explains that would be good, I read some
 books about design patterns and stuff but none of them applied in a
 real application.
 It's not even regular regular programming logic, I need to learn like
 how a put a app in a modular way, one thing on top of eachother, I
 don't know it that's the way to think about that, how classes will
 interact with eachother,Interfaces.
 Anyway, keep your advices coming and in case you know a book that
 explains that would be awesome.
 Thanks again.



 wat
 On Jul 6, 6:01 am, Eric Bowman ebow...@boboco.ie wrote:
  To this I would add:
 
  The way to 

[Lift] Re: How to test/TDD lift apps?

2009-07-06 Thread David Pollak
On Mon, Jul 6, 2009 at 1:34 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:


 On Fri, Jul 3, 2009 at 6:43 PM, David
 Pollakfeeder.of.the.be...@gmail.com wrote:
  Jeppe,
 
  Once I check in some code (in about 20 minutes), if you run Lift in Test
  mode (-Drun.mode=test), forms, etc. will have stable names which makes
  testing easier.

 Thanks. I just tried this, and it seem something is not correct.
 Here's a form field genrated by CRUDify:

 input  name=f01000_a0f86e3b78187b55b8628a66fb3371113ddc295c
 type=text maxlength=2 value=DK lift:field_name=vehicle:country
 /

 Firefox 3.5 complains about lift:field attribute.


THat's very odd.  The lift namespace should be defined for the page.




 Looking at the changes (and the example above) it seems that the field
 name is still some psuedo random number.


It's not a random number, it's an algorithmically produced number based on
the stack frames below the request for the identifier.


 While this is better than
 names changing between each request, I'm wondering if it's stable to
 reordering  removing fields (my guess is no).


It's stable for reordering the fields on the page.  It's not stable for
re-ordering the calls on the server side.  Just as with all Lift's bind
stuff, the order of the field creation is the order of evaluation.  The GUID
must reflect that ordering.


 It would be nice not to
 change test cases just because we rearrange the form layout.


You can rearrange the view code without impacting the field names.



 Moving forward, I'm not sure what the best solution is. I seem able to
 specify the id attribute for forms that I create manually, but need
 this also on CRUDify and other generated forms (and looking at the
 above example, it seems it should be easy to eg. use the field_name).
 In general, It would be nice for Lift to handle all this automatically
 (as you've already started out to do), but if I have to add some
 additional markup to make sure ids/names stay stable, I will prefer
 that over test cases breaking if field ordering is changed.


If you've got suggestions that don't break Lift, I'm all ears.

Thanks,

David




 /Jeppe

 



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

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



[Lift] Re: How to test/TDD lift apps?

2009-07-06 Thread David Pollak
On Mon, Jul 6, 2009 at 3:23 AM, Naftoli Gugenhem naftoli...@gmail.comwrote:


 I would like if in general you would be able to specify input names and
 have lift use those. Maybe FuncHolders could take an optional param?


That would cause more problems than it would solve.  The names are the GUIDs
that bind the server functions.  If you manually name them, there will be
name clashes.  There will be out of order execution of functions.  It will
be a much bigger mess.




 -
 Jeppe Nejsum Madsenje...@ingolfs.dk wrote:


 On Fri, Jul 3, 2009 at 6:43 PM, David
 Pollakfeeder.of.the.be...@gmail.com wrote:
  Jeppe,
 
  Once I check in some code (in about 20 minutes), if you run Lift in Test
  mode (-Drun.mode=test), forms, etc. will have stable names which makes
  testing easier.

 Thanks. I just tried this, and it seem something is not correct.
 Here's a form field genrated by CRUDify:

 input  name=f01000_a0f86e3b78187b55b8628a66fb3371113ddc295c
 type=text maxlength=2 value=DK lift:field_name=vehicle:country
 /

 Firefox 3.5 complains about lift:field attribute.

 Looking at the changes (and the example above) it seems that the field
 name is still some psuedo random number. While this is better than
 names changing between each request, I'm wondering if it's stable to
 reordering  removing fields (my guess is no). It would be nice not to
 change test cases just because we rearrange the form layout.

 Moving forward, I'm not sure what the best solution is. I seem able to
 specify the id attribute for forms that I create manually, but need
 this also on CRUDify and other generated forms (and looking at the
 above example, it seems it should be easy to eg. use the field_name).
 In general, It would be nice for Lift to handle all this automatically
 (as you've already started out to do), but if I have to add some
 additional markup to make sure ids/names stay stable, I will prefer
 that over test cases breaking if field ordering is changed.

 /Jeppe



 



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

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



[Lift] Re: No Navigation Defined in menu snippet

2009-07-06 Thread David Pollak
My guess is that it's a corrupt database problem and there's an exception
being thrown during the processing of Boot.scala

If you've got two apps on the same app server and they are both using Derby,
it's likely that they are trying to share the same Derby files which is
causing the corruption.

So... take at look at std.out and std.err and look for Exceptions during
Boot.scala.

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

 I did see this problem running on localhost on my windows box at home.
 Not tried removing the DB yet, although that is scheduled to go.




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


 Still ... we need to get to the bottom of this ... I made a dummy app
 and deploy it under main.war and stage.war ... again everything works
 correctly (I'm on Windows currently).

 Can you make a minimalistic app (with no DB) where this problem
 reproduces and send it over? ... Can you reproduce this on you
 localhost tomcat?

 Br's,
 Marius

 On Jul 6, 3:13 pm, Kevin Wright kev.lee.wri...@googlemail.com wrote:
  Thanks for your ongoing efforts :)
 
  If you want to test with the LSUG app, feel free to grab it from github:
 http://github.com/kevinwright/lsug-website/tree/master
 
  Just to clarify, I'm working with continuous deplyment here.  The stage
 site
  gets auto-deployed following a successful hudson build (and hudson is in
  turn triggered by changes to the underlying source code).  If no
 problems
  exist in staging then I can very quickly promote it to the main site (by
  copying the war)
 
  I really don't want to have any differences between the two apps (such
 as
  package names), I don't even want for them to be produced by different
  builds against the same source as this defeats much of the point in
 running
  staged deployments.
 
  Although it isn't so vital for LSUG, If I'm to successfully evangelise
 Lift
  to my employers then I also need for this pattern to work on commercial
  sites, where it is much more important that I can guarantee the
 production
  site is identical to the site that passed user testing...
 
  On Mon, Jul 6, 2009 at 1:02 PM, marius d. marius.dan...@gmail.com
 wrote:
 
   Well I just deployed 2 different Lift apps in jetty and everything is
   working fine.
 
   Here is wild thought can you try changing the package names. I
   know it shouldn't matter but this is an awkward case still.
 
   Br's,
   Marius
 
   On Jul 6, 2:32 pm, Kevin Wright kev.lee.wri...@googlemail.com
 wrote:
I agree with your thinking that this looks like a classloading
 issue, but
haven't (yet) tried any clever optimisations here :)
The only shared jars are those supplied by default via java/tomcat.
  When
   I
get a moment though, it might be worth checking for the usual
 culprits
(commons-logging, etc).
 
I didn't try to read back the sitemap in my code, it's just two
   statically
defined locs (see the source on github).  I can certainly attempt
 the
readback for troubleshooting purposes, but still not sure how this
 can
   help
us track down the issue if it fails...
 
Context paths are not explicitly set, no custom context.xml files,
   nothing
special in tomcat whatsoever - the two war files are auto-deployed
 and
   are
identical (apart from their names, obviously)
 
On Mon, Jul 6, 2009 at 12:18 PM, marius d. marius.dan...@gmail.com
 
   wrote:
 
 Oh btw. did you explicitly set the context path for each app ?
 
 On Jul 6, 2:09 pm, marius d. marius.dan...@gmail.com wrote:
  Looks like there is an influence there but it should really
 not be
  since each web application is loaded by a separate classloader.
 
  1. Do you have any jars that these webapps are sharing?
  2. If you put some logs in Boot do you see the logs correctly?
 ... If
  you call LiftRules.siteMap after you set the siteMap gdo you get
 back
  the right SiteMap ?
 
  Br's,
  Marius
 
  On Jul 6, 1:35 pm, Kevin Wright kev.lee.wri...@googlemail.com
   wrote:
 
   Marius, should I be thinking that you have a theory on this
 one?
 
   On Mon, Jul 6, 2009 at 9:55 AM, Kevin Wright
   kev.lee.wri...@googlemail.comwrote:
 
Interesting... yes it does
 
On Mon, Jul 6, 2009 at 9:51 AM, marius d. 
   marius.dan...@gmail.com
 wrote:
 
And if you deploy onlyhttp://lsug.org/main/doesit work
   correctly?
 
Br's,
Marius
 
On Jul 6, 10:17 am, Kevin Wright 
 kev.lee.wri...@googlemail.com
 
wrote:
 I have two webapps, hosted on the same server:
   http://lsug.org/main/http://lsug.org/stage/
 
 Problem is, the menu works just fine on the stage site,
 but
   not on
 the
main
 site.
 Which is odd, as these sites should be identical.  I just
   renamed
stage.war
 to main.war and let tomcat auto-deploy it
 
 The site is using 

[Lift] Re: Anyone out there using SBT?

2009-07-06 Thread Mark Harrah

 Maven is totally the right tool for lift project management, and im not
 suggesting moving that or anything, but im considering having a lift
 archetype that uses SBT so people have the choice when developing their
 applications.

You might have already seen this, but Nathan and I did some work that
you might find useful.  In particular, I used Hello Lift as a demo of
the sbt plugin that packages a project as a
self-extracting-and-building jar.  You can check it out in the first
section of [1].

Thanks,
Mark

[1] http://code.google.com/p/simple-build-tool/wiki/SbtPlugins

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

Hi Spencer

Well done on a nice web site with a great look and feel.

I am also interested to hear how you went about implementing it in  
Lift/Scala - please let us know when you have code / how-to / guide  
etc. to share.


Kind regards

Rudi

On 06 Jul 2009, at 4:26 PM, Spencer Uresk sur...@gmail.com wrote:


 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: Becoming a Scala/Lift Guru

2009-07-06 Thread eric cs

David, awesome ideas you got there,thanks, about posting my
improvements and stuff, pretty unique really and it will helps for
future programers as well specially coming raw into Scala.
I totally agree with you, maybe Scala is too much for a new guy who
doesn't know some basic and advanced concepts or doesn't know how to
put everything together?
Totally agree there, but please tell a way, a book who will teach that
foundation that has some examples in practice as well.
I could install Scala do all that you mention but I don't know where
to go from there which itens/classes/objects should I add to start
building a app from scratch.
I am looking for some book right now, like Code Complete 2,Clean Code:
A Handbook of Agile Software Craftsmanship.
I know what a method/function is what it does, I know what a class is,
an Interface,Object,inheritance, but I can't put everything together
yet, I know some of the theory and concepts, I think I need a good
book that teaches how o put everything together.
If you guys know some...please let me know.
What's more, after that I will need to learn why scala is so
diferent,powerfull,improved from Java or Ruby in concepts,theory,way
to program and do things, in case you know a book about that too would
be awesome.

Is like a person who know what a cement is, water,tools, but doesn't
know how to construct something, with pavers some people knows what it
is but doesn't know how to pave and how some paver patterns with help
with that, he can just put random pavers on the ground because is
gonna be a mess, same thing with coding I think..hehe
Thanks.

On Jul 6, 12:00 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
 I would echo David's comment. Scala is a powerful language with high
 complexity budget. I think it's important to learn the fundamentals of
 Scala first and build on top of it.

 On Mon, Jul 6, 2009 at 11:52 AM, David





 Pollakfeeder.of.the.be...@gmail.com wrote:
  Eric,

  It seems that you want to hike the Appalachain Trail at marathon speeds.
  I'm not sure it can be done.  It took me 18 months with Scala before I felt
  comfortable with it and my learning curve with new languages is pretty good
  (it took 2 weeks to get comfortable with Ruby and 3 months before I felt
  that I had mastered it.)  I do not yet consider myself a Scala guru,
  although I consider myself very skilled with it.

  All of us have different learning styles, but I'm not sure that your goal of
  understanding object hierarchies before sitting down to code is one that I'd
  recommend.

  I'd suggest playing with small pieces and getting them to work for you.
  Perhaps the following order might be a starting place:

  Install Scala 2.7.5 and just play with the REPL (the interactive
  interpreter.)  This will give you a good feeling of what can be done with
  Scala.  See how data can be manipulated. (3 or 4 days... perhaps assisted by
  Beginning Scala.)
  Install Maven on your machine and create the Lift hello world app:
 http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp(1 to 2
  days... also use a normal text editor, not an IDE... installing IDEs can be
  a rats nest of problems... TextMate for the Mac is the best choice, but vi
  or emacs are also good if you already know them.)
  Run through the ToDo example in Lift (5 or 6 days)

  By this point, you should have a bucket full of questions.  Ask them.  Ask
  them as your going.  Ask them when you get to breaking points.

  As you're spending your two weeks touring through Scala and Lift, start
  thinking about what you want to build.  Think from the UI back (that tends
  to be the easiest for most people... then think about how to interact with
  something and then go backward from it.)  Scala allows for better
  composition of application (using smaller parts to make bigger
  functionality rather than thinking about gross level object abstractions).
  So, draw your UI on a piece of paper and then start writing down what pieces
  each UI component needs.  You should be able to build a simple, piece by
  piece screen that does what you want it to.  Once you've got it working,
  think about how to combine and normalize pieces of functionality.

  As always, we're here for you.  The Lift community will help you, but we ask
  that you document your learning (perhaps via blog or wiki or Twitter) so
  others have the benefit of the work you've done.

  Thanks,

  David

  On Mon, Jul 6, 2009 at 6:14 AM, eric cs eeri...@gmail.com wrote:

  Guys,
  Thank you very much for all your answers.
  Having a community like that, I know is half way there for anyone.
  I am very very very eager to learn, that's my number one priorite
  right now and the e-commerce is an example to work with some real
  application and apply logic and a database to learn how put the
  classes together.
  It's not a hobbie I found another passion in my life besides my wife,
  my dog, my music and it's web programming.
  I like it all since css,ajax to 

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

2009-07-06 Thread Timothy Perrett

This is a great idea IMO - if you had any suggestions on forums or
such to reach out to that would be great!

Cheers, Tim

On Jul 6, 2:34 pm, James Matlik james.mat...@gmail.com wrote:
 You could reach out to web design forums (they must exist), universities and
 the open source community at large via a competition of some kind.  The
 reward could simply be bragging rights and credit on the contributors page.
 A production web site design for a university student would be a good resume
 builder.  I've seen some competitions like this in the past where
 semi-functional mock-ups were created for a few select pages, then the
 community voted for the winner.  If you could get an advertisement for such
 a competition on Slashdot and the like, I'd bet you'd get at least a few
 submissions.

 On Mon, Jul 6, 2009 at 4:02 AM, Timothy Perrett 
 timo...@getintheloop.euwrote:





  Yeah if you have a designer which would be prepared to donate their
  time for free then we would very much like to speak with them! Our
  problem is getting creative time for free (as we are obviously a not
  for profit outfit).

  If we can get the design done (even just PSD or whatever) then we im
  more than happy to get that into a working site - this is actually
  something I want to do (rebuild the site) for 1.1... right now we just
  need a designer.

  Cheers, Tim

   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?
--~--~-~--~~~---~--~~
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: Becoming a Scala/Lift Guru

2009-07-06 Thread Wilson MacGyver

I would like to suggest David's Beginning Scala book. It's written
for new comer. And has lots of examples that you can play with
using Scala's REPL.

On Mon, Jul 6, 2009 at 1:22 PM, eric cseeri...@gmail.com wrote:

 David, awesome ideas you got there,thanks, about posting my
 improvements and stuff, pretty unique really and it will helps for
 future programers as well specially coming raw into Scala.
 I totally agree with you, maybe Scala is too much for a new guy who
 doesn't know some basic and advanced concepts or doesn't know how to
 put everything together?
 Totally agree there, but please tell a way, a book who will teach that
 foundation that has some examples in practice as well.
 I could install Scala do all that you mention but I don't know where
 to go from there which itens/classes/objects should I add to start
 building a app from scratch.
 I am looking for some book right now, like Code Complete 2,Clean Code:
 A Handbook of Agile Software Craftsmanship.
 I know what a method/function is what it does, I know what a class is,
 an Interface,Object,inheritance, but I can't put everything together
 yet, I know some of the theory and concepts, I think I need a good
 book that teaches how o put everything together.
 If you guys know some...please let me know.
 What's more, after that I will need to learn why scala is so
 diferent,powerfull,improved from Java or Ruby in concepts,theory,way
 to program and do things, in case you know a book about that too would
 be awesome.

 Is like a person who know what a cement is, water,tools, but doesn't
 know how to construct something, with pavers some people knows what it
 is but doesn't know how to pave and how some paver patterns with help
 with that, he can just put random pavers on the ground because is
 gonna be a mess, same thing with coding I think..hehe
 Thanks.

 On Jul 6, 12:00 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
 I would echo David's comment. Scala is a powerful language with high
 complexity budget. I think it's important to learn the fundamentals of
 Scala first and build on top of it.

 On Mon, Jul 6, 2009 at 11:52 AM, David





 Pollakfeeder.of.the.be...@gmail.com wrote:
  Eric,

  It seems that you want to hike the Appalachain Trail at marathon speeds.
  I'm not sure it can be done.  It took me 18 months with Scala before I felt
  comfortable with it and my learning curve with new languages is pretty good
  (it took 2 weeks to get comfortable with Ruby and 3 months before I felt
  that I had mastered it.)  I do not yet consider myself a Scala guru,
  although I consider myself very skilled with it.

  All of us have different learning styles, but I'm not sure that your goal 
  of
  understanding object hierarchies before sitting down to code is one that 
  I'd
  recommend.

  I'd suggest playing with small pieces and getting them to work for you.
  Perhaps the following order might be a starting place:

  Install Scala 2.7.5 and just play with the REPL (the interactive
  interpreter.)  This will give you a good feeling of what can be done with
  Scala.  See how data can be manipulated. (3 or 4 days... perhaps assisted 
  by
  Beginning Scala.)
  Install Maven on your machine and create the Lift hello world app:
 http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp(1 to 2
  days... also use a normal text editor, not an IDE... installing IDEs can be
  a rats nest of problems... TextMate for the Mac is the best choice, but vi
  or emacs are also good if you already know them.)
  Run through the ToDo example in Lift (5 or 6 days)

  By this point, you should have a bucket full of questions.  Ask them.  Ask
  them as your going.  Ask them when you get to breaking points.

  As you're spending your two weeks touring through Scala and Lift, start
  thinking about what you want to build.  Think from the UI back (that tends
  to be the easiest for most people... then think about how to interact with
  something and then go backward from it.)  Scala allows for better
  composition of application (using smaller parts to make bigger
  functionality rather than thinking about gross level object abstractions).
  So, draw your UI on a piece of paper and then start writing down what 
  pieces
  each UI component needs.  You should be able to build a simple, piece by
  piece screen that does what you want it to.  Once you've got it working,
  think about how to combine and normalize pieces of functionality.

  As always, we're here for you.  The Lift community will help you, but we 
  ask
  that you document your learning (perhaps via blog or wiki or Twitter) so
  others have the benefit of the work you've done.

  Thanks,

  David

  On Mon, Jul 6, 2009 at 6:14 AM, eric cs eeri...@gmail.com wrote:

  Guys,
  Thank you very much for all your answers.
  Having a community like that, I know is half way there for anyone.
  I am very very very eager to learn, that's my number one priorite
  right now and the e-commerce is an example to 

[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread David Pollak
On Mon, Jul 6, 2009 at 10:41 AM, Wilson MacGyver wmacgy...@gmail.comwrote:


 I would like to suggest David's Beginning Scala book. It's written
 for new comer. And has lots of examples that you can play with
 using Scala's REPL.


Heh... you beat me to the suggestion... ;-)

Chapters 2-5 of *Beginning Scala* should give you some grounding in Scala
syntax and how to do cool things with Scala.  Whatever you do, stay away
from Chapter 7... it's a big nasty scary thing and is not needed for the
kind of code you're writing.

Once you get through BegSca 2-5, go on to
http://liftweb.net/docs/getting_started.html  There may be gaps between the
two, but if you point out the gaps, we'll fill them in both online and in
the Getting Started document.




 On Mon, Jul 6, 2009 at 1:22 PM, eric cseeri...@gmail.com wrote:
 
  David, awesome ideas you got there,thanks, about posting my
  improvements and stuff, pretty unique really and it will helps for
  future programers as well specially coming raw into Scala.
  I totally agree with you, maybe Scala is too much for a new guy who
  doesn't know some basic and advanced concepts or doesn't know how to
  put everything together?
  Totally agree there, but please tell a way, a book who will teach that
  foundation that has some examples in practice as well.
  I could install Scala do all that you mention but I don't know where
  to go from there which itens/classes/objects should I add to start
  building a app from scratch.
  I am looking for some book right now, like Code Complete 2,Clean Code:
  A Handbook of Agile Software Craftsmanship.
  I know what a method/function is what it does, I know what a class is,
  an Interface,Object,inheritance, but I can't put everything together
  yet, I know some of the theory and concepts, I think I need a good
  book that teaches how o put everything together.
  If you guys know some...please let me know.
  What's more, after that I will need to learn why scala is so
  diferent,powerfull,improved from Java or Ruby in concepts,theory,way
  to program and do things, in case you know a book about that too would
  be awesome.
 
  Is like a person who know what a cement is, water,tools, but doesn't
  know how to construct something, with pavers some people knows what it
  is but doesn't know how to pave and how some paver patterns with help
  with that, he can just put random pavers on the ground because is
  gonna be a mess, same thing with coding I think..hehe
  Thanks.
 
  On Jul 6, 12:00 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
  I would echo David's comment. Scala is a powerful language with high
  complexity budget. I think it's important to learn the fundamentals of
  Scala first and build on top of it.
 
  On Mon, Jul 6, 2009 at 11:52 AM, David
 
 
 
 
 
  Pollakfeeder.of.the.be...@gmail.com wrote:
   Eric,
 
   It seems that you want to hike the Appalachain Trail at marathon
 speeds.
   I'm not sure it can be done.  It took me 18 months with Scala before I
 felt
   comfortable with it and my learning curve with new languages is pretty
 good
   (it took 2 weeks to get comfortable with Ruby and 3 months before I
 felt
   that I had mastered it.)  I do not yet consider myself a Scala guru,
   although I consider myself very skilled with it.
 
   All of us have different learning styles, but I'm not sure that your
 goal of
   understanding object hierarchies before sitting down to code is one
 that I'd
   recommend.
 
   I'd suggest playing with small pieces and getting them to work for
 you.
   Perhaps the following order might be a starting place:
 
   Install Scala 2.7.5 and just play with the REPL (the interactive
   interpreter.)  This will give you a good feeling of what can be done
 with
   Scala.  See how data can be manipulated. (3 or 4 days... perhaps
 assisted by
   Beginning Scala.)
   Install Maven on your machine and create the Lift hello world app:
  http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp(1http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp%281to
   2
   days... also use a normal text editor, not an IDE... installing IDEs
 can be
   a rats nest of problems... TextMate for the Mac is the best choice,
 but vi
   or emacs are also good if you already know them.)
   Run through the ToDo example in Lift (5 or 6 days)
 
   By this point, you should have a bucket full of questions.  Ask them.
 Ask
   them as your going.  Ask them when you get to breaking points.
 
   As you're spending your two weeks touring through Scala and Lift,
 start
   thinking about what you want to build.  Think from the UI back (that
 tends
   to be the easiest for most people... then think about how to interact
 with
   something and then go backward from it.)  Scala allows for better
   composition of application (using smaller parts to make bigger
   functionality rather than thinking about gross level object
 abstractions).
   So, draw your UI on a piece of paper and then start writing down what
 pieces
   

[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread Wilson MacGyver

Wouldn't Ch6 on actors be useful too? But yea, Ch7 would be too much.

On Mon, Jul 6, 2009 at 1:59 PM, David
Pollakfeeder.of.the.be...@gmail.com wrote:


 On Mon, Jul 6, 2009 at 10:41 AM, Wilson MacGyver wmacgy...@gmail.com
 wrote:

 I would like to suggest David's Beginning Scala book. It's written
 for new comer. And has lots of examples that you can play with
 using Scala's REPL.

 Heh... you beat me to the suggestion... ;-)

 Chapters 2-5 of Beginning Scala should give you some grounding in Scala
 syntax and how to do cool things with Scala.  Whatever you do, stay away
 from Chapter 7... it's a big nasty scary thing and is not needed for the
 kind of code you're writing.

 Once you get through BegSca 2-5, go on to
 http://liftweb.net/docs/getting_started.html  There may be gaps between the
 two, but if you point out the gaps, we'll fill them in both online and in
 the Getting Started document.


 On Mon, Jul 6, 2009 at 1:22 PM, eric cseeri...@gmail.com wrote:
 
  David, awesome ideas you got there,thanks, about posting my
  improvements and stuff, pretty unique really and it will helps for
  future programers as well specially coming raw into Scala.
  I totally agree with you, maybe Scala is too much for a new guy who
  doesn't know some basic and advanced concepts or doesn't know how to
  put everything together?
  Totally agree there, but please tell a way, a book who will teach that
  foundation that has some examples in practice as well.
  I could install Scala do all that you mention but I don't know where
  to go from there which itens/classes/objects should I add to start
  building a app from scratch.
  I am looking for some book right now, like Code Complete 2,Clean Code:
  A Handbook of Agile Software Craftsmanship.
  I know what a method/function is what it does, I know what a class is,
  an Interface,Object,inheritance, but I can't put everything together
  yet, I know some of the theory and concepts, I think I need a good
  book that teaches how o put everything together.
  If you guys know some...please let me know.
  What's more, after that I will need to learn why scala is so
  diferent,powerfull,improved from Java or Ruby in concepts,theory,way
  to program and do things, in case you know a book about that too would
  be awesome.
 
  Is like a person who know what a cement is, water,tools, but doesn't
  know how to construct something, with pavers some people knows what it
  is but doesn't know how to pave and how some paver patterns with help
  with that, he can just put random pavers on the ground because is
  gonna be a mess, same thing with coding I think..hehe
  Thanks.
 
  On Jul 6, 12:00 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
  I would echo David's comment. Scala is a powerful language with high
  complexity budget. I think it's important to learn the fundamentals of
  Scala first and build on top of it.
 
  On Mon, Jul 6, 2009 at 11:52 AM, David
 
 
 
 
 
  Pollakfeeder.of.the.be...@gmail.com wrote:
   Eric,
 
   It seems that you want to hike the Appalachain Trail at marathon
   speeds.
   I'm not sure it can be done.  It took me 18 months with Scala before
   I felt
   comfortable with it and my learning curve with new languages is
   pretty good
   (it took 2 weeks to get comfortable with Ruby and 3 months before I
   felt
   that I had mastered it.)  I do not yet consider myself a Scala guru,
   although I consider myself very skilled with it.
 
   All of us have different learning styles, but I'm not sure that your
   goal of
   understanding object hierarchies before sitting down to code is one
   that I'd
   recommend.
 
   I'd suggest playing with small pieces and getting them to work for
   you.
   Perhaps the following order might be a starting place:
 
   Install Scala 2.7.5 and just play with the REPL (the interactive
   interpreter.)  This will give you a good feeling of what can be done
   with
   Scala.  See how data can be manipulated. (3 or 4 days... perhaps
   assisted by
   Beginning Scala.)
   Install Maven on your machine and create the Lift hello world app:
  http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp(1 to 2
   days... also use a normal text editor, not an IDE... installing IDEs
   can be
   a rats nest of problems... TextMate for the Mac is the best choice,
   but vi
   or emacs are also good if you already know them.)
   Run through the ToDo example in Lift (5 or 6 days)
 
   By this point, you should have a bucket full of questions.  Ask
   them.  Ask
   them as your going.  Ask them when you get to breaking points.
 
   As you're spending your two weeks touring through Scala and Lift,
   start
   thinking about what you want to build.  Think from the UI back (that
   tends
   to be the easiest for most people... then think about how to interact
   with
   something and then go backward from it.)  Scala allows for better
   composition of application (using smaller parts to make bigger
   functionality rather than thinking 

[Lift] Re: Becoming a Scala/Lift Guru

2009-07-06 Thread David Pollak
On Mon, Jul 6, 2009 at 11:03 AM, Wilson MacGyver wmacgy...@gmail.comwrote:


 Wouldn't Ch6 on actors be useful too?


Not for getting to the To Do app.  In this case, I think less is more...
learn enough Scala to understand how to do basic Lift stuff.  Get success
with building a Lift app.  Go back to Chapter 6, learn Actors.  Go back to
Lift and do Comet stuff.  Do victory dance.


 But yea, Ch7 would be too much.

 On Mon, Jul 6, 2009 at 1:59 PM, David
 Pollakfeeder.of.the.be...@gmail.com wrote:
 
 
  On Mon, Jul 6, 2009 at 10:41 AM, Wilson MacGyver wmacgy...@gmail.com
  wrote:
 
  I would like to suggest David's Beginning Scala book. It's written
  for new comer. And has lots of examples that you can play with
  using Scala's REPL.
 
  Heh... you beat me to the suggestion... ;-)
 
  Chapters 2-5 of Beginning Scala should give you some grounding in Scala
  syntax and how to do cool things with Scala.  Whatever you do, stay away
  from Chapter 7... it's a big nasty scary thing and is not needed for the
  kind of code you're writing.
 
  Once you get through BegSca 2-5, go on to
  http://liftweb.net/docs/getting_started.html  There may be gaps between
 the
  two, but if you point out the gaps, we'll fill them in both online and in
  the Getting Started document.
 
 
  On Mon, Jul 6, 2009 at 1:22 PM, eric cseeri...@gmail.com wrote:
  
   David, awesome ideas you got there,thanks, about posting my
   improvements and stuff, pretty unique really and it will helps for
   future programers as well specially coming raw into Scala.
   I totally agree with you, maybe Scala is too much for a new guy who
   doesn't know some basic and advanced concepts or doesn't know how to
   put everything together?
   Totally agree there, but please tell a way, a book who will teach that
   foundation that has some examples in practice as well.
   I could install Scala do all that you mention but I don't know where
   to go from there which itens/classes/objects should I add to start
   building a app from scratch.
   I am looking for some book right now, like Code Complete 2,Clean Code:
   A Handbook of Agile Software Craftsmanship.
   I know what a method/function is what it does, I know what a class is,
   an Interface,Object,inheritance, but I can't put everything together
   yet, I know some of the theory and concepts, I think I need a good
   book that teaches how o put everything together.
   If you guys know some...please let me know.
   What's more, after that I will need to learn why scala is so
   diferent,powerfull,improved from Java or Ruby in concepts,theory,way
   to program and do things, in case you know a book about that too would
   be awesome.
  
   Is like a person who know what a cement is, water,tools, but doesn't
   know how to construct something, with pavers some people knows what it
   is but doesn't know how to pave and how some paver patterns with help
   with that, he can just put random pavers on the ground because is
   gonna be a mess, same thing with coding I think..hehe
   Thanks.
  
   On Jul 6, 12:00 pm, Wilson MacGyver wmacgy...@gmail.com wrote:
   I would echo David's comment. Scala is a powerful language with high
   complexity budget. I think it's important to learn the fundamentals
 of
   Scala first and build on top of it.
  
   On Mon, Jul 6, 2009 at 11:52 AM, David
  
  
  
  
  
   Pollakfeeder.of.the.be...@gmail.com wrote:
Eric,
  
It seems that you want to hike the Appalachain Trail at marathon
speeds.
I'm not sure it can be done.  It took me 18 months with Scala
 before
I felt
comfortable with it and my learning curve with new languages is
pretty good
(it took 2 weeks to get comfortable with Ruby and 3 months before I
felt
that I had mastered it.)  I do not yet consider myself a Scala
 guru,
although I consider myself very skilled with it.
  
All of us have different learning styles, but I'm not sure that
 your
goal of
understanding object hierarchies before sitting down to code is one
that I'd
recommend.
  
I'd suggest playing with small pieces and getting them to work for
you.
Perhaps the following order might be a starting place:
  
Install Scala 2.7.5 and just play with the REPL (the interactive
interpreter.)  This will give you a good feeling of what can be
 done
with
Scala.  See how data can be manipulated. (3 or 4 days... perhaps
assisted by
Beginning Scala.)
Install Maven on your machine and create the Lift hello world app:
   http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp(1http://wiki.liftweb.net/index.php/HowTo_start_a_new_liftwebapp%281to
2
days... also use a normal text editor, not an IDE... installing
 IDEs
can be
a rats nest of problems... TextMate for the Mac is the best choice,
but vi
or emacs are also good if you already know them.)
Run through the ToDo example in Lift (5 or 6 days)
  
By this point, you should 

[Lift] Lift upgraded to Scala 2.7.5 (**IMPORTANT**)

2009-07-06 Thread David Pollak
Folks,

I did a stress test of the 2.7.5 Scala actors over the weekend.  There are
no gross memory leaks, so I updated Lift to use 2.7.5.

For anyone using 1.1-SNAPSHOT, please update your pom.xml to use Scala 2.7.5

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
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] parameterizing a mapper query clause

2009-07-06 Thread Dano

Hello Lifters!

I recently acquired the Lift  book and saw a neat example of how to
use a QueryParam() to setup a query which does date range checking.
The code I am referencing is the dateClause expression in the
Expense.scala file (pocketchange project).  It looks like:

val dateClause : QueryParam[Expense] = (startDate,endDate) match {
  case (Full(start), Full(end)) = BySql(Expense.dateOf between ?
and ?,
 
IHaveValidatedThisSQL(dchenbecker, 2009-02-22),
 start, end)
  case (Full(start), Empty) = BySql(Expense.dateOf = ?,
 IHaveValidatedThisSQL(dchenbecker, 
2009-02-22),
 start)
  case (Empty, Full(end)) = BySql(Expense.dateOf = ?,
   IHaveValidatedThisSQL(dchenbecker, 
2009-02-22),
   end)
  case _ = new Ignore[Expense]
}

I want to use this clause across a set of Mapper classes and so I
thought I would take the code and try to parameterize it with a type
so that I could pass in a Mapper class at the type.

I have tried to model the type as both KeyedMapper and Mapper to no
avail (see broken code below)  I am stumbling on the User class which
is probably the most involved of the Mapper classes I need to get to
work.

Does anyone have a quick pointer for a type challenged lifter?

Thanks in advance.


Dano

/* Site analytics code */
val startDate: Box[Date] = parseDate(2009/06/01 00:00)
val endDate: Box[Date] = parseDate(2009/07/01 00:00)
val users = User.findAll(dateClause(startDate, endDate, User))
println(users =  + users)

  private def dateClause[T : Mapper[Long]](startDate: Box[Date],
endDate: Box[Date], tbl: T) : QueryParam[T] = (startDate,endDate)
match {
  case (Full(start), Full(end)) = BySql(User.createdAt between ?
and ?,
 IHaveValidatedThisSQL(djo, 
2009-06-22),
 start, end)
  case (Full(start), Empty) = BySql(User.createdAt = ?,
 IHaveValidatedThisSQL(djo, 
2009-06-22),
 start)
  case (Empty, Full(end)) = BySql(User.createdAt = ?,
   IHaveValidatedThisSQL(djo, 
2009-06-22),
   end)
  case _ = new Ignore[T]
  }

--~--~-~--~~~---~--~~
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: Becoming a Scala/Lift Guru

2009-07-06 Thread Ellis

Tim, Eric,

@Tim:
 everyone has to start
 somewhere and saying Lift is only appropriate for hardcore programmers
 because its a new framework is wrong IMHO.

Compared to certain other starting points, there are a lot of extra
hurdles to overcome if you're going to attempt lift as your intro to
programming.  For example, contrasted to a simple non-lift project,
the person would have to become familiar with:
- maven
- command line
- many advanced aspects of scala
- deal with less reliable IDE tools and sometimes forgo their benefits
entirely

A new programmer shouldn't try to deal with more than one of those at
a time, or he'll get stuck on lots of fruitless problems (sometimes
for days), and likely have to go back to a simpler environment
anyway.  It's better to start programming by: 1) *programming* rather
than learning tools, and 2) having the full support of an IDE.

@Eric:
I'd also echo the sentiment which has already been expressed here a
few times: just start working with code and don't worry about getting
the architecture right.

Architecture is a medium-to-advanced topic, btw, that requires you to
judge the value of choosing among multi-factored tradeoffs.  That kind
of knowledge mostly comes from *experience* with all the patterns in
various contexts.

Best regards,
Ellis


On Jul 6, 12:17 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Ellis,

 Im afraid I disagree with you - Eric does not state what type of
 eComerce application he wants to create... IMO, this is very
 subjective. Lift ships out of the box with PayPal integration - one
 could say that a site which allows a user to pay via paypal is
 eCommerce... would you disagree?

 If Eric takes on advice from the Lift Book and perhaps a learning
 scala book like DPP's, then asks lift related questions on here when
 he needs specific help im sure he'll be fine... everyone has to start
 somewhere and saying Lift is only appropriate for hardcore programmers
 because its a new framework is wrong IMHO.

 Eric, good luck to you - the lift community is a great place to start
 your programming endeavors; you probably have a slightly steeper
 learning curve than most, but provided you have grit and determination
 there is nothing to say you will not reach your goals. Think
 positive.

 Cheers, Tim

 On Jul 6, 10:13 am, Ellis ellis.whiteh...@gmail.com wrote:



  Hi Eric,

  Here are a few comments and suggestions.

  - Honestly, I don't think that lift and scala are the right places for
  you to start out.  The systems are very powerful, but relatively new,
  and so they are still geared towards more experienced programmers.
  - You'll need more than a month to become comfortable with an entirely
  new programming environment.
  - The java toolset can be confusing.  Try NetBeans; it's easier to
  understand than Eclipse.
  - An e-commerce program would take years to get right, but if that's
  what inspires you, you might want to focus on just small parts of such
  a program instead.

  Cheers,
  Ellis

  On Jul 6, 5:13 am, eric cs eeri...@gmail.com wrote:

   Hi guys,

   I saw some posts on Scala website about helping newcomers and I was
   wondering if some of you would be kind enough to help me out to start
   with Scala/Lift.
   My main problem is I am not a programmer yet but I really really want
   to be, I've been studying Ruby/Rails, Php/Zend/Symfony,Mvc,Design
   Patterns,Uml,Sql and some Java. I read some books but I don't get my
   head to think like a programer.
   I really like OO,Design Patterns, Uml but I don't know how to apply
   that to a full application, how to link everything together,
   classes,objects(books about that?Not about those items but how to put
   everything together)...I know a lot of the theory and concepts but no
   practice.
   I have all july available to learn that 12 hours a day or more if
   necessary I just need a push, someone to teach/help me out.
   What's more, I saw a post saying that I could learn Scala from scratch
   without learning Java, it's possible, not so much with Groovy. If it's
   not what parts of Java do I need to know, in case some of you tell me
   learn Java first(the easy answer).Do I need a lot of experience in
   Java to jump in in Scala? I know it helps but I would like to finish
   my first e-commerce in august, 100% opensource in Scala if possible.

   P.s:I did 2 years of Computer Science C++ and 2 years of Civil
   Engineering over 12 years ago both unfinished.

--~--~-~--~~~---~--~~
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: parameterizing a mapper query clause

2009-07-06 Thread Derek Chen-Becker
Maybe I'm misunderstanding what you're attempting here, but I don't think
that this will work. The major roadblock I see is that the SQL query strings
are tied directly to a table name (e.g. User.createdAt), and therefore to
a particular type. Off the top of my head, I think that you *could* write
something that would be templated by leveraging base Mapper traits instead.
Something maybe like:

def DateRangeParam[O](field: MappedField[T, O], startDate : Box[Date],
endDate: Box[Date]) : QueryParam[O] =
  (startDate, endDate) match {
case (Full(start), Full(end)) =
BySql(field.fieldOwner.getSingleton.dbTableName + . + field.dbColumnName +
 between ? and ?, ...

and so on. I have no idea if this will really work, since I shoot myself in
the foot with the type system all of the time, but it should be possible to
dynamically build the query string based on the field and mapper class
involved.

Derek

On Mon, Jul 6, 2009 at 1:56 PM, Dano olearydani...@gmail.com wrote:


 Hello Lifters!

 I recently acquired the Lift  book and saw a neat example of how to
 use a QueryParam() to setup a query which does date range checking.
 The code I am referencing is the dateClause expression in the
 Expense.scala file (pocketchange project).  It looks like:

val dateClause : QueryParam[Expense] = (startDate,endDate) match {
  case (Full(start), Full(end)) = BySql(Expense.dateOf between ?
 and ?,

 IHaveValidatedThisSQL(dchenbecker, 2009-02-22),
 start, end)
  case (Full(start), Empty) = BySql(Expense.dateOf = ?,

 IHaveValidatedThisSQL(dchenbecker, 2009-02-22),
 start)
  case (Empty, Full(end)) = BySql(Expense.dateOf = ?,
   IHaveValidatedThisSQL(dchenbecker,
 2009-02-22),
   end)
  case _ = new Ignore[Expense]
}

 I want to use this clause across a set of Mapper classes and so I
 thought I would take the code and try to parameterize it with a type
 so that I could pass in a Mapper class at the type.

 I have tried to model the type as both KeyedMapper and Mapper to no
 avail (see broken code below)  I am stumbling on the User class which
 is probably the most involved of the Mapper classes I need to get to
 work.

 Does anyone have a quick pointer for a type challenged lifter?

 Thanks in advance.


 Dano

/* Site analytics code */
val startDate: Box[Date] = parseDate(2009/06/01 00:00)
val endDate: Box[Date] = parseDate(2009/07/01 00:00)
val users = User.findAll(dateClause(startDate, endDate, User))
println(users =  + users)

  private def dateClause[T : Mapper[Long]](startDate: Box[Date],
 endDate: Box[Date], tbl: T) : QueryParam[T] = (startDate,endDate)
 match {
  case (Full(start), Full(end)) = BySql(User.createdAt between ?
 and ?,
 IHaveValidatedThisSQL(djo,
 2009-06-22),
 start, end)
  case (Full(start), Empty) = BySql(User.createdAt = ?,
 IHaveValidatedThisSQL(djo,
 2009-06-22),
 start)
  case (Empty, Full(end)) = BySql(User.createdAt = ?,
   IHaveValidatedThisSQL(djo,
 2009-06-22),
   end)
  case _ = new Ignore[T]
  }

 


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