public ActionForward dissociateCurricularCourse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws FenixActionException {
String executionCourseId = RequestUtils.getAndSetStringToRequest(request, "executionCourseId");
String curricularCourseId = RequestUtils.getAndSetStringToRequest(request, "curricularCourseId");
ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseId);
String executionCourseName = executionCourse.getName() + " [" + executionCourse.getDegreePresentationString() + "]";
try {
DissociateCurricularCourseByExecutionCourseId.run(executionCourseId, curricularCourseId);
CurricularCourse curricularCourse = FenixFramework.getDomainObject(curricularCourseId);
addActionMessage("success", request, "message.manager.executionCourseManagement.dissociate.success",
curricularCourse.getName(), curricularCourse.getDegreeCurricularPlan().getName());
} catch (FenixServiceException e) {
throw new FenixActionException(e);
}
Set<Degree> degrees = executionCourse.getDegreesSortedByDegreeName();
// destination attributes
String originExecutionDegreeId = RequestUtils.getAndSetStringToRequest(request, "originExecutionDegreeId");
ExecutionDegree originExecutionDegree = FenixFramework.getDomainObject(originExecutionDegreeId);
request.setAttribute("originExecutionDegreeName", originExecutionDegree.getPresentationName());
Boolean chooseNotLinked = Boolean.valueOf(RequestUtils.getAndSetStringToRequest(request, "executionCoursesNotLinked"));
String curricularYearId = RequestUtils.getAndSetStringToRequest(request, "curricularYearId");
if (!degrees.contains(originExecutionDegree.getDegree())) {
ExecutionCourseBean sessionBean = new ExecutionCourseBean();
sessionBean.setSourceExecutionCourse(executionCourse);
sessionBean.setExecutionSemester(executionCourse.getExecutionPeriod());
sessionBean.setChooseNotLinked(chooseNotLinked);
CurricularYear curYear = FenixFramework.getDomainObject(curricularYearId);
sessionBean.setExecutionDegree(originExecutionDegree);
sessionBean.setCurricularYear(curYear);