infoShiftStudentEnrolment = (InfoShiftStudentEnrolment) ServiceUtils.executeService(userView, "ValidateAndConfirmShiftStudentEnrolment", new Object[] { infoShiftStudentEnrolment }); } catch (Exception e) {
infoShiftStudentEnrolment = (InfoShiftStudentEnrolment) ServiceUtils.executeService( userView, "ValidateAndConfirmShiftStudentEnrolment", new Object[] { infoShiftStudentEnrolment }); } catch (FenixServiceException e) {
	public ActionForward validateAndConfirmShiftEnrolment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {		//validateToken(request, form, mapping);		Integer[] shifts = (Integer[]) ((DynaActionForm) form).get("shifts");		ArrayList toEnroll = new ArrayList();		HttpSession session = request.getSession();		IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);		InfoShiftStudentEnrolment infoShiftStudentEnrolment = (InfoShiftStudentEnrolment) session.getAttribute(SessionConstants.INFO_STUDENT_SHIFT_ENROLMENT_CONTEXT_KEY);		List avaliableShifts = infoShiftStudentEnrolment.getAvailableShift();		// Insert into the wanted shifts list the shifts the user has selected		InfoShift shift;		for (int i = 0; i < shifts.length; i++) {			Iterator it = avaliableShifts.iterator();			if (shifts[i] == null) {				continue;				// the user may have wished not to select a particular shift group			}			while (it.hasNext()) {				shift = (InfoShift) ((InfoShiftWithAssociatedInfoClassesAndInfoLessons) it.next()).getInfoShift();				if (shifts[i].equals(shift.getIdInternal())) {					toEnroll.add(shift);				}			}		}		// Insert into the wanted shifts list the shifts the users is already enroled in		Iterator it = infoShiftStudentEnrolment.getCurrentEnrolment().iterator();		while (it.hasNext()) {			toEnroll.add(it.next());		}		infoShiftStudentEnrolment.setWantedShifts(toEnroll);		try {			infoShiftStudentEnrolment = (InfoShiftStudentEnrolment) ServiceUtils.executeService(userView, "ValidateAndConfirmShiftStudentEnrolment", new Object[] { infoShiftStudentEnrolment });		} catch (Exception e) {			// TODO: tdi-dev (bruno) -> here we will catch the errors that say "hey, you made a boo boo". or not		}		return mapping.findForward("validateAndConfirmShiftEnrolment");		// TODO: tdi-dev (bruno) -> clean up session variable?	}