Revision: 3133
Author: [email protected]
Date: Fri Jul 31 14:54:37 2009
Log: Make standard Velocity tools available for running Velocity
transformations, because Velocity users will most likely expect them to be
present.
http://code.google.com/p/power-architect/source/detail?r=3133
Added:
/trunk/lib/velocity-tools-generic-1.4.jar
Modified:
/trunk/src/ca/sqlpower/architect/transformation/VelocityTransformation.java
=======================================
--- /dev/null
+++ /trunk/lib/velocity-tools-generic-1.4.jar Fri Jul 31 14:54:37 2009
Binary file, no diff available.
=======================================
---
/trunk/src/ca/sqlpower/architect/transformation/VelocityTransformation.java
Mon Jul 20 08:16:16 2009
+++
/trunk/src/ca/sqlpower/architect/transformation/VelocityTransformation.java
Fri Jul 31 14:54:37 2009
@@ -30,6 +30,11 @@
import org.apache.velocity.app.VelocityEngine;
import ca.sqlpower.architect.swingui.ArchitectSwingSession;
+import ca.sqlpower.sqlobject.SQLType;
+import org.apache.velocity.tools.generic.AlternatorTool;
+import org.apache.velocity.tools.generic.DateTool;
+import org.apache.velocity.tools.generic.NumberTool;
+import org.apache.velocity.tools.generic.SortTool;
/**
*
@@ -63,7 +68,12 @@
VelocityContext context = new VelocityContext();
context.put("tables", session.getPlayPen().getTables());
context.put("projectName", session.getName());
-
+ context.put("sorter", new SortTool());
+ context.put("dateTool", new DateTool());
+ context.put("numberTool", new NumberTool());
+ context.put("alternator", new AlternatorTool());
+ context.put("sqlTypes", SQLType.class);
+
FileOutputStream out = new FileOutputStream(result);
OutputStreamWriter writer = new OutputStreamWriter(out,
"UTF-8");
try {