Mercurial Hosting > nabble
view src/nabble/view/web/tools/UploadMbox.jtp @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
line wrap: on
line source
<% package nabble.view.web.tools; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import nabble.model.MailingList; import nabble.model.ModelHome; import nabble.model.Node; import nabble.view.lib.Jtp; import nabble.view.lib.Shared; public final class UploadMbox extends HttpServlet { protected void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); Node forum = Jtp.getSiteNotNull(request).getNode(Long.parseLong(request.getParameter("forum"))); MailingList mailingList = forum.getMailingList(); String listName = (mailingList == null) ? null : mailingList.getListName(); boolean hasListNameSet = listName != null && !"".equals(listName); %> <html> <head> <% Shared.title(request,response,"upload mbox file"); %> </head> <body onload='document.theForm.image.focus();'> <h2>upload mbox file to <%=forum.getSubjectHtml()%></h2> <p> <form name="theForm" action="UploadMbox2.jtp" method="POST" enctype="multipart/form-data"> <input type="hidden" name="forum" value="<%=forum.getId()%>" /> <% if(!hasListNameSet) { %> <font color="red"> <h3>Mailing list archive does not have ListName set yet!</h3> </font> <% } %> <p> Mbox File to Upload: <input name="mbox" type="file" size="40" /> </p> <p> or download Mbox from url: <input name="mboxurl" type="text" size="100" /> </p> <p> or read from <%=getInitParameter("exportDir")%><input name="mboxfile" type="text" size="40" /> </p> <p>Mail errors to: <input name="mailErrorsTo" size="30" /></p> <p>Max errors: <input name="maxErrors" value="10" /></p> <p><input type="checkbox" name="runRethread" value="x" /> rethread after import</p> <p><input type="submit" value="upload mbox file" /></p> </form> </p> </body> </html> <% } } %>