01: package org.claros.intouch.notes.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.common.services.BaseService;
11: import org.claros.intouch.notes.controllers.NotesFolderController;
12:
13: public class DeleteNotebookService extends BaseService {
14:
15: /**
16: *
17: */
18: private static final long serialVersionUID = -202208543639254229L;
19:
20: /**
21: * @param request
22: * the request send by the client to the server
23: * @param response
24: * the response send by the server to the client
25: * @throws ServletException
26: * if an error occurred
27: * @throws IOException
28: * if an error occurred
29: */
30: public void doPost(HttpServletRequest request,
31: HttpServletResponse response) throws ServletException,
32: IOException {
33:
34: response.setHeader("Expires", "-1");
35: response.setHeader("Pragma", "no-cache");
36: response.setHeader("Cache-control", "no-cache");
37: response.setHeader("Content-Type", "text/html; charset=utf-8");
38: PrintWriter out = response.getWriter();
39:
40: try {
41: String sId = request.getParameter("id");
42: NotesFolderController.deleteFolder(getAuthProfile(request),
43: new Long(sId));
44: out.print("ok");
45: } catch (Exception e) {
46: e.printStackTrace();
47: out.print("fail");
48: }
49:
50: }
51:
52: }
|