You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tricia Williams <pg...@student.cs.uwaterloo.ca> on 2006/06/27 20:34:17 UTC

Importing Hand-made Java Packages For Use in Flowscript

Hi All,

    I have a Cocoon pipeline which could be done with a lot of awkward 
branching, or use Flowscript to abstract out some of the complexity and 
reuse a java class that was built for a similar purpose.  The awkwardness 
and complexity comes from the need to validate and in some cases re-form 
the parameters to call another pipe.  The Flowscript would use the class I 
mentioned to form a uri and then call coocoon.redirectTo(...) to redirect 
to that page.

    I've implemented the Flowscript idea but am getting the following 
error:
org.mozilla.javascript.EvaluatorException: 
"file:/c:/Development/martini-peel/cocoonproject/flowscript/martini-flow.js", 
line 44: Not a Java class: [JavaPackage 
org.martini.search.PeelQueryComponent]

    I'm using: importClass(Packages.org.martini.search.PeelQueryComponent); 
To import my class.

    Does anyone have an understanding of what is causing the error 
I'm getting and can offer me a solution.  Is there an alternate way to 
build the uri with the validation and transformation of parameters in 
Cocoon?

Thanks,
Tricia

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


Re: Importing Hand-made Java Packages For Use in Flowscript

Posted by Tricia Williams <pg...@student.cs.uwaterloo.ca>.
Hi,

    That's strange... the .jar that contains the class I'm trying to use is 
used by several xsps to generate content with no problem.  I don't 
understand what the difference between the xsp usage and this javascript 
usage is.  Any thoughts?

Tricia

On Wed, 28 Jun 2006, Jason Johnston wrote:

>> Hi,
>>
>>     I think my problem has to do with the path to the source class that
>> I'm
>> referencing.  Where should the class I'm referencing be relative to
>> cocoon in order for cocoon to recognize it?  Could I include a .jar
>> instead?  Do I need to set anything in cocoon.xconf or the sitemap?
>
> It just needs to be in the classpath.  For most web applications that
> means a JAR file in WEB-INF/lib, or a .class file in WEB-INF/classes
> (within a directory structure matching the package hierarchy).
>
> I believe I remember seeing a special configuration value in Cocoon's
> WEB-INF/web.xml that allows specifying additional locations to add to the
> classpath, if neither of those common locations works for you.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

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


Re: Importing Hand-made Java Packages For Use in Flowscript

Posted by Jason Johnston <co...@lojjic.net>.
> Hi,
>
>     I think my problem has to do with the path to the source class that
> I'm
> referencing.  Where should the class I'm referencing be relative to
> cocoon in order for cocoon to recognize it?  Could I include a .jar
> instead?  Do I need to set anything in cocoon.xconf or the sitemap?

It just needs to be in the classpath.  For most web applications that
means a JAR file in WEB-INF/lib, or a .class file in WEB-INF/classes
(within a directory structure matching the package hierarchy).

I believe I remember seeing a special configuration value in Cocoon's
WEB-INF/web.xml that allows specifying additional locations to add to the
classpath, if neither of those common locations works for you.


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


Re: Importing Hand-made Java Packages For Use in Flowscript

Posted by Tricia Williams <pg...@student.cs.uwaterloo.ca>.
Hi,

    I think my problem has to do with the path to the source class that I'm 
referencing.  Where should the class I'm referencing be relative to 
cocoon in order for cocoon to recognize it?  Could I include a .jar 
instead?  Do I need to set anything in cocoon.xconf or the sitemap?

Thanks for any advice!
Tricia

On Tue, 27 Jun 2006, Tricia Williams wrote:

> Hi All,
>
>   I have a Cocoon pipeline which could be done with a lot of awkward 
> branching, or use Flowscript to abstract out some of the complexity and reuse 
> a java class that was built for a similar purpose.  The awkwardness and 
> complexity comes from the need to validate and in some cases re-form the 
> parameters to call another pipe.  The Flowscript would use the class I 
> mentioned to form a uri and then call coocoon.redirectTo(...) to redirect to 
> that page.
>
>   I've implemented the Flowscript idea but am getting the following error:
> org.mozilla.javascript.EvaluatorException: 
> "file:/c:/Development/martini-peel/cocoonproject/flowscript/martini-flow.js", 
> line 44: Not a Java class: [JavaPackage 
> org.martini.search.PeelQueryComponent]
>
>   I'm using: importClass(Packages.org.martini.search.PeelQueryComponent); To 
> import my class.
>
>   Does anyone have an understanding of what is causing the error I'm getting 
> and can offer me a solution.  Is there an alternate way to build the uri with 
> the validation and transformation of parameters in Cocoon?
>
> Thanks,
> Tricia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

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


RE: Importing Hand-made Java Packages For Use in Flowscript

Posted by Geert Josten <ge...@daidalos.nl>.
>     I've implemented the Flowscript idea but am getting the following
> error:
> org.mozilla.javascript.EvaluatorException: 
> "file:/c:/Development/martini-peel/cocoonproject/flowscript/ma
> rtini-flow.js",
> line 44: Not a Java class: [JavaPackage 
> org.martini.search.PeelQueryComponent]
> 
>     I'm using: 
> importClass(Packages.org.martini.search.PeelQueryComponent);
> To import my class.

Are you sure that the required class is available to the Cocoon
environment? E.g. is it in the Web-inf/classes/ tree or is it available
as part of a jar in Web-inf/lib/?

Grtz,
Geert
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

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