Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tmkasun/geo_dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
tmkasun committed Oct 23, 2014
2 parents 765e428 + 4af6ff2 commit b048938
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions controllers/get_alerts.jag
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%
var log = new Log();
var dataStore = require('../include/commons.jag').dataStore;
var verb = request.getMethod();
var resourceName = request.getParameter('name');
var webService = request.getParameter('service');

var log = new Log();

log.info(webService);
if(webService) {
response.contentType = 'application/json';
response.characterEncoding = 'UTF-8';
Expand Down Expand Up @@ -37,15 +37,26 @@
}
return allFences;
} else if(name == 'speed'){
var resource = dataStore.get(name+'.json');

var resource;
try{
resource = dataStore.get(name+'.json');
}catch(e){
resource = {'content': false};
}
log.info("DEBUG:***** name = "+name);
log.info("DEBUG:***** resource.content = "+resource.content);
return JSON.parse(resource.content);
} else if(name == 'proximity'){
var resource = dataStore.get("/geo/alerts/proximity/proximity.json");
return {proximityDistance: resource.getProperty("proximityDistance"), proximityTime: resource.getProperty("proximityTime")};


var result;
try{
var resource = dataStore.get("/geo/alerts/proximity/proximity.json");
result={proximityDistance: resource.getProperty("proximityDistance"), proximityTime: resource.getProperty("proximityTime")};
}catch(e){
result = {'content': false};
}
return result;
}
}

Expand Down

0 comments on commit b048938

Please sign in to comment.