public ActionForward prepareDefineCreationPeriods(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) throws Exception {
final ThesisCreationPeriodFactoryExecutor thesisCreationPeriodFactoryExecutor =
getThesisCreationPeriodFactoryExecutor(request);
final ExecutionDegree executionDegree = thesisCreationPeriodFactoryExecutor.getExecutionDegree();
if (executionDegree == null) {
final ExecutionYear executionYear = thesisCreationPeriodFactoryExecutor.getExecutionYear();
if (executionYear != null) {
for (final ExecutionDegree otherExecutionDegree : executionYear.getExecutionDegreesSet()) {
final YearMonthDay beginThesisCreationPeriod = otherExecutionDegree.getBeginThesisCreationPeriod();
final YearMonthDay endThesisCreationPeriod = otherExecutionDegree.getEndThesisCreationPeriod();
if (beginThesisCreationPeriod != null) {
thesisCreationPeriodFactoryExecutor.setBeginThesisCreationPeriod(beginThesisCreationPeriod);
}
if (endThesisCreationPeriod != null) {
thesisCreationPeriodFactoryExecutor.setEndThesisCreationPeriod(endThesisCreationPeriod);
}
if (thesisCreationPeriodFactoryExecutor.getBeginThesisCreationPeriod() != null
&& thesisCreationPeriodFactoryExecutor.getEndThesisCreationPeriod() != null) {
break;
}
}
}
} else {
thesisCreationPeriodFactoryExecutor.setBeginThesisCreationPeriod(executionDegree.getBeginThesisCreationPeriod());
thesisCreationPeriodFactoryExecutor.setEndThesisCreationPeriod(executionDegree.getEndThesisCreationPeriod());
}
request.setAttribute("prepareDefineCreationPeriods", Boolean.TRUE);
return mapping.findForward("list-thesis-creation-periods");