Hey Siegfried,
Thanks for your answer.
You mentioned that there is a Templates directory. I never had seem it before, but
your post made
me look at it a bit closer and I saw that torque-gen.jar has the templates. The
standard Torque.jar
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, but
there is apparently some other mechanism for making those files in Torque.jar. Which
makes me
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 into
your Maven site. In case you were curious, the properties to set (in
project.properties) are...
# 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>
<body>
// You can do it as a top bar link
<links>
<item name="Torque Docs" href="database/project-schema.html" />
</links>
// Or put it in the side menu if you'd like with
<menu name="Torque">
<item name="Torque Docs" href="database/project-schema.html" />
</menu>
</body>
</project>
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:[EMAIL PROTECTED]
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 'jdbc'
target)
+) The 'om' target for Torque parses the schema.xml and uses Velocity to render those
Java objects
(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 for
ObjectBridge
+) 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?!
Cheers,
Siegfried Goeschl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]