public @ResponseBody Map<String,String> handleExportRequest(HttpServletRequest request)
throws ServletException, IOException {
//given a list of ogpids, export them to geocommons
//read the POST'ed JSON object
ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(request.getInputStream());
String basemap = rootNode.path("basemap").getTextValue();
String bbox = rootNode.path("extent").getTextValue();
String username = rootNode.path("username").getTextValue();
String password = rootNode.path("password").getTextValue();
ObjectNode responseJson = mapper.createObjectNode();
//response json format
//{"status": "", "message": "", mapUrl: "", "layers": []}
//status where in the process
//statusMessage text
//mapUrl:
//layers
//layerId:
//progress: dataset, map
//format: shp, wms, etc.
//url:
/*if ((username.isEmpty())||(password.isEmpty())){
response.sendError(500, "This request requires a valid GeoCommons username and password.");
return;
}*/
String title = rootNode.path("title").getTextValue();
String description = rootNode.path("description").getTextValue();
JsonNode idArray = rootNode.path("OGPIDS");
ArrayList<String> layers = new ArrayList<String>();
for (JsonNode idNode : idArray){
layers.add(idNode.getTextValue());
}
/*if (layers.isEmpty()) {