public ActionForward showDescription(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {  Integer executionPeriodOId = getFromRequest("executionPeriodOID", request);  Integer degreeId = getFromRequest("degreeID", request); request.setAttribute("degreeID", degreeId);  Integer index = getFromRequest("index", request); request.setAttribute("index", index);  Integer executionDegreeId = getFromRequest("executionDegreeID", request); request.setAttribute("executionDegreeID", executionDegreeId);  Boolean inEnglish = getFromRequestBoolean("inEnglish", request); if (inEnglish == null) { inEnglish = getLocale(request).getLanguage().equals(Locale.ENGLISH.getLanguage()); } request.setAttribute("inEnglish", inEnglish);  if (degreeId == null) {    InfoExecutionYear infoExecutionYear = null; try { final Object[] args = { executionDegreeId }; final InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) ServiceManagerServiceFactory.executeService(null, "ReadExecutionDegreeByOID", args); if (infoExecutionDegree == null || infoExecutionDegree.getInfoDegreeCurricularPlan() == null || infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree() == null || infoExecutionDegree.getInfoExecutionYear() == null) { final ActionErrors errors = new ActionErrors(); errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite")); saveErrors(request, errors); return new ActionForward(mapping.getInput()); }  degreeId = infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree().getIdInternal(); infoExecutionYear = infoExecutionDegree.getInfoExecutionYear();  RequestUtils.setExecutionDegreeToRequest(request, infoExecutionDegree); request.setAttribute("degreeID", degreeId); request.setAttribute("executionDegreeID", infoExecutionDegree.getIdInternal()); } catch (FenixServiceException e) { final ActionErrors errors = new ActionErrors(); errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite")); saveErrors(request, errors); return new ActionForward(mapping.getInput()); }  try { final Object[] args2 = { infoExecutionYear }; final List<InfoExecutionPeriod> executionPeriods = (List<InfoExecutionPeriod>) ServiceManagerServiceFactory.executeService(null, "ReadExecutionPeriodsByExecutionYear", args2); if (executionPeriods == null || executionPeriods.size() <= 0) { final ActionErrors errors = new ActionErrors(); errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite")); } Collections.sort(executionPeriods, new BeanComparator("endDate"));  InfoExecutionPeriod infoExecutionPeriod = ((InfoExecutionPeriod) executionPeriods.get(executionPeriods.size() - 1)); executionPeriodOId = infoExecutionPeriod.getIdInternal();  request.setAttribute(SessionConstants.EXECUTION_PERIOD, infoExecutionPeriod); request.setAttribute(SessionConstants.EXECUTION_PERIOD_OID, infoExecutionPeriod.getIdInternal().toString()); request.setAttribute("schoolYear", infoExecutionYear.getYear()); } catch (FenixServiceException e) { final ActionErrors errors = new ActionErrors(); errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite")); saveErrors(request, errors); return new ActionForward(mapping.getInput()); } }  request.setAttribute("degree", rootDomainObject.readDegreeByOID(degreeId));  final ActionErrors errors = new ActionErrors(); try { final Object[] args = { degreeId }; final InfoDegreeInfo infoDegreeInfo = (InfoDegreeInfo) ServiceManagerServiceFactory.executeService(null, "ReadDegreeInfoByDegree", args); infoDegreeInfo.prepareEnglishPresentation(getLocale(request)); request.setAttribute("infoDegreeInfo", infoDegreeInfo); } catch (FenixServiceException e) { errors.add("impossibleDegreeSite", new ActionError("error.public.DegreeInfoNotPresent")); saveErrors(request, errors); }  try { final Object[] args1 = { executionPeriodOId, degreeId }; final List executionDegreeList = (List) ServiceManagerServiceFactory.executeService(null, "ReadExecutionDegreesByDegreeAndExecutionPeriod", args1); request.setAttribute("infoExecutionDegrees", executionDegreeList); } catch (FenixServiceException e) { errors.add("impossibleDegreeSite", new ActionError("error.impossibleExecutionDegreeList")); saveErrors(request, errors); }
public ActionForward showDescription(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { prepareInfo(request);
    public ActionForward showDescription(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {                Integer executionPeriodOId = getFromRequest("executionPeriodOID", request);        Integer degreeId = getFromRequest("degreeID", request);        request.setAttribute("degreeID", degreeId);        Integer index = getFromRequest("index", request);        request.setAttribute("index", index);                Integer executionDegreeId = getFromRequest("executionDegreeID", request);        request.setAttribute("executionDegreeID", executionDegreeId);        Boolean inEnglish = getFromRequestBoolean("inEnglish", request);        if (inEnglish == null) {            inEnglish = getLocale(request).getLanguage().equals(Locale.ENGLISH.getLanguage());        }        request.setAttribute("inEnglish", inEnglish);              if (degreeId == null) {            // This was call by a coordinator, don't have a degreeId but a executionDegreeId            // Must executionDegree and obtain the correspondent degree                        InfoExecutionYear infoExecutionYear = null;            try {                final Object[] args = { executionDegreeId };                final InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) ServiceManagerServiceFactory.executeService(null, "ReadExecutionDegreeByOID", args);                if (infoExecutionDegree == null                         || infoExecutionDegree.getInfoDegreeCurricularPlan() == null                        || infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree() == null                        || infoExecutionDegree.getInfoExecutionYear() == null) {                    final ActionErrors errors = new ActionErrors();                    errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite"));                    saveErrors(request, errors);                    return new ActionForward(mapping.getInput());                }                degreeId = infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree().getIdInternal();                infoExecutionYear = infoExecutionDegree.getInfoExecutionYear();                RequestUtils.setExecutionDegreeToRequest(request, infoExecutionDegree);                request.setAttribute("degreeID", degreeId);                request.setAttribute("executionDegreeID", infoExecutionDegree.getIdInternal());            } catch (FenixServiceException e) {                final ActionErrors errors = new ActionErrors();                errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite"));                saveErrors(request, errors);                return new ActionForward(mapping.getInput());            }            try {                final Object[] args2 = { infoExecutionYear };                final List<InfoExecutionPeriod> executionPeriods = (List<InfoExecutionPeriod>) ServiceManagerServiceFactory.executeService(null, "ReadExecutionPeriodsByExecutionYear", args2);                if (executionPeriods == null || executionPeriods.size() <= 0) {                    final ActionErrors errors = new ActionErrors();                    errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite"));                }                Collections.sort(executionPeriods, new BeanComparator("endDate"));                InfoExecutionPeriod infoExecutionPeriod = ((InfoExecutionPeriod) executionPeriods.get(executionPeriods.size() - 1));                executionPeriodOId = infoExecutionPeriod.getIdInternal();                                request.setAttribute(SessionConstants.EXECUTION_PERIOD, infoExecutionPeriod);                request.setAttribute(SessionConstants.EXECUTION_PERIOD_OID, infoExecutionPeriod.getIdInternal().toString());                request.setAttribute("schoolYear", infoExecutionYear.getYear());            } catch (FenixServiceException e) {                final ActionErrors errors = new ActionErrors();                errors.add("impossibleDegreeSite", new ActionError("error.impossibleDegreeSite"));                saveErrors(request, errors);                return new ActionForward(mapping.getInput());            }        }        request.setAttribute("degree", rootDomainObject.readDegreeByOID(degreeId));                        final ActionErrors errors = new ActionErrors();        try {            final Object[] args = { degreeId };            final InfoDegreeInfo infoDegreeInfo = (InfoDegreeInfo) ServiceManagerServiceFactory.executeService(null, "ReadDegreeInfoByDegree", args);            infoDegreeInfo.prepareEnglishPresentation(getLocale(request));            request.setAttribute("infoDegreeInfo", infoDegreeInfo);        } catch (FenixServiceException e) {            errors.add("impossibleDegreeSite", new ActionError("error.public.DegreeInfoNotPresent"));            saveErrors(request, errors);        }        try {            final Object[] args1 = { executionPeriodOId, degreeId };            final List executionDegreeList = (List) ServiceManagerServiceFactory.executeService(null, "ReadExecutionDegreesByDegreeAndExecutionPeriod", args1);            request.setAttribute("infoExecutionDegrees", executionDegreeList);        } catch (FenixServiceException e) {            errors.add("impossibleDegreeSite", new ActionError("error.impossibleExecutionDegreeList"));            saveErrors(request, errors);        }        return mapping.findForward("showDescription");    }