private void validateStudy6(FormProcessor fp, Validator v) { v.addValidation( "medlineIdentifier", Validator.LENGTH_NUMERIC_COMPARISON, NumericComparisonOperator.LESS_THAN_OR_EQUAL_TO, 255); v.addValidation( "url", Validator.LENGTH_NUMERIC_COMPARISON, NumericComparisonOperator.LESS_THAN_OR_EQUAL_TO, 255); v.addValidation( "urlDescription", Validator.LENGTH_NUMERIC_COMPARISON, NumericComparisonOperator.LESS_THAN_OR_EQUAL_TO, 255); errors = v.validate(); study.setMedlineIdentifier(fp.getString("medlineIdentifier")); study.setResultsReference(fp.getBoolean("resultsReference")); study.setUrl(fp.getString("url")); study.setUrlDescription(fp.getString("urlDescription")); // request.setAttribute("interventions",session.getAttribute( // "interventions")); if (!errors.isEmpty()) { request.setAttribute("formMessages", errors); } }
private void validateStudy4(FormProcessor fp, Validator v) { v.addValidation( "conditions", Validator.LENGTH_NUMERIC_COMPARISON, NumericComparisonOperator.LESS_THAN_OR_EQUAL_TO, 500); v.addValidation( "keywords", Validator.LENGTH_NUMERIC_COMPARISON, NumericComparisonOperator.LESS_THAN_OR_EQUAL_TO, 255); v.addValidation( "eligibility", Validator.LENGTH_NUMERIC_COMPARISON, NumericComparisonOperator.LESS_THAN_OR_EQUAL_TO, 500); errors = v.validate(); if (fp.getInt("expectedTotalEnrollment") <= 0) { Validator.addError( errors, "expectedTotalEnrollment", respage.getString("expected_total_enrollment_must_be_a_positive_number")); } study.setConditions(fp.getString("conditions")); study.setKeywords(fp.getString("keywords")); study.setEligibility(fp.getString("eligibility")); study.setGender(fp.getString("gender")); study.setAgeMax(fp.getString("ageMax")); study.setAgeMin(fp.getString("ageMin")); study.setHealthyVolunteerAccepted(fp.getBoolean("healthyVolunteerAccepted")); study.setExpectedTotalEnrollment(fp.getInt("expectedTotalEnrollment")); request.setAttribute("facRecruitStatusMap", CreateStudyServlet.facRecruitStatusMap); }