0
|
1 package nabble.view.web.forum;
|
|
2
|
|
3 import nabble.model.Node;
|
|
4 import nabble.model.Site;
|
|
5 import nabble.view.lib.Jtp;
|
|
6
|
|
7 import javax.servlet.ServletException;
|
|
8 import javax.servlet.http.HttpServlet;
|
|
9 import javax.servlet.http.HttpServletRequest;
|
|
10 import javax.servlet.http.HttpServletResponse;
|
|
11 import java.io.IOException;
|
|
12
|
|
13 public class ClearDeleteDate extends HttpServlet {
|
|
14
|
|
15 protected void service(HttpServletRequest request, HttpServletResponse response)
|
|
16 throws ServletException, IOException
|
|
17 {
|
|
18 Site site = Jtp.getSite(request);
|
|
19 if (site == null) {
|
|
20 response.sendError(HttpServletResponse.SC_GONE, "This node has been deleted.");
|
|
21 return;
|
|
22 }
|
|
23 site.clearDeleteDate();
|
|
24 Node node = site.getRootNode();
|
|
25 String what = node.getKind().equals(Node.Kind.POST)? "topic" : Jtp.viewName(node).toLowerCase();
|
|
26 StringBuilder msg = new StringBuilder();
|
|
27 msg.append("<div class=\"big-title second-font\">Success!</div>");
|
|
28 msg.append("This ").append(what).append(" is not scheduled for deletion anymore.");
|
|
29
|
|
30 response.setHeader("Content-Type","application/x-javascript");
|
|
31 response.getWriter().print("Nabble.get('inactive-delete').innerHTML ='" + msg.toString() + "';");
|
|
32 }
|
|
33
|
|
34 }
|