Search in sources :

Example 1 with CalendarRowSet

use of de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarRowSet in project TumCampusApp by TCA-Team.

the class CacheManager method syncCalendar.

public void syncCalendar() {
    TUMOnlineRequest<CalendarRowSet> requestHandler = new TUMOnlineRequest<>(TUMOnlineConst.Companion.getCALENDER(), mContext);
    requestHandler.setParameter("pMonateVor", "2");
    requestHandler.setParameter("pMonateNach", "3");
    if (shouldRefresh(requestHandler.getRequestURL())) {
        Optional<CalendarRowSet> set = requestHandler.fetch();
        if (set.isPresent()) {
            CalendarController calendarController = new CalendarController(mContext);
            calendarController.importCalendar(set.get());
            CalendarController.QueryLocationsService.loadGeo(mContext);
        }
    }
}
Also used : TUMOnlineRequest(de.tum.in.tumcampusapp.api.tumonline.TUMOnlineRequest) CalendarController(de.tum.in.tumcampusapp.component.tumui.calendar.CalendarController) CalendarRowSet(de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarRowSet)

Aggregations

TUMOnlineRequest (de.tum.in.tumcampusapp.api.tumonline.TUMOnlineRequest)1 CalendarController (de.tum.in.tumcampusapp.component.tumui.calendar.CalendarController)1 CalendarRowSet (de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarRowSet)1