return mapping.getInputForward();
}
public ActionForward searchSendMail(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) {
MarkSheetSendMailBean bean = (MarkSheetSendMailBean) RenderUtils.getViewState().getMetaObject().getObject();
Collection<MarkSheet> markSheets = bean.getExecutionPeriod().getMarkSheetsToConfirm(bean.getDegreeCurricularPlan());
Collection<ExecutionCourse> executionCourses =
bean.getExecutionPeriod().getExecutionCoursesWithDegreeGradesToSubmit(bean.getDegreeCurricularPlan());
if (!markSheets.isEmpty()) {
Map<CurricularCourse, MarkSheetToConfirmSendMailBean> map =
new HashMap<CurricularCourse, MarkSheetToConfirmSendMailBean>();
for (MarkSheet markSheet : markSheets) {
if (map.get(markSheet.getCurricularCourse()) == null) {
map.put(markSheet.getCurricularCourse(), new MarkSheetToConfirmSendMailBean(markSheet, true));
}
}
bean.setMarkSheetToConfirmSendMailBean(new ArrayList<MarkSheetToConfirmSendMailBean>(map.values()));
}
if (!executionCourses.isEmpty()) {
Collection<GradesToSubmitExecutionCourseSendMailBean> executionCoursesBean =
new ArrayList<GradesToSubmitExecutionCourseSendMailBean>();
for (ExecutionCourse course : executionCourses) {
executionCoursesBean.add(new GradesToSubmitExecutionCourseSendMailBean(bean.getDegreeCurricularPlan(), course,
true));
}
bean.setGradesToSubmitExecutionCourseSendMailBean(executionCoursesBean);
}
request.setAttribute("bean", bean);
return mapping.findForward("searchSendMail");
}