private void confirmStudy6() throws Exception { FormProcessor fp = new FormProcessor(request); Validator v = new Validator(request); 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(); StudyBean newStudy = (StudyBean) session.getAttribute("newStudy"); newStudy.setMedlineIdentifier(fp.getString("medlineIdentifier")); newStudy.setResultsReference(fp.getBoolean("resultsReference")); newStudy.setUrl(fp.getString("url")); newStudy.setUrlDescription(fp.getString("urlDescription")); session.setAttribute("newStudy", newStudy); // request.setAttribute("interventions",session.getAttribute("interventions")); if (errors.isEmpty()) { forwardPage(Page.UPDATE_STUDY8); } else { request.setAttribute("formMessages", errors); forwardPage(Page.UPDATE_STUDY7); } }
/** * Validates the forth section of study and save it into study bean * * @param request * @param response * @throws Exception */ private void confirmStudy4() throws Exception { FormProcessor fp = new FormProcessor(request); Validator v = new Validator(request); 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")); } StudyBean newStudy = (StudyBean) session.getAttribute("newStudy"); newStudy.setConditions(fp.getString("conditions")); newStudy.setKeywords(fp.getString("keywords")); newStudy.setEligibility(fp.getString("eligibility")); newStudy.setGender(fp.getString("gender")); newStudy.setAgeMax(fp.getString("ageMax")); newStudy.setAgeMin(fp.getString("ageMin")); newStudy.setHealthyVolunteerAccepted(fp.getBoolean("healthyVolunteerAccepted")); newStudy.setExpectedTotalEnrollment(fp.getInt("expectedTotalEnrollment")); session.setAttribute("newStudy", newStudy); request.setAttribute("facRecruitStatusMap", CreateStudyServlet.facRecruitStatusMap); if (errors.isEmpty()) { forwardPage(Page.UPDATE_STUDY6); } else { request.setAttribute("formMessages", errors); forwardPage(Page.UPDATE_STUDY5); } }