allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "You must supply at least one Criteria,"));
}else{
Iterator iter = searchCriteria.iterator();
int count = 1;
while (iter.hasNext()) {
SearchCriteriaVO criteria = (SearchCriteriaVO)iter.next();
if (criteria == null || criteria.getValue() == null || (criteria.getValue()).length() <= 0) {
allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "The Criteria field cannot be blank. (line " + count + ")"));
}else{
RuleCriteriaVO ruleCriteriaVO = new RuleCriteriaVO();
ruleCriteriaVO.setOrderID(count);
ruleCriteriaVO.setExpressionType(criteria.getExpressionType());
try{
ruleCriteriaVO.setFieldID(Integer.parseInt(criteria.getFieldID()));
}catch(NumberFormatException nfe){
ruleCriteriaVO.setFieldID(-1);
}
try{
ruleCriteriaVO.setConditionID(Integer.parseInt(criteria.getConditionID()));
}catch(NumberFormatException nfe){
ruleCriteriaVO.setConditionID(4);
}
ruleCriteriaVO.setValue(criteria.getValue());
ruleVO.addRuleCriteria(ruleCriteriaVO);
}
count++;
}
}