[Zope] Using Java libraries on Zope (XML) content

Paul Tchistopolskii pault12@pacbell.net
Thu, 14 Jun 2001 18:57:54 -0700


----- Original Message ----- 
From: Jeff Kowalczyk <jtk@adelphia.net>


> If you had a Zope application that needed some library fuctionality that
> is only available with Java at present, what would be the best way to
> integrate?
> 
> For simplicity let's limit the scope of the question to using Batik
> (SVG->PNG/JPG) and/or FOP (XML->PDF) on some dynamic XML that came out
> of a Zope method instead of HTML, and as destined to be transformed
> before its seen by the user.

Take a look at Hiawatha-Z ( http://www.pault.com/pault/prod/Hiawatha/HiawathaZ.html ) 
It is using SAXON XSLT engine ( which is Java ). It is using it over XML-RPC.

I think the usecases you're talking about do not require more efficient 
communication ( FOP / SVG stuff will eat 90% of the speed, and 
XML-RPC will eat not more than the rest 10% )

> There's always java HTTP servlets, but would there be a way to eliminate
> the latency and overhead? I.e. Is there something in Python that would
> wrap Java API's so they executed more or less in-process with the Zope
> XML generating code?

> (I suppose running a whole Zope on Jython is out of the question :) )

I'd say that using Java libraries with Zope over XML-RPC is :

1. Robust.
2. Flexible.
3. Relatively fast.

For your task, you can not use Hiawatha-Z as-is, but you can modify the 
tiny java wrapper which is shipped with Hiawatha to make it not only 
invoke XSLT transformation, but then pipeline the result to FOP, SVG, 
whatever. 

I'd say that it looks like one-two days task.

Rgds.Paul.

Hiawatha-Z is opesource and it is running my website with 
uptime of  60 days. I'm suspicious about  any JNI-based 
solution, because my experiments with PJC ( perl-java-connector )
were frustrative. My experience was that JNI-based solution 
is sensitive to the combination of JDK / perl / OS.