[Lift] Re: A coupel of quick questions

2008-10-09 Thread Charles F. Munat

David Pollak wrote:
 If you're cool with looking up the snippet by class/method name use the 
 plain old snippet.  If you want some control before the method gets 
 invoked (e.g., changing the behavior based on current session state), 
 use the dispatch snippet.

Is there a good example of this in the example sites somewhere? I'm a 
bit confused but intrigued.

 One-to-Many is:
 object otherThing extends MappedLongForeignKey(this, Other)
 
 otherThing.obj: Can[Other] will give you the other, if it exists.
 
 In other, to find all the things the refer to it:
 
 def findThings: List[Thing] = Thing.findAll(Thing.otherThing, this.id 
 http://this.id)
 
 Does that help?

Very much so. Thank you!

Chas.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A coupel of quick questions

2008-10-09 Thread Tim Perrett

 Is there a good example of this in the example sites somewhere? I'm a
 bit confused but intrigued.

http://github.com/dpp/liftweb/tree/master/sites/example/src/main/scala/net/liftweb/example/snippet/CountGame.scala

That should help you get started

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



[Lift] Re: A coupel of quick questions

2008-10-09 Thread Charles F. Munat

OK, I have two mapped classes:

class Page extends KeyedMapper[Long, Page] {
   def findPageSections: List[PageSection] =
 PageSection.findAll(PageSection.page, this.id)
}

and

class PageSection extends KeyedMapper[Long, PageSection] {
   object page extends MappedLongForeignKey(this, Page) {
 override def dbDisplay_? = false
   }
}

and I get this:

error: type mismatch;
[WARNING]  found   : Long
[WARNING]  required:
 net.liftweb.mapper.QueryParam[com.myapp.model.Page]
[WARNING]   def findPageSections: List[PageSection] =
 Page.findAll(PageSection.page, this.id)
  ^


??

Chas.

David Pollak wrote:
 
 
 On Tue, Oct 7, 2008 at 1:28 PM, Charles F. Munat [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 
 What is the benefit of the Dispatch Snippet over the Snippet? When would
 I use one and when the other?
 
 
 If you're cool with looking up the snippet by class/method name use the 
 plain old snippet.  If you want some control before the method gets 
 invoked (e.g., changing the behavior based on current session state), 
 use the dispatch snippet.
  
 
 
 
 Is there a quick explanation somewhere that is *up-to-date* on how to do
 one-to-many bidirectional relationships and many-to-many bidirectional
 relationships in the mapper? I've looked around but I'm not sure how it
 all works.
 
 
 There's no much to say about many to many other than HasManyThrough 
 which is a pretty old and crunchy piece of code.
 
 One-to-Many is:
 object otherThing extends MappedLongForeignKey(this, Other)
 
 otherThing.obj: Can[Other] will give you the other, if it exists.
 
 In other, to find all the things the refer to it:
 
 def findThings: List[Thing] = Thing.findAll(Thing.otherThing, this.id 
 http://this.id)
 
 Does that help?
 
 Thanks,
 
 David
  
 
 
 
 Thanks!
 
 Chas.
 
 
 
 
 
 -- 
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A coupel of quick questions

2008-10-09 Thread Charles F. Munat

Very helpful. Thanks!

Tim Perrett wrote:
 Is there a good example of this in the example sites somewhere? I'm a
 bit confused but intrigued.
 
 http://github.com/dpp/liftweb/tree/master/sites/example/src/main/scala/net/liftweb/example/snippet/CountGame.scala
 
 That should help you get started
 
 Cheers, Tim
  

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



[Lift] Re: NetBeans and complex parser combinator files

2008-10-09 Thread Viktor Klang
Is it permGen OOM or Heap OOM?

On Wed, Oct 8, 2008 at 7:21 PM, David Pollak [EMAIL PROTECTED] wrote:


 Folks,

 I've been using NetBean pretty successfully... except for projects that
 refer to complex parser combinator files (e.g., Lift's Textile parser.)
 NetBeans looks for stuff on the classpath and when it gets to the file
 with the complex parser combinator stuff in it, it gets Out of Memory
 exceptions (I've allocated 3GB to the NB process).

 Is there a way to ask NetBeans to not parse these files?  Alternatively,
 is there a way to reduce the memory needs for these complex files?

 Thanks,

 David

 PS -- There's a separate problem editing these files, but I'm not
 worried about that right now... I'm happy to use emacs to edit the files.


 



-- 
Viktor Klang
Senior Systems Analyst

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] lift-paypal module

2008-10-09 Thread Tim Perrett

Guys,

I've spent some time gutting my extremely boiler plate paypal code now
its in master. I've only implemented the PDT data types and response
so far, but im going to do IPN tomorrow / over the weekend.

So then, its all properly immutable now and is just generally a lot
more sensible. To use it from a snippet you do this:

val pdt: PaypalDataTransferReponse =
PaypalDataTransfer(MyAuthToken,S.param(tx)).execute

The default points to the sandbox, so to make it work with live you
need to do:

val pdt: PaypalDataTransferReponse =
PaypalDataTransfer(MyAuthToken,S.param(tx))
 
.withMode(PaypalLive).execute

When you have your PDT object, and just simply want to see if the
transaction was a success or not you can do:

pdt.paymentSuccessful // gives boolean result

Would love to hear any thoughts people might have at this stage :-)

Cheers

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



[Lift] Re: NetBeans and complex parser combinator files

2008-10-09 Thread David Pollak


Erik Engbrecht wrote:
 I haven't tried this, but if possible I'd suggest moving them into a 
 separate libary and only letting NetBeans see the compiled jar.
Unfortunately, that doesn't work.  Anything that is seen as part of the 
project is parsed.  So, I can't edit the Lift Example code because it 
refers to the Lift Textile parser (even though it just refers to the JAR).

  
 As a side note, I bet the Eclipse plugin has the same problem.  They 
 are both use pieces of Scala compiler, and anything that makes the 
 compiler work hard makes the IDE work several times harder, because 
 new stuff is continuously being pushed through pieces of the compiler.

 On Wed, Oct 8, 2008 at 1:21 PM, David Pollak [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:


 Folks,

 I've been using NetBean pretty successfully... except for projects
 that
 refer to complex parser combinator files (e.g., Lift's Textile
 parser.)
 NetBeans looks for stuff on the classpath and when it gets to the file
 with the complex parser combinator stuff in it, it gets Out of Memory
 exceptions (I've allocated 3GB to the NB process).

 Is there a way to ask NetBeans to not parse these files?
  Alternatively,
 is there a way to reduce the memory needs for these complex files?

 Thanks,

 David

 PS -- There's a separate problem editing these files, but I'm not
 worried about that right now... I'm happy to use emacs to edit the
 files.



 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: NetBeans and complex parser combinator files

2008-10-09 Thread Miles Sabin

On Thu, Oct 9, 2008 at 1:55 PM, Erik Engbrecht [EMAIL PROTECTED] wrote:
 As a side note, I bet the Eclipse plugin has the same problem.

It'd be much appreciated if someone could give this a try ...

Cheers,


Miles

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: A coupel of quick questions

2008-10-09 Thread David Pollak


Charles F. Munat wrote:
 OK, I have two mapped classes:

 class Page extends KeyedMapper[Long, Page] {
def findPageSections: List[PageSection] =
  PageSection.findAll(PageSection.page, this.id)
 }

 and

 class PageSection extends KeyedMapper[Long, PageSection] {
object page extends MappedLongForeignKey(this, Page) {
  override def dbDisplay_? = false
}
 }

 and I get this:

 error: type mismatch;
 [WARNING]  found   : Long
 [WARNING]  required:
  net.liftweb.mapper.QueryParam[com.myapp.model.Page]
 [WARNING]   def findPageSections: List[PageSection] =
  Page.findAll(PageSection.page, this.id)
   

Page.findAll(By(PageSection.page, this.id))

You could also do:

Page.findAll(By(PageSection.page, this.id), OrderBy(PageSection.page, 
Ascending))
   ^


 ??

 Chas.

 David Pollak wrote:
   
 On Tue, Oct 7, 2008 at 1:28 PM, Charles F. Munat [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:


 What is the benefit of the Dispatch Snippet over the Snippet? When would
 I use one and when the other?


 If you're cool with looking up the snippet by class/method name use the 
 plain old snippet.  If you want some control before the method gets 
 invoked (e.g., changing the behavior based on current session state), 
 use the dispatch snippet.
  



 Is there a quick explanation somewhere that is *up-to-date* on how to do
 one-to-many bidirectional relationships and many-to-many bidirectional
 relationships in the mapper? I've looked around but I'm not sure how it
 all works.


 There's no much to say about many to many other than HasManyThrough 
 which is a pretty old and crunchy piece of code.

 One-to-Many is:
 object otherThing extends MappedLongForeignKey(this, Other)

 otherThing.obj: Can[Other] will give you the other, if it exists.

 In other, to find all the things the refer to it:

 def findThings: List[Thing] = Thing.findAll(Thing.otherThing, this.id 
 http://this.id)

 Does that help?

 Thanks,

 David
  



 Thanks!

 Chas.





 -- 
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] JPA Demo with JTA and JNDI

2008-10-09 Thread Derek Chen-Becker
I'm very close to getting this working. I can look up the EM via JNDI as
well as the UserTransaction, but I'm getting a weird error with Atomikos:

Message: java.lang.RuntimeException: Transaction Service Not Running?
com.atomikos.icatch.jta.J2eeUserTransaction.checkSetup(Unknown Source)
com.atomikos.icatch.jta.J2eeUserTransaction.begin(Unknown Source)


I've never used Atomikos before so I may be missing something simple. In any
case I think I'll be able to check the changes in later today or tomorrow
morning.

Derek

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-paypal module

2008-10-09 Thread Charles F. Munat

Outstanding! And just in time. I need to implement PayPal functionality 
on a site next week. Thank you very much, Tim.

Chas.

Tim Perrett wrote:
 Guys,
 
 I've spent some time gutting my extremely boiler plate paypal code now
 its in master. I've only implemented the PDT data types and response
 so far, but im going to do IPN tomorrow / over the weekend.
 
 So then, its all properly immutable now and is just generally a lot
 more sensible. To use it from a snippet you do this:
 
 val pdt: PaypalDataTransferReponse =
 PaypalDataTransfer(MyAuthToken,S.param(tx)).execute
 
 The default points to the sandbox, so to make it work with live you
 need to do:
 
 val pdt: PaypalDataTransferReponse =
 PaypalDataTransfer(MyAuthToken,S.param(tx))
  
 .withMode(PaypalLive).execute
 
 When you have your PDT object, and just simply want to see if the
 transaction was a success or not you can do:
 
 pdt.paymentSuccessful // gives boolean result
 
 Would love to hear any thoughts people might have at this stage :-)
 
 Cheers
 
 Tim
  

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



[Lift] Re: lift-paypal module

2008-10-09 Thread Tim Perrett

Sweet - I'll be implementing IPN soon as well, so we'll have the
braces and belt as it were. My plan for that right now is two fold:

a) A hadnling class that is implemented as part of a DispatchPf setup,
and a subsequent ResponseState to satisfy the paypal POST to the
client web server. Perhaps require the user to implement the IPN trait
in there custom handler so they can then program it however they want
(update the database or whatever)

b) A similar mechanism to the PDT stuff to make the IPN verification
callback to confirm the post data.

If you've got any suggestions or stuff you'd like to see by all means
say

Cheers

Tim

On Oct 9, 4:43 pm, Charles F. Munat [EMAIL PROTECTED] wrote:
 Outstanding! And just in time. I need to implement PayPal functionality
 on a site next week. Thank you very much, Tim.

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



[Lift] Re: A coupel of quick questions

2008-10-09 Thread Charles F. Munat

Ah! I thought that's what the QueryParams were, but they weren't in your 
original post so I was confused. Excellent. Thanks a lot.

Chas.

David Pollak wrote:
 
 
 Charles F. Munat wrote:
 OK, I have two mapped classes:

 class Page extends KeyedMapper[Long, Page] {
def findPageSections: List[PageSection] =
  PageSection.findAll(PageSection.page, this.id)
 }

 and

 class PageSection extends KeyedMapper[Long, PageSection] {
object page extends MappedLongForeignKey(this, Page) {
  override def dbDisplay_? = false
}
 }

 and I get this:

 error: type mismatch;
 [WARNING]  found   : Long
 [WARNING]  required:
  net.liftweb.mapper.QueryParam[com.myapp.model.Page]
 [WARNING]   def findPageSections: List[PageSection] =
  Page.findAll(PageSection.page, this.id)
   
 
 Page.findAll(By(PageSection.page, this.id))
 
 You could also do:
 
 Page.findAll(By(PageSection.page, this.id), OrderBy(PageSection.page, 
 Ascending))
   ^


 ??

 Chas.

 David Pollak wrote:
   
 On Tue, Oct 7, 2008 at 1:28 PM, Charles F. Munat [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:


 What is the benefit of the Dispatch Snippet over the Snippet? When would
 I use one and when the other?


 If you're cool with looking up the snippet by class/method name use the 
 plain old snippet.  If you want some control before the method gets 
 invoked (e.g., changing the behavior based on current session state), 
 use the dispatch snippet.
  



 Is there a quick explanation somewhere that is *up-to-date* on how to do
 one-to-many bidirectional relationships and many-to-many bidirectional
 relationships in the mapper? I've looked around but I'm not sure how it
 all works.


 There's no much to say about many to many other than HasManyThrough 
 which is a pretty old and crunchy piece of code.

 One-to-Many is:
 object otherThing extends MappedLongForeignKey(this, Other)

 otherThing.obj: Can[Other] will give you the other, if it exists.

 In other, to find all the things the refer to it:

 def findThings: List[Thing] = Thing.findAll(Thing.otherThing, this.id 
 http://this.id)

 Does that help?

 Thanks,

 David
  



 Thanks!

 Chas.





 -- 
 Lift, the simply functional web framework http://liftweb.net
 Collaborative Task Management http://much4.us
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: lift-paypal module

2008-10-09 Thread Charles F. Munat

Of course I'll be happy to pass along suggestions, bugs I find, etc. 
This is a good opportunity to get something like this into the wild, as 
this is a paying client and they are *very* aggressively pushing me to 
get PayPal online ASAP. I hope to start implementing this next week if I 
can get the Lift/JPA site online this weekend (as I promised them).

Chas.

Tim Perrett wrote:
 Sweet - I'll be implementing IPN soon as well, so we'll have the
 braces and belt as it were. My plan for that right now is two fold:
 
 a) A hadnling class that is implemented as part of a DispatchPf setup,
 and a subsequent ResponseState to satisfy the paypal POST to the
 client web server. Perhaps require the user to implement the IPN trait
 in there custom handler so they can then program it however they want
 (update the database or whatever)
 
 b) A similar mechanism to the PDT stuff to make the IPN verification
 callback to confirm the post data.
 
 If you've got any suggestions or stuff you'd like to see by all means
 say
 
 Cheers
 
 Tim
 
 On Oct 9, 4:43 pm, Charles F. Munat [EMAIL PROTECTED] wrote:
 Outstanding! And just in time. I need to implement PayPal functionality
 on a site next week. Thank you very much, Tim.
 
  

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



[Lift] Re: lift-paypal module

2008-10-09 Thread David Pollak
There are two projects I'm working on that will use the PayPal module in 
the next month as well.

Rock and Roll!

Charles F. Munat wrote:
 Of course I'll be happy to pass along suggestions, bugs I find, etc. 
 This is a good opportunity to get something like this into the wild, as 
 this is a paying client and they are *very* aggressively pushing me to 
 get PayPal online ASAP. I hope to start implementing this next week if I 
 can get the Lift/JPA site online this weekend (as I promised them).

 Chas.

 Tim Perrett wrote:
   
 Sweet - I'll be implementing IPN soon as well, so we'll have the
 braces and belt as it were. My plan for that right now is two fold:

 a) A hadnling class that is implemented as part of a DispatchPf setup,
 and a subsequent ResponseState to satisfy the paypal POST to the
 client web server. Perhaps require the user to implement the IPN trait
 in there custom handler so they can then program it however they want
 (update the database or whatever)

 b) A similar mechanism to the PDT stuff to make the IPN verification
 callback to confirm the post data.

 If you've got any suggestions or stuff you'd like to see by all means
 say

 Cheers

 Tim

 On Oct 9, 4:43 pm, Charles F. Munat [EMAIL PROTECTED] wrote:
 
 Outstanding! And just in time. I need to implement PayPal functionality
 on a site next week. Thank you very much, Tim.
   

 
   

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