Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 81503 invoked by uid 500); 17 Jul 2002 13:23:41 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 81494 invoked by uid 500); 17 Jul 2002 13:23:41 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 17 Jul 2002 13:23:41 -0000 Message-ID: <20020717132341.21637.qmail@icarus.apache.org> From: cziegeler@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/serialization FOPSerializer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N cziegeler 2002/07/17 06:23:41 Modified: . Tag: cocoon_2_0_3_branch changes.xml src/java/org/apache/cocoon/serialization Tag: cocoon_2_0_3_branch FOPSerializer.java Log: Direct fop log messages to log Revision Changes Path No revision No revision 1.138.2.35 +4 -1 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.138.2.34 retrieving revision 1.138.2.35 diff -u -r1.138.2.34 -r1.138.2.35 --- changes.xml 15 Jul 2002 14:10:35 -0000 1.138.2.34 +++ changes.xml 17 Jul 2002 13:23:41 -0000 1.138.2.35 @@ -39,6 +39,9 @@ + + All log messages from FOP now go into the logs instead of printing them to the screen. + Applied patch for MaybeUploadRequestFactoryImpl which sets the timeout for a session to infinite during an upload and restores it afterwards. No revision No revision 1.7.2.2 +17 -13 xml-cocoon2/src/java/org/apache/cocoon/serialization/FOPSerializer.java Index: FOPSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/FOPSerializer.java,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -r1.7.2.1 -r1.7.2.2 --- FOPSerializer.java 15 Jul 2002 21:32:19 -0000 1.7.2.1 +++ FOPSerializer.java 17 Jul 2002 13:23:41 -0000 1.7.2.2 @@ -63,6 +63,7 @@ import org.apache.cocoon.util.ClassUtils; import org.apache.fop.apps.Driver; import org.apache.fop.apps.Options; +import org.apache.fop.messaging.MessageHandler; import org.apache.fop.render.Renderer; import java.io.OutputStream; @@ -110,11 +111,16 @@ */ protected boolean setContentLength = true; + /** This logger is used for FOP */ + protected org.apache.avalon.framework.logger.Logger logger; + /** * Set the configurations for this serializer. */ public void configure(Configuration conf) throws ConfigurationException { + this.logger = new LogKitLogger(getLogger().getChildLogger("fop")); + MessageHandler.setScreenLogger(this.logger); String userConfig = null; java.io.File userConfigFile = null; @@ -194,24 +200,22 @@ */ public void setOutputStream(OutputStream out) { // load the fop driver - driver = new Driver(); + this.driver = new Driver(); - if(driver instanceof Loggable) { - driver.setLogger(new LogKitLogger(getLogger().getChildLogger("fop"))); - } + this.driver.setLogger(this.logger); if (this.rendererName == null) { this.renderer = factory.createRenderer(mimetype); } else { try { - this.renderer = (Renderer)ClassUtils.newInstance(rendererName); + this.renderer = (Renderer)ClassUtils.newInstance(this.rendererName); } catch (Exception ex) { - getLogger().error("Cannot load class " + rendererName, ex); - throw new RuntimeException("Cannot load class " + rendererName); + this.getLogger().error("Cannot load class " + this.rendererName, ex); + throw new RuntimeException("Cannot load class " + this.rendererName); } } - driver.setRenderer(this.renderer); - driver.setOutputStream(out); - setContentHandler(driver.getContentHandler()); + this.driver.setRenderer(this.renderer); + this.driver.setOutputStream(out); + this.setContentHandler( this.driver.getContentHandler() ); } /** @@ -243,8 +247,8 @@ */ public void recycle() { super.recycle(); - options = null; - driver = null; + this.options = null; + this.driver = null; this.renderer = null; } ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org