bgriffin-zenhub / core

Source Code for dotCMS Java Enterprise Content Management System
http://dotcms.com
GNU General Public License v3.0
0 stars 0 forks source link

Card 679 Validation and constraint improvements for Rules Engine. #190

Open brentgriffin opened 8 years ago

brentgriffin commented 8 years ago

Issue by ggranum Tuesday Mar 08, 2016 at 10:21 GMT Originally opened as https://github.com/dotCMS/core/pull/8726


Implements a constraint structure that can be more easily mapped to client-side representations of the same constraint.

DataType implementations now defer to a common pool of defined constraint functions, rather than implementing their own custom validation methods.

Also adds 'required' field.

The order that constraint are applied is important. A Required=true constraint should be applied before a minLength=5 constraint, for example. However, the constraints are implemented in such a way that - usually - the combination isn't order dependent.

Constraints do not short circuit. All constraints will be tested, and error messages / error message keys will be returned in a list.

Review on Reviewable


ggranum included the following code: https://github.com/dotCMS/core/pull/8726/commits