You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/10/27 21:11:11 UTC
cvs commit: jakarta-turbine-torque/src/schema id-table-schema.xml
jvanzyl 01/10/27 12:11:11
Modified: . build.xml
examples project-schema.xml
src/conf build.xml
src/dtd database.dtd
src/schema id-table-schema.xml
Log:
- build.xml: cleanup, adding a hook for tests
- examples/project-schema.xml: remove the multiple database entries
and the outer <app-data> wrapper. only one <database> entry per
datamodel descriptor now which allows the easy handling and maintenance
of multiple databases.
- src/conf/build.xml: cleanups, placed each <taskdef> in each of
the individual tasks so that if you use a single task you're not
loading all the tasks as it's a waste of time.
- src/dtd/database.dtd: remove the <app-data> top element as we
are now only allowing a single <database> element in each datamodel
descriptor.
- src/schema/id-table-schema.xml: fix the reference to the dtd
that can be found on the web. jakarta.apache.org and not
java.apache.org.
Revision Changes Path
1.20 +9 -0 jakarta-turbine-torque/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/build.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- build.xml 2001/10/15 05:54:57 1.19
+++ build.xml 2001/10/27 19:11:11 1.20
@@ -48,6 +48,15 @@
</target>
<!-- ================================================================== -->
+ <!-- T E S T -->
+ <!-- ================================================================== -->
+
+ <target
+ name="test">
+ <ant antfile="build-test.xml"/>
+ </target>
+
+ <!-- ================================================================== -->
<!-- I N I T -->
<!-- ================================================================== -->
1.2 +2 -34 jakarta-turbine-torque/examples/project-schema.xml
Index: project-schema.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/examples/project-schema.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project-schema.xml 2001/08/02 05:08:15 1.1
+++ project-schema.xml 2001/10/27 19:11:11 1.2
@@ -3,44 +3,14 @@
<!-- ==================================================================== -->
<!-- -->
-<!-- E X A M P L E T O R Q U E S C H E M A -->
+<!-- E X A M P L E T O R Q U E S C H E M A -->
<!-- -->
<!-- ==================================================================== -->
-<app-data>
-
<!--
- Note: the name= attribute in the database tag represents what
- you would use to map to a specific database named in the
- Torque.properties file. If you just want to use
- the defaults, please do not specify a name= attribute.
-
- The benefit is that you can have one database talking to
- one system and another talking to an entirely different
- system.
-
- Example:
- database.INTERPLANETARY.driver=org.postgresql.Driver
- database.INTERPLANETARY.url=jdbc:postgresql:test
- database.INTERPLANETARY.username=graeme
- database.INTERPLANETARY.password=password
-
- database.SIMPLE.driver=org.postgresql.Driver
- database.SIMPLE.url=jdbc:postgresql:foo
- database.SIMPLE.username=foo
- database.SIMPLE.password=bar
+ Note: You must now specify a database name.
-->
-<database name="SIMPLE">
- <table name="SIMPLE">
- <column name="ROWID" required="true" autoIncrement="true"
- primaryKey="true" type="INTEGER"/>
- <column name="NAME" required="true" size="255" type="VARCHAR"/>
- <column name="SPECIES" type="INTEGER" default="-2"/>
- <column name="PLANET" type="INTEGER" default="-1"/>
- </table>
-</database>
-
<database name="INTERPLANETARY">
<table name="CIVILIZATION">
<column name="CIV_ID" required="true" autoIncrement="true"
@@ -69,5 +39,3 @@
<column name="PLANET" type="INTEGER" default="-1"/>
</table>
</database>
-
-</app-data>
1.7 +109 -104 jakarta-turbine-torque/src/conf/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/conf/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 2001/08/30 17:38:28 1.6
+++ build.xml 2001/10/27 19:11:11 1.7
@@ -16,8 +16,8 @@
</path>
<!--
- Load the build.properties file. All the targets use the
- information stored in the properties file.
+ Load the build.properties file. All the targets use the
+ information stored in the properties file.
-->
<property name="build.properties" value="build.properties"/>
@@ -32,77 +32,38 @@
<!-- when you change your XML schema. -->
<!-- ================================================================ -->
- <target name="main" description="==> generates sql + om classes">
+ <target
+ name="main"
+ description="==> generates sql + om classes">
+
<antcall target="project-sql"/>
<antcall target="project-om"/>
</target>
- <target name="main-classpath" description="==> generates sql + om classes">
+ <target
+ name="main-classpath"
+ description="==> generates sql + om classes">
+
<antcall target="project-sql-classpath"/>
<antcall target="project-om-classpath"/>
</target>
<!-- ================================================================ -->
- <!-- I N I T T A S K T A R G E T -->
- <!-- ================================================================ -->
- <!-- Taskdefs are defined inside this target as Ant seems to have -->
- <!-- problems defining them at the top level. -->
+ <!-- J D B C TO X M L -->
<!-- ================================================================ -->
-
- <target name="init-tasks">
-
- <taskdef name="torque-datasql"
- classname="org.apache.torque.task.TorqueDataSQLTask">
- <classpath refid="classpath"/>
- </taskdef>
- <taskdef name="torque-datadump"
- classname="org.apache.torque.task.TorqueDataDumpTask">
- <classpath refid="classpath"/>
- </taskdef>
+ <target
+ name="project-jdbc"
+ description="==> jbbc to xml">
- <taskdef name="torque-datadtd"
- classname="org.apache.torque.task.TorqueDataDTDTask">
- <classpath refid="classpath"/>
- </taskdef>
-
- <taskdef name="torque-sql"
- classname="org.apache.torque.task.TorqueSQLTask">
- <classpath refid="classpath"/>
- </taskdef>
-
- <taskdef name="torque-om"
- classname="org.apache.torque.task.TorqueObjectModelTask">
- <classpath refid="classpath"/>
- </taskdef>
-
- <taskdef name="sql-xml"
- classname="org.apache.torque.task.TorqueSQLTransformTask">
- <classpath refid="classpath"/>
- </taskdef>
-
- <taskdef name="texen"
- classname="org.apache.velocity.texen.ant.TexenTask">
- <classpath refid="classpath"/>
- </taskdef>
+ <echo message="JDBC transform"/>
- <taskdef name="torque-jdbc"
+ <taskdef
+ name="torque-jdbc"
classname="org.apache.torque.task.TorqueJDBCTransformTask">
<classpath refid="classpath"/>
</taskdef>
- </target>
-
-
- <!-- ================================================================ -->
- <!-- J D B C TO X M L -->
- <!-- ================================================================ -->
-
- <target name="project-jdbc" depends="init-tasks"
- description="==> jbbc to xml">
-
- <echo message="JDBC transform"/>
-
<torque-jdbc
dbUrl="${databaseUrl}"
dbDriver="${databaseDriver}"
@@ -118,8 +79,9 @@
<!-- Generate SQL from XML data file -->
<!-- ================================================================ -->
- <target name="project-datasql" depends="init-tasks"
- description="==> generates sql from data xml">
+ <target
+ name="project-datasql"
+ description="==> generates sql from data xml">
<echo message="+-----------------------------------------------+"/>
<echo message="| |"/>
@@ -129,6 +91,12 @@
<echo message="+-----------------------------------------------+"/>
<echo message=" taking build.properties from: ${build.properties}"/>
+ <taskdef
+ name="torque-datasql"
+ classname="org.apache.torque.task.TorqueDataSQLTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-datasql
contextProperties="${build.properties}"
controlTemplate="${DataSQLControlTemplate}"
@@ -148,8 +116,9 @@
<!-- Dump data from database into xml file -->
<!-- ================================================================ -->
- <target name="project-datadump" depends="init-tasks"
- description="==> dump data from database into xml file">
+ <target
+ name="project-datadump"
+ description="==> dump data from database into xml file">
<echo message="+-----------------------------------------------+"/>
<echo message="| |"/>
@@ -159,6 +128,12 @@
<echo message="+-----------------------------------------------+"/>
<echo message=" taking build.properties from: ${build.properties}"/>
+ <taskdef
+ name="torque-datadump"
+ classname="org.apache.torque.task.TorqueDataDumpTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-datadump
contextProperties="${build.properties}"
controlTemplate="${DataDumpControlTemplate}"
@@ -181,8 +156,9 @@
<!-- Generate the DATA DTD for your project -->
<!-- ================================================================ -->
- <target name="project-datadtd" depends="init-tasks"
- description="==> generates the DATA DTD for your project">
+ <target
+ name="project-datadtd"
+ description="==> generates the DATA DTD for your project">
<echo message="+-----------------------------------------------+"/>
<echo message="| |"/>
@@ -191,6 +167,12 @@
<echo message="| |"/>
<echo message="+-----------------------------------------------+"/>
+ <taskdef
+ name="torque-datadtd"
+ classname="org.apache.torque.task.TorqueDataDTDTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-datadtd
contextProperties="${build.properties}"
controlTemplate="${DataDTDControlTemplate}"
@@ -211,8 +193,9 @@
<!-- project should be specified in project-schema.xml. -->
<!-- ================================================================ -->
- <target name="project-sql" depends="init-tasks"
- description="==> generates the SQL for your project">
+ <target
+ name="project-sql"
+ description="==> generates the SQL for your project">
<echo message="+------------------------------------------+"/>
<echo message="| |"/>
@@ -221,6 +204,12 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
+ <taskdef
+ name="torque-sql"
+ classname="org.apache.torque.task.TorqueSQLTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-sql
contextProperties="${build.properties}"
controlTemplate="${SQLControlTemplate}"
@@ -241,8 +230,9 @@
<!-- ================================================================ -->
- <target name="project-om" depends="init-tasks"
- description="==> generates the Peer-based object model for your project">
+ <target
+ name="project-om"
+ description="==> generates the Peer-based object model for your project">
<echo message="+------------------------------------------+"/>
<echo message="| |"/>
@@ -251,6 +241,12 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
+ <taskdef
+ name="torque-om"
+ classname="org.apache.torque.task.TorqueObjectModelTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-om
contextProperties="${build.properties}"
controlTemplate="${OMControlTemplate}"
@@ -259,7 +255,6 @@
outputFile="report.${project}.om.generation"
targetPackage="${targetPackage}.om"
xmlFile="${torque.home}/${schemaDirectory}/${project}-schema.xml"
- targetDatabase="${database}"
/>
</target>
@@ -272,7 +267,8 @@
<!-- project should be specified in project-schema.xml. -->
<!-- ================================================================ -->
- <target name="project-sql-classpath" depends="init-tasks">
+ <target
+ name="project-sql-classpath">
<echo message="+------------------------------------------+"/>
<echo message="| |"/>
@@ -281,6 +277,12 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
+ <taskdef
+ name="torque-sql"
+ classname="org.apache.torque.task.TorqueSQLTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-sql
contextProperties="${build.properties}"
controlTemplate="${SQLControlTemplate}"
@@ -300,7 +302,8 @@
<!-- These are in addition to the base Turbine OM! -->
<!-- ================================================================ -->
- <target name="project-om-classpath" depends="init-tasks">
+ <target
+ name="project-om-classpath">
<echo message="+------------------------------------------+"/>
<echo message="| |"/>
@@ -309,6 +312,12 @@
<echo message="| |"/>
<echo message="+------------------------------------------+"/>
+ <taskdef
+ name="torque-om"
+ classname="org.apache.torque.task.TorqueObjectModelTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<torque-om
contextProperties="${build.properties}"
controlTemplate="${OMControlTemplate}"
@@ -325,7 +334,10 @@
<!-- =================================================================== -->
<!-- C O M P I L E O M -->
<!-- =================================================================== -->
- <target name="compile" description="==> compiles the OM classes">
+
+ <target
+ name="compile"
+ description="==> compiles the OM classes">
<!--
This should be moved to the top of the file, and
@@ -345,41 +357,30 @@
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
-
<classpath refid="classpath"/>
-
</javac>
</target>
-
-
- <!-- ================================================================ -->
- <!-- G E N E R A T E T U R B I N E S E R V I C E -->
- <!-- ================================================================ -->
- <!-- Generate turbine service code. -->
- <!-- ================================================================ -->
-
- <target name="turbine-service" depends="init-tasks">
-
- <texen
- contextProperties="service.props"
- controlTemplate="${ServiceControlTemplate}"
- outputDirectory="${outputDirectory}"
- templatePath="${templatePath}"
- outputFile="report.${project}.service.generation"
- />
-
- </target>
<!-- =================================================================== -->
+ <!-- S Q L T O X M L -->
+ <!-- =================================================================== -->
<!-- Create an xml schema from an sql schema. -->
<!-- -->
<!-- inputFile: The input sql file. This must be valid sql file but -->
<!-- it not not be in any specific format. -->
<!-- outputFile: The file where the xml schema will be written -->
<!-- =================================================================== -->
+
+ <target
+ name="project-sql2xml"
+ description="==> creates an xml schema from an sql schema">
- <target name="sql2xml" depends="init-tasks"
- description="==> creates an xml schema from an sql schema">
+ <taskdef
+ name="sql-xml"
+ classname="org.apache.torque.task.TorqueSQLTransformTask">
+ <classpath refid="classpath"/>
+ </taskdef>
+
<sql-xml
inputFile="schema/schema.sql"
outputFile="schema/schema.xml"
@@ -387,19 +388,23 @@
</target>
<!-- ================================================================== -->
- <!-- Creates the API documentation -->
+ <!-- J A V A D O C -->
<!-- ================================================================== -->
- <target name="javadocs"
- description="==> generates the API documentation">
+
+ <target
+ name="javadocs"
+ description="==> generates the API documentation">
+
<mkdir dir="${torque.home}/${outputDirectory}/javadoc"/>
- <javadoc sourcepath="${torque.home}/${outputDirectory}"
- packagenames="${targetPackage}.*"
- destdir="${outputDirectory}/javadoc"
- author="true"
- private="true"
- version="true"
- use="true"
- >
+
+ <javadoc
+ sourcepath="${torque.home}/${outputDirectory}"
+ packagenames="${targetPackage}.*"
+ destdir="${outputDirectory}/javadoc"
+ author="true"
+ private="true"
+ version="true"
+ use="true">
<classpath refid="classpath"/>
</javadoc>
</target>
1.5 +1 -3 jakarta-turbine-torque/src/dtd/database.dtd
Index: database.dtd
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/dtd/database.dtd,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- database.dtd 2001/10/22 22:28:18 1.4
+++ database.dtd 2001/10/27 19:11:11 1.5
@@ -1,9 +1,7 @@
<!--
Torque XML database schema DTD
- $Id: database.dtd,v 1.4 2001/10/22 22:28:18 dlr Exp $
+ $Id: database.dtd,v 1.5 2001/10/27 19:11:11 jvanzyl Exp $
-->
-
-<!ELEMENT app-data (database+)>
<!--
For: database.defaultIdMethod and table.idMethod
1.2 +2 -2 jakarta-turbine-torque/src/schema/id-table-schema.xml
Index: id-table-schema.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/schema/id-table-schema.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- id-table-schema.xml 2001/08/31 07:07:50 1.1
+++ id-table-schema.xml 2001/10/27 19:11:11 1.2
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!-- <!DOCTYPE database SYSTEM
-"http://java.apache.org/turbine/dtd/database.dtd"> -->
+"http://jakarta.apache.org/turbine/dtd/database.dtd"> -->
<!-- ==================================================================== -->
<!-- -->
@@ -11,7 +11,7 @@
<!-- ID_TABLE table used by the id broker mechanism in Turbine. -->
<!-- ==================================================================== -->
<!-- @author: <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a> -->
-<!-- @version $Id: id-table-schema.xml,v 1.1 2001/08/31 07:07:50 jvanzyl Exp $ -->
+<!-- @version $Id: id-table-schema.xml,v 1.2 2001/10/27 19:11:11 jvanzyl Exp $ -->
<!-- ==================================================================== -->
<database>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org