/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/LocateStations.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 588 by torben, Mon Feb 8 19:12:15 2010 UTC revision 858 by torben, Wed Jun 16 08:11:33 2010 UTC
# Line 41  public class LocateStations extends Http Line 41  public class LocateStations extends Http
41          protected List<StationBean> getStations(HttpServletRequest req) throws SQLException {          protected List<StationBean> getStations(HttpServletRequest req) throws SQLException {
42                  List<StationBean> stations = null;                  List<StationBean> stations = null;
43                  if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) {                  if (req.getParameter("latitude") != null && req.getParameter("latitude") != null) {
44                            
45                            Statistics.getInstance().incrementStationLookupsLocation();
46                            
47                          double latitude = Double.parseDouble( req.getParameter("latitude") );                          double latitude = Double.parseDouble( req.getParameter("latitude") );
48                          double longitude = Double.parseDouble( req.getParameter("longitude") );                          double longitude = Double.parseDouble( req.getParameter("longitude") );
49                          stations = stationDao.getByLocation(latitude, longitude);                          stations = stationDao.getByLocation(latitude, longitude);
50    
51                  } else if (req.getParameter("name") != null) {                  } else if (req.getParameter("name") != null) {
52                            Statistics.getInstance().incrementStationLookupsName();
53                          String name = req.getParameter("name").trim();                          String name = req.getParameter("name").trim();
54                          stations = stationDao.getByName(name);                          stations = stationDao.getByName(name);
55    
56                  } else if (req.getParameter("list") != null) {                  } else if (req.getParameter("list") != null) {
57                            Statistics.getInstance().incrementStationLookupsFavorites();
58                          String list = transformToIntList( req.getParameter("list"));                          String list = transformToIntList( req.getParameter("list"));
59                          stations = stationDao.getByList(list);                          stations = stationDao.getByList(list);
60                  }                  }
# Line 61  public class LocateStations extends Http Line 66  public class LocateStations extends Http
66    
67                  StringBuffer buff = new StringBuffer();                  StringBuffer buff = new StringBuffer();
68    
69                  buff.append("<?xml version=\"1.0\" ?>\n");                  buff.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
70                  buff.append("<stations>\n");                      buff.append("<stations>\n");    
71    
72    

Legend:
Removed from v.588  
changed lines
  Added in v.858

  ViewVC Help
Powered by ViewVC 1.1.20