You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by "Scoz, Eduardo" <es...@cti.depaul.edu> on 2004/10/27 20:20:18 UTC

help with torque generator

Hi everybody,

 

I'm currently working on a large application project that will extend
one existing system that uses OJB. One of our main problems now is that
we can't use the xdoclet plugin anymore on the classes. We now have to
use a secondary XML file that is somewhat similar to the
project_schema.xml file.

 

As I don't have that much experience with Torque, I would like to add a
few questions. 

 

>From the torque.jar file, it's possible to see that the generator uses
vm files to create the external documents. What exact format are those
vm files in? Is there any documentation on how I can extend, or create a
new vm file?

 

Is there anyway to have those vm files outside the torque package? I
tried copying some of the files to my project, so that I can then change
them, and I changed the torque-build.xml file, but I couldn't get it to
work (Resource not found - control.vm file).

 

Thanks a lot, guys!

 

I know this is not the dev list, but probably the developers check this
list, so congratulations to all you, for the great project!

 

 

Eduardo Scoz

DePaul University

Chicago, IL

 

 


Re: help with torque generator

Posted by Emmanuel Florent <ef...@devaki.org>.
I already modified those terrific vm templates to generate PHP-OO code.
Bogdan have pushed up  a torque-app looking like Phpmyadmin and others
but on top of Torque and on the basis of your tables.
I think a repository for Torque and Velocity template would be a nice
project...
you can find some code sample and an IDE for extending Torque's
templates at http://www.devaki.org/nextobjects/

Regards.

EF

Le jeu 28/10/2004 à 13:07, T E Schmitz a écrit :
> Hello Eduardo,
> 
> > From the torque.jar file, it's possible to see that the generator uses
> > vm files to create the external documents. What exact format are those
> > vm files in? Is there any documentation on how I can extend, or create a
> > new vm file?
> 
> They are Velocity files (http://jakarta.apache.org/velocity)
> Yes, you can add more vm templates to your project.
> 
> What makes life easier when editing the Velocity/Java jumble: I use an 
> editor (on the PC) called UltraEdit, for which I have a code colouring 
> for Velocity files.
> 
> > Is there anyway to have those vm files outside the torque package? I
> > tried copying some of the files to my project, so that I can then change
> > them, and I changed the torque-build.xml file, but I couldn't get it to
> > work (Resource not found - control.vm file).
> 
> Yes, I've done it. You have to change the torque-build.xml. You also 
> have to understand how the Torque people used Control.vm: this is the 
> template from which the generation of the actual code is controlled. 
> Control.vm, as it is, expects the other vm files to be in the same 
> directory.
> The other thing you have to be aware of is that the schema.xml file is 
> expected in a certain location (generator\schema); in my Ant build I 
> copy my schema file from the project directory to this Torque directory.
> 
> You could also make the Torque generator directory tree part of your 
> project.
> 
> I am generating a whole lot of additional code based on the schema file. 
> I found it was really worth my while understanding the Velocity templates.


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


Re: help with torque generator

Posted by T E Schmitz <ma...@numerixtechnology.de>.
Hello Eduardo,

> From the torque.jar file, it's possible to see that the generator uses
> vm files to create the external documents. What exact format are those
> vm files in? Is there any documentation on how I can extend, or create a
> new vm file?

They are Velocity files (http://jakarta.apache.org/velocity)
Yes, you can add more vm templates to your project.

What makes life easier when editing the Velocity/Java jumble: I use an 
editor (on the PC) called UltraEdit, for which I have a code colouring 
for Velocity files.

> Is there anyway to have those vm files outside the torque package? I
> tried copying some of the files to my project, so that I can then change
> them, and I changed the torque-build.xml file, but I couldn't get it to
> work (Resource not found - control.vm file).

Yes, I've done it. You have to change the torque-build.xml. You also 
have to understand how the Torque people used Control.vm: this is the 
template from which the generation of the actual code is controlled. 
Control.vm, as it is, expects the other vm files to be in the same 
directory.
The other thing you have to be aware of is that the schema.xml file is 
expected in a certain location (generator\schema); in my Ant build I 
copy my schema file from the project directory to this Torque directory.

You could also make the Torque generator directory tree part of your 
project.

I am generating a whole lot of additional code based on the schema file. 
I found it was really worth my while understanding the Velocity templates.

-- 


Regards/Gruß,

Tarlika Elisabeth Schmitz

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


Re: help with torque generator

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Scoz, Eduardo" <es...@cti.depaul.edu> writes:

>>From the torque.jar file, it's possible to see that the generator uses
>vm files to create the external documents. What exact format are those
>vm files in? Is there any documentation on how I can extend, or create a
>new vm file?

Yes, this is possible. The .vm files are _in_ the torque-gen.jar. If
you want to change or expand these, best would be to get the torque
source (the files are in src/generator/src/templates/) and rebuilt the
jar.

>Is there anyway to have those vm files outside the torque package? I
>tried copying some of the files to my project, so that I can then change
>them, and I changed the torque-build.xml file, but I couldn't get it to
>work (Resource not found - control.vm file).

It should be possible. There are settings for the ant-tasks to load
the templates from a directory and not from the classpath. Sorry,
can't recall on the spot which these are.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

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