Photo from Chile

ValidateThis 0.99 - Goodies for ColdBox, Debugging and More

I promised John Whish that we'd have another version of ValidateThis, an awesome validation framework for ColdFusion, out in time for his presentation at Scotch on the Rocks on March 4th, 2011, and I've never been one to disappoint. So today I announce the release of version 0.99 of ValidateThis.

The lion's share of the work on this release was done by John, Adam Drew and myself. A lot of the work in this release is actually building towards something very cool that will come out later in the year, but there are still some significant enhancements including:

  • Goodies for ColdBoxers including a ColdBox interceptor and three new sample applications.
  • New debugging features to make it easier to figure out what's going wrong when things aren't working as you expect.
  • The ability to ignore a validation client-side.
  • Support for onMissingMethod in your objects.
  • JavaScript assets are now retrieved from a CDN or written to the browser so you don't need to place JS files in a web accessible folder.
  • Updates to the addFailure() method.
  • A couple of new validation types were added.

As always, the latest version can be downloaded from the ValidateThis RIAForge site. Details of the enhancements follow:


Recent ValidateThis Presentation Recording Available

I did an impromptu presentation for the Dallas / Fort Worth ColdFusion User Group a couple of days ago, filling in for someone who was supposed to present on ValidateThis but was unable to make it to the meeting. I delivered the presentation that I gave at both cf.Objective() and CFUnited last year.

Dave Shuck was kind enough to record the presentation and make the recording available, so if you're interested in watching it you can do so. I will warn you that the recording is around 90 minutes long because I tended to talk quite a bit throughout the presentation (as it was an informal preso), although I do believe that most of the information I was providing was useful.

If you do watch the presentation and have any questions about ValidateThis please feel free to send your questions to the official ValidateThis Google Group.

I'd like to thank Dave and the DFWCFUG for giving me the opportunity to present to them. If any of you are UGMs and are looking for a remote presenter I'm always available and interested, and can present on a number of topics.

What's New in ValidateThis 0.98 - Part II - New Validation Types

In addition to a bunch of neat new features, version 0.98 of ValidateThis also included a number of new validation types. One of the most important aspects of the framework, to me anyway, is the fact that it is incredibly extensible and allows you to easily create your own validation types, which is precisely what a number of folks including Adam Drew, Marc Esher and Chris Blackwell did. They were also kind enough to contribute those validation types to the framework so we can all benefit from them. In this post I'll describe each of the types that were added for version 0.98.

Each validation type accepts certain parameters, all of which have been documented in the ValidateThis Online Documentation, so I won't clutter up this post with that information. You can click on the name of each type in this post and be taken directly to its description in the docs if you wish. I'll just concentrate on describing what the validation type tests and suggestions for ways in which it might be useful.


What's New in ValidateThis 0.98 - Part I

As a follow-up to my post announcing the availability of version 0.98 of ValidateThis, which just included a brief summary of the new features, this post will describe some of those features in more detail.

defaultFailureMessagePrefix Configuration Option

When a validation fails the framework adds a failure message to the Result object that is returned to you. Each validation type has a default failure message, and you also have the option of overriding the default failure message using the failureMessage attribute of the rule element. The default messaged generated by VT are customized based on the type of failure and any parameters that were in place for the rule. For example, if a rule of type email which is defined on the emailAddress property of your object fails, the message will read "The Email Address must be a valid email address." If you've defined a rule of type rangeLength with a minLength of 5 and a maxLength of 20 on the password property of your object, the default failure message will read "The Password must be between 5 and 20 characters.


ValidateThis 0.98 - A Ton of New Stuff, and Two Important Changes

I've just released version 0.98 of ValidateThis, my validation framework ColdFusion. This update has been long in the making, and has been contributed to significantly by a number of folks including Adam Drew, Marc Esher, Chris Blackwell and John Whish. As always, the latest version can be downloaded from the ValidateThis RIAForge site. There are so many new features and enhancements that I'm going to divide them up into a number of posts, so this post will just include a summary, as well as a discussion of a couple of important changes that will impact all existing users. I'm going to start with a discussion of these changes.

The Folder Structure of the Distribution has Changed

A big thanks to Adam Drew for reorganizing the code repository and the distribution for the framework. This change won't impact any of your code, but it does mean that what you do with the download, in terms of which folders go where, has changed. The framework itself is now contained in the root of the distribution, whereas before it was in a folder called ValidateThis. This means that you can simply unzip the entire zip file into your local /ValidateThis folder. The sample applications are now contained in a folder called /samples, so if you don't want to include these in your project, simply delete this /samples folder after unzipping, or move it elsewhere.

A Change to Metadata that Needs Your Attention

In order to add a cool new enhancement (dynamic parameters) I've had to revisit the way that metadata for parameters was being specified. This examination led me to change the format of the param element. Because of this format change, any rules that you may currently have defined that use parameters will need to be changed as well, in order to use this and all future releases of the framework.

The good news is that the change is simple and easy, and Marc Esher has even contributed a regular expression that can be used to automatically update all of your xml files via Eclipse. The truth is that the previous format was actually flawed, so not only will this new format enable this cool new feature, but it will also position the framework better for future enhancement.


A Git Workflow for Open Source Collaboration - Part I - Introduction

As some of you may know, I'm the lead developer on an open source project called ValidateThis. I changed the version control software that I'm using for the project from Subversion to Git almost a year ago, and I've been very happy with Git ever since. There was a bit of a learning curve to Git, particularly as I'd never really used the command line much, and it's pretty much required with Git, but that was actually one of the reasons for the switch - to give me the impetus to really learn how to work with Git.

I am lucky enough to have several contributors to the project, and they made me aware recently that the fact that the source is housed in a Git repository is interfering with their ability to make contributions. They all have plenty of experience working with Subversion, but Git is quite new to most of them. Simply learning the syntax of Git is no problem, but what many people find difficult, me included, is figuring out how to change their workflow, as working with Git can be quite different from working with Subversion. So I decided to do some research and come up with a proposal for a workflow for all of the contributors. We're going to give it a try and see how well it goes. If changes need to be made, we'll make them. My hope is that the workflow we devise is one that can be used by other open source projects as well, if they choose to do so.

I am going to describe this workflow in detail through a series of posts on my blog, this post being the first installment. The series will likely contain the following posts:

  • Introduction
  • Setting Up Your Local Environment
  • Developing Code
  • Submitting Code to the Project


Automagic Validations for ColdFusion Objects - CFUnited Slide Deck Available

As promised, the slide deck from my presentation at CFUnited about ValidateThis, a validation framework for ColdFusion, is now available. Download it in PDF format here. Here's a description of the session:

Automagic Validations for ColdFusion Objects

This session will provide an overview of, as well as a detailed how-to about a Validation framework for ColdFusion. The title is a slight misnomer, as, although the framework was originally written to work inside an object-oriented application, and remains an ideal solution for that, it has recently been enhanced to work with simple ColdFusion structures as well. This means that anyone who is looking for a better way of addressing their validation requirements, both on the client side and on the server side, can now benefit from the framework, even if they are not using objects.

The main benefit of the framework is that it will automatically generate all of your client-side and server-side validations for you, from a simple set of metadata. This frees you from the drudgery of writing similar validation code over and over again, and also eliminates the possibility of adding bugs into your application via your validation code. The framework, called ValidateThis, is being actively developed by myself and a number of other contributors, so not only is it extremely functional and flexible right now, but new features are being added continually. If you are interested in finding out more about it, including exactly how to implement it in a new or existing application (and it's dead easy), I encourage you to take a look at the material.

More Entries