-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
executable file
·227 lines (146 loc) · 9.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Home - ValidateThis</title>
<meta name="author" content="Cameron Childresss">
<meta name="description" content="ValidateThis is a validation framework for ColdFusion objects and structures. It is designed to allow a developer to define the validation rules for …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://cameroncf.github.io/">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/atom.xml" rel="alternate" title="ValidateThis" type="application/atom+xml">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/javascripts/libs/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">ValidateThis</a></h1>
<h2>A ColdFusion Validation Framework</h2>
</hgroup>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="https://www.google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="sitesearch" value="cameroncf.github.io">
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/blog">Blog</a></li>
<li><a href="/docs">Documentation</a></li>
<li><a href="/download">Download</a></li>
<li><a href="/contribute">Contribute</a></li>
<li><a href="/support">Support</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div>
<article role="article">
<p>ValidateThis is a validation framework for ColdFusion objects and structures. It is designed to allow a developer to define the validation rules for their objects in a succinct fashion, and it will then automatically perform server-side validations and generate client-side validations.</p>
<h2>Goals of the Framework</h2>
<p>The ValidateThis framework is designed with the following goals in mind.</p>
<h2>Flexible Validations</h2>
<p>It should be possible to create an unlimited number of validation types, and any validation type imaginable should be possible. It should be possible to create new validation types without having to touch any of the existing framework code. Examples of validation types that currently ship with the framework are:</p>
<ul>
<li>Required - which includes three variations:</li>
<li>Simple - this property is always required</li>
<li>Dependent - this property is required if property x is populated</li>
<li>Dependent with Value - this property is required if property x has a value of y</li>
<li>Conditional - this property is required if condition x is true</li>
<li>EqualTo - the value of this property must be equal to the value of property x</li>
<li>Min - the value of this property must be at least x</li>
<li>MinLength - the length of this property must be at least x</li>
<li>Range - the value of this property must be between x and y</li>
<li>RangeLength - the length of this property must be between x and y</li>
<li>Numeric - the value of this property must be numeric</li>
<li>Date - the value of this property must be a date</li>
<li>Integer - the value of this property must be an integer</li>
<li>Email - the value of this property must be an Email Address</li>
<li>Regex - the value of this property must match the specified regex</li>
<li>Custom - allows for a method to be defined inside the Business Object that returns either true or false</li>
</ul>
<p>It should also be possible to create an unlimited number of client-side validation implementations, and a new implementation can be created without having to touch any of the existing framework code. An implementation is a way of converting the business rules into JavaScript code. The framework currently ships with a single JavaScript implementation:</p>
<ul>
<li>jQuery Validation Plugin</li>
</ul>
<h2>Code Generation</h2>
<p>A developer should be able to define the validation rules in a simple manner in a single location, and the framework will generate all server-side and client-side validation code automatically. Examples of validation rules are:</p>
<ul>
<li>UserName is required</li>
<li>UserName must be between 5 and 10 characters long</li>
<li>UserName must be unique</li>
<li>Password must be equal to VerifyPassword</li>
<li>If ShippingType is “Express”, a ShippingMethod must be selected</li>
</ul>
<p>The framework should be able to generate generic, but specific, validation failure messages, any of which can be overridden by an application developer. Examples of generic failure messages corresponding to the example rules above are:</p>
<ul>
<li>The User Name is required.</li>
<li>The User Name must be between 5 and 10 characters long.</li>
<li>The User Name must be unique.</li>
<li>The Password must be the same as the Verify Password.</li>
<li>The Shipping Method is required when selecting a Shipping Type of “Express”.</li>
</ul>
<h2>Flexible Feedback</h2>
<p>The framework should return flexible metadata back to the calling application which will allow for customization of how the validation failures will appear to the end user. This metadata will include more than just the failure messages generated. The framework will not dictate in any way how the view will communicate validation failures to the user.
Any invalid values supplied by a user should be returned by the Business Object when requested. For example, if one has a Product Business Object with a Price property that can only accept numeric data, if a user provides the value “Bob” in the Price property of a form, when the Product object is returned to the view, calling getPrice() will return the value “Bob”. Note: A technique for achieving this is demonstrated in a sample application that ships with the framework, but the framework itself is not involved in “saving” this invalid data.</p>
<h2>Persistence Layer Agnostic</h2>
<p>It should be possible to implement the framework, without making any modifications, into a model that uses any ORM or no ORM at all. The only requirement is that the model makes use of Business Objects. Note: The framework has been successfully implemented into applications using with Transfer, Reactor and ColdFusion 9’s ORM features.</p>
<h2>MVC Framework Agnostic</h2>
<p>It should be possible to implement the framework in any application using any MVC framework. That would include Fusebox, Model-Glue, Mach-II, ColdBox, FW/1 and any homegrown MVC framework. This kind of goes without saying, as the framework is specific to the model layer of your application. Note: A Coldbox plugin has been developed which makes integration of the framework into Coldbox even simpler.</p>
<h2>Installation</h2>
<p>Download the source code from validatethis.riaforge.org.
Unzip the file into your webroot, or elsewhere and create a mapping called ValidateThis that points to it.
Note that the download comes with a number of sample applications, demonstrating ValidateThis being integrated into applications in various ways. None of those files and folders are required to make use of the framework - they are just examples.</p>
<footer>
<p class="meta">
Updated: <time class='updated' datetime='2015-07-21T10:46:00-04:00'><span class='date'><span class='date-month'>Jul</span> <span class='date-day'>21</span><span class='date-suffix'>st</span>, <span class='date-year'>2015</span></span> <span class='time'>10:46 am</span></time>
</p>
</footer>
</article>
</div>
<aside class="sidebar">
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2015/07/21/someone-in-atlanta-likes-raisins/">Someone in Atlanta Likes Raisins</a>
</li>
<li class="post">
<a href="/blog/2015/07/21/a-test-os-a-new-blog-posting/">A Test Os a New Blog Posting</a>
</li>
</ul>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2015 - <a href="/about">Contributors</a> -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = '//platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
</body>
</html>