In this series, we will create a ModelGlue:Unity application. Our example application will manage contacts. We will start with a blank canvas and by the end of the series, have a functional application.

Lets begin:

Firstly, you should have the ModelGlue:Unity and Coldspring framework installed. If the framework is not installed, have a look at this post.

Our application will reside in a directory just under the webroot. We will access our application at http://LocalHost/ContactManagerMG. With that in mind, lets open the ModelGlueApplicationTemplate Directory.

This directory serves as an application skeleton for which to begin a new ModelGlue:Unity application.

There are two ways to get a new application up quickly. The first way is to copy the contents of the ModelGlueApplicationTemplate into a new directory just under your webroot called ContactManagerMG. Do a find and replace on 'modelglueapplicationtemplate' and change it to 'ContactManagerMG'.

The second way assumes you have cfeclipse or some other ANT environment. The directions below are specifically for cfeclipse.

Inside the ModelGlueApplicationTemplate directory is a file called build.xml. Build.xml is an ANT script. ANT scripts are sets of commands used to perform file and directory tasks. There are certain parts of the ModelGlueApplicationTemplate that need to be changed to our application name ( ContactManagerMG ).

We will now make the modifications to the build.xml file for the purpose of creating our new application.

Open the build.xml file. On a default install of ModelGlue:Unity the file will look like so:

In plain English, the build.xml file will copy the contents from the 'source' directory and place them into the 'target' directory then replace each instance of the 'token' and replace it with 'value'.

Once your edits are complete, save the file and locate it in the navigator. Right click on the file and choose Run As -> ANT Build. You can see the progress in the console. Assuming no errors, you now have a new ModelGlue application and can begin coding.

Via Find and ReplaceANT build, you now have a new directory called ContactManagerMG. Run this in your browser and you should get a page showing the following:

Model-Glue 2.0: Unity

Model-Glue is up and running!

Voila. A new ModelGlue:Unity application.
In the next series, we will add some functionality to our application.

ModelGlue:Unity is a ColdFusion framework that comes with a lot of of functionality and power right out of the box. In this tutorial, we will download all of the files needed to install ModelGlue:Unity, set up the framework and test our configuration.

ModelGlue:Unity requires the ModelGlue framework as well as the ColdSpring framework. We begin by downloading each part then placing them under our webroot.

Update: Make sure the version of the ModelGlue:Unity framework is at LEAST version 284.

You will run into errors if you use an earlier version of the ModelGlue:Unity framework.

You can find version 284 here. A complete list of builds is here. Note the builds are sorted alphabetically so if you want the most recent, pay attention to the LAST decimal number. I.E. modelglue_2.0.284.zip is a later version then modelglue_2.0.52.zip even though it appears above in the list.

Update: These instructions assume you will have both frameworks in webroot.

Placing frameworks in webroot is standard and preferred practice. If for some reason you MUST place the frameworks in a directory apart from webroot, you will need ColdFusion mappings for ModelGlue and for ColdSpring. There are few good reasons to install the frameworks in a directory other than webroot. If you have a good reason to do this, then you know who you are and what to do about it.

Now, unzip the contents of modelglue_2.0.xxx.zip underneath your webroot. When complete, you should have 4 directories direct children of your webroot.

documentation

modelglue

modelglueapplicationtemplate

modelgluesamples

Next, unzip the contents of the coldspring.zip file underneath your webroot. When complete you should have a directory called ColdSpring as a direct child of your webroot.

ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.orgSELECT TOP 1 TimeCardID, ObjectID, UserID,UserType, DateTimeIn, DateTimeOut, DateCreated FROMTimeCard WHERE ObjectID = (param 1) AND UserType ='FIELD' ORDER BY DateCreated

Just a public service announcement for those using Flex Builder. Flex Builder really enjoyes defaulting to port 8500 at all possible turns. I was playing with the RDS extentions and couldn't get the server to connect.
RDS was ( in fact ) enabled in the CFadmin. I changed the RDS password a few times and still had no connection. Turns out the default connection was to our friend port 8500. I found the configuration information in the helpful Flex Builder docs. The RDS configuration was tucked away in window/preferences.
When creating a Flex project the docs say:

ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.orgTo configure any ColdFusion servers that you want to connect to using RDS: In Flex Builder or Eclipse, select Window - Preferences - RDS Configuration. To configure the default localhost server, select localhost and specify the following: Description Host name (127.0.0.1) Port number (8500 if you are using the built-in web server) Context root, if necessary1To configure any ColdFusion servers that you want to connect to using RDS: 2In Flex Builder or Eclipse, select Window - Preferences - RDS Configuration. 3To configure the default localhost server, select localhost and specify the following: 4Description 5Host name (127.0.0.1) 6Port number (8500 if you are using the built-in web server) 7Context root, if necessary

Over the last 10 or so years, web based applications have used HTML.
HTML describes the look and feel of the application to the web
browser, a piece of software on your local computer. The web browser
then interprets the description into a usable ( you hope ) application
capable of interacting with users.

This process has worked extremely well, mostly for lack of viable alternatives.

I personally don't hate writing javascript, I just don't like the signal to noise ratio. It seems like I write many lines of code for a simple bit of functionality. The fine folks at JQuery have a tremendous amount of functionality in their library and in just a few lines, you can add some nice flair to your web applications.

So, a big thanks to Rob Gonda for pushing out the newest (alpha) release of AjaxCFC. We appreciate your efforts

While refactoring today, I got a dreaded Java 500 NULL error. This is by far my least favorite error because ColdFusion gives ABSOLUTELY no helpful information at all as to where the error occurred.

I am not sure why this error happens outside of the coldfusion error handler, you know, the one with the nice pretty information. Apparently it happens during a part of the process where coldfusion has no control, because coldfusion is usually tops on giving proper information onError.

After staring blankly at my screen for a few minutes, I tracked it down to the following section of code:

A few days I completed an installation of Subversion on Windows XP Pro 64. Subversion usually a pretty easy set up. In this case I was setting up subversion on an XP Pro 64 bit OS and there was an annoying wrinkle to the process.

I didn't know much about 64 bit windows, just that it could supposedly run 32 bit applications with no problem. (You know backward compatibility and all that bollocks). At this point, I wasn't much worried about incompatibilities, seemed like a piece of cake.