ColdFusion Builder Extension Won’t Install But Will Import

I’ve run into this problem quite a bit, and it came up on a post about Ray Camden’s ORM Scanner.

So the conditions are:

  • User tries to install extension
  • Install option does not work
  • They unzip the file
  • User imports the extension
  • The extension works

Two subtle pieces of information that don’t always get reported:

  • Extension user on Windows
  • Extension author on Mac

This particular problem doesn’t appear if:

  • Author uses PC
  • User uses Mac

The cause of your woes:

.DS_Store files.

I’m not entirely sure why.

To combat this I build all of my extensions with ANT. (I know we provide a packager, but the work flow doesn’t work for me.) Here’re the relevant ANT targets:

 

<target name=”build.copy.files” description=”Create a installable version of the source code.”>
<echo message=”Copying Files to Build Location”/>
<copy todir=”${build.dir}” preservelastmodified=”true”>
<fileset dir=”${dev.dir}”>
<exclude name=’settings.xml’/>
<exclude name=’settings.properties’/>
<exclude name=’.project’/>
<exclude name=’.settings’/>
<exclude name=’build.xml’/>
<exclude name=’**/.DS_Store’/>
</fileset>
</copy>
</target>

<target name=”build.zip” description=”Creates a zip file of the build.”>
<echo message=”Creating Zip File”/>
<zip destfile=”${package.dir}/${app.name}.zip” basedir=”${build.dir}”/>
</target>

ColdFusion Builder GO!

I’m happy to announce that this morning, at 12:00 AM EST*  ColdFusion Builder has been released and is available for purchase. Before I tell you how kick ass ColdFusion Builder is let me answer the questions everyone has asked me that I’ve had to be coy about for the past few months.

When will it be released?

TODAY!

How much will it cost?

ColdFusion Builder Standalone will cost $299 and will include Flash Builder Standard. That’s right; you get ColdFusion Builder and Flash Builder for $299.

Flash Builder Premium will also include ColdFusion Builder for the price of $699.

Where do I get it?

http://www.adobe.com/go/coldfusionbuilder

Okay, that’s out of the way. Let’s talk about ColdFusion Builder.

I love ColdFusion Builder. Sometime during the betas I switched over to using ColdFusion Builder, and I haven’t looked back. I’ve put up with reinstalling over and over and over again through 3 public betas, and several private alphas, and several private refreshes. I’ve done this because I was excited with every drop to see what our engineers added. With few exceptions every release was a phenomenal leap over the previous versions.

Of course I’m going to say this, because I work for Adobe, right? Well I’ve griped, but gripes go inward, not outwards. (At least in the written form 😉 )

It’s not hard for me to pick my favorite feature: ColdFusion Builder Extensions. Extending an IDE isn’t a new concept. We chose Eclipse as the platform for ColdFusion Builder precisely because it was designed to be extended. But the fact that ColdFusion developers can extend Builder with the language in which they are expert instead of dropping down to Java and Eclipse development is huge. It makes the development of plugins have almost no barriers to entry. Have an idea? Write 50 lines of code and XML and there it is. We’ve already seen 30 extensions up on RIAForge before ColdFusion Builder is even out of beta. I am continuously impressed at what the community is doing in this space, and I can’t wait to see what they do after today.

Check out for yourself what the community has done at the ColdFusion Builder Extensions section at RIAForge.

It’s tough to get a sense of how good a product is when you are working this close to it. You don’t know if you have something, or you’re suffering from groupthink. But some people will always find fault, some people will always love everything. You have to throw away those opinions and focus on the rest. Doing this, I think the verdict on ColdFusion Builder is that it is a great product, an impressive 1.0 product, and it still has lots of potential for which to strive in future versions.

I think the engineers, and product manager (Adam Lehman) deserve a round of applause (and several rounds of whatever they want to drink) for their efforts.

Go get yourself some ColdFusion Builder today!

 

* Or possibly earlier.

ColdFusion Builder Extension Using Flex

So, buried in the documentation around ColdFusion Builder is the fact that you can write extensions in Flex. I decided to fool around with this for a bit.

If you want to skip all of the demo and explanation and just try it out, feel free to pull down the extension:

Builder Stats at RIAForge

 
http://vimeo.com/moogaloop.swf?clip_id=9946314&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

Builder Stats – ColdFusion Extension with Flex from Terry Ryan on Vimeo.

 

So doing it is pretty easy on the Builder side:

  • Create a remote service CFC for all of the information that you want to expose to Flex
  • Have your ColdFusion Builder extension pass information to the Flex generated SWF
    • Pass any variables to the SWF just like you would pass URL variables

On the Flex side:

  • Pull in the remote service cfc as a WSDL* using Flash Builder’s Data/Services
  • Write your Flex app to use the services that get created
  • Alter the generated ActionScript classes to use a WSDL that is passed into the SWF via the URL (Flash Params)

One more thing:

I’m not sure if this is a Flex thing, a ColdFusion thing, an OS thing, a webservices thing, or a me being dumb thing, but the automatically generated WSDL for my remote service CFC was different on Windows and Mac. Consequently the SWF could call the Mac hosted WSDL but not the Windows hosts WSDL. My solution? Create a static WSDL file that had the service spelled both ways. Maybe a hack but worked like charm.

Anyway, if you want to see the code, it’s available on github:

*WSDL? Why not Flash Remoting (or ColdFusion in the Data/Services list)? Remoting needs to be configured to each system’s configuration, and isn’t very discoverable. WSDL doesn’t require knowing about the Extension user’s AMF setup; it just uses a URL, which can be easily discovered.

 

Builder Extension using HTML

One of the cooler features of ColdFusion Builder’s extension tooling is the ability to create extensions that are driven with HTML/JS/CSS instead of with the default XML options. I think this has a few advantages:

  • Allows interface options enabled by the XML options
  • Allows better branded extensions via CSS and background images
  • Allows you to develop/debug your extensions like normal web applications

This is pretty easy to enable. Normally you would have code like this in your handler to communicate back to the IDE:

<cfheader name="Content-Type" value="text/xml">
<response status="success" showresponse="true">
    <ide >
        <dialog width="600" height="400" />
        <body>
            <![CDATA[
                Some Response
            ]]>
        </body>
    </ide>
</response>

Instead you pass a URL parameter to the ide tag in your extension handler:

<cfheader name="Content-Type" value="text/xml">
<cfoutput>
<response showresponse="true">
    <ide url="http://localhost/extension/handler.cfm?configPath=#configPath#" >
        <dialog width="655" height="600" />
    </ide>
</response>
</cfoutput>

As you can see it can even handle URL variables.

Now, where I ran into trouble with this was with the URL itself. Basically you can’t be sure of the URL when dealing with extensions. It could be localhost, but it just as easily could be on a remote server. So I was all clever and wrote some code to handle this:

<cfset baseURL = "http://" & cgi.server_name  />
<cfset messagesPath = getDirectoryFromPath(cgi.script_name) & "/messages.cfm" />
<cfset messagesOptions = "?type=notanapplication" />
<cfset messagesURL = baseURL  & messagesPath & messagesOptions >

 

You see, this will give me the correct URL to use to pass information to a template named “messages.cfm” that sits in the same folder as my handler. I use CGI variables to grab the server information. Then I use getDirectoryFromPath to make sure that I get the real relative path of the folder that the extension is sitting in (as opposed to assuming that it lives in the webroot). This works great.

Except I got reports of one of my extensions not working at all for some people. Look at that code again… There’s another big assumption there. The assumption is that the extension is being called over the default http port, which for many ColdFusion developers it isn’t. So the correct version of this code goes:

<cfset baseURL = "http://" & cgi.server_name & ":" & cgi.server_port />
<cfset messagesPath = getDirectoryFromPath(cgi.script_name) & "/messages.cfm" />
<cfset messagesOptions = "?type=notanapplication" />
<cfset messagesURL = baseURL  & messagesPath & messagesOptions >

Doing this you can be sure that you hit the right URL regardless of:

  • Server hostname
  • Server http port
  • Relative location of extension to the webroot

Happy extension building.

Apptacular Update and Video

I know I’ve been quiet of late. But I’ve been working.

You see a few weeks ago I had this checklist up on the site:

  • Make sure apptacular_blog database works on MySQL on MAC.
  • Make sure apptacular_blog database works on MySQL on PC.
  • Make sure sakila database works on MySQL on MAC.
  • Make sure sakila database works on MySQL on PC.
  • Make sure apptacular_blog database works on MSSQL on MAC.
  • Make sure apptacular_blog database works on MSSQL on PC.
  • Make sure adventureworks database works on MSSQL on MAC.
  • Make sure adventureworks database works on MSSQL on PC.
  • Fix major issues in code readability.
  • Start Document how to work with Apptacular

See those AdventureWorks database items? They nearly killed me and made me want to stop work on Apptacular. AdventureWorks is like a cruel Double Dare obstacle course for code generation:

  • Composite primary keys
  • Composite foreign keys
  • Composite primary keys that are also foreign keys
  • Custom Datatypes
  • Constraints (Really only affected unit testing).

I came through, and now I can give you this list:

  • Make sure apptacular_blog database works on MySQL on MAC.
  • Make sure apptacular_blog database works on MySQL on PC.
  • Make sure sakila database works on MySQL on MAC.
  • Make sure sakila database works on MySQL on PC.
  • Make sure apptacular_blog database works on MSSQL on MAC.
  • Make sure apptacular_blog database works on MSSQL on PC.
  • Make sure adventureworks database works on MSSQL on MAC.
  • Make sure adventureworks database works on MSSQL on PC.
  • Fix major issues in code readability.
  • Start Document how to work with Apptacular

So that’s where I am. A few of you asked if you could get your hands on Apptacular and I would be happy to distribute it to individuals. I’m not ready for general availability yet though.

And as a final note, I thought I would share this feature with you: Apptacular can model CRUD for image fields in your database.

http://vimeo.com/moogaloop.swf?clip_id=9159214&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

Apptacular ColdFusion Builder Extension – Working with Images from Terry Ryan on Vimeo.

Builder Stats

You may have seen my previous posts about Apptacular. I’m getting pretty far along in it, and I wanted to figure out how many lines of code I had written, you know, for my only curiosity’s sake. There’s no easy way of doing this, but I figured that this was the perfect excuse to build another extension.

So basically I wrote an extension that will count every nonblank line in every file in a targeted folder. It then groups those line counts by folder, extension, and then just all files.

This extension isn’t going to change anyone’s life. But it’s a great example of the fact that ColdFusion Builder extensions remove barriers to entry for this sort of thing. If I had to drop to Java to extend this in Eclipse I would have never done it – too much work for too little reward. But with ColdFusion Builder extensions in ColdFusion there’s very little cost to indulging in this sort of experiment:

  • 10 minutes to write the base code
  • 10 minutes to turn it into an extension
  • 1 hour getting the formatting right to share publicly. (CSS is sadly harder then ColdFusion)

Feel free to use it, and improve on it: BuilderStats at RIAForge.

Apptacular Plans

A few people have asked: When will Apptacular be released?

Short answer: I don’t know.

Long answer: I have a plan. Read on.

Before I release Apptacular, I want to make sure that it’s solid. Right now it works with the database I have but I know it will fall down when it hits a “real” database. The fix for that problem is to run it against demo databases that come with various RDBMSs. I’m targeting sakila for MySQL and AdventureWorks for MSSQL.

Also the source is somewhat hard to follow. There is no documentation. Most people won’t give a project a second look unless the documentation can at least get them started. Most potential contributors won’t even try to jump in unless the source is manageable.

So to those ends I have sort of a checklist to go through before I release the extension and code:

  • Make sure apptacular_blog database works on MySQL on MAC.
  • Make sure apptacular_blog database works on MySQL on PC.
  • Make sure sakila database works on MySQL on MAC.
  • Make sure sakila database works on MySQL on PC.
  • Make sure apptacular_blog database works on MSSQL on MAC.
  • Make sure apptacular_blog database works on MSSQL on PC.
  • Make sure adventureworks database works on MSSQL on MAC.
  • Make sure adventureworks database works on MSSQL on PC.
  • Fix major issues in code readability.
  • Start Document how to work with Apptacular

So I’ll keep you all up to date on where it is. If you want to test it ahead of time, and are willing to deal with bugs, then drop me a line in the comments.

Apptacular ColdFusion Builder Extension – Unit Tests

I just cannot get enough of making videos for Apptacular it seems. This latest one is about unit tests, specifically MXUnit tests. I need to test if Apptacular is creating applications properly. I wrote up some traditional unit tests for my code, but I really need to test the code that Apptacular makes. So I got it to generate unit tests that help me determine if the applications that Apptacular creates actually work. However, in the process I have to wire up a few things that make it really easy for you to get started writing unit tests in your applications. So it’s a win-win.

The generator does some smart things like wiring up ORM tests that test across many-to-one relationships. (I haven’t figured out how to do one-to-many or many-to-many yet.) Anyway, check out the video.

http://vimeo.com/moogaloop.swf?clip_id=8264930&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

Apptacular ColdFusion Builder Extension – Unit Test from Terry Ryan on Vimeo.

Apptacular ColdFusion Builder Extension – Working with Flash Catalyst and Flash Builder

For my next Extension trick, I want to show how to use Apptacular to jump start your Flex development. Apptacular by default creates remote services that are compatible with Flex. Flash Builder 4 has a new tool called “Data/Services” that makes working with ColdFusion remote services simplistic. Too simplistic. “Oh crap, what happens if my boss finds out I have all of this free time now” simplistic.

This demo will take you from a Flash Catalyst driven front-end to a Flex application back-ended by Apptacular created ColdFusion services.

http://vimeo.com/moogaloop.swf?clip_id=8227342&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

Apptacular ColdFusion Builder Extension – Flash Builder and Flash Catalyst from Terry Ryan on Vimeo.

Apptacular ColdFusion Builder Extension – Aesthetics

My last post and video dealt with how Apptacular could scaffold together your application. This post and video will talk about making that application look more like you want.

First off, everything has a display name. That display name is altered in the data model tools of Apptacular or in the XML directly. Then you might want to alter what column gets used when your table shows up in another table’s interface because of a relationship. This is called a foreign key label. This is also editable in the configuration. After you get all of your labels done right, you want to order all of your columns correctly. You guessed it; it’s done in the configuration tools. Finally, you might want to make up columns to use in your various labels. Apptacular has the concept of “virtual columns”, which will allow you create custom getters for things like concatenated or formatted columns.

Once you get past interface issues, you may want to change application structure, move code around, or fine tune choices. This is done through the Application configuration. You can also detect obsolete code and have it removed automatically. Finally, if you are so inclined, Apptacular includes a login piece that can add an easy authentication form to your application.

So still a work in progress, hopefully this creates a good starting place for applications. My next post will talk about integrating this back-end into a Flex front-end.

http://vimeo.com/moogaloop.swf?clip_id=8175252&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

Apptacular ColdFusion Builder Extension – Aesthetics from Terry Ryan on Vimeo.