Posted At : July 13, 2010 11:48 AM | Posted By : Bob Silverberg
Related Categories:
ColdFusion,CF ORM Integration
ColdFusion 9.0.1 is now available for download at http://www.adobe.com/go/getcf901,
and, in addition to fixing a number of issues with ColdFusion 9.0, it's packed full of goodies as well. The details of all the new features
can be found in the New Feature Notes,
and the bug fixes and outstanding items can be found in the Release Notes.
I think my favourite single new feature is the ability to do a for - in loop with an array, as looping through an array using script has
always been a pain. I'm also very happy with some of the improvements to ORM.
Here's a high-level summary of the new features, followed by some details on the ORM changes:
- Language enhancements - including for-in loops for arrays.
- New script functions implemented as CFCs - including dbinfo, imap, pop, ldap, and feed.
- Caching enhancements - including the ability to get a handle on the ehCache session.
- Support for IIS 7
- ColdFusion Ajax enhancements - including updates cfmap, cfgrid, file uploading and JavaScript functions.
- ORM enhancements - more details below.
- Amazon S3 support - the ability to use Amazon S3 storage with most tags and functions that use a file or directory as input or output.
- Various other enhancements covering areas such as Spreadsheets, AIR Integration, Flash Remoting, Blaze DS, Solr, Logging, Server Monitoring, and more.
ORM Enhancements
Here's a summary of the ORM enhancements in ColdFusion 9.0.1, followed by some details about each one:
- Support for Multiple Datasources
- Transaction Management Improvements
- skipCFCWithError Flag in ormSettings
- mappedSuperClass Attribute for Components
- Use EntityNew to Populate a New Entity
- Support for HQL in cfquery
[More]
Posted At : July 5, 2010 4:34 PM | Posted By : Bob Silverberg
Related Categories:
ValidateThis
I've just released version 0.96 of ValidateThis, my validation framework for ColdFusion objects.
I guess I'm going to have to come up with a new tagline, because, as of this release, ValidateThis is no longer only for objects.
This update includes a bunch of new enhancements, the most significant of which is that you can now use VT to validate a structure.
That's right, you no longer need to be working with objects to make use of the framework. More details on that enhancement, and others, can be found
following the summary of changes:
- You can now use VT to validate a structure, not just an object.
- Metadata can now be supplied in an external JSON file, as an alternative to the standard XML file.
- You can now have multiple forms on the same html page for the same object, with different contexts.
- A John Whish inspired package of enhancements has been added to the jQuery client-side validations.
- A bug fix reported and patched by a user was implemented.
As always, the latest version can be downloaded from the ValidateThis RIAForge site. Details of the enhancements follow:
[More]
Posted At : June 25, 2010 12:01 PM | Posted By : Bob Silverberg
Related Categories:
ValidateThis
I've just released version 0.95 of ValidateThis, my validation framework for ColdFusion objects. This update includes some community contributions, as well as a number of features that
were prompted by community requests. Here's a summary of the changes, followed by the details for each one.
- Numerous enhancements were made to the Result object, as well as the ability to easily substitute your own Result object for the one that is built into the framework,
and the ability to automatically inject the Result object into your business object.
- Client-side validations have been enhanced so that missing form fields will not generate JavaScript errors.
- Client-side validation code has been refactored, and includes a fix from Martijn van der Woud for the equalTo validation type.
- More refactoring to set the stage for future enhancements.
The latest version can be downloaded from the ValidateThis RIAForge site. Details of the enhancements follow:
[More]
Posted At : June 21, 2010 3:10 PM | Posted By : Bob Silverberg
Related Categories:
OS X,Git
As a relative newcomer to Git one of the things I've struggled most with is how to compare files from different branches.
The challenge comes from the fact that, from the perspective of the file system, two branches cannot exist at the same time.
When you switch from one branch to another the new branch replaces the old branch, so you cannot use a native file compare tool to compare two sets
of files, as there really is only one set of files at any point in time. Now I admit that I might be totally wrong about this,
and I'm sure that there are other, perhaps better, solutions to the issue, but the one that works for me currently is git difftool.
What is Git Difftool?
According to the man page for git-difftool,
git difftool is a git command that allows you to compare and edit files between revisions using common diff tools.
git difftool is a frontend to git diff and accepts the same options and arguments.
I've tried using git diff in the past and, after spending years working with a wonderful tool like Subclipse's Synchronize with Repository,
I just did not enjoy the output of git diff at all.
Luckily, git difftool works with a file compare tool on your system, making the output much easier (for me at least) to deal with.
On my system, which is OS X, because I have the Apple Developer Tools installed, when I issue the git difftool the output is sent to opendiff,
which in turn uses FileMerge which is a nice, graphical file compare and merge tool. Other than installing the developer tools, which I did long before
I started using Git, I didn't have to do any other setup. I honestly have no idea how easy it is to set up a graphical compare tool to work
with git difftool on a Windows or Linux box, but I'm guessing it cannot be that difficult.
Using Git Difftool
To start a compare, you simply issue the git difftool command and pass it paths to two sets of files.
The paths look like branchName:path. So if I wanted to compare the file ValidationFactory.cfc from the master branch
to the same file in the newStuff branch, I'd type:
git difftool master:ValidationFactory.cfc newBranch:ValidationFactory.cfc
I'd see a prompt that says something like:
merge tool candidates: opendiff kdiff3 tkdiff xxdiff meld kompare gvimdiff diffuse ecmerge araxis emerge vimdiff
Viewing: 'master:ValidationFactory.cfc'
Hit return to launch 'opendiff':
And when I hit return FileMerge would open up with both files displayed. If I want to compare an entire folder, I can just type
git difftool master:ValidateThis/core/ newBranch:ValidateThis/core/
And then I receive that prompt for each individual file in turn.
I still don't think this is anywhere near as good as what I had with Subclipse, and I'm guessing there are ways to configure it to make it even friendlier,
but for now it's much better than git diff.
Posted At : June 21, 2010 9:41 AM | Posted By : Bob Silverberg
Related Categories:
ColdFusion,Notifo
Notifo is a relatively new service which allows you to send push notifications to mobile clients
via a REST interface. Currently notifications can only be sent to the iPhone, but they plan to add support for Android and Blackberry in the future.
Because it is based on a REST API, it's very easy to interact with from a ColdFusion application,
and I wanted to give it a try, so I whipped up
a quick API wrapper for it.
It all seems to work extraordinarily well, and is quite cool.
CFNotifo is Born
I found out about Notifo from the GitHub blog,
which describes a Notifo service hook that was just added. This
service hook allows you to receive push notifications on your iPhone any time someone commits to your Git repo. Of course I had to try this right away,
and was duly impressed. The next step was to write some CFML that interacts with the API, so, as I mentioned above, I decided to create a simple API
wrapper to make it even easier for others to do the same. In a matter of minutes I was able to create a single cfc which implements all of the current API.
This wasn't that challenging as there are only two API methods right now, subscribe_user and send_notification, but as Notifo adds more,
I will follow suit.
How Does Notifo Work
Paul Stamatiou, co-founder of Notifo, wrote up a detailed post about Notifo on his blog,
which is well worth reading. If you don't feel like following the link, here are the highlights:
- Allows you to send push notifications to a mobile client from a server.
- Currently iPhone is supported, via an app available in the app store. Android is up next, with other smartphones to be added in the future.
- To subscribe to services you need a Notifo account, which can be set up via the Notifo site, or via the iPhone app.
- To receive notifications you need to have the iPhone app installed.
- Once you've subscribed to a service you can set various options for it via a web interface, including what type of notifications you want to receive
(normal, silent and stealth), and you can unsubscribe, block and report spam on a service.
- You can also set some global options for notifications, such as silent hours, during which notifications will be sent silently.
[More]
Posted At : June 17, 2010 10:49 AM | Posted By : Bob Silverberg
Related Categories:
TDD,ColdFusion,Podcasts
I had the honour and pleasure of being interviewed by Michael Kimsal for his
WebDevRadio podcast a few weeks ago.
The episode was published last week and is now available for listening and/or downloading from
the podcast website, as well as
via iTunes.
For those of you that don't know Michael, you're missing out. I met him at NCDevCon and found him to be an extremely pleasant, funny and smart individual.
I enjoyed my chats with him at the conference, and really enjoyed discussing all sorts of topics with him for the podcast, including,
but not limited to, how I came to develop using ColdFusion, contributing to open source projects, test-driven development and unit testing in general, and
object-relational mapping (ORM) in ColdFusion. I also really appreciated the opportunity to have my voice heard outside of the ColdFusion community.
Posted At : June 7, 2010 5:54 PM | Posted By : Bob Silverberg
Related Categories:
TDD,Selenium
I've recently been writing some end-to-end tests for ValidateThis,
my validation framework for ColdFusion objects, using Selenium. One of the things I wanted to test
were the client-side validations that the framework generates automatically. Selenium makes it very easy to test these, as I can use Selenium's
assertText command to locate failure messages that have been generated by the jQuery Validation plugin,
using XPath, and check whether the message is what I expected.
I found, however, that I was often getting JavaScript errors when the page first loaded (because I was working on the JS and was introducing errors),
so I was looking for a quick way to add an assert to my test to check whether any JS errors occurred. After some Googling I came to the conclusion that
there is nothing built into Selenium to support this, but there are a number of hacks that can be used to accomplish it. I'm going to describe one of them
here. Let me state again, for the record, that this is pretty hacky. I'd love to hear from others who may have better solutions.
I simply add a script to my page that will catch any JS errors by intercepting the window.onerror event:
<script type="text/javascript">
window.onerror=function(msg){
$("body").attr("JSError",msg);
}
</script>
This will cause an attribute called JSError with a value corresponding to the JavaScript error message to be added to the body tag of my document if a JavaScript
error occurs. Note that I'm using jQuery to do this, so this specific example won't work if jQuery fails to load.
Then, in my Selenium test, I just use the command assertElementNotPresent with a target of //body[@JSError].
Now, if any JavaScript errors occur on the page my test will fail and I'll know I have to address them first. If, for some strange reason, I want to
check for a particular JavaScript error, I could use the assertElementPresent command with a target of //body[@JSError='the error message'].
Note that I'm using this with a test fixture page, it's not an actual page that is part of an application. I'm not sure that this would be very
useful in an automated testing environment, I'm just using it for some TDDing, where I want to write an end-to-end acceptance test first, and
then write my unit tests. Getting the test to fail because of a JavaScript error is a nice way, imo, of satisfying the criteria that I must have a
failing test before writing code to make it work. The usefullness of this technique in terms of pure testing is questionable, but I find it useful
for my purposes, so I thought I'd put it out there for others.
More Entries