Stretch Media
home services Solutions news about us Blog contact us

ColdFusion & Flex Hosting

If you knew me, you'd know that this post is about the last thing you'd expect coming from me. However, after recent experiences, I can't help but put a word out for GoWest Hosting.

I've been focusing on a full-time job for the last 2 years now, and as a result, my consulting business has all but ceased to exist. I've maintained a dedicated server to maintain previous clients over this time, but financially, it just wasn't making sense any more. Therefore, I undertook the arduous task of transitioning clients off of it so I could get rid of it (and its expensive monthly cost) because I wasn't recouping the cost from hosting fees.

I've put this off for 2 years because the thought of finding a compatible hosting company to support the ColdFusion and database services most of my projects required plain scared me. With all the remoting-config.xml and services-config.xml (not to mention data-management-config.xml with LCDS) to setup I figured it was going to take a very understanding hosting company to maintain these sites.

I found just such a company in GoWest hosting. I have used other services in the past, and most recently an Adobe endorsed provider for the Austin Flex User Group site (I won't mention names, but it shouldn't be too hard to track down who they are). The service and support from this (and other, but especially this) company was absolutely pathetic. I've found that too often these days it's easy to just expect sub par services and support because it seems to be becoming the norm... and so you just deal with it and think 'hey, it could be worse i guess'. Seriously though... a lot of times customer support is literally becoming an afterthought (eg. Dell's troubles in the past few years, and their 180 reversal to try and gain back disgruntled customers).

When I first contacted GoWest to ask them if they could support what I needed, not only did I get a quick response to the positive, but also an offer to setup a trial account and test it out before committing to a hosting plan. I took them up on this offer, and in fact their system did support what we needed, and was easy... really easy... to setup. It literally took me 10 minutes to ftp contents directly over, backup and restore the database, and fire up the site. Not one glitch in the process, and all done through their control panel interface. I immediately sent them an e-mail stating my joy over this.

There was a bit more correspondence to come in setting up the ColdFusion services, and after a thread of about 30 emails back and forth we did get it working. Now, I'd like to step back and point out again, I hadn't given them a single dollar yet, and we could have potentially hit a roadblock in the setup which could have resulted in me saying 'thanks for your help, but I'm gonna have to look elsewhere'.

This didn't happen and everything got transitioned over just fine. GoWest is now the new hosting provider for my clients, and I know they're in good hands given the service I received during the process.

That's my pitch for the day... and hope that more Flex/CF developers read this and look to GoWest for their hosting... I know I will be in the future.

http://www.gowesthosting.com

Dynamic Datasources with Flex & LCDS

Here's some info from recent posts I made re: a feature I was trying to figure out using ColdFusion, Flex and LCDS... the ability to change the database being used by destinations for different client logins.

ORIGINAL POST:

I'm hitting a wall on a requirement for a Flex application which utilizes the LCDS version included with ColdFusion.

I have the project setup to use DAO's, Assemblers and ValueObject (cfc's) which I call from Flex via DataService implmentation and the fill(), getItem(), etc... methods.

I need to setup my ColdFusion layer to access multiple datasources from the same Flex application. However, because of the way LCDS gets called from Flex, it doesn't seem that Application or Session variables in ColdFusion persist when I set them. I was thinking I could just have the HTML (cfm) wrapper page for my Flex application set that, but it is not recognized when I go to make a fill or get call against the assembler.

I thought about passing the datasource as a parameter each time a call is made, but while that would work when I initiate fill and get methods, the sync methods are "invisible" and I wouldn't be able to append an argument to them.

So my issue is... how do I go about having ColdFusion read a dynamic variable to define it's datasource?




ANSWER:

Tom Jordahl provided the answer on this for me. Here's the solution:

1) Prior to implementing this solution, it's important to realize that because LCDS manages the data, switching datasources dynamically could potentially cause issues if there is overlap between identifiers on the records you are retrieving. In my case, I'm using GUID fields as primary key and identifiers in my destinations, so this is not a problem. However, for example, if you were to use an incrementing integer for the identifier, then you could feasibly have LCDS managing a record, which would match identifiers with a record if you switched datasources on the fly.

2) I'm using ColdFusion as my middle-tier layer, but this could be applied to any form by accessing the flex.messaging.FlexContext class within your solution of choice.

3) The solution involves extracting the ID value of Flex client which makes calls against your Destination. Grab the identifier by calling FlexContext.getFlexClient().getId() to get a unique key for the "session". I use the term "session" loosely, as it's really just representative of the particular swf instance which has been loaded with your Flex Application. However, the ID doesn't change and persists across all calls you make against your destinations.

4) On application load, make a call to your CF layer which gets the ID, and sets it to the Application scope of the CF server as follows:

<cffunction name="set" access="remote">
<cfargument name="datasource" type="string" required="yes" default="">
<cfset var clientID="">
<cfscript>
clientID = CreateObject('java', 'flex.messaging.FlexContext').getFlexClient().getId(); APPLICATION[clientID] = arguments.datasource;
</cfscript>
</cffunction>


The function above receives a unique string which I want to be my datasource of choice. You could call this "set" function again anytime to reset the Application variable for this "session".

5) The only other thing to do, is now access this Application variable for each datasource.

datasource="#APPLICATION[CreateObject('java', 'flex.messaging.FlexContext').getFlexClient().getId()]#"

6) The last consideration is that each connection that is made via Flex will be setting a new variable in the Application scope on the Coldfusion server. This is a pretty minor concern for me, and I'll just run a schedule to clear the Application scope once a day, but if you have a high volume of users, a better solution would have to be found.

Installing CFEclipse/Subclipse plugins on FlexBuilder 3

A co-worker sent me this post for installing things through software updates. Issue is, trying to install through update sites would result in error:

Eclipse Modeling Framework (EMF) - org.eclipse.emf.codegen.ecore.ui (2.3.0.v200706262000) requires plug-in "org.eclipse.jdt.core".

Joao (Fernandes?) has posted the solution over on his blog:

Link Here

Note the comment I added about having to check a second option labeled:

'Eclipse Java Development Tools 3.3.1.r331_......' as well to get it to work.

Thanks Joao!

Export to Excel with Flex 2.0 and ColdFusion

Hi,

I didn't really find a suitable solution for exporting to Excel after a bit of searching through forums and blogs, so I came up with the following. I wanted to achieve seamless "click to generate a report" from Flex and have the file option dialog popup in the browser allowing me to open or save. Here's what I came up with. While I don't see any issues with the solution, I realize it's a bit of a hack, and would appreciate any CF wizards letting me know if this is going to create problems.

From Flex, I'm calling a CFC function with my data being passed back as an array. The CFC takes the data and stores it to an application variable in CF. I then send a trivial result back to Flex. On the CFC result inside Flex, I make a call to a template CFM file which uses the cfcontent tag to generate the excel file from an html table structure I build with the saved application variable data.

CFC

<cffunction name="exportToExcel" access="remote" returntype="any" output="true">
<cfargument name="data" type="array" required="yes" default="" />
<cfset session.exportData = #ArrayNew(1)#>
<cfreturn 'true'>
</cffunction>


Flex

if(event.result == 'true')
{
var request:URLRequest = new URLRequest(URLToCFTemplate);
flash.net.navigateToURL(request, "_self");
}


Brendan

Updated: Download the source files here - Download

CF Flex Connectivity Setup

Good God... I don't think this could have possibly been more frustrating...

I finally figured out the method behind setting up the CF-Flex Connectivity this afternoon. I'd setup the default "ColdFusion" destination out of the box, with a minor adjustment to the channel uri setting a few weeks ago. However, I decided this afternoon that I would get it setup so that I could easily copy from my development environment over to production (both have CF and the CF Connectivity installed). So I wanted to setup two different destinations, one for my local instance, and one for the production instance.... that way when I was ready to deploy to production just test locally, and move it over if all was good.

The solution ended up involving the same version of the flex-gateway-config.xml file to be placed in each location, which had destinations for both the local development box as well as production box. Before moving over to production, change the destination to the production box, test locally, and if al

BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.