diff src/global/web/tools/Reindex.java @ 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/global/web/tools/Reindex.java	Thu Mar 21 19:15:52 2019 -0600
@@ -0,0 +1,31 @@
+
+package global.web.tools;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import global.Site;
+
+
+public final class Reindex extends HttpServlet {
+
+	protected void service(HttpServletRequest request,HttpServletResponse response)
+		throws IOException
+	{
+		if( request.getParameter("reindex") != null ) {
+			Site.startReindexing();
+			response.sendRedirect("Reindex.jtp");
+			return;
+		}
+		PrintWriter out = response.getWriter();
+		
+		out.print( "\r\n<html>\r\n	<head>\r\n		<title>Reindex</title>\r\n	</head>\r\n	<body>\r\n		<h1>Reindex</h1>\r\n		<p>Status: " );
+		out.print( (Site.status) );
+		out.print( " (reload page to update)</p>\r\n		<form action=\"Reindex.jtp\"><input type=\"submit\" name=\"reindex\" value=\"Reindex\"></form>\r\n	</body>\r\n</html>\r\n" );
+
+	}
+
+}
+