public ActionForward viewAllLessonDates(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
final InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
final Lesson lesson = infoLesson.getLesson();
final Set<NextPossibleSummaryLessonsAndDatesBean> lessonDatesBean =
new TreeSet<NextPossibleSummaryLessonsAndDatesBean>(
NextPossibleSummaryLessonsAndDatesBean.COMPARATOR_BY_DATE_AND_HOUR);
for (final LessonInstance instance : infoLesson.getLesson().getLessonInstancesSet()) {
final NextPossibleSummaryLessonsAndDatesBean bean =
new NextPossibleSummaryLessonsAndDatesBean(lesson, instance.getDay());
bean.setRoom(instance.getRoom());
bean.setTime(instance.getStartTime());
lessonDatesBean.add(bean);
}
if (!lesson.wasFinished()) {
for (final YearMonthDay yearMonthDay : lesson.getAllLessonDatesWithoutInstanceDates()) {
final NextPossibleSummaryLessonsAndDatesBean bean =
new NextPossibleSummaryLessonsAndDatesBean(lesson, yearMonthDay);
bean.setRoom(lesson.getSala());
bean.setTime(lesson.getBeginHourMinuteSecond());
lessonDatesBean.add(bean);
}
}
request.setAttribute("lessonDates", lessonDatesBean);