for (TripProblemReportBean report : reports) {
StopBean stop = report.getStop();
TripBean trip = report.getTrip();
SyndEntry entry = new SyndEntryImpl();
StringBuilder entryTitle = new StringBuilder();
if (trip == null) {
entryTitle.append("trip_id=");
entryTitle.append(report.getTripId());
entryTitle.append(" (?)");
} else {
entryTitle.append(RoutePresenter.getNameForRoute(trip));
entryTitle.append(" - ");
entryTitle.append(trip.getTripHeadsign());
}
if (stop == null) {
entryTitle.append(" - stop_id=");
entryTitle.append(report.getStopId());
entryTitle.append(" (?)");
} else {
entryTitle.append(" - ");
entryTitle.append(getText("StopNum", new String[] {stop.getCode()}));
entryTitle.append(" - ");
entryTitle.append(stop.getName());
if (stop.getDirection() != null) {
entryTitle.append(" - ");
entryTitle.append(getText("bound", new String[] {stop.getDirection()}));
}
}
StringBuilder entryUrl = new StringBuilder();
entryUrl.append(baseUrl);
entryUrl.append("/admin/problems/trip-problem-report.action?tripId=");
entryUrl.append(report.getTripId());
entryUrl.append("&id=");
entryUrl.append(report.getId());
StringBuilder entryDesc = new StringBuilder();
entryDesc.append(getText("Data"));
entryDesc.append(": ");
entryDesc.append(report.getData());
entryDesc.append("<br/>");
if (report.getUserComment() != null) {
entryDesc.append(getText("Comment"));
entryDesc.append(": ");
entryDesc.append(report.getUserComment());
entryDesc.append("<br/>");
}
if (report.getStatus() != null) {
entryDesc.append(getText("Status"));
entryDesc.append(": ");
entryDesc.append(report.getStatus());
entryDesc.append("<br/>");
}
entry = new SyndEntryImpl();
entry.setTitle(entryTitle.toString());
entry.setLink(entryUrl.toString());
entry.setPublishedDate(new Date(report.getTime()));
SyndContent description = new SyndContentImpl();
description.setType("text/html");
description.setValue(entryDesc.toString());
entry.setDescription(description);
entries.add(entry);
}
return SUCCESS;
}