@Path(RestPaths.LIST)
@Produces(MediaType.APPLICATION_JSON)
public Response getReminderList(@QueryParam("calendarIds") final String calendarIds,
@QueryParam("modifiedSince") final Integer daysInFuture)
{
final DayHolder day = new DayHolder();
int days = daysInFuture != null ? daysInFuture : 30;
if (days <= 0 || days > 90) {
days = 90;
}
day.add(Calendar.DAY_OF_YEAR, days);
final Collection<Integer> cals = new LinkedList<Integer>();
if (StringUtils.isBlank(calendarIds) == true) {
final Collection<TeamCalDO> ownCals = TeamCalCache.getInstance().getAllOwnCalendars();
if (ownCals != null && ownCals.size() > 0) {
for (final TeamCalDO cal : ownCals) {
cals.add(cal.getId());
}
}
} else {
final Integer[] ids = StringHelper.splitToIntegers(calendarIds, ",;:");
if (ids != null && ids.length > 0) {
for (final Integer id : ids) {
if (id != null) {
cals.add(id);
}
}
}
}
final List<CalendarEventObject> result = new LinkedList<CalendarEventObject>();
if (cals.size() > 0) {
final Date now = new Date();
final TeamEventFilter filter = new TeamEventFilter().setStartDate(now).setEndDate(day.getDate()).setTeamCals(cals);
final List<TeamEvent> list = teamEventDao.getEventList(filter, true);
if (list != null && list.size() > 0) {
for (final TeamEvent event : list) {
if (event.getStartDate().after(now) == true) {
result.add(TeamEventDOConverter.getEventObject(event));