You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by gm...@apache.org on 2003/08/12 23:17:44 UTC
cvs commit: xml-fop/src/java/org/apache/fop/tools/anttasks Fop.java
gmazza 2003/08/12 14:17:44
Modified: src/java/org/apache/fop/apps CommandLineOptions.java
Driver.java XSLTInputHandler.java
src/java/org/apache/fop/image XMLImage.java
src/java/org/apache/fop/svg SVGElementMapping.java
SVGUserAgent.java
src/java/org/apache/fop/tools TestConverter.java
src/java/org/apache/fop/tools/anttasks Fop.java
Added: src/java/org/apache/fop/apps FOFileHandler.java
Removed: src/java/org/apache/fop/apps FOInputHandler.java
Log:
Renamed apps.FOInputHandler to apps.FOFileHandler to reduce confusion with the new FOInputHandler in the fo package.
Revision Changes Path
1.11 +1 -1 xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java
Index: CommandLineOptions.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- CommandLineOptions.java 4 Aug 2003 18:53:17 -0000 1.10
+++ CommandLineOptions.java 12 Aug 2003 21:17:44 -0000 1.11
@@ -491,7 +491,7 @@
public InputHandler getInputHandler() throws FOPException {
switch (inputmode) {
case FO_INPUT:
- return new FOInputHandler(fofile);
+ return new FOFileHandler(fofile);
case XSLT_INPUT:
return new XSLTInputHandler(xmlfile, xsltfile);
default:
1.22 +1 -2 xml-fop/src/java/org/apache/fop/apps/Driver.java
Index: Driver.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Driver.java 12 Aug 2003 06:18:43 -0000 1.21
+++ Driver.java 12 Aug 2003 21:17:44 -0000 1.22
@@ -648,8 +648,7 @@
if (reader == null) {
if (!(source instanceof DocumentInputSource)) {
- //TODO: (gm) rename to FOFileHandler or similar
- reader = org.apache.fop.apps.FOInputHandler.createParser();
+ reader = FOFileHandler.createParser();
}
}
1.9 +1 -1 xml-fop/src/java/org/apache/fop/apps/XSLTInputHandler.java
Index: XSLTInputHandler.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/XSLTInputHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XSLTInputHandler.java 4 Aug 2003 00:52:16 -0000 1.8
+++ XSLTInputHandler.java 12 Aug 2003 21:17:44 -0000 1.9
@@ -170,7 +170,7 @@
saxTFactory.newXMLFilter(xsltSource);
// Create an XMLReader.
- XMLReader parser = FOInputHandler.createParser();
+ XMLReader parser = FOFileHandler.createParser();
if (parser == null) {
throw new FOPException("Unable to create SAX parser");
}
1.1 xml-fop/src/java/org/apache/fop/apps/FOFileHandler.java
Index: FOFileHandler.java
===================================================================
/*
* $Id: FOFileHandler.java,v 1.1 2003/08/12 21:17:44 gmazza Exp $
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
*
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
* tion, 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 "FOP" 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
* apache@apache.org.
*
* 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 (INCLU-
* DING, 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 and was originally created by
* James Tauber <jt...@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.fop.apps;
// Imported SAX classes
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotSupportedException;
// java
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.net.URL;
/**
* Manages input if it is an XSL-FO file.
*/
public class FOFileHandler extends InputHandler {
private File fofile = null;
private URL foURL = null;
/**
* Create a FOFileHandler for a file.
* @param fofile the file to read the FO document.
*/
public FOFileHandler(File fofile) {
this.fofile = fofile;
}
/**
* Create a FOFileHandler for an URL.
* @param url the URL to read the FO document.
*/
public FOFileHandler(URL url) {
this.foURL = url;
}
/**
* @see org.apache.fop.apps.InputHandler#getInputSource()
*/
public InputSource getInputSource () {
if (fofile != null) {
return super.fileInputSource(fofile);
}
return super.urlInputSource(foURL);
}
/**
* @see org.apache.fop.apps.InputHandler#getParser()
*/
public XMLReader getParser() throws FOPException {
return createParser();
}
/**
* Creates <code>XMLReader</code> object using default
* <code>SAXParserFactory</code>
* @return the created <code>XMLReader</code>
* @throws FOPException if the parser couldn't be created or configured for proper operation.
*/
protected static XMLReader createParser() throws FOPException {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
factory.setFeature(
"http://xml.org/sax/features/namespace-prefixes", true);
return factory.newSAXParser().getXMLReader();
} catch (SAXNotSupportedException se) {
throw new FOPException("Error: You need a parser which allows the"
+ " http://xml.org/sax/features/namespace-prefixes"
+ " feature to be set to true to support namespaces", se);
} catch (SAXException se) {
throw new FOPException("Couldn't create XMLReader", se);
} catch (ParserConfigurationException pce) {
throw new FOPException("Couldn't create XMLReader", pce);
}
}
/**
* Returns the fully qualified classname of the standard XML parser for FOP
* to use.
* @return the XML parser classname
*/
public static final String getParserClassName() {
try {
return createParser().getClass().getName();
} catch (FOPException e) {
return null;
}
}
}
1.6 +2 -2 xml-fop/src/java/org/apache/fop/image/XMLImage.java
Index: XMLImage.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/image/XMLImage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLImage.java 4 Aug 2003 00:52:16 -0000 1.5
+++ XMLImage.java 12 Aug 2003 21:17:44 -0000 1.6
@@ -54,7 +54,7 @@
import org.w3c.dom.Document;
// FOP
-import org.apache.fop.apps.FOInputHandler;
+import org.apache.fop.apps.FOFileHandler;
/**
* This is an implementation for XML-based images such as SVG.
@@ -86,7 +86,7 @@
* @return the created SAX parser
*/
public static String getParserName() {
- String parserClassName = FOInputHandler.getParserClassName();
+ String parserClassName = FOFileHandler.getParserClassName();
return parserClassName;
}
1.7 +2 -2 xml-fop/src/java/org/apache/fop/svg/SVGElementMapping.java
Index: SVGElementMapping.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/SVGElementMapping.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SVGElementMapping.java 4 Aug 2003 00:52:16 -0000 1.6
+++ SVGElementMapping.java 12 Aug 2003 21:17:44 -0000 1.7
@@ -54,7 +54,7 @@
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ElementMapping;
-import org.apache.fop.apps.FOInputHandler;
+import org.apache.fop.apps.FOFileHandler;
import org.apache.batik.util.XMLResourceDescriptor;
import org.apache.batik.dom.svg.SVGDOMImplementation;
@@ -78,7 +78,7 @@
// normally the user agent value is used
try {
XMLResourceDescriptor.setXMLParserClassName(
- FOInputHandler.getParserClassName());
+ FOFileHandler.getParserClassName());
foObjs = new HashMap();
foObjs.put("svg", new SE());
1.6 +1 -1 xml-fop/src/java/org/apache/fop/svg/SVGUserAgent.java
Index: SVGUserAgent.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/SVGUserAgent.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SVGUserAgent.java 4 Aug 2003 00:52:16 -0000 1.5
+++ SVGUserAgent.java 12 Aug 2003 21:17:44 -0000 1.6
@@ -158,7 +158,7 @@
* @return the XML parser class name
*/
public String getXMLParserClassName() {
- return org.apache.fop.apps.FOInputHandler.getParserClassName();
+ return org.apache.fop.apps.FOFileHandler.getParserClassName();
}
/**
1.5 +2 -2 xml-fop/src/java/org/apache/fop/tools/TestConverter.java
Index: TestConverter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/tools/TestConverter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestConverter.java 27 Jul 2003 16:37:13 -0000 1.4
+++ TestConverter.java 12 Aug 2003 21:17:44 -0000 1.5
@@ -51,7 +51,7 @@
package org.apache.fop.tools;
import org.apache.fop.apps.Driver;
-import org.apache.fop.apps.FOInputHandler;
+import org.apache.fop.apps.FOFileHandler;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.InputHandler;
import org.apache.fop.apps.XSLTInputHandler;
@@ -278,7 +278,7 @@
InputHandler inputHandler = null;
if (xsl == null) {
- inputHandler = new FOInputHandler(xmlFile);
+ inputHandler = new FOFileHandler(xmlFile);
} else {
inputHandler = new XSLTInputHandler(xmlFile,
new File(baseDir + "/"
1.7 +2 -2 xml-fop/src/java/org/apache/fop/tools/anttasks/Fop.java
Index: Fop.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/tools/anttasks/Fop.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Fop.java 30 Jul 2003 22:01:35 -0000 1.6
+++ Fop.java 12 Aug 2003 21:17:44 -0000 1.7
@@ -68,7 +68,7 @@
// FOP
import org.apache.fop.apps.Starter;
import org.apache.fop.apps.InputHandler;
-import org.apache.fop.apps.FOInputHandler;
+import org.apache.fop.apps.FOFileHandler;
import org.apache.fop.apps.Driver;
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FOUserAgent;
@@ -502,7 +502,7 @@
private void render(File foFile, File outFile,
int renderer) throws FOPException {
- InputHandler inputHandler = new FOInputHandler(foFile);
+ InputHandler inputHandler = new FOFileHandler(foFile);
OutputStream out = null;
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org