Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.
September 30, 2005
Posted At : 3:30 PM
Related Categories:
ColdFusion :
ColdFusion Administrator settings are server wide. And users have long asked for more granular settings, ideally per application. A thread on cf-talk today discussed per application mappings, but there is actually more to it than that. What about debug settings? Log file paths? Default SMTP server? There are lots of settings that are server-wide right now (unless you are running multiple instances, in which case they are instance wide). So, if ColdFusion were to support per application settings (which, if present, would override the default CF Admin settings), how would you expect to define them?
- <cfapplication> tag attributes
- <cfsetting>
- A new tag
- Application.cfc THIS members
- Or ...
What do you think?
Posted At : 3:24 PM
Related Categories:
ColdFusion :
Look at the latest ColdFusion news stories picked up by Google News. Mac OSX support has attracted lots of attention. If you know of any production sites running ColdFusion on OSX, please let me know.
September 29, 2005
Posted At : 4:12 PM
Related Categories:
ColdFusion :
ColdFusion MX 7.0.1 includes a Java CFCProxy class which can be used to invoke ColdFusion Components from within Java code. Lots of developers are trying to find documentation on this class, and we will be posting this shortly. But in the interim, I have posted a copy on my site.
September 28, 2005
Posted At : 11:22 PM
Related Categories:
ColdFusion :
I am in Dallas for a customer meeting tomorrow, and took the opportunity to speak to the local CFUG this evening. The room was packed with a standing room only crowd, and two developers even drove in from Tulsa for the event (over 4 hours each way). The meeting was hosted by Aidmatrix (who showed their impressive CF+Flash app used to facilitate donation drives and donation allocation) in one of the nicest facilities I have seen (complete with three gigantic screens and auditorium style seating with plush armchair like seats). The presentation was on event gateways (with examples of asynchronous processing, IM integration, and SMS applications). Lots of good questions, both on and off topic, as well as requests for "Scorpio" functionality.
September 27, 2005
Posted At : 10:59 PM
Related Categories:
ColdFusion :
The update to ColdFusion previously known by the code name "Merrimack" is now available for download. Version 7.0.1 of ColdFusion includes:
- Native Mac OSX installer
- Support for Oracle AS and Oracle 10g
- Support for IBM WebSphere Network Deployment
- Lots of incremental improvements to Flash Forms, including the ability to use ActionScript functions, and additional ActionScript events
- New RTF output for ColdFusion reports
- Report Builder enhancements
- Java CFCProxy support (invoke CFCs from Java)
- Basic support for IPv6
- Updated drivers and OEM bits
- And more!
Go grab your copy from the Macromedia site (which, of course, is now running on ColdFusion MX 7.0.1).
Posted At : 10:26 PM
Related Categories:
Using CF :
WorkTree.com claims to be "the LARGEST job search portal in the world" (their words, not mine). Personally, this is not a site I have run into (but hey, I have not been out looking for a job), and so I can't comment on that claim. But I can comment on the fact that this site is powered by ColdFusion. Thanks to Jason Fill for this one.
Posted At : 10:16 PM
Related Categories:
Using CF :
Under Armour has made it their mission to provide the world with technically advanced performance apparel engineered with exclusive fabric construction, supreme moisture management, and proven innovation. The Under Armour sites are all powered by ColdFusion and sport highly interactive Flash front ends, too. Thanks to Phil for this one.
Someone just e-mailed me to ask if there was a way to see a dump of all query contents when viewing ColdFusion debug output. And, actually, there is. Here's the scoop. The ColdFusion debug output that we are all so familiar with is actually generated by a .cfm page. If you look in coldfusionroot/wwwroot/WEB-INF/debug you'll see several .cfm files. classic.cfm is the debug output that you usually see, dockable.cfm is the docked view debug output, and dreamweaver.cfm is used to generate debug output that Dreamweaver displays. And these files may be modified (well, don't mess with the Dreamweaver one), and you can create your own ones, too. Actually, if you are going to tinker with these, then please make a copy and edit it. Then save it in the same folder, and you'll then be able to select it as the active debug template in CF Admin. If you look at these files (and yes you can, they are not encoded) you will see that a big query named qEvents is retrieved from ColdFusion, this is all of the debugging data retrieved from the debugging service's event table. The rest of the templates simply process this data to display the debug output. To add the query contents dump, find the section that begins with the comment <--- SQL Queries ---> (it'll be at about line 550 or so in CFMX7). That block of code starts with a <cfif> statement that checks to see if any queries were processed. If yes, it loops through each query displaying the SQL, number of rows returned, and more. There are two nested loops in this section, the outer loop loops through queries, and the inner loop loops query attributes for each query. Locate the </cfloop> for the outer loop, and add this code before it (after the </cfif> and before the </cfloop>:
<!--- Dump query contents ---> <cfdump var="#cfdebug_queries.result#">
Then save your new debug template, and activate it in CF Admin. Now the complete result set for any executed query will be included in the debug output.
Ray Camden is running a contest for beginner ColdFusion programmers. He has posted a program that he wants created, and is looking for creative solutions. The contest is over on October 3rd, 2005, and the winner will get a copy of ColdFusion MX 7 Web Application Construction kit (which Ray co-authored).
September 26, 2005
Posted At : 3:38 PM
Related Categories:
Mobile :
In case you are one of the many who doubted the authenticity of last week's Engadget post about a Windows based Treo, this press release should set the record straight (and check out the banner on the Palm homepage). But, and this part is troubling, the press release refers to a CDMA device. I am hoping that Palm is not stupid enough to create a CDMA only device and not a GSM version.
September 23, 2005
Posted At : 2:03 PM
Related Categories:
Mobile :
Engadget got their hands on a Treo 700w, w as in Windows Mobile powered. The big question for me is, will this mean more or less spontaneous reboots? From a feature perspective, this looks a little weak, essentially a 650 with a new OS. Still, will be worth a look at.
Posted At : 10:13 AM
Related Categories:
ColdFusion :
KoldKast is ColdFusion MX 7 version powered blog software, and 2.0 is now available for download. The application takes advantage of CFMX7 functionality and features PDF/FlashPaper formatted printing, Flash Forms, comment anti-spam to reduce spam on your blog entries, unlimited polls and poll options, word filters to help eliminate unwanted words in your comments, ban filters, multiple blogs and admins, easily accessible CSS skinning via the design manager, and much more. A demo is online for you to play with.
September 22, 2005
A CFC Bird-of-a-feather session has been added to the MAX 2005 schedule. It'll be Tuesday night at 6:30pm, and Ray Camden will be moderating.
Wharton Computing at the University of Pennsylvania is looking for a full time ColdFusion/ Flex developer in Philadelphia, PA. Duties primarily involve application development, though some server maintenance is involved. Contact: tpryan@wharton.upenn.edu.
September 21, 2005
Posted At : 10:27 PM
Related Categories:
Using CF :
Charity Navigator, America's premier independent charity evaluator, works to advance a more efficient and responsive philanthropic marketplace by evaluating the financial health of America's largest charities. Charity Navigator is powered by ColdFusion MX. Thanks to Will Tomlinson for this one.
Posted At : 10:24 PM
Related Categories:
Using CF :
This one sent to me by Phillip Holmstrand of City of Portland, Oregon. Portland Online is the official web site of Portland, OR. The site contains over 60,000 pieces of content (HTML, PDF, and more), has a sophisticated security ands access control system built-in, features calendars polls and more, and receives more than 3,500,000 page views per month. Portland Maps is the largest municipal GIS implementation using ESRI technology with over two dozen different datasets online from assessor records to crime statistics. It features Google Earth integration, regularly generates as many as 15,000 maps an hour, and get over 1,800,000 per month. And the site is powered by ColdFusion MX 7 running on Windows 2003.
Posted At : 6:53 PM
Related Categories:
Jobs :
This sent to me by Jeff Mayer: Foresite Design located in Hollywood, FL is an E-Commerce development company and is seeking 2 full time web developers with 2 yrs plus experience in ColdFusion. This is a permanent on-site position. Salary based on experience. For information contact jobs@foresite.com.
September 19, 2005
Posted At : 12:12 PM
Related Categories:
ColdFusion :
As part of our planning for the next ColdFusion, we are collecting feedback from users via this online survey. Thanks.
September 16, 2005
Posted At : 12:12 PM
Related Categories:
ColdFusion :
The previous parts of this series explained what IM bots are and how they work, and then walked through the steps needed to create a Google Talk IM bot. In this part we'll look at using other IM networks, using gateway helper functions, and managing session state. Thus far we have concentrated on Google Talk IM bots, but there are other IM networks out there. In fact, AOL IM (or AIM) and Yahoo IM (or YIM) are the most used public IM networks, with MSN and ICQ (now owned by AOL) being important, too. So what about those networks? What would it take to create an IM bot for those services? ColdFusion ships with two IM gateway types, XMPP and Lotus Sametime. XMPP is the protocol used by Jabber, and thus by Google Talk (as explained previously), and by private Jabber servers. Lotus Sametime is IBM's real-time collaboration platform which includes instant messaging (and is generally used within organization for internal IM communication, as opposed to public IM communication). So, while ColdFusion can automatically communicate with Google Talk and other Jabber based services, it cannot talk to AIM, YIM, MSN, and ICQ without custom gateway types for these networks and their proprietary protocols. So how could your bot connect to these services? You have several options available to you:
- The best option is JBuddy-CF, a set of gateway types created by Zion Software. JBuddy-CF is a commercial product which supports all of the major networks. It comes with an installation program which installs the required Java files into your ColdFusion server, and even includes an optional .cfm file which uses the Administration API to register the new gateway types. Once installed, these can be used like any other gateway types. (And indeed, this is what I am using for the YIM and AIM interfaces of my CF LiveDocs gateway connected as user cflivedocs). This is not a free solution, but it is the simplest and cleanest option available thus far.
- The CFMX7 IM Event Gateways SourceForge project is an ongoing initiative to develop IM gateway types for AIM, MSN, and YIM. This project is a work in progress, but if you don't mind getting involved with alpha code, this may be a viable option.
- You could install your own Jabber server (your own local IM server), and connect to it using the included XMPP gateway. Jabber add-ons can then be used to connect your IM server to the major IM networks (some servers and add-ons are freebies, others are commercial products). This configuration is not trivial, but it can be made to work very inexpensively.
Once installed and configured, the steps needed to build your bot are no different from those described in Part II. One important point to note is that different gateway types may require different CFC methods and may support different options and gateway helper functions (we'll get to those shortly). JBuddy-CF (built using the same underlying technology as the included XMPP gateway) provides the cleanest IM abstractions, using the exact same interfaces and helper functions for all networks. As such, if using JBuddy-CF, the identical CFC can be used for all networks (only the gateway types and config files will differ). This may, or may not, be the case when using the other two options described above. So now you know how to create bots and bring them online. But what if you wanted to manipulate bot settings, perhaps to set the status to away temporarily, or to programmatically obtain the number of messages responded to? Developers creating the Java code for the underlying gateway type can include Java helper methods specific to that gateway type. Not all gateway types have helper methods, but many (including the XMPP gateway) do. To access the helper function you need to obtain a Java GetwayHelper object using a little known CFML function named GetGatewayHelper(). This function takes the id of a gateway as a parameter, and returns a Java object that can then be used within your CFML code. To demonstrate this, the following code is used to set the IM status for my CFDocs Google Talk IM bot. To use this code with your own bot, simply change the gateway_id. To try out this code, just save it in a .cfm file (on the server running your bot) and execute it. <!--- Gateway id ---> <cfset gateway_id="jabber cfdocs">
<!--- Status options Bit off a hack needed because the strings returned by getStatusAsString() are not the same as the ones passed to setStatus(). ---> <cfset status_options="ONLINE,AWAY,DND,NA,FREE_TO_CHAT"> <cfset status_display="ONLINE,AWAY,DO NOT DISTURB,NOT AVAILABLE,FREE TO CHAT">
<!--- Get the GatewayHelper ---> <cfset helper=getGatewayHelper(gateway_id)>
<!--- If form post is present ---> <cfif IsDefined("FORM.status_new")> <cfset helper.setStatus(ListGetAt(status_options, status_new), "")> </cfif>
<!--- Get current status ---> <cfset status=helper.getStatusAsString()>
<cfoutput> <!--- Display current status ---> <h3>Status: #status#</h3>
<!--- Form to change status ---> <form action="#CGI.SCRIPT_NAME#" method="post">
<!--- Loop through status options ---> <cfloop index="o" from="1" to="#ListLen(status_options)#"> <input type="radio" name="status_new" value="#o#" <cfif ListGetAt(status_display, o) is status>checked</cfif> onChange="submit()">#ListGetAt(status_display, o)#<br> </cfloop>
</form>
</cfoutput>
This is a pretty simple example. The gateway id is defined, as are lists containing the status values returned by and passed to the GatewayHelper methods. Next, GetGatewayHelper() is used to obtain a GatewayHelper object. The form in this little app is self-posting, and if a new status has been specified, helper.setStatus() is used to set the status (which will immediately be reflected in relevant buddy lists). The code then uses helper.getStatusAsString() to obtain the current status, and then displays a form used to change the status. This is just a simple example, and there are lots of other GatewayHelper methods, too. Some are informational, like numberOfMessagesReceived() which returns the number of received inbound messages, and isOnline() which indicates whether or not the gateway is online and connected. Others are used to control buddy lists, including getBuddyList() which returns the buddy list, getBuddyInfo() which returns information about a buddy, and addBuddy() and removeBuddy() which do exactly what their names suggest. The full list of GatewayHelper methods for IM gateway types is included in the ColdFusion documentation (in the ColdFusion MX Event Gateway Reference section). Other gateway types may have other helper methods, consult the relevant gateway documentation to determine which methods are available to you. The last topic to discuss is session state management. Fortunately, there is not much to discuss. If ColdFusion session state management is enabled then you can use the SESSION scope in your bot code as you would in any other applications. It is worth noting that although you may use SESSION just as you would in a web application, ColdFusion uses a different mechanism to identify sessions. In web applications ColdFusion uses a jsessionid or a cfid/cftoken pair (in cookies or URL parameters) to identify sessions, and these are passed back and forth with each request. There are no cookies or URL parameters to be passed back and forth when using IM, and so ColdFusion uses a combination of gateway id, gateway type, and the originator id (sender's buddy name) to identify sessions. And this is all handled internally by ColdFusion, you can just use sessions as you usually would, and it'll just work. More to follow (perhaps <g>).
Posted At : 10:41 AM
Related Categories:
ColdFusion :
An update to the ColdFusion MX 7 XMPP gateway is now available. The changes include XMPP/Jabber 1.0 specification compliance, increased connection timeout, SASL/Plain support for servers requesting SASL/PLAIN authentication, and SASL/Digest-MD5 support. This update is not part of the upcoming Merrimack updater, and is intended for use with ColdFusion MX 7 with or without that future update applied.
September 15, 2005
Posted At : 4:51 PM
Related Categories:
ColdFusion :
As should be clear by Part I of this post, creating a Google Talk IM bot requires the following three items:
- An installed ColdFusion gateway type that is compatible with the Google Talk network. As Google Talk is built on top of Jabber which is XMPP based, the XMPP gateway that comes with ColdFusion fits the bill.
- A configuration file specifying the Google Talk account name and password to be used by the bot.
- A CFC file to actually process and respond to inbound IM messages.
Obviously, any IM bot needs an IM user account, so the first thing you'll need to do is obtain a Google Talk account. Google Talk uses GMail addresses and passwords, so obtain a new GMail account if needed, or use any unused account (don't use an account that you yourself will be using with Google Talk, the same account cannot be logged in twice of course, so the bot needs its own account). Next you'll need to save that account information into a configuration file. Gateway config files are typically stored in /gateway/config under the ColdFusion root (c:\cfusionmx7\gateway\config on a Windows standalone installation, c:\jrun4\servers\cfusion\cfusion-ear\cfusion-war\web-inf\cfusion\gateway\config on the default ColdFusion instance on a Windows multi-server installation), although they could be stored elsewhere too. That folder may contain a sample XMPP configuration file named xmpp.cfg which you may copy and modify. Your configuration file should contain (at a minimum) the following entries (obviously setting userid and password to your GMail account information):
userid=account@gmail.com password=password resourceName=ColdFusion MX 7 secureprotocol=TSL securerequirement=true serverip=talk.google.com serverport=5222
Next you need the CFC that will respond to inbound requests. At a minimum you need two methods in your CFC, onIncomingMessage and onAddBuddyRequest. All instant messages sent to your bot are routed to a method named onIncomingMessage. This method is the one that actually receives all inbound messages, and this is where you'd process user requests, generating responses if needed. Here is a simple example:
<cffunction name="onIncomingMessage"> <cfargument name="CFEvent" type="struct" required="yes">
<!--- Get the message ---> <cfset var message=CFEvent.data.message> <cfset var originatorID=CFEvent.originatorID>
<!--- Result structure ---> <cfset var retValue=structNew()> <cfset retValue.BuddyID= originatorID > <cfset retValue.Message="You said: #message#"> <!--- send the return message back ---> <cfreturn retValue> </cffunction>
All methods invoked by gateways receive a single argument, a CFEvent structure (the contents of which vary based on the gateway type). In this example, two local variables are created containing values extracted from the CFEvent structure, message is the actual text sent by the user, and originatorID is the sender name. Typically your bot would do some processing based on the contents of message, but this simple example just echoes the content back to the sender. A return structure is created, and two values are set, BuddyID is set to originatorID (so that the message is sent back to the sender), and Message contains a string echoing the received message. And that is all that is needed. The return structure is returned by the <cfreturn> tag, and the echo will be sent back to the sender. That's onIncomingMessage. Next comes onAddBuddyRequest. When you add a user to your own IM buddy list, the network sends a message to that user asking them to accept or deny the request. If accepted you'll be able to see when that user is online and will be able to send him or her messages, and if denied then you'll not be able to see online status, and you may not even be able to send messages. When a user adds your bot as a buddy, the server will ask it to accept or decline the request. Obviously, these requests must be handled programmatically (as there is no actual user), and so these are routed to a CFC method named onAddBuddyRequest. This method can always return an accept response, or can conditionally accept or decline based on some code (maybe a database lookup, or some password or code provided, and so on). Here is an example:
<cffunction name="onAddBuddyRequest"> <cfargument name="CFEvent" type="struct" required="true"> <cfset var retValue = structNew()>
<cfset retValue.Command="accept"> <cfset retValue.BuddyID=CFEvent.data.sender> <cfset retValue.Reason="Welcome!">
<cfreturn retValue> </cffunction>
Once again, onAddBuddyRequest receives a CFEvent structure. This method must respond to the network either accepting or denying the request. Here a return structure is created. Command is set to accept, accepting the request (set it to decline to deny the request). BuddyID is the name of the user being accepted, and Reason is a welcome message that may be sent to the user (depending on the network and IM client being used). And like before, the return structure is then returned using the <cfreturn> tag. Other methods are supported too. And best practices dictate that every method be present in your CFC, even if they are not all used. So every IM bot CFC you create should probably contain the following (even if the methods are all empty): <cffunction name="onAddBuddyResponse"> <cfargument name="CFEvent" type="struct" required="YES"> </cffunction>
<cffunction name="onBuddyStatus"> <cfargument name="CFEvent" type="struct" required="YES"> </cffunction>
<cffunction name="onIMServerMessage"> <cfargument name="CFEvent" type="struct" required="YES"> </cffunction>
<cffunction name="onAdminMessage"> <cfargument name="CFEvent" type="struct" required="YES"> </cffunction>
The CFC can be saved anywhere on your server. The default path for gateway CFC files is /gateway/cfc under the ColdFusion root (c:\cfusionmx7\gateway\cfc on a Windows standalone installation, c:\jrun4\servers\cfusion\cfusion-ear\cfusion-war\web-inf\cfusion\gateway\cfc on the default ColdFusion instance on a Windows multi-server installation). With the config file and CFC saved, you can now register the new gateway instance. Here are the steps needed:
- Open the ColdFusion Administrator.
- Go to the Event Gateways, Settings screen, and make sure that Enable ColdFusion Event Gateway Services checkbox is checked.
- Next, go to the Event Gateways, Gateway Instances screen.
- Use the form at the top of the screen to add your new gateway instance. Start by specifying a unique Gateway ID.
- In the Gateway Type field select XMPP – XMPP Gateway.
- In the CFC Path field specify the path to your gateway CFC file.
- In the Configuration File field specify the path to your gateway configuration file.
- To have your gateway start automatically upon ColdFusion server start, set Startup Mode to Automatic, otherwise set this field to Manual.
- And finally, click the Add Gateway Instance button to save your new gateway instance.
To start the gateway, click the green Start button in the gateway Action column. The status will change to Starting, and then Running. And once running, your Google Talk IM bot will be ready to receive and respond to requests. But what if the bot won't start? The Debugging & Logging, Log Files screen contains a file named eventgateway.log (this file will be created the first time event gateways are used). You can inspect this log file to determine what your gateway is doing and what errors it may have thrown. And with that, you are all set to create a Google Talk IM bot. In a subsequent post we'll look at other IM networks, and advanced IM bot functionality.
Posted At : 3:18 PM
Related Categories:
ColdFusion :
I recently mentioned a Google Talk bot that I put online at cfdocs@gmail.com. Google Talk users can add this user to their buddy list and then submit CFML tag and function lookups to it. (I've also brought Yahoo IM and AIM versions online as nickname cflivedocs, but more on those in a subsequent post). As promised, in this post I explain exactly what the IM bot is and what it does, and will continue this topic in subsequent posts. We've all used instant messaging (or IM), almost always for person-to-person communication; send a user a message and it'll pop up on their desktop allowing them to respond. An IM bot is a virtual IM user (bot is short for robot), an application that can receive and send messages programmatically. Bots are not a new idea, IRC bots have been around for years, in pre-web days we used to use e-mail bots to submit gopher and usenet searches via e-mail, and if you think about it, spiders (used by search engine to index web site content) are bots of sorts in that they programmatically simulate what it is that users would do with their web browsers. So what would an IM bot be used for? Imagine that UPS or FedEx had bots online (named UPS or FedEx) that would allow you to simply type a tracking number in an instant message, instantly receiving a tracking response. Or an airline allowing you to type in a flight number to obtain gate information or flight status. Or your company employee directory allowing users to type in partial names to do lookups (the results of which could include an e-mail address which could be clicked on to send an e-mail). Or my ColdFusion LiveDocs example, mentioned previously. Of course, not all applications are suited to this type of interaction. But many are, and IM bots allow you to provide instant access to applications leveraging the immediacy and simplicity of now ubiquitous IM clients. Developing an Google Talk IM bot obviously requires that you have an application waiting to receive requests (and thus running at all times) that is logged in to the Google Talk network (and thus requiring a thorough understanding of the technical implementations used by Google Talk). Or you can simple use ColdFusion, which obviously will be always running (so as to respond to HTTP requests), and which already comes with the code needed to login and interact with Google Talk. And this requires a word or two (or more) about ColdFusion event gateways. ColdFusion MX 7 Enterprise (and Developer's Edition) includes support for event gateways. The best way to understand event gateways is to understand what it is they allow. ColdFusion has long been an incredibly simple way to build Web apps. That's why we all use ColdFusion, simplicity (and thus productivity). But ColdFusion is not exclusively tied to the Web. In fact, ColdFusion does not even talk to Web browsers (that is the Web server's job). ColdFusion simply executes scripts on the server in response to requests, requests which (thus far) have been typically HTTP originated. So could ColdFusion respond to other requests? For example, data sent to a specific port, or changes in a folder, or inbound SMS and IM messages, or database table changes, or ... ? The answer is yes, ColdFusion can respond to any and all of those, it just needs a way to know when those events occur. And that is what the event gateways are all about. Gateways are interfaces to other systems, ways for events to trigger ColdFusion processing. A gateway watching a folder on a server can trigger ColdFusion execution when folder contents change. A gateway connecting to an SMS provider can respond to inbound SMS messages (and send SMS messages as well). A gateway can be pinged by a database trigger so that a database event forces ColdFusion processing (imagine being able to automatically dynamically generate static HTML pages whenever back-end databases change). And a gateway connected to Google Talk can respond to (and send) Google Talk instant messages. ColdFusion has a built in event gateway service (which can be stopped and started using the ColdFusion Administrator, and which is running by default). The event gateway service receives all gateway requests, queuing and routing them to the appropriate gateways as needed, and then executing them using a designated number of allowed threads (10 by default). ColdFusion ships with an array of gateway types out of the box (additional ones are available from 3rd parties, and you may write these yourself too). Gateway types written in Java, and are registered in the ColdFusion Administrator. Gateway types are just that, types, they are not gateway instances. The folder watcher type has no code specific to your folders or what you'd want when an event is triggered. An SMS gateway type knows how to connect to SMS servers and exchange messages, but is not tied to a specific account or processing. Gateway types are generalized, they are the processing that is not unique to your application. You can kind of think of gateway types as being a bit like database drivers, they contain (and encapsulate) the code and processing needed to interact with some system or technology. And, as already stated, they must be registered in the ColdFusion Administrator before they can be used. Gateway instances are also defined in the ColdFusion Administrator. A gateway instance is simply an entry that defines the name, the associated type, the name of an optional configuration file, and the name of the CFC file containing your processing. So, if you needed a gateway to respond to requests coming in over a socket, you'd create a gateway instance using the appropriate gateway type and specifying a CFC file that would actually receive those requests so as to be able to respond to them. A single gateway type can be used in as many gateways as needed (so you can have several different IM applications running, or multiple folders being watched each triggering different events). The CFC used is no different to any other CFC, except that specific method names are used (these are specified by the gateway type being used, each gateway type will expect specific CFC methods to be present). The CFC is straight CFML, and can contain any CFML code and processing. When a gateway event occurs (an SMS message arrives, a database trigger fires, data is received by a socket being watched, and so on), the ColdFusion gateway engine calls the appropriate CFC method, telling it everything it needs to know about the event. And your CFC code can then respond, using the same CFML that you know and love. Which brings us back to Google Talk IM bots.
Posted At : 1:24 PM
Related Categories:
ColdFusion :
I'll be in Dallas next week for a customer meeting, and am flying in a day earlier so as to get the chance to present to the Dallas / Fort Worth CFUG on September 28th. We'll talk about gateways, asynch processing, SMS, IM bots, and more. I hope to see you there!
Posted At : 11:55 AM
Related Categories:
ColdFusion :
Phil Crissman has posted his notes on my Monday Twin Cities CFUG presentation on ColdFusion MX 7 Event Gateways.
September 14, 2005
An issue with Internet Explorer may prevent FlashPaper documents dynamically generated by ColdFusion from displaying in Flash Player 8. This technote explains.
|