/** * This method returns CoverSheet,Renewal,Full Application,Type of application and Application * certification information for the CoverSheet type. * * @return CoverSheet object containing cover sheet information details. */ private CoverSheet getCoverSheet() { CoverSheet coverSheet = CoverSheet.Factory.newInstance(); coverSheet.setCheckCoverSheet(YesNoDataType.Enum.forInt(getChecklistAnswer(QUESTION_ID_1))); coverSheet.setCheckRenewal( YesNoNotApplicableDataType.Enum.forInt(getChecklistAnswer(QUESTION_ID_2))); coverSheet.setCheckTypeApp(YesNoDataType.Enum.forInt(getChecklistAnswer(QUESTION_ID_4))); coverSheet.setCheckAppCert(YesNoDataType.Enum.forInt(getChecklistAnswer(QUESTION_ID_5))); return coverSheet; }
/** * Setting the Coversheet and ProjectNarrative details according the Questionnaire Answers. * * @param coverSheet * @param projectNarrative */ private void setQuestionnaireAnswers(CoverSheet coverSheet, ProjectNarrative projectNarrative) { List<Answer> answers = s2sUtilService.getQuestionnaireAnswers( pdDoc.getDevelopmentProposal(), getNamespace(), getFormName()); for (Answer answer : answers) { switch (answer.getQuestion().getQuestionIdAsInteger()) { case PRELIMINARY: YesNoNotApplicableDataType.Enum yesNoNotApplicableDataType = YesNoNotApplicableDataType.N_NO; if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) { yesNoNotApplicableDataType = YesNoNotApplicableDataType.Y_YES; } else if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) { yesNoNotApplicableDataType = YesNoNotApplicableDataType.N_NO; } else if (QUESTIONNAIRE_ANSWER_X.equals(answer.getAnswer())) { yesNoNotApplicableDataType = YesNoNotApplicableDataType.NA_NOT_APPLICABLE; } coverSheet.setCheckFullApp(yesNoNotApplicableDataType); break; case MERIT_REVIEW: if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) { projectNarrative.setCheckMeritReview(YesNoNotApplicableDataType.Y_YES); } else if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) { projectNarrative.setCheckMeritReview(YesNoNotApplicableDataType.N_NO); } else if (QUESTIONNAIRE_ANSWER_X.equals(answer.getAnswer())) { projectNarrative.setCheckMeritReview(YesNoNotApplicableDataType.NA_NOT_APPLICABLE); } break; case MENTORING: if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) { projectNarrative.setCheckMentoring(YesNoNotApplicableDataType.Y_YES); } else if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) { projectNarrative.setCheckMentoring(YesNoNotApplicableDataType.N_NO); } break; case PRIOR_SUPPORT: // Does narrative include info regarding prior support? if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) projectNarrative.setCheckPriorSupport(YesNoNotApplicableDataType.Y_YES); if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) projectNarrative.setCheckPriorSupport(YesNoNotApplicableDataType.N_NO); if (QUESTIONNAIRE_ANSWER_X.equals(answer.getAnswer())) projectNarrative.setCheckPriorSupport(YesNoNotApplicableDataType.NA_NOT_APPLICABLE); break; case HR_QUESTION: /* * HR Info that is mandatory for renwals from academic * institutions. */ if (QUESTIONNAIRE_ANSWER_NO.equals(answer)) { projectNarrative.setCheckHRInfo(YesNoNotApplicableDataType.N_NO); } break; case HR_REQUIRED_INFO: /* * HR Info that is mandatory for renwals from academic * institutions. */ if (QUESTIONNAIRE_ANSWER_YES.equals(answer)) { projectNarrative.setCheckHRInfo(YesNoNotApplicableDataType.Y_YES); } break; default: break; } } }