checkIfStudentHasPayedTuition(request, studentCurricularPlan);
} catch (FenixServiceException e) { e.printStackTrace(); if (e.getMessage() != null && e.getMessage().endsWith("noCurricularPlans")) { addActionMessage(request, e.getMessage(), studentNumber.toString()); } else if (e.getMessage() != null && !e.getMessage().endsWith("noCurricularPlans")) { addActionMessage(request, e.getMessage()); } else { addActionMessage(request, "error.impossible.operations"); } return mapping.getInputForward(); }
	public ActionForward readCoursesToEnroll(ActionMapping mapping, ActionForm actionForm,			HttpServletRequest request, HttpServletResponse response) throws Exception {		final DynaActionForm form = (DynaActionForm) actionForm;		final Integer studentNumber = Integer.valueOf(form.getString("studentNumber"));		final ExecutionPeriod executionPeriod = getExecutionPeriod(form);				final Integer executionDegreeID = Integer.valueOf(form.getString("executionDegree"));		final List<Integer> curricularYearsList = Arrays.asList((Integer[]) form.get("curricularYears"));		final List<Integer> curricularSemesters = Arrays.asList((Integer[]) form.get("curricularSemesters"));		StudentCurricularPlan studentCurricularPlan = null;		List<CurricularCourse2Enroll> curricularCourses2Enroll = null;		try {			final Integer userType = (Integer) form.get("userType");			final Registration registration = getStudent(form);			studentCurricularPlan = registration.getActiveOrConcludedStudentCurricularPlan();			if (userType.equals(0)) {				curricularCourses2Enroll = (List<CurricularCourse2Enroll>) ServiceManagerServiceFactory						.executeService(getUserView(request), "ReadCurricularCoursesToEnroll",								new Object[] { registration, getDegreeType(form), executionPeriod,										executionDegreeID, curricularYearsList, curricularSemesters });			} else {				curricularCourses2Enroll = (List<CurricularCourse2Enroll>) ServiceManagerServiceFactory						.executeService(getUserView(request), "ReadCurricularCoursesToEnrollSuperUser",								new Object[] { registration, getDegreeType(form), executionPeriod,										executionDegreeID, curricularYearsList, curricularSemesters });			}		} catch (NotAuthorizedFilterException e) {			e.printStackTrace();			addActionMessage(request, "error.exception.notAuthorized2");			return mapping.getInputForward();		} catch (FenixServiceException e) {			e.printStackTrace();			if (e.getMessage() != null && e.getMessage().endsWith("noCurricularPlans")) {				addActionMessage(request, e.getMessage(), studentNumber.toString());			} else if (e.getMessage() != null && !e.getMessage().endsWith("noCurricularPlans")) {				addActionMessage(request, e.getMessage());			} else {				addActionMessage(request, "error.impossible.operations");			}			return mapping.getInputForward();		}		checkIfStudentHasPayedTuition(request, studentCurricularPlan);		// set attributes used by courseEnrollment context		request.setAttribute("executionPeriod", executionPeriod);		request.setAttribute("studentCurricularPlan", studentCurricularPlan);		sortCurricularCourses2Enrol(curricularCourses2Enroll);		request.setAttribute("curricularCourses2Enroll", curricularCourses2Enroll);		form.set("enrollmentTypes", getInitializedMap(curricularCourses2Enroll));		return mapping.findForward("showCurricularCourseToEnroll");	}