Search in sources :

Example 46 with CalendarUserConfiguration

use of org.olat.commons.calendar.model.CalendarUserConfiguration in project openolat by klemens.

the class HomeCalendarManager method appendPersonalCalendar.

private void appendPersonalCalendar(Identity identity, List<KalendarRenderWrapper> calendars, Map<CalendarKey, CalendarUserConfiguration> configMap) {
    // get the personal calendar
    if (calendarModule.isEnablePersonalCalendar()) {
        try {
            KalendarRenderWrapper calendarWrapper = calendarManager.getPersonalCalendar(identity);
            calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_WRITE);
            calendarWrapper.setPrivateEventsVisible(true);
            CalendarUserConfiguration config = configMap.get(calendarWrapper.getCalendarKey());
            if (config != null) {
                calendarWrapper.setConfiguration(config);
            }
            calendars.add(calendarWrapper);
        } catch (Exception e) {
            log.error("Cannot read personal calendar of: " + identity, e);
        }
    }
}
Also used : CalendarUserConfiguration(org.olat.commons.calendar.model.CalendarUserConfiguration) KalendarRenderWrapper(org.olat.commons.calendar.ui.components.KalendarRenderWrapper) CorruptedCourseException(org.olat.course.CorruptedCourseException)

Aggregations

CalendarUserConfiguration (org.olat.commons.calendar.model.CalendarUserConfiguration)46 KalendarRenderWrapper (org.olat.commons.calendar.ui.components.KalendarRenderWrapper)24 Kalendar (org.olat.commons.calendar.model.Kalendar)12 Identity (org.olat.core.id.Identity)12 ArrayList (java.util.ArrayList)10 BusinessGroup (org.olat.group.BusinessGroup)10 CalendarKey (org.olat.commons.calendar.model.CalendarKey)8 Test (org.junit.Test)6 CalendarManager (org.olat.commons.calendar.CalendarManager)6 CorruptedCourseException (org.olat.course.CorruptedCourseException)6 ICourse (org.olat.course.ICourse)6 IOException (java.io.IOException)4 HashSet (java.util.HashSet)4 CollaborationTools (org.olat.collaboration.CollaborationTools)4 CollaborationToolsFactory (org.olat.collaboration.CollaborationToolsFactory)4 Roles (org.olat.core.id.Roles)4 CourseGroupManager (org.olat.course.groupsandrights.CourseGroupManager)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 File (java.io.File)2 URISyntaxException (java.net.URISyntaxException)2