Thursday, August 13, 2009

Installing support for ColdFusion development

Previous: Installing Tomcat.

I wanted to set up a ColdFusion development environment similar to that used at a current client of mine. That environment is based on ColdFusion, ColdSpring, ModelGlue, and MXUnit. The software used in this set-up is:
  • Eclipse - development IDE
  • ColdFusion - the base product
  • ColdFusion Eclipse Plugin - Eclipse support for ColdFusion development
  • ColdFusion ModelGlue - an MVC framework for webapps
  • ColdSpring - a Spring-like IoC implementation for ColdFusion
  • MXUnit - a unit test framework for ColdFusion, based on JUnit
  • CFEclipse Plugin - Eclipse support for CFML
  • MXUnit Eclipse Plugin - Eclipse support for MXUnit

ColdFusion


I followed instructions on http://www.adobe.com to download and install ColdFusion Developer Edition.
  1. Navigate to the ColdFusion product page on Adobe's website: http://www.adobe.com/products/coldfusion/.

  2. Follow the link labeled Download the free Developer Edition.

  3. Sign in to the Adobe site. Create a userid and password if you don't already have one. Don't worry, it's harmless.

  4. From the drop-down list for ColdFusion Developer Edition, choose the appropriate language and operating system.

  5. Click the button labeled Download next to the Developer Edition drop-down box.

  6. I copied the downloaded file, which is an installation program, to an "installation" directory, gave myself execution permission on it, and ran it. I followed the prompts to install a standalone ColdFusion server with a root directory of /home/dave/coldfusion8, to listen on port 8500.

  7. Started ColdFusion with
    sudo ./coldfusion8/bin/coldfusion start
    and navigated in Firefox to localhost:8500. (Yeah, you read that right: You need root privileges to start a single-user development server on your own machine. That's "enterprise" software, for ya. <sigh>) It told me no application was configured to respond to the request. I tried localhost:8500/CFIDE (based on what I saw in ~/coldfusion8/wwwroot, and not because I knew what I was doing) and it displayed a directory listing of wwwroot/CFIDE. I clicked on administrator and the ColdFusion Administrator app started up. It accepted the password I had defined during the installation process, and appeared to be working. I took this to mean a crude install of the base product had been accomplished. I looked, but couldn't find a sample app. Often, vendors include a sample app you can attempt to run, so that you can see whether the product installed correctly. No such luck here. If there are problems, I suppose they will turn up as I continue configuring the environment.

Install ColdSpring


ColdSpring is a port of Spring to ColdFusion. Its main features are support for IoC and AOP. I obtained it from http://www.coldspringframework.org/. The site offers a quick start guide, a reference guide, and API docs for CFCs. The simplicity and clarity of the packaging and documentation were a refreshing contrast to the "enterprisey" organization and packaging of ColdFusion itself.

I downloaded the pdf Reference Guide. The guide states you can install ColdSpring by placing the source in the web root directory. I learned the hard way that they should have said to unpack the distribution archive in the web root directory. "Place the source" there didn't imply that to me.

There is more than merely a problem with wording, though. While the Reference Guide says you can either place the source in wwwroot or define mappings in Administrator, in fact you must do both. After I defined a mapping for /coldspring to wwwroot, the quickstart app worked. The other sample apps did not work. This tells me the basic install is okay, and there are some configuration secrets that the developers and supporters of ColdSpring think are too obvious to bear mentioning. I'll have to seek help to complete the configuration later, when I'm ready to try using these tools.

Install ModelGlue


ModelGlue is a Model-View-Container framework that comes in ColdFusion and Flex flavors. I downloaded a zipped distribution archive from http://www.modelglue.org. At first glance, the documentation at http://docs.model-glue.com/ looks comprehensive, well-organized, and filled with concrete, practical examples, tutorials, and how-tos. One exceptionally good feature of the documentation is that the main heading on the first page reads, "Don't panic!" The site also has installation and configuration instructions, which I followed more-or-less like this:
  1. Unpack the distribution archive
  2. Copy the ModelGlue folder to ColdFusion's wwwroot folder

Install MXUnit


MXUnit is a unit testing framework based on JUnit. To get it, I went to http://www.mxunit.org/ and downloaded the distribution archive. Then I unpacked it in the coldfusion8/wwwroot directory.

To verify the installation, I started the ColdFusion server and went to http://localhost:8500/mxunit/index.cfm. It ran a trivial sample app and displayed a "Congratulations" message.

So far, so good with the ColdFusion setup.

Install the CFEclipse Eclipse Plugin


This is an Eclipse plugin that provides language support for ColdFusion Markup Language (CFML). The CFEclipse wiki has current information about the Eclipse update site, recent versions, known problems and workarounds. When I installed it, the update site was www.cfeclipse.org/update. Installation instructions are at http://trac.cfeclipse.org/wiki/InstallingCfeclipse. I followed the instructions more-or-less this way:
  1. Started Eclipse
  2. From the main menu, chose Help -> Install New Software...
  3. In the Install dialog window, clicked the Add button. Entered 'CFEclipse' in Name and 'http://www.cfeclipse.org/update' in Location. Clicked OK.
  4. Eclipse displayed two downloadable items, the editor and the documentation. I checked both. I also unchecked the 'group items by category' box and clicked Next. This resulted in an error, apparently because it tried to grab the documentation for Eclipse 3.4 and 3.5. I only needed 3.5, so I deselected the documentation for 3.4 and tried again. It seemed to like this better.
  5. Clicked Next on the 'review' dialog.
  6. On the 'accept licenses' dialog, clicked the 'accept' radio button but the installation did not work. The Next and Finish buttons remained disabled. I tried checking 'do not accept', scrolling from top to bottom of each license, and then checking 'accept' on each one. This time, the Finish button became enabled.
  7. Eclipse called for a restart, and I clicked Yes to restart it.
Since I have no existing ColdFusion code and no ColdFusion experience, I didn't try to write a test app. I noticed that when I opened the perspectives dialog, there was an entry for CFEclipse. I chose it and things looked pretty normal.

Install the MXUnit Eclipse Plugin


The installation instructions at http://www.mxunit.org/doc/index.cfm?doc=installplugin appear to be designed for an earlier version of Eclipse and for Microsoft Windows. It looks like a standard Eclipse software update, so I used the information from the site but followed a procedure like the one I used for the CFEclipse Plugin. The update site is http://mxunit.org/update. This installed MXUnit Test Runner.

At this point I believed I had a working installation of the ColdFusion development tools my client uses.

Next: Installing support for .NET development.

No comments:

Post a Comment