fedor 02/02/26 14:15:44
Modified: . build-torque.xml
src/java/org/apache/turbine/torque/engine/database/model
AppData.java Column.java Database.java
ForeignKey.java IdMethodParameter.java Index.java
Inheritance.java Table.java Unique.java
src/java/org/apache/turbine/torque/engine/database/transform
XmlToAppData.java
Log:
removing dependency on xerces. There is no need for it and it makes it possible to
upgrade to xerces-2. Before it was not possible due to ant's classloader issues
Revision Changes Path
1.2 +5 -10 jakarta-turbine-2/build-torque.xml
Index: build-torque.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/build-torque.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build-torque.xml 4 Jan 2002 12:53:24 -0000 1.1
+++ build-torque.xml 26 Feb 2002 22:15:43 -0000 1.2
@@ -17,16 +17,11 @@
<mkdir dir="${torque.dir}"/>
<mkdir dir="${torque.dir}/lib"/>
- <copy todir="${torque.dir}/lib">
- <fileset dir=".">
- <include name="ant-*.jar"/>
- </fileset>
- <fileset dir="lib">
- <include name="xerces-*.jar"/>
- <include name="velocity-*.jar"/>
- <include name="village-*.jar"/>
- </fileset>
- </copy>
+ <copy file="${velocity.jar}" todir="${torque.dir}/lib"/>
+ <copy file="${village.jar}" todir="${torque.dir}/lib"/>
+ <copy file="${commons-collections.jar}" todir="${torque.dir}/lib"/>
+ <copy file="${stratum.jar}" todir="${torque.dir}/lib"/>
+ <copy file="${log4j.jar}" todir="${torque.dir}/lib"/>
<filter token="TORQUE_HOME" value="."/>
<filter token="JARS" value="lib/*.jar"/>
1.4 +4 -3
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/AppData.java
Index: AppData.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/AppData.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AppData.java 16 Feb 2002 19:40:37 -0000 1.3
+++ AppData.java 26 Feb 2002 22:15:43 -0000 1.4
@@ -54,17 +54,18 @@
* <http://www.apache.org/>.
*/
+import org.xml.sax.AttributeList;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.xml.sax.Attributes;
/**
* A class for holding application data structures.
*
* @author <a href="mailto:[EMAIL PROTECTED]>Leon Messerschmidt</a>
* @author <a href="mailto:[EMAIL PROTECTED]>John McNally</a>
- * @version $Id: AppData.java,v 1.3 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: AppData.java,v 1.4 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class AppData
@@ -132,7 +133,7 @@
* An utility method to add a new database from
* an xml attribute.
*/
- public Database addDatabase(Attributes attrib)
+ public Database addDatabase(AttributeList attrib)
{
Database db = new Database();
db.loadFromXML (attrib);
1.4 +6 -9
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Column.java
Index: Column.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Column.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Column.java 16 Feb 2002 19:40:37 -0000 1.3
+++ Column.java 26 Feb 2002 22:15:43 -0000 1.4
@@ -54,14 +54,11 @@
* <http://www.apache.org/>.
*/
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Hashtable;
-import java.util.List;
-
import org.apache.velocity.util.StringUtils;
+import org.xml.sax.AttributeList;
-import org.xml.sax.Attributes;
+import java.util.ArrayList;
+import java.util.List;
/**
* A Class for holding data about a column used in an Application.
@@ -70,7 +67,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: Column.java,v 1.3 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: Column.java,v 1.4 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class Column
@@ -119,7 +116,7 @@
/**
* Imports a column from an XML specification
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
//Name
name = attrib.getValue("name");
@@ -255,7 +252,7 @@
* A utility function to create a new column
* from attrib and add it to this table.
*/
- public Inheritance addInheritance(Attributes attrib)
+ public Inheritance addInheritance(AttributeList attrib)
{
Inheritance inh = new Inheritance();
inh.loadFromXML (attrib);
1.3 +6 -5
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Database.java
Index: Database.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Database.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Database.java 16 Feb 2002 19:40:37 -0000 1.2
+++ Database.java 26 Feb 2002 22:15:43 -0000 1.3
@@ -54,12 +54,13 @@
* <http://www.apache.org/>.
*/
+import org.apache.turbine.services.db.TurbineDB;
+import org.xml.sax.AttributeList;
+
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
-import org.apache.turbine.services.db.TurbineDB;
-import org.xml.sax.Attributes;
/**
* A class for holding application data structures.
@@ -67,7 +68,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]>Leon Messerschmidt</a>
* @author <a href="mailto:[EMAIL PROTECTED]>John McNally</a>
* @author <a href="mailto:[EMAIL PROTECTED]>Martin Poeschl</a>
- * @version $Id: Database.java,v 1.2 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: Database.java,v 1.3 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class Database
@@ -93,7 +94,7 @@
/**
* Load the database object from an xml tag.
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
name = attrib.getValue("name");
if ( name == null )
@@ -238,7 +239,7 @@
* An utility method to add a new table from
* an xml attribute.
*/
- public Table addTable(Attributes attrib)
+ public Table addTable(AttributeList attrib)
{
Table tbl = new Table();
tbl.loadFromXML (attrib, this.getDefaultIdMethod());
1.3 +5 -4
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/ForeignKey.java
Index: ForeignKey.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/ForeignKey.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ForeignKey.java 16 Feb 2002 19:40:37 -0000 1.2
+++ ForeignKey.java 26 Feb 2002 22:15:43 -0000 1.3
@@ -54,16 +54,17 @@
* <http://www.apache.org/>.
*/
+import org.xml.sax.AttributeList;
+
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
-import org.xml.sax.Attributes;
/**
* A Class for information about foreign keys of a table
*
* @author <a href="mailto:[EMAIL PROTECTED]">Fedor</a>
- * @version $Id: ForeignKey.java,v 1.2 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: ForeignKey.java,v 1.3 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class ForeignKey
@@ -83,7 +84,7 @@
/**
* Imports foreign key from an XML specification
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
foreignTableName = attrib.getValue("foreignTable");
}
@@ -132,7 +133,7 @@
/**
* adds a new reference entry to the foreign key
*/
- public void addReference(Attributes attrib)
+ public void addReference(AttributeList attrib)
{
addReference(attrib.getValue("local"), attrib.getValue("foreign"));
}
1.3 +3 -3
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/IdMethodParameter.java
Index: IdMethodParameter.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/IdMethodParameter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IdMethodParameter.java 16 Feb 2002 19:40:37 -0000 1.2
+++ IdMethodParameter.java 26 Feb 2002 22:15:43 -0000 1.3
@@ -54,13 +54,13 @@
* <http://www.apache.org/>.
*/
-import org.xml.sax.Attributes;
+import org.xml.sax.AttributeList;
/**
* Information related to an ID method.
*
* @author <a href="mailto:[EMAIL PROTECTED]">John McNally</a>
- * @version $Id: IdMethodParameter.java,v 1.2 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: IdMethodParameter.java,v 1.3 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class IdMethodParameter
@@ -73,7 +73,7 @@
/**
* Imports foreign key from an XML specification
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
name = attrib.getValue("name");
value = attrib.getValue("value");
1.3 +5 -4
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Index.java
Index: Index.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Index.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Index.java 16 Feb 2002 19:40:37 -0000 1.2
+++ Index.java 26 Feb 2002 22:15:43 -0000 1.3
@@ -54,15 +54,16 @@
* <http://www.apache.org/>.
*/
+import org.xml.sax.AttributeList;
+
import java.util.ArrayList;
import java.util.List;
-import org.xml.sax.Attributes;
/**
* A Class for information about indices of a table
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Index.java,v 1.2 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: Index.java,v 1.3 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class Index
@@ -82,7 +83,7 @@
/**
* Imports index from an XML specification
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
indexName = attrib.getValue("name");
String unique = attrib.getValue("unique");
@@ -142,7 +143,7 @@
/**
* adds a new column to an index
*/
- public void addColumn(Attributes attrib)
+ public void addColumn(AttributeList attrib)
{
indexColumns.add(attrib.getValue("name"));
}
1.3 +3 -3
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Inheritance.java
Index: Inheritance.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Inheritance.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Inheritance.java 16 Feb 2002 19:40:37 -0000 1.2
+++ Inheritance.java 26 Feb 2002 22:15:43 -0000 1.3
@@ -54,13 +54,13 @@
* <http://www.apache.org/>.
*/
-import org.xml.sax.Attributes;
+import org.xml.sax.AttributeList;
/**
* A Class for information regarding possible objects representing a table
*
* @author <a href="mailto:[EMAIL PROTECTED]">John McNally</a>
- * @version $Id: Inheritance.java,v 1.2 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: Inheritance.java,v 1.3 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class Inheritance
@@ -80,7 +80,7 @@
/**
* Imports foreign key from an XML specification
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
setKey(attrib.getValue("key"));
setClassName(attrib.getValue("class"));
1.6 +11 -11
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Table.java
Index: Table.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Table.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Table.java 16 Feb 2002 19:40:37 -0000 1.5
+++ Table.java 26 Feb 2002 22:15:43 -0000 1.6
@@ -54,14 +54,14 @@
* <http://www.apache.org/>.
*/
+import org.apache.turbine.util.db.map.IDMethod;
+import org.apache.velocity.util.StringUtils;
+import org.xml.sax.AttributeList;
+
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
-import org.apache.velocity.util.StringUtils;
-import org.xml.sax.Attributes;
-
-import org.apache.turbine.util.db.map.IDMethod;
/**
* Data about a table used in an application.
@@ -71,7 +71,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">John McNally</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: Table.java,v 1.5 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: Table.java,v 1.6 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class Table implements IDMethod
@@ -124,7 +124,7 @@
/**
* Load the table object from an xml tag.
*/
- public void loadFromXML (Attributes attrib, String defaultIdMethod)
+ public void loadFromXML (AttributeList attrib, String defaultIdMethod)
{
name = attrib.getValue("name");
javaName = attrib.getValue("javaName");
@@ -213,7 +213,7 @@
* A utility function to create a new column
* from attrib and add it to this table.
*/
- public Column addColumn(Attributes attrib)
+ public Column addColumn(AttributeList attrib)
{
Column col = new Column();
col.loadFromXML (attrib);
@@ -242,7 +242,7 @@
* A utility function to create a new foreign key
* from attrib and add it to this table.
*/
- public ForeignKey addForeignKey(Attributes attrib)
+ public ForeignKey addForeignKey(AttributeList attrib)
{
ForeignKey fk = new ForeignKey();
fk.loadFromXML (attrib);
@@ -347,7 +347,7 @@
* A utility function to create a new id method parameter
* from attrib and add it to this table.
*/
- public IdMethodParameter addIdMethodParameter(Attributes attrib)
+ public IdMethodParameter addIdMethodParameter(AttributeList attrib)
{
IdMethodParameter imp = new IdMethodParameter();
imp.loadFromXML (attrib);
@@ -386,7 +386,7 @@
* A utility function to create a new index
* from attrib and add it to this table.
*/
- public Index addIndex(Attributes attrib)
+ public Index addIndex(AttributeList attrib)
{
Index index = new Index();
index.loadFromXML (attrib);
@@ -408,7 +408,7 @@
* A utility function to create a new Unique
* from attrib and add it to this table.
*/
- public Unique addUnique(Attributes attrib)
+ public Unique addUnique(AttributeList attrib)
{
Unique unique = new Unique();
unique.loadFromXML (attrib);
1.4 +5 -4
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Unique.java
Index: Unique.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/model/Unique.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Unique.java 16 Feb 2002 19:40:37 -0000 1.3
+++ Unique.java 26 Feb 2002 22:15:43 -0000 1.4
@@ -54,15 +54,16 @@
* <http://www.apache.org/>.
*/
+import org.xml.sax.AttributeList;
+
import java.util.ArrayList;
import java.util.List;
-import org.xml.sax.Attributes;
/**
* A Class for information about unique indices of a table
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Unique.java,v 1.3 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: Unique.java,v 1.4 2002/02/26 22:15:43 fedor Exp $
* @deprecated use turbine-torque
*/
public class Unique
@@ -114,7 +115,7 @@
/**
* adds a new column to an index
*/
- public void addColumn(Attributes attrib)
+ public void addColumn(AttributeList attrib)
{
indexColumns.add(attrib.getValue("name"));
}
@@ -168,7 +169,7 @@
/**
* Imports a column from an XML specification
*/
- public void loadFromXML (Attributes attrib)
+ public void loadFromXML (AttributeList attrib)
{
indexName = attrib.getValue("name");
}
1.4 +16 -33
jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/transform/XmlToAppData.java
Index: XmlToAppData.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/torque/engine/database/transform/XmlToAppData.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XmlToAppData.java 16 Feb 2002 19:40:37 -0000 1.3
+++ XmlToAppData.java 26 Feb 2002 22:15:44 -0000 1.4
@@ -54,30 +54,15 @@
* <http://www.apache.org/>.
*/
+import org.apache.turbine.services.db.TurbineDB;
+import org.apache.turbine.torque.engine.database.model.*;
+import org.xml.sax.*;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.parsers.SAXParserFactory;
import java.io.BufferedReader;
import java.io.FileReader;
-import java.io.PrintStream;
-import java.io.Reader;
import java.util.List;
-import org.apache.turbine.services.db.TurbineDB;
-import org.apache.turbine.torque.engine.database.model.AppData;
-import org.apache.turbine.torque.engine.database.model.Column;
-import org.apache.turbine.torque.engine.database.model.Database;
-import org.apache.turbine.torque.engine.database.model.ForeignKey;
-import org.apache.turbine.torque.engine.database.model.IdMethodParameter;
-import org.apache.turbine.torque.engine.database.model.Index;
-import org.apache.turbine.torque.engine.database.model.Inheritance;
-import org.apache.turbine.torque.engine.database.model.Table;
-import org.apache.turbine.torque.engine.database.model.Unique;
-import org.apache.xerces.parsers.SAXParser;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
/**
* A Class that is used to parse an input
@@ -87,10 +72,10 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Leon Messerschmidt</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
- * @version $Id: XmlToAppData.java,v 1.3 2002/02/16 19:40:37 mpoeschl Exp $
+ * @version $Id: XmlToAppData.java,v 1.4 2002/02/26 22:15:44 fedor Exp $
* @deprecated use turbine-torque
*/
-public class XmlToAppData extends DefaultHandler
+public class XmlToAppData extends DefaultHandler implements DocumentHandler
{
private AppData app;
private Database currDB;
@@ -128,19 +113,14 @@
app = new AppData();
}
- SAXParser parser = new SAXParser();
+ Parser parser =
SAXParserFactory.newInstance().newSAXParser().getParser();
// set the Resolver for the database DTD
DTDResolver dtdResolver = new DTDResolver();
parser.setEntityResolver(dtdResolver);
// We don't use an external content handler - we use this object
- parser.setContentHandler(this);
-
- // Validate the input file
- parser.setFeature
- ("http://apache.org/xml/features/validation/dynamic", true);
- parser.setFeature("http://xml.org/sax/features/validation", true);
+ parser.setDocumentHandler(this);
parser.setErrorHandler(this);
@@ -171,13 +151,16 @@
return app;
}
-
+ public void endElement(String s) throws SAXException
+ {
+ // nothing to do
+ }
/**
* Handles opening elements of the xml file.
*/
- public void startElement(String uri, String localName, String rawName,
- Attributes attributes)
+ public void startElement(String rawName,
+ AttributeList attributes)
{
try
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>