Save JabberBot.cfc in a logical location on your server. For instance, on my local development server, I created a directory called "jabber" under the ColdFusion web root and placed JabberBot.cfc in that directory.
You may have been wondering how the JabberBot CFC knows how to log on to the Jive Messenger server. The answer is that each event gateway instance is able to have a configuration file associated with it. In some cases a configuration file isn’t necessary, but JabberBot needs to have a configuration file containing the XMPP server location and its buddy ID and password to work its magic.
ColdFusion contains a sample configuration file for each of the event gateways that ship with it. In a standalone installation the configuration files on Windows are in C:\CFusionMX7\gateway\config, and in a multi-instance or J2EE installation the configuration files are located under the server instance’s web root in the WEB-INF/cfusion/gateway/config directory. You are using the XMPP gateway, which uses the xmpp.cfg file. You can use these gateway files as templates when you create new gateway files, but you don’t need to edit any of these files now.
For this tutorial, I provided a file called cfjabber.cfg (in the ZIP for this tutorial). You will edit this gateway file based on the following specifications:
Open cfjabber.cfg (in any text editor) and update the following lines:
You can leave the rest of the configuration file as is.
Click Gateway Types.
Note: This screen shows you all the gateways installed on the server. Use this section to install any new gateways. The XMPP Gateway is already installed so you don’t need to do anything here now. I’m just pointing this out to show you where ColdFusion gets the available gateway types in the next step.
Enter the following information to complete the form:
Startup Mode: This tells ColdFusion to start the gateway instance automatically when ColdFusion starts, if the instance should be started manually, or to disable the instance. If you want to be able to chat with your ColdFusion server automatically after a server restart, set this to automatic. (If you find yourself talking to your ColdFusion server a bit too much, you might also want to consider hanging out with some real human beings on occasion!)
Figure 6. Adding an Event Gateway Instance
Click the green Play button next to your instance to start the instance. A message displays "Starting" in yellow, but the screen doesn’t automatically refresh to show you when it reaches "Running" status. If you want to verify that it is running, click the Refresh button at the bottom of the instances list. Once your JabberBot gateway is running, your ColdFusion server is ready for Jabber traffic!
Figure 7. The list of gateway instances and their status
One final note before proceeding: When you work with event gateways, you become very good friends with the cflog tag and the eventgateway.log file that appears in the ColdFusion Administrator Log Files section. If you start modifying JabberBot or creating your own IM gateways (come on, you know you want to) you’ll notice that when an error occurs you will see nothing in your IM client. It’s useful to either use the cflog tag to log information from your CFC, or, I’ve found that the eventgateway.log file that exists by default in ColdFusion does well with providing information that helps pinpoint solutions to an error. These are just a couple of pointers to avoid the frustration of the "white screen of death" in your Jabber client.