db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r372022 - in /db/torque/generator/trunk/xdocs: index.xml navigation.xml properties-reference.xml schema-reference.xml
Date Tue, 24 Jan 2006 21:13:37 GMT
Author: tfischer
Date: Tue Jan 24 13:13:30 2006
New Revision: 372022

URL: http://svn.apache.org/viewcvs?rev=372022&view=rev
Log:
- written a new index.xml with an introduction and a usage section
- removed the "Torque" from the document titles as it is inserted by maven anyway. 

Added:
    db/torque/generator/trunk/xdocs/index.xml
Modified:
    db/torque/generator/trunk/xdocs/navigation.xml
    db/torque/generator/trunk/xdocs/properties-reference.xml
    db/torque/generator/trunk/xdocs/schema-reference.xml

Added: db/torque/generator/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/index.xml?rev=372022&view=auto
==============================================================================
--- db/torque/generator/trunk/xdocs/index.xml (added)
+++ db/torque/generator/trunk/xdocs/index.xml Tue Jan 24 13:13:30 2006
@@ -0,0 +1,156 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2001-2005 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License")
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<document>
+ <properties>
+  <title>Generator Overview</title>
+  <author email="fischer@seitenbau.de">Thomas Fischer</author>
+ </properties>
+
+ <body>
+  <section name="Introduction">
+    
+    <p>
+      The Torque generator consists of a collection of ant tasks. The core tasks
+      generat java classes and sql scripts from an xml description of
+      the database, but there are other tasks available. See the 
+      <a href="schema-reference.html">Schema Reference</a> for the format of
+      the xml file, and the
+      <a href="tasks-reference.html">Tasks reference</a> for a complete list
+      of available tasks. 
+    </p>
+    
+    <p>
+      The generator can be configured using a properties file, 
+      <code>build.properties</code>. See the 
+      <a href="properties-reference.html">Properties reference</a> for a 
+      list of available properties and their purposes.
+    </p>
+  </section>
+  
+  <section name="Usage">
+    <p>
+      This section will give a short introduction of how to use the 
+      Torque generator using ant. For using the generator with maven, see the
+      <a href="../maven-plugin/index.html">Maven plugin docs</a>.
+    </p>
+    
+    <p>
+      The following is just a suggestion to get you started using the generator.
+      Once you fond out how it is working, feel free to change the suggestion
+      to fit your specific needs.
+    </p>
+  
+    <p>
+      To use the generator, download the tar.gz or zip binary distribution
+      of the Torque generator from the
+      <a href="../../../download.html">Torque download page</a>. Unpack it in
+      the root directory of your project. This will create a directory called
+      <code>torque-gen-3.2</code> in the root directory of your project.
+      You also need to have <a href="http://ant.apache.org">ant</a> 
+      installed and available in your path.
+    </p>
+    
+    <p>
+      Change into the <code>torque-gen-3.2</code> directory and edit the file
+      <code>build.properties</code>. Look through the properties and 
+      modify them to fit your specific set-up.
+      Afterwards, assuming you want to keep your schema
+      files in the <code>src/schema</code> subdirectory of the project
+      root directory, and generate your java
+      classes in the <code>target/java</code> and the sql scripts in the 
+      <code>target/sql</code> subdirectories of the project root directory, add
+      the following properties:
+<source>
+torque.output.dir = ../target
+torque.schema.dir = ../src/schema
+</source>
+    </p>
+    
+    <p>
+      Now create the <code>src/schema</code> subdirectory of your project
+      root directory. Create a schema.xml file describing your database in the
+      newly create directory (for example you might use the 
+      <code>bookstore-schema.xml</code> file from the 
+      <a href="../tutorial/step2.html">Tutorial</a>) for a start. 
+      Note that the names of the schema file(s) needs to end with 
+      <code>schema.xml</code>.
+    </p>
+    
+    <p>
+      If you want to use the id broker (a Torque runtime service which creates
+      primary keys in a database independent manner), also copy the file
+      <code>torque-gen-3.2/src/schema/id-table-schema.xml</code> to the 
+      <code>src/schema</code> subdirectory of your project root.
+    </p>
+
+    <p>
+      Now change into the <code>torque-gen-3.2</code> directory, and type
+      the command
+    </p>
+    
+<source>
+ant -f build.xml
+</source>
+
+    <p>
+      This will create the <code>target/java</code> subdirectory in your
+      project root directory containing the generated java classes,
+      and the <code>target/sql</code> directory containing the generated
+      sql scripts.
+    </p>
+
+    <p>
+      If you want to create your database using torque (this does not work for
+      all databases), you first need to copy the database driver jar 
+      into the <code>torque-gen-3.2/lib</code> directory.
+      Then make sure that the database user you have configured in the 
+      build.properties has sufficient rights to create a database.
+      When everything is ready, type the command
+    </p>
+    
+<source>
+ant -f build.xml create-db
+</source>
+    
+    <p>
+      To create the tables in your database, you also need the database driver 
+      jar in the <code>torque-gen-3.2/lib</code> directory. Type the command
+    </p>
+    
+<source>
+ant -f build.xml insert-sql
+</source>
+    
+    <p>
+      You can repeat the steps above if you have changed your 
+      <code>schema.xml</code>. However, be aware that the insert-sql task drops
+      all table and creates them anew, so all data in the tables is lost.
+    </p>
+    
+    <p>
+      Now you have finished the short course in using the generator.
+      To learn about how to use your generated java classes, you can 
+      either look at the <a href="../runtime/index.html">Torque Runtime Docs</a>
+      or continue with the Tutorial at 
+      <a href="../tutorial/step4.html">Step 4</a>, ignoring all
+      maven-specific parts, especially the bits about a file called
+      <code>project.xml</code>. (As you use ant, you need to set up your own

+      project build tasks.)
+    </p>
+  </section>
+ </body>

Modified: db/torque/generator/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/navigation.xml?rev=372022&r1=372021&r2=372022&view=diff
==============================================================================
--- db/torque/generator/trunk/xdocs/navigation.xml (original)
+++ db/torque/generator/trunk/xdocs/navigation.xml Tue Jan 24 13:13:30 2006
@@ -36,6 +36,7 @@
     <menu name="Documentation">
       <item name="Documentation"         href="../../../documentation/index.html">
         <item name="Torque 3.2 Generator" href="/index.html">
+          <item name="Tasks Reference"   href="/tasks-reference.html"/>
           <item name="Schema Reference"  href="/schema-reference.html"/>
           <item name="Properties Reference" href="/properties-reference.html"/>
           <item name="database.dtd"      href="/database.dtd.txt" target="_blank"/>

Modified: db/torque/generator/trunk/xdocs/properties-reference.xml
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/properties-reference.xml?rev=372022&r1=372021&r2=372022&view=diff
==============================================================================
--- db/torque/generator/trunk/xdocs/properties-reference.xml (original)
+++ db/torque/generator/trunk/xdocs/properties-reference.xml Tue Jan 24 13:13:30 2006
@@ -17,7 +17,7 @@
 
 <document>
   <properties>
-    <title>Torque - Properties Reference</title>
+    <title>Properties Reference</title>
     <author email="stephenh@chase3000.com">Stephen Haberman</author>
     <author email="hps@intermeta.de">Henning P. Schmiedehausen</author>
   </properties>

Modified: db/torque/generator/trunk/xdocs/schema-reference.xml
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/schema-reference.xml?rev=372022&r1=372021&r2=372022&view=diff
==============================================================================
--- db/torque/generator/trunk/xdocs/schema-reference.xml (original)
+++ db/torque/generator/trunk/xdocs/schema-reference.xml Tue Jan 24 13:13:30 2006
@@ -18,7 +18,7 @@
 <document>
 
  <properties>
-  <title>Torque Schema Reference</title>
+  <title>Schema Reference</title>
   <author email="warner@warneronstine.com">Warner Onstine</author>
   <author email="jvanzyl@apache.org">Jason van Zyl</author>
   <author email="ville.skytta@iki.fi">Ville Skyttä</author>



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message