User Guide

Table Of Contents
Using the example event gateways and gateway applications 1045
The gateway/config/sms-test.cfg file is configured to use this application with the SMS client
(phone simulator), and short message service center (SMSC) server simulator that are provided
with ColdFusion MX.
The application presents users with a drill-down menu of tools that they can use, including a
weather report, stock information, status and configuration information, and language tools such
as a dictionary.
The code for this application is relatively complex and is distributed among 13 files. The
following brief description provides an overview of how it works. To get a full understanding of
how the application works, see the source code.
The top level, menu, directory contains two files: Application.cfm and main.cfc.
The Application.cfm file consists of a single cfapplication tag that enables session
management and names the application. Session variables maintain the current state
information of the session, such as the active menu, and so on.
The main.cfc file contains the master CFC; the event gateway configuration in ColdFusion
MX Administrator uses it as the listener CFC. The main CFC file processes CFEvent
structures from the event gateway. It does the following:
a
Inspects the gatewayType field to determine the rest of the structure contents. This is
necessary because different event gateways put the message in fields with different names.
b
If a Session.menu variable does not exist, initializes the menu system. To do so, it calls
methods in two other CFCs: menu and menunode. These two CFCs contain the menu
system code.
c
Calls the session.menu.process method to process the users input. This method can
dispatch a message to an individual application for processing, if appropriate.
The apps directory contains several CFCs. Each file contains the code for a single application,
such as the weather report or dictionary lookup (definition.cfc).
To use the menu application with the Socket event gateway:
1.
On the Gateway Settings page in the ColdFusion MX Administrator, click the Start SMS Test
Server button.
2.
On the Gateways page in the ColdFusion MX Administrator, start the SMS Menu App -
5551212 event gateway by clicking the green play button (third button from the left in the
Actions column). If the Status does not say Running after a few seconds, click Refresh to check
that the server started.
3.
In the cf_root\WEB-INF\cfusion\bin directory on J2EE configurations or the cf_root\bin
directory on server configurations, run the SMSClient.bat file (on Windows) or SMSClient.sh
file (on UNIX or Linux) to start the SMS phone simulator. The simulator is preconfigured by
default to “call” the default SMS event gateway configuration.
4.
Enter any character by typing or by using the mouse to click the simulator keypad, and press
Enter on your keyboard or click Send on the simulator.
5.
The menu application responds with the top-level menu. Enter L for language tools such as a
dictionary and thesaurus, S to get stock quotes or weather forecasts, or C to get information
about the server. Press Enter on your keyboard or click Send on the simulator.