diff options
author | Glen Mazza <gmazza@apache.org> | 2004-07-24 05:47:45 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-07-24 05:47:45 +0000 |
commit | 3bcfed2d9b7e68e4bfcf6738bf5c9a28063d59d5 (patch) | |
tree | 9b75a0917ed78fffc5ee848e06ab5bba3315d0b1 /src/java/org/apache/fop/servlet | |
parent | 7796f1b60829f28d3173b658871cd0fa46d4c258 (diff) | |
download | xmlgraphics-fop-3bcfed2d9b7e68e4bfcf6738bf5c9a28063d59d5.tar.gz xmlgraphics-fop-3bcfed2d9b7e68e4bfcf6738bf5c9a28063d59d5.zip |
Combined the apps.Driver class into apps.Fop. (195 LOC total.) Primary
benefit is to make Fop self-documenting in external code, also none of the
API ideas called for retention of the Driver class (even if there were
different ideas for its replacement).
Let's try this for a few weeks, if it confuses people too much (or when
the API starts to grow again) we can bring back Driver, possibly under
a different name, apps.FopProcess, perhaps.
See also:
http://marc.theaimsgroup.com/?l=fop-dev&m=108947697611032&w=2
http://marc.theaimsgroup.com/?l=fop-dev&m=108966015504506&w=2
http://marc.theaimsgroup.com/?l=fop-dev&m=108942673103344&w=2
http://marc.theaimsgroup.com/?l=fop-dev&m=108958756030147&w=2
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197827 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/servlet')
-rw-r--r-- | src/java/org/apache/fop/servlet/FopPrintServlet.java | 10 | ||||
-rw-r--r-- | src/java/org/apache/fop/servlet/FopServlet.java | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/servlet/FopPrintServlet.java b/src/java/org/apache/fop/servlet/FopPrintServlet.java index 55a868214..699aef012 100644 --- a/src/java/org/apache/fop/servlet/FopPrintServlet.java +++ b/src/java/org/apache/fop/servlet/FopPrintServlet.java @@ -37,7 +37,7 @@ import javax.xml.transform.stream.StreamSource; // XML import org.apache.commons.logging.impl.SimpleLog; import org.apache.commons.logging.Log; -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; import org.xml.sax.InputSource; //Java @@ -138,7 +138,7 @@ public class FopPrintServlet extends HttpServlet { public void renderFO(InputStream foFile, HttpServletResponse response) throws ServletException { try { - Driver driver = new Driver(Driver.RENDER_PRINT); + Fop fop = new Fop(Fop.RENDER_PRINT); // Setup JAXP TransformerFactory factory = TransformerFactory.newInstance(); @@ -148,7 +148,7 @@ public class FopPrintServlet extends HttpServlet { Source src = new StreamSource(foFile); // Resulting SAX events (the generated FO) must be piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); @@ -169,7 +169,7 @@ public class FopPrintServlet extends HttpServlet { public void renderXML(File xmlfile, File xsltfile, HttpServletResponse response) throws ServletException { try { - Driver driver = new Driver(Driver.RENDER_PRINT); + Fop fop = new Fop(Fop.RENDER_PRINT); // Setup XSLT TransformerFactory factory = TransformerFactory.newInstance(); @@ -179,7 +179,7 @@ public class FopPrintServlet extends HttpServlet { Source src = new StreamSource(xmlfile); // Resulting SAX events (the generated FO) must be piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); // Start XSLT transformation and FOP processing transformer.transform(src, res); diff --git a/src/java/org/apache/fop/servlet/FopServlet.java b/src/java/org/apache/fop/servlet/FopServlet.java index 6a626786d..ca04bd486 100644 --- a/src/java/org/apache/fop/servlet/FopServlet.java +++ b/src/java/org/apache/fop/servlet/FopServlet.java @@ -38,7 +38,7 @@ import org.apache.commons.logging.impl.SimpleLog; import org.apache.commons.logging.Log; //FOP -import org.apache.fop.apps.Driver; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FOPException; /** @@ -201,14 +201,14 @@ public class FopServlet extends HttpServlet { throws FOPException, TransformerException { //Setup FOP - Driver driver = new Driver(Driver.RENDER_PDF); + Fop fop = new Fop(Fop.RENDER_PDF); //Setup output ByteArrayOutputStream out = new ByteArrayOutputStream(); - driver.setOutputStream(out); + fop.setOutputStream(out); //Make sure the XSL transformation's result is piped through to FOP - Result res = new SAXResult(driver.getDefaultHandler()); + Result res = new SAXResult(fop.getDefaultHandler()); //Start the transformation and rendering process transformer.transform(src, res); |