// counter used to store row number in event
int i = 1;
for (ListEntry ssRow : ssEntryList) {
i++;
// CustomElementCollection represents elements in the gsx namespace
CustomElementCollection elements = ssRow.getCustomElements();
try {
Event e = new Event(
elements.getValue(fieldMap.getTitleColumn()),
elements.getValue(fieldMap.getDescriptionColumn()),
elements.getValue(fieldMap.getWebsiteColumn()),
elements.getValue(fieldMap.getStartColumn()),
elements.getValue(fieldMap.getEndColumn()),
elements.getValue(fieldMap.getCalendarUrlColumn()),
elements.getValue(fieldMap.getBaseUrlColumn()));
e.ssRow = i;
e.setSsEditUrl(ssRow.getEditLink().getHref());
eventList.add(e);
} catch (MalformedURLException urlEx) {
System.err.println("Could not read event titled '" +
elements.getValue(fieldMap.getTitleColumn()) +
"' due to a bad URL for the Calendar or Base URL");
}
}
return eventList;
}