예제 #1
0
 @POST
 @Path("neededlist")
 @Produces(MediaType.TEXT_PLAIN)
 @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
 public String getNeededList(@FormParam("filter") String filter) {
   Gson gson = new Gson();
   NeededFilter neededFilter = gson.fromJson(filter, NeededFilter.class);
   DocumentDao dao = new DocumentDao();
   return gson.toJson(dao.getHeadRowsNeededList(neededFilter));
 }
예제 #2
0
 @POST
 @Path("neededdoc")
 @Produces(MediaType.TEXT_PLAIN)
 @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
 public String createNeededDoc(
     @Context HttpServletRequest request, @FormParam("needed") String needed) {
   Gson gson = new Gson();
   NeededObject neededFilter = gson.fromJson(needed, NeededObject.class);
   DocumentDao dao = new DocumentDao();
   User loggeduser = HibernateUtils.getUserFromSession(request);
   return gson.toJson(dao.createHeadRowsNeeded(neededFilter, loggeduser));
 }