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;
}
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;
}
Aggregations