incubator-lokahi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tob...@apache.org
Subject svn commit: r392982 [4/25] - in /incubator/lokahi/lokahi/trunk: ./ conf/ database/ docs/ lib/ src/ src/java/ src/java/lokahi/ src/java/lokahi/core/ src/java/lokahi/core/agent/ src/java/lokahi/core/agent/callable/ src/java/lokahi/core/agent/callable/con...
Date Mon, 10 Apr 2006 16:20:11 GMT
Added: incubator/lokahi/lokahi/trunk/conf/validator-rules-1_1.xml
URL: http://svn.apache.org/viewcvs/incubator/lokahi/lokahi/trunk/conf/validator-rules-1_1.xml?rev=392982&view=auto
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/validator-rules-1_1.xml (added)
+++ incubator/lokahi/lokahi/trunk/conf/validator-rules-1_1.xml Mon Apr 10 09:19:33 2006
@@ -0,0 +1,1044 @@
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+<!--
+
+   This file contains the default Struts Validator pluggable validator
+   definitions.  It should be placed somewhere under /WEB-INF and
+   referenced in the struts-config.xml under the plug-in element
+   for the ValidatorPlugIn.
+
+      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+                                                  /WEB-INF/validation.xml"/>
+      </plug-in>
+
+   These are the default error messages associated with
+   each validator defined in this file.  They should be
+   added to your projects ApplicationResources.properties
+   file or you can associate new ones by modifying the
+   pluggable validators msg attributes in this file.
+
+   # Struts Validator Error Messages
+   errors.required={0} is required.
+   errors.minlength={0} can not be less than {1} characters.
+   errors.maxlength={0} can not be greater than {1} characters.
+   errors.invalid={0} is invalid.
+
+   errors.byte={0} must be a byte.
+   errors.short={0} must be a short.
+   errors.integer={0} must be an integer.
+   errors.long={0} must be a long.
+   errors.float={0} must be a float.
+   errors.double={0} must be a double.
+
+   errors.date={0} is not a date.
+   errors.range={0} is not in the range {1} through {2}.
+   errors.creditcard={0} is an invalid credit card number.
+   errors.email={0} is an invalid e-mail address.
+
+-->
+
+<form-validation>
+
+   <global>
+
+      <validator name="required"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateRequired"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+                  msg="errors.required">
+
+         <javascript><![CDATA[
+            function validateRequired(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRequired = new required();
+                for (x in oRequired) {
+                	var field = form[oRequired[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'file' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio' ||
+                        field.type == 'password') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (trim(value).length == 0) {
+                        
+	                        if (i == 0) {
+	                            focusField = field;
+	                        }
+	                        fields[i++] = oRequired[x][1];
+	                        isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }
+            
+            // Trim whitespace from left and right sides of s.
+            function trim(s) {
+                return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
+            }
+            
+            ]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="requiredif"
+                 classname="org.apache.struts.validator.FieldChecks"
+                 method="validateRequiredIf"
+                 methodParams="java.lang.Object,
+                               org.apache.commons.validator.ValidatorAction,
+                               org.apache.commons.validator.Field,
+                               org.apache.struts.action.ActionErrors,
+                               org.apache.commons.validator.Validator,
+                               javax.servlet.http.HttpServletRequest"
+                 msg="errors.required">
+      </validator>
+
+      <validator name="minlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMinLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.minlength">
+
+         <javascript><![CDATA[
+            function validateMinLength(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMinLength = new minlength();
+                for (x in oMinLength) {
+                    var field = form[oMinLength[x][0]];
+                    
+                    if (field.type == 'text' ||
+                        field.type == 'textarea') {
+                        
+                        var iMin = parseInt(oMinLength[x][2]("minlength"));
+                        if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMinLength[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="maxlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMaxLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.maxlength">
+
+         <javascript><![CDATA[
+            function validateMaxLength(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMaxLength = new maxlength();
+                for (x in oMaxLength) {
+                    var field = form[oMaxLength[x][0]];
+                    
+                    if (field.type == 'text' ||
+                        field.type == 'textarea') {
+                        
+                        var iMax = parseInt(oMaxLength[x][2]("maxlength"));
+                        if (field.value.length > iMax) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMaxLength[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="mask"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMask"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.invalid">
+
+         <javascript><![CDATA[
+            function validateMask(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oMasked = new mask();
+                for (x in oMasked) {
+                    var field = form[oMasked[x][0]];
+                    
+                    if ((field.type == 'text' || 
+                         field.type == 'textarea') && 
+                         (field.value.length > 0)) {
+                        
+                        if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oMasked[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return isValid;
+            }
+
+            function matchPattern(value, mask) {
+               return mask.exec(value);
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="byte"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateByte"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.byte"
+       jsFunctionName="ByteValidations">
+
+         <javascript><![CDATA[
+            function validateByte(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oByte = new ByteValidations();
+                for (x in oByte) {
+                	var field = form[oByte[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+						field.type == 'radio') {
+
+						var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oByte[x][1];
+
+                            } else {
+
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oByte[x][1];
+	                                bValid = false;
+	                            }
+                            }
+						}
+						
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="short"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateShort"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.short"
+       jsFunctionName="ShortValidations">
+
+         <javascript><![CDATA[
+            function validateShort(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oShort = new ShortValidations();
+                for (x in oShort) {
+                	var field = form[oShort[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+								value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oShort[x][1];
+
+                            } else {
+                        
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oShort[x][1];
+	                                bValid = false;
+	                            }
+	                       }
+                       }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="integer"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateInteger"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.integer"
+       jsFunctionName="IntegerValidations">
+
+         <javascript><![CDATA[
+            function validateInteger(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oInteger = new IntegerValidations();
+                for (x in oInteger) {
+                	var field = form[oInteger[x][0]];
+
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                        var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+						    if (si >= 0) {
+							    value = field.options[si].value;
+						    }
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                        
+                            if (!isAllDigits(value)) {
+                                bValid = false;
+                                if (i == 0) {
+	                                focusField = field;
+	                            }
+						        fields[i++] = oInteger[x][1];
+						        
+                            } else {
+	                            var iValue = parseInt(value);
+	                            if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oInteger[x][1];
+	                                bValid = false;
+	                           }
+                           }
+                       }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            function isAllDigits(argvalue) {
+                argvalue = argvalue.toString();
+                var validChars = "0123456789";
+                var startFrom = 0;
+                if (argvalue.substring(0, 2) == "0x") {
+                   validChars = "0123456789abcdefABCDEF";
+                   startFrom = 2;
+                } else if (argvalue.charAt(0) == "0") {
+                   validChars = "01234567";
+                   startFrom = 1;
+                } else if (argvalue.charAt(0) == "-") {
+                    startFrom = 1;
+                }
+                
+                for (var n = startFrom; n < argvalue.length; n++) {
+                    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="long"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateLong"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.long"/>
+
+
+      <validator name="float"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloat"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.float"
+       jsFunctionName="FloatValidations">
+
+         <javascript><![CDATA[
+            function validateFloat(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oFloat = new FloatValidations();
+                for (x in oFloat) {
+                	var field = form[oFloat[x][0]];
+                	
+                    if (field.type == 'text' ||
+                        field.type == 'textarea' ||
+                        field.type == 'select-one' ||
+                        field.type == 'radio') {
+                        
+                    	var value = '';
+						// get field's value
+						if (field.type == "select-one") {
+							var si = field.selectedIndex;
+							if (si >= 0) {
+							    value = field.options[si].value;
+							}
+						} else {
+							value = field.value;
+						}
+                        
+                        if (value.length > 0) {
+                            // remove '.' before checking digits
+                            var tempArray = value.split('.');
+                            var joinedString= tempArray.join('');
+
+                            if (!isAllDigits(joinedString)) {
+                                bValid = false;
+                                if (i == 0) {
+                                    focusField = field;
+                                }
+                                fields[i++] = oFloat[x][1];
+
+                            } else {
+	                            var iValue = parseFloat(value);
+	                            if (isNaN(iValue)) {
+	                                if (i == 0) {
+	                                    focusField = field;
+	                                }
+	                                fields[i++] = oFloat[x][1];
+	                                bValid = false;
+	                            }
+                            }
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                   focusField.focus();
+                   alert(fields.join('\n'));
+                }
+                return bValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="double"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDouble"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.double"/>
+
+
+      <validator name="date"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDate"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.date"
+       jsFunctionName="DateValidations">
+
+         <javascript><![CDATA[
+            function validateDate(form) {
+               var bValid = true;
+               var focusField = null;
+               var i = 0;
+               var fields = new Array();
+               oDate = new DateValidations();
+               for (x in oDate) {
+                   var value = form[oDate[x][0]].value;
+                   var datePattern = oDate[x][2]("datePatternStrict");
+                   if ((form[oDate[x][0]].type == 'text' ||
+                        form[oDate[x][0]].type == 'textarea') &&
+                       (value.length > 0) &&
+                       (datePattern.length > 0)) {
+                     var MONTH = "MM";
+                     var DAY = "dd";
+                     var YEAR = "yyyy";
+                     var orderMonth = datePattern.indexOf(MONTH);
+                     var orderDay = datePattern.indexOf(DAY);
+                     var orderYear = datePattern.indexOf(YEAR);
+                     if ((orderDay < orderYear && orderDay > orderMonth)) {
+                         var iDelim1 = orderMonth + MONTH.length;
+                         var iDelim2 = orderDay + DAY.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderDay && iDelim2 == orderYear) {
+                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
+                         } else if (iDelim1 == orderDay) {
+                            dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
+                         } else if (iDelim2 == orderYear) {
+                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
+                         } else {
+                            dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                            if (!isValidDate(matched[2], matched[1], matched[3])) {
+                               if (i == 0) {
+                                   focusField = form[oDate[x][0]];
+                               }
+                               fields[i++] = oDate[x][1];
+                               bValid =  false;
+                            }
+                         } else {
+                            if (i == 0) {
+                                focusField = form[oDate[x][0]];
+                            }
+                            fields[i++] = oDate[x][1];
+                            bValid =  false;
+                         }
+                     } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
+                         var iDelim1 = orderDay + DAY.length;
+                         var iDelim2 = orderMonth + MONTH.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderMonth && iDelim2 == orderYear) {
+                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
+                         } else if (iDelim1 == orderMonth) {
+                             dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
+                         } else if (iDelim2 == orderYear) {
+                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
+                         } else {
+                             dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                             if (!isValidDate(matched[1], matched[2], matched[3])) {
+                                 if (i == 0) {
+                                     focusField = form[oDate[x][0]];
+                                 }
+                                 fields[i++] = oDate[x][1];
+                                 bValid =  false;
+                              }
+                         } else {
+                             if (i == 0) {
+                                 focusField = form[oDate[x][0]];
+                             }
+                             fields[i++] = oDate[x][1];
+                             bValid =  false;
+                         }
+                     } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
+                         var iDelim1 = orderYear + YEAR.length;
+                         var iDelim2 = orderMonth + MONTH.length;
+                         var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
+                         var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
+                         if (iDelim1 == orderMonth && iDelim2 == orderDay) {
+                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
+                         } else if (iDelim1 == orderMonth) {
+                             dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
+                         } else if (iDelim2 == orderDay) {
+                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
+                         } else {
+                             dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{2})$");
+                         }
+                         var matched = dateRegexp.exec(value);
+                         if(matched != null) {
+                             if (!isValidDate(matched[3], matched[2], matched[1])) {
+                                 if (i == 0) {
+                                     focusField = form[oDate[x][0]];
+                                  }
+                                  fields[i++] = oDate[x][1];
+                                  bValid =  false;
+                              }
+                          } else {
+                              if (i == 0) {
+                                  focusField = form[oDate[x][0]];
+                              }
+                              fields[i++] = oDate[x][1];
+                              bValid =  false;
+                          }
+                     } else {
+                         if (i == 0) {
+                             focusField = form[oDate[x][0]];
+                         }
+                         fields[i++] = oDate[x][1];
+                         bValid =  false;
+                     }
+                  }
+               }
+               if (fields.length > 0) {
+                  focusField.focus();
+                  alert(fields.join('\n'));
+               }
+               return bValid;
+            }
+
+	    function isValidDate(day, month, year) {
+	        if (month < 1 || month > 12) {
+                    return false;
+                }
+                if (day < 1 || day > 31) {
+                    return false;
+                }
+                if ((month == 4 || month == 6 || month == 9 || month == 11) &&
+                    (day == 31)) {
+                    return false;
+                }
+                if (month == 2) {
+                    var leap = (year % 4 == 0 &&
+                               (year % 100 != 0 || year % 400 == 0));
+                    if (day>29 || (day == 29 && !leap)) {
+                        return false;
+                    }
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+<!-- range is deprecated use intRange instead -->
+      <validator name="range"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateRange(form) {
+                return validateIntRange(form);
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="intRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateIntRange(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRange = new intRange();
+                for (x in oRange) {
+                    var field = form[oRange[x][0]];
+                    
+                    if ((field.type == 'text' ||
+                         field.type == 'textarea') &&
+                        (field.value.length > 0)) {
+                        
+                        var iMin = parseInt(oRange[x][2]("min"));
+                        var iMax = parseInt(oRange[x][2]("max"));
+                        var iValue = parseInt(field.value);
+                        if (!(iValue >= iMin && iValue <= iMax)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oRange[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="floatRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloatRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends="float"
+                  msg="errors.range">
+
+         <javascript><![CDATA[
+            function validateFloatRange(form) {
+                var isValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oRange = new floatRange();
+                for (x in oRange) {
+                    var field = form[oRange[x][0]];
+                    
+                    if ((field.type == 'text' ||
+                         field.type == 'textarea') &&
+                        (field.value.length > 0)) {
+                        
+                        var fMin = parseFloat(oRange[x][2]("min"));
+                        var fMax = parseFloat(oRange[x][2]("max"));
+                        var fValue = parseFloat(field.value);
+                        if (!(fValue >= fMin && fValue <= fMax)) {
+                            if (i == 0) {
+                                focusField = field;
+                            }
+                            fields[i++] = oRange[x][1];
+                            isValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return isValid;
+            }]]>
+         </javascript>
+
+      </validator>
+
+      <validator name="creditCard"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateCreditCard"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.creditcard">
+
+         <javascript><![CDATA[
+            function validateCreditCard(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oCreditCard = new creditCard();
+                for (x in oCreditCard) {
+                    if ((form[oCreditCard[x][0]].type == 'text' ||
+                         form[oCreditCard[x][0]].type == 'textarea') &&
+                        (form[oCreditCard[x][0]].value.length > 0)) {
+                        if (!luhnCheck(form[oCreditCard[x][0]].value)) {
+                            if (i == 0) {
+                                focusField = form[oCreditCard[x][0]];
+                            }
+                            fields[i++] = oCreditCard[x][1];
+                            bValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            /**
+             * Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
+             */
+            function luhnCheck(cardNumber) {
+                if (isLuhnNum(cardNumber)) {
+                    var no_digit = cardNumber.length;
+                    var oddoeven = no_digit & 1;
+                    var sum = 0;
+                    for (var count = 0; count < no_digit; count++) {
+                        var digit = parseInt(cardNumber.charAt(count));
+                        if (!((count & 1) ^ oddoeven)) {
+                            digit *= 2;
+                            if (digit > 9) digit -= 9;
+                        };
+                        sum += digit;
+                    };
+                    if (sum == 0) return false;
+                    if (sum % 10 == 0) return true;
+                };
+                return false;
+            }
+
+            function isLuhnNum(argvalue) {
+                argvalue = argvalue.toString();
+                if (argvalue.length == 0) {
+                    return false;
+                }
+                for (var n = 0; n < argvalue.length; n++) {
+                    if ((argvalue.substring(n, n+1) < "0") ||
+                        (argvalue.substring(n,n+1) > "9")) {
+                        return false;
+                    }
+                }
+                return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+
+      <validator name="email"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateEmail"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionErrors,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.email">
+
+         <javascript><![CDATA[
+            function validateEmail(form) {
+                var bValid = true;
+                var focusField = null;
+                var i = 0;
+                var fields = new Array();
+                oEmail = new email();
+                for (x in oEmail) {
+                    if ((form[oEmail[x][0]].type == 'text' ||
+                         form[oEmail[x][0]].type == 'textarea') &&
+                        (form[oEmail[x][0]].value.length > 0)) {
+                        if (!checkEmail(form[oEmail[x][0]].value)) {
+                            if (i == 0) {
+                                focusField = form[oEmail[x][0]];
+                            }
+                            fields[i++] = oEmail[x][1];
+                            bValid = false;
+                        }
+                    }
+                }
+                if (fields.length > 0) {
+                    focusField.focus();
+                    alert(fields.join('\n'));
+                }
+                return bValid;
+            }
+
+            /**
+             * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
+             * http://javascript.internet.com
+             */
+            function checkEmail(emailStr) {
+               if (emailStr.length == 0) {
+                   return true;
+               }
+               var emailPat=/^(.+)@(.+)$/;
+               var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
+               var validChars="\[^\\s" + specialChars + "\]";
+               var quotedUser="(\"[^\"]*\")";
+               var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
+               var atom=validChars + '+';
+               var word="(" + atom + "|" + quotedUser + ")";
+               var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
+               var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
+               var matchArray=emailStr.match(emailPat);
+               if (matchArray == null) {
+                   return false;
+               }
+               var user=matchArray[1];
+               var domain=matchArray[2];
+               if (user.match(userPat) == null) {
+                   return false;
+               }
+               var IPArray = domain.match(ipDomainPat);
+               if (IPArray != null) {
+                   for (var i = 1; i <= 4; i++) {
+                      if (IPArray[i] > 255) {
+                         return false;
+                      }
+                   }
+                   return true;
+               }
+               var domainArray=domain.match(domainPat);
+               if (domainArray == null) {
+                   return false;
+               }
+               var atomPat=new RegExp(atom,"g");
+               var domArr=domain.match(atomPat);
+               var len=domArr.length;
+               if ((domArr[domArr.length-1].length < 2) ||
+                   (domArr[domArr.length-1].length > 3)) {
+                   return false;
+               }
+               if (len < 2) {
+                   return false;
+               }
+               return true;
+            }]]>
+         </javascript>
+
+      </validator>
+
+   </global>
+
+</form-validation>
\ No newline at end of file

Added: incubator/lokahi/lokahi/trunk/conf/validator-rules.xml
URL: http://svn.apache.org/viewcvs/incubator/lokahi/lokahi/trunk/conf/validator-rules.xml?rev=392982&view=auto
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/validator-rules.xml (added)
+++ incubator/lokahi/lokahi/trunk/conf/validator-rules.xml Mon Apr 10 09:19:33 2006
@@ -0,0 +1,263 @@
+<!--
+  $Header: /cvsroot/tmcg2/tmcg2/conf/validator-rules.xml,v 1.1.1.1 2005/11/30 22:34:13 drtobes Exp $
+  $Revision: 1.1.1.1 $
+  $Date: 2005/11/30 22:34:13 $
+
+   This file contains the default Struts Validator pluggable validator
+   definitions.  It should be placed somewhere under /WEB-INF and
+   referenced in the struts-config.xml under the plug-in element
+   for the ValidatorPlugIn.
+
+      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+                                                  /WEB-INF/validation.xml"/>
+      </plug-in>
+
+   These are the default error messages associated with
+   each validator defined in this file.  They should be
+   added to your projects ApplicationResources.properties
+   file or you can associate new ones by modifying the
+   pluggable validators msg attributes in this file.
+
+   # Struts Validator Error Messages
+   errors.required={0} is required.
+   errors.minlength={0} can not be less than {1} characters.
+   errors.maxlength={0} can not be greater than {1} characters.
+   errors.invalid={0} is invalid.
+
+   errors.byte={0} must be a byte.
+   errors.short={0} must be a short.
+   errors.integer={0} must be an integer.
+   errors.long={0} must be a long.
+   errors.float={0} must be a float.
+   errors.double={0} must be a double.
+
+   errors.date={0} is not a date.
+   errors.range={0} is not in the range {1} through {2}.
+   errors.creditcard={0} is an invalid credit card number.
+   errors.email={0} is an invalid e-mail address.
+
+   Note: Starting in Struts 1.2.0 the default javascript definitions have
+         been consolidated to commons-validator. The default can be overridden
+         by supplying a <javascript> element with a CDATA section, just as
+         in struts 1.1.
+
+-->
+
+<form-validation>
+
+   <global>
+
+      <validator name="required"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateRequired"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+                  msg="errors.required"/>
+
+      <validator name="requiredif"
+                 classname="org.apache.struts.validator.FieldChecks"
+                 method="validateRequiredIf"
+                 methodParams="java.lang.Object,
+                               org.apache.commons.validator.ValidatorAction,
+                               org.apache.commons.validator.Field,
+                               org.apache.struts.action.ActionMessages,
+                               org.apache.commons.validator.Validator,
+                               javax.servlet.http.HttpServletRequest"
+                 msg="errors.required"/>
+
+      <validator name="validwhen"
+          msg="errors.required"
+                 classname="org.apache.struts.validator.validwhen.ValidWhen"
+                 method="validateValidWhen"
+                 methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       org.apache.commons.validator.Validator,
+                       javax.servlet.http.HttpServletRequest"/>
+
+
+      <validator name="minlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMinLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.minlength"
+           jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>
+
+
+      <validator name="maxlength"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMaxLength"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.maxlength"
+           jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>
+
+
+
+      <validator name="mask"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateMask"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.invalid"/>
+
+
+      <validator name="byte"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateByte"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.byte"
+       jsFunctionName="ByteValidations"/>
+
+
+      <validator name="short"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateShort"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.short"
+       jsFunctionName="ShortValidations"/>
+
+
+      <validator name="integer"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateInteger"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.integer"
+       jsFunctionName="IntegerValidations"/>
+
+
+
+      <validator name="long"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateLong"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.long"/>
+
+
+      <validator name="float"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloat"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.float"
+       jsFunctionName="FloatValidations"/>
+
+      <validator name="double"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDouble"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.double"/>
+
+
+      <validator name="date"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateDate"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.date"
+       jsFunctionName="DateValidations"/>
+
+
+      <validator name="intRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateIntRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends="integer"
+                  msg="errors.range"/>
+
+
+      <validator name="floatRange"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateFloatRange"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends="float"
+                  msg="errors.range"/>
+
+
+
+      <validator name="creditCard"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateCreditCard"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.creditcard"/>
+
+
+      <validator name="email"
+            classname="org.apache.struts.validator.FieldChecks"
+               method="validateEmail"
+         methodParams="java.lang.Object,
+                       org.apache.commons.validator.ValidatorAction,
+                       org.apache.commons.validator.Field,
+                       org.apache.struts.action.ActionMessages,
+                       javax.servlet.http.HttpServletRequest"
+              depends=""
+                  msg="errors.email"/>
+
+
+   </global>
+
+</form-validation>
\ No newline at end of file

Added: incubator/lokahi/lokahi/trunk/conf/validator_1_1.dtd
URL: http://svn.apache.org/viewcvs/incubator/lokahi/lokahi/trunk/conf/validator_1_1.dtd?rev=392982&view=auto
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/validator_1_1.dtd (added)
+++ incubator/lokahi/lokahi/trunk/conf/validator_1_1.dtd Mon Apr 10 09:19:33 2006
@@ -0,0 +1,292 @@
+<!--
+    DTD for the Validator Rules Configuration File, Version 1.1
+
+    To allow for XML validation of your rules configuration
+    file, include the following DOCTYPE element at the beginning (after
+    the "xml" declaration):
+
+    <!DOCTYPE form-validation PUBLIC
+     "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
+     "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
+
+    $Id: validator_1_1.dtd,v 1.1.1.1 2005/11/30 22:34:13 drtobes Exp $
+-->
+
+
+
+<!--
+     The "form-validation" element is the root of the configuration file
+     hierarchy, and contains nested elements for all of the other
+     configuration settings.
+-->
+<!ELEMENT form-validation (global*, formset*)>
+
+
+<!--
+    The elements defined here are all global and must be nested within a
+    "global" element.
+-->
+<!ELEMENT global (validator*, constant*)>
+
+
+<!--
+     The "validator" element defines what validator objects can be used with
+     the fields referenced by the formset elements.
+-->
+<!ELEMENT validator (javascript?)>
+<!ATTLIST validator name CDATA #REQUIRED>
+<!ATTLIST validator classname CDATA #REQUIRED>
+<!ATTLIST validator method CDATA #REQUIRED>
+<!ATTLIST validator methodParams CDATA #REQUIRED>
+<!ATTLIST validator msg CDATA #REQUIRED>
+<!ATTLIST validator depends CDATA #IMPLIED>
+<!ATTLIST validator jsFunctionName CDATA #IMPLIED>
+<!ATTLIST validator jsFunction CDATA #IMPLIED>
+
+
+<!--
+     The "javascript" element defines a JavaScript that can be used to perform
+     client-side validators.
+-->
+<!ELEMENT javascript (#PCDATA)>
+
+
+<!--
+     The "constant" element defines a static value that can be used as
+     replacement parameters within "field" elements. The "constant-name" and
+     "constant-value" elements define the constant's reference id and replacement
+     value.
+-->
+<!ELEMENT constant (constant-name, constant-value)>
+<!ELEMENT constant-name  (#PCDATA)>
+<!ELEMENT constant-value (#PCDATA)>
+
+
+<!--
+      The "formset" element defines a set of forms for a locale. Formsets for
+      specific locales can override only those fields that change. The
+      localization is properly scoped, so that a formset can override just the
+      language, or just the country, or both.
+-->
+<!ELEMENT formset (constant*, form+)>
+<!ATTLIST formset language CDATA #IMPLIED>
+<!ATTLIST formset country CDATA #IMPLIED>
+<!ATTLIST formset variant CDATA #IMPLIED>
+
+
+<!--
+     The "form" element defines a set of fields to be validated. The name
+     corresponds to the identifer the application assigns to the form. 
+-->
+<!ELEMENT form (field+)>
+<!ATTLIST form name CDATA #REQUIRED>
+
+
+<!--
+     The "field" element defines the properties to be validated. In a
+     web application, a field would also correspond to a control on
+     a HTML form. To validate the properties, the validator works through
+     a JavaBean representation. The field element accepts these 
+     attributes:
+
+     property        The property on the JavaBean corresponding to this
+                     field element.
+
+     depends         The comma-delimited list of validators to apply against
+                     this field. For the field to succeed, all the
+                     validators must succeed.
+
+     page            The JavaBean corresponding to this form may include
+                     a page property. Only fields with a "page" attribute
+                     value that is equal to or less than the page property
+                     on the form JavaBean are processed. This is useful when
+                     using a "wizard" approach to completing a large form,
+                     to ensure that a page is not skipped.
+                     [0]
+
+     indexedListProperty
+                     The "indexedListProperty" is the method name that will
+                     return an array or a Collection used to retrieve the
+                     list and then loop through the list performing the
+                     validations for this field.
+
+-->
+<!ELEMENT field (msg|arg|arg0|arg1|arg2|arg3|var)*>
+<!ATTLIST field property CDATA #REQUIRED>
+<!ATTLIST field depends CDATA #IMPLIED>
+<!ATTLIST field page CDATA #IMPLIED>
+<!ATTLIST field indexedListProperty CDATA #IMPLIED>
+
+
+<!--
+     The "msg" element defines a custom message key to use when one of the
+     validators for this field fails. Each validator has a default message
+     property that is used when a corresonding field msg is not specified.
+     Each validator applied to a field may have its own msg element.
+     The msg element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+      
+      bundle     The resource bundle name that the key should be resolved in.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT msg EMPTY>
+<!ATTLIST msg key CDATA #REQUIRED>
+<!ATTLIST msg name CDATA #REQUIRED>
+<!ATTLIST msg bundle CDATA #IMPLIED>
+<!ATTLIST msg resource CDATA #IMPLIED>
+
+
+
+<!--
+     The "arg" element defines a replacement value to use with the
+     message template for this validator or this field.
+     The arg element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+      			  If not supplied, this argument will be used in the given 
+      			  position for every validator.
+      			  
+      bundle     The resource bundle name that the key should be resolved in.      			  
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+
+      position    The position of this replacement parameter in the message.
+      			  For example, position="0" will set the first argument.
+      			  [0]
+-->
+<!ELEMENT arg EMPTY>
+<!ATTLIST arg key CDATA #REQUIRED>
+<!ATTLIST arg bundle CDATA #IMPLIED>
+<!ATTLIST arg name CDATA #IMPLIED>
+<!ATTLIST arg resource CDATA #IMPLIED>
+<!ATTLIST arg position CDATA #IMPLIED>
+
+
+
+<!--
+
+		DEPRECATED Use <arg position="0"/> instead.
+
+     The "arg0" element defines the first replacement value to use with the
+     message template for this validator or this field.
+     The arg0 element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg0 EMPTY>
+<!ATTLIST arg0 name CDATA #IMPLIED>
+<!ATTLIST arg0 key CDATA #IMPLIED>
+<!ATTLIST arg0 resource CDATA #IMPLIED>
+
+
+<!--
+
+		DEPRECATED Use <arg position="1"/> instead.
+
+     The "arg1" element defines the second replacement value to use with the
+     message template for this validator or this field.
+     The arg1 element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg1 EMPTY>
+<!ATTLIST arg1 name CDATA #IMPLIED>
+<!ATTLIST arg1 key CDATA #IMPLIED>
+<!ATTLIST arg1 resource CDATA #IMPLIED>
+
+
+<!--
+
+		DEPRECATED Use <arg position="2"/> instead.
+
+     The "arg2" element defines the third replacement value to use with the
+     message template for this validator or this field.
+     The arg2 element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg2 EMPTY>
+<!ATTLIST arg2 name CDATA #IMPLIED>
+<!ATTLIST arg2 key CDATA #IMPLIED>
+<!ATTLIST arg2 resource CDATA #IMPLIED>
+
+
+<!--
+
+		DEPRECATED Use <arg position="3"/> instead.
+
+     The "arg3" element defines the fourth replacement value to use with the
+     message template for this validator or this field.
+     The arg0 element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT arg3 EMPTY>
+<!ATTLIST arg3 name CDATA #IMPLIED>
+<!ATTLIST arg3 key CDATA #IMPLIED>
+<!ATTLIST arg3 resource CDATA #IMPLIED>
+
+
+<!--
+     The "var" element can set parameters that a field may need to pass to
+     one of its validators, such as the minimum and maximum values in a
+     range validation. These parameters may also be referenced by one of the
+     arg? elements using a shell syntax: ${var:var-name}.
+-->
+<!ELEMENT var (var-name, var-value)>
+
+
+
+<!--
+     The name of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-name  (#PCDATA)>
+
+
+
+<!--
+     The value of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-value (#PCDATA)>
+
+

Added: incubator/lokahi/lokahi/trunk/conf/validator_1_2_0.dtd
URL: http://svn.apache.org/viewcvs/incubator/lokahi/lokahi/trunk/conf/validator_1_2_0.dtd?rev=392982&view=auto
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/validator_1_2_0.dtd (added)
+++ incubator/lokahi/lokahi/trunk/conf/validator_1_2_0.dtd Mon Apr 10 09:19:33 2006
@@ -0,0 +1,220 @@
+<!--
+    DTD for the Validator Rules Configuration File, Version 1.2.0
+
+    To allow for XML validation of your rules configuration
+    file, include the following DOCTYPE element at the beginning (after
+    the "xml" declaration):
+
+    <!DOCTYPE form-validation PUBLIC
+     "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.2.0//EN"
+     "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">
+
+    $Id: validator_1_2_0.dtd,v 1.1.1.1 2005/11/30 22:34:13 drtobes Exp $
+-->
+
+
+
+<!--
+     The "form-validation" element is the root of the configuration file
+     hierarchy, and contains nested elements for all of the other
+     configuration settings.
+-->
+<!ELEMENT form-validation (global*, formset*)>
+
+
+<!--
+    The elements defined here are all global and must be nested within a
+    "global" element.
+-->
+<!ELEMENT global (validator*, constant*)>
+
+
+<!--
+     The "validator" element defines what validator objects can be used with
+     the fields referenced by the formset elements.
+     elements:
+       validator         Defines a new validatior
+       javascript        The javascript source code for client side validation.
+     attributes:
+         name            The name of this validation
+         classname       The java class name that handles server side validation
+         method          The java method that handles server side validation
+         methodParams    The java class types passed to the serverside method
+         msg             a generic message key to use when this validator fails.
+                         It can be overridden by the 'msg' element for a specific field.
+         depends         The comma-delimited list of validator that are called before this validator.
+                         For this validation to succeed, all the listed validators must succeed.
+         jsFunctionName  The name of the javascript function which returns all fields of a certain type.
+         jsFunction      The name of the javascript function which is passed the form for validation.
+
+-->
+<!ELEMENT validator (javascript?)>
+<!ATTLIST validator name CDATA #REQUIRED>
+<!ATTLIST validator classname CDATA #REQUIRED>
+<!ATTLIST validator method CDATA #REQUIRED>
+<!ATTLIST validator methodParams CDATA #REQUIRED>
+<!ATTLIST validator msg CDATA #REQUIRED>
+<!ATTLIST validator depends CDATA #IMPLIED>
+<!ATTLIST validator jsFunctionName CDATA #IMPLIED>
+<!ATTLIST validator jsFunction CDATA #IMPLIED>
+
+
+
+<!--
+     The "javascript" element defines a JavaScript that can be used to perform
+     client-side validators.
+-->
+<!ELEMENT javascript (#PCDATA)>
+
+
+<!--
+     The "constant" element defines a static value that can be used as
+     replacement parameters within "field" elements. The "constant-name" and
+     "constant-value" elements define the constant's reference id and replacement
+     value.
+-->
+<!ELEMENT constant (constant-name, constant-value)>
+<!ELEMENT constant-name  (#PCDATA)>
+<!ELEMENT constant-value (#PCDATA)>
+
+
+<!--
+      The "formset" element defines a set of forms for a locale. Formsets for
+      specific locales can override only those fields that change. The
+      localization is properly scoped, so that a formset can override just the
+      language, or just the country, or both.
+-->
+<!ELEMENT formset (constant*, form+)>
+<!ATTLIST formset language CDATA #IMPLIED>
+<!ATTLIST formset country CDATA #IMPLIED>
+<!ATTLIST formset variant CDATA #IMPLIED>
+
+
+<!--
+     The "form" element defines a set of fields to be validated. The name
+     corresponds to the identifier the application assigns to the form. 
+-->
+<!ELEMENT form (field+)>
+<!ATTLIST form name CDATA #REQUIRED
+            extends CDATA #IMPLIED>
+ 
+
+
+<!--
+     The "field" element defines the properties to be validated. In a
+     web application, a field would also correspond to a control on
+     a HTML form. To validate the properties, the validator works through
+     a JavaBean representation. The field element accepts these 
+     attributes:
+
+     property        The property on the JavaBean corresponding to this
+                     field element.
+
+     depends         The comma-delimited list of validators to apply against
+                     this field. For the field to succeed, all the
+                     validators must succeed.
+
+     page            The JavaBean corresponding to this form may include
+                     a page property. Only fields with a "page" attribute
+                     value that is equal to or less than the page property
+                     on the form JavaBean are processed. This is useful when
+                     using a "wizard" approach to completing a large form,
+                     to ensure that a page is not skipped.
+                     [0]
+
+     indexedListProperty
+                     The "indexedListProperty" is the method name that will
+                     return an array or a Collection used to retrieve the
+                     list and then loop through the list performing the
+                     validations for this field.
+
+-->
+<!ELEMENT field (msg|arg|arg0|arg1|arg2|arg3|var)*>
+<!ATTLIST field property CDATA #REQUIRED>
+<!ATTLIST field depends CDATA #IMPLIED>
+<!ATTLIST field page CDATA #IMPLIED>
+<!ATTLIST field indexedListProperty CDATA #IMPLIED>
+
+
+<!--
+     The "msg" element defines a custom message key to use when one of the
+     validators for this field fails. Each validator has a default message
+     property that is used when a corresponding field msg is not specified.
+     Each validator applied to a field may have its own msg element.
+     The msg element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+      
+      bundle     The resource bundle name that the key should be resolved in.
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+-->
+<!ELEMENT msg EMPTY>
+<!ATTLIST msg key CDATA #REQUIRED>
+<!ATTLIST msg name CDATA #REQUIRED>
+<!ATTLIST msg bundle CDATA #IMPLIED>
+<!ATTLIST msg resource CDATA #IMPLIED>
+
+
+
+<!--
+     The "arg" element defines a replacement value to use with the
+     message template for this validator or this field.
+     The arg element accepts these attributes.
+
+      name        The name of the validator corresponding to this msg.
+      			  If not supplied, this argument will be used in the given 
+      			  position for every validator.
+      			  
+      bundle     The resource bundle name that the key should be resolved in.      			  
+
+      key         The key that will return the message template from a
+                  resource bundle.
+
+      resource    If set to "false", the key is taken to be a literal
+                  value rather than a bundle key.
+                  [true]
+
+      position    The position of this replacement parameter in the message.
+      			  For example, position="0" will set the first argument.
+      			  [0]
+-->
+<!ELEMENT arg EMPTY>
+<!ATTLIST arg key CDATA #REQUIRED>
+<!ATTLIST arg bundle CDATA #IMPLIED>
+<!ATTLIST arg name CDATA #IMPLIED>
+<!ATTLIST arg resource CDATA #IMPLIED>
+<!ATTLIST arg position CDATA #IMPLIED>
+
+<!--
+     The "var" element can set parameters that a field may need to pass to
+     one of its validators, such as the minimum and maximum values in a
+     range validation. These parameters may also be referenced by one of the
+     arg? elements using a shell syntax: ${var:var-name}.
+-->
+<!ELEMENT var (var-name, var-value, var-jstype?)>
+
+
+
+<!--
+     The name of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-name  (#PCDATA)>
+
+
+
+<!--
+     The value of the var parameter to provide to a field's validators.
+-->
+<!ELEMENT var-value (#PCDATA)>
+
+<!--
+     The java script type, Possible Values [int| string | regexp] 
+
+-->
+<!ELEMENT var-jstype (#PCDATA)>

Added: incubator/lokahi/lokahi/trunk/conf/velocity.properties
URL: http://svn.apache.org/viewcvs/incubator/lokahi/lokahi/trunk/conf/velocity.properties?rev=392982&view=auto
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/velocity.properties (added)
+++ incubator/lokahi/lokahi/trunk/conf/velocity.properties Mon Apr 10 09:19:33 2006
@@ -0,0 +1,97 @@
+#----------------------------------------------------------------------------
+# These are the default properties for the
+# Velocity Runtime. These values are used when
+# Runtime.init() is called, and when Runtime.init(properties)
+# fails to find the specificed properties file.
+#----------------------------------------------------------------------------
+
+
+#----------------------------------------------------------------------------
+# R U N T I M E  L O G  
+#----------------------------------------------------------------------------
+# Velocity uses the Servlet APIs logging facilites.
+
+#----------------------------------------------------------------------------
+# This controls if Runtime.error(), info() and warn() messages include the
+# whole stack trace. The last property controls whether invalid references
+# are logged.
+#----------------------------------------------------------------------------
+
+runtime.log.error.stacktrace = false
+runtime.log.warn.stacktrace = false
+runtime.log.info.stacktrace = false
+runtime.log.invalid.reference = true
+
+
+#----------------------------------------------------------------------------
+# T E M P L A T E  E N C O D I N G
+#----------------------------------------------------------------------------
+
+input.encoding=ISO-8859-1
+output.encoding=ISO-8859-1
+
+
+#----------------------------------------------------------------------------
+# F O R E A C H  P R O P E R T I E S
+#----------------------------------------------------------------------------
+# These properties control how the counter is accessed in the #foreach
+# directive. By default the reference $velocityCount will be available
+# in the body of the #foreach directive. The default starting value
+# for this reference is 1.
+#----------------------------------------------------------------------------
+
+directive.foreach.counter.name = velocityCount
+directive.foreach.counter.initial.value = 1
+
+
+#----------------------------------------------------------------------------
+# I N C L U D E  P R O P E R T I E S
+#----------------------------------------------------------------------------
+# These are the properties that governed the way #include'd content
+# is governed.
+#----------------------------------------------------------------------------
+
+directive.include.output.errormsg.start = <!-- include error : 
+directive.include.output.errormsg.end   =  see error log -->
+
+
+#----------------------------------------------------------------------------
+# P A R S E  P R O P E R T I E S
+#----------------------------------------------------------------------------
+
+directive.parse.max.depth = 10
+
+
+#----------------------------------------------------------------------------
+# VELOCIMACRO PROPERTIES
+#----------------------------------------------------------------------------
+# global : name of default global library.  It is expected to be in the regular
+# template path.  You may remove it (either the file or this property) if 
+# you wish with no harm.
+#----------------------------------------------------------------------------
+velocimacro.library = /WEB-INF/VM_global_library.vm
+
+velocimacro.permissions.allow.inline = true
+velocimacro.permissions.allow.inline.to.replace.global = false
+velocimacro.permissions.allow.inline.local.scope = false
+
+velocimacro.context.localscope = false
+
+
+#----------------------------------------------------------------------------
+# INTERPOLATION
+#----------------------------------------------------------------------------
+# turn off and on interpolation of references and directives in string
+# literals.  ON by default :)
+#----------------------------------------------------------------------------
+runtime.interpolate.string.literals = true
+
+
+#----------------------------------------------------------------------------
+# RESOURCE MANAGEMENT
+#----------------------------------------------------------------------------
+# Allows alternative ResourceManager and ResourceCache implementations
+# to be plugged in.
+#----------------------------------------------------------------------------
+resource.manager.class = org.apache.velocity.runtime.resource.ResourceManagerImpl
+resource.manager.cache.class = org.apache.velocity.runtime.resource.ResourceCacheImpl
\ No newline at end of file

Added: incubator/lokahi/lokahi/trunk/conf/web.xml
URL: http://svn.apache.org/viewcvs/incubator/lokahi/lokahi/trunk/conf/web.xml?rev=392982&view=auto
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/web.xml (added)
+++ incubator/lokahi/lokahi/trunk/conf/web.xml Mon Apr 10 09:19:33 2006
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+  "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <servlet>
+        <servlet-name>TMCStartupServlet</servlet-name>
+        <servlet-class>lokahi.core.gui.www.TMCStartupServlet</servlet-class>
+
+      <init-param>
+            <param-name>log4j-init-file</param-name>
+            <param-value>WEB-INF/log4j.xml</param-value>
+      </init-param>
+      <init-param>
+          <param-name>properties</param-name>
+          <param-value>lokahi.properties</param-value>
+      </init-param>
+
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>action</servlet-name>
+        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
+        <init-param>
+            <param-name>config</param-name>
+            <param-value>/WEB-INF/struts-config.xml</param-value>
+        </init-param>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>1</param-value>
+        </init-param>
+        <init-param>
+            <param-name>detail</param-name>
+            <param-value>0</param-value>
+        </init-param>
+        <init-param>
+            <param-name>validate</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <load-on-startup>3</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>velocity</servlet-name>
+        <servlet-class>lokahi.core.gui.www.TMCVelocityServlet</servlet-class>
+        <init-param>
+            <param-name>org.apache.velocity.toolbox</param-name>
+            <param-value>/WEB-INF/toolbox.xml</param-value>
+        </init-param>
+        <init-param>
+            <param-name>org.apache.velocity.properties</param-name>
+            <param-value>/WEB-INF/velocity.properties</param-value>
+        </init-param>
+        <load-on-startup>4</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>AxisServlet</servlet-name>
+        <display-name>Apache-Axis Servlet</display-name>
+        <servlet-class>
+            org.apache.axis.transport.http.AxisServlet
+        </servlet-class>
+    </servlet>
+
+    <servlet>
+        <servlet-name>AdminServlet</servlet-name>
+        <display-name>Axis Admin Servlet</display-name>
+        <servlet-class>
+            org.apache.axis.transport.http.AdminServlet
+        </servlet-class>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
+
+    <servlet>
+      <servlet-name>TMCRSSAlertFeed</servlet-name>
+      <display-name>TMC Alert RSS Feed</display-name>
+      <servlet-class>lokahi.core.gui.www.TMCRSSAlertServlet</servlet-class>
+    </servlet>
+
+    <servlet>
+      <servlet-name>TMCRest</servlet-name>
+      <display-name>TMC Rest</display-name>
+      <servlet-class>lokahi.core.gui.www.RestServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>AxisServlet</servlet-name>
+        <url-pattern>/servlet/AxisServlet</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+      <servlet-name>TMCRSSAlertFeed</servlet-name>
+      <url-pattern>/rss/alert</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+      <servlet-name>TMCRest</servlet-name>
+      <url-pattern>/rest/*</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>AxisServlet</servlet-name>
+        <url-pattern>*.jws</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>AxisServlet</servlet-name>
+        <url-pattern>/services/*</url-pattern>
+    </servlet-mapping>
+
+    <!-- Standard Action Servlet Mapping -->
+    <servlet-mapping>
+        <servlet-name>action</servlet-name>
+        <url-pattern>*.do</url-pattern>
+    </servlet-mapping>
+
+    <!-- Map *.vm files to Velocity -->
+    <servlet-mapping>
+        <servlet-name>velocity</servlet-name>
+        <url-pattern>*.vm</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>velocity</servlet-name>
+        <url-pattern>*.vmcss</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>velocity</servlet-name>
+        <url-pattern>*.wml</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>TMCStartupServlet</servlet-name>
+        <url-pattern>/TMCStartupServlet</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <session-timeout>20</session-timeout>
+    </session-config>
+
+    <!-- currently the W3C havent settled on a media type for WSDL;
+    http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
+    for now we go with the basic 'it's XML' response -->
+    <mime-mapping>
+        <extension>wsdl</extension>
+        <mime-type>text/xml</mime-type>
+    </mime-mapping>
+
+
+    <mime-mapping>
+        <extension>xsd</extension>
+        <mime-type>text/xml</mime-type>
+    </mime-mapping>
+
+    <mime-mapping>
+        <extension>vmcss</extension>
+        <mime-type>text/css</mime-type>
+    </mime-mapping>
+
+    <!-- welcome file list -->
+    <welcome-file-list>
+        <welcome-file>index.vm</welcome-file>
+    </welcome-file-list>
+
+  <error-page>
+    <error-code>404</error-code>
+    <location>/error/404.vm</location>
+  </error-page>
+
+    <!-- Struts Tag Library Descriptors -->
+    <taglib>
+        <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
+        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
+    </taglib>
+
+    <taglib>
+        <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
+        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
+    </taglib>
+
+    <taglib>
+        <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
+        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
+    </taglib>
+
+    <taglib>
+        <taglib-uri>/WEB-INF/struts-validator.tld</taglib-uri>
+        <taglib-location>/WEB-INF/struts-validator.tld</taglib-location>
+    </taglib>
+
+</web-app>
\ No newline at end of file



Mime
View raw message