ColdBox M5 and 2.6.4 Playing Together
To do this without refactoring see: http://www.cfcoffee.co.uk/index.cfm/2010/5/2/ColdBox-M5-and-264-Playing-Together-Continued
Have you downloaded the lasted update from Luis, ColdBox M5? No? Well you should download it right now! So many new goodies, however running CB release M5 alongside my stable version CB 2.6.4 took me a while to set-up in my environment. I have been playing with the new update for a week, but only locally. Now I wanted to actually do something I would need to run it in an environment with an older version.
I run IIS6 and have CB 2.6.4 mapped in my ColdFusion Administrator. Any reference to coldbox/system will use this release. I wanted to run both versions so that my old applications running 2.6.4 still work!
As I found out this can be done very easily following ColdBox Refactoring Guide found here and the Ant Script found in the download. I had a few issues with this tho, not many but here is what I did....
Your set-up many differ from this, this is just my experience!
I Downloaded M5 from the the ColdBox site and placed it on my desktop following the instructions in the refactoring guide. I used ColdFusion Builder to run the Ant script not Eclipse but it's the same.
My default path for my CFC's is coldbox.system, this is mapped in my ColdFusion Administrator to shared/frameworks/coldbox/system. Because my new version is going to run inside the same 'framework' folder I entered not the full path to the new location as the guide shows but the Logical Path. This is my case would be coldbox3.system.
The Ant script however did not actually replace coldbox.system with coldbox3.system but append it to the beginning of 'system'. ie I ended up with the following in the framework code 'coldbox.system.system', which in my case was not correct.
I tired again, this time without word 'system'. After this my paths looked correct. I am not sure if this is an issue with the Ant Script or just something I did wrong.
Now my refactored code is all ready roll (thanks Ant Script). I added the refactored code to my newly created directory folder on the server then created a mapping as you can see below.
Mapping now done I needed to get my CB application to use the coldbox3 path. I installed the advanced example template that came with the CB M5 release download. I then did a find and replace in ColdFusion Builder. In Builder it's done by clicking on the folder you want to replace on and pressing [ctrl + h]
- I searched for coldbox.system and replace it with coldbox3.system
- I searched for /coldbox/system and replace it with /coldbox3/system
That's it. O, apart from the error below....
Not sure why this happens yet, but a quick search on the ColdBox forum (users with the same issue) resolved the issue by commenting out the ModelMappings in the default forgebox module > ModuleConfig.cfc.
Now time to play, may have more issues when I start playing with modules but all seems to be fine so far!
Apr30



30/04/10 20:14
To me, this seems like so much more work than is needed.
Unless you are still on CF7, I would use application specific mappings for this instead of server-wide mappings. Using app-specific mappings would allow you to map both applications to /coldbox but have them point to different physical directories. This also means you would not need to modify the framework.