diff --git a/onebusaway-webapp/src/main/java/org/onebusaway/webapp/actions/admin/problems/TripProblemReportAction.java b/onebusaway-webapp/src/main/java/org/onebusaway/webapp/actions/admin/problems/TripProblemReportAction.java index cf9b89e75..62dfa3402 100644 --- a/onebusaway-webapp/src/main/java/org/onebusaway/webapp/actions/admin/problems/TripProblemReportAction.java +++ b/onebusaway-webapp/src/main/java/org/onebusaway/webapp/actions/admin/problems/TripProblemReportAction.java @@ -46,7 +46,7 @@ "parse", "true"}), @Result(type = "redirectAction", name = "update", params = { "actionName", "trip-problem-report", "tripId", "${model.tripId}", "id", - "${model.id}", "parse", "true"})}) + "${model.id}", "m", "1", "parse", "true"})}) public class TripProblemReportAction extends ActionSupport implements ModelDriven { @@ -64,6 +64,8 @@ public class TripProblemReportAction extends ActionSupport implements private List _labels; + private int _m = 0; + @Autowired public void setTransitDataService(TransitDataService transitDataService) { _transitDataService = transitDataService; @@ -81,6 +83,10 @@ public void setMinutesBefore(int minutesBefore) { public void setMinutesAfter(int minutesAfter) { _minutesAfter = minutesAfter; } + + public void setM(int m) { + _m = m; + } public List getVehicleLocationRecords() { return _vehicleLocationRecords; @@ -89,8 +95,11 @@ public List getVehicleLocationRecords() { @Validations(requiredFields = {@RequiredFieldValidator(fieldName = "model.id", message = "missing id")}, requiredStrings = {@RequiredStringValidator(fieldName = "model.tripId", message = "missing tripId")}) @Override public String execute() { + long t1 = System.currentTimeMillis(); _model = _transitDataService.getTripProblemReportForTripIdAndId( _model.getTripId(), _model.getId()); + long t2 = System.currentTimeMillis(); + System.out.println("getTripProblemReportForTripIdAndId=" + (t2-t1)); if (_model == null) return ERROR; @@ -109,15 +118,27 @@ public String execute() { query.setVehicleId(_model.getVehicleId()); query.setFromTime(timeFrom); query.setToTime(timeTo); + long t3 = System.currentTimeMillis(); ListBean records = _transitDataService.getVehicleLocationRecords(query); + long t4 = System.currentTimeMillis(); + System.out.println("getVehicleLocationRecords=" + (t4-t3)); _vehicleLocationRecords = records.getList(); } + long t5 = System.currentTimeMillis(); _labels = _transitDataService.getAllTripProblemReportLabels(); + long t6 = System.currentTimeMillis(); + System.out.println("getAllTripProblemReportLabels=" + (t6-t5)); // Deduplicate labels _labels = new ArrayList(new HashSet(_labels)); Collections.sort(_labels); + + switch(_m) { + case 1: + addActionMessage("Report Updated!"); + break; + } return SUCCESS; } diff --git a/onebusaway-webapp/src/main/webapp/WEB-INF/content/admin/problems/trip-problem-report.jspx b/onebusaway-webapp/src/main/webapp/WEB-INF/content/admin/problems/trip-problem-report.jspx index c3209cf55..b28a15daa 100644 --- a/onebusaway-webapp/src/main/webapp/WEB-INF/content/admin/problems/trip-problem-report.jspx +++ b/onebusaway-webapp/src/main/webapp/WEB-INF/content/admin/problems/trip-problem-report.jspx @@ -44,6 +44,8 @@

Trip Problem Report

+ +