AdobeStock_455007340

ColdFusion Flex Enterprise Services Based Session Tracker Online

One of the examples that I have been using in my user group presentations is a ColdFusion Session Tracker. This application uses Flex Enterprise Services to push real time session details to a connected Flex client. The display is a grid of sessions showing request count and when the most recent request occurred, and allowing each session to be expanded (to see details) and collapsed as needed.
The application is a demonstration of:

  • How to send structured data from ColdFusion to Flex clients via Flex Enterprise Services (FES).
  • How to subscribe to messages channels and how to consume received data.
  • The use of custom grid renderers.
  • Using states to implement expand/collapse views within grid cell renderers.

To create and run the ColdFusion Session Tracker you must have the following (all of which are downloadable from the Labs site):

  • ColdFusion MX 7.01 (Enterprise or Developer editions) with the “Mystic” updater installed.
  • Flex Builder 2.0 Beta 1.
  • Flex Enterprise Services 2.0 Beta 1.

As this application uses Flex Enterprise Services it cannot be used with ColdFusion Standard (which does not support the use of event gateways). ColdFusion Enterprise (or Developer Edition) is required.
You can download the application (along with detailed instructions and usage notes) from the ColdFusion/Flex Connectivity page.

10 responses to “ColdFusion Flex Enterprise Services Based Session Tracker Online”

  1. Steve Powell Avatar
    Steve Powell

    Now this is interesting.
    A couple of questions. What’s the msytic update fro CF? ANd where do you get it?

  2. Ben Forta Avatar
    Ben Forta

    Steve, look for ColdFusion/Flex Connectivity. The page you want is http://labs.macromedia.com/technologies/cf_flexconnectivity/.
    — Ben

  3. Steve Powell Avatar
    Steve Powell

    Thanks Ben. Had already downloaded it. Just not managed to figure out where the "mystic" bit came from.
    Though Flex was recently described as "voodoo" by one of our .net teams recently. Kind of funny given I was demonstrating how to deliver an app they have out in the field without the 34Mb executable that keeps killing our network every time there’s a change.

  4. Saeed Richardson Avatar
    Saeed Richardson

    Hey Ben,
    hanks much for the Session Tracker App … I’m playing with it a we speak but running into a snag. Now the mxml fles work without a hitch (they compile and I can get the Connected/Subscribe = false messages).
    The problem I’m having is that when I run the test1/2.cfm files I keep receiving this error: Unable to find Flex adapter for destination "ColdFusionGateway" in the RMI registry on localhost.
    I’ve got the Flex2CF Event Gateway running and pointing to the Application.CFC, and the ColdFusionGateway is uncommented in the Flexmessaging.xml file, too.
    I’ve been hacking over this thing for some time now; can you offer any suggestions? Thanks much!

  5. Randy Ellis Avatar
    Randy Ellis

    Hi Ben, thanks for the Kansas City Presentation!
    I’ve downloaded the Session Tracker application and installed it. The Flex app runs and the CF test pages work, but the two don’t talk to each other.
    My question is during the installation the CF gateway, step 1 states: "In ColdFusion Administrator define a new gateway named “Flex2CF” of type “Flex Messaging”. You will need to point it to a CFC file, but no configuration file is needed."
    "…point it to a CFC file…", what CFC file would this be?
    The only CFC file I have fould is the application.cfc file for the test1.cfm and test2.cfm files.
    Is there a CFC file missing or am I missing something here?
    Thanks

  6. Ben Forta Avatar
    Ben Forta

    Saeed, if the Flex app is showing false for connected, and CF is throwing that error, then neither are connecting to FES properly. Check the flex-message-service.xml file (in C:fes2jrun4serversdefaultsamplesWEB-INFflex by default) and make sure that the ColdFusoin gateway is not commented out.
    See http://www.forta.com/blog/index.cfm/2006/2/1/Getting-Started-With-ColdFusion-And-Flex-Enterprise-Services for more details on FES setup.
    — Ben

  7. Ben Forta Avatar
    Ben Forta

    Randy, the needed CFC is used to process inbound messages. As the sample app does not need this you can create an empty CFC and just point to that.
    — Ben

  8. Saeed Richardson Avatar
    Saeed Richardson

    Thanks much Ben,
    I just took and copied your flex-messaging contents into mine and it worked. I’m not sure why but the gateway appeared to be uncommented and it still could not reference the ColdFusionGateway. Maybe it was a rogue comment marker or something like that.
    Nonetheless, I’m up and running now. Thanks again!

  9. Gus Avatar
    Gus

    Hi Ben,
    This is odd, it looks like everything is set up correctly. I have the Main.mxml running, connected=true subscribed=true, no errors thrown on test1.cfm or test2.cfm.
    But the grid never displays any session information.
    Any thoughts?

  10. Raphael Sbegue Avatar
    Raphael Sbegue

    Hi Ben,
    Would like to know if some way exists to manipulate the time of session of the user.
    For example, how much time it is logado in the system…
    Grateful. Raphael Sbegue

Leave a Reply