Beispiel #1
0
 @Path("/deleteformbyid")
 @POST
 @Consumes(MediaType.APPLICATION_JSON)
 public Response deleteForm(
     @QueryParam("token") String token, @QueryParam("formid") String formID) {
   try {
     Utils.verify(token, 1);
   } catch (Exception ex) {
     return Response.status(401).entity(ex.getMessage()).build();
   }
   try {
     comp.nuhs.jaxb.Model.Form form = new comp.nuhs.jaxb.Model.Form();
     form.setFormID(formID);
     form.deleteForm();
     return Response.status(201).entity("").build();
   } catch (Exception ex) {
     return Response.status(400).entity(ex.getMessage()).build();
   }
 }
Beispiel #2
0
 @Path("/getformbyid")
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public Response getForm(@QueryParam("token") String token, @QueryParam("formid") String formID) {
   try {
     String a = formID;
     a.equals("");
     Utils.verify(token, 2);
   } catch (Exception ex) {
     return Response.status(401).entity(ex.getMessage()).build();
   }
   comp.nuhs.jaxb.Model.Form form = new comp.nuhs.jaxb.Model.Form();
   try {
     form.setFormID(formID);
     form = form.getForm();
     return Response.status(201).entity(form).build();
   } catch (Exception ex) {
     return Response.status(400).entity(ex.getMessage()).build();
   }
 }