db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quint...@apache.org
Subject cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/engine/database/transform DTDResolver.java
Date Fri, 31 Jan 2003 16:23:59 GMT
quintonm    2003/01/31 08:23:59

  Modified:    src/java/org/apache/torque/engine/database/transform
                        DTDResolver.java
  Log:
  - Changed logging statements from System.out to use log4j.
  - If the DTD matches http://jakarta.apache.org/turbine/dtd/database_3_1.dtd,
  database.dtd will be used from the classpath.
  
  The new dtd is already in place on the jakarta site.
  
  Revision  Changes    Path
  1.11      +20 -9     jakarta-turbine-torque/src/java/org/apache/torque/engine/database/transform/DTDResolver.java
  
  Index: DTDResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/transform/DTDResolver.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DTDResolver.java	3 Jan 2003 20:20:54 -0000	1.10
  +++ DTDResolver.java	31 Jan 2003 16:23:58 -0000	1.11
  @@ -57,6 +57,9 @@
   import java.io.IOException;
   import java.io.InputStream;
   import java.net.URL;
  +
  +import org.apache.log4j.Logger;
  +
   import org.xml.sax.EntityResolver;
   import org.xml.sax.InputSource;
   
  @@ -65,17 +68,21 @@
    *
    * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
    * @author <a href="mailto:kschrader@karmalab.org">Kurt Schrader</a>
  + * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
    * @version $Id$
    */
   public class DTDResolver implements EntityResolver
   {
       /** Where the DTD is located on the web. */
       private static final String WEB_SITE_DTD
  -            = "http://jakarta.apache.org/turbine/dtd/database.dtd";
  +            = "http://jakarta.apache.org/turbine/dtd/database_3_1.dtd";
   
       /** InputSource for <code>database.dtd</code>. */
       private InputSource databaseDTD = null;
   
  +    /** Logging */
  +    private static Logger log = Logger.getLogger(DTDResolver.class);
  +
       /**
        * constructor
        */
  @@ -93,10 +100,14 @@
               {
                   databaseDTD = new InputSource(dtdStream);
               }
  +            else
  +            {
  +                log.warn("Could not located the database.dtd");
  +            }
           }
           catch (Exception ex)
           {
  -            ex.printStackTrace();
  +            log.error("Could not get stream for database.dtd", ex );
           }
       }
   
  @@ -113,18 +124,20 @@
           {
               String pkg = getClass().getName().substring(0,
                       getClass().getName().lastIndexOf("."));
  -            System.out.println("Resolver: used database.dtd from "
  +
  +            log.info("Resolver: used database.dtd from "
                       + pkg + " package ");
  +
               return databaseDTD;
           }
           else if (systemId == null)
           {
  -            System.out.println("Resolver: used " + WEB_SITE_DTD);
  +            log.info("Resolver: used " + WEB_SITE_DTD);
               return getInputSource(WEB_SITE_DTD);
           }
           else
           {
  -            System.out.println("Resolver: used " + systemId);
  +            log.info("Resolver: used " + systemId);
               return getInputSource(systemId);
           }
       }
  @@ -144,9 +157,7 @@
           }
           catch (IOException ex)
           {
  -            System.err.println("Couldn't read DTD specified in XML schema: "
  -                    + ex.getMessage());
  -            //ex.printStackTrace();
  +            log.error("Couldn't read DTD specified in XML schema: ", ex);
               return new InputSource();
           }
       }
  
  
  

Mime
View raw message