Search in sources :

Example 6 with CalendarServiceProvider

use of fi.otavanopisto.muikku.calendar.CalendarServiceProvider in project muikku by otavanopisto.

the class CalendarController method deleteCalendar.

public void deleteCalendar(UserCalendar userCalendar) throws CalendarServiceException {
    CalendarServiceProvider provider = getCalendarServiceProvider(userCalendar.getCalendarProvider());
    Calendar calendar = provider.findCalendar(userCalendar.getCalendarId());
    if (calendar == null) {
        throw new CalendarServiceException("Could not find calendar for user calendar #" + userCalendar.getId());
    }
    provider.deleteCalendar(calendar);
}
Also used : CalendarServiceException(fi.otavanopisto.muikku.calendar.CalendarServiceException) CalendarServiceProvider(fi.otavanopisto.muikku.calendar.CalendarServiceProvider) Calendar(fi.otavanopisto.muikku.calendar.Calendar) UserCalendar(fi.otavanopisto.muikku.plugins.calendar.model.UserCalendar)

Aggregations

Calendar (fi.otavanopisto.muikku.calendar.Calendar)6 CalendarServiceException (fi.otavanopisto.muikku.calendar.CalendarServiceException)6 CalendarServiceProvider (fi.otavanopisto.muikku.calendar.CalendarServiceProvider)6 UserCalendar (fi.otavanopisto.muikku.plugins.calendar.model.UserCalendar)6 DefaultCalendarEventTemporalField (fi.otavanopisto.muikku.calendar.DefaultCalendarEventTemporalField)1