jvanzyl 01/10/21 14:46:20
Modified: src/tdk/task/org/apache/tdk/transformer
SourceTransformer.java transformations.xml
Log:
- adding more transformations to the migration process. oh boy.
Revision Changes Path
1.2 +44 -5
jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/transformer/SourceTransformer.java
Index: SourceTransformer.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/transformer/SourceTransformer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SourceTransformer.java 2001/10/21 01:15:07 1.1
+++ SourceTransformer.java 2001/10/21 21:46:20 1.2
@@ -67,7 +67,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
*
- * @version $Id: SourceTransformer.java,v 1.1 2001/10/21 01:15:07 jvanzyl Exp $
+ * @version $Id: SourceTransformer.java,v 1.2 2001/10/21 21:46:20 jvanzyl Exp $
*/
public class SourceTransformer
extends Task
@@ -94,40 +94,79 @@
protected Transformations transformations;
/**
- * File to operate on, may be a directory.
+ * Directory of source files that need to be
+ * transformed.
*/
private File srcDir;
+
+ /**
+ * Directory to place the resultant transformed
+ * sources.
+ */
private File targetDir;
+
+ /**
+ * Transformation descriptor. A series of targets
+ * and results.
+ */
private File descriptor;
+ /**
+ * Set the source directory.
+ *
+ * @param File source directory
+ */
public void setSrcDir(File srcDir)
{
this.srcDir = srcDir;
}
+ /**
+ * Get source directory.
+ *
+ * @return File source directory
+ */
public File getSrcDir()
{
return srcDir;
}
+ /**
+ * Set the target directory.
+ *
+ * @param File target directory
+ */
public void setTargetDir(File targetDir)
{
this.targetDir = targetDir;
}
+ /**
+ * Get source directory.
+ *
+ * @return File target directory
+ */
public File getTargetDir()
{
return targetDir;
}
+ /**
+ * Set the transformation descriptor.
+ *
+ * @param File transformation descriptor
+ */
public void setDescriptor(File descriptor)
{
this.descriptor = descriptor;
}
/**
- * Iterate through the set of find/replace regexes
- * that will convert a given source tree from one
+ * Iterator through a set of transformations, applying
+ * the transformation to each source file in the
+ * source directory.
+ *
+ * @throws BuildException
*/
public void execute()
throws BuildException
@@ -208,7 +247,7 @@
* @param String source file to migrate.
* @return String migrated source file.
*/
- public String convertSourceFile(String sourceFile)
+ private String convertSourceFile(String sourceFile)
{
originalSourceFile = StringUtils.fileContentsToString(sourceFile);
perl = new Perl5Util();
1.3 +88 -1
jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/transformer/transformations.xml
Index: transformations.xml
===================================================================
RCS file:
/home/cvs/jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/transformer/transformations.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- transformations.xml 2001/10/21 15:27:10 1.2
+++ transformations.xml 2001/10/21 21:46:20 1.3
@@ -1,5 +1,10 @@
<transformations>
+ <description>
+ These transformations provide a path of migration from
+ Turbine 2.1 to Turbine 3.x.
+ </description>
+
<!-- Classes that have been made a part of the Turbine
interface for now. -->
@@ -90,11 +95,93 @@
<result>import org.apache.commons.util.StringUtils</result>
</transformation>
+ <transformation>
+ <target>import org.apache.turbine.util.ContentURI</target>
+ <result>import org.apache.turbine.tool.ContentURI</result>
+ </transformation>
+
+ <!-- Commons Mail Separation -->
+
+ <!-- Take care of all the imports for the separated mail package -->
+ <transformation>
+ <target>import org.apache.turbine.util.mail</target>
+ <result>import org.apache.commons.mail</result>
+ </transformation>
+
+ <!-- Fulcrum Separation -->
+
+ <!-- Take care of all imports for the separated parser package -->
+ <transformation>
+ <target>import org.apache.turbine.util.parser</target>
+ <result>import org.apache.fulcrum.util.parser</result>
+ </transformation>
+
+ <!-- Take care of all imports for the separated pool package -->
+ <transformation>
+ <target>import org.apache.turbine.util.pool</target>
+ <result>import org.apache.fulcrum.pool</result>
+ </transformation>
+
+ <!-- Take care of all imports for the separated security package -->
+ <transformation>
+ <target>import org.apache.turbine.util.security</target>
+ <result>import org.apache.fulcrum.security.util</result>
+ </transformation>
+
+ <!-- Conversion of util.velocity package -->
+ <transformation>
+ <target>import org.apache.turbine.util.velocity.VelocityEmail</target>
+ <result>import org.apache.fulcrum.template.mail.TemplateEmail</result>
+ </transformation>
+
+ <!-- Need to change the class name in source files as well -->
+ <transformation>
+ <target>VelocityEmail</target>
+ <result>TemplateEmail</result>
+ </transformation>
+
+ <transformation>
+ <target>import org.apache.turbine.util.velocity.VelocityHtmlEmail</target>
+ <result>import org.apache.fulcrum.template.mail.TemplateHtmlEmail</result>
+ </transformation>
+
+ <!-- Need to change the class name in source files as well -->
+ <transformation>
+ <target>VelocityHtmlEmail</target>
+ <result>TemplateHtmlEmail</result>
+ </transformation>
+
+ <transformation>
+ <target>import org.apache.turbine.util.velocity.VelocityAction</target>
+ <result>import org.apache.turbine.TemplateAction</result>
+ </transformation>
+
+ <!-- Need to change the class name in source files as well -->
+ <transformation>
+ <target>VelocityActionEvent</target>
+ <result>TemplateAction</result>
+ </transformation>
+
+ <!-- util.template package needs some work -->
+
+ <transformation>
+ <target>import org.apache.turbine.util.upload</target>
+ <result>import org.apache.fulcrum.upload</result>
+ </transformation>
+
+
<!-- Torque Separation -->
<transformation>
<target>import org.apache.turbine.util.db.Criteria</target>
<result>import org.apache.torque.util.Criteria</result>
</transformation>
-
+
+ <transformation>
+ <target>import org.apache.turbine.util.db.pool.DBConnection</target>
+ <result>import org.apache.torque.pool.DBConnection</result>
+ </transformation>
+
+
+
</transformations>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]