db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r349925 - in /db/ddlutils/trunk: build.xml src/java/database.dtd src/java/org/apache/ddlutils/io/LocalEntityResolver.java src/java/org/apache/ddlutils/task/DdlToDatabaseTask.java src/resources/
Date Wed, 30 Nov 2005 11:29:42 GMT
Author: tomdz
Date: Wed Nov 30 03:29:29 2005
New Revision: 349925

URL: http://svn.apache.org/viewcvs?rev=349925&view=rev
Log:
Added option for controlling whether the schema XML is validated against the local (the default)
or the remote database

Added:
    db/ddlutils/trunk/src/java/database.dtd
      - copied unchanged from r330800, db/ddlutils/trunk/src/resources/database.dtd
Removed:
    db/ddlutils/trunk/src/resources/
Modified:
    db/ddlutils/trunk/build.xml
    db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DdlToDatabaseTask.java

Modified: db/ddlutils/trunk/build.xml
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/build.xml?rev=349925&r1=349924&r2=349925&view=diff
==============================================================================
--- db/ddlutils/trunk/build.xml (original)
+++ db/ddlutils/trunk/build.xml Wed Nov 30 03:29:29 2005
@@ -69,7 +69,8 @@
                excludes="**/*.java"/>
     </copy>
     <jar jarfile="${dist.dir}/${dist-filename-prefix}.jar"
-         basedir="${build.java.dir}"/>
+         basedir="${build.java.dir}"
+         excludes="**/package.html"/>
   </target>
 
   <target name="clean"

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java?rev=349925&r1=349924&r2=349925&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java Wed Nov 30
03:29:29 2005
@@ -26,7 +26,7 @@
 
 /**
  * An entity resolver that matches the specific database dtds to the one that comes
- * with commons-sql, and that can handle file url's.
+ * with DdlUtils, and that can handle file url's.
  * 
  * @author Thomas Dudziak
  * @version $Revision$
@@ -45,7 +45,7 @@
 
         if (systemId.startsWith(DTD_PREFIX))
         {
-            InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream("resources/database.dtd");
+            InputStream input = getClass().getResourceAsStream("/database.dtd");
 
             if (input != null)
             {

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DdlToDatabaseTask.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DdlToDatabaseTask.java?rev=349925&r1=349924&r2=349925&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DdlToDatabaseTask.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DdlToDatabaseTask.java Wed Nov 30
03:29:29 2005
@@ -39,6 +39,18 @@
     private File _singleSchemaFile = null;
     /** The input files. */
     private ArrayList _fileSets = new ArrayList();
+    /** Whether XML input files are validated against the internal or an external DTD. */
+    private boolean _useInternalDtd = true;
+
+    /**
+     * Specifies whether XML input files are validated against the internal or an external
DTD.
+     *
+     * @param isValidating <code>true</code> if input files are to be validated
against the internal DTD
+     */
+    public void setUseInternalDtd(boolean useInternalDtd)
+    {
+        _useInternalDtd = useInternalDtd;
+    }
 
     /**
      * Adds a fileset.
@@ -136,8 +148,9 @@
     protected Database readModel()
     {
         DatabaseIO reader = new DatabaseIO();
-        Database       model  = null;
+        Database   model  = null;
 
+        reader.setUseInternalDtd(_useInternalDtd);
         if ((_singleSchemaFile != null) && !_fileSets.isEmpty())
         {
             throw new BuildException("Please use either the schemafile attribute or the sub
fileset element, but not both");



Mime
View raw message