From 5f95c2d4f405faf0960034c6af09892b513b2042 Mon Sep 17 00:00:00 2001
From: Schankula Christopher <schankuc@mcmaster.ca>
Date: Mon, 2 Apr 2018 19:50:10 -0400
Subject: [PATCH] proper search for map.jsp

---
 tomcat/webapps/Trawl/map.jsp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tomcat/webapps/Trawl/map.jsp b/tomcat/webapps/Trawl/map.jsp
index ab0c63e..d71ef0f 100644
--- a/tomcat/webapps/Trawl/map.jsp
+++ b/tomcat/webapps/Trawl/map.jsp
@@ -6,11 +6,14 @@
 <%
 	// Sample result data containing an iterable of records
 		TrawlExpert te = (TrawlExpert)request.getServletContext().getAttribute("trawl");
-		BasicSearchResult result = te.rangeSearch(2, 1960, 2016);
-
-		
-		
 		JSONParser parser = new JSONParser();
+		JSONObject req = (JSONObject) parser.parse(request.getReader().readLine());
+		
+		Integer taxonId = (int) (long) req.get("taxId");
+		Integer yearLo = (int) (long) req.get("yearF");
+		Integer yearHi = (int) (long) req.get("yearT");
+
+		BasicSearchResult result = te.rangeSearch(taxonId, yearLo, yearHi);
 		
 		// Initialize JSON Object and Arrays
 		JSONObject js = new JSONObject();
@@ -30,7 +33,6 @@
 			dateobj.put("year",r.getDate().getYear());
 			dateobj.put("month",r.getDate().getMonth());
 			dateobj.put("day",r.getDate().getDay());
-			date.add(r.getDate());
 			count.add(r.getCount());
 		}
 	
-- 
GitLab