Conduit

PDF HTML FlashPaper

Installing Conduit

The following steps should get you up and running with Conduit in no time!

Library Installation

  • If you haven't fulfilled the Conduit Requirements, please do so now.
  • Turn off ColdFusion.
  • Download Conduit. Stable Release (forthcoming) , Daily Build
  • Unzip the .zip file.
  • Place the conduit.jar in your '{ColdFusionHome}/lib' folder. (This is the same folder you will find flex-messaging-common.jar, flex-messaging-core.jar etc)
  • Place the /conduit folder somewhere (non web-accessible is best, as we will be creating a CF mapping for it in the next few steps)
  • Start up ColdFusion
  • Login to the ColdFusion Administrator
  • Create a mapping called /conduit that points to where you put the /conduit folder.
  • Turn off ColdFusion

You now have all the right libraries, in the right places.

Configuration

  • Open {ColdFusionHome}/wwwroot/WEB-INF/flex/remoting-config.xml
  • Add to the <adapters> section:

<adapter-definition id="conduit" class="com.compoundtheory.conduit.adapters.ColdFusionAdapter"/>

  • Add a new destination with the following code:

<destination id="Conduit"> <channels> <channel ref="my-cfamf" /> </channels> <adapter ref="conduit" /> <properties> <source>*</source> <cfcs> <!-- Whether or not reload the CFCs below on each request. Useful for debugging when building new invokers,serialisers or deserialisers --> <reloadcfcs>false</reloadcfcs> <!-- The CFC that invokes the remote method call --> <invoker>conduit.core.CFCInvoker</invoker> <!-- Translates CF=>AS3 --> <serialiser>conduit.core.CFSerialiser</serialiser> <!-- Translates AS3=>CF --> <deserialiser>conduit.core.CFDeserialiser</deserialiser> </cfcs> <access> <!-- allow "public" (which is public or remote) or just "remote" methods to be invoked. If not specified, "remote" is the default --> <method-access-level>remote</method-access-level> </access> </properties> </destination>

An example of the remoting-config.xml can be found in the download zip file, under /config.

This creates a Destination for the general invokers, serialiser and deserialiser that ships with Conduit.

  • Restart CF.
  • If you started CF via the command line, you may see some output after the MesasgeBrokerServlet init's, depending on what version you are running, and your debug settings (The daily build usually has a lot of System.out.println() and/or Logging calls in it).

Usage within Flex

  • Assuming you are using the Destination set up above, you can use <RemoteObject> in Flex like you would normally for a usual ColdFusion Remoting call, but set the destination to 'Conduit'

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init();"> <mx:RemoteObject id="service" destination="Conduit" source="flexrecursive.Remote"> <mx:method name="doSomething()" fault="onFault(event);" result="onResult(event);" /> </mx:RemoteObject> <mx:Script> private function init():void { service.doSomething(); } private function onResult(event:ResultEvent):void { //do something } </mx:Script> </mx:Application>

Installation Issues

If you have any problems, please refer to Debugging with Conduit, and/or post to the mailing list.