final IViewState summaryViewState = RenderUtils .getViewState("summariesManagementBeanWithSummary"); if (summaryViewState != null) { SummariesManagementBean summaryBean = (SummariesManagementBean) summaryViewState .getMetaObject().getObject(); request.setAttribute("summariesManagementBean", summaryBean); return mapping.findForward("prepareInsertComplexSummary"); }
return goToInsertComplexSummaryAgain(request, mapping, response, form);
    public ActionForward prepareCreateComplexSummary(ActionMapping mapping, ActionForm form,	    HttpServletRequest request, HttpServletResponse response) {	Professorship loggedProfessorship = (Professorship) request		.getAttribute("loggedTeacherProfessorship");	ExecutionCourse executionCourse = (ExecutionCourse) request.getAttribute("executionCourse");	DynaActionForm dynaActionForm = (DynaActionForm) form;	String[] selectedLessons = request.getParameterValues("selectedLessonAndDate");	if (selectedLessons == null || selectedLessons.length == 0) {	    final IViewState summaryViewState = RenderUtils		    .getViewState("summariesManagementBeanWithSummary");	    if (summaryViewState != null) {		SummariesManagementBean summaryBean = (SummariesManagementBean) summaryViewState			.getMetaObject().getObject();				request.setAttribute("summariesManagementBean", summaryBean);		return mapping.findForward("prepareInsertComplexSummary");	    }	} else if (selectedLessons != null && selectedLessons.length != 0) {	    ShiftType shiftType = null;	    Shift shift = null;	    boolean uniqueType = true;	    List<NextPossibleSummaryLessonsAndDatesBean> nextPossibleLessonsDates = new ArrayList<NextPossibleSummaryLessonsAndDatesBean>();	    for (int i = 0; i < selectedLessons.length; i++) {		String lessonRepresentation = selectedLessons[i];		NextPossibleSummaryLessonsAndDatesBean nextLesson = NextPossibleSummaryLessonsAndDatesBean			.getNewInstance(lessonRepresentation);		nextPossibleLessonsDates.add(nextLesson);		ShiftType lessonType = nextLesson.getLesson().getTipo();		if (shiftType == null) {		    shiftType = lessonType;		    shift = nextLesson.getLesson().getShift();		} else if (!shiftType.equals(lessonType)) {		    request.setAttribute("notShowLessonPlanningsAndSummaries", Boolean.TRUE);		    uniqueType = false;		}	    }	    	    SummariesManagementBean bean = new SummariesManagementBean(		    SummariesManagementBean.SummaryType.NORMAL_SUMMARY, executionCourse,		    loggedProfessorship, nextPossibleLessonsDates);	    if (uniqueType && shift != null) {		bean.setShift(shift);	    }	    request.setAttribute("summariesManagementBean", bean);	    dynaActionForm.set("teacher", loggedProfessorship.getIdInternal().toString());	    return mapping.findForward("prepareInsertComplexSummary");	}	return prepareShowSummaries(mapping, form, request, response);    }