final List<Integer> curricularYears = buildCurricularYearList(selectAllCurricularYears, degree, chooseExamContextoForm);
request.setAttribute("curricularYearList", curricularYears);
// degreeCurricularPlanID
String degreeCurricularPlanId = getFromRequest("degreeCurricularPlanID", request);
final DegreeCurricularPlan degreeCurricularPlan;
if (StringUtils.isEmpty(degreeCurricularPlanId)) {
degreeCurricularPlan = degree.getMostRecentDegreeCurricularPlan();
} else {
degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanId);
}
if (degreeCurricularPlan != null) {
request.setAttribute("degreeCurricularPlanID", degreeCurricularPlan.getExternalId());
if (!degreeCurricularPlan.getDegree().getExternalId().equals(degreeId)) {
throw new FenixActionException();
}
// lista
List<LabelValueBean> executionPeriodsLabelValueList =
buildExecutionPeriodsLabelValueList(degreeCurricularPlan.getExternalId());
if (executionPeriodsLabelValueList.size() > 1) {
request.setAttribute("lista", executionPeriodsLabelValueList);
} else {
request.removeAttribute("lista");
}
// infoDegreeCurricularPlan
InfoDegreeCurricularPlan infoDegreeCurricularPlan = InfoDegreeCurricularPlan.newInfoFromDomain(degreeCurricularPlan);
request.setAttribute("infoDegreeCurricularPlan", infoDegreeCurricularPlan);
}
InfoExecutionPeriod infoExecutionPeriod =
(InfoExecutionPeriod) request.getAttribute(PresentationConstants.EXECUTION_PERIOD);
String executionPeriodID = (String) chooseExamContextoForm.get("indice");
if (executionPeriodID != null && !executionPeriodID.equals("")) {
infoExecutionPeriod = ReadExecutionPeriodByOID.run(executionPeriodID);
}
request.setAttribute("indice", infoExecutionPeriod.getExternalId());
chooseExamContextoForm.set("indice", infoExecutionPeriod.getExternalId());
RequestUtils.setExecutionPeriodToRequest(request, infoExecutionPeriod);
request.setAttribute(PresentationConstants.EXECUTION_PERIOD, infoExecutionPeriod);
request.setAttribute(PresentationConstants.EXECUTION_PERIOD_OID, infoExecutionPeriod.getExternalId().toString());
final ExecutionSemester executionSemester = FenixFramework.getDomainObject(infoExecutionPeriod.getExternalId());
ExecutionDegree executionDegree = null;
if (degreeCurricularPlan != null) {
executionDegree = degreeCurricularPlan.getExecutionDegreeByYear(executionSemester.getExecutionYear());
if (executionDegree == null) {
executionDegree = degreeCurricularPlan.getMostRecentExecutionDegree();
if (executionDegree != null) {
infoExecutionPeriod =
InfoExecutionPeriod.newInfoFromDomain(executionDegree.getExecutionYear().getExecutionSemesterFor(1));
request.setAttribute("indice", infoExecutionPeriod.getExternalId());