Flash Camp Chicago 2010 - Slides and Code

Here are the slides and complete code from my Flash Camp Chicago 2010 presentation - Accessing Remote Data.

Slides:
Accessing_Remote_Data_FCC_22262010.pdf

Code:
flash-camp-source.zip

Feel free to ask questions!

FlexPMDPDF - A ColdFusion PDF report generator for Flex PMD!

I have been using Flex PMD on a project recently to validate Flex code and am really digging it. I have used Adobe's PMD viewer to view the violations. I needed to print out a report and there was no apparent way to do this from the Adobe tool, so I went ahead and made my own using ColdFusion!

FlexPMDPDF is the result! It's available for download on RIA Forge!

FlexPMDPDF takes a pmd xml file output by Flex PMD and creates a PDF report with several formatting and filtering options. You can choose to group the report by rules, files or priority. You further filter the rule and file groupings by priority. FlexPMDPDF ColdFusion 8 or later.

Here is a sample call grouped by rule and only showing errors and warnings.

<cfset flexPMDPDF = CreateObject( "component", "FlexPMDPDF.FlexPMDPDF" ) />

<cfset byRule =
flexPMDPDF.generateReport(
"C:\ColdFusion9\wwwmroot\FlexPMDPDF\pmd.xml",
"C:\ColdFusion9\wwwroot\FlexPMDPDF\pmd.pdf",
"byRule",
"ERRORS,WARNINGS" )
/>

I've got complete documentation for the arguments in the CFC.

Give it a shot and let me know what you think. If you have a feature request, let me know. And should you find a bug, please let me know and I'll get it fixed!

My Max Session...

So, I'm fortunate enough to be speaking a MAX again this year. Both in San Francisco and Milan, Italy.

My session, ColdFusion Powered AIR, is running three times in San Francisco. The only slot that is not full is the one that runs on the 19th at 9 am. There are 11 slots left. So, if you want to see how ColdFusion and AIR can work together, sign up today!

As for Milan, my session is running December 1st at 1:00 pm and December 3rd at 9:00 am. There is plenty of room in both of these sessions!

Hope to see you in San Fran or Milan!

360 Flex Slides and Code...

Here is both the slides and code from my presentation on Using Value Objects in ColdFusion and Flex from 360Flex in San Jose.

If you have any questions, feel free to email me.

Slides:

360Flex_KAS.ppt

Code:

360Flex_SanJose.zip

VO's with ColdFusion and Flex...gotcha!

Ok, so I was pulling my hair out last night trying to figure out why the value object that ColdFusion was returning was not casting to the value object on the Flex/Actionscript side.

I bet I ran the Flex debugger 100 times. Everything looked just fine. The object that was being returned from ColdFusion was typed correctly and had the correct data, but when I went to assign the object to the proper type in Flex, it would end up being null.

After a few hours of this, I decided to open a bottle of wine and call it a night. Nothing like a well rested pair of eyes to solve the problem.

After having no luck this morning, I had my friend, Kevin Kazmierczack take a look at my VO on the Flex side of things.










Before:

[RemoteClass(alias="openmetric.com.openmetric.cfc.vo.OpenMetricEventVO")]

import com.openmetric.as3.model.vo.OpenMetricEventTypeVO;

[Bindable]
public class OpenMetricEventVO
...

Kevin suggested moving the import statement above the meta data for the RemoteClass. Shazaam! It worked.

Now, I don't know if I'm just dumb and I missed this in Flex 101 and need to go back, or if this is just something you have to find out the hard way. I'm guessing it's the former, but who knows. However, swapping those two little lines of code to this made all my headaches go away:

After:

import com.openmetric.as3.model.vo.OpenMetricEventTypeVO;

[RemoteClass(alias="openmetric.com.openmetric.cfc.vo.OpenMetricEventVO")]

[Bindable]
public class OpenMetricEventVO
...

Anyone else ever run into this?

Special thanks to Ed Sullivan!

Jesus, it's been since September 27th since I wrote anything!?!

Well, I've got a few things to say so I'll just get started.

From the yesterday's news department, MAX Barcelona was amazing, aside from spending 9 hours crammed into a Northwest Airbus. It was better than MAX Chicago. It wasn't as spread out and certainly had a better feel to it.

Next, 360 Flex Atlanta, I'll be speaking on using the ColdFusion 8 Flex Gateways! A great line up of speakers and an all around great conference!




Register today!




And finally, for those of you who remember my bet with Ed Sullivan, well he finally paid up. At the Union Oyster house in downtown Boston over Thanksgiving weekend!

Here's my reward and Ed in all his glory!

A yummy 2lb. Lobster


Thanks Ed!


Yes, I'm wearing my Peyton Manning jersey in Boston


Ready to rock Chi-town!

We'll I'm headed for MAX tomorrow afternoon! I'm driving the new G35 up to the Hyatt at McCormick Place with the new girlfriend.

Universal Mind has an outing on Saturday for all of us and then the show gets on the road.

You'll be able to find me in numerous places. I'll be in the Community Pit as well at the Ask an Expert table, the Universal Mind booth and of course at the bar! I hear Rex Grossman might even be bar tending. That's if he can hold onto the drinks and get them to the right person cause lord knows he can't do it with a football.

I'm really excited as this is the first year I'm speaking, here's the details.

ColdFusion 8 Crash Course Skill: Beginner ColdFusion

ColdFusion 8 is the most ambitious and capable version of ColdFusion to date. Join us for a crash course on everything that is new and exciting in this latest release of ColdFusion.

* Tuesday, October 2 9:15 am - 10:15 am
* Wednesday, October 3 1:45 pm - 2:45 pm

I hope you got registered before it sold out. If not I'll be making counterfeit badges and selling them for $100. If anyone from Adobe is reading, I'm just kidding.

Hope to see you there!

I'm speaking at MAX!

Yeah, it's been up for a while on the MAX site now, but I'm speaking at MAX this year. My topic? The ColdFusion 8 Crash Course!

It on Tuesday, October 2 9:15 am - 10:15 am and Wednesday, October 3 1:45 pm - 2:45 pm.

MAX is looking like it's going to be amazing this year, so if you can come, I highly recommend it. Come stop by my session, I'm going to try to come up with something unique. What, I'm not exactly sure yet!

I wonder...

Speaking with Darron Schall, we've come to conclusion that there are way too many me too posts that go up on blog aggregators. ColdFusion is no exception to this.

With the probable release of Scorpio (ColdFusion 8) to public beta tonight anyone want to take a guess as to what just about every other post that is aggregated tomorrow about ColdFusion will be about.

I'm going to count how many people jump up and down about ColdFusion 8, but don't actually add anything relevant to the discussion, kind of like this post.

Free code! (Server Side Validation...)

Yay! Free code! The only thing better than free code? Free Beer! Since I can't tap a keg on my blog, I'll give you all some free code.

I got Hal Helms' occasional newsletter in which he describes his newly created method of server-side validation.

I didn't realize there were no good examples out there in the ColdFusion community. So here's how I do it, along with the code. Whether you thinks it's good or not, well I guess that's up for debate.

I've got three parts:
(1) A CFC to handle the actual validation
(2) A custom tag to show the error messages, if any
(3) Some simple <cfscript> to set up what needs to be validated

Let's look at some code:

<cfscript>
   variables.rf = ArrayNew(1);
   
   variables.rf[1] = StructNew();
   variables.rf[1].fieldName = 'Photo_Name';
   variables.rf[1].required = true;
   variables.rf[1].displayName = 'Title';
   variables.rf[1].validate = '';
   
   variables.rf[2] = StructNew();
   variables.rf[2].fieldName = 'Photo_File';
   variables.rf[2].required = true;
   variables.rf[2].displayName = 'photo to upload';
   variables.rf[2].validate = '';
   
   variables.invalid = application.objFormValidate.validate(rf=variables.rf,form=form);
</cfscript>

This is the <cfscript> that's setting up what needs to be validated. I'm using an array of structures to determine what needs validated and how. The first key in the structure, "fieldName", is the actual name of the formfield. The second, "required", is whether or not the field is required. The third, "displayName" is how you want the name of the field displayed in the event that there is a validation error. The last two, "validate" and "validateAttribute" are what you want to validate, for example, length or email would be valid attributes for "validate" and 50 would be valid for "validateAttribute".

Finally, call the "validate" method of the formValidate.cfc and you'll get back an array of structures containing the violations. If there aren't any, you'll get back an empty array. If there are errors, the array is made up of a structure that includes the offending field name and an appropriate error message.

This is still a work in progress, but it's pretty solid for now. I'm working on making "validate" and "validateAttribute" so you can pass in more than one value for each.

I've posted the .cfc and the custom tag I use to display the errors that are returned.

I'd love to have feedback, let me know what you think. And if you want to take it and improve upon it, feel free.

Here's the code: formValidation.zip

I've got a golden ticket...

I had to laugh when I read this post over on Slugworth's, er... I mean Vince Bonfanti's blog.

"It would appear that the tables have turned somewhat. The major "new" features of CFMX 8, certainly the first ones announced by Adobe--CFIMAGE, .NET integration, CFTHREAD--are playing catch-up to BlueDragon. Has BlueDragon 7.0 caught and surpassed CFMX? I think the evidence is clear that it has."

I guess it's easy to think you're some sort of genius when your product is a knock-off of someone else's hard work. All New Atlanta needs to do is outsource their coding to China and they'll be set.

I've always wondered how New Atlanta is able to sell their product, I'm sure there's a loophole somewhere that has allowed for this.

Of course, New Atlanta is about to have another epiphany of new ideas when ColdFusion 8 is released this year.

This was just posted and it cracks me up even more!

"...the company that pioneered CFML innovations such as standard J2EE WAR/EAR deployment, image manipulation (CFIMAGE), .NET integration, and multi-threaded programming (CFTHREAD) offers their vision of the future."

Pioneered!?! Wow, the delusions just keep getting bigger. Vince you just made me shoot my Diet Coke out my nose. You can bet I'll be in the audience at CFUnited for that one.

And for those of you working hard at Adobe, keep up the good work.

Think I'm wrong? Let me know. I assure you, that unlike New Atlanta, I won't ban you or delete your comments.

More Entries

Questions or comments? Feel free to email me at kevin.schmidt[at]flexinabox.com