|
From: <tr...@us...> - 2003-06-27 00:49:45
|
Update of /cvsroot/babeldoc/babeldoc/modules/xslfo/src/com/babeldoc/xslfo/pipeline/stage In directory sc8-pr-cvs1:/tmp/cvs-serv21184/src/com/babeldoc/xslfo/pipeline/stage Modified Files: SvgTranscodePipelineStage.java XslFoTransformPipelineStage.java Log Message: Formatted the XSLFO module. Index: SvgTranscodePipelineStage.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/xslfo/src/com/babeldoc/xslfo/pipeline/stage/SvgTranscodePipelineStage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SvgTranscodePipelineStage.java 10 Jun 2003 00:01:31 -0000 1.2 --- SvgTranscodePipelineStage.java 27 Jun 2003 00:31:35 -0000 1.3 *************** *** 1,22 **** ! /* ! * $Header$ ! * $DateTime: 2002/07/24 18:15:55 $ * * ! * babeldoc: universal document processor * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.babeldoc.xslfo.pipeline.stage; --- 1,66 ---- ! /* ==================================================================== ! * The Apache Software License, Version 1.1 * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. * ! * Redistribution and use in source and binary forms, with or without ! * modification, are permitted provided that the following conditions ! * are met: * ! * 1. Redistributions of source code must retain the above copyright ! * notice, this list of conditions and the following disclaimer. * ! * 2. Redistributions in binary form must reproduce the above copyright ! * notice, this list of conditions and the following disclaimer in ! * the documentation and/or other materials provided with the ! * distribution. ! * ! * 3. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! * SUCH DAMAGE. ! * ==================================================================== ! * ! * This software consists of voluntary contributions made by many ! * individuals on behalf of the Apache Software Foundation. For more ! * information on the Apache Software Foundation, please see ! * <http://www.apache.org/>. ! * ! * Portions of this software are based upon public domain software ! * originally written at the National Center for Supercomputing Applications, ! * University of Illinois, Urbana-Champaign. ! * ==================================================================== ! * ! * Babeldoc: The Universal Document Processor ! * ! * $Header$ ! * $DateTime$ ! * $Author$ * */ package com.babeldoc.xslfo.pipeline.stage; *************** *** 28,31 **** --- 72,76 ---- import com.babeldoc.core.pipeline.*; import com.babeldoc.core.pipeline.command.PipelineFeeder; + import org.apache.batik.transcoder.Transcoder; import org.apache.batik.transcoder.TranscoderException; *************** *** 38,41 **** --- 83,87 ---- import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; + import java.util.ArrayList; import java.util.Collection; *************** *** 48,56 **** * @version 1.0 */ ! public class SvgTranscodePipelineStage ! extends PipelineStage { ! /** ! * Constants ! */ public static final String TRANSCODE = "transcode"; public static final String JPEG = "jpeg"; --- 94,99 ---- * @version 1.0 */ ! public class SvgTranscodePipelineStage extends PipelineStage { ! /** Constants */ public static final String TRANSCODE = "transcode"; public static final String JPEG = "jpeg"; *************** *** 66,104 **** public SvgTranscodePipelineStage() { super(new PipelineStageInfo() { ! public String getName() { ! return "SvgTranscode"; ! } ! public String getDescription() { ! return I18n.get("module.pipeline.stage.svgtranscode.0"); ! } ! public Collection getTypeSpecificOptions() { ! ArrayList options = new ArrayList(); ! options.add(new ConfigOption(TRANSCODE, ! new ValueListConfigOptionType(new String[]{JPEG, PNG, TIFF}), ! "png", true, I18n.get("module.pipeline.stage.svgtranscode.1"))); ! options.add(new ConfigOption ! (WIDTH, ! IConfigOptionType.INTEGER, ! null, false, I18n.get("module.pipeline.stage.svgtranscode.2"))); ! options.add(new ConfigOption ! (HEIGHT, ! IConfigOptionType.INTEGER, ! null, false, I18n.get("module.pipeline.stage.svgtranscode.3"))); ! options.add(new ConfigOption ! (QUALITY, ! IConfigOptionType.INTEGER, ! null, true, I18n.get("module.pipeline.stage.svgtranscode.4"))); ! return options; ! } ! }); } /** ! * pipeline stage. * * @return array of results */ public PipelineStageResult[] process() throws PipelineException { --- 109,144 ---- public SvgTranscodePipelineStage() { super(new PipelineStageInfo() { ! public String getName() { ! return "SvgTranscode"; ! } ! public String getDescription() { ! return I18n.get("module.pipeline.stage.svgtranscode.0"); ! } ! public Collection getTypeSpecificOptions() { ! ArrayList options = new ArrayList(); ! options.add(new ConfigOption(TRANSCODE, ! new ValueListConfigOptionType(new String[] { JPEG, PNG, TIFF }), ! "png", true, I18n.get("module.pipeline.stage.svgtranscode.1"))); ! options.add(new ConfigOption(WIDTH, IConfigOptionType.INTEGER, null, ! false, I18n.get("module.pipeline.stage.svgtranscode.2"))); ! options.add(new ConfigOption(HEIGHT, IConfigOptionType.INTEGER, null, ! false, I18n.get("module.pipeline.stage.svgtranscode.3"))); ! options.add(new ConfigOption(QUALITY, IConfigOptionType.INTEGER, ! null, true, I18n.get("module.pipeline.stage.svgtranscode.4"))); ! ! return options; ! } ! }); } /** ! * Convert the SVG document into a binary image * * @return array of results + * + * @throws PipelineException DOCUMENT ME! */ public PipelineStageResult[] process() throws PipelineException { *************** *** 109,113 **** // Create a new document ! PipelineDocument newDoc = new PipelineDocument(this.getDocument(), baos.toByteArray()); newDoc.setBinary(true); newDoc.setMimeType(getMimetype()); --- 149,154 ---- // Create a new document ! PipelineDocument newDoc = new PipelineDocument(this.getDocument(), ! baos.toByteArray()); newDoc.setBinary(true); newDoc.setMimeType(getMimetype()); *************** *** 117,135 **** } ! private ByteArrayOutputStream transcodeDocument(Transcoder transcoder) throws PipelineException { ! // Note that if we don't do this, relative URLs can not be resolved correctly! ! String url = com.babeldoc.core.ResourceLoader.getUrl((String) getDocument().get(PipelineFeeder.FILE_NAME)).toString(); ! TranscoderInput input = new TranscoderInput(new BufferedInputStream(this.getDocument().getInputStream())); ! input.setURI(url); ! ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); ! TranscoderOutput output = new TranscoderOutput(baos); ! try { ! transcoder.transcode(input, output); ! } catch (TranscoderException e) { ! throw new PipelineException(I18n.get("module.pipeline.stage.svgtranscode.8"), e); ! } ! return baos; ! } ! private String getMimetype() { String transcodeStr = this.getOptions(TRANSCODE); --- 158,166 ---- } ! /** ! * Get the mimetype from the destination image format. ! * ! * @return DOCUMENT ME! ! */ private String getMimetype() { String transcodeStr = this.getOptions(TRANSCODE); *************** *** 146,149 **** --- 177,187 ---- } + /** + * Get the transcoder - determined by the out image type + * + * @return Transcoder + * + * @throws PipelineException DOCUMENT ME! + */ private Transcoder getTranscoder() throws PipelineException { Transcoder transcoder; *************** *** 160,190 **** transcoder = new TIFFTranscoder(); } else { ! throw new PipelineException(I18n.get("module.pipeline.stage.svgtranscode.7")); } return transcoder; } private void trancoderHeigth(Transcoder transcoder) throws PipelineException { try { ! transcoder.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new Float(this.getOptions(HEIGHT))); } catch (Exception e) { ! throw new PipelineException(I18n.get("module.pipeline.stage.svgtranscode.6"), e); } } ! private void transcoderWidth(Transcoder transcoder) throws PipelineException { try { ! transcoder.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new Float(this.getOptions(WIDTH))); ! } catch (Exception e) { ! throw new PipelineException(I18n.get("module.pipeline.stage.svgtranscode.5"), e); } } private void transcoderQuality(Transcoder transcoder) { int quality = 80; if (this.hasOption(QUALITY)) { quality = Integer.parseInt(this.getOptions(QUALITY)); } ! transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float((float) quality / 100)); } } --- 198,288 ---- transcoder = new TIFFTranscoder(); } else { ! throw new PipelineException(I18n.get( ! "module.pipeline.stage.svgtranscode.7")); } + return transcoder; } + /** + * Get the height of the output document + * + * @param transcoder object to apply the height hint to. + * + * @throws PipelineException DOCUMENT ME! + */ private void trancoderHeigth(Transcoder transcoder) throws PipelineException { try { ! transcoder.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, ! new Float(this.getOptions(HEIGHT))); } catch (Exception e) { ! throw new PipelineException(I18n.get( ! "module.pipeline.stage.svgtranscode.6"), e); } } ! /** ! * Transcode the document to an image ! * ! * @param transcoder Use this transcoder ! * ! * @return Image as an array of bytes ! * ! * @throws PipelineException DOCUMENT ME! ! */ ! private ByteArrayOutputStream transcodeDocument(Transcoder transcoder) ! throws PipelineException { ! // Note that if we don't do this, relative URLs can not be resolved correctly! ! String url = com.babeldoc.core.ResourceLoader.getUrl((String) getDocument() ! .get(PipelineFeeder.FILE_NAME)) ! .toString(); ! TranscoderInput input = new TranscoderInput(new BufferedInputStream( ! this.getDocument().getInputStream())); ! input.setURI(url); ! ! ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); ! TranscoderOutput output = new TranscoderOutput(baos); ! try { ! transcoder.transcode(input, output); ! } catch (TranscoderException e) { ! throw new PipelineException(I18n.get( ! "module.pipeline.stage.svgtranscode.8"), e); } + + return baos; } + /** + * Set the transcoder quality + * + * @param transcoder The transcoder in question + */ private void transcoderQuality(Transcoder transcoder) { int quality = 80; + if (this.hasOption(QUALITY)) { quality = Integer.parseInt(this.getOptions(QUALITY)); } ! ! transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, ! new Float((float) quality / 100)); ! } ! ! /** ! * Set the transcoder width ! * ! * @param transcoder The transcoder in questiom ! * ! * @throws PipelineException DOCUMENT ME! ! */ ! private void transcoderWidth(Transcoder transcoder) throws PipelineException { ! try { ! transcoder.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, ! new Float(this.getOptions(WIDTH))); ! } catch (Exception e) { ! throw new PipelineException(I18n.get( ! "module.pipeline.stage.svgtranscode.5"), e); ! } } } Index: XslFoTransformPipelineStage.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/xslfo/src/com/babeldoc/xslfo/pipeline/stage/XslFoTransformPipelineStage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XslFoTransformPipelineStage.java 10 Jun 2003 00:01:31 -0000 1.2 --- XslFoTransformPipelineStage.java 27 Jun 2003 00:31:35 -0000 1.3 *************** *** 1,36 **** ! /* ! * $Header$ ! * $DateTime: 2002/07/24 18:15:55 $ * * ! * babeldoc: universal document processor * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.babeldoc.xslfo.pipeline.stage; import com.babeldoc.core.I18n; import com.babeldoc.core.option.ConfigOption; import com.babeldoc.core.option.IConfigOptionType; import com.babeldoc.core.option.ValueListConfigOptionType; import com.babeldoc.core.pipeline.*; import org.apache.avalon.framework.logger.Logger; import org.apache.fop.apps.Driver; import org.xml.sax.InputSource; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Collection; --- 1,85 ---- ! /* ==================================================================== ! * The Apache Software License, Version 1.1 * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. * ! * Redistribution and use in source and binary forms, with or without ! * modification, are permitted provided that the following conditions ! * are met: * ! * 1. Redistributions of source code must retain the above copyright ! * notice, this list of conditions and the following disclaimer. * ! * 2. Redistributions in binary form must reproduce the above copyright ! * notice, this list of conditions and the following disclaimer in ! * the documentation and/or other materials provided with the ! * distribution. ! * ! * 3. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! * SUCH DAMAGE. ! * ==================================================================== ! * ! * This software consists of voluntary contributions made by many ! * individuals on behalf of the Apache Software Foundation. For more ! * information on the Apache Software Foundation, please see ! * <http://www.apache.org/>. ! * ! * Portions of this software are based upon public domain software ! * originally written at the National Center for Supercomputing Applications, ! * University of Illinois, Urbana-Champaign. ! * ==================================================================== ! * ! * Babeldoc: The Universal Document Processor ! * ! * $Header$ ! * $DateTime$ ! * $Author$ * */ package com.babeldoc.xslfo.pipeline.stage; import com.babeldoc.core.I18n; + import com.babeldoc.core.LogService; import com.babeldoc.core.option.ConfigOption; import com.babeldoc.core.option.IConfigOptionType; import com.babeldoc.core.option.ValueListConfigOptionType; import com.babeldoc.core.pipeline.*; + import org.apache.avalon.framework.logger.Logger; + import org.apache.fop.apps.Driver; + import org.xml.sax.InputSource; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; + import java.util.ArrayList; import java.util.Collection; *************** *** 38,55 **** /** ! * A pipeline stage to do transformations. This stage uses the apache xml FOP engine ! * to the hard work. The XSL:FO data comes from the pipelinedocument. The output is ! * configurable. * * @author Bmcdonald * @version 1.0 */ ! public class XslFoTransformPipelineStage ! extends PipelineStage { ! /** ! * Constants ! */ ! public final static String OUTPUT_TYPE = "outputType"; ! public final static String BUFFER_SIZE = "bufferSize"; /** --- 87,101 ---- /** ! * A pipeline stage to do transformations. This stage uses the apache xml FOP ! * engine to the hard work. The XSL:FO data comes from the pipelinedocument. ! * The output is configurable. * * @author Bmcdonald * @version 1.0 */ ! public class XslFoTransformPipelineStage extends PipelineStage { ! /** Constants */ ! public static final String OUTPUT_TYPE = "outputType"; ! public static final String BUFFER_SIZE = "bufferSize"; /** *************** *** 58,82 **** public XslFoTransformPipelineStage() { super(new PipelineStageInfo() { ! public String getName() { ! return "XslFoTransform"; ! } ! public String getDescription() { ! return I18n.get("module.pipeline.stage.xslfotransform.0"); ! } ! public Collection getTypeSpecificOptions() { ! ArrayList options = new ArrayList(); ! options.add(new ConfigOption(OUTPUT_TYPE, ! new ValueListConfigOptionType(new String[]{"pdf", "pcl", "svg", "ps"}), ! "pdf", true, I18n.get("module.pipeline.stage.xslfotransform.1"))); ! options.add(new ConfigOption ! (OUTPUT_TYPE, ! IConfigOptionType.INTEGER, ! null, false, I18n.get("module.pipeline.stage.xslfotransform.2"))); ! return options; ! } ! }); } --- 104,128 ---- public XslFoTransformPipelineStage() { super(new PipelineStageInfo() { ! public String getName() { ! return "XslFoTransform"; ! } ! public String getDescription() { ! return I18n.get("module.pipeline.stage.xslfotransform.0"); ! } ! public Collection getTypeSpecificOptions() { ! ArrayList options = new ArrayList(); ! options.add(new ConfigOption(OUTPUT_TYPE, ! new ValueListConfigOptionType( ! new String[] { "pdf", "pcl", "svg", "ps" }), "pdf", true, ! I18n.get("module.pipeline.stage.xslfotransform.1"))); ! options.add(new ConfigOption(OUTPUT_TYPE, IConfigOptionType.INTEGER, ! null, false, I18n.get("module.pipeline.stage.xslfotransform.2"))); ! ! return options; ! } ! }); } *************** *** 85,89 **** * * @return ! * @throws com.babeldoc.core.pipeline.PipelineException */ public PipelineStageResult[] process() throws PipelineException { --- 131,136 ---- * * @return ! * ! * @throws PipelineException */ public PipelineStageResult[] process() throws PipelineException { *************** *** 120,124 **** try { InputSource xmlSource = new InputSource(new ByteArrayInputStream( ! this.getDocument().getBytes())); ByteArrayOutputStream baos = new ByteArrayOutputStream(bufsize); --- 167,171 ---- try { InputSource xmlSource = new InputSource(new ByteArrayInputStream( ! this.getDocument().getBytes())); ByteArrayOutputStream baos = new ByteArrayOutputStream(bufsize); *************** *** 132,136 **** // Create a new document ! PipelineDocument newDoc = new PipelineDocument(this.getDocument(), baos.toByteArray()); newDoc.setBinary(binary); newDoc.setMimeType(mimeType); --- 179,184 ---- // Create a new document ! PipelineDocument newDoc = new PipelineDocument(this.getDocument(), ! baos.toByteArray()); newDoc.setBinary(binary); newDoc.setMimeType(mimeType); *************** *** 147,222 **** /** * Just a facade to the avalon framework logger. * - * <p>Title: Babel</p> - * <p>Description: Universal Document Processor</p> - * <p>Copyright: Copyright (c) 2002</p> - * <p>Company: </p> * @author Bmcdonald * @version 1.0 */ class MyLogger implements Logger { ! // Methods ! public void debug(String string) { ! com.babeldoc.core.LogService.getInstance().logDebug(string); ! } ! ! public void debug(String string, Throwable throwable) { ! com.babeldoc.core.LogService.getInstance().logDebug(string); } public boolean isDebugEnabled() { ! return com.babeldoc.core.LogService.getInstance().isDebugEnabled(); } ! public void info(String string) { ! com.babeldoc.core.LogService.getInstance().logInfo(string); } ! public void info(String string, Throwable throwable) { ! com.babeldoc.core.LogService.getInstance().logInfo(string); } public boolean isInfoEnabled() { ! return com.babeldoc.core.LogService.getInstance().isInfoEnabled(); } ! public void warn(String string) { ! com.babeldoc.core.LogService.getInstance().logDebug(string); } ! public void warn(String string, Throwable throwable) { ! com.babeldoc.core.LogService.getInstance().logDebug(string); } ! public boolean isWarnEnabled() { ! return com.babeldoc.core.LogService.getInstance().isWarnEnabled(); } public void error(String string) { ! com.babeldoc.core.LogService.getInstance().logError(string, null); } public void error(String string, Throwable throwable) { ! com.babeldoc.core.LogService.getInstance().logError(string, throwable); ! } ! ! public boolean isErrorEnabled() { ! return com.babeldoc.core.LogService.getInstance().isErrorEnabled(); } public void fatalError(String string) { ! com.babeldoc.core.LogService.getInstance().logError(string, null); } public void fatalError(String string, Throwable throwable) { ! com.babeldoc.core.LogService.getInstance().logError(string, throwable); } ! public boolean isFatalErrorEnabled() { ! return com.babeldoc.core.LogService.getInstance().isErrorEnabled(); } ! public Logger getChildLogger(String string) { ! return null; } } --- 195,267 ---- /** * Just a facade to the avalon framework logger. + * * * @author Bmcdonald * @version 1.0 */ class MyLogger implements Logger { ! public Logger getChildLogger(String string) { ! return null; } public boolean isDebugEnabled() { ! return LogService.getInstance().isDebugEnabled(); } ! public boolean isErrorEnabled() { ! return LogService.getInstance().isErrorEnabled(); } ! public boolean isFatalErrorEnabled() { ! return LogService.getInstance().isErrorEnabled(); } public boolean isInfoEnabled() { ! return LogService.getInstance().isInfoEnabled(); } ! public boolean isWarnEnabled() { ! return LogService.getInstance().isWarnEnabled(); } ! // Methods ! public void debug(String string) { ! LogService.getInstance().logDebug(string); } ! public void debug(String string, Throwable throwable) { ! LogService.getInstance().logDebug(string); } public void error(String string) { ! LogService.getInstance().logError(string, null); } public void error(String string, Throwable throwable) { ! LogService.getInstance().logError(string, throwable); } public void fatalError(String string) { ! LogService.getInstance().logError(string, null); } public void fatalError(String string, Throwable throwable) { ! LogService.getInstance().logError(string, throwable); } ! public void info(String string) { ! LogService.getInstance().logInfo(string); } ! public void info(String string, Throwable throwable) { ! LogService.getInstance().logInfo(string); ! } ! ! public void warn(String string) { ! LogService.getInstance().logDebug(string); ! } ! ! public void warn(String string, Throwable throwable) { ! LogService.getInstance().logDebug(string); } } |