Beispiel #1
0
 @GET
 @Path("/actors/delete")
 @Produces(MediaType.TEXT_PLAIN)
 public String getActorsToDelete() throws UnknownHostException {
   ArrayList<BasicDBObject> albdbo = ActorsDAO.findActors(100);
   return albdbo.toString();
 }
Beispiel #2
0
  @GET
  @Path("/actors")
  @Produces(MediaType.TEXT_PLAIN)
  public String getAllActors() {

    ArrayList<BasicDBObject> albdbo = ActorsDAO.findActors(100);
    return albdbo.toString();
  }
Beispiel #3
0
 @POST
 @Path("/actors/edit/updateActor")
 @Produces(MediaType.TEXT_PLAIN)
 public String updateActor(String msg) {
   ArrayList<BasicDBObject> albdbo;
   String[] parts = msg.split("&");
   String[] part1 = parts[0].split("=");
   String[] part2 = parts[1].split("=");
   String[] part3 = parts[2].split("=");
   String id = part1[1].replaceAll("\\+", " ");
   String name = part2[1].replaceAll("\\+", " ");
   String description = part3[1].replaceAll("\\+", ".");
   int id1 = Integer.parseInt(id);
   try {
     ActorsDAO.updateActor(id1, name, description);
   } catch (UnknownHostException e) {
     e.printStackTrace();
   } catch (ParseException e) {
     e.printStackTrace();
   }
   albdbo = ActorsDAO.findActors(100);
   return albdbo.toString();
 }