I'm trying to run torquer from another app.
(It's generating xml and properties file neccessary for Torque from 
drawing Entity Relational Models.
You can visit http://www.devaki.org if you are interrested in my 
project)
I start Torque from this app.
It worked with Torque 3.0 beta 2:

             TorqueSQLTask torqueSQLTask=new TorqueSQLTask();
             Project p=new Project();

            torqueSQLTask.setProject(p);
            torqueSQLTask.setBasePathToDbProps(torqueHome + 
"/templates/sql/base/");

            torqueSQLTask.setContextProperties(new File(torqueHome + 
File.separator + "build.properties"));
            torqueSQLTask.setTemplatePath(new 
File(torqueHome+File.separator+"templates"));
            torqueSQLTask.setControlTemplate("sql/base/Control.vm");
            torqueSQLTask.setTargetPackage(prefs.getPackageName());
            torqueSQLTask.setOutputDirectory(new 
File(torqueHome+File.separator+"src"+File.separator+"sql"));
            
torqueSQLTask.setOutputFile(prefs.getDatabaseName()+"-schema.sql");
            String str=torqueHome + File.separator + "schema" + 
File.separator+ prefs.getDatabaseName() + "-schema.xml";
            torqueSQLTask.setTargetDatabase(prefs.getDatabaseType());
            torqueSQLTask.setXmlFile(str);
             try {
               torqueSQLTask.initControlContext();
               torqueSQLTask.execute();
               torqueSQLTask.getDataModels().clear();
             } catch (Exception e) {
               System.out.println("exception TorqueSQLTask.execute() : 
" + e);
             }

But it work only one time,
On the second time I get error and in the velocity log :
[error] Method parse threw exception for reference $generator in 
template sql/base/Control.vm at  [17,7]
It seems that project-schema.sql is write protected and it work if I 
change the name of project each time .
Do you have a clue ?


Emmanuel Florent




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to