labelListOfCurricularYears.add(new LabelValueBean("5 ยบ", "5"));
return labelListOfCurricularYears;
}
public static void setContextSelectionBean(HttpServletRequest request, Object renderedObject) {
ContextSelectionBean context = null;
if (renderedObject != null && renderedObject instanceof ContextSelectionBean) {
RenderUtils.invalidateViewState();
context = (ContextSelectionBean) renderedObject;
} else if (request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN) != null) {
context = (ContextSelectionBean) request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN);
} else {
AcademicInterval academicInterval = null;
ExecutionDegree executionDegree = null;
CurricularYear curricularYear = null;
String courseName = null;
if (request.getAttribute(PresentationConstants.ACADEMIC_INTERVAL) != null) {
String academicIntervalStr = (String) request.getAttribute(PresentationConstants.ACADEMIC_INTERVAL);
academicInterval = AcademicInterval.getAcademicIntervalFromResumedString(academicIntervalStr);
} else if (request.getParameter(PresentationConstants.ACADEMIC_INTERVAL) != null) {
String academicIntervalStr = request.getParameter(PresentationConstants.ACADEMIC_INTERVAL);
if (academicIntervalStr != null && !academicIntervalStr.equals("null")) {
academicInterval = AcademicInterval.getAcademicIntervalFromResumedString(academicIntervalStr);
}
}
if (academicInterval == null) {
academicInterval = AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.SEMESTER);
}
if (request.getAttribute(PresentationConstants.EXECUTION_DEGREE_OID) != null) {
executionDegree =
FenixFramework.getDomainObject((String) request.getAttribute(PresentationConstants.EXECUTION_DEGREE_OID));
} else if (request.getParameter(PresentationConstants.EXECUTION_DEGREE_OID) != null) {
executionDegree =
FenixFramework.getDomainObject(request.getParameter(PresentationConstants.EXECUTION_DEGREE_OID));
}
if (request.getAttribute(PresentationConstants.CURRICULAR_YEAR_OID) != null
&& !request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID).equals("null")) {
curricularYear =
FenixFramework.getDomainObject((String) request.getAttribute(PresentationConstants.CURRICULAR_YEAR_OID));
} else if (request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID) != null
&& !request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID).equals("null")) {
curricularYear = FenixFramework.getDomainObject(request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID));
}
if (request.getAttribute("execution_course_name") != null) {
courseName = (String) request.getAttribute("execution_course_name");
} else if (request.getParameter("execution_course_name") != null) {
courseName = request.getParameter("execution_course_name");
}
context = new ContextSelectionBean(academicInterval, executionDegree, curricularYear);
context.setCourseName(courseName);
}
request.setAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN, context);
request.setAttribute(PresentationConstants.ACADEMIC_INTERVAL, context.getAcademicInterval()
.getResumedRepresentationInStringFormat());
if (context.getExecutionDegree() != null) {
request.setAttribute(PresentationConstants.EXECUTION_DEGREE, new InfoExecutionDegree(context.getExecutionDegree()));
}
request.setAttribute(PresentationConstants.CURRICULAR_YEAR, new InfoCurricularYear(context.getCurricularYear()));
}