예제 #1
0
  private boolean isActiveForCalendarEntry(AcademicCalendarEntry entry) {
    if (entry instanceof AcademicCalendarRootEntry) {
      return false;
    }

    if (entry instanceof AcademicYearCE) {
      return intersects(entry.getBegin().toDate(), entry.getEnd().toDate());
    }

    if (intersects(entry.getBegin().toDate(), entry.getEnd().toDate())
        && new Integer(entry.getAcademicSemesterOfAcademicYear(entry.getAcademicChronology()))
            .equals(getCurricularSemester().getSemester())) {
      return true;
    }
    return isActiveForCalendarEntry(entry.getParentEntry());
  }
예제 #2
0
  public static CalendarEntryBean createCalendarEntryBeanToEditEntry(
      AcademicCalendarRootEntry rootEntry,
      AcademicCalendarEntry entry,
      Partial begin,
      Partial end) {

    CalendarEntryBean bean = new CalendarEntryBean();

    bean.setRootEntry(rootEntry);
    bean.setEntry(entry);
    bean.setBeginDateToDisplay(begin);
    bean.setEndDateToDisplay(end);

    bean.setTemplateEntry(entry.getTemplateEntry());
    bean.setType(entry.getClass());
    bean.setTitle(entry.getTitle());
    bean.setDescription(entry.getDescription());
    bean.setBegin(entry.getBegin());
    bean.setEnd(entry.getEnd());

    return bean;
  }