For those of you who are reading this post about using Inline::Java with 
Catalyst, the following is provided so the issue's resolution is shared.

Patrick asked me to create a debug dump by adding the option DEBUG => 5. I 
added the option and created the dump, which was huge (6Mb+). I forwarded the 
dump directly to Patrick's email address because of its size. That was last 
night. This morning I opened my email and found that Patrick had already 
scanned the dump and come up with an answer. I have performed initial testing 
within the Catalyst framework and found that his suggestion worked. Fantastic!

Unfortunately, I used a different email address to send the dump to Patrick and 
he responded to that email address. I cannot directly forward his response to 
inline@perl.org. So I have simply copied and pasted his response here.

==================
Patrick's response
==================

Thomas,

Basically your Java classes end up under these namespaces:

myJava::Controller::Root::paypal::payflow::AuthorizationTransaction
myJava::Controller::Root::paypal::payflow::BillTo
myJava::Controller::Root::paypal::payflow::Currency
myJava::Controller::Root::paypal::payflow::Invoice
myJava::Controller::Root::paypal::payflow::PayflowConnectionData
myJava::Controller::Root::paypal::payflow::PayflowUtility
myJava::Controller::Root::paypal::payflow::Response
myJava::Controller::Root::paypal::payflow::SDKProperties
myJava::Controller::Root::paypal::payflow::TransactionResponse
myJava::Controller::Root::paypal::payflow::UserInfo

So, for example, to create an object, you have to go something like this:

my $ui = new myJava::Controller::Root::paypal::payflow::UserInfo(...) ;


Patrick

=========================
end of Patrick's response
=========================

I modified my code to use the extended naming scheme to test out if the PayFlow 
methods were really accessible that way. It worked without a hitch.

In my original module, I was trying to access the methods like this:

my $sdk = new paypal::payflow::SDKProperties() ;

That worked fine if I was using a non-Catalyst perl program. But Catalyst adds 
plenty of its own namespace processing, so I had to use the full path from the 
very top of the Catalyst program, where 

1) myJava:: represents the main Catalyst framework application,  

2) Controller:: is the subdirectory under the main application (the 'C' part of 
Catalyst's 'MVC' functionality), and 

3) Root:: is the actual module containing the executable code (and which was 
the module with the "use" clause that loaded the module containing the use 
"Inline Java => 'STUDY'" in it (note that the latter module's name does not 
appear in the namespace hierarchy)). 

Thank you so very much Patrick. I will follow up as I move from my test 
framework to my actual module.

Tom


Reply via email to