CF goes the Flex way – ColdFusion free for education

June 20, 2008

CF has finally gone the Flex way. I was itching to blog about this for so long and the CF team was literally holding me back…

Last night at CFUnited, we announced that ColdFusion is going to be available free for educational purposes. Quoting Ben

ColdFusion would be made freely available for educational use (including students and faculty). The program is modeled on the Adobe Flex Builder 3 Pro for Education program, and will use similar distribution and similar eligibility and verification requirements

ColdFusion is to Server developement, what Flex is to RIA. A platform for Rapid-Application-Development. Its so simple and elegent, I am amazed how so little code can achieve so less. The usual install comes with A JRUN Server, but you can choose to deploy it on the J2EE Server of your choice.

Here’s the best place to go to learn about CF

The only frustrating part is that the program is not  immediate availabile due to some delay in set up of the infrastructure. I will keep you posted on the “Going Live” announcement within the next few weeks.

This is sure to push the killer combo of Flex & CF into colleges…

Specifying an endpoint for a RemoteObject destination at runtime

June 5, 2008

When you intend to use BlazeDS or LCDS in your App, you usually start a new project in FlexBuilder and set the Server Technology to LCDS and then Set the Root folder and Context root and validate the configuration to create the project as below.

At this point, FlexBuilder adds a -services option to the compiler and sets it to the services-config.xml where the end-points for the services are set.

You can then write code as below where the destination is now configured in the config file that’s set at the location in -services option.

<mx:RemoteObject id=”artJava” destination=”ArtGallery” fault=”errorHandler(event)” showBusyCursor=”true”>
<mx:method name=”getArts” result=”onArtResult(event)”/>

If you look into the services-config.xml you will see the following lines there

<channel-definition id=”my-amf” class=”mx.messaging.channels.AMFChannel”>
<endpoint url=”http://{}:{server.port}/{context.root}/messagebroker/amf” class=”flex.messaging.endpoints.AMFEndpoint”/>

When you run the app in FlexBuilder, it substitues the {} and other variables from the configuation that you set when you created a new project and compiles this into the application. This works like a charm, but this has a problem.

Yesterday, I did an application and bundled it into a war file and send it to my friend. But when he ran it, it did not work. This was because, I had my BlazeDS installed on port 8400 while he had it on port 8080. Since my Builder had substituted the {} at compile time, the only option was to give him the whole project and get him to recompile it for his configuration.

Thanks to Sujit, I discovered that you can not go this way and make this generalized by injecting these values at runtime, rather that these being at compiletime.

The trick is Read the rest of this entry »