List avaliableCurricularPlans = new LinkedList(); for (Iterator iter = degrees.iterator(); iter.hasNext();) { InfoDegreeCurricularPlan infoDegreeCurricularPlan = (InfoDegreeCurricularPlan) iter.next(); if (infoDegreeCurricularPlan.getInfoDegree().getTipoCurso().equals(DegreeType.MASTER_DEGREE)) avaliableCurricularPlans.add(infoDegreeCurricularPlan); else if (infoDegreeCurricularPlan.getName().endsWith("2003/2004")) { String newName = new String(); newName = infoDegreeCurricularPlan.getName().replaceAll("2003/2004", ""); infoDegreeCurricularPlan.setName(newName); avaliableCurricularPlans.add(infoDegreeCurricularPlan); } else if (infoDegreeCurricularPlan.getName().indexOf("2") != -1) { String newName = new String(); newName = infoDegreeCurricularPlan.getName().replaceAll("2003", ""); infoDegreeCurricularPlan.setName(newName); avaliableCurricularPlans.add(infoDegreeCurricularPlan); } } Collections.sort(avaliableCurricularPlans, new BeanComparator("name"));
Collections.sort(avaliableCurricularPlans, new BeanComparator("name"));
    private void setAvaliableOptionsForInputQueries(HttpServletRequest request, IUserView userView)            throws FenixActionException {        List seminaries = null;        List cases = null;        List degrees = null;        List modalities = null;        List equivalencies = null;        List themes = null;        List curricularCoursesWithEquivalency = new LinkedList();        try {            Object[] argsReadSeminaries = { new Boolean(false) };            Object[] argsReadCasesStudy = {};            Object[] argsReadDegrees = {};            Object[] argsReadModalities = {};            Object[] argsReadThemes = {};            Object[] argsReadEquivalencies = {};            Object[] argsReadCurrentExecutionPeriod = {};            seminaries = (List) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetAllSeminaries", argsReadSeminaries);            cases = (List) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetAllCasesStudy", argsReadCasesStudy);            degrees = (List) ServiceManagerServiceFactory.executeService(userView,                    "manager.ReadDegreeCurricularPlans", argsReadDegrees);            modalities = (List) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetAllModalities", argsReadModalities);            themes = (List) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetAllThemes", argsReadThemes);            equivalencies = (List) ServiceManagerServiceFactory.executeService(userView,                    "Seminaries.GetAllEquivalencies", argsReadEquivalencies);            ServiceManagerServiceFactory.executeService(userView, "ReadCurrentExecutionPeriod",                    argsReadCurrentExecutionPeriod);            //            //            for (Iterator iterator = equivalencies.iterator(); iterator.hasNext();) {                InfoEquivalency equivalency = (InfoEquivalency) iterator.next();                InfoCurricularCourse curricularCourse = equivalency.getCurricularCourse();                curricularCoursesWithEquivalency.add(curricularCourse);            }        } catch (Exception e) {            e.printStackTrace();            throw new FenixActionException(e);        }        //this is very ugly, but the boss asked for it :)        //we will display only the Master Curricular Plans and the actual        // (current execution period) curricular plans for other degree types        List avaliableCurricularPlans = new LinkedList();        for (Iterator iter = degrees.iterator(); iter.hasNext();) {            InfoDegreeCurricularPlan infoDegreeCurricularPlan = (InfoDegreeCurricularPlan) iter.next();            if (infoDegreeCurricularPlan.getInfoDegree().getTipoCurso().equals(DegreeType.MASTER_DEGREE))                avaliableCurricularPlans.add(infoDegreeCurricularPlan);            else if (infoDegreeCurricularPlan.getName().endsWith("2003/2004")) {                String newName = new String();                newName = infoDegreeCurricularPlan.getName().replaceAll("2003/2004", "");                infoDegreeCurricularPlan.setName(newName);                avaliableCurricularPlans.add(infoDegreeCurricularPlan);            } else if (infoDegreeCurricularPlan.getName().indexOf("2") != -1) {                String newName = new String();                newName = infoDegreeCurricularPlan.getName().replaceAll("2003", "");                infoDegreeCurricularPlan.setName(newName);                avaliableCurricularPlans.add(infoDegreeCurricularPlan);            }        }        Collections.sort(avaliableCurricularPlans, new BeanComparator("name"));        request.setAttribute("seminaries", seminaries);        request.setAttribute("cases", cases);        request.setAttribute("degrees", avaliableCurricularPlans);        request.setAttribute("modalities", modalities);        request.setAttribute("courses", curricularCoursesWithEquivalency);        request.setAttribute("themes", themes);    }