Eclipse 3.4.1 Ganymede, MXUnit, Flexbuilder 3 on MacOSX

After a few minutes of thrashing with a incompatibility issue that was giving me trouble installing MXUnit in Eclipse 3.4.1 I found a work around I thought other people might benefit from.

First the back story. I had Eclipse 3.3 running happily on my Mac with Flex Builder, CFEclipse, SVEclipse, etc... Then I tried to install MXUnit, and I kept running into a incompatibility issue. Oh well I thought, I guess it's an excuse to upgrade to a newer version of Eclipse.

So I downloaded Eclipse 3.4.1 Ganymede and proceed to install all my usual plugins including Flexbuilder (I kept a copy of by 3.3 install just in case though). When I tried to install MXUnit though it again complained about an incompatibility. It looked something like this:

Cannot complete the request. See the details. Cannot find a solution where both Match[requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.equinox.preferences/[3.2.201.R34x_v20080709,3.2.201.R34x_v20080709]] and Match[requiredCapability: org.eclipse.equinox.p2.iu/org.eclipse.equinox.preferences/[3.2.200.v20080421-2006,3.2.200.v20080421-2006]] can be satisfied.

I did find something on Google similar to this: http://forum.springframework.org/showthread.php?t=63187 But the solution in that thread was to manually install a pre-release version of equinox which I didn't really feel like messing with.

I looked at the incompatibility message a little closer (I didn't include the whole thing above because it was sooooo loooong) and saw it mentioned Flex Builder which I had already installed successfully. It seemed to suggest that Flex Builder was causing the incompatibility issue.

Just for laughs I decided to try uninstalling Flex Builder and then install MXUnit. SUCCESS! What's more after MXUnit was installed I had no problem installing Flex Builder.

I never would have guessed it, well I suppose I did stumble upon it but I didn't really thing it was going to work. Flex builder must be a little more flexible (ha) in regrards to which version of the equinox plugin is installed.

I wonder if the same workaround would have worked with 3.3, probably. No time to check now though gotta get back to work using shiny new eclipse 3.4.

CFQRCode

Here is a simple proof of concept QRCode generating cfc that I glued together a while ago. You should be able to just unzip it and then drop the "cf_qrcode" folder in your web root and have it just work. I've only run it of CF 7 and up, but I wouldn't be surprised if it works on CF 6.1 too.

Click here to download it.

The real credit for it goes to the code/libraries it relies on:


Y.Swetake QRCode java library. http://www.swetake.com/qr/index-e.html

This is what does the process to create a QRCode. The pages for the QRCode libraries are in Japanese but Google can help anglo-only folks our there (like me). The how to create QRCode section is very informative as well.


Mark Mandel's brilliant "JavaLoader" for Coldfusion http://www.compoundtheory.com/?action=javaloader.index

For loading all the necessary Java stuff without the hassle of restarting CF.


acme.jar from ACME Laboratories http://www.acme.com/

This is just for gif encoding of the qrcode graphic. The QRCodeEndcoder.cfc could re-written to use CFImage in CF8 instead.

Finally migrated to my new server.

I have finally migrated my blog to my new server. Part of the fun was tweaking Ray Camden's BlogCFC to be PostgreSQL compatible. It really wasn't that hard because BlogCFC already had Oracle support, and PostgreSQL's and Oracle's SQL commands are pretty similar. I guess we will see if I introduced any bugs in my tweak shortly.

I should probably tweak the skin as well.

Flash Remoting with ModelGlue2

I was wondering if anyone has figured out a better way to expose a cfc for Flash Remoting or as a webservice when using MG:2 than the way I have been doing it. I know it's possible to to just target a cfc directly but I want to have Coldspring configure of the cfc I'm targeting as have the ability to use Reactor within it.

Coldspring actully has a very cool ability to create a facade of a bean for use for flash remoting. The tricky part was getting this to work with Coldspring and Reactor as part of MG:2.

Here is the way I did it:

The Coldspring documentation describes how you can create a remoting facade for a bean configured in Coldsrping, so in my Coldspring.xml file I use something like this:

<bean id="myRemoting" class="mg2test.model.remoting.myRemoting" autowire="byName"></bean>
<bean id="myRemoting_Facade" class="coldspring.aop.framework.RemoteFactoryBean">
<property name="target">
<ref bean="myRemoting" />
</property>
<property name="serviceName">
<value>myRemotingService</value>
</property>
<property name="relativePath">
<value>mg2test/remotefacades/</value>
</property>
<property name="remoteMethodNames">
<value>get*</value>
</property>
</bean>

Then I can just (but not quite) target mg2test.remotefacades.myRemotingService with my remoting calls.

There are a couple of additional things I had to set up before this would work though.

1. You have to call getBean on the bean factory for myRemoting_Facade before Coldspring will create the mg2test.remotefacades.myRemotingService cfc for you. I do this by having a setmyRemoting_Facade method in on of my model-glue controllers, and because of autowiring it is created automatically. Also it makes the the facade available in my MG controller.

2. The cfc generated by Coldspring "myRemotingService" won't be able to find a reference to the coldspring bean factory unless it is an a scope that it can access. By default it looks for it at application["coldspring.beanfactory.root"]. I got arround this by adding the following to the end of my project's index.cfm:

<cfif StructKeyExists(_modelglue, "beanFactory")>
<cflock name="setUpForRemoting" type="exclusive" timeout="10" throwOnTimeout="true">
<cfset application["coldspring.beanfactory.root"] =
application[ModelGlue_APP_KEY].framework.GetBeanFactory()>
<cfset application.reactor =
application[ModelGlue_APP_KEY].framework.GETORMSERVICE()>
</cflock>
</cfif>

I also put a reference to reactor in the application scope for easy access from within myRemoting.cfc. Both application scope references should be reset if model-glue is forced to reload (the mg2test/remotefacades/myRemotingService.cfc should be recreated too for that matter).

3. With steps 1 and 2 you won't be able to make a request directly to mg2test.remotefacades.myRemotingService until at least one regular MG request has been made.

This set up seems to work pretty well and I haven't found anything on the interweb yet describing another way of doing this with MG:2.

I wonder though, is there anyway this could be improved or simplified? Or is there a completely different way that this could be done that is far simpler?

CFUG Quarterly Meeting

The training wheels were off, and we were rolling on our own with two presentations from locals. Both presentations were similar in that both featured tools to simplify how data is managed by Coldfusion web applications but that was where the similarity ended.

Kristian Ward and David Mayerlen from UpstartX and the Pointt, gave a presentation on their product the Pointt. At first I thought it was a RAD tool or some sort of ORM tool, but now I realize it's more of a datamining/manipulation tool. I think their analogy was the best; it's like File Maker Pro for the web. Just like how with filemaker you can create "table" and "columns", and make interfaces for working with that data all without writing code. Great for clients who have need to be able to constantly update the schema of their "tables" while on a production. It suprising that there aren't more webapplications or webapp frameworks out there that provide this sort of flexibility.

Byron Bignell and Nolan Dubeau gave a presentation on cfcPowertools. CFCPowertools is a very ambitious project and is a RAD/ORM code generation tool. It's basically a webapplication that can operate a plugin for the coldfusion administrator application that can generate cfc Data Access Objects to take care of your Create Read Update Delete operations automatically from a database table. There are other tools that provide this sort of functionality like ARF, Reactor, or even CFHibernate. Where cfcPowertools distiguishes itself from the other ORM tools for colfusion is that it can create or alter the schema of a database table based on a DAO cfcs. So it can be used for code generation, or it can be used for database generation. It's compatible with most of the popular coldfusion frameworks like MachII, fusebox, and CFMVC. It doesn't limit self to just the behind the scenes code though, and this is a great demo feature, it can autogenerate the cfml code for forms, lists, and display views. It's expected that you will likely have to modify or extend any code it generates to add the business logic specific to your application but it certainly gives you a big head start.

The FITO/CFUG Cross over meeting

For our first real CFUG meeting, we got the help of the very popular Flash Users Group (Flash in T.O.) and had joint meeting at their usual place the reactor gallery.

I took the liberty of giving a presentation on the work I've done on the TAXI.ca website. Kristian Ward and David Mayerlen from UpstartX gave a presentation on their experience making a photo album for the Dove campaign for real beauty website. Nolan Dubeau and Theirry Load gave a presentation on their work for johnst.com and mijo.ca. Pat Keenan and Alan Smith of The Movement gave precentation on theundecided.ca (they used PHP for the backend but their presenation was still pretty cool :)

All in all a pretty sucessfull evening.

PostgreSQL on Reactor

I have just added PostgreSQL database support to Doug Hughes' Reactor for Coldfusion, which is a database abstraction code generator. It already supported Microsoft SQL Server, and MySQL. Oracle and DB2 support aren't far off either.

A tool like Reactor can remove a lot of the drudge work involved in putting data into and getting it out of a database. It integrates easily with all the popular CF frameworks like Model Glue, Mach II, or Fusebox. Not to mention that it also plays nice with Coldspring which is a project that has brought AOP (Aspect Oriented Programming) to Coldfusion.

I'm really looking forward to using it in future projects.

A Flash Based Coldfusion Debugger

For better or for worse I'm a mac user. One of things I thought was kind of neat while using a PC at work was the dockable debug pane for debugging Coldfusion. Unfortunately it doesn't work in Safari or Firefox, so when I switched (back) over to a Mac at work I was stuck with "Classic" debugging.

I rarely seem to use the Coldfusion debugger anymore, and I didn't really use it that much to begin with. Mainly because it gets in the way and disrupts the formatting of the HTML. When I do need some additional debugging info I can usually get it faster by inserting a cfdump or someother temporary output right in my code, rather than opening Coldfusion Administrator, logging in, turning on debugging, and rerequesting my page.

I was thinking about how the "dockable" debugger doesn't work on my mac, and how disruptive to the page the classic debugger is when it occured to me I should write my own. The debug layout code used by Coldfusion is unencrypted, and pretty well commented so it isn't that difficult to make a change or extend. I had previously made a modified version of the classic debugger, to solve a problem with the display of arguments passed to cfc functions when the arguments contain a html string.

So I made one. It works, but is by no means complete. It's more of a proof of concept, a code sketch. I made it using Flash, I needed some more AS 2.0 component experience anyway. It uses two flash movies, one on the page being debugged and one that opens in a pop-up window. The two flash movies communicate between each other using LocalConnection. As for the data I am reusing the xml data that Coldfusion generates for debugging in Dreamweaver, and passing that into the flash movie on the page being debugged as a FlashVar.

The result is a Flash based Coldfusion Debugger, capable of holding the debug data from multiple pages. Unfortunately, at this point it is a bit too slow to be useful (on my mac at least) and it runs into trouble with same sort of problem I previously had to revise the "Classic" debugger for. But it is a start.

I suspect that the speed issues are due to my over reliance on DataGrid rather than designing a proper layout, and the fact I'm reparsing and repopulating the DataGrids' dataProviders everytime I load coldfusion page. I also think that the format of the XML could be different, or at a minimum less work for Flash to consume. So there are improvements to be made.

Feel free to have a look at where I am so far with it. Let me know what you think, and if it's worth developing further.

You can download it here: http://blog.onepixeloff.com/files/cfdebug/flash-CFDebugger-01.zip

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