You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Herring <da...@micromuse.com> on 2000/02/14 19:35:52 UTC

Advice on XML -> PNG Image creation


Hello,

Has anyone any expericence or advice on transforming XML data into graphical
images (charts etc).

Obviously the Graphics2d java api can perform the image creation, but how
would one segragate this
process within a Cocoon driven system.

Thanks in advance,
David Herring



Re: Advice on XML -> PNG Image creation

Posted by Stefano Mazzocchi <st...@apache.org>.
Roberto Gilberti wrote:
> 
> Hi,
> I've modified Cocoon in order to serve image information.
> I'm not sure it is right, but I simply changed the internal handling of page
> from Writer to Stream in order to avoid changes on the byte stream.
> 
> Problems:
> .       Page contains a String
> .       Formatter.format accepts a Writer
> .       Engine.handle create a StringWriter for formatter.format
> Actions:
> .       Page contains a byte[] (methods change from String to byte[])
> .       Formatter.format accepts an OutputStream
> .       Engine.handle create a ByteArrayOutputStream for formatter.format
> .       Engine.handle get response.getOutputStream() instead of
> response.getWriter()
> 
> I've not found other components using "character" api vs. byte api, so I've
> done simple patches.

Yes, that was a know problem and we were trying to patch it for
cocoon2... anyway, send the patches in and I'll look at them. (they may
break other parts of the system).
 
> Changed this and create a ImageFormatter (based on ImagePrinter found in
> stylebook)
> Now (my) Cocoon can produce also binary content and it works fine, but I'm
> not verified if there are side effects (maybe using different encodings).

Exactly.
 
> If this is of interest, I can send the patches.

Go right ahead. Thank you.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



RE: Advice on XML -> PNG Image creation

Posted by Roberto Gilberti <gi...@tin.it>.
Hi,
I've modified Cocoon in order to serve image information.
I'm not sure it is right, but I simply changed the internal handling of page
from Writer to Stream in order to avoid changes on the byte stream.

Problems:
.	Page contains a String
.	Formatter.format accepts a Writer
.	Engine.handle create a StringWriter for formatter.format
Actions:
.	Page contains a byte[] (methods change from String to byte[])
.	Formatter.format accepts an OutputStream
.	Engine.handle create a ByteArrayOutputStream for formatter.format
.	Engine.handle get response.getOutputStream() instead of
response.getWriter()


I've not found other components using "character" api vs. byte api, so I've
done simple patches.

Changed this and create a ImageFormatter (based on ImagePrinter found in
stylebook)
Now (my) Cocoon can produce also binary content and it works fine, but I'm
not verified if there are side effects (maybe using different encodings).

If this is of interest, I can send the patches.



-----Original Message-----
From: dherr@badger [mailto:dherr@badger]On Behalf Of David Herring
Sent: Monday, February 14, 2000 7:36 PM
To: cocoon-users@xml.apache.org
Subject: Advice on XML -> PNG Image creation




Hello,

Has anyone any expericence or advice on transforming XML data into graphical
images (charts etc).

Obviously the Graphics2d java api can perform the image creation, but how
would one segragate this
process within a Cocoon driven system.

Thanks in advance,
David Herring



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