01: package org.claros.intouch.calendar.services;
02:
03: import java.io.IOException;
04: import java.io.PrintWriter;
05:
06: import javax.servlet.ServletException;
07: import javax.servlet.http.HttpServletRequest;
08: import javax.servlet.http.HttpServletResponse;
09:
10: import org.claros.intouch.calendar.controllers.CalendarDBController;
11: import org.claros.intouch.common.services.BaseService;
12:
13: public class DeleteEventService extends BaseService {
14:
15: /**
16: *
17: */
18: private static final long serialVersionUID = -418607119306582907L;
19:
20: /**
21: * The doPost method of the servlet. <br>
22: *
23: * This method is called when a form has its tag value method equals to post.
24: *
25: * @param request the request send by the client to the server
26: * @param response the response send by the server to the client
27: * @throws ServletException if an error occurred
28: * @throws IOException if an error occurred
29: */
30: public void doPost(HttpServletRequest request,
31: HttpServletResponse response) throws ServletException,
32: IOException {
33: response.setHeader("Expires", "-1");
34: response.setHeader("Pragma", "no-cache");
35: response.setHeader("Cache-control", "no-cache");
36: response.setHeader("Content-Type", "text/html; charset=utf-8");
37: PrintWriter out = response.getWriter();
38:
39: try {
40: String sEventId = request.getParameter("id");
41: CalendarDBController.deleteEvent(getAuthProfile(request),
42: new Long(sEventId));
43: out.print("ok");
44: } catch (Exception e) {
45: out.print("fail");
46: }
47: }
48: }
|