dlr 01/08/20 18:51:23
Modified: src/java/org/apache/torque/task TorqueSQLTask.java
Log:
Since we do nothing more than populate the context (i.e. we don't
create a special type of context), let's add to the TexenTask method
which is meant for doing just that.
Revision Changes Path
1.3 +12 -14
jakarta-turbine-torque/src/java/org/apache/torque/task/TorqueSQLTask.java
Index: TorqueSQLTask.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/task/TorqueSQLTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -u -r1.2 -r1.3
--- TorqueSQLTask.java 2001/08/10 12:23:03 1.2
+++ TorqueSQLTask.java 2001/08/21 01:51:23 1.3
@@ -56,7 +56,6 @@
import java.util.Date;
import org.apache.velocity.context.Context;
-import org.apache.velocity.VelocityContext;
import org.apache.velocity.texen.ant.TexenTask;
import org.apache.torque.engine.database.model.AppData;
import org.apache.torque.engine.database.transform.XmlToAppData;
@@ -67,7 +66,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]>John McNally</a>
- * @version $Id: TorqueSQLTask.java,v 1.2 2001/08/10 12:23:03 knielsen Exp $
+ * @version $Id: TorqueSQLTask.java,v 1.3 2001/08/21 01:51:23 dlr Exp $
*/
public class TorqueSQLTask
extends TexenTask
@@ -135,15 +134,19 @@
}
/**
- * Set up the initialial context for generating the
- * SQL from the XML schema.
+ * Populates the initialial context with the model used to
+ * generate SQL from a XML schema.
+ *
+ * @param context The initial context, ripe for population.
+ * @exception Exception None expected.
*/
- public Context initControlContext()
+ protected void populateInitialContext(Context context)
+ throws Exception
{
- /*
- * Create a new Velocity context.
- */
- Context context = new VelocityContext();
+ // Adds $now.
+ super.populateInitialContext(context);
+
+ // Torque could be initialized here.
/*
* Transform the XML database schema into an
@@ -161,10 +164,5 @@
* Place the target database in the context.
*/
context.put("targetDatabase", targetDatabase);
-
- return context;
}
}
-
-
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]