Calling All Devs: Mach-II Work Session - Saturday March 3rd, 2012 via Google Hang-Out

Matt, Kurt and Peter are leading a Mach-II Work Session in March via Google Hang-Out. If you're interested in helping out on the project - coding, documentation or even have a question drop on by.

When: Saturday March 3rd, 2012 from Noon - 6pm CT (10am - 4pm PT)

Where: Google Plus Hang-Out using SVN / Trac

Just follow our Google+ Mach-II page and join our public hang-out that day.  If you're coming, we'd love to hear from you now in our comments and we'll send you a reminder just a few days before!

Adobe ColdFusion 9 on MAC Lion - Fix for Hanging Admin

First let me start off that I am not a MAC owner and therefore please keep this in mind.

One of the issues with ACF9 on MAC is the use of the java.awt package to get items like the list of available printers.  The AWT package is just a wrapper for a packages that are native on the target operating system.  In this case, there are bugs in the apple.awt.CToolkit class that is the problem on MAC.

We were having an issue with Mach-II 1.9 hanging on MAC Lion recently and we narrowed it done to our use of java.awt.Toolkit.  You can indicate to the JVM that you want to use the sun.awt.* package instead which appears to have fixed the issue for Mach-II 1.9 for MAC Lion users.  The positive side effect is that it fixed the hung "Info" page in the CFIDE as well.

You probably already have headless=true in your jvm.config file, however you need another directive to use a different awt toolkit otherwise the JVM will default the buggy apple.awt toolkit.

Let me know if this fixes other ACF9 issues on MAC Lion like cfdocument.

-Djava.awt.headless=true
-Dawt.toolkit=sun.awt.HToolkit

This also fixes an issue with Mach-II 1.9 on ACF9 with CHF2 running on MAC Lion.

Free Mach-II Training at OpenCF Summit 2012 plus Hackfest

Free Mach-II Training

GreatBizTools, our commercial sponsor of Mach-II, is a sponsor of OpenCF Summit again in 2012. - February 24-26, 2012. This year's conference schedule is going to be slightly different this year with the unconference sessions and other trainings happening on Day 1 - Friday, Feburary 24th, 2012.

We're proud to announce that Team Mach-II is going to be offering FREE jumpstart to Mach-II and ColdSpring using OOP development techniques at OpenCFSummit 2012!

Where: OpenCF Summit, Dallas TX
When: Day 1 - February 24th, 2012
Cost: Free

We don't have exact details on the start/end times for Day 1 at the conference. If you want to get a leg up on OOP development using a framework in CFML, this is the year to come to the conference. Once we get more details lined up, you will be able to reserve your space at the Mach-II training.

HackFest at OpenCF Summit

Team Mach-II is running the annual Hackfest at the conference which runs all three days of the conference.  What is a Hackfest you ask?  It's an event where programmers meet for collaborative programming.  During the hackfest, we'll be building an open-source application for a non-profit. Best of all we'll be using a bunch of open-source technologies such as OpenBD, Railo, Apache, ColdSpring, Mach-II, JQuery, HSQL, OpenBD Desktop, and others.

We learned a lot about how to organize a HackFest from the 2011 conference and we're working hard to build upon last year's success to make this year's HackFest even better!

See you in February!

Mach-II Tips: Canonical Links

With the advent of dynamic database driven pages many moons ago, you can probably access the same information from multiple URLs.  How does that affect your Google rankings?  Probably adversely.  Enter the canonical URLs via an HTML meta tag which you put in the head part of your document:

 <link rel="canonical" href="http://www.example.com/directory/page.html" /> 

Canonical URLs allows webmasters to provide a "preferred" or "canonical" link that specifies the preferred version of the webpage as part of SEO.  If you have multiple ways to get at the same content, then you should be specifying a canonical link to the preferred URL for SEO.

According to Google, canonical links are just a directive but "strongly honored" accord Google search guru Matt Cutts. So it's about time you start thinking of canonical URLs.

Luckily for us, Mach-II makes it easy to create.  Here is an example using the Mach-II view custom tag library:

 <cfimport prefix="view" taglib="/MachII/customtags/view/" />  <view:link type="canonical" route="productsServices.certification.features" /> 

We support a multitude of attributes from event, route and hrefs.  Be sure to check out the documentation on using <view:link /> custom tag in Mach-II for more information.

2nd Updated with Dinner Plans: 3rd Annual Mach-II Night Out at cf.Objective()

Brit's was too busy. Meet us at the hotel bar.

Team Mach-II is happy to announce the 3rd Annual Mach-II Night Out at cf.Objective() at Brit's Pub. Luckily we'll be arriving before Happy Hour ends at 6:30 so come early to enjoy most beer at $4 pint and all apps at $6 (menu).

When: Thursday, May 12th, 2011 - meet in hotel lobby at 5:30pm, walk to Hell's Kitchen at 5:45, starting at Brit's around 7:15pm onwards
Where:
Hell's Kitchen for Dinner - About three blocks from the conference hotel (Dinner Menu)
Brit's Pub - 11- Nicollet Ave - About two blocks from the conference hotel (Map / Directions)

Brit's a pretty large place with side walk seating, two tiers indoors and outdoor bowling green seating.  If you've come in past years, then you know this.  When you arrive, the easiest place to see where we are at Brit's is to check the comments on this blog post or check the Mach-II twitter feed.

Also, no RSVP is neccessary, but we would love to hear who's coming so feel free to leave a comment.  This number helps us figure out the size tables we need.

Mach-II has reignited my passion for development! (via CFGears)

For a while now I've been in a rut. I'm not really sure of the cause, but lately I just haven't had the passion I once had for writing code. The spark seemed to be gone. I really haven't had much of a desire to work on any of my side projects, and getting stuff done for clients sometimes seems like a chore. Maybe it's because we've mainly just been doing tedious bug fixes at work for a while and no new development, or maybe it's because I lost a couple of my side contracts since they're moving away from CF. It may just be a side effect of me getting some non-programming hobbies and focusing my time on something else. Whatever the reason, sitting in front of my computer when I'm not at work is not something that I've wanted to do lately. In fact, I've found myself coming up with excuses NOT to get on the computer. But, that all changed last night.

A couple of days ago I decided to dust off one of my old pet projects and start working on it again. This particular project is a custom Mach-II CMS that I was building for a client. The client knew about it and thought it would be nice to have, but they don't really need it so there's never been a big push to get it finished. It's just something that I worked on in my spare time and if it never got finished it was no big deal. About a year ago, I decided to shelve this project and go with Mura instead (no sense reinventing the wheel, right?). Well, that didn't work out so hot, and I really want this client on a CMS, so last night I fired up Subversion and pulled down my old Mach-II project.

This was the first time I've looked at Mach-II since I stopped working on this project a year ago. Imagine my surprise when within just a few minutes of looking through the code I started getting excited about this project. Almost instantly I was looking forward to doing some development again! I actually had to make myself turn off the computer and go to bed last night. It's been a long time since that has happened, and it's been a long time since I felt like that about writing some code. I don't know what it is, but something about working in Mach-II always excites me. Maybe it's because I'm still fairly new to Mach-II and I'm learning a lot while working with it, but I really enjoy working with Mach-II. So much so, that I even try to contribute to the wiki when I can. As funny as it sounds, what really set off this excitement was realizing that the first thing I need to do on this project is set up autowiring for ColdSpring in all of my listeners.

So, yeah, I'm in full geek mode again. :) Thanks Mach-II, this is going to be fun!

Are there any programming languages or frameworks that you work with that get you excited like this?

And Eric hits the nail right on the head! It doesn't matter if Mach-II inspires you; it matters that you are inspired.

For a small soapbox moment, instead of going off and creating a new open source project run by a solo developer. Look around the CFML ecosystem and see if there are projects that you love and use that need your help. Actually, ALL open source projects need your help. So team up and help your favorite open source project instead of trying to do it all yourself. We can do much more for the CFML community if we band together and then divide and conquer. We cannot do it as individuals!

CFML needs to be:
Got Apps?

Not:
Got (More) Frameworks?

VIew Tip: Using CopyToScope()

Another tip in our series of keeping code simple in our view layer.  A lot of developers copy event-args into the variables cope at the top of a view to make looping and other miscellaneous display logic more manageable.  This bit of code becomes more complex as our views get more complex.  Take this example:

 <cfimport prefix="view" taglib="/MachII/customtags/view" />
 <cfimport prefix="display" taglib="/lightpost/cftags/display/" />
 <cfscript>
     // Get data
     variables.adminBean = event.getArg("adminBean");
     variables.formattedName = event.getArg("adminBean").getFormattedName();
     variables.adminAnpBean = event.getArg("adminAnpBean");
     variables.adminAddressBean = event.getArg("adminAddressBean");
     variables.adminPrimaryPhoneBean = event.getArg("adminPrimaryPhoneBean");
     variables.adminSecondaryPhones = event.getArg("adminSecondaryPhones");
     variables.locations = event.getArg("assignedLocations");
     // Get services
     variables.timeService = getProperty("timeService");
     variables.uiService = getProperty("uiService");
     variables.udfs = getProperty("udfs");
     // Set meta data into the event object
     getProperty("html").addMeta("title", "Administrator Details for #variables.adminBean.getFormattedName()##");
     event.setArg("meta.cacheControl", TRUE);
 </cfscript>
 

Ouch, that is a bit of code to manage.  If you look carefully, you'll notice that most copies of args from the event have the same name when assigned to the variables scope (except for a few which we'll talk about later).  This can be simplified by using the new copyToScope() method available in Mach-II 1.8+:

     <cfimport prefix="view" taglib="/MachII/customtags/view" />
     <cfimport prefix="display" taglib="/lightpost/cftags/display/" />
     <cfset copyToScope("${event.adminBean}
             ,${event.adminBean.formattedName}
             ,${event.adminAnpBean}
             ,${event.adminAddressBean}
             ,${event.adminPrimaryPhoneBean}
             ,${event.adminSecondaryPhones}
             ,locations=${event.assignedLocations}
             ,${properties.timeService}
             ,${properties.uiService}
             ,${properties.udfs}") />
     <view:meta type="title" content="Administrator Details for #variables.formattedName#" />
     <cfset event.setArg("meta.cacheControl", TRUE) />
 

Wow! That's a lot less code than before.  Let's look at two special cases.  If you compared the two code blocks, notice that ${event.adminBean.formattedName} is not only getting the admin bean, but also making a call to a getter.  CopyToScope() uses the Mach-II Expression Language Syntax and if an object (CFC) is selected, it will dive deeper and call methods.  If you don't append a () a the end, the framework assumes you are calling a getter so behind the scenes it is really calling getFormattedName() for you.  Secondly, noticed that locations=${event.assignedLocations} is setting a different key name.  By default we use the last value in the dot path of the M2 EL syntax as the key name in the variables scope so in this case we'll set the data in "locations" instead of "assignedLocations".

Check out the CopyToScope documentation for more information on using deeply nested data and other nifty features.

View Tag Library Tip: Inserting Scripts

We all work with slinging script fragments all over the place in our view layer.  I'm sure you have code that looks a lot like this everywhere:

 <cfsavecontent variable="variables.js">
 <script type="text/javascript">
     Event.observe(window, 'load', loadAccordions, false);
     
     function loadAccordions() {
         var verticalAccordion = new accordion('vertical_accordion');
     }
 </script>
 </cfsavecontent>
 <cfset addHTMLHeadElement(variables.js) />
 

We set some come into a variable via cfsaveconent and then sling it into the HTML head via addHTMLHeadElement() which wraps cfhtmlhead ultimately.  In Mach-II, you need to use this method if you want caching to observe and later replay elements you added to the head.  Ugh, that's a lot of useless code.  It would be helped if cfhtmlhead supported body content (OpenBD does BTW) instead of just string data in an attribute.

Enter the HTMLHelperProperty and the nifty view custom tag library in Mach-II 1.8:

 <cfimport prefix="view" taglib="/MachII/customtags/view" />
 <view:script>
     Event.observe(window, 'load', loadAccordions, false);
     
     function loadAccordions() {
         var verticalAccordion = new accordion('vertical_accordion');
     }
 </view:script>
 

Wow, by default the view:script tag saves the content and inserts it into the head for you!  If you wanted it inline, then you just add outputType="inline" as an attribute or if you are on OpenBD you can use "body" to insert it at the bottom of the HTML body element.  Best thing of all is that it automatically uses addHTMLHeadElement() behind the scenes for you -- so your code is Mach-II cachable by proxy.

So be sure to check out our lengthy documentation on the view library and HTML helper -- they do a lot of stuff other than what I've shown in this example.

Bye Bye OhLoh as Download Host; Welcome SourceForge!

In surprising news to use, our file download provider OhLoh pulled support for hosted downloads in the past couple of days.  They recently migrated to a new data center but neglected to tell us that after the switch the download service would be dropped.  So in the aftermath we are switching to SourceForge as our provider to host our downloads.  All of our links on our website have been restored however if you find an out dated link be sure to let us know

Converting one company to CFML using an OSS CFML engine (via Dan's Drivelings)

There have been some lively discussions on Twitter today centered around the adoption of open source CFML engines in various types of businesses. I can’t speak to any kind of trends anywhere, but I wanted to share my experience with a project I was involved in last year that used Railo as the CMFL engine.

My brother, Andrew, is the head of the IT department for a firm that sells books and other supplies to school libraries all over the country. When he took over the position, he inherited a web site built on Java using the Struts framework. The original site had been in place for quite some time and the ownership decided it was time to refresh the site. The main issue (besides the outdated design) with the site was that it was so difficult to update. I’m not a Java developer by any stretch of the imagination, but from what I understand, even the simplest update required the site to be recompiled. The actual implementation of the site was fairly brittle as well, so new features were generally not even considered for fear of breaking something that was currently working.

Andrew had previously done some ColdFusion work with me on some of my other projects. He approached his management about contracting with me to help them replace their java web site with one built on CFML. During the initial requirements gathering and planning phases, the decision was made to use Railo as the CFML engine for the site. This was shortly after Railo went open source which appealed to them as they have several systems within the company that are open source. Cost was not a major concern (Railo being free vs the cost of a standard license of Adobe ColdFusion) but it was a consideration as this project did have a fixed budget. When we started the project, Adobe ColdFusion MX7 was the most current release. In several categories at the time, Railo’s performance was quite a bit better than Adobe ColdFusion’s. This has obviously changed in the interim, but that’s the way it was then. Anyway, all those factors and probably a few more I wasn’t privy to led to the decision to use Railo as the CFML engine for the site.

Our experience developing with Railo was very positive. We built the site using Mach-II, Transfer, ColdSpring using a PostgreSQL database backend. We had one little issue with Mach-II when we plugged in the Mach-II Dashboard module into our main config. Peter Farrell and I traced it down and found that it was due to a difference in how Railo parsed XML vs how Adobe ColdFusion did. I worked with the folks at Railo and they got the problem sorted out in one of the next releases.

The site went live the first of August, 2009. Between January 1 and August 1 of 2010, the site experienced a 562% increase in revenue generated when compared to the same time period of 2009 (the YTD time frame leading up to the new site going live). They’ve also seen a dramatic increase in the amount of traffic to the site since the new version went live (although I don’t have exact percentages at my fingertips to share). Just as importantly, in the months sice the new site went live, they have been able to add dozens of new features to the site–both publicly-available features as well as features for administrators and sales people that just would have been too difficult to try to weave into the previous java struts based application.

Finally, while this “success story” has Railo as one of its key components, the bigger issue in my mind is the fact that a formerly java-centric shop has converted to using CFML successfully to run their business and provide a better experience for their customers and employees.

Disclaimer: I’m not on either side of the Railo/OpenBD/Adobe CF argument. I’ve not had a client since that project that’s given me the option to use Railo so all of my work since then has been in Adobe CF but I certainly wouldn’t dismiss Railo straight away if there were an option to use it on a future project. The intent behind this blog post is simply to provide one real-world example of Railo being an entry point into CFML development, not to take either side of the Twitter discussions that have been going on today.

Sounds like an open source success story from all levels. We're glad that Mach-II helped in ways it can. Way to go Dan!