public JSONObject downloadPlateInputForm(HttpSession session, JSONObject json) { if (json.has("documentFormat")) { String documentFormat = json.getString("documentFormat"); try { File f = misoFileManager.getNewFile( Plate.class, "forms", "PlateInputForm-" + LimsUtils.getCurrentDateAsString() + "." + documentFormat); FormUtils.createPlateInputSpreadsheet(f); return JSONUtils.SimpleJSONResponse("" + f.getName().hashCode()); } catch (Exception e) { e.printStackTrace(); return JSONUtils.SimpleJSONError("Failed to get plate input form: " + e.getMessage()); } } else { return JSONUtils.SimpleJSONError("Missing project ID or document format supplied."); } }