use of org.olat.commons.calendar.ui.components.KalendarEventRenderWrapper in project openolat by klemens.
the class CalendarPrintMapper method handle.
@Override
public MediaResource handle(String relPath, HttpServletRequest request) {
StringBuilder sb = new StringBuilder();
sb.append("<html><head><title>").append("Calendar").append("</title>").append("<meta http-equiv='Content-type' content='text/html; charset=utf-8' />").append("<link href='").append(themeBaseUri).append("theme.css' rel='stylesheet' type='text/css' />\n").append("<!--[if IE 9]><link id='o_theme_css_ie' href='").append(themeBaseUri).append("theme_ie_completions.css' rel='stylesheet' type='text/css' /><![endif]-->\n").append("</head><body class='o_cal_print' onload='window.focus();window.print()'>");
// collect all events
List<KalendarEventRenderWrapper> sortedEventsWithin = new ArrayList<>();
collectEvents(sortedEventsWithin, calendarWrappers);
Collections.sort(sortedEventsWithin, KalendarEventDateComparator.getInstance());
// list of events
renderEvents(sb, sortedEventsWithin, from, to);
// list of calendars
renderCalendars(sb);
sb.append("</body></html>");
StringMediaResource smr = new StringMediaResource();
smr.setContentType("text/html");
smr.setEncoding("UTF-8");
smr.setData(sb.toString());
return smr;
}
Aggregations