final Integer anoCurricular = (Integer) escolherContextoForm.get("curYear");
request.setAttribute("curYear", anoCurricular);
// infoDegreeCurricularPlan
if (degreeCurricularPlanId != null) {
final DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanId);
InfoDegreeCurricularPlan infoDegreeCurricularPlan = InfoDegreeCurricularPlan.newInfoFromDomain(degreeCurricularPlan);
request.setAttribute("infoDegreeCurricularPlan", infoDegreeCurricularPlan);
}
InfoExecutionPeriod infoExecutionPeriod =
(InfoExecutionPeriod) request.getAttribute(PresentationConstants.EXECUTION_PERIOD);
String executionPeriodID = (String) escolherContextoForm.get("indice");
if (StringUtils.isEmpty(executionPeriodID)) {
executionPeriodID = getFromRequest("indice", request);
}
if (!StringUtils.isEmpty(executionPeriodID)) {
infoExecutionPeriod = ReadExecutionPeriodByOID.run(executionPeriodID);
}
request.setAttribute("indice", infoExecutionPeriod.getExternalId());
escolherContextoForm.set("indice", infoExecutionPeriod.getExternalId());
RequestUtils.setExecutionPeriodToRequest(request, infoExecutionPeriod);
request.setAttribute(PresentationConstants.EXECUTION_PERIOD, infoExecutionPeriod);
request.setAttribute(PresentationConstants.EXECUTION_PERIOD_OID, infoExecutionPeriod.getExternalId().toString());
request.setAttribute("semester", infoExecutionPeriod.getSemester());
final ExecutionSemester executionSemester = FenixFramework.getDomainObject(infoExecutionPeriod.getExternalId());
final DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanId);
ExecutionDegree 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());