final String[] teamCalIds = StringUtils.split(teamCals, ";");
if (teamCalIds == null) {
return null;
}
final List<VEvent> events = new LinkedList<VEvent>();
final TeamEventDao teamEventDao = Registry.instance().getDao(TeamEventDao.class);
final TeamEventFilter eventFilter = new TeamEventFilter();
eventFilter.setDeleted(false);
final DateTime now = DateTime.now();
final Date eventDateLimit = now.minusYears(1).toDate();
eventFilter.setStartDate(eventDateLimit);
final boolean exportReminders = "true".equals(params.get(PARAM_EXPORT_REMINDER)) == true;
for (int i = 0; i < teamCalIds.length; i++) {
final Integer id = Integer.valueOf(teamCalIds[i]);
eventFilter.setTeamCalId(id);
final List<TeamEvent> teamEvents = teamEventDao.getEventList(eventFilter, false);
if (teamEvents != null && teamEvents.size() > 0) {
for (final TeamEvent teamEventObject : teamEvents) {
if (teamEventObject instanceof TeamEventDO == false) {
log.warn("Oups, shouldn't occur, please contact the developer: teamEvent isn't of type TeamEventDO: " + teamEventObject);
continue;