Search in sources :

Example 1 with StandardCalendarEventHandler

use of io.lavagna.service.calendarutils.StandardCalendarEventHandler in project lavagna by digitalfondue.

the class CalendarService method getUserCalendar.

public CalendarEvents getUserCalendar(UserWithPermission user) throws URISyntaxException, ParseException {
    final CalendarEvents events = new CalendarEvents(new HashMap<Date, CalendarEvents.MilestoneDayEvents>());
    final CalendarEventHandler handler = new StandardCalendarEventHandler(events);
    // Milestones
    addMilestoneEvents(handler, user);
    // Cards
    addCardEvents(handler, user);
    return events;
}
Also used : StandardCalendarEventHandler(io.lavagna.service.calendarutils.StandardCalendarEventHandler) CalendarEventHandler(io.lavagna.service.calendarutils.CalendarEventHandler) CalendarEvents(io.lavagna.service.calendarutils.CalendarEvents) StandardCalendarEventHandler(io.lavagna.service.calendarutils.StandardCalendarEventHandler)

Example 2 with StandardCalendarEventHandler

use of io.lavagna.service.calendarutils.StandardCalendarEventHandler in project lavagna by digitalfondue.

the class CalendarService method getProjectCalendar.

public CalendarEvents getProjectCalendar(String projectShortName, UserWithPermission user) throws URISyntaxException, ParseException {
    final CalendarEvents events = new CalendarEvents(new HashMap<Date, CalendarEvents.MilestoneDayEvents>());
    final CalendarEventHandler handler = new StandardCalendarEventHandler(events);
    Project project = projectService.findByShortName(projectShortName);
    // Milestones
    getMilestoneEventsFromProject(handler, user, project);
    // Cards
    SearchFilter locationFilter = filter(SearchFilter.FilterType.LOCATION, SearchFilter.ValueType.STRING, BoardColumn.BoardColumnLocation.BOARD.toString());
    for (CardFullWithCounts card : searchService.find(Arrays.asList(locationFilter), project.getId(), null, user).getFound()) {
        for (LabelAndValue lav : card.getLabelsWithType(LabelType.TIMESTAMP)) {
            handler.addCardEvent(card, lav);
        }
    }
    return events;
}
Also used : StandardCalendarEventHandler(io.lavagna.service.calendarutils.StandardCalendarEventHandler) CalendarEventHandler(io.lavagna.service.calendarutils.CalendarEventHandler) CalendarEvents(io.lavagna.service.calendarutils.CalendarEvents) StandardCalendarEventHandler(io.lavagna.service.calendarutils.StandardCalendarEventHandler)

Aggregations

CalendarEventHandler (io.lavagna.service.calendarutils.CalendarEventHandler)2 CalendarEvents (io.lavagna.service.calendarutils.CalendarEvents)2 StandardCalendarEventHandler (io.lavagna.service.calendarutils.StandardCalendarEventHandler)2