It was with a great deal of fondness and appreciation that I submitted my resignation from Perficient last week.
I started with a small consulting firm by the name of E-Tech Solutions and based in West Chester, PA in December of 2005 -- the 12th, to be exact; that's how fondly I remember it! -- and since then my life has been in a state of constant change and growth (in more dimensions than one!). To be perfectly honest, I thought I was a damn good ColdFusion developer when I applied there -- and it turns out I had a lot to learn.
When I wasn't working on client websites, I attended CFUnited in both 2007 and 2008, learned Model-Glue and ColdSpring in my free time, wrote a few open source projects myself, and got certified for ColdFusion 7. I've had my eyes opened to the beauty and importance of frameworks and design patterns.
... And there's so much more that if I wrote about it all you would drown in a sea of hyperlinks.
And I owe it all to one person: Chuck McElwee.
Chances are you don't know him. He had one article published in the CFDJ back in 2002, and used to chirp in on CF-Talk occasionally, but otherwise isn't really that involved in the ColdFusion community. He was my boss at E-Tech and he showed me that there was so much more to ColdFusion than me and the documentation vs. the world. (Although, for what it's worth, the documentation is so good that I would bet on us. ;)
When E-Tech was purchased by Perficient in early 2007, and with the economy starting its downward spiral, Chuck and I were fortunate enough to keep our jobs and continue working together. A large portion of E-Tech's business was ColdFusion consulting -- and to a lesser extent, hosting our clients. While CF made up roughly half of our business (by my own estimate) the other half was Java, .Net, Sharepoint, and other Microsoft solutions. It was these other competencies that Perficient was most interested in, and so ColdFusion became the proverbial red-headed step child.
ColdFusion consulting gigs continued coming in for a while -- and still do, to some extent -- and I've had plenty to do and lots of opportunities to hone my C# skills, but as I'm sure many consulting firms are dealing with right now, billable hours are a little bit scarce no matter what technology you're talking about.
Consulting has taught me how to work at break-neck speed and how to help a client find a cost effective compromise between the solution they want and what they want to pay for it. But most of all, consulting has taught me that consulting is not a business I want to be in if I can help it.
I will always look back and remember E-Tech and Perficient as the true foundation of my career in web development. I only wish I could bring some of the excellent people I had the opportunity to work with along the way with me.
So where am I going? What does the future hold for me?
I'm excited about the opportunity to work in an environment where extra time spent learning something new is considered a valuable effort; where opportunities exist for me to learn Flex, AIR, and other related technologies; and to work with some greatminds (Sorry if there are others I didn't link... I just don't know about your blogs yet!) in what I'm told by many is a great program.
I am not taking Terrance Ryan's vacant position, but he did mention to me who he's pulling for as his replacement. ;)
I see so many opportunities and things I want to take advantage of in my future, and this job feels like the right way to start. Here's to the next step.
As it turns out, Ray's response is really clever. I'm quite fond of it, actually. But I still think mine is a bit more robust and closer to what you might call the "right" way to do it.
The question, to save you the clicking if you haven't seen either of those two pages, was how to get and set ColdFusion client variable values with JavaScript. As for dependencies, my solution uses jQuery and the returnFormat parameter added in ColdFusion 8.
What you want to do is write what would be called a Client Facade
And to use this component, you need to write some client-side JavaScript. As I said before, I used jQuery -- because I never leave home without it.
test.cfm:foo:
$(document).ready(function(){
//attach functionality to our alert button
$("#alertValue").click(function(e){
var clientVal = 'initialdata';
$.getJSON(
'clientFacade.cfc',
{
method:"get",
returnFormat:"json",
name:"foo"
},
function(d){
clientVal = d;
alert(clientVal);
}
);
//prevent the button from doing anything else
e.preventDefault();
});
//attach functionality to our set button
$("#setValue").click(function(e){
var success = false;
var valu = $("#foo").val();
$.getJSON(
'clientFacade.cfc',
{
method:"set",
returnFormat:"json",
name:"foo",
"val":valu
},
function(d){
success = eval(d);
if (!success){
alert('Failure');
}
}
);
//prevent the button from doing anything else
e.preventDefault();
});
});
Note that I'm using "xscript" instead of "script" tags so that Mango will allow me to post it.
This code remotely (via AJAX) accesses ClientFacade.cfc to send data back and forth. It lets you specify a default value when getting, instead of dealing with non existence.
We start with a few simple form fields: a textbox, a button to save the value, and a button to get and alert the value. To demonstrate that it really is working over AJAX and not just reloading the page faster than can be perceived, you could simply CFDump the Client scope on the page. This would show that the values in server memory are changing without the page reloading.
Then, some click event handlers are binded to our buttons that use jQuery's getJSON method to interact with the server, and the return data is managed with anonymous callback functions.
One final note: Notice that in the SET operation, I'm quoting the variable name:"val":valuThis is because "val" is a JavaScript reserved word. I should have thought of that when writing my CFC, but I didn't, and this is how you get around the issue. (Or just rename the CFArgument, but who has time for that?)
There are lots of other guides out there that explain how to install ColdFusion on IIS7, but I haven't found any specifically for ColdFusion 8. Not much is different from the CF 7 guides.
To be honest I had high hopes and expected ColdFusion to not have any problems installing out of the box, so first I enabled IIS and installed CF. When that didn't "just work" I went looking for information.
I ended up working from this guide, and did everything there that I hadn't already done. For some reason, I still got an error, which I'm now wishing I had taken a screenshot of before I fixed it. I've tried breaking my installation to get it back, but can't get the exact same error message. If memory serves, it just said, "Server Error" and had a single line of meaningless IIS information under that. (So you're not missing much...)
Some more googling gave a hint, but not a definitive answer, that what I needed to do was use the Web Server Configuration Tool.
So start that puppy up:
(Yes, I use the kitten as my icon. Got a problem with that?)
And that brings up this bad boy:
Notice that there are no configured web servers. That is a pretty big clue, right there. (Facepalm, anyone?)
So we're going to ... you guessed it ... click the "Add..." button. And that brings up this mofo right here:
The only change I made on this screen was to check "Configure web server for ColdFusion 8 applications" -- the rest were the default settings. There are a couple of settings available by clicking the "Advanced..." button that I'm not sure about, so I left them at their default settings as well.
I chose the default settings because I don't do anything fancy on my local machine. I don't have the need to run multiple instances of ColdFusion, nor configure anything special web-server-wise. I'm a vanilla-install kind of guy.
Click OK, Exit the Web Server Configuration Tool, and you're off and running.
It recently came up on the Model-Glue mailing list that the baked-in URL Managers in Model-Glue 3 could be a little bit better. In particular, the way they work is that you use the LinkTo function and pass it the event name that you want to link to as well as the name of the parameters that should go in the URL. Their values have to be variables stored in the event -- so they could come from a form post, a controller, or if need be, you can set them in your view immediately before use like so:
I found this to be a little bit clumsy in some cases -- mostly when I would have done the above, to set the values from the view -- and apparently I'm not alone; so I figured I would go ahead and post my custom URL Manager CFCs for you here.
My changes are not that significant, and really only build on the existing functionality (which is left in place for cases where I still want to use it) so that if the second argument to the LinkTo function is a structure instead of a string, I use the key/value pairs from it to populate the link, instead of keys from the string and values from the event.
To use this, save it as a CFC in your Model-Glue application somewhere, and change the default bean definition in your ModelGlue.xml file to point to the new file instead of the default one:
And here is the code for my basic URL Manager CFC:
To make this into an SES URL Manager, you just need to change the formatUrlParameter function definition to be something like the this:
Just a super quick update today to let you know that SweetTweetsCFC (and corresponding Mango plugin) are now up to version 1.4.
This update includes some fixes to make everything work on Railo (Thanks to Paul Kukiel for providing me a Railo testing environment -- Owe you a beer!) as well as some additional error trapping surrounding url shortening and JSON parsing so that we're not filling up your error logs if a URL shortening API or the Twitter Search API goes down or changes formats.