return mapping.findForward("showForm");
}
public ActionForward chooseStudent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
final StudentContextSelectionBean studentContextSelectionBean = getRenderedObject();
final String number = studentContextSelectionBean.getNumber();
if (number != null && !number.isEmpty()) {
final AcademicInterval academicInterval = studentContextSelectionBean.getAcademicInterval();
final ExecutionInterval executionInterval = ExecutionInterval.getExecutionInterval(academicInterval);
final SearchParameters searchParameters = new SearchParameters();
if (StringUtils.isNumeric(number)) {
searchParameters.setStudentNumber(Integer.valueOf(number));
} else {
searchParameters.setUsername(number);
}
final CollectionPager<Person> people =
new SearchPerson().run(searchParameters, new SearchPerson.SearchPersonPredicate(searchParameters));
final Collection<Registration> registrations = new ArrayList<Registration>();
for (final Person person : people.getCollection()) {
if (person.getStudent() != null) {
for (final Registration registration : person.getStudent().getRegistrationsSet()) {
if (registration.hasAnyActiveState((ExecutionSemester) executionInterval)) {
registrations.add(registration);
}
}
}
}
if (studentContextSelectionBean.getToEdit()) {
request.setAttribute("toEditScheduleRegistrations", registrations);
} else {
request.setAttribute("registrations", registrations);
request.setAttribute("timeTableExecutionSemester", executionInterval);
}