You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew Madu <an...@gmail.com> on 2006/02/23 02:22:59 UTC

flowscript importClass problem

When I try and import the following class into my flowscript:

importClass(Packages.com.paypal.soap.api.*);

I get an:

	'missing name after . operator'


error message. If I do the following:


importClass(Packages.com.paypal.soap.api);

I get an:

	Not a Java class: [JavaPackage com.paypal.soap.api]

error message. What am I overlooking here?

regards

Andrew

Re: flowscript importClass problem

Posted by Andrew Madu <an...@gmail.com>.
  Jason,

> The error messages are pretty clear, importClass() requires a Java  
> class
> as an argument,

my bad! Yes I should have simply stated importPackage(). Time for  
some sleep me thinks!!!

regards

Andrew

Re: flowscript importClass problem

Posted by Jason Johnston <co...@lojjic.net>.
Andrew Madu wrote:
> 
> When I try and import the following class into my flowscript:
> 
> importClass(Packages.com.paypal.soap.api.*);
> 
> I get an:
> 
> '*missing name after . operator*' 
> 
> 
> error message. If I do the following:
> 
> 
> importClass(Packages.com.paypal.soap.api);
> 
> I get an:
> 
> *Not a Java class: [JavaPackage com.paypal.soap.api]*
> *
> *
> error message. What am I overlooking here?


The error messages are pretty clear, importClass() requires a Java class
as an argument, not a Java package or a wildcard (which is invalid
JavaScript syntax anyway).  If you need to import multiple classes from
that soap api package you must do each individually.

If you just want to avoid having to type out the verbose
"Packages.com.paypal.soap.api." every time, you can create a javascript
variable that is a reference to that package, so:

  var soap = Packages.com.paypal.soap.api;
  var myObj = new soap.SomeSOAPClass();
  var myOtherObj = new soap.SomeOtherSOAPClass();

Saves a few keystrokes.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org