executionDegreeList, messageResources);
executionDegreeList, messageResources, request);
    public ActionForward prepareSearch(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        // TODO : find a way to refactor this code so it is shared with context        // selection.        // this implies changing the form value from index to executionPeriodOID        // etc.        // The same should be done with the selection of the execution course        // and        // of the curricular year.        IUserView userView = (IUserView) request.getSession(false).getAttribute("UserView");        InfoExecutionPeriod selectedExecutionPeriod = (InfoExecutionPeriod) request                .getAttribute(SessionConstants.EXECUTION_PERIOD);        Object argsReadExecutionPeriods[] = {};        List executionPeriods = (ArrayList) ServiceManagerServiceFactory.executeService(userView,                "ReadExecutionPeriods", argsReadExecutionPeriods);        ComparatorChain chainComparator = new ComparatorChain();        chainComparator.addComparator(new BeanComparator("infoExecutionYear.year"));        chainComparator.addComparator(new BeanComparator("semester"));        Collections.sort(executionPeriods, chainComparator);        if (selectedExecutionPeriod != null) {            DynaActionForm searchExecutionCourse = (DynaActionForm) form;            searchExecutionCourse.set("executionPeriodOID", selectedExecutionPeriod.getIdInternal()                    .toString());        }        List executionPeriodsLabelValueList = new ArrayList();        for (int i = 0; i < executionPeriods.size(); i++) {            InfoExecutionPeriod infoExecutionPeriod = (InfoExecutionPeriod) executionPeriods.get(i);            executionPeriodsLabelValueList.add(new LabelValueBean(infoExecutionPeriod.getName() + " - "                    + infoExecutionPeriod.getInfoExecutionYear().getYear(), infoExecutionPeriod                    .getIdInternal().toString()));        }        request.setAttribute(SessionConstants.LABELLIST_EXECUTIONPERIOD, executionPeriodsLabelValueList);        // //////////////////////////////////////////////////////////////////////////        /* Obtain a list of curricular years */        List labelListOfCurricularYears = ContextUtils.getLabelListOfOptionalCurricularYears();        request.setAttribute(SessionConstants.LABELLIST_CURRICULAR_YEARS, labelListOfCurricularYears);        /* Obtain a list of degrees for the specified execution year */        Object argsLerLicenciaturas[] = { selectedExecutionPeriod.getInfoExecutionYear() };        List executionDegreeList = null;        try {                                              executionDegreeList = (List) ServiceUtils.executeService(userView,                    "ReadExecutionDegreesByExecutionYear", argsLerLicenciaturas);            /* Sort the list of degrees */            Collections.sort(executionDegreeList, new ComparatorByNameForInfoExecutionDegree());        } catch (FenixServiceException e) {            e.printStackTrace();        }        MessageResources messageResources = this.getResources(request, "ENUMERATION_RESOURCES");        /* Generate a label list for the above list of degrees */        List labelListOfExecutionDegrees = ExecutionDegreesFormat.buildExecutionDegreeLabelValueBean(                executionDegreeList, messageResources);// ContextUtils.getLabelListOfExecutionDegrees(executionDegreeList);        request.setAttribute(SessionConstants.LIST_INFOEXECUTIONDEGREE, labelListOfExecutionDegrees);        return mapping.findForward("ShowSearchForm");    }