return FenixFramework.getDomainObject(request.getParameter("degreeCurricularPlanID"));
}
public ActionForward selectPerson(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) throws Exception {
ThesisBean bean = getRenderedObject("bean");
if (bean == null) {
return editProposal(mapping, actionForm, request, response);
}
request.setAttribute("bean", bean);
Person selectedPerson = bean.getPerson();
if (selectedPerson == null) {
addActionMessage("info", request, "thesis.selectPerson.internal.required");
return mapping.findForward("select-person");
} else {
DegreeCurricularPlan degreeCurricularPlan = getDegreeCurricularPlan(request);
Thesis thesis = getThesis(request);
final PersonTarget personTarget = bean.getTargetType();
if (personTarget == PersonTarget.president) {
final Enrolment enrolment = thesis.getEnrolment();
final ExecutionYear executionYear = enrolment.getExecutionYear();
if (selectedPerson == null || !degreeCurricularPlan.isScientificCommissionMember(executionYear, selectedPerson)) {
addActionMessage("info", request, "thesis.selectPerson.president.required.scientific.commission");
return mapping.findForward("select-person");
}
}
if (personTarget == PersonTarget.vowel) {
for (ThesisEvaluationParticipant participant : thesis.getVowels()) {
if (participant.getPerson() == selectedPerson) {
addActionMessage("info", request, "thesis.selectPerson.vowel.duplicated");
return mapping.findForward("select-person");
}
}
}
ChangeThesisPerson.run(degreeCurricularPlan, thesis,
new PersonChange(bean.getTargetType(), selectedPerson, bean.getTarget()));
return editProposal(mapping, actionForm, request, response);
}
}