public ActionForward createSummaryAndSame(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws FenixServiceException {
final IViewState viewState = RenderUtils.getViewState();
SummariesManagementBean bean = (SummariesManagementBean) viewState.getMetaObject().getObject();
readAndSaveTeacher(bean, (DynaActionForm) form, request, mapping);
try {
CreateSummary.runCreateSummary(bean);
} catch (DomainException e) {
addActionMessage(request, e.getMessage());
return goToSummaryManagementPageAgain(mapping, request, (DynaActionForm) form, bean);
} catch (NotAuthorizedException e) {
addActionMessage(request, e.getMessage());
return goToSummaryManagementPageAgain(mapping, request, (DynaActionForm) form, bean);
}
RenderUtils.invalidateViewState();
DynaActionForm dynaActionForm = (DynaActionForm) form;
Professorship loggedProfessorship = (Professorship) request.getAttribute("loggedTeacherProfessorship");
ExecutionCourse executionCourse = (ExecutionCourse) request.getAttribute("executionCourse");
dynaActionForm.set("teacher", loggedProfessorship.getExternalId().toString());
SummariesManagementBean newBean =
new SummariesManagementBean(SummariesManagementBean.SummaryType.NORMAL_SUMMARY, executionCourse,
loggedProfessorship, null);
newBean.setSummaryText(bean.getSummaryText());
newBean.setTitle(bean.getTitle());
request.setAttribute("summariesManagementBean", newBean);
return mapping.findForward("prepareInsertSummary");
}