@Post @Path("/getErrorCategoriesForUser") public void getErrorCategoriesForUser(String username, String token) { LOG.debug("getErrorCategoriesForUser: "******" encrypted token: " + token); try { LOG.info("Will get rules for user."); Set<String> cat = this.errorEntryLogic.getErrorCategoriesForUser(username); StringBuilder sb = new StringBuilder(); Iterator<String> it = cat.iterator(); while (it.hasNext()) { sb.append(it.next() + "|"); } LOG.debug("Categories: " + sb); result.include("result", RestUtil.prepareResponse("categories", sb.toString())); } catch (Exception e) { LOG.error("Error getting categories", e); } }
/** * Submit an error report via OpenOffice plugin. Only CoGrOO users are allowed. * * @param username * @param token * @param error */ @Post @Path("/submitErrorReport") public void submitErrorEntry(String username, String token, String error) { error = securityUtil.decodeURLSafeString(error); LOG.debug( "Got new error report from: " + username + " encrypted token: " + token + " error: " + error); try { errorEntryLogic.addErrorEntry("cogroo", username, error); LOG.debug("Error handled, will set response"); result.include("result", RestUtil.prepareResponse("result", "OK")); } catch (CommunityException e) { LOG.error("Error handling error submition", e); } }