db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Atkins" <Brent.Atk...@Pro-Sys.biz>
Subject RE: Using Torque's project-schema.xml to generate other files
Date Wed, 11 Feb 2004 20:32:36 GMT
Hey Siegfried,

Thanks for your answer.

You mentioned that there is a Templates directory.  I never had seem it before, but your post
me look at it a bit closer and I saw that torque-gen.jar has the templates.  The standard
however doesn't have the templates...

This really where my confusion started.

I can understand how Torque-gen.jar could create the source from the schema and the templates,
there is apparently some other mechanism for making those files in Torque.jar.  Which makes
question my understanding how Torque-gen.jar actually works.  So I guess a good question is,
what is
different and should I care?

Any ideas?

You are right about setting up maven to generate Torque's docs in xdoc format for inclusion
your Maven site.  In case you were curious, the properties to set (in project.properties)

# Settings to generate torque docs in xdoc format
# and place in xdoc directory for inclusion in
# Maven site:generate goal

torque.doc.format = anakia
torque.doc.dir = xdocs/database

Then all you have to do is create a xdocs/navigation.xml with code like this...

<?xml version="1.0" encoding="ISO-8859-1" ?>
<project name="ProjectName" href="www.foobar.com">
  <title>Project Name</title>

// You can do it as a top bar link
      <item name="Torque Docs" href="database/project-schema.html" />

// Or put it in the side menu if you'd like with
    <menu name="Torque">
      <item name="Torque Docs" href="database/project-schema.html" />

Just run [maven torque:doc] and [maven site:generate] and you are good to go.

Since I already have the normal documentation setup, I'm more excited about setting up templates
where web developers can see documentation about the Struts implementation.   Which, I would
imagine, will require a new velocity template.

-----Original Message-----
From: Göschl,Siegfried [mailto:Siegfried.Goeschl@drei.com]
Sent: Wednesday, February 11, 2004 3:06 PM
To: Apache Torque Users List
Subject: RE: Using Torque's project-schema.xml to generate other files

Well, I'm not qualified but I give it a try ...

+) Some Java code in Torque does the JDBC magic to generate the schema.xml (done with the

+) The 'om' target for Torque parses the schema.xml and uses Velocity to render those Java
(found in the Velocity context) with the given Velocity templates (found in templates\om)
to Java
source files. The beauty of Velocity is the usage of reflection to invoke methods on Java
objects on
the fly ... :-)

+) The other targets using similar templates, e.g. 'ojb' generates the bare-bone Java files

+) Mentioning xdocs - using the ANAKIA templates you could generate XDOC to be transformed
to HTML.
I don't know if there is a setting to automate this?!


Siegfried Goeschl

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

View raw message