[Lift] Re: prep for offline work

2009-06-22 Thread Oliver Lambert
Check you can work offline before you go with the command Tim details (mvn
-o clean install).
If you are running against a snapshot of Lift consider changing to a release
instead, otherwise
Maven will want to download a new snapshot every day (you could freeze at a
snapshot version,
but thats more complicated).

On Tue, Jun 23, 2009 at 1:30 AM, Timothy Perrett wrote:

>
> Grab yourself a copy of the lift book, download the lift source code
> so you can build locally if need be and dont forget you prefix all
> your maven commands: mvn -o
>
> Cheers, Tim
>
> On Jun 22, 4:01 pm, Mojo  wrote:
> > Hi all, I've enjoyed following the list for a few weeks, and studying
> > Scala casually for a few months.
> >
> > I'm a Java developer currently working with Spring and Hibernate to
> > build web apps, and spent a few months professionally in the Ruby on
> > Rails world as well.
> >
> > I'm about to depart on a ten-day cruise (San Francisco to Alaska) and
> > kind of looking forward to the disconnected time to spend working with
> > Scala and Lift.
> >
> > Being disconnected makes for good concentration time, but it also
> > makes it difficult to deal with things like missing Maven
> > dependencies. I'm trying to be as prepared as I can before departure.
> >
> > I've done things like install the "helloworld" lift app from Maven,
> > and done a complete build to jetty:run, and even "mvn site" to try and
> > make sure all the plugins and dependencies are in my local repository.
> > I have Netbeans on the machine, 6.5, and the latest RC for 6.7, but
> > haven't yet installed the Scala plugin.
> >
> > I'd probably better have a DB on hand. Mysql or HSQLDB.
> >
> > Can anyone think of any other good ways to prepare for doing some
> > study and development while being off the grid, so to speak?
> >
> > Cheers,
> > Mojo
> > --
> > Morris Jones
> > Monrovia, CA
> > m...@whiteoaks.comhttp://mojo.whiteoaks.com
> >
>

--~--~-~--~~~---~--~~
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: Deployment questions and little Java web dev experience

2009-06-22 Thread Naftoli Gugenheim
When you deploy a web app I think you specify a context path (at least in
jetty) which I think is what you're looking for -- the first part of the
path after the domain name.

On Mon, Jun 22, 2009 at 11:39 PM, g-man  wrote:

>
> I came from a similar background, but with some detours after Rails
> through Erlang, GAE w/ Django, and web2py. It took me about 2 months
> to finally start having fun with Lift and Scala, but I can tell you
> now it's really nice to just sit down, write something, and watch it
> work!
>
> I'm no expert yet, and I'm constantly reading all the books I can
> find, but the rewards and power are definitely there. Where I needed
> dozens of files with Rails, I only need 3 models, 3 snippets, and 2
> templates now, and they are far cleaner!
>
> My advice is to slow down, do the 'ToDo' app tutorial, and then start
> adding functionality to it. As you add features, you will research and
> learn about new things and how to do them. As a study aid, I keep the
> 'PocketChange' app from the book open, and look to see how similar
> problems were solved there.
>
> As they say, almost everything you need to know is contained in those
> two examples. As to all the niceties of the servers and deployment to
> a VPS, I suggest you leave that for later. The little Jetty thing
> running on localhost will give you a taste of how Maven sets up
> things, and how to tweak them (adding logging, comments, debugging
> messages, etc), plus you always have the Group here for help.
>
> Lift (and Scala) are both very young, so it will take a while for all
> the books, websites, tutorials, and videos to come out. Imagine Rails
> 5 years ago and you have some idea of where we are, and that's not
> even considering the new 'Goat Rodeo' project...
>
> No worries -- have fun!
>
>
> On Jun 19, 1:09 pm, "Nolan Darilek"  wrote:
> > Hi, all. I'm new to Lift and have a few questions about using it. For
> > background, I'm coming from Ruby to Scala, having finally been
> > frustrated by some aspects of the former enough to try jumping ship. I
> > know Java syntax, but the simplicity of Ruby has always been a powerful
> > draw for me, so when I used Java I always stayed away from Maven and
> > other cornerstones of the Java tool community. I say all of this not to
> > stir up Ruby vs. Scala drama (because we just don't have enough of that
> > already :P ) but to explain that I'm mistified by much of the Java
> > ecosystem, and a lot of what's out there seems to take it for granted
> > that I know all of this. So please pardon my newbie questions, and feel
> > free to point me to the FM on the subject if there is one, because I've
> > certainly been *trying* to RTFM. :) I also recognize that these topics
> > aren't specific to Lift, but I figure I'm likely to find more proponents
> > of low ceremony in the Scala community than I'd find if I seeked out
> > some more general purpose Java enterprise deployment resource.
> >
> > First...servlets? Web containers? App servers? Oh my. I want to write a
> > few hobbyist apps with Lift and deploy them to my VPS. They may or may
> > not take off, in which case I'd like a solution that can scale to
> > real-world use. Not heavy real-world use, mind you, but I figure a
> > separate VM/port for every app instance is overkill. So what do I need
> > for this? I gather the app server is what handles arranging web apps in
> > a single VM instance, but it's tough cutting through all the enterprise
> > language to figure out which one of these is best for my circumstances,
> > especially since I'm not dealing with legacy code and just want to
> > launch hobbyist/personal projects. And I can't for the life of me figure
> > out whether Tomcat is an app server or something else entirely. This
> > seems so much more complicated than just throwing up a few Mongrels and
> > a load balancer, or reading through the nicely-written Passenger manual
> > and following the step-by-step instructions. I'm sure it has its
> > advantages, I just can't get a grip on how it works.
> >
> > I've also been reading a lot about OSGi and it looks really nice. Am I
> > correct in assuming that OSGi is to Java web apps what Rack is to Ruby
> > ones? OK, maybe not exactly, and I know it's a more general-purpose
> > mechanism (I'm toying with ScalaModules in a desktop app for providing
> > pluggable UIs and other services) but in poking through OSGi articles,
> > I've read a few statements hinting that this is probably the best way to
> > deploy new apps with no legacy dependencies. Is this true? Is an app
> > server actually needed here, or do I just create an OSGi execution
> > environment and start adding bundles?
> >
> > It seems like the way to deploy an app is to build a war file and drop
> > it into a specific directory of your servlet/app
> > server/doohicky-whatamajig serverletcontainerthingie. It also looks as
> > if all apps are installed into the same HTTP namespace, with URL path
> > collisions resolved by ed

[Lift] Re: Trouble with menus and CRUDify

2009-06-22 Thread David Pollak
On Mon, Jun 22, 2009 at 5:30 PM, Nolan Darilek wrote:

>
> Wow, thanks for the quick response!
>
> On 06/22/2009 07:11 PM, David Pollak wrote:
> >
> > Try:
> >
> > val entries = Menu(Loc("Home", List("index"), "Home")) ::
> > Layout.menus ::: User.sitemap
> >
> >
> > Note the triple colon (:::) operator.  This concatenates two lists.
> >
> >
> Hmm, so why wouldn't I need the ::: before Layout.menus as well? I'm
> assuming that's a list too, so why isn't list concatenation needed on
> that end?


scala> 1 :: List(2,3,4)
res1: List[Int] = List(1, 2, 3, 4)

scala> List(1,2,3) ::: List(4,5,6)
res2: List[Int] = List(1, 2, 3, 4, 5, 6)

scala> List(1,2,3) :: List(4,5,6)
res3: List[Any] = List(List(1, 2, 3), 4, 5, 6)

Because the thing to the Left of :: Layout.menus is a single item, not a
List of items.  :: prepends a single item at the head of the List where :::
concats two Lists.


>
>
> >
>


-- 
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: Deployment questions and little Java web dev experience

2009-06-22 Thread g-man

I came from a similar background, but with some detours after Rails
through Erlang, GAE w/ Django, and web2py. It took me about 2 months
to finally start having fun with Lift and Scala, but I can tell you
now it's really nice to just sit down, write something, and watch it
work!

I'm no expert yet, and I'm constantly reading all the books I can
find, but the rewards and power are definitely there. Where I needed
dozens of files with Rails, I only need 3 models, 3 snippets, and 2
templates now, and they are far cleaner!

My advice is to slow down, do the 'ToDo' app tutorial, and then start
adding functionality to it. As you add features, you will research and
learn about new things and how to do them. As a study aid, I keep the
'PocketChange' app from the book open, and look to see how similar
problems were solved there.

As they say, almost everything you need to know is contained in those
two examples. As to all the niceties of the servers and deployment to
a VPS, I suggest you leave that for later. The little Jetty thing
running on localhost will give you a taste of how Maven sets up
things, and how to tweak them (adding logging, comments, debugging
messages, etc), plus you always have the Group here for help.

Lift (and Scala) are both very young, so it will take a while for all
the books, websites, tutorials, and videos to come out. Imagine Rails
5 years ago and you have some idea of where we are, and that's not
even considering the new 'Goat Rodeo' project...

No worries -- have fun!


On Jun 19, 1:09 pm, "Nolan Darilek"  wrote:
> Hi, all. I'm new to Lift and have a few questions about using it. For
> background, I'm coming from Ruby to Scala, having finally been
> frustrated by some aspects of the former enough to try jumping ship. I
> know Java syntax, but the simplicity of Ruby has always been a powerful
> draw for me, so when I used Java I always stayed away from Maven and
> other cornerstones of the Java tool community. I say all of this not to
> stir up Ruby vs. Scala drama (because we just don't have enough of that
> already :P ) but to explain that I'm mistified by much of the Java
> ecosystem, and a lot of what's out there seems to take it for granted
> that I know all of this. So please pardon my newbie questions, and feel
> free to point me to the FM on the subject if there is one, because I've
> certainly been *trying* to RTFM. :) I also recognize that these topics
> aren't specific to Lift, but I figure I'm likely to find more proponents
> of low ceremony in the Scala community than I'd find if I seeked out
> some more general purpose Java enterprise deployment resource.
>
> First...servlets? Web containers? App servers? Oh my. I want to write a
> few hobbyist apps with Lift and deploy them to my VPS. They may or may
> not take off, in which case I'd like a solution that can scale to
> real-world use. Not heavy real-world use, mind you, but I figure a
> separate VM/port for every app instance is overkill. So what do I need
> for this? I gather the app server is what handles arranging web apps in
> a single VM instance, but it's tough cutting through all the enterprise
> language to figure out which one of these is best for my circumstances,
> especially since I'm not dealing with legacy code and just want to
> launch hobbyist/personal projects. And I can't for the life of me figure
> out whether Tomcat is an app server or something else entirely. This
> seems so much more complicated than just throwing up a few Mongrels and
> a load balancer, or reading through the nicely-written Passenger manual
> and following the step-by-step instructions. I'm sure it has its
> advantages, I just can't get a grip on how it works.
>
> I've also been reading a lot about OSGi and it looks really nice. Am I
> correct in assuming that OSGi is to Java web apps what Rack is to Ruby
> ones? OK, maybe not exactly, and I know it's a more general-purpose
> mechanism (I'm toying with ScalaModules in a desktop app for providing
> pluggable UIs and other services) but in poking through OSGi articles,
> I've read a few statements hinting that this is probably the best way to
> deploy new apps with no legacy dependencies. Is this true? Is an app
> server actually needed here, or do I just create an OSGi execution
> environment and start adding bundles?
>
> It seems like the way to deploy an app is to build a war file and drop
> it into a specific directory of your servlet/app
> server/doohicky-whatamajig serverletcontainerthingie. It also looks as
> if all apps are installed into the same HTTP namespace, with URL path
> collisions resolved by editing web.xml and prepending something to the
> /* for the map elements. Is this accurate? Or is it possible to have the
> server prepend  /myapp or /myapp.war based on the name of the deployed
> app, then handle the mappings via ProxyPass in the front-end server?
> That's closer to what I'm used to in Ruby, where the app takes over the
> URL namespace beneath whatever path yo

Re: Lift + Scala 2.8 (Was: Re: [Lift] Re: Is there any eclipse setup that actually works for lift?)

2009-06-22 Thread David Pollak
On Mon, Jun 22, 2009 at 7:51 PM, Jorge Ortiz  wrote:

> I just spent all afternoon trying to get stuff to compile with Scala 2.8.
>
> Since Lift depends on Specs, and Specs depends on Scalacheck, I started
> trying to port Scalacheck to 2.8 so I could port Specs to 2.8 so I could
> port Lift. It was unable to get Scalacheck to compile due to bugs which
> cause the compiler to choke and throw an exception. Apparently both paulp
> and Iulian have tried to compile Scalacheck with 2.8 before and failed.
>
> Giving up on Specs and Scalacheck, I decided to try to compile Lift (sans
> tests) with 2.8. After fixing some of the breaking changes that 2.8
> introduces, I again ran into compiler troubles. In principle, with a lot of
> sleuthing I could figure out what code is causing the compiler to choke and
> give the compiler more type hints or whatever. Unfortunately this requires
> more work than I can put in today.
>
> Conclusion: 2.8 is basically unusable right now.
>
> (I'll check in my progress to GitHub later tonight or tomorrow.)


Thanks for your hard work!


>
>
> --j
>
> On Mon, Jun 22, 2009 at 11:35 AM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>>
>>
>> On Mon, Jun 22, 2009 at 11:25 AM, Ellis wrote:
>>
>>>
>>> Hello David,
>>>
>>> Thanks for your reply.  Do you know whether lift *should* work with
>>> scala 2.8 when we pull it from the maven repositories?
>>
>>
>> Lift currently only works with Scala 2.7.4.  You can use Eclipse and 2.7.5
>> to edit Lift files, but Lift must be deployed against 2.7.4.
>>
>> We will have a branch of Lift (Jorge... you got this running yet) building
>> against 2.8, but it will be experimental.
>>
>> I have experienced a fair number of suboptimalities with Lift and Eclipse
>> in the last 3 weeks with the 2.7.5 stable plugin.  I have had success
>> recently with NetBeans, IntelliJ, and emacs.
>>
>>
>>>  If so, then
>>> I'll try deleting my ~/.m2 as Tim suggested.
>>>
>>> Thanks,
>>> Ellis
>>>
>>>
>>> On Jun 22, 8:14 pm, David Pollak 
>>> wrote:
>>> > Ellis,
>>> > Miles will be back online in a few days, but I suspect that the answer
>>> is
>>> > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is
>>> going to
>>> > have bugs. :-(
>>> >
>>> > Sorry.
>>> >
>>> > David
>>> >
>>> >
>>> >
>>> > On Mon, Jun 22, 2009 at 11:08 AM, Ellis 
>>> wrote:
>>> >
>>> > > Hello everyone,
>>> >
>>> > > Does anyone have a setup for eclipse that works like it should?  By
>>> > > "like it should", I mostly mean that the scala plugin doesn't crash
>>> > > regularly AND it works with lift/maven.  If so, which versions of
>>> > > which plugins are you using?
>>> >
>>> > > The nightly build of the scala plugin seems to work better than
>>> > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
>>> > > maven due to "signature differences" between the scala libraries.
>>> >
>>> > > Best regards,
>>> > > Ellis
>>> >
>>> > --
>>> > Lift, the simply functional web frameworkhttp://liftweb.net
>>> > Beginning Scalahttp://www.apress.com/book/view/1430219890
>>> > Follow me:http://twitter.com/dpp
>>> > Git some:http://github.com/dpp
>>>
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>>
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>
> >
>


-- 
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 + Scala 2.8 (Was: Re: [Lift] Re: Is there any eclipse setup that actually works for lift?)

2009-06-22 Thread Jorge Ortiz
I just spent all afternoon trying to get stuff to compile with Scala 2.8.

Since Lift depends on Specs, and Specs depends on Scalacheck, I started
trying to port Scalacheck to 2.8 so I could port Specs to 2.8 so I could
port Lift. It was unable to get Scalacheck to compile due to bugs which
cause the compiler to choke and throw an exception. Apparently both paulp
and Iulian have tried to compile Scalacheck with 2.8 before and failed.

Giving up on Specs and Scalacheck, I decided to try to compile Lift (sans
tests) with 2.8. After fixing some of the breaking changes that 2.8
introduces, I again ran into compiler troubles. In principle, with a lot of
sleuthing I could figure out what code is causing the compiler to choke and
give the compiler more type hints or whatever. Unfortunately this requires
more work than I can put in today.

Conclusion: 2.8 is basically unusable right now.

(I'll check in my progress to GitHub later tonight or tomorrow.)

--j

On Mon, Jun 22, 2009 at 11:35 AM, David Pollak <
feeder.of.the.be...@gmail.com> wrote:

>
>
> On Mon, Jun 22, 2009 at 11:25 AM, Ellis  wrote:
>
>>
>> Hello David,
>>
>> Thanks for your reply.  Do you know whether lift *should* work with
>> scala 2.8 when we pull it from the maven repositories?
>
>
> Lift currently only works with Scala 2.7.4.  You can use Eclipse and 2.7.5
> to edit Lift files, but Lift must be deployed against 2.7.4.
>
> We will have a branch of Lift (Jorge... you got this running yet) building
> against 2.8, but it will be experimental.
>
> I have experienced a fair number of suboptimalities with Lift and Eclipse
> in the last 3 weeks with the 2.7.5 stable plugin.  I have had success
> recently with NetBeans, IntelliJ, and emacs.
>
>
>>  If so, then
>> I'll try deleting my ~/.m2 as Tim suggested.
>>
>> Thanks,
>> Ellis
>>
>>
>> On Jun 22, 8:14 pm, David Pollak 
>> wrote:
>> > Ellis,
>> > Miles will be back online in a few days, but I suspect that the answer
>> is
>> > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is going
>> to
>> > have bugs. :-(
>> >
>> > Sorry.
>> >
>> > David
>> >
>> >
>> >
>> > On Mon, Jun 22, 2009 at 11:08 AM, Ellis 
>> wrote:
>> >
>> > > Hello everyone,
>> >
>> > > Does anyone have a setup for eclipse that works like it should?  By
>> > > "like it should", I mostly mean that the scala plugin doesn't crash
>> > > regularly AND it works with lift/maven.  If so, which versions of
>> > > which plugins are you using?
>> >
>> > > The nightly build of the scala plugin seems to work better than
>> > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
>> > > maven due to "signature differences" between the scala libraries.
>> >
>> > > Best regards,
>> > > Ellis
>> >
>> > --
>> > Lift, the simply functional web frameworkhttp://liftweb.net
>> > Beginning Scalahttp://www.apress.com/book/view/1430219890
>> > Follow me:http://twitter.com/dpp
>> > Git some:http://github.com/dpp
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
>
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>

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



[Lift] Re: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread ngug

I use lift in eclipse and don't have too much trouble. I have maven
managing dependencies but I disabled its builder and let the scala
plugin build.
Also, since I'm often offline and maven always remembers that it
forgot to download something before :), I set up a custom Jetty
launch.
I think the plugin is actually current 2.7.5. It works very good; once
in a while syntax highlighting or autocomplete gets stuck but closing
and reopening the editor usually solves the problem.

--~--~-~--~~~---~--~~
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: Great pictures from the Scala Lift Off

2009-06-22 Thread Miles Sabin

Rather late in the day ... my pictures from Scala Lift Off here,

  http://www.flickr.com/photos/montpelier/sets/72157619470965981/

Cheers,


Miles

-- 
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://www.chuusai.com/
http://twitter.com/milessabin

--~--~-~--~~~---~--~~
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: Trouble with menus and CRUDify

2009-06-22 Thread Nolan Darilek

Wow, thanks for the quick response!

On 06/22/2009 07:11 PM, David Pollak wrote:
>
> Try:
>
> val entries = Menu(Loc("Home", List("index"), "Home")) ::
> Layout.menus ::: User.sitemap
>
>
> Note the triple colon (:::) operator.  This concatenates two lists.
>
>
Hmm, so why wouldn't I need the ::: before Layout.menus as well? I'm 
assuming that's a list too, so why isn't list concatenation needed on 
that end?

--~--~-~--~~~---~--~~
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: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Dano

I just downloaded Intellij 8.1.3, installed it, installed the scala,
maven and jetty plugins, created a project on top of my scala/lift
sandbox and was able to debug pretty easily.  Editor also has pretty
good intelli-sense.

Pretty impressive given that the last time I tried NetBeans/Eclipse (5
months ago), debugging was a no-go (although I am sure those IDEs/
plugins have made progress since then).

All to the good!!


Dan

On Jun 22, 3:20 pm, Dano  wrote:
> Rudi,
>
> Thanks for posting your Intellij specifics.  Wondering if you are
> using the debugger and find that it works for your scala/lift
> debugging?
>
> Dano
>
> On Jun 22, 2:57 pm, Rudi Engelbrecht  wrote:
>
> > I know you are looking for a working Eclipse configuration, but I have  
> > had great success and stability with
>
> > IntelliJ IDEA 8.1.2
> > Scala 2.7.4
> > The Scala plugin for IDEA
> > Lift 1.0
>
> > I can do "mvn jetty:run" from the IDE and what is really cool is that  
> > I can set breakpoints and debug the "mvn jetty:run" target from IDEA  
> > and then explore the scala code.
>
> > Just thought I will post version numbers of a working environment.
>
> > Regards
>
> > Rudi
>
> > On 22 Jun 2009, at 8:35 PM, David Pollak  
>
> >  wrote:
>
> > > On Mon, Jun 22, 2009 at 11:25 AM, Ellis   
> > > wrote:
>
> > > Hello David,
>
> > > Thanks for your reply.  Do you know whether lift *should* work with
> > > scala 2.8 when we pull it from the maven repositories?
>
> > > Lift currently only works with Scala 2.7.4.  You can use Eclipse and  
> > > 2.7.5 to edit Lift files, but Lift must be deployed against 2.7.4.
>
> > > We will have a branch of Lift (Jorge... you got this running yet)  
> > > building against 2.8, but it will be experimental.
>
> > > I have experienced a fair number of suboptimalities with Lift and  
> > > Eclipse in the last 3 weeks with the 2.7.5 stable plugin.  I have  
> > > had success recently with NetBeans, IntelliJ, and emacs.
>
> > >  If so, then
> > > I'll try deleting my ~/.m2 as Tim suggested.
>
> > > Thanks,
> > > Ellis
>
> > > On Jun 22, 8:14 pm, David Pollak 
> > > wrote:
> > > > Ellis,
> > > > Miles will be back online in a few days, but I suspect that the  
> > > answer is
> > > > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is  
> > > going to
> > > > have bugs. :-(
>
> > > > Sorry.
>
> > > > David
>
> > > > On Mon, Jun 22, 2009 at 11:08 AM, Ellis  
> > >  wrote:
>
> > > > > Hello everyone,
>
> > > > > Does anyone have a setup for eclipse that works like it should?  
> > > By
> > > > > "like it should", I mostly mean that the scala plugin doesn't  
> > > crash
> > > > > regularly AND it works with lift/maven.  If so, which versions of
> > > > > which plugins are you using?
>
> > > > > The nightly build of the scala plugin seems to work better than
> > > > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > > > > maven due to "signature differences" between the scala libraries.
>
> > > > > Best regards,
> > > > > Ellis
>
> > > > --
> > > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > Follow me:http://twitter.com/dpp
> > > > Git some:http://github.com/dpp
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: [scala] JPA question

2009-06-22 Thread Derek Chen-Becker
For sufficiently complex relationships, JPA is not a good fit. Beyond a
certain point it's usually simpler to roll your own. I think that this is
somewhat of a failing of the model, but it's not a simple problem to solve
in the generic case.

Derek

On Mon, Jun 22, 2009 at 6:45 PM, Derek Chen-Becker wrote:

> Ah, sorry, I lost track of the thread.
>
>
> On Mon, Jun 22, 2009 at 4:55 PM, Meredith Gregory <
> lgreg.mered...@gmail.com> wrote:
>
>> Derek,
>>
>> You are correct and i noted and reported this on Scala on Friday. However,
>> if you have a chain of the form
>>
>> AbstractClass <- Class <-contains- AbstractClass <-Class <-contains- ...
>>
>> The @MappedSuperclass solution fails at level 2.
>>
>> Best wishes,
>>
>> --greg
>>
>>
>> On Mon, Jun 22, 2009 at 3:52 PM, Derek Chen-Becker > > wrote:
>>
>>> Something I just want to throw out into the discussion: Since you're
>>> using table-per-class, having a @Table annotation on AbstractContainer
>>> doesn't do anything since abstract classes can't have instances. Tables are
>>> only generated for abstract classes if you're using a JOINED inheritance
>>> strategy. You might want to look at using the MappedSuperclass annotation
>>> for the abstract base class instead. If I change the AbstractContainer def
>>> to:
>>>
>>> @MappedSuperclass
>>> public abstract class AbstractContainer implements java.io.Serializable {
>>>
>>> and then modify MySampleFuContainer to:
>>>
>>> public class MySampleFuContainer extends AbstractContainer {
>>>
>>> then I seem to get the proper schema:
>>>
>>> create table lingo_production.MySampleFuContainer_table (
>>> id varchar(255) not null,
>>> uuid varchar(255),
>>> mysamplingmumble__idSuper varchar(255),
>>> primary key (id),
>>> unique (uuid)
>>> );
>>>
>>>
>>> Having said that, I think that the behavior you're currently seeing
>>> appears to be a bug.
>>>
>>> Derek
>>>
>>>
>>> On Mon, Jun 22, 2009 at 3:43 PM, Meredith Gregory <
>>> lgreg.mered...@gmail.com> wrote:
>>>
 Kris,

 Hereis 
 a link to the self-contained example that now uses just Java. i included
 the target dir in the repo to speed up investigation, but you can just blow
 that away and build from scratch. The example is currently written to
 Java1.6, but also exhibits the same behavior under Java1.5. To run the
 example

 > svn co
 http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
 ...
 > env PATH=:$PATH JAVA_HOME= mvn clean
 compile process-classes

 If you switch comment and decl at line 22 in
 src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error.
 The schema goes from

 create table lingo_production.MySampleFuContainer_table (
 id_AbstractContainer varchar(255) not null,
 varchar(255) not null,
 uuid varchar(255),
 mysamplingmumble__idSuper varchar(255),
 primary key (id),
 unique (uuid)
 );

 to

 create table lingo_production.MySampleFuContainer_table (
 id_AbstractContainer varchar(255) not null,
 id varchar(255),
 mysamplingmumble_ tinyblob,
 uuid varchar(255),
 primary key (id_AbstractContainer),
 unique (id_AbstractContainer)
 );

 Best wishes,

 --greg


 On Mon, Jun 22, 2009 at 1:38 PM, Meredith Gregory <
 lgreg.mered...@gmail.com> wrote:

> Kris,
>
> Thanks for the suggestion. i've now got a tiny little example that
> compiles on its own that illustrates the problem. Changing the inheritance
> strategy to JOINED makes no difference. Hibernate still does the wrong
> thing.
>
> Best wishes,
>
> --greg
>
>
> On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe <
> kris.nuttyco...@gmail.com> wrote:
>
>> This may be off the mark, but I'm wondering if the reason that you're
>> having difficulty with the parallel inheritance hierarchy problem is
>> not your use of TABLE_PER_CLASS inheritance. In my application, I have
>> a similar construct, but I am using JOINED_TABLE inheritance. This
>> allows for a normal foreign key relationship to be created in the
>> database between C2_table and the base table for CThing, with the
>> result that Hibernate will generate the query for CThing member as a
>> union. Using table per class inheritance, I would expect Hibernate to
>> need to synthesize an additional dtype field in C2_table along with
>> the key column in order to enforce the uniqueness of the keys to the
>> joined entities, and I don't believe that it does this.
>>
>> I'm not sure how the fact that the code is generated is particularly
>> relevant; surely if it's possible to hand-write a successful solution,
>>

[Lift] Re: [scala] JPA question

2009-06-22 Thread Derek Chen-Becker
Ah, sorry, I lost track of the thread.

On Mon, Jun 22, 2009 at 4:55 PM, Meredith Gregory
wrote:

> Derek,
>
> You are correct and i noted and reported this on Scala on Friday. However,
> if you have a chain of the form
>
> AbstractClass <- Class <-contains- AbstractClass <-Class <-contains- ...
>
> The @MappedSuperclass solution fails at level 2.
>
> Best wishes,
>
> --greg
>
>
> On Mon, Jun 22, 2009 at 3:52 PM, Derek Chen-Becker 
> wrote:
>
>> Something I just want to throw out into the discussion: Since you're using
>> table-per-class, having a @Table annotation on AbstractContainer doesn't do
>> anything since abstract classes can't have instances. Tables are only
>> generated for abstract classes if you're using a JOINED inheritance
>> strategy. You might want to look at using the MappedSuperclass annotation
>> for the abstract base class instead. If I change the AbstractContainer def
>> to:
>>
>> @MappedSuperclass
>> public abstract class AbstractContainer implements java.io.Serializable {
>>
>> and then modify MySampleFuContainer to:
>>
>> public class MySampleFuContainer extends AbstractContainer {
>>
>> then I seem to get the proper schema:
>>
>> create table lingo_production.MySampleFuContainer_table (
>> id varchar(255) not null,
>> uuid varchar(255),
>> mysamplingmumble__idSuper varchar(255),
>> primary key (id),
>> unique (uuid)
>> );
>>
>>
>> Having said that, I think that the behavior you're currently seeing
>> appears to be a bug.
>>
>> Derek
>>
>>
>> On Mon, Jun 22, 2009 at 3:43 PM, Meredith Gregory <
>> lgreg.mered...@gmail.com> wrote:
>>
>>> Kris,
>>>
>>> Hereis 
>>> a link to the self-contained example that now uses just Java. i included
>>> the target dir in the repo to speed up investigation, but you can just blow
>>> that away and build from scratch. The example is currently written to
>>> Java1.6, but also exhibits the same behavior under Java1.5. To run the
>>> example
>>>
>>> > svn co
>>> http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
>>> ...
>>> > env PATH=:$PATH JAVA_HOME= mvn clean
>>> compile process-classes
>>>
>>> If you switch comment and decl at line 22 in
>>> src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error.
>>> The schema goes from
>>>
>>> create table lingo_production.MySampleFuContainer_table (
>>> id_AbstractContainer varchar(255) not null,
>>> varchar(255) not null,
>>> uuid varchar(255),
>>> mysamplingmumble__idSuper varchar(255),
>>> primary key (id),
>>> unique (uuid)
>>> );
>>>
>>> to
>>>
>>> create table lingo_production.MySampleFuContainer_table (
>>> id_AbstractContainer varchar(255) not null,
>>> id varchar(255),
>>> mysamplingmumble_ tinyblob,
>>> uuid varchar(255),
>>> primary key (id_AbstractContainer),
>>> unique (id_AbstractContainer)
>>> );
>>>
>>> Best wishes,
>>>
>>> --greg
>>>
>>>
>>> On Mon, Jun 22, 2009 at 1:38 PM, Meredith Gregory <
>>> lgreg.mered...@gmail.com> wrote:
>>>
 Kris,

 Thanks for the suggestion. i've now got a tiny little example that
 compiles on its own that illustrates the problem. Changing the inheritance
 strategy to JOINED makes no difference. Hibernate still does the wrong
 thing.

 Best wishes,

 --greg


 On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe <
 kris.nuttyco...@gmail.com> wrote:

> This may be off the mark, but I'm wondering if the reason that you're
> having difficulty with the parallel inheritance hierarchy problem is
> not your use of TABLE_PER_CLASS inheritance. In my application, I have
> a similar construct, but I am using JOINED_TABLE inheritance. This
> allows for a normal foreign key relationship to be created in the
> database between C2_table and the base table for CThing, with the
> result that Hibernate will generate the query for CThing member as a
> union. Using table per class inheritance, I would expect Hibernate to
> need to synthesize an additional dtype field in C2_table along with
> the key column in order to enforce the uniqueness of the keys to the
> joined entities, and I don't believe that it does this.
>
> I'm not sure how the fact that the code is generated is particularly
> relevant; surely if it's possible to hand-write a successful solution,
> then your code generator could be made aware of how to construct a
> viable solution?
>
> Kris
>
> On Fri, Jun 19, 2009 at 8:47 PM, Meredith
> Gregory wrote:
> > All,
> >
> > i had a similar problem and found the source of the issues. Spse you
> have a
> > container hierarchy (CTop <- C2) side-by-side with a contained
> hierarchy
> > (CThing <- CThing1). The inheritance at the top of the container
> hierarchy,
>

[Lift] Re: Class not found?

2009-06-22 Thread Charles F. Munat

I'll update it to 1.1-SNAPSHOT ASAP. Thanks!

(The page still displays, so it's not a show-stopper.)

Chas.

David Pollak wrote:
> Charles,
> 
> If you're running Lift 1.1-SNAPSHOT in developer mode, you'll get a very 
> nice error message in the browser giving you more details on which 
> snippet was not found.
> 
> Thanks,
> 
> David
> 
> On Fri, Jun 19, 2009 at 6:53 PM, Charles F. Munat  > wrote:
> 
> 
> I'm still confused about this:
> 
> WARN - Snippet Failure: SnippetFailure(/events/competitions/ ->
> ParsePath(List(events, competition,
> index),,true,false),Full(default),Class Not Found)
> 
> Anyone know what this means?
> 
> Chas.
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

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



[Lift] Re: Trouble with menus and CRUDify

2009-06-22 Thread David Pollak
On Mon, Jun 22, 2009 at 5:00 PM, Nolan Darilek wrote:

>
> I'm setting up my first model with CRUDify, but I'm having a hard time
> trying to figure out how to insert the auto-generated menus into my
> sitemap. Currently I have:
>
> val entries = Menu(Loc("Home", List("index"), "Home")) ::
> Layout.menus :: User.sitemap
> LiftRules.setSiteMap(SiteMap(entries:_*))


Try:

val entries = Menu(Loc("Home", List("index"), "Home")) ::
Layout.menus ::: User.sitemap


Note the triple colon (:::) operator.  This concatenates two lists.


>
> This gives:
>
> [error]  found   : List[Product]
> [error]  required: Seq[net.liftweb.sitemap.Menu]
> [error] LiftRules.setSiteMap(SiteMap(entries:_*))
> [error]  ^
>
> I've tried various permutations on this, and if I remove Layout.menus,
> everything compiles. Same thing for User.sitemap. But I can't have both
> Layout.menus and User.sitemap in the same val or the attempt to set it
> as the sitemap fails.
>
> Any idea what's up?
>
>
> >
>


-- 
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] Trouble with menus and CRUDify

2009-06-22 Thread Nolan Darilek

I'm setting up my first model with CRUDify, but I'm having a hard time 
trying to figure out how to insert the auto-generated menus into my 
sitemap. Currently I have:

 val entries = Menu(Loc("Home", List("index"), "Home")) :: 
Layout.menus :: User.sitemap
 LiftRules.setSiteMap(SiteMap(entries:_*))

This gives:

[error]  found   : List[Product]
[error]  required: Seq[net.liftweb.sitemap.Menu]
[error] LiftRules.setSiteMap(SiteMap(entries:_*))
[error]  ^

I've tried various permutations on this, and if I remove Layout.menus, 
everything compiles. Same thing for User.sitemap. But I can't have both 
Layout.menus and User.sitemap in the same val or the attempt to set it 
as the sitemap fails.

Any idea what's up?


--~--~-~--~~~---~--~~
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: 3 question Lift quiz

2009-06-22 Thread David Pollak
Sorry it took so long to get back to you.

On Sat, Jun 13, 2009 at 4:56 PM, David Persons  wrote:

>
> Hello heavy lifters,
>
> After a couple of late night Lift play-around sessions I thought this
> time I might as well ask the questions to you guys and get some
> sleep :-) I use a model which consists of storyboards and scenes. I
> use the Mapper Framework (for the first time). Underneath I have
> pasted some example code, I want to add content to a scene by
> uploading a file and selecting a type.
>
> 1. I want to write the uploaded file to disk. My approach underneath
> is not working, maybe I am just completely misunderstanding something.
> How to change the example so I can save to disk?


bind("ul", chooseTemplate("choose", "get", xhtml),
"file_upload" -> fileUpload(ul => {val fos = new
FileOutputStream("filename"); fos.write(ul.file); fos.close()}))


>
>
> 2. A scene maps to a storyboard (object storyboard extends
> MappedLongForeignKey(this, StoryBoard)). What is the the prettiest way
> of storing this storyboard in the currentStoryBoardVar?? I cannot
> simply say scene.storyboard because that results in a Long value.
> Furthermore, I now use the Box open_! method while that might not be
> necessary. So, there must be a very easy way to do this but I have not
> found it yet..


object currentStoryBoard extends SessionVar[Box[StoryBoard]](Empty)

when a StoryBoard is selected:

currentStoryBoard.set(myRow.storyboard.obj)

When you access the currentStoryBoard, use the for comprehension:

for {
  user <- User.currentUser
  storyBoard <- currentStoryBoard.is
  ...
  } yield calculation based on the user, storyboard, etc.



>
>
> 3. content.contenttype is a mapped enum (object contenttype extends
> MappedEnum(this, ContentType)):
>
> object ContentType extends Enumeration {
>  val Text = Value("text")
>  val Image = Value("image")
>  val Video = Value("video")
> }
>
> I use mysql for storage, how to map to a mysql enum
> ('text','image','video') field instead of the bigint(20) field it maps
> to right now?


Not super-easy.  I'd suggest looking at the MappedEnum implementation and
doing the same impl on top of MappedString, but looking up based on String
rather than Int.

Thanks,

David


>
>
> Thanks a lot!
>
> David Persons
>
> *** C O D E ***
>
> object currentStoryBoardVar extends RequestVar[Box[StoryBoard]](Empty)
> object currentSceneVar extends RequestVar[Box[Scene]](Empty)
>
> // the request-local variable that holds the file parameter
> private object theUpload extends RequestVar[Box[FileParamHolder]]
> (Empty)
>
> def addContent(form: NodeSeq) = {
>  val scene = currentSceneVar.is
>  val content = Content.create.scene(scene)
>
>  def checkAndSave(): Unit =
>content.validate match {
>  case Nil => {
>content.save
>writeToFile
>S.redirectTo("/editSB", () => currentStoryBoardVar(Full
> (scene.open_!.storyboard)))
>  }
>  case xs => S.error(xs); S.mapSnippet("SB.addContent", doBind)
>}
>
>  def writeToFile(): Unit = {
>theUpload.is match {
>  case Full(FileParamHolder(_, _, _, data)) => {
>val stream = new FileOutputStream(new File("test.file"))
>stream.write(data)
>stream.close()
>  }
>  case _ =>
>}
>  }
>
>  def doBind(form: NodeSeq) =
>bind("content", form,
>  "contentType" -> content.contenttype.toForm,
>  "fileUpload" -> fileUpload(ul => theUpload(Full(ul))),
>  "submit" -> submit("Add", checkAndSave))
>doBind(form)
> }
>
> >
>


-- 
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: [scala] JPA question

2009-06-22 Thread Meredith Gregory
P.S. While i am waiting for the Hibernate folks to respond to the issue, i
am looking into Stefan Zeiger's LINQ implementation for Scala more
seriously. If it is reasonably stable, this is a much better target for my
compilation scheme, anyway.

On Mon, Jun 22, 2009 at 3:55 PM, Meredith Gregory
wrote:

> Derek,
>
> You are correct and i noted and reported this on Scala on Friday. However,
> if you have a chain of the form
>
> AbstractClass <- Class <-contains- AbstractClass <-Class <-contains- ...
>
> The @MappedSuperclass solution fails at level 2.
>
> Best wishes,
>
> --greg
>
>
> On Mon, Jun 22, 2009 at 3:52 PM, Derek Chen-Becker 
> wrote:
>
>> Something I just want to throw out into the discussion: Since you're using
>> table-per-class, having a @Table annotation on AbstractContainer doesn't do
>> anything since abstract classes can't have instances. Tables are only
>> generated for abstract classes if you're using a JOINED inheritance
>> strategy. You might want to look at using the MappedSuperclass annotation
>> for the abstract base class instead. If I change the AbstractContainer def
>> to:
>>
>> @MappedSuperclass
>> public abstract class AbstractContainer implements java.io.Serializable {
>>
>> and then modify MySampleFuContainer to:
>>
>> public class MySampleFuContainer extends AbstractContainer {
>>
>> then I seem to get the proper schema:
>>
>> create table lingo_production.MySampleFuContainer_table (
>> id varchar(255) not null,
>> uuid varchar(255),
>> mysamplingmumble__idSuper varchar(255),
>> primary key (id),
>> unique (uuid)
>> );
>>
>>
>> Having said that, I think that the behavior you're currently seeing
>> appears to be a bug.
>>
>> Derek
>>
>>
>> On Mon, Jun 22, 2009 at 3:43 PM, Meredith Gregory <
>> lgreg.mered...@gmail.com> wrote:
>>
>>> Kris,
>>>
>>> Hereis 
>>> a link to the self-contained example that now uses just Java. i included
>>> the target dir in the repo to speed up investigation, but you can just blow
>>> that away and build from scratch. The example is currently written to
>>> Java1.6, but also exhibits the same behavior under Java1.5. To run the
>>> example
>>>
>>> > svn co
>>> http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
>>> ...
>>> > env PATH=:$PATH JAVA_HOME= mvn clean
>>> compile process-classes
>>>
>>> If you switch comment and decl at line 22 in
>>> src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error.
>>> The schema goes from
>>>
>>> create table lingo_production.MySampleFuContainer_table (
>>> id_AbstractContainer varchar(255) not null,
>>> varchar(255) not null,
>>> uuid varchar(255),
>>> mysamplingmumble__idSuper varchar(255),
>>> primary key (id),
>>> unique (uuid)
>>> );
>>>
>>> to
>>>
>>> create table lingo_production.MySampleFuContainer_table (
>>> id_AbstractContainer varchar(255) not null,
>>> id varchar(255),
>>> mysamplingmumble_ tinyblob,
>>> uuid varchar(255),
>>> primary key (id_AbstractContainer),
>>> unique (id_AbstractContainer)
>>> );
>>>
>>> Best wishes,
>>>
>>> --greg
>>>
>>>
>>> On Mon, Jun 22, 2009 at 1:38 PM, Meredith Gregory <
>>> lgreg.mered...@gmail.com> wrote:
>>>
 Kris,

 Thanks for the suggestion. i've now got a tiny little example that
 compiles on its own that illustrates the problem. Changing the inheritance
 strategy to JOINED makes no difference. Hibernate still does the wrong
 thing.

 Best wishes,

 --greg


 On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe <
 kris.nuttyco...@gmail.com> wrote:

> This may be off the mark, but I'm wondering if the reason that you're
> having difficulty with the parallel inheritance hierarchy problem is
> not your use of TABLE_PER_CLASS inheritance. In my application, I have
> a similar construct, but I am using JOINED_TABLE inheritance. This
> allows for a normal foreign key relationship to be created in the
> database between C2_table and the base table for CThing, with the
> result that Hibernate will generate the query for CThing member as a
> union. Using table per class inheritance, I would expect Hibernate to
> need to synthesize an additional dtype field in C2_table along with
> the key column in order to enforce the uniqueness of the keys to the
> joined entities, and I don't believe that it does this.
>
> I'm not sure how the fact that the code is generated is particularly
> relevant; surely if it's possible to hand-write a successful solution,
> then your code generator could be made aware of how to construct a
> viable solution?
>
> Kris
>
> On Fri, Jun 19, 2009 at 8:47 PM, Meredith
> Gregory wrote:
> > All,
> >
> > i had a similar problem and found the source of the issues

[Lift] Re: [scala] JPA question

2009-06-22 Thread Meredith Gregory
Derek,

You are correct and i noted and reported this on Scala on Friday. However,
if you have a chain of the form

AbstractClass <- Class <-contains- AbstractClass <-Class <-contains- ...

The @MappedSuperclass solution fails at level 2.

Best wishes,

--greg

On Mon, Jun 22, 2009 at 3:52 PM, Derek Chen-Becker wrote:

> Something I just want to throw out into the discussion: Since you're using
> table-per-class, having a @Table annotation on AbstractContainer doesn't do
> anything since abstract classes can't have instances. Tables are only
> generated for abstract classes if you're using a JOINED inheritance
> strategy. You might want to look at using the MappedSuperclass annotation
> for the abstract base class instead. If I change the AbstractContainer def
> to:
>
> @MappedSuperclass
> public abstract class AbstractContainer implements java.io.Serializable {
>
> and then modify MySampleFuContainer to:
>
> public class MySampleFuContainer extends AbstractContainer {
>
> then I seem to get the proper schema:
>
> create table lingo_production.MySampleFuContainer_table (
> id varchar(255) not null,
> uuid varchar(255),
> mysamplingmumble__idSuper varchar(255),
> primary key (id),
> unique (uuid)
> );
>
>
> Having said that, I think that the behavior you're currently seeing appears
> to be a bug.
>
> Derek
>
>
> On Mon, Jun 22, 2009 at 3:43 PM, Meredith Gregory <
> lgreg.mered...@gmail.com> wrote:
>
>> Kris,
>>
>> Here is 
>> a link to the self-contained example that now uses just Java. i included
>> the target dir in the repo to speed up investigation, but you can just blow
>> that away and build from scratch. The example is currently written to
>> Java1.6, but also exhibits the same behavior under Java1.5. To run the
>> example
>>
>> > svn co
>> http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
>> ...
>> > env PATH=:$PATH JAVA_HOME= mvn clean
>> compile process-classes
>>
>> If you switch comment and decl at line 22 in
>> src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error.
>> The schema goes from
>>
>> create table lingo_production.MySampleFuContainer_table (
>> id_AbstractContainer varchar(255) not null,
>> varchar(255) not null,
>> uuid varchar(255),
>> mysamplingmumble__idSuper varchar(255),
>> primary key (id),
>> unique (uuid)
>> );
>>
>> to
>>
>> create table lingo_production.MySampleFuContainer_table (
>> id_AbstractContainer varchar(255) not null,
>> id varchar(255),
>> mysamplingmumble_ tinyblob,
>> uuid varchar(255),
>> primary key (id_AbstractContainer),
>> unique (id_AbstractContainer)
>> );
>>
>> Best wishes,
>>
>> --greg
>>
>>
>> On Mon, Jun 22, 2009 at 1:38 PM, Meredith Gregory <
>> lgreg.mered...@gmail.com> wrote:
>>
>>> Kris,
>>>
>>> Thanks for the suggestion. i've now got a tiny little example that
>>> compiles on its own that illustrates the problem. Changing the inheritance
>>> strategy to JOINED makes no difference. Hibernate still does the wrong
>>> thing.
>>>
>>> Best wishes,
>>>
>>> --greg
>>>
>>>
>>> On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe <
>>> kris.nuttyco...@gmail.com> wrote:
>>>
 This may be off the mark, but I'm wondering if the reason that you're
 having difficulty with the parallel inheritance hierarchy problem is
 not your use of TABLE_PER_CLASS inheritance. In my application, I have
 a similar construct, but I am using JOINED_TABLE inheritance. This
 allows for a normal foreign key relationship to be created in the
 database between C2_table and the base table for CThing, with the
 result that Hibernate will generate the query for CThing member as a
 union. Using table per class inheritance, I would expect Hibernate to
 need to synthesize an additional dtype field in C2_table along with
 the key column in order to enforce the uniqueness of the keys to the
 joined entities, and I don't believe that it does this.

 I'm not sure how the fact that the code is generated is particularly
 relevant; surely if it's possible to hand-write a successful solution,
 then your code generator could be made aware of how to construct a
 viable solution?

 Kris

 On Fri, Jun 19, 2009 at 8:47 PM, Meredith
 Gregory wrote:
 > All,
 >
 > i had a similar problem and found the source of the issues. Spse you
 have a
 > container hierarchy (CTop <- C2) side-by-side with a contained
 hierarchy
 > (CThing <- CThing1). The inheritance at the top of the container
 hierarchy,
 > CTop, causes hibernate to bail on tracking the relations and punt to
 > embedded values instead. Rewriting the top to be a @MappedSuperClass
 fixes
 > the problem in this specific case. However, if your hierarchy is deep,
 > you're s

[Lift] Re: JPA and auto generation of id

2009-06-22 Thread Derek Chen-Becker
Also, what does the schema for the entity's table look like?

On Mon, Jun 22, 2009 at 4:54 PM, Derek Chen-Becker wrote:

> Mind posting the snippet of code where you're saving the instance? A merge
> should interpret a null ID as a fresh instance, and a persist should just
> save it.
>
> Derek
>
>
> On Mon, Jun 22, 2009 at 1:50 PM, David Persons wrote:
>
>>
>> I am using MySql (5). After setting the hibernate.dialect to
>> org.hibernate.dialect.MySQLDialect in my persistence.xml file, I get a
>> org.hibernate.AssertionFailure: null id :-s
>>
>> cheers
>>
>> On 22 jun, 19:18, Derek Chen-Becker  wrote:
>> > That's not accurate, at least with Hibernate. By putting the annotations
>> on
>> > vars, the compiler ends up putting them on the internal fields, which
>> then
>> > forces Hibernate into a field-based persistence model and not a
>> > getter/setter based one. The SQLGrammarException is most likely what the
>> > other people have said. If you're in Oracle or PostgreSQL, for instance,
>> you
>> > need a sequence set up for the auto identity model. What database are
>> you
>> > using?
>> >
>> > Derek
>> >
>> > On Mon, Jun 22, 2009 at 8:54 AM, Eric Bowman  wrote:
>> >
>> > > David Persons wrote:
>> > > > Hello guys,
>> >
>> > > > I get a org.hibernate.exception.SQLGrammarException: could not get
>> or
>> > > > update next value error everytime I try to save the following
>> Entity:
>> >
>> > > > @Entity
>> > > > class Scene {
>> > > >   @Id
>> > > >   @GeneratedValue(){val strategy = GenerationType.AUTO}
>> > > >   var id : Long = _
>> >
>> > > >   @Column{val unique = true, val nullable = false}
>> > > >   var ordering : Int = _
>> >
>> > > >   @Column{val unique = true, val nullable = false}
>> > > >   var name : String = ""
>> >
>> > > >   @ManyToOne{val optional = false}
>> > > >   var storyBoard : StoryBoard = _
>> > > > }
>> >
>> > > You almost certainly need some scala.reflect.BeanProperty annotations
>> on
>> > > your fields.
>> >
>> > > cheers,
>> > > Eric
>> >
>> > > --
>> > > Eric Bowman
>> > > Boboco Ltd
>> > > ebow...@boboco.ie
>> > >http://www.boboco.ie/ebowman/pubkey.pgp
>> > > +35318394189/+353872801532<
>> http://www.boboco.ie/ebowman/pubkey.pgp%0A+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] Re: JPA and auto generation of id

2009-06-22 Thread Derek Chen-Becker
Mind posting the snippet of code where you're saving the instance? A merge
should interpret a null ID as a fresh instance, and a persist should just
save it.

Derek

On Mon, Jun 22, 2009 at 1:50 PM, David Persons  wrote:

>
> I am using MySql (5). After setting the hibernate.dialect to
> org.hibernate.dialect.MySQLDialect in my persistence.xml file, I get a
> org.hibernate.AssertionFailure: null id :-s
>
> cheers
>
> On 22 jun, 19:18, Derek Chen-Becker  wrote:
> > That's not accurate, at least with Hibernate. By putting the annotations
> on
> > vars, the compiler ends up putting them on the internal fields, which
> then
> > forces Hibernate into a field-based persistence model and not a
> > getter/setter based one. The SQLGrammarException is most likely what the
> > other people have said. If you're in Oracle or PostgreSQL, for instance,
> you
> > need a sequence set up for the auto identity model. What database are you
> > using?
> >
> > Derek
> >
> > On Mon, Jun 22, 2009 at 8:54 AM, Eric Bowman  wrote:
> >
> > > David Persons wrote:
> > > > Hello guys,
> >
> > > > I get a org.hibernate.exception.SQLGrammarException: could not get or
> > > > update next value error everytime I try to save the following Entity:
> >
> > > > @Entity
> > > > class Scene {
> > > >   @Id
> > > >   @GeneratedValue(){val strategy = GenerationType.AUTO}
> > > >   var id : Long = _
> >
> > > >   @Column{val unique = true, val nullable = false}
> > > >   var ordering : Int = _
> >
> > > >   @Column{val unique = true, val nullable = false}
> > > >   var name : String = ""
> >
> > > >   @ManyToOne{val optional = false}
> > > >   var storyBoard : StoryBoard = _
> > > > }
> >
> > > You almost certainly need some scala.reflect.BeanProperty annotations
> on
> > > your fields.
> >
> > > cheers,
> > > Eric
> >
> > > --
> > > Eric Bowman
> > > Boboco Ltd
> > > ebow...@boboco.ie
> > >http://www.boboco.ie/ebowman/pubkey.pgp
> > > +35318394189/+353872801532<
> http://www.boboco.ie/ebowman/pubkey.pgp%0A+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] Re: [scala] JPA question

2009-06-22 Thread Derek Chen-Becker
Something I just want to throw out into the discussion: Since you're using
table-per-class, having a @Table annotation on AbstractContainer doesn't do
anything since abstract classes can't have instances. Tables are only
generated for abstract classes if you're using a JOINED inheritance
strategy. You might want to look at using the MappedSuperclass annotation
for the abstract base class instead. If I change the AbstractContainer def
to:

@MappedSuperclass
public abstract class AbstractContainer implements java.io.Serializable {

and then modify MySampleFuContainer to:

public class MySampleFuContainer extends AbstractContainer {

then I seem to get the proper schema:

create table lingo_production.MySampleFuContainer_table (
id varchar(255) not null,
uuid varchar(255),
mysamplingmumble__idSuper varchar(255),
primary key (id),
unique (uuid)
);


Having said that, I think that the behavior you're currently seeing appears
to be a bug.

Derek

On Mon, Jun 22, 2009 at 3:43 PM, Meredith Gregory
wrote:

> Kris,
>
> Here is a 
> link to the self-contained example that now uses just Java. i included
> the target dir in the repo to speed up investigation, but you can just blow
> that away and build from scratch. The example is currently written to
> Java1.6, but also exhibits the same behavior under Java1.5. To run the
> example
>
> > svn co http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
> ...
> > env PATH=:$PATH JAVA_HOME= mvn clean
> compile process-classes
>
> If you switch comment and decl at line 22 in
> src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error.
> The schema goes from
>
> create table lingo_production.MySampleFuContainer_table (
> id_AbstractContainer varchar(255) not null,
> varchar(255) not null,
> uuid varchar(255),
> mysamplingmumble__idSuper varchar(255),
> primary key (id),
> unique (uuid)
> );
>
> to
>
> create table lingo_production.MySampleFuContainer_table (
> id_AbstractContainer varchar(255) not null,
> id varchar(255),
> mysamplingmumble_ tinyblob,
> uuid varchar(255),
> primary key (id_AbstractContainer),
> unique (id_AbstractContainer)
> );
>
> Best wishes,
>
> --greg
>
>
> On Mon, Jun 22, 2009 at 1:38 PM, Meredith Gregory <
> lgreg.mered...@gmail.com> wrote:
>
>> Kris,
>>
>> Thanks for the suggestion. i've now got a tiny little example that
>> compiles on its own that illustrates the problem. Changing the inheritance
>> strategy to JOINED makes no difference. Hibernate still does the wrong
>> thing.
>>
>> Best wishes,
>>
>> --greg
>>
>>
>> On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe <
>> kris.nuttyco...@gmail.com> wrote:
>>
>>> This may be off the mark, but I'm wondering if the reason that you're
>>> having difficulty with the parallel inheritance hierarchy problem is
>>> not your use of TABLE_PER_CLASS inheritance. In my application, I have
>>> a similar construct, but I am using JOINED_TABLE inheritance. This
>>> allows for a normal foreign key relationship to be created in the
>>> database between C2_table and the base table for CThing, with the
>>> result that Hibernate will generate the query for CThing member as a
>>> union. Using table per class inheritance, I would expect Hibernate to
>>> need to synthesize an additional dtype field in C2_table along with
>>> the key column in order to enforce the uniqueness of the keys to the
>>> joined entities, and I don't believe that it does this.
>>>
>>> I'm not sure how the fact that the code is generated is particularly
>>> relevant; surely if it's possible to hand-write a successful solution,
>>> then your code generator could be made aware of how to construct a
>>> viable solution?
>>>
>>> Kris
>>>
>>> On Fri, Jun 19, 2009 at 8:47 PM, Meredith
>>> Gregory wrote:
>>> > All,
>>> >
>>> > i had a similar problem and found the source of the issues. Spse you
>>> have a
>>> > container hierarchy (CTop <- C2) side-by-side with a contained
>>> hierarchy
>>> > (CThing <- CThing1). The inheritance at the top of the container
>>> hierarchy,
>>> > CTop, causes hibernate to bail on tracking the relations and punt to
>>> > embedded values instead. Rewriting the top to be a @MappedSuperClass
>>> fixes
>>> > the problem in this specific case. However, if your hierarchy is deep,
>>> > you're screwed.
>>> >
>>> > If anybody has a suggestion for a workaround, i'm all ears. The problem
>>> is
>>> > that it would appear that both Mr Crowley and i are generating Java +
>>> JPA
>>> > code. So, the solution needs to be algorithmic and not 1-off.
>>> >
>>> > Perhaps the best solution is to find an alternative to hibernate as
>>> this is
>>> > a particularly irritating bug.
>>> >
>>> > Best wishes,
>>> >
>>> > --greg
>>> >
>>> > @Entity
>>> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)

[Lift] Re: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Dano

Rudi,

Thanks for posting your Intellij specifics.  Wondering if you are
using the debugger and find that it works for your scala/lift
debugging?


Dano

On Jun 22, 2:57 pm, Rudi Engelbrecht  wrote:
> I know you are looking for a working Eclipse configuration, but I have  
> had great success and stability with
>
> IntelliJ IDEA 8.1.2
> Scala 2.7.4
> The Scala plugin for IDEA
> Lift 1.0
>
> I can do "mvn jetty:run" from the IDE and what is really cool is that  
> I can set breakpoints and debug the "mvn jetty:run" target from IDEA  
> and then explore the scala code.
>
> Just thought I will post version numbers of a working environment.
>
> Regards
>
> Rudi
>
> On 22 Jun 2009, at 8:35 PM, David Pollak  
>
>
>
>  wrote:
>
> > On Mon, Jun 22, 2009 at 11:25 AM, Ellis   
> > wrote:
>
> > Hello David,
>
> > Thanks for your reply.  Do you know whether lift *should* work with
> > scala 2.8 when we pull it from the maven repositories?
>
> > Lift currently only works with Scala 2.7.4.  You can use Eclipse and  
> > 2.7.5 to edit Lift files, but Lift must be deployed against 2.7.4.
>
> > We will have a branch of Lift (Jorge... you got this running yet)  
> > building against 2.8, but it will be experimental.
>
> > I have experienced a fair number of suboptimalities with Lift and  
> > Eclipse in the last 3 weeks with the 2.7.5 stable plugin.  I have  
> > had success recently with NetBeans, IntelliJ, and emacs.
>
> >  If so, then
> > I'll try deleting my ~/.m2 as Tim suggested.
>
> > Thanks,
> > Ellis
>
> > On Jun 22, 8:14 pm, David Pollak 
> > wrote:
> > > Ellis,
> > > Miles will be back online in a few days, but I suspect that the  
> > answer is
> > > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is  
> > going to
> > > have bugs. :-(
>
> > > Sorry.
>
> > > David
>
> > > On Mon, Jun 22, 2009 at 11:08 AM, Ellis  
> >  wrote:
>
> > > > Hello everyone,
>
> > > > Does anyone have a setup for eclipse that works like it should?  
> > By
> > > > "like it should", I mostly mean that the scala plugin doesn't  
> > crash
> > > > regularly AND it works with lift/maven.  If so, which versions of
> > > > which plugins are you using?
>
> > > > The nightly build of the scala plugin seems to work better than
> > > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > > > maven due to "signature differences" between the scala libraries.
>
> > > > Best regards,
> > > > Ellis
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Git some:http://github.com/dpp
>
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Rudi Engelbrecht
I know you are looking for a working Eclipse configuration, but I have  
had great success and stability with

IntelliJ IDEA 8.1.2
Scala 2.7.4
The Scala plugin for IDEA
Lift 1.0

I can do "mvn jetty:run" from the IDE and what is really cool is that  
I can set breakpoints and debug the "mvn jetty:run" target from IDEA  
and then explore the scala code.

Just thought I will post version numbers of a working environment.

Regards

Rudi


On 22 Jun 2009, at 8:35 PM, David Pollak  
 wrote:

>
>
> On Mon, Jun 22, 2009 at 11:25 AM, Ellis   
> wrote:
>
> Hello David,
>
> Thanks for your reply.  Do you know whether lift *should* work with
> scala 2.8 when we pull it from the maven repositories?
>
> Lift currently only works with Scala 2.7.4.  You can use Eclipse and  
> 2.7.5 to edit Lift files, but Lift must be deployed against 2.7.4.
>
> We will have a branch of Lift (Jorge... you got this running yet)  
> building against 2.8, but it will be experimental.
>
> I have experienced a fair number of suboptimalities with Lift and  
> Eclipse in the last 3 weeks with the 2.7.5 stable plugin.  I have  
> had success recently with NetBeans, IntelliJ, and emacs.
>
>  If so, then
> I'll try deleting my ~/.m2 as Tim suggested.
>
> Thanks,
> Ellis
>
>
> On Jun 22, 8:14 pm, David Pollak 
> wrote:
> > Ellis,
> > Miles will be back online in a few days, but I suspect that the  
> answer is
> > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is  
> going to
> > have bugs. :-(
> >
> > Sorry.
> >
> > David
> >
> >
> >
> > On Mon, Jun 22, 2009 at 11:08 AM, Ellis  
>  wrote:
> >
> > > Hello everyone,
> >
> > > Does anyone have a setup for eclipse that works like it should?   
> By
> > > "like it should", I mostly mean that the scala plugin doesn't  
> crash
> > > regularly AND it works with lift/maven.  If so, which versions of
> > > which plugins are you using?
> >
> > > The nightly build of the scala plugin seems to work better than
> > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > > maven due to "signature differences" between the scala libraries.
> >
> > > Best regards,
> > > Ellis
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
>
>
>
>
>
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >

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



[Lift] Re: [scala] JPA question

2009-06-22 Thread Meredith Gregory
Kris,

Here  is
a link to the self-contained example that now uses just Java. i included the
target dir in the repo to speed up investigation, but you can just blow that
away and build from scratch. The example is currently written to Java1.6,
but also exhibits the same behavior under Java1.5. To run the example

> svn co http://svn.biosimilarity.com/src/open/codesamples/trunk/hibernate
...
> env PATH=:$PATH JAVA_HOME= mvn clean
compile process-classes

If you switch comment and decl at line 22 in
src/main/java/maxb/hbex2/MySampleFuContainer.java then you see the error.
The schema goes from

create table lingo_production.MySampleFuContainer_table (
id_AbstractContainer varchar(255) not null,
varchar(255) not null,
uuid varchar(255),
mysamplingmumble__idSuper varchar(255),
primary key (id),
unique (uuid)
);

to

create table lingo_production.MySampleFuContainer_table (
id_AbstractContainer varchar(255) not null,
id varchar(255),
mysamplingmumble_ tinyblob,
uuid varchar(255),
primary key (id_AbstractContainer),
unique (id_AbstractContainer)
);

Best wishes,

--greg

On Mon, Jun 22, 2009 at 1:38 PM, Meredith Gregory
wrote:

> Kris,
>
> Thanks for the suggestion. i've now got a tiny little example that compiles
> on its own that illustrates the problem. Changing the inheritance strategy
> to JOINED makes no difference. Hibernate still does the wrong thing.
>
> Best wishes,
>
> --greg
>
>
> On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe <
> kris.nuttyco...@gmail.com> wrote:
>
>> This may be off the mark, but I'm wondering if the reason that you're
>> having difficulty with the parallel inheritance hierarchy problem is
>> not your use of TABLE_PER_CLASS inheritance. In my application, I have
>> a similar construct, but I am using JOINED_TABLE inheritance. This
>> allows for a normal foreign key relationship to be created in the
>> database between C2_table and the base table for CThing, with the
>> result that Hibernate will generate the query for CThing member as a
>> union. Using table per class inheritance, I would expect Hibernate to
>> need to synthesize an additional dtype field in C2_table along with
>> the key column in order to enforce the uniqueness of the keys to the
>> joined entities, and I don't believe that it does this.
>>
>> I'm not sure how the fact that the code is generated is particularly
>> relevant; surely if it's possible to hand-write a successful solution,
>> then your code generator could be made aware of how to construct a
>> viable solution?
>>
>> Kris
>>
>> On Fri, Jun 19, 2009 at 8:47 PM, Meredith
>> Gregory wrote:
>> > All,
>> >
>> > i had a similar problem and found the source of the issues. Spse you
>> have a
>> > container hierarchy (CTop <- C2) side-by-side with a contained hierarchy
>> > (CThing <- CThing1). The inheritance at the top of the container
>> hierarchy,
>> > CTop, causes hibernate to bail on tracking the relations and punt to
>> > embedded values instead. Rewriting the top to be a @MappedSuperClass
>> fixes
>> > the problem in this specific case. However, if your hierarchy is deep,
>> > you're screwed.
>> >
>> > If anybody has a suggestion for a workaround, i'm all ears. The problem
>> is
>> > that it would appear that both Mr Crowley and i are generating Java +
>> JPA
>> > code. So, the solution needs to be algorithmic and not 1-off.
>> >
>> > Perhaps the best solution is to find an alternative to hibernate as this
>> is
>> > a particularly irritating bug.
>> >
>> > Best wishes,
>> >
>> > --greg
>> >
>> > @Entity
>> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
>> > abstract class CTop {
>> >...
>> >@Id
>> > @GeneratedValue(generator = "system-uuid")
>> > @GenericGenerator(name = "system-uuid", strategy = "uuid")
>> > private String id_CTop;
>> > }
>> >
>> > @Entity
>> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
>> > abstract class CThing {
>> >...
>> >@Id
>> > @GeneratedValue(generator = "system-uuid")
>> > @GenericGenerator(name = "system-uuid", strategy = "uuid")
>> > private String id_CThing;
>> > }
>> >
>> > @Entity
>> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
>> > @Table(name = "C2_table", catalog = "mydb_production", uniqueConstraints
>> = {
>> > @UniqueConstraint(columnNames = "uuid") })
>> > class C2 extends CTop {
>> >CThing thing;
>> > ...
>> >   @OneToOne
>> > @JoinColumn
>> > public CThing getThing() {
>> > return this.thing;
>> > }
>> > public void setThing( CThing thing ) {
>> > this.thing = thing;
>> > }
>> >
>> > @Column(name = "uuid", unique = false, nullable = true, insertable =
>> true,
>> > updatable = true)
>> > public String getUuid() {
>> > return this.uuid;
>> > }
>> >
>> > public void setUuid(String uuid) {
>> > this

[Lift] Re: lift-paypal: Paypal Production PDT not working - help!

2009-06-22 Thread Dano

When the pdtPath was "complete", I did have my Paypal account
configured to .../paypal/complete.  The odd thing was that this worked
in my development account but NOT in the paypal production account
which is painful because I had to do testing on the production account
with real money.

When I removed my override (the default reverting back to "pdt"), I
changed my Paypal account to auto return to .../paypal/pdt and BOTH my
dev and production paypal accounts worked.

Maybe I had something else misaligned.  Another moral to the story is
to make sure this stuff works well in advance of launching a
production site (something David did warn me about).


Dan

On Jun 22, 2:11 pm, David Pollak 
wrote:
> My guess is that he had the wrong URL in the Auto Return.
>
> On Mon, Jun 22, 2009 at 1:30 AM, Timothy Perrett 
> wrote:
>
>
>
>
>
>
>
> > Hey chaps... sorry for my late reply (just flew in from Egypt!)
>
> > The pdtPath is configurable already, right?
>
> > object SimplePaypal extends PaypalPDT {
> >  def pdtPath: String = "yourendpoint"
> >  
> > }
>
> > Im not sure why this would cause an issue as if you look at the
> > dispatch:
>
> > Req(RootPath :: PDTPath :: Nil, "", PostRequest)
>
> > Its just concatenating both the rootPath and the pdtPath defs (via
> > lazy vals) - so you can set it to whatever you want within some basic
> > guidelines. What is it thats not happening for you exactly or in what
> > way do you feel its not configurable?
>
> > Cheers, Tim
>
> > On Jun 19, 2:07 am, David Pollak 
> > wrote:
> > > On Thu, Jun 18, 2009 at 3:17 PM, Derek Chen-Becker <
> > dchenbec...@gmail.com>wrote:
>
> > > > It seems to me that the pdtPath should be configurable. If other people
> > > > agree we should at least open an issue on GitHub to track this.
>
> > > Sure.
>
> > > > Derek
>
> > > > On Thu, Jun 18, 2009 at 3:07 PM, Dano  wrote:
>
> > > >> Resolved.
>
> > > >> I backed out my override on pdtPath and adjusted my paypal
> > > >> configuration to point to /paypal/pdt and things worked.
>
> > > >> Moral of the story: Do NOT override pdtPath!!
>
> > > >> On Jun 18, 12:07 pm, Dano  wrote:
> > > >> > Sorry, my post got submitted too early.
>
> > > >> > When I commented out the line: override def pdtPath = "complete"
>
> > > >> > I get the same failure mode as in production.
>
> > > >> > Do I need to set pdtPath or what do I change to work with the
> > default?
>
> > > >> > Thanks.
>
> > > >> > Dan
>
> > > >> > On Jun 18, 12:04 pm, Dano  wrote:
>
> > > >> > > More information:
>
> > > >> > > In my object which extends PaypalPDT, I had a line which
> > overridded
> > > >> > > the variable pdtPath:
>
> > > >> > > override def pdtPath = "complete"
>
> > > >> > > On Jun 18, 11:58 am, Dano  wrote:
>
> > > >> > > > I trying to get our site (buyafeature.com) live today and ran
> > into
> > > >> a
> > > >> > > > problem with the paypal feature.  I am using the lift-paypal
> > module
> > > >> > > > and things have been working just fine in development.
>
> > > >> > > > The problem I am seeing is that when I press the "Return to
> > Website"
> > > >> > > > button in paypal, it tries to redirect to the following URL:
>
> > > >>http://buyafeature.com/paypal/complete?tx=36627495TV601683L&st=Comple.
> > ..
>
> > > >> > > > And then the browser shows the following error:
>
> > > >> > > > The Requested URL /paypal/complete was not found on this server
>
> > > >> > > > I tried to reproduced this on the development sandbox but it
> > works
> > > >> > > > fine (i.e. returns to the starting page in my app and my server
> > gets
> > > >> > > > the PDT event).
>
> > > >> > > > Has anyone seen this or have any ideas on what to try?
>
> > > >> > > > Thanks in advance.
>
> > > >> > > > Dan
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Git some:http://github.com/dpp
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Git some:http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: MappedFields depending on one another

2009-06-22 Thread David Pollak
You can validate on the record as well as individual fields.
There are also a bunch of object lifecycle hooks in MetaMapper:


  def beforeValidation: List[A => Any] = Nil
  def beforeValidationOnCreate: List[A => Any] = Nil
  def beforeValidationOnUpdate: List[A => Any] = Nil
  def afterValidation: List[A => Any] = Nil
  def afterValidationOnCreate: List[A => Any] = Nil
  def afterValidationOnUpdate: List[A => Any] = Nil

  def beforeSave: List[A => Any] = Nil
  def beforeCreate: List[(A) => Any] = Nil
  def beforeUpdate: List[(A) => Any] = Nil

  def afterSave: List[(A) => Any] = Nil
  def afterCreate: List[(A) => Any] = Nil
  def afterUpdate: List[(A) => Any] = Nil

  def beforeDelete: List[(A) => Any] = Nil
  def afterDelete: List[(A) => Any] = Nil

/**

   * If there are model-specific validations to perform, override this

   * method and return an additional list of validations to perform

   */

  def validation: List[A => List[FieldError]] = Nil


Does this help?


2009/6/10 dflemstr 

>
> Hello everyone,
> I am currently using the Mapper framework to create a very complex
> data storage system. In this system, I have the need of changing one
> or more MappedFields depending on another MappedField, for example:
>
> trait NonUserEditable
>
> object MyMapper extends LongKeyedMetaMapper[MyMapper] with CRUDify
>
> class MyMapper extends LongKeyedMapper[MyMapper] with IdPK {
>  def getSingleton = MyMapper
>
>  object field1 extends MappedString(this, 64) with LifecycleCallbacks
> {
>override def beforeValidationOnUpdate {field2(is.capitalize);
> super.beforeValidationOnUpdate}
>  }
>
>  object field2 extends MappedString(this, 64) with NonUserEditable
> }
>
> I am now looking for the most elegant way to do this; I need
> validations on both fields above (which the above code doesn't allow),
> and I would like to use CRUDify as much as possible (which might be
> overkill but who knows).
> So, the goal is to allow for the following process :
> 1. The user submits a form containing data for field1 through CRUDify
> (→ done)
> 2. The data is stored in field1 by crudDoForm (→ done)
> 3. field1 is validated, but not field2 (→ How would I do this? Do I
> need to rewrite crudDoForm? Because now all fields are validated in
> one go, without filtering)
> 4. Some custom action in field1 is invoked that changes field2 (→ I
> can do this with afterValidationOnUpdate if the above point succeeds,
> but not otherwise)
> 5. field2 is changed (→ done, in the custom action)
> 6. field2 is validated (→ done)
> 7. Any errors from validations are displayed to the user (→ Can this
> be done? Specifically, can I validate field2 in the same cycle as
> field1?)
>
> I have hacked CRUDify with a NonUserEditable trait as demonstrated
> above (but my hacks are not ;) ) so that CRUDify doesn't include some
> fields in its "create" form (dbIncludeInForm_? is BROKEN; the CRUD
> "list" doesn't display the hidden field when overriding
> dbIncludeInForm_?), so think of the field2 as completely hidden to the
> user in the create form. The only problems remaining are the ones
> listed above.
>
> Any suggestions on how to solve this would be greatly appreciated.
>
> >
>


-- 
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: REST & Record

2009-06-22 Thread David Pollak
Interesting!

On Fri, Jun 19, 2009 at 11:45 AM, marius d.  wrote:

>
> Ok I just committed this support,
>
> Here is how it works:
>
>MyRecordMeta.appendDispatch {
>  case Req("create" :: Nil, _, _) => (record) => {
>println("created")
>Full(XmlResponse(
>  
>{record.firstName}
>{record.lastName}
>  
>))
>  }
>}
>
> appendDispatch/prependDispatch are extremely similar with DispatchPF
> but it does not return a () => Box[LiftResponse] instead it returns a
> (BaseRecord) => Box[LiftResponse]. Of course, under the hood it just
> registers a plain old DispatchPF but the point is that when our
> function gets called the record is already constructed baes on the
> inof from Req. Hence we can leverage Record's validations, have proper
> encapsulation out of the box and of course type-safety.
>
> Br's,
> Marius
>
> On Jun 18, 7:18 pm, Marius  wrote:
> > Hi,
> >
> > I think that Record framework may play a relevant role in processing
> > REST requests. I mean picture the following model:
> >
> > class MyRecord extends Record[MyRecord] {
> >
> > def meta = MyRecordMeta
> >
> > object firstName extends StringField(this, "John")
> > object lastName extends StringField(this, "Doe")
> >  }
> >
> > object MyRecordMeta extends MyRecord with MetaRecord[MyRecord] {
> >  override def mutable_? = false
> >
> > }
> >
> > In boot we could say something like:
> >
> > MyRecordMeta.dispatch.append {
> >
> > case (Req("create" :: "person" :: Nil, _, _), rec) =>
> > //rec is the record constructed by this meta record based on the
> > REST QS parameters.
> > val validationResult = MyRecordMeta.validate(rec)
> >
> > ...
> >// return a Box[LiftResponse]
> >
> > }
> >
> > // The http Request would look something like: http///create/
> > person?firstName=Isaac&lastName=Newton
> >
> > As you can see it is very similar with DispatchPF, in fact under the
> > hood it will just register a DispatchPF construct the record for us
> > and we can use the actual information in a type safe manner.
> >
> > I could add this support soon enough but first I'd like to know if you
> > think this would be helpful.
> >
> > Br's,
> > Marius
> >
>


-- 
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: Mapper and display generation

2009-06-22 Thread David Pollak
Glenn,
No obvious way of streamlining the process of adding attributes is coming to
mind.  Sorry :-(

For anything that's style-related, I'll suggest using CSS and doing
something like:


... generated form here


And then in your CSS:
#my_form input {
  width: 200px;
}



On Thu, Jun 18, 2009 at 5:02 PM, glenn  wrote:

>
> I'm looking for a relatively simple way to modify the form and form
> elements that are generated by Mapper, such as adding or modifying
> attributes.
>
> I've been using the following method in my model classes that extend
> Mapper:
>
> def mf(in: Node, name:String, value:String): NodeSeq = in match
> {
>case e: Elem => e % new UnprefixedAttribute(name, Text(value),
> Null)
>case _ => NodeSeq.Empty
>  }
>
> I then override _toForm method in the fields, like so:
>
> object description extends MappedString(this, 255) {
>   override def _toForm = super._toForm.map(_.flatMap(mf
> (_,"size","80")))
>  }
>
> This adds a "size" attribute to the input element on the form.
>
> I also tried this with WYMEditor, to output a xhtml editor:
>
> object detail extends MappedTextarea(this, 1024) {
>   override def _toForm = super._toForm.map(_.flatMap(mf
> (_,"class","wymeditor")))
>  }
>
> and it works OK. But it seems like there should be a simpler way to
> style field output. Also,
> if I wanted to add attributes to the submit button in the form,
> itself, say if  I CRUDify my model, I have to override
> crudDoForm entirely just to get to the input button. At least I think
> I do.
>
>
>
> >
>


-- 
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: redirect, page not found

2009-06-22 Thread David Pollak
Glad you solved it.  Please start using Lift 1.1-SNAPSHOT.  It's got much
more friendly error messages for stuff that's not in SiteMap.

On Sat, Jun 20, 2009 at 7:12 AM, Manfred  wrote:

>
> Alright, solved it.
> Since the page was not accessible in general when putting the link
> into the browser manually but the file was there I locking again
> through the master.pdf and SiteMap.
> Looks like the page needs to be defined for SiteMap in Boot class.
> After doing that it was accessible.
>
>
> Cheers,
> Manfred
>
> On 19 Jun., 19:53, Manfred  wrote:
> > Hi there.
> >
> > I'm doing my first steps with Scala and Lift and so far I'm enjoying
> > this fresh approach in web development.
> >
> > After some playing around I'm trying now to port an existing web
> > application to Lift.
> > However I'm struggling on redirects.
> > I have a login page and on pressing submit button a login method is
> > called which should do a redirect to another page.
> > Although the html page exists the server sais: "The Requested URL /
> > main.html was not found on this server".
> > What am I doing wrong?
> >
> > This is the snippet that does the redirect:
> >
> > class Login {
> > def render(xhtml:NodeSeq) = {
> > Log.trace("rendering login...")
> >
> > // we need some vars here
> > var username = ""
> > var password = ""
> > var host = ""
> >
> > def login() = {
> > // some value checking can be done here
> > Log.trace("login called!")
> > Log.debug("username: " + username)
> > Log.debug("password: " + password)
> > Log.debug("host: " + host)
> >
> > // store in session
> > S.set("LoggedInUsername", username)
> > S.set("LoggedInHost", host)
> >
> > S.error("This is a demo error string!")
> > S.notice("This is a demo notice string!")
> >
> > // redirect to main
> > S.redirectTo("/main.html")
> > }
> >
> > bind("entry", xhtml,
> > "username" -> SHtml.text("", username = _),
> > "password" -> SHtml.password("", password = _),
> > "host" -> SHtml.text("", host = _),
> > "submit" -> SHtml.submit("Login", login))
> > }
> >
> > }
> >
> > Regards,
> > Manfred
>
> >
>


-- 
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: Deployment questions and little Java web dev experience

2009-06-22 Thread David Pollak
There are some good suggestions for using Lift on this thread.
Please try the following:

git clone git://github.com/dpp/lift-samples.git
tar -xzvf lift-samples/jetty_instance.tgz
cd jetty_instance
cp *your_war_file_from_mvn_install* webapp/root.war
./start_prod.sh

Open a browser to http://localhost:9910

So, that's how I deploy my Lift apps.  I use a separate jetty instance
for each app.  It costs about 32MB of RAM over sharing apps per jetty
instance (this can be material if you're in a VPS).

Hope this helps.


On Fri, Jun 19, 2009 at 1:09 PM, Nolan Darilek wrote:

>
> Hi, all. I'm new to Lift and have a few questions about using it. For
> background, I'm coming from Ruby to Scala, having finally been
> frustrated by some aspects of the former enough to try jumping ship. I
> know Java syntax, but the simplicity of Ruby has always been a powerful
> draw for me, so when I used Java I always stayed away from Maven and
> other cornerstones of the Java tool community. I say all of this not to
> stir up Ruby vs. Scala drama (because we just don't have enough of that
> already :P ) but to explain that I'm mistified by much of the Java
> ecosystem, and a lot of what's out there seems to take it for granted
> that I know all of this. So please pardon my newbie questions, and feel
> free to point me to the FM on the subject if there is one, because I've
> certainly been *trying* to RTFM. :) I also recognize that these topics
> aren't specific to Lift, but I figure I'm likely to find more proponents
> of low ceremony in the Scala community than I'd find if I seeked out
> some more general purpose Java enterprise deployment resource.
>
> First...servlets? Web containers? App servers? Oh my. I want to write a
> few hobbyist apps with Lift and deploy them to my VPS. They may or may
> not take off, in which case I'd like a solution that can scale to
> real-world use. Not heavy real-world use, mind you, but I figure a
> separate VM/port for every app instance is overkill. So what do I need
> for this? I gather the app server is what handles arranging web apps in
> a single VM instance, but it's tough cutting through all the enterprise
> language to figure out which one of these is best for my circumstances,
> especially since I'm not dealing with legacy code and just want to
> launch hobbyist/personal projects. And I can't for the life of me figure
> out whether Tomcat is an app server or something else entirely. This
> seems so much more complicated than just throwing up a few Mongrels and
> a load balancer, or reading through the nicely-written Passenger manual
> and following the step-by-step instructions. I'm sure it has its
> advantages, I just can't get a grip on how it works.
>
> I've also been reading a lot about OSGi and it looks really nice. Am I
> correct in assuming that OSGi is to Java web apps what Rack is to Ruby
> ones? OK, maybe not exactly, and I know it's a more general-purpose
> mechanism (I'm toying with ScalaModules in a desktop app for providing
> pluggable UIs and other services) but in poking through OSGi articles,
> I've read a few statements hinting that this is probably the best way to
> deploy new apps with no legacy dependencies. Is this true? Is an app
> server actually needed here, or do I just create an OSGi execution
> environment and start adding bundles?
>
> It seems like the way to deploy an app is to build a war file and drop
> it into a specific directory of your servlet/app
> server/doohicky-whatamajig serverletcontainerthingie. It also looks as
> if all apps are installed into the same HTTP namespace, with URL path
> collisions resolved by editing web.xml and prepending something to the
> /* for the map elements. Is this accurate? Or is it possible to have the
> server prepend  /myapp or /myapp.war based on the name of the deployed
> app, then handle the mappings via ProxyPass in the front-end server?
> That's closer to what I'm used to in Ruby, where the app takes over the
> URL namespace beneath whatever path you assign it, but it's not clear to
> me based on what I've read that this happens with Java app servers.
>
> Thanks for reading, and again, feel free to respond with a link or
> google keywords if I'm just missing something obvious. One of the
> biggest challenges I find myself facing with this move is that most of
> what I've found assumes a high ceremony->low ceremony migration path, or
> at least assumes that you've spent enough time in the Java ecosystem at
> some point to get it. :)
>
>
> >
>


-- 
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.co

[Lift] Re: lift-paypal: Paypal Production PDT not working - help!

2009-06-22 Thread David Pollak
My guess is that he had the wrong URL in the Auto Return.

On Mon, Jun 22, 2009 at 1:30 AM, Timothy Perrett wrote:

>
> Hey chaps... sorry for my late reply (just flew in from Egypt!)
>
> The pdtPath is configurable already, right?
>
> object SimplePaypal extends PaypalPDT {
>  def pdtPath: String = "yourendpoint"
>  
> }
>
> Im not sure why this would cause an issue as if you look at the
> dispatch:
>
> Req(RootPath :: PDTPath :: Nil, "", PostRequest)
>
> Its just concatenating both the rootPath and the pdtPath defs (via
> lazy vals) - so you can set it to whatever you want within some basic
> guidelines. What is it thats not happening for you exactly or in what
> way do you feel its not configurable?
>
> Cheers, Tim
>
> On Jun 19, 2:07 am, David Pollak 
> wrote:
> > On Thu, Jun 18, 2009 at 3:17 PM, Derek Chen-Becker <
> dchenbec...@gmail.com>wrote:
> >
> > > It seems to me that the pdtPath should be configurable. If other people
> > > agree we should at least open an issue on GitHub to track this.
> >
> > Sure.
> >
> >
> >
> >
> >
> >
> >
> > > Derek
> >
> > > On Thu, Jun 18, 2009 at 3:07 PM, Dano  wrote:
> >
> > >> Resolved.
> >
> > >> I backed out my override on pdtPath and adjusted my paypal
> > >> configuration to point to /paypal/pdt and things worked.
> >
> > >> Moral of the story: Do NOT override pdtPath!!
> >
> > >> On Jun 18, 12:07 pm, Dano  wrote:
> > >> > Sorry, my post got submitted too early.
> >
> > >> > When I commented out the line: override def pdtPath = "complete"
> >
> > >> > I get the same failure mode as in production.
> >
> > >> > Do I need to set pdtPath or what do I change to work with the
> default?
> >
> > >> > Thanks.
> >
> > >> > Dan
> >
> > >> > On Jun 18, 12:04 pm, Dano  wrote:
> >
> > >> > > More information:
> >
> > >> > > In my object which extends PaypalPDT, I had a line which
> overridded
> > >> > > the variable pdtPath:
> >
> > >> > > override def pdtPath = "complete"
> >
> > >> > > On Jun 18, 11:58 am, Dano  wrote:
> >
> > >> > > > I trying to get our site (buyafeature.com) live today and ran
> into
> > >> a
> > >> > > > problem with the paypal feature.  I am using the lift-paypal
> module
> > >> > > > and things have been working just fine in development.
> >
> > >> > > > The problem I am seeing is that when I press the "Return to
> Website"
> > >> > > > button in paypal, it tries to redirect to the following URL:
> >
> > >>http://buyafeature.com/paypal/complete?tx=36627495TV601683L&st=Comple.
> ..
> >
> > >> > > > And then the browser shows the following error:
> >
> > >> > > > The Requested URL /paypal/complete was not found on this server
> >
> > >> > > > I tried to reproduced this on the development sandbox but it
> works
> > >> > > > fine (i.e. returns to the starting page in my app and my server
> gets
> > >> > > > the PDT event).
> >
> > >> > > > Has anyone seen this or have any ideas on what to try?
> >
> > >> > > > Thanks in advance.
> >
> > >> > > > Dan
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
> >
>


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

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



[Lift] Re: malformed Scala signature of User

2009-06-22 Thread David Pollak
SOunds like there's something very wrong with your app.
If you want to send it to me privately (remove the target directory, tar up
the rest and send it as attachment), I'll take a look at it.  Alternatively,
if it's on a public repository, just point me to it.

On Fri, Jun 19, 2009 at 1:56 PM, Peter Robinett wrote:

>
> Thanks for the quick response. However, I'm afraid that didn't work. I
> then deleted the entire project and ~/.m2/ and cloned my project from
> my remote git repo. The project now compiles with no problems but when
> I visit the site I just get the html fragment from src/main/webapp/
> index.html, without any of the output expected from lift:surround. mvn
> -U clean install doesn't have any effect.
>
> Peter
>
> On Jun 19, 1:00 pm, David Pollak 
> wrote:
> > Try mvn -U clean install
> >
> > On Fri, Jun 19, 2009 at 12:46 PM, Peter Robinett <
> pe...@bubblefoundry.com>wrote:
> >
> >
> >
> >
> >
> > > Hi David,
> >
> > > I'm getting a compile error saying that User is already defined.
> > > Thinking that it was similar to the problem discussed in this thread,
> > > I tried both mvn clean test and the fieldOrder solutions but neither
> > > worked. This is with the User model generated from basic archetype and
> > > it had previously compiled. Do you or anyone else here have any idea
> > > why the compiler is finding another User definition?
> >
> > > Thanks!
> >
> > > Peter
> >
> > > On Apr 28, 10:12 am, David Pollak 
> > > wrote:
> > > > How about:
> >
> > > > override def fieldOrder = List[BaseOwnedMappedField[User]](id,
> firstName,
> > > > lastName, email,
> > > > locale, timezone, password, textArea)
> >
> > > > The compiler often gets the type signature wrong on Lists of
> MappedField.
> >
> > > > On Tue, Apr 28, 2009 at 9:51 AM, erik.karls...@iki.fi <
> >
> > > > erik.b.karls...@gmail.com> wrote:
> >
> > > > > hello,
> >
> > > > > Tried to dig a bit more. I noticed that I get the cryptic compile
> > > > > error with the mock objects if I have the following code for User:
> > > > > ---
> > > > > object User extends MetaUser {
> >
> > > > >  override def dbTableName = "users" // define the DB table name
> > > > >  override def screenWrap = Full( > > > > at="content">
> > > > >   )
> >
> > > > >   override def fieldOrder = List(id, firstName, lastName, email,
> > > > > locale, timezone, password, textArea)
> > > > >   override def skipEmailValidation = true
> > > > > }
> >
> > > > > trait MetaUser extends User with MetaMegaProtoUser[User]
> >
> > > > > /**
> > > > >  * An O-R mapped "User" class that includes first name, last name,
> > > > > password and we add a "Personal Essay" to it
> > > > >  */
> > > > > class User extends MegaProtoUser[User] {
> > > > >  def getSingleton = User // what's the "meta" server
> >
> > > > >  // define an additional field for a personal essay
> > > > >  object textArea extends MappedTextarea(this, 2048) {
> > > > >override def textareaRows  = 10
> > > > >override def textareaCols = 50
> > > > >override def displayName = "Personal Essay"
> > > > >  }
> > > > > }
> > > > > ---
> >
> > > > > However, if I change the line:
> >
> > > > > override def fieldOrder = List(id, firstName, lastName, email,
> locale,
> > > > > timezone, password, textArea)
> >
> > > > > to:
> >
> > > > > override def fieldOrder = List(firstName, lastName, email, locale,
> > > > > timezone, password,textArea)
> >
> > > > > then things get compiled nicely. I noticed that if I putt the Id
> > > > > anywhere inside the list the compile error hits.
> > > > > Am I just doing something really stupid or have I hit some real
> issue
> > > > > with the compiler? I think more about the first option.
> >
> > > > > br,
> > > > > - Erik
> >
> > > > > On Apr 28, 12:52 am, "erik.karls...@iki.fi"
> > > > >  wrote:
> > > > > > Hi,
> >
> > > > > > I have noticed this and I always run mvn clean before running the
> > > > > > tests or just compiling them. So I get the issue even I run the
> clean
> > > > > > command.
> >
> > > > > > -erik
> >
> > > > > > David Pollak kirjoitti:
> >
> > > > > > > Erik,
> >
> > > > > > > Please do an:
> >
> > > > > > > mvn clean test
> >
> > > > > > > From the command line.
> >
> > > > > > > The Eclipse plugin uses a different version of Scala than does
> > > Lift.
> > > > >  There
> > > > > > > will be weird errors like the one you've seen.
> >
> > > > > > > Thanks,
> >
> > > > > > > David
> >
> > > > > > > On Mon, Apr 27, 2009 at 2:24 PM, erik.karls...@iki.fi <
> > > > > > > erik.b.karls...@gmail.com> wrote:
> >
> > > > > > > > Weird thing is  that I'm able to mock "MetaTeam":
> >
> > > > > > > > ---
> > > > > > > > trait MetaTeam extends Team with LongKeyedMetaMapper[Team] {
> > > > > > > >  def findByUser(user:User): List[Team]
> > > > > > > > }
> >
> > > > > > > > object Team extends MetaTeam {
> > > > > > > >  def findByUser(user:User): List[Team] =
> > > > > > > >UserTeam.findAll(
> > > > > > > >  By(UserTeam.user, user

[Lift] Re: JaveRebel Setup

2009-06-22 Thread Mark Lynn

For future reference, posted to JavaRebel support forum at

http://www.zeroturnaround.com/forum/topic.php?id=336

Mark Lynn
Sabado Technologies




On Jun 22, 2009, at 4:29 PM, David Pollak wrote:

>
>
> On Mon, Jun 22, 2009 at 11:54 AM, Mark Lynn  wrote:
>
> David,
>
> Thanks. I expected that much, but I am only changing things within  
> snippets. I see in the terminal window running mvn scala:cc that the  
> file is being recompiled and I can also see in the file system that  
> the corresponding class files have updated timestamps. However,  
> JavaRebal only indicates that it is reloading the main snippet class  
> file and does not appear to reload additional class files.
>
> As an example, I defined MyMenu.scala as a direct replacement for  
> Menu.scala so that I could add some wrapper html for menu items. I  
> have the following (minus imports):
>
> class MyMenu extends DispatchSnippet {
>   def dispatch: DispatchIt = {
> case "item" => item
>   }
>
>   def item(text: NodeSeq): NodeSeq =
> for (name <- S.attr("name").toList;
>  request <- S.request.toList;
>  loc <- request.location.toList)
> yield {
>   if (loc.name != name) {
> val itemLink = SiteMap.buildLink(name, text) match {
>   case e : Elem => e % S.prefixedAttrsToMetaData("a")
>   case x => x
> }
> { Group(itemLink) }
>   } else if (S.attr("donthide").isDefined) {
> // Use the provided text if it's non-empty, otherwise,  
> default to Loc's LinkText
> {
>   if (text.length > 0) {
> Group(text)
>   } else {
> Group(loc.linkText openOr Text(loc.name))
>   }
> }
>   } else {
> Text("")
>   }
> }
>
>
> If I change the line
>
> { Group(itemLink) }
>
> to
>
> { Group(itemLink) }
>
> it does not pick this up though I see the following message in my  
> console window:
>
> JavaRebel: Reloading class 'org.watertogether.snippet.MyMenu'.
>
> If I kill Jetty and restart it, then the change is found.
>
> Yeah... I updated to JR 2.0.1 and am seeing the same problems.  It's  
> looking like JR is not loading the anonymous inner classes that  
> Scala generates.  I'd suggest reporting this on the JavaRebel list.
>
> Sorry.
>
>
>  - Mark
>
> Mark Lynn
> Sabado Technologies
>
>
> On Jun 22, 2009, at 2:07 PM, David Pollak wrote:
>
>> Mark,
>>
>> Anything that's passed to Lift in Boot is "static" and changes will  
>> not be picked up by JR on recompile.  So, if you're changing  
>> SiteMap or REST handling, you'll have to restart you app.
>>
>> Thanks,
>>
>> David
>>
>> On Mon, Jun 22, 2009 at 7:13 AM, Mark Lynn  wrote:
>>
>>
>> I saw JavaRebel mentioned on the list in recent days and was excited
>> to try it. I followed the instructions at
>>
>> http://wiki.liftweb.net/index.php/JavaRebel
>>
>> for using it with Jetty. I have mvn scala:cc setup in another  
>> terminal
>> window and I see that it is compiling files that change. I also see
>> where JavaRebel is reporting that snippets are being reloaded, but it
>> does not appear to be reloading other classes generated from the
>> snippet source file. As an example, if I add a case to the dispatch
>> method, it does not pick up this change. Is this a limitation of
>> JavaRebel or am I missing something in the configuration? By the way,
>> I am not using an IDE - just Textmate and the command line which is  
>> my
>> preferred mode. The one thing I was really missing from the Rails
>> world was the reloading of classes automatically - hence I was very
>> excited to learn of JavaRebel.
>>
>>  - Mark
>>
>> Mark Lynn
>> Sabado Technologies
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>
>
>
>
>
>
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >


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



[Lift] Re: [scala] JPA question

2009-06-22 Thread Meredith Gregory
Kris,

Thanks for the suggestion. i've now got a tiny little example that compiles
on its own that illustrates the problem. Changing the inheritance strategy
to JOINED makes no difference. Hibernate still does the wrong thing.

Best wishes,

--greg

On Mon, Jun 22, 2009 at 8:55 AM, Kris Nuttycombe
wrote:

> This may be off the mark, but I'm wondering if the reason that you're
> having difficulty with the parallel inheritance hierarchy problem is
> not your use of TABLE_PER_CLASS inheritance. In my application, I have
> a similar construct, but I am using JOINED_TABLE inheritance. This
> allows for a normal foreign key relationship to be created in the
> database between C2_table and the base table for CThing, with the
> result that Hibernate will generate the query for CThing member as a
> union. Using table per class inheritance, I would expect Hibernate to
> need to synthesize an additional dtype field in C2_table along with
> the key column in order to enforce the uniqueness of the keys to the
> joined entities, and I don't believe that it does this.
>
> I'm not sure how the fact that the code is generated is particularly
> relevant; surely if it's possible to hand-write a successful solution,
> then your code generator could be made aware of how to construct a
> viable solution?
>
> Kris
>
> On Fri, Jun 19, 2009 at 8:47 PM, Meredith
> Gregory wrote:
> > All,
> >
> > i had a similar problem and found the source of the issues. Spse you have
> a
> > container hierarchy (CTop <- C2) side-by-side with a contained hierarchy
> > (CThing <- CThing1). The inheritance at the top of the container
> hierarchy,
> > CTop, causes hibernate to bail on tracking the relations and punt to
> > embedded values instead. Rewriting the top to be a @MappedSuperClass
> fixes
> > the problem in this specific case. However, if your hierarchy is deep,
> > you're screwed.
> >
> > If anybody has a suggestion for a workaround, i'm all ears. The problem
> is
> > that it would appear that both Mr Crowley and i are generating Java + JPA
> > code. So, the solution needs to be algorithmic and not 1-off.
> >
> > Perhaps the best solution is to find an alternative to hibernate as this
> is
> > a particularly irritating bug.
> >
> > Best wishes,
> >
> > --greg
> >
> > @Entity
> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
> > abstract class CTop {
> >...
> >@Id
> > @GeneratedValue(generator = "system-uuid")
> > @GenericGenerator(name = "system-uuid", strategy = "uuid")
> > private String id_CTop;
> > }
> >
> > @Entity
> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
> > abstract class CThing {
> >...
> >@Id
> > @GeneratedValue(generator = "system-uuid")
> > @GenericGenerator(name = "system-uuid", strategy = "uuid")
> > private String id_CThing;
> > }
> >
> > @Entity
> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
> > @Table(name = "C2_table", catalog = "mydb_production", uniqueConstraints
> = {
> > @UniqueConstraint(columnNames = "uuid") })
> > class C2 extends CTop {
> >CThing thing;
> > ...
> >   @OneToOne
> > @JoinColumn
> > public CThing getThing() {
> > return this.thing;
> > }
> > public void setThing( CThing thing ) {
> > this.thing = thing;
> > }
> >
> > @Column(name = "uuid", unique = false, nullable = true, insertable =
> true,
> > updatable = true)
> > public String getUuid() {
> > return this.uuid;
> > }
> >
> > public void setUuid(String uuid) {
> > this.uuid = uuid;
> > }
> >
> > @Id
> > @GeneratedValue(generator = "system-uuid")
> > @GenericGenerator(name = "system-uuid", strategy = "uuid")
> > @Column(name = "id", unique = false, nullable = true, insertable =
> true,
> > updatable = true)
> > public String getId() {
> > return this.id;
> > }
> >
> > }
> >
> > @Entity
> > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
> > @Table(name = "CThing1_table", catalog = "mydb_production",
> > uniqueConstraints = { @UniqueConstraint(columnNames = "uuid") })
> > class CThing1 extends CThing {
> > ...
> >   // lots of ground type fields
> >
> > @Column(name = "uuid", unique = false, nullable = true, insertable =
> true,
> > updatable = true)
> > public String getUuid() {
> > return this.uuid;
> > }
> >
> > public void setUuid(String uuid) {
> > this.uuid = uuid;
> > }
> >
> > @Id
> > @GeneratedValue(generator = "system-uuid")
> > @GenericGenerator(name = "system-uuid", strategy = "uuid")
> > @Column(name = "id", unique = false, nullable = true, insertable =
> true,
> > updatable = true)
> > public String getId() {
> > return this.id;
> > }
> >
> > }
> >
> >
> > On Tue, Jun 16, 2009 at 1:45 PM, Derek Chen-Becker  >
> > wrote:
> >>
> >> John Nilsson wrote:
> >> > Hi,
> >> >
> >> > I think the showSql property has been deprecated in favor of log4j
> >> > loggers.
> >> >
> >> > If you set 

[Lift] Re: JaveRebel Setup

2009-06-22 Thread David Pollak
On Mon, Jun 22, 2009 at 11:54 AM, Mark Lynn  wrote:

>
> David,
>
> Thanks. I expected that much, but I am only changing things within
> snippets. I see in the terminal window running mvn scala:cc that the file is
> being recompiled and I can also see in the file system that the
> corresponding class files have updated timestamps. However, JavaRebal only
> indicates that it is reloading the main snippet class file and does not
> appear to reload additional class files.
>
> As an example, I defined MyMenu.scala as a direct replacement for
> Menu.scala so that I could add some wrapper html for menu items. I have the
> following (minus imports):
>
> class MyMenu extends DispatchSnippet {
>   def dispatch: DispatchIt = {
> case "item" => item
>   }
>
>   def item(text: NodeSeq): NodeSeq =
> for (name <- S.attr("name").toList;
>  request <- S.request.toList;
>  loc <- request.location.toList)
> yield {
>   if (loc.name != name) {
> val itemLink = SiteMap.buildLink(name, text) match {
>   case e : Elem => e % S.prefixedAttrsToMetaData("a")
>   case x => x
> }
> { Group(itemLink) }
>   } else if (S.attr("donthide").isDefined) {
> // Use the provided text if it's non-empty, otherwise, default to
> Loc's LinkText
> {
>   if (text.length > 0) {
> Group(text)
>   } else {
> Group(loc.linkText openOr Text(loc.name))
>   }
> }
>   } else {
> Text("")
>   }
> }
>
>
> If I change the line
>
> { Group(itemLink) }
>
> to
>
> { Group(itemLink) }
>
> it does not pick this up though I see the following message in my console
> window:
>
> JavaRebel: Reloading class 'org.watertogether.snippet.MyMenu'.
>
> If I kill Jetty and restart it, then the change is found.
>

Yeah... I updated to JR 2.0.1 and am seeing the same problems.  It's looking
like JR is not loading the anonymous inner classes that Scala generates.
 I'd suggest reporting this on the JavaRebel list.

Sorry.


>
>  - Mark
>
> Mark Lynn
> Sabado Technologies
>
>
> On Jun 22, 2009, at 2:07 PM, David Pollak wrote:
>
> Mark,
> Anything that's passed to Lift in Boot is "static" and changes will not be
> picked up by JR on recompile.  So, if you're changing SiteMap or REST
> handling, you'll have to restart you app.
>
> Thanks,
>
> David
>
> On Mon, Jun 22, 2009 at 7:13 AM, Mark Lynn  wrote:
>
>>
>>
>> I saw JavaRebel mentioned on the list in recent days and was excited
>> to try it. I followed the instructions at
>>
>> http://wiki.liftweb.net/index.php/JavaRebel
>>
>> for using it with Jetty. I have mvn scala:cc setup in another terminal
>> window and I see that it is compiling files that change. I also see
>> where JavaRebel is reporting that snippets are being reloaded, but it
>> does not appear to be reloading other classes generated from the
>> snippet source file. As an example, if I add a case to the dispatch
>> method, it does not pick up this change. Is this a limitation of
>> JavaRebel or am I missing something in the configuration? By the way,
>> I am not using an IDE - just Textmate and the command line which is my
>> preferred mode. The one thing I was really missing from the Rails
>> world was the reloading of classes automatically - hence I was very
>> excited to learn of JavaRebel.
>>
>>  - Mark
>>
>> Mark Lynn
>> Sabado Technologies
>>
>>
>>
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
>
>
>
>
> >
>


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

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



[Lift] Re: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Kevin Wright
Using eclipse with the IAM plugin is a *big* help (still hosted at
http://code.google.com/p/q4e/)make sure you start as a native maven project
then import the pom
after that you can add the scala nature, you'll need the scala plugin for
that, of course


Personally, I use IntelliJ for the moment, but eagerly awaiting the stable
2.8 eclipse plugin...

On Mon, Jun 22, 2009 at 7:55 PM, Ellis  wrote:

>
> > I have had success recently
> > with NetBeans, IntelliJ, and emacs.
>
> Ok, thanks.  I'm downloading NetBeans now to try it out.
>
>
> On Jun 22, 8:35 pm, David Pollak 
> wrote:
> > On Mon, Jun 22, 2009 at 11:25 AM, Ellis 
> wrote:
> >
> > > Hello David,
> >
> > > Thanks for your reply.  Do you know whether lift *should* work with
> > > scala 2.8 when we pull it from the maven repositories?
> >
> > Lift currently only works with Scala 2.7.4.  You can use Eclipse and
> 2.7.5
> > to edit Lift files, but Lift must be deployed against 2.7.4.
> >
> > We will have a branch of Lift (Jorge... you got this running yet)
> building
> > against 2.8, but it will be experimental.
> >
> > I have experienced a fair number of suboptimalities with Lift and Eclipse
> in
> > the last 3 weeks with the 2.7.5 stable plugin.  I have had success
> recently
> > with NetBeans, IntelliJ, and emacs.
> >
> >
> >
> > >  If so, then
> > > I'll try deleting my ~/.m2 as Tim suggested.
> >
> > > Thanks,
> > > Ellis
> >
> > > On Jun 22, 8:14 pm, David Pollak 
> > > wrote:
> > > > Ellis,
> > > > Miles will be back online in a few days, but I suspect that the
> answer is
> > > > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is
> going
> > > to
> > > > have bugs. :-(
> >
> > > > Sorry.
> >
> > > > David
> >
> > > > On Mon, Jun 22, 2009 at 11:08 AM, Ellis 
> > > wrote:
> >
> > > > > Hello everyone,
> >
> > > > > Does anyone have a setup for eclipse that works like it should?  By
> > > > > "like it should", I mostly mean that the scala plugin doesn't crash
> > > > > regularly AND it works with lift/maven.  If so, which versions of
> > > > > which plugins are you using?
> >
> > > > > The nightly build of the scala plugin seems to work better than
> > > > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > > > > maven due to "signature differences" between the scala libraries.
> >
> > > > > Best regards,
> > > > > Ellis
> >
> > > > --
> > > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > Follow me:http://twitter.com/dpp
> > > > Git some:http://github.com/dpp
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
>
> >
>

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



[Lift] Re: JPA and auto generation of id

2009-06-22 Thread David Persons

I am using MySql (5). After setting the hibernate.dialect to
org.hibernate.dialect.MySQLDialect in my persistence.xml file, I get a
org.hibernate.AssertionFailure: null id :-s

cheers

On 22 jun, 19:18, Derek Chen-Becker  wrote:
> That's not accurate, at least with Hibernate. By putting the annotations on
> vars, the compiler ends up putting them on the internal fields, which then
> forces Hibernate into a field-based persistence model and not a
> getter/setter based one. The SQLGrammarException is most likely what the
> other people have said. If you're in Oracle or PostgreSQL, for instance, you
> need a sequence set up for the auto identity model. What database are you
> using?
>
> Derek
>
> On Mon, Jun 22, 2009 at 8:54 AM, Eric Bowman  wrote:
>
> > David Persons wrote:
> > > Hello guys,
>
> > > I get a org.hibernate.exception.SQLGrammarException: could not get or
> > > update next value error everytime I try to save the following Entity:
>
> > > @Entity
> > > class Scene {
> > >   @Id
> > >   @GeneratedValue(){val strategy = GenerationType.AUTO}
> > >   var id : Long = _
>
> > >   @Column{val unique = true, val nullable = false}
> > >   var ordering : Int = _
>
> > >   @Column{val unique = true, val nullable = false}
> > >   var name : String = ""
>
> > >   @ManyToOne{val optional = false}
> > >   var storyBoard : StoryBoard = _
> > > }
>
> > You almost certainly need some scala.reflect.BeanProperty annotations on
> > your fields.
>
> > cheers,
> > Eric
>
> > --
> > 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] Re: JPA and auto generation of id

2009-06-22 Thread Meredith Gregory
David,

i recently ran into an issue that smells exactly like this. For hibernate i
had to do the following:

@Id
@GeneratedValue(){generator = "system-uuid"}
@GenericGenerator(){name = "system-uuid", strategy = "uuid"}

This is hibernate specific. This was for an Id property that was typed
String.

Best wishes,

--greg

On Mon, Jun 22, 2009 at 2:08 AM, David Persons  wrote:

>
> Hello guys,
>
> I get a org.hibernate.exception.SQLGrammarException: could not get or
> update next value error everytime I try to save the following Entity:
>
> @Entity
> class Scene {
>  @Id
>  @GeneratedValue(){val strategy = GenerationType.AUTO}
>  var id : Long = _
>
>  @Column{val unique = true, val nullable = false}
>  var ordering : Int = _
>
>  @Column{val unique = true, val nullable = false}
>  var name : String = ""
>
>  @ManyToOne{val optional = false}
>  var storyBoard : StoryBoard = _
> }
>
> What am I doing wrong??
>
> grtz,
> David Persons
>
> >
>


-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

--~--~-~--~~~---~--~~
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: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Ellis

> I have had success recently
> with NetBeans, IntelliJ, and emacs.

Ok, thanks.  I'm downloading NetBeans now to try it out.


On Jun 22, 8:35 pm, David Pollak 
wrote:
> On Mon, Jun 22, 2009 at 11:25 AM, Ellis  wrote:
>
> > Hello David,
>
> > Thanks for your reply.  Do you know whether lift *should* work with
> > scala 2.8 when we pull it from the maven repositories?
>
> Lift currently only works with Scala 2.7.4.  You can use Eclipse and 2.7.5
> to edit Lift files, but Lift must be deployed against 2.7.4.
>
> We will have a branch of Lift (Jorge... you got this running yet) building
> against 2.8, but it will be experimental.
>
> I have experienced a fair number of suboptimalities with Lift and Eclipse in
> the last 3 weeks with the 2.7.5 stable plugin.  I have had success recently
> with NetBeans, IntelliJ, and emacs.
>
>
>
> >  If so, then
> > I'll try deleting my ~/.m2 as Tim suggested.
>
> > Thanks,
> > Ellis
>
> > On Jun 22, 8:14 pm, David Pollak 
> > wrote:
> > > Ellis,
> > > Miles will be back online in a few days, but I suspect that the answer is
> > > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is going
> > to
> > > have bugs. :-(
>
> > > Sorry.
>
> > > David
>
> > > On Mon, Jun 22, 2009 at 11:08 AM, Ellis 
> > wrote:
>
> > > > Hello everyone,
>
> > > > Does anyone have a setup for eclipse that works like it should?  By
> > > > "like it should", I mostly mean that the scala plugin doesn't crash
> > > > regularly AND it works with lift/maven.  If so, which versions of
> > > > which plugins are you using?
>
> > > > The nightly build of the scala plugin seems to work better than
> > > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > > > maven due to "signature differences" between the scala libraries.
>
> > > > Best regards,
> > > > Ellis
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Git some:http://github.com/dpp
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Git some:http://github.com/dpp

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



[Lift] Re: JaveRebel Setup

2009-06-22 Thread Mark Lynn

David,

Thanks. I expected that much, but I am only changing things within  
snippets. I see in the terminal window running mvn scala:cc that the  
file is being recompiled and I can also see in the file system that  
the corresponding class files have updated timestamps. However,  
JavaRebal only indicates that it is reloading the main snippet class  
file and does not appear to reload additional class files.

As an example, I defined MyMenu.scala as a direct replacement for  
Menu.scala so that I could add some wrapper html for menu items. I  
have the following (minus imports):

class MyMenu extends DispatchSnippet {
   def dispatch: DispatchIt = {
 case "item" => item
   }

   def item(text: NodeSeq): NodeSeq =
 for (name <- S.attr("name").toList;
  request <- S.request.toList;
  loc <- request.location.toList)
 yield {
   if (loc.name != name) {
 val itemLink = SiteMap.buildLink(name, text) match {
   case e : Elem => e % S.prefixedAttrsToMetaData("a")
   case x => x
 }
 { Group(itemLink) }
   } else if (S.attr("donthide").isDefined) {
 // Use the provided text if it's non-empty, otherwise,  
default to Loc's LinkText
 {
   if (text.length > 0) {
 Group(text)
   } else {
 Group(loc.linkText openOr Text(loc.name))
   }
 }
   } else {
 Text("")
   }
 }


If I change the line

{ Group(itemLink) }

to

{ Group(itemLink) }

it does not pick this up though I see the following message in my  
console window:

JavaRebel: Reloading class 'org.watertogether.snippet.MyMenu'.

If I kill Jetty and restart it, then the change is found.

  - Mark

Mark Lynn
Sabado Technologies


On Jun 22, 2009, at 2:07 PM, David Pollak wrote:

> Mark,
>
> Anything that's passed to Lift in Boot is "static" and changes will  
> not be picked up by JR on recompile.  So, if you're changing SiteMap  
> or REST handling, you'll have to restart you app.
>
> Thanks,
>
> David
>
> On Mon, Jun 22, 2009 at 7:13 AM, Mark Lynn  wrote:
>
>
> I saw JavaRebel mentioned on the list in recent days and was excited
> to try it. I followed the instructions at
>
> http://wiki.liftweb.net/index.php/JavaRebel
>
> for using it with Jetty. I have mvn scala:cc setup in another terminal
> window and I see that it is compiling files that change. I also see
> where JavaRebel is reporting that snippets are being reloaded, but it
> does not appear to be reloading other classes generated from the
> snippet source file. As an example, if I add a case to the dispatch
> method, it does not pick up this change. Is this a limitation of
> JavaRebel or am I missing something in the configuration? By the way,
> I am not using an IDE - just Textmate and the command line which is my
> preferred mode. The one thing I was really missing from the Rails
> world was the reloading of classes automatically - hence I was very
> excited to learn of JavaRebel.
>
>  - Mark
>
> Mark Lynn
> Sabado Technologies
>
>
>
>
>
>
>
>
> -- 
> 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: howto do simple calculation with MappedInt

2009-06-22 Thread David Pollak
On Sun, Jun 21, 2009 at 6:38 AM, Tobias Daub  wrote:

>
> I'm stucked again with the simple things
>
> I've a trait that extends BaseLongKeyedMapper and I wanna add a field
> (currentCost) that does some calculation. Nothing special. Here's the code:
>
> /*
>  * Order.scala
>  *
>  * To change this template, choose Tools | Template Manager
>  * and open the template in the editor.
>  */
>
> package org.tobster.model
>
> import net.liftweb._
> import mapper._
> import http._
> import SHtml._
> import util._
> import model._
>
> /* Describes a general order.  */
> trait Order extends BaseLongKeyedMapper{
>
>/* The number of lots this order has */
>object lots extends MappedInt(this.asInstanceOf[MapperType])
>
>/* The person who owns the order */
>object owner extends
> MappedLongForeignKey(this.asInstanceOf[MapperType], User){
>
>// hides this field in the CRUDify list/create forms
>override def dbDisplay_? = false
>
>//set the default value to the current logged in user (at
> creation time)
>override def defaultValue = User.currentUser.map(_.id.is) openOr 0L
>}
>
>/* The market place where the order belongs to  */
>object marketPlace extends
> MappedLongForeignKey(this.asInstanceOf[MapperType], MarketPlaceMetaObj){
>override def _toForm = Full(SHtml.selectObj[MarketPlace](
>  MarketPlaceMetaObj.findAll.map(mp
> => (mp, mp.name.is)),
>  obj,
>  (mp: MarketPlace) => apply(mp)))
>}
>
>/* The basic trade types are: BUY and SELL */
>object tradeType extends
> MappedLongForeignKey(this.asInstanceOf[MapperType], TradeTypeMetaObj){
>override def _toForm = Full(SHtml.selectObj[TradeType](
>TradeTypeMetaObj.findAll.map(t => (t, t.name.is)),
>obj,
>(t: TradeType) => apply(t)))
>}
>
>
>object currentCost extends MappedInt(this.asInstanceOf[MapperType]){
>override def _toForm = Full({this.lots *
> this.marketPlace.lotValue})



Try:
override def _toForm = Full({Order.this.lots *
Order.this.marketPlace.lotValue})



>
>}
>
> }
>
> I get the following compiler error:
>
> [WARNING]
>
> /home/wacky/workspace_VirtuelleBoerse/virtualMarket/src/main/scala/org/tobster/model/Order.scala:51:
> error: value lots is not a member of Int
> [WARNING] override def _toForm = Full({this.lots *
> this.marketPlace.lotValue})
> [WARNING]  ^
> [WARNING] one error found
>
> The field marketPlace.lotValue is of type MappedInt as well as the field
> lots.
>
> I tried things like "this.lots.is" or "this.lots.i_is_!" but without
> success. I ran out of ideas...
>
>
> thanks.
>
> >
>


-- 
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: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread David Pollak
On Mon, Jun 22, 2009 at 11:25 AM, Ellis  wrote:

>
> Hello David,
>
> Thanks for your reply.  Do you know whether lift *should* work with
> scala 2.8 when we pull it from the maven repositories?


Lift currently only works with Scala 2.7.4.  You can use Eclipse and 2.7.5
to edit Lift files, but Lift must be deployed against 2.7.4.

We will have a branch of Lift (Jorge... you got this running yet) building
against 2.8, but it will be experimental.

I have experienced a fair number of suboptimalities with Lift and Eclipse in
the last 3 weeks with the 2.7.5 stable plugin.  I have had success recently
with NetBeans, IntelliJ, and emacs.


>  If so, then
> I'll try deleting my ~/.m2 as Tim suggested.
>
> Thanks,
> Ellis
>
>
> On Jun 22, 8:14 pm, David Pollak 
> wrote:
> > Ellis,
> > Miles will be back online in a few days, but I suspect that the answer is
> > that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is going
> to
> > have bugs. :-(
> >
> > Sorry.
> >
> > David
> >
> >
> >
> > On Mon, Jun 22, 2009 at 11:08 AM, Ellis 
> wrote:
> >
> > > Hello everyone,
> >
> > > Does anyone have a setup for eclipse that works like it should?  By
> > > "like it should", I mostly mean that the scala plugin doesn't crash
> > > regularly AND it works with lift/maven.  If so, which versions of
> > > which plugins are you using?
> >
> > > The nightly build of the scala plugin seems to work better than
> > > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > > maven due to "signature differences" between the scala libraries.
> >
> > > Best regards,
> > > Ellis
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
>
> >
>


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

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



[Lift] Re: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Ellis

Hi Tim,

> Of course its possible to develop Lift with Eclipse - lots of people
> do.

It'd be great to know exactly which versions of eclipse and the
plugins that they are using then, assuming that they really do have a
stable environment...  I've also been using eclipse with lift/maven
for a month now, but the instability of the scala plugin often leaves
eclipse with no more "special" functionality than a plain text editor.

Cheers,
Ellis


On Jun 22, 8:14 pm, Timothy Perrett  wrote:
> Of course its possible to develop Lift with Eclipse - lots of people
> do. Sounds like you've got something corrupt in there; perhaps try
> blowing away your ~/.m2 directory...?
>
> Cheers, Tim
>
> On Jun 22, 7:08 pm, Ellis  wrote:
>
> > Hello everyone,
>
> > Does anyone have a setup for eclipse that works like it should?  By
> > "like it should", I mostly mean that the scala plugin doesn't crash
> > regularly AND it works with lift/maven.  If so, which versions of
> > which plugins are you using?
>
> > The nightly build of the scala plugin seems to work better than
> > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > maven due to "signature differences" between the scala libraries.
>
> > Best regards,
> > Ellis
>
>

--~--~-~--~~~---~--~~
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: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Ellis

Hello David,

Thanks for your reply.  Do you know whether lift *should* work with
scala 2.8 when we pull it from the maven repositories?  If so, then
I'll try deleting my ~/.m2 as Tim suggested.

Thanks,
Ellis


On Jun 22, 8:14 pm, David Pollak 
wrote:
> Ellis,
> Miles will be back online in a few days, but I suspect that the answer is
> that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is going to
> have bugs. :-(
>
> Sorry.
>
> David
>
>
>
> On Mon, Jun 22, 2009 at 11:08 AM, Ellis  wrote:
>
> > Hello everyone,
>
> > Does anyone have a setup for eclipse that works like it should?  By
> > "like it should", I mostly mean that the scala plugin doesn't crash
> > regularly AND it works with lift/maven.  If so, which versions of
> > which plugins are you using?
>
> > The nightly build of the scala plugin seems to work better than
> > 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> > maven due to "signature differences" between the scala libraries.
>
> > Best regards,
> > Ellis
>
> --
> 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: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Timothy Perrett

Of course its possible to develop Lift with Eclipse - lots of people
do. Sounds like you've got something corrupt in there; perhaps try
blowing away your ~/.m2 directory...?

Cheers, Tim

On Jun 22, 7:08 pm, Ellis  wrote:
> Hello everyone,
>
> Does anyone have a setup for eclipse that works like it should?  By
> "like it should", I mostly mean that the scala plugin doesn't crash
> regularly AND it works with lift/maven.  If so, which versions of
> which plugins are you using?
>
> The nightly build of the scala plugin seems to work better than
> 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> maven due to "signature differences" between the scala libraries.
>
> Best regards,
> Ellis
--~--~-~--~~~---~--~~
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: Is there any eclipse setup that actually works for lift?

2009-06-22 Thread David Pollak
Ellis,
Miles will be back online in a few days, but I suspect that the answer is
that the 2.8 plugin is the "new generation" and the 2.7.5 stuff is going to
have bugs. :-(

Sorry.

David

On Mon, Jun 22, 2009 at 11:08 AM, Ellis  wrote:

>
> Hello everyone,
>
> Does anyone have a setup for eclipse that works like it should?  By
> "like it should", I mostly mean that the scala plugin doesn't crash
> regularly AND it works with lift/maven.  If so, which versions of
> which plugins are you using?
>
> The nightly build of the scala plugin seems to work better than
> 2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
> maven due to "signature differences" between the scala libraries.
>
> Best regards,
> Ellis
>
>
> >
>


-- 
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] Is there any eclipse setup that actually works for lift?

2009-06-22 Thread Ellis

Hello everyone,

Does anyone have a setup for eclipse that works like it should?  By
"like it should", I mostly mean that the scala plugin doesn't crash
regularly AND it works with lift/maven.  If so, which versions of
which plugins are you using?

The nightly build of the scala plugin seems to work better than
2.7.4/2.7.5 in some ways, but I couldn't get it working with lift/
maven due to "signature differences" between the scala libraries.

Best regards,
Ellis


--~--~-~--~~~---~--~~
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: Class not found?

2009-06-22 Thread David Pollak
Charles,
If you're running Lift 1.1-SNAPSHOT in developer mode, you'll get a very
nice error message in the browser giving you more details on which snippet
was not found.

Thanks,

David

On Fri, Jun 19, 2009 at 6:53 PM, Charles F. Munat  wrote:

>
> I'm still confused about this:
>
> WARN - Snippet Failure: SnippetFailure(/events/competitions/ ->
> ParsePath(List(events, competition,
> index),,true,false),Full(default),Class Not Found)
>
> Anyone know what this means?
>
> Chas.
>
> >
>


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

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



[Lift] Re: JaveRebel Setup

2009-06-22 Thread David Pollak
Mark,
Anything that's passed to Lift in Boot is "static" and changes will not be
picked up by JR on recompile.  So, if you're changing SiteMap or REST
handling, you'll have to restart you app.

Thanks,

David

On Mon, Jun 22, 2009 at 7:13 AM, Mark Lynn  wrote:

>
>
> I saw JavaRebel mentioned on the list in recent days and was excited
> to try it. I followed the instructions at
>
> http://wiki.liftweb.net/index.php/JavaRebel
>
> for using it with Jetty. I have mvn scala:cc setup in another terminal
> window and I see that it is compiling files that change. I also see
> where JavaRebel is reporting that snippets are being reloaded, but it
> does not appear to be reloading other classes generated from the
> snippet source file. As an example, if I add a case to the dispatch
> method, it does not pick up this change. Is this a limitation of
> JavaRebel or am I missing something in the configuration? By the way,
> I am not using an IDE - just Textmate and the command line which is my
> preferred mode. The one thing I was really missing from the Rails
> world was the reloading of classes automatically - hence I was very
> excited to learn of JavaRebel.
>
>  - Mark
>
> Mark Lynn
> Sabado Technologies
>
>
>
>
> >
>


-- 
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: JPA and auto generation of id

2009-06-22 Thread Derek Chen-Becker
That's not accurate, at least with Hibernate. By putting the annotations on
vars, the compiler ends up putting them on the internal fields, which then
forces Hibernate into a field-based persistence model and not a
getter/setter based one. The SQLGrammarException is most likely what the
other people have said. If you're in Oracle or PostgreSQL, for instance, you
need a sequence set up for the auto identity model. What database are you
using?

Derek

On Mon, Jun 22, 2009 at 8:54 AM, Eric Bowman  wrote:

>
> David Persons wrote:
> > Hello guys,
> >
> > I get a org.hibernate.exception.SQLGrammarException: could not get or
> > update next value error everytime I try to save the following Entity:
> >
> > @Entity
> > class Scene {
> >   @Id
> >   @GeneratedValue(){val strategy = GenerationType.AUTO}
> >   var id : Long = _
> >
> >   @Column{val unique = true, val nullable = false}
> >   var ordering : Int = _
> >
> >   @Column{val unique = true, val nullable = false}
> >   var name : String = ""
> >
> >   @ManyToOne{val optional = false}
> >   var storyBoard : StoryBoard = _
> > }
> >
> >
>
> You almost certainly need some scala.reflect.BeanProperty annotations on
> your fields.
>
> cheers,
> Eric
>
> --
> 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] Re: So where is that OAuth?

2009-06-22 Thread DFectuoso

Well i will start working on that tonight(after work of course) and
keep you guys updated! Cheers!

On Jun 22, 8:59 am, "marius d."  wrote:
> On Jun 22, 3:25 am, DFectuoso  wrote:
>
> > Well i went ahead and learn a lot from the lift-openId implementation
> > and understand what I would need to do have lift-OAuth working
>
> > It seems like i could do two things:
> > 1) Get a OAuth java library that allows me to post, get, login and
> > logout then create a OAuth.scala file where i create a trait of the
> > OAuth Handler that would access to this methods, then create a object
> > that extends from that trait; Then create a OAuthProtoUser.scala where
> > I would have a trait for the MetaOAuthProtoUser with the Xhtml for
> > login, override the menus that i would not use and perform the login
> > and logout of the user as well as the post and get methods. Finally
> > create a trait for the OAuthProtoUser that would allow me to store
> > information about the user.
>
> Besides Proto stuff we'd need an abstraction over OAuth artifacts.
> Essentially a wrapper over their Java library.
>
> > 2) Go ahead and have the login,logout, post and get methods on the
> > OAuth.scala actually do the logic to get the tokens without a java
> > library, this would mean creating some way of signing a url and body
> > to post and get stuff from the request, access and user-auth Token Url
> > or an url in the service.
>
> > I have absolutely no experience with scala, java or lift but I really
> > want to get some(by doing this type of stuff). So what do you think is
> > better(for me to learn, for lift and for you).
>
> I think it would be a good exercise. Once you're done with it we could
> probably review it and maybe it'll get its way into Lift if some
> committer doesn't implement it in the mean time, but regardless would
> be a good exercise for you.
>
>
>
> > Also, what part of this abstraction(and how) is the one to set the
> > consumer_key, secret_key and the request urls?
>
> In OAuth world consumer secret and consumer key are somehow invariants
> as they impersonate a trusted service. So I would put them into a
> Scala object where user can just set these quantities from Boot.
>
>
>
> > Finally; a uber noob question, what is the equivalent of curl(php) or
> > urllib/urlopen(python) that i would use in the second option to
> > actually make the http request to ther other site? I think its a
> > servlet but some trivial example on this would really help me =)
>
> You can just use HttpUrlConnection, or Apache Http client.
>
>
>
> > On Jun 21, 7:18 am, "marius d."  wrote:
>
> > > OAuth is not implemented yet in Lift still the project folder is
> > > there. I think Dave wanted to put it there but never got the chance to
> > > add it.
>
> > > Br's,
> > > Marius
>
> > > On Jun 21, 9:29 am, DFectuoso  wrote:
>
> > > > Im trying to integrate OAuth (with twitter) in one of my projects...
> > > > and i saw the lift-oauth, but i cant find the code, documentation or
> > > > examples around this module; so i guess either its somewhere else or
> > > > people is doing their twitter integrations with other class(maybe
> > > > java)...
>
> > > > So what are you guys doing around OAuth and what could i do to get
> > > > this rolling?

--~--~-~--~~~---~--~~
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: Is something up with applying By to a MappedBoolean?

2009-06-22 Thread Derek Chen-Becker
I was starting to look at this (and the MappedStringIndex issue) but I'm
swamped with my day job right now. Please open an issue and I'll look at it
hopefully in the next week or two.

Derek

On Fri, Jun 19, 2009 at 2:02 PM, David Pollak  wrote:

> Please open a ticket at http://github.com/dpp/liftweb/issues
> I know Derek has
> closed a fair number of related tickets.  Also, please make sure you're using 
> 1.1-SNAPSHOT
>
> On Fri, Jun 19, 2009 at 12:56 PM, E. Biggs  wrote:
>
>>
>> an indication at this point that somebody cares about this besides me
>> would be like gold
>>
>> At this point, I'm assuming it's a bug and am fumbling through the
>> mapping code which is taking me a bit of time to understand
>>
>>
>>
>
>
> --
> 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: YA menu question: separate menus

2009-06-22 Thread Derek Chen-Becker
Pushed to master.

On Fri, Jun 19, 2009 at 11:54 AM, glenn  wrote:

>
> Derek,
>
> It does not appear that these changes have been migrated to the
> snapshot repository yet.
> What are you plans?
>
> thanks,
>
> Glenn...
>
> On Jun 19, 8:57 am, Derek Chen-Becker  wrote:
> > OK, I've committed some new support for groups in the MenuWidget class.
> > Also, the existing MenuWidget had facilities set up to take a SiteMap
> > instance as part of the setup params, but those params were never used.
> In
> > the interest of simplicity, I've removed those extra params unless
> someone
> > has a use case that's not covered by groups or the other new
> functionality.
> > If no one has any issues with the new code I'll merge to master later
> today.
> >
> > Derek
> >
> > On Fri, Jun 12, 2009 at 1:02 PM, Derek Chen-Becker <
> dchenbec...@gmail.com>wrote:
> >
> > > Tied up with work this afternoon, but I'll look at reworking MenuWidget
> > > with the added functionality.
> >
> > > On Fri, Jun 12, 2009 at 6:40 AM, glenn  wrote:
> >
> > >> Derek,
> >
> > >> Your new Menu snippet works great. I created a superfish-style menu
> > >> using
> > >> a list of groups, like so:
> >
> > >> object MenuWidgetEx {
> >
> > >>   def apply(groups:List[String]) = new MenuWidgetEx(groups,
> > >> MenuStyle.HORIZONTAL, JsObj()) render
> >
> > >>   def apply(groups:List[String], style: MenuStyle.Value) = new
> > >> MenuWidgetEx(groups, style, JsObj()) render
> >
> > >>   def apply(groups:List[String], jsObj: JsObj) = new MenuWidgetEx
> > >> (groups, MenuStyle.HORIZONTAL, jsObj) render
> >
> > >>   def apply(groups:List[String], style: MenuStyle.Value, jsObj:
> > >> JsObj) = new MenuWidgetEx(groups, style, jsObj) render
> > >> }
> >
> > >> class MenuWidgetEx(groups:List[String], style: MenuStyle.Value, jsObj:
> > >> JsObj) extends
> > >>  MenuWidget(LiftRules.siteMap open_!, style: MenuStyle.Value, jsObj:
> > >> JsObj){
> >
> > >> override def render :NodeSeq = {
> >
> > >>def buildMenu(group:String) =  > >> expandAll="true" top:class={style.toString} />
> >
> > >> head ++ 
> > >>{for(group <- groups) yield {buildMenu(group)}}
> > >>
> >
> > >>   }
> >
> > >> Someone should redo the MenuWidget snippet to handle your
> > >> new Menu.builder construct, so it doesn't have to be subclassed.
> >
> > >> Glenn...
> >
> > >> On Jun 12, 4:59 am, glenn  wrote:
> > >> > My error. Ignore this. I did a mvn clean then mvn install outside
> > >> > of Eclipse on the parent pom and everything worked fine.
> >
> > >> > Glenn...
> >
> > >> > On Jun 12, 4:45 am, glenn  wrote:
> >
> > >> > > Derek,
> >
> > >> > > I'd love to test the changes you made to Menu, but my build fails
> when
> > >> > > I run
> > >> > > mvn install on the pom in the lift directory of the download from
> >
> > >> > >http://github.com/dpp/liftweb/tree/wip-dcb-menu-addons
> >
> > >> > > Here's what maven reports:
> >
> > >> > > [WARNING] Warning in manifest for net.liftweb:lift-webkit:jar:1.1-
> > >> > > SNAPSHOT : Did not find matching r
> > >> > > eferal for org.slf4j.*
> > >> > > [ERROR] Error in manifest for net.liftweb:lift-webkit:jar:1.1-
> > >> > > SNAPSHOT : The default package '.' is
> > >> > > not permitted by the Import-Package syntax.
> > >> > >  This can be caused by compile errors in Eclipse because Eclipse
> > >> > > creates
> > >> > > valid class files regardless of compile errors.
> > >> > > The following package(s) import from the default package
> > >> > > [net.liftweb.http, net.liftweb.http.auth, n
> > >> > > et.liftweb.http.js, net.liftweb.http.js.jquery,
> net.liftweb.sitemap]
> > >> > > [ERROR] Error(s) found in manifest configuration
> > >> > > [INFO]
> >
> > >>
> 
> > >> > > [ERROR] BUILD ERROR
> > >> > > [INFO]
> >
> > >>
> 
> > >> > > [INFO] Error(s) found in manifest configuration
> >
> > >> > > It seems like a problem with the construction of the following
> > >> > > plugin in the pom.
> >
> > >> > > 
> > >> > > org.apache.felix
> > >> > > maven-bundle-plugin
> > >> > > 
> > >> > >   
> > >> > > !
> > >> > > net.liftweb.util.*,net.liftweb.*;version="${pom.version}" > >> > > Package>
> > >> > > org.slf4j.*;resolution:="optional",* > >> > > Import-Package>
> > >> > > *
> > >> > >   
> > >> > > 
> > >> > >   
> >
> > >> > > Either that, or there's something else going on. Any ideas?
> >
> > >> > > Glenn...
> >
> > >> > > On Jun 11, 11:54 am, Derek Chen-Becker 
> wrote:
> >
> > >> > > > I'm building some code right now that I think should handle all
> of
> > >> your
> > >> > > > cases. Since Menu.builder is already concerned with building a
> menu
> > >> tree, I
> > >> > > > decided that it would be better to allow you to specify a
> specific
> > >> item or
> > >> > > > group to Menu.bui

[Lift] Re: So where is that OAuth?

2009-06-22 Thread Timothy Perrett

I'm using the apache http client in lift-paypal and have been  
contemplating extracring some of the util methods / factories into the  
lift-util package of lift so if your going to make something for OAuth  
go for http client for sure as it's already in use within the lift eco- 
system.

Cheers

Tim

Sent from my iPhone

On 22 Jun 2009, at 16:59, "marius d."  wrote:

>
>
>
> On Jun 22, 3:25 am, DFectuoso  wrote:
>> Well i went ahead and learn a lot from the lift-openId implementation
>> and understand what I would need to do have lift-OAuth working
>>
>> It seems like i could do two things:
>> 1) Get a OAuth java library that allows me to post, get, login and
>> logout then create a OAuth.scala file where i create a trait of the
>> OAuth Handler that would access to this methods, then create a object
>> that extends from that trait; Then create a OAuthProtoUser.scala  
>> where
>> I would have a trait for the MetaOAuthProtoUser with the Xhtml for
>> login, override the menus that i would not use and perform the login
>> and logout of the user as well as the post and get methods. Finally
>> create a trait for the OAuthProtoUser that would allow me to store
>> information about the user.
>
> Besides Proto stuff we'd need an abstraction over OAuth artifacts.
> Essentially a wrapper over their Java library.
>
>> 2) Go ahead and have the login,logout, post and get methods on the
>> OAuth.scala actually do the logic to get the tokens without a java
>> library, this would mean creating some way of signing a url and body
>> to post and get stuff from the request, access and user-auth Token  
>> Url
>> or an url in the service.
>>
>> I have absolutely no experience with scala, java or lift but I really
>> want to get some(by doing this type of stuff). So what do you think  
>> is
>> better(for me to learn, for lift and for you).
>
> I think it would be a good exercise. Once you're done with it we could
> probably review it and maybe it'll get its way into Lift if some
> committer doesn't implement it in the mean time, but regardless would
> be a good exercise for you.
>
>>
>> Also, what part of this abstraction(and how) is the one to set the
>> consumer_key, secret_key and the request urls?
>
> In OAuth world consumer secret and consumer key are somehow invariants
> as they impersonate a trusted service. So I would put them into a
> Scala object where user can just set these quantities from Boot.
>
>>
>> Finally; a uber noob question, what is the equivalent of curl(php) or
>> urllib/urlopen(python) that i would use in the second option to
>> actually make the http request to ther other site? I think its a
>> servlet but some trivial example on this would really help me =)
>
> You can just use HttpUrlConnection, or Apache Http client.
>
>>
>> On Jun 21, 7:18 am, "marius d."  wrote:
>>
>>> OAuth is not implemented yet in Lift still the project folder is
>>> there. I think Dave wanted to put it there but never got the  
>>> chance to
>>> add it.
>>
>>> Br's,
>>> Marius
>>
>>> On Jun 21, 9:29 am, DFectuoso  wrote:
>>
 Im trying to integrate OAuth (with twitter) in one of my  
 projects...
 and i saw the lift-oauth, but i cant find the code, documentation  
 or
 examples around this module; so i guess either its somewhere else  
 or
 people is doing their twitter integrations with other class(maybe
 java)...
>>
 So what are you guys doing around OAuth and what could i do to get
 this rolling?
> >
>

--~--~-~--~~~---~--~~
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: Jetty and Apache

2009-06-22 Thread David Pollak
On Sat, Jun 20, 2009 at 9:34 PM, DFectuoso  wrote:

>
> Actually... what can I do to help you create a good tutorial on how to
> take any off the shelf vpn server running a LAMP stack to have nginx,
> jetty and apache running(and still using cpanel and everything else
> for php sites). I think that having a step by step tutorial on how to
> deploy to the GAE(i know you dont like it but hey), vpn, and Amazon
> EC2 would be great; I know there are some stuff out there but for
> people who have not used any java container its pretty hard to
> undertand what going on with all this softwares


The more information people have, the better.  I may not be keen on GAE, but
others see value in it, so please tell the community about it... I have been
wrong about one (OS/2) or two (OpenDoc) things in my life. :-)


>
>
> Kudos
>
> On Jun 20, 6:27 pm, David Pollak 
> wrote:
> > Apache does not deal well with long polling or lots of open connections.
> > For low traffic sites, it won't be noticeable.  However, I strongly
> > recommend nginx... it's a much much better http server than apache and
> it's
> > got a very small memory footprint.  On my servers, I run nginx at port 80
> > and proxy to apache for php sites.
> >
> > On Jun 20, 2009 3:11 PM, "DFectuoso"  wrote:
> >
> > I have a VPS in wiredtree where i would like to run a scala/lift
> > application with jeety in a server that is running a LAMP stack. I
> > want to use comet actors so i will be using the "long http hack" and i
> > dont know if that would be important.
> >
> > So what options do i have? How can i achieve this? I read there are
> > way to do this with mod_rewrite and with mod_proxy but i have no idea!
>
> >
>


-- 
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: Jetty and Apache

2009-06-22 Thread David Pollak
On Sat, Jun 20, 2009 at 8:33 PM, DFectuoso  wrote:

>
> Thank you very much, i will look into nginx! I admire how fast you
> answer everything in here =) ... o yea and thanks for creating this
> great community!
>
> How about the java container, do you strongly recommend jetty or is
> there anything better? (Specially what do you think of tomcat?)


I have a preference for Jetty.  It handles Lift's comet better than any
other non-beta app container.  I'll be spending time with Glassfish next
month.


>
>
> On Jun 20, 6:27 pm, David Pollak 
> wrote:
> > Apache does not deal well with long polling or lots of open connections.
> > For low traffic sites, it won't be noticeable.  However, I strongly
> > recommend nginx... it's a much much better http server than apache and
> it's
> > got a very small memory footprint.  On my servers, I run nginx at port 80
> > and proxy to apache for php sites.
> >
> > On Jun 20, 2009 3:11 PM, "DFectuoso"  wrote:
> >
> > I have a VPS in wiredtree where i would like to run a scala/lift
> > application with jeety in a server that is running a LAMP stack. I
> > want to use comet actors so i will be using the "long http hack" and i
> > dont know if that would be important.
> >
> > So what options do i have? How can i achieve this? I read there are
> > way to do this with mod_rewrite and with mod_proxy but i have no idea!
>
> >
>


-- 
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: So where is that OAuth?

2009-06-22 Thread marius d.



On Jun 22, 3:25 am, DFectuoso  wrote:
> Well i went ahead and learn a lot from the lift-openId implementation
> and understand what I would need to do have lift-OAuth working
>
> It seems like i could do two things:
> 1) Get a OAuth java library that allows me to post, get, login and
> logout then create a OAuth.scala file where i create a trait of the
> OAuth Handler that would access to this methods, then create a object
> that extends from that trait; Then create a OAuthProtoUser.scala where
> I would have a trait for the MetaOAuthProtoUser with the Xhtml for
> login, override the menus that i would not use and perform the login
> and logout of the user as well as the post and get methods. Finally
> create a trait for the OAuthProtoUser that would allow me to store
> information about the user.

Besides Proto stuff we'd need an abstraction over OAuth artifacts.
Essentially a wrapper over their Java library.

> 2) Go ahead and have the login,logout, post and get methods on the
> OAuth.scala actually do the logic to get the tokens without a java
> library, this would mean creating some way of signing a url and body
> to post and get stuff from the request, access and user-auth Token Url
> or an url in the service.
>
> I have absolutely no experience with scala, java or lift but I really
> want to get some(by doing this type of stuff). So what do you think is
> better(for me to learn, for lift and for you).

I think it would be a good exercise. Once you're done with it we could
probably review it and maybe it'll get its way into Lift if some
committer doesn't implement it in the mean time, but regardless would
be a good exercise for you.

>
> Also, what part of this abstraction(and how) is the one to set the
> consumer_key, secret_key and the request urls?

In OAuth world consumer secret and consumer key are somehow invariants
as they impersonate a trusted service. So I would put them into a
Scala object where user can just set these quantities from Boot.

>
> Finally; a uber noob question, what is the equivalent of curl(php) or
> urllib/urlopen(python) that i would use in the second option to
> actually make the http request to ther other site? I think its a
> servlet but some trivial example on this would really help me =)

You can just use HttpUrlConnection, or Apache Http client.

>
> On Jun 21, 7:18 am, "marius d."  wrote:
>
> > OAuth is not implemented yet in Lift still the project folder is
> > there. I think Dave wanted to put it there but never got the chance to
> > add it.
>
> > Br's,
> > Marius
>
> > On Jun 21, 9:29 am, DFectuoso  wrote:
>
> > > Im trying to integrate OAuth (with twitter) in one of my projects...
> > > and i saw the lift-oauth, but i cant find the code, documentation or
> > > examples around this module; so i guess either its somewhere else or
> > > people is doing their twitter integrations with other class(maybe
> > > java)...
>
> > > So what are you guys doing around OAuth and what could i do to get
> > > this rolling?
--~--~-~--~~~---~--~~
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: prep for offline work

2009-06-22 Thread Timothy Perrett

Grab yourself a copy of the lift book, download the lift source code
so you can build locally if need be and dont forget you prefix all
your maven commands: mvn -o

Cheers, Tim

On Jun 22, 4:01 pm, Mojo  wrote:
> Hi all, I've enjoyed following the list for a few weeks, and studying
> Scala casually for a few months.
>
> I'm a Java developer currently working with Spring and Hibernate to
> build web apps, and spent a few months professionally in the Ruby on
> Rails world as well.
>
> I'm about to depart on a ten-day cruise (San Francisco to Alaska) and
> kind of looking forward to the disconnected time to spend working with
> Scala and Lift.
>
> Being disconnected makes for good concentration time, but it also
> makes it difficult to deal with things like missing Maven
> dependencies. I'm trying to be as prepared as I can before departure.
>
> I've done things like install the "helloworld" lift app from Maven,
> and done a complete build to jetty:run, and even "mvn site" to try and
> make sure all the plugins and dependencies are in my local repository.
> I have Netbeans on the machine, 6.5, and the latest RC for 6.7, but
> haven't yet installed the Scala plugin.
>
> I'd probably better have a DB on hand. Mysql or HSQLDB.
>
> Can anyone think of any other good ways to prepare for doing some
> study and development while being off the grid, so to speak?
>
> Cheers,
> Mojo
> --
> Morris Jones
> Monrovia, CA
> m...@whiteoaks.comhttp://mojo.whiteoaks.com
--~--~-~--~~~---~--~~
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] prep for offline work

2009-06-22 Thread Mojo

Hi all, I've enjoyed following the list for a few weeks, and studying
Scala casually for a few months.

I'm a Java developer currently working with Spring and Hibernate to
build web apps, and spent a few months professionally in the Ruby on
Rails world as well.

I'm about to depart on a ten-day cruise (San Francisco to Alaska) and
kind of looking forward to the disconnected time to spend working with
Scala and Lift.

Being disconnected makes for good concentration time, but it also
makes it difficult to deal with things like missing Maven
dependencies. I'm trying to be as prepared as I can before departure.

I've done things like install the "helloworld" lift app from Maven,
and done a complete build to jetty:run, and even "mvn site" to try and
make sure all the plugins and dependencies are in my local repository.
I have Netbeans on the machine, 6.5, and the latest RC for 6.7, but
haven't yet installed the Scala plugin.

I'd probably better have a DB on hand. Mysql or HSQLDB.

Can anyone think of any other good ways to prepare for doing some
study and development while being off the grid, so to speak?

Cheers,
Mojo
--
Morris Jones
Monrovia, CA
m...@whiteoaks.com
http://mojo.whiteoaks.com

--~--~-~--~~~---~--~~
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: JPA and auto generation of id

2009-06-22 Thread Eric Bowman

David Persons wrote:
> Hello guys,
>
> I get a org.hibernate.exception.SQLGrammarException: could not get or
> update next value error everytime I try to save the following Entity:
>
> @Entity
> class Scene {
>   @Id
>   @GeneratedValue(){val strategy = GenerationType.AUTO}
>   var id : Long = _
>
>   @Column{val unique = true, val nullable = false}
>   var ordering : Int = _
>
>   @Column{val unique = true, val nullable = false}
>   var name : String = ""
>
>   @ManyToOne{val optional = false}
>   var storyBoard : StoryBoard = _
> }
>
>   

You almost certainly need some scala.reflect.BeanProperty annotations on
your fields.

cheers,
Eric

-- 
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] Re: JPA and auto generation of id

2009-06-22 Thread Mojo

My guess:  It depends on the DB you're using.  If it's Oracle, you may
need to create a sequence for the table ID. Alternatively your ORM
configuration may need to know what dialect of database to use.

Mojo
--
Morris Jones
Monrovia, CA
m...@whiteoaks.com
http://mojo.whiteoaks.com

On Sun, Jun 21, 2009 at 4:31 PM, David Persons wrote:
>
> Hello guys,
>
> I switched from the Mapper Framework to JPA. Example of one of the
> entities:
>
> @Entity
> class Scene {
> �...@id
> �...@generatedvalue(){val strategy = GenerationType.AUTO}
>  var id : Long = _
>
> �...@column{val unique = true, val nullable = false}
>  var ordering : Int = _
>
> �...@column{val unique = true, val nullable = false}
>  var name : String = ""
>
> �...@manytoone{val optional = false}
>  var storyBoard : StoryBoard = _
> }
>
> When trying to save a new Scene, I keep getting the following error:
> org.hibernate.exception.SQLGrammarException: could not get or update
> next value
>
> What can be the problem??
>
> regards,
> David
>
> >
>

--~--~-~--~~~---~--~~
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: JaveRebel Setup

2009-06-22 Thread fan...@gmail.com

Mark Lynn a écrit :
> 
> I saw JavaRebel mentioned on the list in recent days and was excited  
> to try it. I followed the instructions at
> 
> http://wiki.liftweb.net/index.php/JavaRebel
> 
[...] The one thing I was really missing from the Rails
> world was the reloading of classes automatically - hence I was very  
> excited to learn of JavaRebel.

Hello Mark,

For the auto-reloading part, in webdevelopment, it's a MUST HAVE, so I 
fully understand it :)

For the behaviour you are seeing, I have it, too, within IntelliJ: only 
some classes are recompiled/reloaded. Particularly, anonymous classes 
generated for higher order function and the like are not well handled.
So, I can't help you, but if you find a solution, I'm interested !

-- 
Francois Armand
http://fanf42.blogspot.com

--~--~-~--~~~---~--~~
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: JPA and auto generation of id

2009-06-22 Thread Oliver Lambert
What sort of database are you trying to use Hibernate against (look at the
property hibernate.dialect  in the file persistence.xml)?
I think the error may mean that your trying to use GenerationType.AUTO
against a database that doesn't support it.
On Mon, Jun 22, 2009 at 7:08 PM, David Persons  wrote:

>
> Hello guys,
>
> I get a org.hibernate.exception.SQLGrammarException: could not get or
> update next value error everytime I try to save the following Entity:
>
> @Entity
> class Scene {
>  @Id
>  @GeneratedValue(){val strategy = GenerationType.AUTO}
>  var id : Long = _
>
>  @Column{val unique = true, val nullable = false}
>  var ordering : Int = _
>
>  @Column{val unique = true, val nullable = false}
>  var name : String = ""
>
>  @ManyToOne{val optional = false}
>  var storyBoard : StoryBoard = _
> }
>
> What am I doing wrong??
>
> grtz,
> David Persons
>
> >
>

--~--~-~--~~~---~--~~
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] JaveRebel Setup

2009-06-22 Thread Mark Lynn


I saw JavaRebel mentioned on the list in recent days and was excited  
to try it. I followed the instructions at

http://wiki.liftweb.net/index.php/JavaRebel

for using it with Jetty. I have mvn scala:cc setup in another terminal  
window and I see that it is compiling files that change. I also see  
where JavaRebel is reporting that snippets are being reloaded, but it  
does not appear to be reloading other classes generated from the  
snippet source file. As an example, if I add a case to the dispatch  
method, it does not pick up this change. Is this a limitation of  
JavaRebel or am I missing something in the configuration? By the way,  
I am not using an IDE - just Textmate and the command line which is my  
preferred mode. The one thing I was really missing from the Rails  
world was the reloading of classes automatically - hence I was very  
excited to learn of JavaRebel.

  - Mark

Mark Lynn
Sabado Technologies




--~--~-~--~~~---~--~~
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] JPA and auto generation of id

2009-06-22 Thread David Persons

Hello guys,

I get a org.hibernate.exception.SQLGrammarException: could not get or
update next value error everytime I try to save the following Entity:

@Entity
class Scene {
  @Id
  @GeneratedValue(){val strategy = GenerationType.AUTO}
  var id : Long = _

  @Column{val unique = true, val nullable = false}
  var ordering : Int = _

  @Column{val unique = true, val nullable = false}
  var name : String = ""

  @ManyToOne{val optional = false}
  var storyBoard : StoryBoard = _
}

What am I doing wrong??

grtz,
David Persons

--~--~-~--~~~---~--~~
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: So where is that OAuth?

2009-06-22 Thread DFectuoso

Well i went ahead and learn a lot from the lift-openId implementation
and understand what I would need to do have lift-OAuth working

It seems like i could do two things:
1) Get a OAuth java library that allows me to post, get, login and
logout then create a OAuth.scala file where i create a trait of the
OAuth Handler that would access to this methods, then create a object
that extends from that trait; Then create a OAuthProtoUser.scala where
I would have a trait for the MetaOAuthProtoUser with the Xhtml for
login, override the menus that i would not use and perform the login
and logout of the user as well as the post and get methods. Finally
create a trait for the OAuthProtoUser that would allow me to store
information about the user.
2) Go ahead and have the login,logout, post and get methods on the
OAuth.scala actually do the logic to get the tokens without a java
library, this would mean creating some way of signing a url and body
to post and get stuff from the request, access and user-auth Token Url
or an url in the service.

I have absolutely no experience with scala, java or lift but I really
want to get some(by doing this type of stuff). So what do you think is
better(for me to learn, for lift and for you).

Also, what part of this abstraction(and how) is the one to set the
consumer_key, secret_key and the request urls?

Finally; a uber noob question, what is the equivalent of curl(php) or
urllib/urlopen(python) that i would use in the second option to
actually make the http request to ther other site? I think its a
servlet but some trivial example on this would really help me =)

On Jun 21, 7:18 am, "marius d."  wrote:
> OAuth is not implemented yet in Lift still the project folder is
> there. I think Dave wanted to put it there but never got the chance to
> add it.
>
> Br's,
> Marius
>
> On Jun 21, 9:29 am, DFectuoso  wrote:
>
> > Im trying to integrate OAuth (with twitter) in one of my projects...
> > and i saw the lift-oauth, but i cant find the code, documentation or
> > examples around this module; so i guess either its somewhere else or
> > people is doing their twitter integrations with other class(maybe
> > java)...
>
> > So what are you guys doing around OAuth and what could i do to get
> > this rolling?

--~--~-~--~~~---~--~~
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] JPA and auto generation of id

2009-06-22 Thread David Persons

Hello guys,

I switched from the Mapper Framework to JPA. Example of one of the
entities:

@Entity
class Scene {
  @Id
  @GeneratedValue(){val strategy = GenerationType.AUTO}
  var id : Long = _

  @Column{val unique = true, val nullable = false}
  var ordering : Int = _

  @Column{val unique = true, val nullable = false}
  var name : String = ""

  @ManyToOne{val optional = false}
  var storyBoard : StoryBoard = _
}

When trying to save a new Scene, I keep getting the following error:
org.hibernate.exception.SQLGrammarException: could not get or update
next value

What can be the problem??

regards,
David

--~--~-~--~~~---~--~~
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-paypal: Paypal Production PDT not working - help!

2009-06-22 Thread Timothy Perrett

Hey chaps... sorry for my late reply (just flew in from Egypt!)

The pdtPath is configurable already, right?

object SimplePaypal extends PaypalPDT {
  def pdtPath: String = "yourendpoint"
  
}

Im not sure why this would cause an issue as if you look at the
dispatch:

Req(RootPath :: PDTPath :: Nil, "", PostRequest)

Its just concatenating both the rootPath and the pdtPath defs (via
lazy vals) - so you can set it to whatever you want within some basic
guidelines. What is it thats not happening for you exactly or in what
way do you feel its not configurable?

Cheers, Tim

On Jun 19, 2:07 am, David Pollak 
wrote:
> On Thu, Jun 18, 2009 at 3:17 PM, Derek Chen-Becker 
> wrote:
>
> > It seems to me that the pdtPath should be configurable. If other people
> > agree we should at least open an issue on GitHub to track this.
>
> Sure.
>
>
>
>
>
>
>
> > Derek
>
> > On Thu, Jun 18, 2009 at 3:07 PM, Dano  wrote:
>
> >> Resolved.
>
> >> I backed out my override on pdtPath and adjusted my paypal
> >> configuration to point to /paypal/pdt and things worked.
>
> >> Moral of the story: Do NOT override pdtPath!!
>
> >> On Jun 18, 12:07 pm, Dano  wrote:
> >> > Sorry, my post got submitted too early.
>
> >> > When I commented out the line: override def pdtPath = "complete"
>
> >> > I get the same failure mode as in production.
>
> >> > Do I need to set pdtPath or what do I change to work with the default?
>
> >> > Thanks.
>
> >> > Dan
>
> >> > On Jun 18, 12:04 pm, Dano  wrote:
>
> >> > > More information:
>
> >> > > In my object which extends PaypalPDT, I had a line which overridded
> >> > > the variable pdtPath:
>
> >> > > override def pdtPath = "complete"
>
> >> > > On Jun 18, 11:58 am, Dano  wrote:
>
> >> > > > I trying to get our site (buyafeature.com) live today and ran into
> >> a
> >> > > > problem with the paypal feature.  I am using the lift-paypal module
> >> > > > and things have been working just fine in development.
>
> >> > > > The problem I am seeing is that when I press the "Return to Website"
> >> > > > button in paypal, it tries to redirect to the following URL:
>
> >>http://buyafeature.com/paypal/complete?tx=36627495TV601683L&st=Comple...
>
> >> > > > And then the browser shows the following error:
>
> >> > > > The Requested URL /paypal/complete was not found on this server
>
> >> > > > I tried to reproduced this on the development sandbox but it works
> >> > > > fine (i.e. returns to the starting page in my app and my server gets
> >> > > > the PDT event).
>
> >> > > > Has anyone seen this or have any ideas on what to try?
>
> >> > > > Thanks in advance.
>
> >> > > > Dan
>
> --
> 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
-~--~~~~--~~--~--~---