Archive for March, 2006

Uncategorized

Using Reactor with Flex 2

A while back I posted on my usage of ARF!,ColdSpring and Reactor with flex 1.5. I promised to talk about how I was using it and what I was doing. Well I promptly got sidetracked and it never happened. So to make up for that I wanted to talk about what i have learned about using Reactor with Flex 2.

A little background first. I am working with reactor from svn. I dont have any idea when the last zip file was released but my codebase is current. And as such some of the things I might mention may not be in the latest public zip and also require that you have a small understanding of Reactor.

The most prevelant example of CF and Flex 2 integration right now is Ben Forta’s Phone selector example. In this example our Flex 2 gui connects to a remote service object. That remote service object has a getProjects() method which returns an array of Phone objects. His Phone.cfc is generated from the nifty RDS eclipse plugin that Adobe is working on. In that respect the steps he went through are very similiar to what we would do in reactor. Except we wouldnt do our code generation ahead of time.

If this example was to be done in reactor then our remote service object would create an instance of our reactor factory, use it to create an iterator for our phones, then our iterator to loop through our phone objects.

You might think this is enough, but in truth returning these objects would get us no data. In reactor our data is actually containd in Transfer Objects. So we need to return the actual TO of our Phone object. Right now the easiest way to get that data is to create a getTo method inside our Record Object. This file will be created in the location we specify for “mapping” in our reactor config. The function in its simplest form might look like:





With that in our Phone record object our getPhones() method might look like ( we like hypothetical code ):









With this we now return actual data now to our flex gui, so all we need to do is update the [RemoteClass] compiler binding in our Phone.as object. Depending on how you set your reactor “mapping” in the config. Mine looks like:


[RemoteClass(alias="phoneDemo.data.To.phoneTomysql4")]

This is the basics of what you need to get your reactor code working with Flex 2. Stay tuned for a new sample project i am working on which uses Reactor, ColdSpring and Flex2.

[UPDATE]
Ok, so I forgot one thing. You also need to add the cfproperty tags to your TO that is being returned. The trick is to make sure that the cfproperty tags are defined in the same order as the instance properties of your AS object.

Uncategorized

CF.Objective() Wrap-up Post

Wow, what a weekend. I have been home for 2 days and I am starting to feel like I am getting caught up. It was an amazing weekend with so many great sessions. I am so glad I went.

My last 2 presentations went pretty well. The subversion talk is one I have decided is very hard :) Its something where I feel its so important, but it sometimes requires a change to your workflow, and people dont always like to hear that.

My 3rd session was a fill in session where I talked about Flex Enterprise Services and using messaging to talk with CF 7. I think the session went very well. There was lots of head-nodding and smiling which leads me to believe people were getting it. I also talked about the new Event model in AS3 which I think is very cool but also something that can trip up new users.

All in all it was a great time. If you came to one of my sessions and have any questions feel free to drop me a note.

There were a couple of moments over the weekend when I found myself taking pictures. I posted those to flickr so if you are interested you can see those here

Uncategorized

1 Presentation Down - 2 to go.

I just finished my first presentation of the conference, “CFEclipse: A guided tour”. First session of the day (after Tom Jordahls rocking key-note) and as they put up the partitions I found I was in a room with no projector. It didnt take long to get set up, but I still only had 40 minutes to finish the sesion.

I rushed a bit, but I did cover everything. I am so glad I didnt try to fit more in. I think everyone walked away with something. I saw a lot of smiles and head nodding, so i am going to call this one a win.

Next presentation: “Subversion” and its at 10am tomorow morning. Right after Hal Helms keynote.

Uncategorized

CF.Objective() here i come

I am sitting here enjoying the wonderful free wi-fi at the portland airport. I am waiting to board my flight to head to the cf.objective() conference this weekend. I will be presenting 3 sessions at the conference this weekend. The first one is “CFEclipse: A guided tour” where I talk about Eclipse, CFEclipse and the features they bring to your development. The second session is on “Subversion SCM” which I will cover why you should use Subversion and how to get started. The third session is one I just picked up a couple days ago. I will be filling in a session and talking about my recent experience with Flex Enterprise Services and how you can use them with CF. I will probably rely heavy on the flexMessage app since i have only had a couple days to prepare.

Anyway, if you are at the conf, drop on by and say hi. I always like making new friends :)

Uncategorized

Introducing flexMessage 0.1 - My first FES application

When I saw ben forta present on Flex 2 I was really excited to build something fun. I wanted to make sure it was something that really showed off how easy CF and Flex were to build things. But I wanted it to be something that could be potentially useful. So what did I do? I wrote an app I am (for now) calling flexMessage.

flexMessage is a CF/FES application that is a GUI for the Google Talk IM service. Currently the functionality is quite lacking, but it is a working example. It has a contact list that updates live based on user status. If a buddy goes “away” the display is updated immediatly. Also it uses a tab navigator to seperate seperate discussions with your buddies. See example below:

Its got a long way to go before I would consider it something for users to learn from but at the same time I believe in the betterment of software through community involvement. So I am releasing the code for the project. I have also set up a Trac site for wiki and bug tracking. Please feel free to add to the wiki as well as fill out enhancement requests.

Subversion: http://svn.simb.net/flexMessage

Trac: http://projects.simb.net/flexMessage/trac.cgi

Please feel free to direct any questions or comments to simeon at simb dot net. I already have plans for alot of refactoring, but my first goal was to get something that works. And since this does technically “work” its the first milestone on this project :) Have fun

Uncategorized

Flex Enterprise Services messaging with CF

I was pretty excited about this new functionality when I saw Ben Forta present on it at the Seattle CFUG last month. I thought it was pretty amazing how easy it was to send messages from ColdFusion to FES. Ben showed us his simple messaging app as well as his session tracker. I couldnt wait to build something myself.

Well the first step was getting one of Ben’s apps working locally on my machine. Normally I wouldnt think twice about this but as i am doing all my testing on my mac there is alway a bit of mystery. Anyway, I choose to set up his simple cf to flex message app. It didnt take much work at all to get this working.

My next step was to test sending messages from flex back to cf. Here i had a bit more trouble. After working several hours with config files and visiting with my buddy jared about it. The solution was quite unimpressive. In setting up the communication from cf and flex you have to enable the ColdfusionGateway destination in flex-messaging-service.xml. In this one of the options is to specify your gateway id and gatewayhost. haveing gatewayID = * and the gatewayhost commented out I was able to recieve messages in flex but not send. In order to send messages from flex to cf it required that the gatewayid = the actual name of the gateway you created in cfadmin. Also in order for the rmi to bind correctly, I found that the gatewayhost had to be set to 127.0.0.1 . My config file looks like this now.








Flex2CF
127.0.0.1







With the abilty to communicate between flex anc cf (in real time) at hand, I decided to undertake a project. Stay tuned for more information on flexMessage. My Flex Enterprise Services interface for Google Talk.

Uncategorized

Webservices in FES

This is mostly for my reference for later. Rich Tretola posted yesterday about getting WebService setup in FES. If you are planning on using webservices in Flex Enterprise Services this could be a great reference.

Uncategorized

ColdFusion Gateway for Flex Enterprise Services

I have started playing with the ColdFusion to FES messaging over the last couple days. I have had some successes and some road blocks. But I dont seem to have many folks on my IM list that are doing CF/FES2 stuff yet.

Is anybody out there started on this path? I would love to get you on IM/Email and chat about it.

Post a comment if you are interested and I will get ahold of you.

Uncategorized

Compiling Mystic Compatible Flex 2 SWF’s with Ant

I previously posted on how I was able to get the files that make up the Flex sdk. I also posted an ant script (thanks rob) that allows you to compile those to swf’s so you can test out flex 2 on the mac.

Yesterday I outlined the steps nessicary to get the Mystic updater running on mac and linux as well. But without a swf that uses the remote object calls you can’t really test out that installation.

So adding this functionality is very simple. It is actually the same functional steps required when using Flex builder. What we have to do is tell the mxml compiler where the xml config file is that tells it what to do with our new “ColdFusion” remote object destination

So one of the files that gets installed when you run the Mystic cf updater is the {WEB-INF}/Flex/flex-enterprise-services.xml. I grabbed a copy of this file and put it in the /flex/frameworks/ folder that I created when setting up my sdk files. Make sure that line 36 (or so) of that file has the correct port for your mystic instance.

Now in your Ant file you need to add one more argline to my compile task.



This tells the compiler to look for the information on services in that file. If you want to put your xml file somewhere other than in frameworks, this is where you tell the compiler how to find it.

So just for the record this is how my Ant file looks now.















« Prev