Return-Path: Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 45369 invoked by uid 1152); 5 Dec 2000 00:24:15 -0000 Date: 5 Dec 2000 00:24:15 -0000 Message-ID: <20001205002415.45367.qmail@locus.apache.org> From: bloritsch@locus.apache.org To: xml-cocoon-cvs@apache.org Subject: cvs commit: xml-cocoon/src/org/apache/cocoon/serialization FOPSerializer.java SVGSerializer.java bloritsch 00/12/04 16:24:14 Modified: src/org/apache/cocoon/serialization Tag: xml-cocoon2 FOPSerializer.java SVGSerializer.java Log: Slight formatting and log messages. Still trying to locate 500 ok error message with WebSphere Revision Changes Path No revision No revision 1.1.2.7 +22 -22 xml-cocoon/src/org/apache/cocoon/serialization/Attic/FOPSerializer.java Index: FOPSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/FOPSerializer.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- FOPSerializer.java 2000/09/27 16:15:37 1.1.2.6 +++ FOPSerializer.java 2000/12/05 00:24:13 1.1.2.7 @@ -5,7 +5,7 @@ * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ - + package org.apache.cocoon.serialization; import java.io.IOException; @@ -28,18 +28,18 @@ * @author Giacomo Pati * (PWR Organisation & Entwicklung) * @author Stefano Mazzocchi - * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/09/27 16:15:37 $ + * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/05 00:24:13 $ * */ public class FOPSerializer extends AbstractSerializer implements MessageListener { /** - * The FOP driver + * The FOP driver */ private Driver driver = null; /** - * Create the FOP driver + * Create the FOP driver */ public FOPSerializer() { this.driver = new Driver(); @@ -56,7 +56,7 @@ this.driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping"); this.driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping"); } - + /** * Set the OutputStream where the XML should be serialized. */ @@ -64,20 +64,20 @@ this.driver.setWriter(new PrintWriter(out)); this.setContentHandler(this.driver.getContentHandler()); } - - /** - * Receive notification of the end of a document. - */ - public void endDocument() throws SAXException { + + /** + * Receive notification of the end of a document. + */ + public void endDocument() throws SAXException { super.endDocument(); - try { - driver.format(); - driver.render(); - } catch (IOException e) { - throw new SAXException (e); - } catch (FOPException e) { - throw new SAXException (e); - } + try { + driver.format(); + driver.render(); + } catch (IOException e) { + throw new SAXException (e); + } catch (FOPException e) { + throw new SAXException (e); + } } /** @@ -86,12 +86,12 @@ public String getMimeType() { return "application/pdf"; } - - /** + + /** * Receive FOP events. - */ + */ public void processMessage (MessageEvent event) { - // XXX (SM) + // XXX (SM) // we should consume the events in some meaningful way // for example formatting them on the metapipeline } 1.1.2.16 +10 -7 xml-cocoon/src/org/apache/cocoon/serialization/Attic/SVGSerializer.java Index: SVGSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/SVGSerializer.java,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -r1.1.2.15 -r1.1.2.16 --- SVGSerializer.java 2000/11/30 21:42:02 1.1.2.15 +++ SVGSerializer.java 2000/12/05 00:24:14 1.1.2.16 @@ -61,20 +61,20 @@ this.config = conf; try { - log.debug("Looking up " + Roles.PARSER); + log.debug("Looking up " + Roles.PARSER); // First, get a DOM parser for the DOM Builder to work with. super.factory= (Parser) this.manager.lookup(Roles.PARSER); - } catch (Exception e) { - log.error("Could not find component", e); - throw new ConfigurationException("Could not find Parser", e); - } + } catch (Exception e) { + log.error("Could not find component", e); + throw new ConfigurationException("Could not find Parser", e); + } // What image encoder do I use? String enc = this.config.getChild("encoder").getValue(); try { - log.debug("Selecting " + Roles.IMAGE_ENCODER + ": " + enc); - ComponentSelector selector = (ComponentSelector) this.manager.lookup(Roles.IMAGE_ENCODER); + log.debug("Selecting " + Roles.IMAGE_ENCODER + ": " + enc); + ComponentSelector selector = (ComponentSelector) this.manager.lookup(Roles.IMAGE_ENCODER); this.encoder = (ImageEncoder) selector.select(enc); } catch (Exception e) { log.error("Could not select " + Roles.IMAGE_ENCODER, e); @@ -86,10 +86,13 @@ if (this.encoder instanceof Configurable) { ((Configurable)this.encoder).configure(conf); } + // Transparent or a solid colour background? this.transparent = this.config.getChild("transparent").getValueAsBoolean(false); + if (!transparent) { String bg = this.config.getChild("background").getValue("#FFFFFF").trim(); + if (bg.startsWith("#")) { bg = bg.substring(1); }