vmote       2003/06/17 09:35:58

  Modified:    src/java/org/apache/fop/apps AWTStarter.java
                        CommandLineOptions.java CommandLineStarter.java
                        Driver.java FOInputHandler.java InputHandler.java
                        PrintStarter.java TraxInputHandler.java
                        XSLTInputHandler.java
               src/java/org/apache/fop/image XMLImage.java
               src/java/org/apache/fop/servlet FopPrintServlet.java
                        FopServlet.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
  Removed:     src/java/org/apache/fop/apps Session.java
  Log:
  Revert refactoring of Driver to Session. Files affected should be identical to that 
which is two revisions earlier (e.g. if 1.3 is being checked in here, it should be 
identical to 1.1).
  
  Revision  Changes    Path
  1.4       +15 -15    xml-fop/src/java/org/apache/fop/apps/AWTStarter.java
  
  Index: AWTStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/AWTStarter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AWTStarter.java   17 Jun 2003 02:46:55 -0000      1.3
  +++ AWTStarter.java   17 Jun 2003 16:35:57 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   //FOP
  @@ -76,7 +76,7 @@
   public class AWTStarter extends CommandLineStarter {
       private PreviewDialog frame;
       private Translator translator;
  -    private Session session;
  +    private Driver driver;
       private XMLReader parser;
   
       /**
  @@ -101,8 +101,8 @@
           AWTRenderer renderer = new AWTRenderer(translator);
           frame = createPreviewDialog(renderer, translator);
           renderer.setComponent(frame);
  -        session = new Session();
  -        session.setRenderer(renderer);
  +        driver = new Driver();
  +        driver.setRenderer(renderer);
           parser = inputHandler.getParser();
           if (parser == null) {
               throw new FOPException("Unable to create SAX parser");
  @@ -115,10 +115,10 @@
        * @throws FOPException FIXME should not happen.
        */
       public void run() throws FOPException {
  -        session.reset();
  +        driver.reset();
           try {
               frame.setStatus(translator.getString("Status.Build.FO.tree"));
  -            session.render(parser, inputHandler.getInputSource());
  +            driver.render(parser, inputHandler.getInputSource());
               frame.setStatus(translator.getString("Status.Show"));
               frame.showPage();
           } catch (Exception e) {
  
  
  
  1.4       +22 -22    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CommandLineOptions.java   17 Jun 2003 02:46:55 -0000      1.3
  +++ CommandLineOptions.java   17 Jun 2003 16:35:57 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   // java
  @@ -154,7 +154,7 @@
   
       /**
        * parses the commandline arguments
  -     * @return true if parse was successful and processing can continue, false
  +     * @return true if parse was successful and processing can continue, false 
        * if processing should stop
        * @exception FOPException if there was an error in the format of the options
        */
  @@ -392,26 +392,26 @@
           case NOT_SET:
               throw new FOPException("Renderer has not been set!");
           case PDF_OUTPUT:
  -            return Session.RENDER_PDF;
  +            return Driver.RENDER_PDF;
           case AWT_OUTPUT:
  -            return Session.RENDER_AWT;
  +            return Driver.RENDER_AWT;
           case MIF_OUTPUT:
  -            return Session.RENDER_MIF;
  +            return Driver.RENDER_MIF;
           case PRINT_OUTPUT:
  -            return Session.RENDER_PRINT;
  +            return Driver.RENDER_PRINT;
           case PCL_OUTPUT:
  -            return Session.RENDER_PCL;
  +            return Driver.RENDER_PCL;
           case PS_OUTPUT:
  -            return Session.RENDER_PS;
  +            return Driver.RENDER_PS;
           case TXT_OUTPUT:
  -            return Session.RENDER_TXT;
  +            return Driver.RENDER_TXT;
           case SVG_OUTPUT:
  -            return Session.RENDER_SVG;
  +            return Driver.RENDER_SVG;
           case AREA_OUTPUT:
               rendererOptions.put("fineDetail", isCoarseAreaXml());
  -            return Session.RENDER_XML;
  +            return Driver.RENDER_XML;
           case RTF_OUTPUT:
  -            return Session.RENDER_RTF;
  +            return Driver.RENDER_RTF;
           default:
               throw new FOPException("Invalid Renderer setting!");
           }
  @@ -617,7 +617,7 @@
               + "  Fop foo.fo -print or Fop -print foo.fo \n"
               + "  Fop foo.fo -awt \n");
       }
  -
  +    
       /**
        * shows the options for print output
        */
  
  
  
  1.3       +18 -18    xml-fop/src/java/org/apache/fop/apps/CommandLineStarter.java
  
  Index: CommandLineStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/CommandLineStarter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommandLineStarter.java   17 Jun 2003 02:46:55 -0000      1.2
  +++ CommandLineStarter.java   17 Jun 2003 16:35:57 -0000      1.3
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   // SAX
  @@ -91,21 +91,21 @@
           XMLReader parser = inputHandler.getParser();
           setParserFeatures(parser);
   
  -        Session session = new Session();
  -        setupLogger(session);
  -        session.initialize();
  +        Driver driver = new Driver();
  +        setupLogger(driver);
  +        driver.initialize();
   
           try {
  -            session.setRenderer(commandLineOptions.getRenderer());
  +            driver.setRenderer(commandLineOptions.getRenderer());
               BufferedOutputStream bos = new BufferedOutputStream(new 
FileOutputStream(
                                         commandLineOptions.getOutputFile()));
               try {
  -                session.setOutputStream(bos);
  -                if (session.getRenderer() != null) {
  -                    session.getRenderer().setOptions(
  +                driver.setOutputStream(bos);
  +                if (driver.getRenderer() != null) {
  +                    driver.getRenderer().setOptions(
                     commandLineOptions.getRendererOptions());
                   }
  -                session.render(parser, inputHandler.getInputSource());
  +                driver.render(parser, inputHandler.getInputSource());
               } finally {
                   bos.close();
               }
  
  
  
  1.6       +101 -19   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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Driver.java       17 Jun 2003 02:46:55 -0000      1.5
  +++ Driver.java       17 Jun 2003 16:35:57 -0000      1.6
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   // FOP
  @@ -133,9 +133,6 @@
    * driver.setRenderer(new org.apache.fop.render.awt.AWTRenderer(translator));
    * driver.render(parser, fileInputSource(args[0]));
    * </PRE>
  - *
  - * @deprecated This class is replaced by [EMAIL PROTECTED] Session}. See [EMAIL 
PROTECTED]
  - * CommandLineStarter#run for a usage example.
    */
   public class Driver implements LogEnabled {
   
  @@ -299,8 +296,8 @@
       }
   
       /**
  -     * Provide the Driver instance with a logger. More information on Avalon
  -     * logging can be found at the
  +     * Provide the Driver instance with a logger. More information on Avalon 
  +     * logging can be found at the 
        * <a href="http://avalon.apache.org";>Avalon site</a>.
        *
        * @param log the logger. Must not be <code>null</code>.
  @@ -315,7 +312,7 @@
       }
   
       /**
  -     * Provide the Driver instance with a logger.
  +     * Provide the Driver instance with a logger. 
        * @param log the logger. Must not be <code>null</code>.
        * @deprecated Use #enableLogging(Logger) instead.
        */
  @@ -402,7 +399,7 @@
   
           // add mappings from available services
           Iterator providers =
  -            Session.providers(org.apache.fop.fo.ElementMapping.class);
  +            Service.providers(org.apache.fop.fo.ElementMapping.class);
           if (providers != null) {
               while (providers.hasNext()) {
                   String str = (String)providers.next();
  @@ -490,7 +487,7 @@
        * @param rendererClassName the fully qualified classname of the renderer
        * class to use.
        * @param version version number
  -     * @deprecated use renderer.setProducer(version) + setRenderer(renderer) or
  +     * @deprecated use renderer.setProducer(version) + setRenderer(renderer) or 
        * just setRenderer(rendererType) which will use the default producer string.
        * @see #setRenderer(int)
        * @see #setRenderer(Renderer)
  @@ -581,7 +578,7 @@
               initialize();
           }
           validateOutputStream();
  -
  +        
           // TODO: - do this stuff in a better way
           // PIJ: I guess the structure handler should be created by the renderer.
           if (rendererType == RENDER_MIF) {
  @@ -701,3 +698,88 @@
       }
   
   }
  +
  +// code stolen from org.apache.batik.util and modified slightly
  +// does what sun.misc.Service probably does, but it cannot be relied on.
  +// hopefully will be part of standard jdk sometime.
  +
  +/**
  + * This class loads services present in the class path.
  + */
  +class Service {
  +
  +    private static Map providerMap = new java.util.Hashtable();
  +
  +    public static synchronized Iterator providers(Class cls) {
  +        ClassLoader cl = cls.getClassLoader();
  +        // null if loaded by bootstrap class loader
  +        if (cl == null) {
  +            cl = ClassLoader.getSystemClassLoader();
  +        }
  +        String serviceFile = "META-INF/services/" + cls.getName();
  +
  +        // getLogger().debug("File: " + serviceFile);
  +
  +        List lst = (List)providerMap.get(serviceFile);
  +        if (lst != null) {
  +            return lst.iterator();
  +        }
  +
  +        lst = new java.util.Vector();
  +        providerMap.put(serviceFile, lst);
  +
  +        Enumeration e;
  +        try {
  +            e = cl.getResources(serviceFile);
  +        } catch (IOException ioe) {
  +            return lst.iterator();
  +        }
  +
  +        while (e.hasMoreElements()) {
  +            try {
  +                java.net.URL u = (java.net.URL)e.nextElement();
  +                //getLogger().debug("URL: " + u);
  +
  +                InputStream is = u.openStream();
  +                Reader r = new InputStreamReader(is, "UTF-8");
  +                BufferedReader br = new BufferedReader(r);
  +
  +                String line = br.readLine();
  +                while (line != null) {
  +                    try {
  +                        // First strip any comment...
  +                        int idx = line.indexOf('#');
  +                        if (idx != -1) {
  +                            line = line.substring(0, idx);
  +                        }
  +
  +                        // Trim whitespace.
  +                        line = line.trim();
  +
  +                        // If nothing left then loop around...
  +                        if (line.length() == 0) {
  +                            line = br.readLine();
  +                            continue;
  +                        }
  +                        // getLogger().debug("Line: " + line);
  +
  +                        // Try and load the class
  +                        // Object obj = cl.loadClass(line).newInstance();
  +                        // stick it into our vector...
  +                        lst.add(line);
  +                    } catch (Exception ex) {
  +                        // Just try the next line
  +                    }
  +
  +                    line = br.readLine();
  +                }
  +            } catch (Exception ex) {
  +                // Just try the next file...
  +            }
  +
  +        }
  +        return lst.iterator();
  +    }
  +
  +}
  +
  
  
  
  1.4       +14 -14    xml-fop/src/java/org/apache/fop/apps/FOInputHandler.java
  
  Index: FOInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOInputHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FOInputHandler.java       17 Jun 2003 02:46:55 -0000      1.3
  +++ FOInputHandler.java       17 Jun 2003 16:35:57 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   // Imported SAX classes
  @@ -62,7 +62,7 @@
    * Manages input if it is an XSL-FO file.
    */
   public class FOInputHandler extends InputHandler {
  -
  +    
       private File fofile = null;
       private URL foURL = null;
   
  @@ -82,7 +82,7 @@
           this.foURL = url;
       }
   
  -
  +    
       /**
        * @see org.apache.fop.apps.InputHandler#getInputSource()
        */
  @@ -101,9 +101,9 @@
       }
   
       /**
  -     * @see org.apache.fop.apps.InputHandler#run(Session)
  +     * @see org.apache.fop.apps.InputHandler#run(Driver)
        */
  -    public void run(Session session) throws FOPException {
  +    public void run(Driver driver) throws FOPException {
           throw new FOPException("not implemented: FOInputHandler.run(Driver)");
       }
   
  
  
  
  1.4       +15 -15    xml-fop/src/java/org/apache/fop/apps/InputHandler.java
  
  Index: InputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/InputHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- InputHandler.java 17 Jun 2003 02:46:55 -0000      1.3
  +++ InputHandler.java 17 Jun 2003 16:35:57 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   // SAX
  @@ -129,13 +129,13 @@
               throw new FOPException("Coudn't create XMLReader", pce);
           }
       }
  -
  +    
       /**
  -     * Runs this InputHandler through the Session.
  -     * @param session Session instance to use
  +     * Runs this InputHandler through the Driver.
  +     * @param driver Driver instance to use
        * @throws FOPException if processing this InputHandler fails
        */
  -    public abstract void run(Session session) throws FOPException;
  -
  +    public abstract void run(Driver driver) throws FOPException;
  +    
   }
   
  
  
  
  1.3       +14 -14    xml-fop/src/java/org/apache/fop/apps/PrintStarter.java
  
  Index: PrintStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/PrintStarter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PrintStarter.java 17 Jun 2003 02:46:55 -0000      1.2
  +++ PrintStarter.java 17 Jun 2003 16:35:57 -0000      1.3
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   /*
  @@ -95,7 +95,7 @@
        * @see org.apache.fop.apps.Starter#run()
        */
       public void run() throws FOPException {
  -        Session session = new Session();
  +        Driver driver = new Driver();
   
           String version = Version.getVersion();
           //log.debug(version);
  @@ -118,8 +118,8 @@
           //renderer.setCopies(copies);
   
           try {
  -            session.setRenderer(renderer);
  -            session.render(parser, inputHandler.getInputSource());
  +            driver.setRenderer(renderer);
  +            driver.render(parser, inputHandler.getInputSource());
           } catch (Exception e) {
               if (e instanceof FOPException) {
                   throw (FOPException)e;
  @@ -188,7 +188,7 @@
                   printerJob.print();
               } catch (PrinterException e) {
                   e.printStackTrace();
  -                throw new IOException("Unable to print: "
  +                throw new IOException("Unable to print: " 
                       + e.getClass().getName()
                       + ": " + e.getMessage());
               }
  
  
  
  1.4       +20 -20    xml-fop/src/java/org/apache/fop/apps/TraxInputHandler.java
  
  Index: TraxInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/TraxInputHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TraxInputHandler.java     17 Jun 2003 02:46:55 -0000      1.3
  +++ TraxInputHandler.java     17 Jun 2003 16:35:57 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.apps;
   
   // Imported java.io classes
  @@ -68,7 +68,7 @@
   import org.xml.sax.XMLFilter;
   
   /**
  - * XSLTInputHandler basically takes an XML file and transforms it with an
  + * XSLTInputHandler basically takes an XML file and transforms it with an 
    * XSLT file and the resulting XSL-FO document is input for FOP.
    */
   public class TraxInputHandler extends InputHandler {
  @@ -79,7 +79,7 @@
   
       /**
        * Constructor with files as input.
  -     * @param xmlfile XML file
  +     * @param xmlfile XML file 
        * @param xsltfile XSLT file
        * @throws FOPException if initializing the Transformer fails
        */
  @@ -107,7 +107,7 @@
        * @param xsltSource XSLT InputSource
        * @throws FOPException if initializing the Transformer fails
        */
  -    public TraxInputHandler(InputSource xmlSource, InputSource xsltSource)
  +    public TraxInputHandler(InputSource xmlSource, InputSource xsltSource) 
                   throws FOPException {
           this.xmlSource  = new StreamSource(xmlSource.getByteStream(),
                                              xmlSource.getSystemId());
  @@ -115,10 +115,10 @@
                                              xsltSource.getSystemId());
           initTransformer();
       }
  -
  +    
       private void initTransformer() throws FOPException {
           try {
  -            this.transformer =
  +            this.transformer = 
                   TransformerFactory.newInstance().newTransformer(xsltSource);
           } catch (Exception ex) {
               throw new FOPException(ex);
  @@ -136,7 +136,7 @@
       }
   
       /**
  -     * Overwrites this method of the super class and returns an XMLFilter
  +     * Overwrites this method of the super class and returns an XMLFilter 
        * instead of a simple XMLReader which allows chaining of transformations.
        * @see org.apache.fop.apps.InputHandler#getParser()
        */
  @@ -150,7 +150,7 @@
        * during the conversion of the xml file + xslt stylesheet the resulting
        * data is fed into Fop. This should help to avoid memory problems
        * @param xsltSource An xslt stylesheet
  -     * @return an XMLFilter which can be chained together with other
  +     * @return an XMLFilter which can be chained together with other 
        * XMLReaders or XMLFilters
        * @throws FOPException if setting up the XMLFilter fails
        */
  @@ -192,12 +192,12 @@
       }
   
       /**
  -     * @see org.apache.fop.apps.InputHandler#run(Session)
  +     * @see org.apache.fop.apps.InputHandler#run(Driver)
        */
  -    public void run(Session session) throws FOPException {
  +    public void run(Driver driver) throws FOPException {
           try {
               transformer.transform(xmlSource,
  -                                  new SAXResult(session.getContentHandler()));
  +                                  new SAXResult(driver.getContentHandler()));
           } catch (Exception ex) {
               throw new FOPException(ex);
           }
  
  
  
  1.5       +3 -3      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XSLTInputHandler.java     17 Jun 2003 02:46:55 -0000      1.4
  +++ XSLTInputHandler.java     17 Jun 2003 16:35:57 -0000      1.5
  @@ -115,10 +115,10 @@
       }
   
       /**
  -     * @see org.apache.fop.apps.InputHandler#run(Session)
  +     * @see org.apache.fop.apps.InputHandler#run(Driver)
        */
  -    public void run(Session session) throws FOPException {
  -        traxInputHandler.run(session);
  +    public void run(Driver driver) throws FOPException {
  +        traxInputHandler.run(driver);
       }
   
       /**
  
  
  
  1.4       +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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLImage.java     17 Jun 2003 02:46:56 -0000      1.3
  +++ XMLImage.java     17 Jun 2003 16:35:57 -0000      1.4
  @@ -54,7 +54,7 @@
   import org.w3c.dom.Document;
   
   // FOP
  -import org.apache.fop.apps.Session;
  +import org.apache.fop.apps.Driver;
   
   /**
    * 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 = Session.getParserClassName();
  +        String parserClassName = Driver.getParserClassName();
           return parserClassName;
       }
   
  
  
  
  1.4       +9 -9      xml-fop/src/java/org/apache/fop/servlet/FopPrintServlet.java
  
  Index: FopPrintServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/servlet/FopPrintServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FopPrintServlet.java      17 Jun 2003 02:46:56 -0000      1.3
  +++ FopPrintServlet.java      17 Jun 2003 16:35:57 -0000      1.4
  @@ -72,7 +72,7 @@
   import org.apache.avalon.framework.logger.Logger;
   
   // FOP
  -import org.apache.fop.apps.Session;
  +import org.apache.fop.apps.Driver;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.area.PageViewport;
   import org.apache.fop.apps.XSLTInputHandler;
  @@ -171,13 +171,13 @@
       public void renderFO(InputSource foFile,
                            HttpServletResponse response) throws ServletException {
           try {
  -            Session session = new Session(foFile, null);
  +            Driver driver = new Driver(foFile, null);
               PrinterJob pj = PrinterJob.getPrinterJob();
               PrintRenderer renderer = new PrintRenderer(pj);
   
  -            session.enableLogging(log);
  -            session.setRenderer(renderer);
  -            session.run();
  +            driver.enableLogging(log);
  +            driver.setRenderer(renderer);
  +            driver.run();
   
               reportOK (response);
           } catch (Exception ex) {
  @@ -194,15 +194,15 @@
       public void renderXML(XSLTInputHandler input,
                             HttpServletResponse response) throws ServletException {
           try {
  -            Session session = new Session();
  +            Driver driver = new Driver();
               PrinterJob pj = PrinterJob.getPrinterJob();
               PrintRenderer renderer = new PrintRenderer(pj);
   
               pj.setCopies(1);
   
  -            session.enableLogging(log);
  -            session.setRenderer(renderer);
  -            session.render(input.getParser(), input.getInputSource());
  +            driver.enableLogging(log);
  +            driver.setRenderer(renderer);
  +            driver.render(input.getParser(), input.getInputSource());
   
               reportOK (response);
           } catch (Exception ex) {
  
  
  
  1.4       +7 -7      xml-fop/src/java/org/apache/fop/servlet/FopServlet.java
  
  Index: FopServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/servlet/FopServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FopServlet.java   17 Jun 2003 02:46:56 -0000      1.3
  +++ FopServlet.java   17 Jun 2003 16:35:57 -0000      1.4
  @@ -71,7 +71,7 @@
   import org.apache.avalon.framework.logger.Logger;
   
   //FOP
  -import org.apache.fop.apps.Session;
  +import org.apache.fop.apps.Driver;
   import org.apache.fop.apps.FOPException;
   
   /**
  @@ -233,17 +233,17 @@
                   throws FOPException, TransformerException {
   
           //Setup FOP
  -        Session session = new Session();
  -        session.enableLogging(this.log);
  -        session.setRenderer(Session.RENDER_PDF);
  -        session.initialize();
  +        Driver driver = new Driver();
  +        driver.enableLogging(this.log);
  +        driver.setRenderer(Driver.RENDER_PDF);
  +        driver.initialize();
   
           //Setup output
           ByteArrayOutputStream out = new ByteArrayOutputStream();
  -        session.setOutputStream(out);
  +        driver.setOutputStream(out);
   
           //Make sure the XSL transformation's result is piped through to FOP
  -        Result res = new SAXResult(session.getContentHandler());
  +        Result res = new SAXResult(driver.getContentHandler());
   
           //Start the transformation and rendering process
           transformer.transform(src, res);
  
  
  
  1.3       +12 -12    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SVGElementMapping.java    17 Jun 2003 02:46:56 -0000      1.2
  +++ SVGElementMapping.java    17 Jun 2003 16:35:57 -0000      1.3
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.svg;
   
   import java.util.HashMap;
  @@ -55,7 +55,7 @@
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTreeBuilder;
   import org.apache.fop.fo.ElementMapping;
  -import org.apache.fop.apps.Session;
  +import org.apache.fop.apps.Driver;
   
   import org.apache.batik.util.XMLResourceDescriptor;
   import org.apache.batik.dom.svg.SVGDOMImplementation;
  @@ -75,7 +75,7 @@
               // by default (SVGBrokenLinkProvider)
               // normally the user agent value is used
               XMLResourceDescriptor.setXMLParserClassName(
  -              Session.getParserClassName());
  +              Driver.getParserClassName());
   
               foObjs = new HashMap();
               foObjs.put("svg", new SE());
  
  
  
  1.4       +11 -11    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SVGUserAgent.java 17 Jun 2003 02:46:56 -0000      1.3
  +++ SVGUserAgent.java 17 Jun 2003 16:35:57 -0000      1.4
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,12 +42,12 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.svg;
   
   import org.apache.fop.fo.FOUserAgent;
  @@ -158,7 +158,7 @@
        * @return the XML parser class name
        */
       public String getXMLParserClassName() {
  -        return org.apache.fop.apps.Session.getParserClassName();
  +        return org.apache.fop.apps.Driver.getParserClassName();
       }
   
       /**
  
  
  
  1.3       +25 -25    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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestConverter.java        17 Jun 2003 02:46:56 -0000      1.2
  +++ TestConverter.java        17 Jun 2003 16:35:58 -0000      1.3
  @@ -3,34 +3,34 @@
    * ============================================================================
    *                    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
    *    [EMAIL PROTECTED]
  - *
  + * 
    * 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
  @@ -42,15 +42,15 @@
    * (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 <[EMAIL PROTECTED]>. For more information on the Apache
    * Software Foundation, please see <http://www.apache.org/>.
  - */
  + */ 
   package org.apache.fop.tools;
   
  -import org.apache.fop.apps.Session;
  +import org.apache.fop.apps.Driver;
   import org.apache.fop.apps.FOInputHandler;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.apps.InputHandler;
  @@ -84,10 +84,10 @@
    * pdf rendering.
    *
    * Modified by Mark Lillywhite [EMAIL PROTECTED] to use the new Driver
  - * (now Session) interface.
  + * interface.
    */
   public class TestConverter extends AbstractLogEnabled {
  -
  +    
       private boolean failOnly = false;
       private boolean outputPDF = false;
       private File destdir;
  @@ -141,7 +141,7 @@
       }
   
       /**
  -     * Controls whether to process only the tests which are specified as fail
  +     * Controls whether to process only the tests which are specified as fail 
        * in the test results.
        * @param fail True if only fail tests should be processed
        */
  @@ -266,7 +266,7 @@
           if (xslNode != null) {
               xsl = xslNode.getNodeValue();
           }
  -        getLogger().debug("converting xml:" + xml + " and xsl:"
  +        getLogger().debug("converting xml:" + xml + " and xsl:" 
                     + xsl + " to area tree");
   
           try {
  @@ -290,33 +290,33 @@
               XMLReader parser = inputHandler.getParser();
               setParserFeatures(parser);
   
  -            Session session = new Session();
  -            setupLogger(session, "fop");
  -            session.initialize();
  +            Driver driver = new Driver();
  +            setupLogger(driver, "fop");
  +            driver.initialize();
               FOUserAgent userAgent = new FOUserAgent();
               userAgent.setBaseURL(baseURL);
  -            session.setUserAgent(userAgent);
  +            driver.setUserAgent(userAgent);
               if (outputPDF) {
  -                session.setRenderer(Session.RENDER_PDF);
  +                driver.setRenderer(Driver.RENDER_PDF);
               } else {
  -                session.setRenderer(Session.RENDER_XML);
  +                driver.setRenderer(Driver.RENDER_XML);
               }
   
               Map rendererOptions = new java.util.HashMap();
               rendererOptions.put("fineDetail", new Boolean(false));
               rendererOptions.put("consistentOutput", new Boolean(true));
  -            session.getRenderer().setOptions(rendererOptions);
  -            session.getRenderer().setProducer("Testsuite Converter");
  +            driver.getRenderer().setOptions(rendererOptions);
  +            driver.getRenderer().setProducer("Testsuite Converter");
   
               String outname = xmlFile.getName();
               if (outname.endsWith(".xml")) {
                   outname = outname.substring(0, outname.length() - 4);
               }
  -            session.setOutputStream(new java.io.BufferedOutputStream(
  +            driver.setOutputStream(new java.io.BufferedOutputStream(
                                          new java.io.FileOutputStream(new 
File(destdir,
                                          outname + (outputPDF ? ".pdf" : 
".at.xml")))));
               getLogger().debug("ddir:" + destdir + " on:" + outname + ".pdf");
  -            session.render(parser, inputHandler.getInputSource());
  +            driver.render(parser, inputHandler.getInputSource());
   
               // check difference
               if (compare != null) {
  
  
  
  1.4       +22 -22    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Fop.java  17 Jun 2003 02:46:56 -0000      1.3
  +++ Fop.java  17 Jun 2003 16:35:58 -0000      1.4
  @@ -72,7 +72,7 @@
   import org.apache.fop.apps.Starter;
   import org.apache.fop.apps.InputHandler;
   import org.apache.fop.apps.FOInputHandler;
  -import org.apache.fop.apps.Session;
  +import org.apache.fop.apps.Driver;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.FOUserAgent;
   
  @@ -307,27 +307,27 @@
           if ((format == null)
                   || format.equalsIgnoreCase("application/pdf")
                   || format.equalsIgnoreCase("pdf")) {
  -            return Session.RENDER_PDF;
  +            return Driver.RENDER_PDF;
           } else if (format.equalsIgnoreCase("application/postscript")
                   || format.equalsIgnoreCase("ps")) {
  -            return Session.RENDER_PS;
  +            return Driver.RENDER_PS;
           } else if (format.equalsIgnoreCase("application/vnd.mif")
                   || format.equalsIgnoreCase("mif")) {
  -            return Session.RENDER_MIF;
  +            return Driver.RENDER_MIF;
           } else if (format.equalsIgnoreCase("application/msword")
                   || format.equalsIgnoreCase("application/rtf")
                   || format.equalsIgnoreCase("rtf")) {
  -            return Session.RENDER_RTF;
  +            return Driver.RENDER_RTF;
           } else if (format.equalsIgnoreCase("application/vnd.hp-PCL")
                   || format.equalsIgnoreCase("pcl")) {
  -            return Session.RENDER_PCL;
  +            return Driver.RENDER_PCL;
           } else if (format.equalsIgnoreCase("text/plain")
                   || format.equalsIgnoreCase("txt")) {
  -            return Session.RENDER_TXT;
  +            return Driver.RENDER_TXT;
           } else if (format.equalsIgnoreCase("text/xml")
                   || format.equalsIgnoreCase("at")
                   || format.equalsIgnoreCase("xml")) {
  -            return Session.RENDER_XML;
  +            return Driver.RENDER_XML;
           } else {
               String err = "Couldn't determine renderer to use: " + format;
               throw new BuildException(err);
  @@ -336,19 +336,19 @@
   
       private String determineExtension(int renderer) {
           switch (renderer) {
  -            case Session.RENDER_PDF:
  +            case Driver.RENDER_PDF:
                   return ".pdf";
  -            case Session.RENDER_PS:
  +            case Driver.RENDER_PS:
                   return ".ps";
  -            case Session.RENDER_MIF:
  +            case Driver.RENDER_MIF:
                   return ".mif";
  -            case Session.RENDER_RTF:
  +            case Driver.RENDER_RTF:
                   return ".rtf";
  -            case Session.RENDER_PCL:
  +            case Driver.RENDER_PCL:
                   return ".pcl";
  -            case Session.RENDER_TXT:
  +            case Driver.RENDER_TXT:
                   return ".txt";
  -            case Session.RENDER_XML:
  +            case Driver.RENDER_XML:
                   return ".xml";
               default:
                   String err = "Unknown renderer: " + renderer;
  @@ -478,16 +478,16 @@
           }
   
           try {
  -            Session session = new Session();
  -            setupLogger(session);
  -            session.initialize();
  +            Driver driver = new Driver();
  +            setupLogger(driver);
  +            driver.initialize();
               FOUserAgent userAgent = new FOUserAgent();
               userAgent.setBaseURL(this.baseURL);
               userAgent.enableLogging(getLogger());
  -            session.setUserAgent(userAgent);
  -            session.setRenderer(renderer);
  -            session.setOutputStream(out);
  -            session.render(parser, inputHandler.getInputSource());
  +            driver.setUserAgent(userAgent);
  +            driver.setRenderer(renderer);
  +            driver.setOutputStream(out);
  +            driver.render(parser, inputHandler.getInputSource());
           } catch (Exception ex) {
               throw new BuildException(ex);
           } finally {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to