0
|
1
|
|
2 package nabble.view.web.tools;
|
|
3
|
|
4 import java.io.IOException;
|
|
5 import java.io.PrintWriter;
|
|
6 import javax.servlet.ServletException;
|
|
7 import javax.servlet.http.HttpServlet;
|
|
8 import javax.servlet.http.HttpServletRequest;
|
|
9 import javax.servlet.http.HttpServletResponse;
|
|
10 import nabble.model.MailingList;
|
|
11 import nabble.model.ModelHome;
|
|
12 import nabble.model.Node;
|
|
13 import nabble.view.lib.Jtp;
|
|
14 import nabble.view.lib.Shared;
|
|
15
|
|
16
|
|
17 public final class UploadMbox extends HttpServlet {
|
|
18
|
|
19 protected void service(HttpServletRequest request,HttpServletResponse response)
|
|
20 throws ServletException, IOException
|
|
21 {
|
|
22 PrintWriter out = response.getWriter();
|
|
23 Node forum = Jtp.getSiteNotNull(request).getNode(Long.parseLong(request.getParameter("forum")));
|
|
24 MailingList mailingList = forum.getMailingList();
|
|
25 String listName = (mailingList == null) ? null : mailingList.getListName();
|
|
26 boolean hasListNameSet = listName != null && !"".equals(listName);
|
|
27
|
|
28 out.print( "\r\n<html>\r\n<head>\r\n" );
|
|
29
|
|
30 Shared.title(request,response,"upload mbox file");
|
|
31
|
|
32 out.print( "\r\n</head>\r\n<body onload='document.theForm.image.focus();'>\r\n<h2>upload mbox file to " );
|
|
33 out.print( (forum.getSubjectHtml()) );
|
|
34 out.print( "</h2>\r\n<p>\r\n<form name=\"theForm\" action=\"UploadMbox2.jtp\" method=\"POST\" enctype=\"multipart/form-data\">\r\n<input type=\"hidden\" name=\"forum\" value=\"" );
|
|
35 out.print( (forum.getId()) );
|
|
36 out.print( "\" />\r\n " );
|
|
37
|
|
38 if(!hasListNameSet) {
|
|
39
|
|
40 out.print( "\r\n <font color=\"red\">\r\n <h3>Mailing list archive does not have ListName set yet!</h3>\r\n </font>\r\n " );
|
|
41
|
|
42 }
|
|
43
|
|
44 out.print( "\r\n<p>\r\nMbox File to Upload:\r\n<input name=\"mbox\" type=\"file\" size=\"40\" />\r\n</p>\r\n<p>\r\nor download Mbox from url:\r\n<input name=\"mboxurl\" type=\"text\" size=\"100\" />\r\n</p>\r\n<p>\r\nor read from " );
|
|
45 out.print( (getInitParameter("exportDir")) );
|
|
46 out.print( "<input name=\"mboxfile\" type=\"text\" size=\"40\" />\r\n</p>\r\n<p>Mail errors to: <input name=\"mailErrorsTo\" size=\"30\" /></p>\r\n<p>Max errors: <input name=\"maxErrors\" value=\"10\" /></p>\r\n<p><input type=\"checkbox\" name=\"runRethread\" value=\"x\" /> rethread after import</p>\r\n<p><input type=\"submit\" value=\"upload mbox file\" /></p>\r\n</form>\r\n</p>\r\n</body>\r\n</html>\r\n" );
|
|
47
|
|
48 }
|
|
49 }
|
|
50
|