@Path("updateCagePosition/{userName}/{encryptedPW}/{data}") @POST public String updateCagePosition( @PathParam("userName") String userName, @PathParam("encryptedPW") String encryptedPW, @PathParam("data") String data) { if (this.autheticateRequest(encryptedPW)) { JSONParser parser = new JSONParser(); try { JSONArray arr = (JSONArray) parser.parse(data); JSONObject returnObject = new JSONObject(); String status = "success"; for (Object obj : arr) { if (vlmDAO.updateCageContainerHistory((JSONObject) obj).equals("error")) { status = "error"; } } returnObject.put("status", status); return returnObject.toJSONString(); } catch (Exception e) { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", e); return returnObject.toJSONString(); } } else { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", "You do not have permission to access this."); return returnObject.toJSONString(); } }
@Path("generateLevelTreeData/{userName}/{encryptedPW}") @POST public String generateLevelTreeData( @PathParam("userName") String userName, @PathParam("encryptedPW") String encryptedPW) { if (this.autheticateRequest(encryptedPW)) { return vlmDAO.generateVivariaLayoutTreeData().toJSONString(); } else { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", "You do not have permission to access this."); return returnObject.toJSONString(); } }
@Path("getMiceInCage/{userName}/{encryptedPW}/{containerID}") @GET public String getMiceInCage( @PathParam("userName") String userName, @PathParam("encryptedPW") String encryptedPW, @PathParam("containerID") String containerID) { if (this.autheticateRequest(encryptedPW)) { return vlmDAO.getMiceInCage(containerID, userName).toJSONString(); } else { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", "You do not have permission to access this."); return returnObject.toJSONString(); } }
@Path("getRackDetails/{userName}/{encryptedPW}/{levelKey}") @POST public String getRackDetails( @PathParam("userName") String userName, @PathParam("encryptedPW") String encryptedPW, @PathParam("levelKey") Integer levelKey) { if (this.autheticateRequest(encryptedPW)) { return vlmDAO.generateVivariaLayoutDetails(levelKey.toString(), userName).toJSONString(); } else { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", "You do not have permission to access this."); return returnObject.toJSONString(); } }
@Path("retireCage/{userName}/{encryptedPW}/{data}") @POST public String retireCage( @PathParam("userName") String userName, @PathParam("encryptedPW") String encryptedPW, @PathParam("data") String data) { if (this.autheticateRequest(encryptedPW)) { JSONParser parser = new JSONParser(); try { JSONObject obj = (JSONObject) parser.parse(data); return vlmDAO.retireCage(obj).toJSONString(); } catch (Exception e) { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", e); return returnObject.toJSONString(); } } else { JSONObject returnObject = new JSONObject(); returnObject.put("status", "error"); returnObject.put("error", "You do not have permission to access this."); return returnObject.toJSONString(); } }