Integer degreeCurricularPlanID = new Integer(request.getParameter("degreeCurricularPlanID")); request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);
    public ActionForward prepare(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws FenixActionException, FenixFilterException {        HttpSession session = request.getSession(false);        Integer executionCourseID = null;        try {            executionCourseID = new Integer(request.getParameter("objectCode"));                } catch (NumberFormatException ex) {            //ok, we don't want to view a shift's student list        }                DynaActionForm formBean = (DynaActionForm)form;        UserView userView = (UserView) session.getAttribute(SessionConstants.U_VIEW);                // all the information, no filtering applied        Object args[] = { executionCourseID, null, null, null };        TeacherAdministrationSiteView siteView = null;        InfoForReadStudentsWithAttendsByExecutionCourse infoDTO = null;        try {            siteView = (TeacherAdministrationSiteView) ServiceManagerServiceFactory.executeService(                    userView, "ReadStudentsWithAttendsByExecutionCourse", args);            infoDTO = (InfoForReadStudentsWithAttendsByExecutionCourse) siteView.getComponent();                                    Collections.sort(infoDTO.getInfoAttends(), new BeanComparator("infoAttends.aluno.number"));        } catch (FenixServiceException e) {            throw new FenixActionException(e);        }        request.setAttribute("siteView", siteView);        request.setAttribute("objectCode", executionCourseID);        request.setAttribute("viewPhoto", Boolean.FALSE);                //filling the courses checkboxes in the form-bean        List infoDCPs = ((InfoForReadStudentsWithAttendsByExecutionCourse)siteView.getComponent()).getInfoDegreeCurricularPlans();        Integer cbCourses[] = new Integer[infoDCPs.size() + 1];        String cbCoursesString[] = new String[infoDCPs.size() + 1];        cbCourses[0] = new Integer(0);        cbCoursesString[0] = "0";        for (int i = 1; i < cbCourses.length; i++){            cbCourses[i] = ((InfoDegreeCurricularPlan)infoDCPs.get(i-1)).getIdInternal();            cbCoursesString[i] = cbCourses[i].toString();        }        //filling the shifts checkboxes in the form-bean        List infoShifts = ((InfoForReadStudentsWithAttendsByExecutionCourse)siteView.getComponent()).getInfoShifts();        Integer cbShifts[] = new Integer[infoShifts.size() + 1];        String cbShiftsString[] = new String[infoShifts.size() + 1];        cbShifts[0] = new Integer(0);        cbShiftsString[0] = "0";        for (int i = 1; i < cbShifts.length; i++){            cbShifts[i] = ((InfoShift)infoShifts.get(i-1)).getIdInternal();            cbShiftsString[i] = cbShifts[i].toString();        }        //      filling the enrollment filters checkboxes in the form-bean        String cbFilters[] = new String[4]; // 4 selection criteria        cbFilters[0] = AttendacyStateSelectionType.ALL.toString();        cbFilters[1] = AttendacyStateSelectionType.ENROLLED.toString();        cbFilters[2] = AttendacyStateSelectionType.NOT_ENROLLED.toString();        cbFilters[3] = AttendacyStateSelectionType.IMPROVEMENT.toString();                formBean.set("coursesIDs",cbCourses);        formBean.set("shiftIDs",cbShifts);        formBean.set("enrollmentType",cbFilters);                        Map sendMailParameters = new HashMap();        sendMailParameters.put("objectCode",infoDTO.getInfoExecutionCourse().getIdInternal());        sendMailParameters.put("method","prepare");        request.setAttribute("sendMailLinkParameters",sendMailParameters);                Map spreadSheetParameters = new HashMap();        spreadSheetParameters.put("objectCode",infoDTO.getInfoExecutionCourse().getIdInternal());        spreadSheetParameters.put("method","prepare");        spreadSheetParameters.put("coursesIDs",cbCoursesString);        spreadSheetParameters.put("enrollmentType",cbFilters);        spreadSheetParameters.put("shiftIDs",cbShiftsString);        request.setAttribute("spreadSheetLinkArgs",spreadSheetParameters);        return mapping.findForward("success");    }