Java Coldfusion • Computer Engineer
Need to Refactor Transfer to meet your server layout? Here you go!
Example
I have my frameworks under a directory called: 'frameworks' and I usually create a version to them, say: frameworks.coldbox2_00 or frameworks.transfer0_63
Everybody has their own naming conventions and ideas. Anyways, here is the ANT Task.
<!-- ======================================================================
Mar 19, 2007 12:23:55 PM
transfer.refactoring
This ant task will rebuild Transfer using a prefix of choice:
shared.frameworks.transfer0_63
This is useful, if you are not placing the Transfer library
in your web root.
Example: shared.frameworks.transfer0_63
by Luis Majano
====================================================================== -->
<project name="transfer.refactoring" default="do.refactor" basedir=".">
<description>
This ant task will rebuild colspring using a prefix of choice
</description>
<target name="do.prefix" description="Choose the new transfer prefix">
<input message="What prefix would you like to use? (ex:frameworks.transfer0_63)" addproperty="transfer.newprefix" />
<input message="What is the relative path now? (ex:/frameworks/transfer0_63)" addproperty="transfer.relativepath" />
<echo>The prefix choosen is: ${transfer.newprefix}</echo>
</target>
<target name="do.refactor" depends="do.prefix" description="refactor the code">
<echo>Refactoring: ${basedir}</echo>
<replace dir="${basedir}" value="${transfer.newprefix}.com" summary="yes">
<include name="**/*.cfc" />
<replacetoken>transfer.com</replacetoken>
</replace>
<replace dir="${basedir}" value="${transfer.relativepath}/resources" summary="yes">
<include name="**/*.cfc" />
<replacetoken>/transfer/resources</replacetoken>
</replace>
</target>
</project>
You just need to place this as build.xml or refactor.xml in the root of your Transfer directory, where the TransferFactory.cfc is. Then just run it, it will ask you for the first path, type "frameworks.transfer0_63" then the relative path, type "/frameworks/transfer0_63" and then you are ready to roll.
Just make sure when you instantiate the factory it will now be: "frameworks.transfer0_63.TransferFactory"
There you go. Make sure you make a backup, just in case, or if you are a real geek, then keep it, so you can run it multiple times.
Have fun!!



I'll add a link on my Ant wiki.
I actually learned a lot from your wiki!! Thanks!!
I think it's possible to make it available for Coldbox, for example as pluging.
Kind regards
Joeri
http://www.objectbreeze.com/
Actually, that is the first ORM I looked at and really liked it too. I think so too. This would be great to great one single ORM plugin that can have adaptors built in for all the ORM's
http://www.bosvaktim.com