2006-07-19 14:48:16 -04:00
|
|
|
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
|
2006-11-09 18:13:58 -05:00
|
|
|
<%--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
--%>
|
2008-07-15 17:30:37 -04:00
|
|
|
<%@ page import="org.apache.solr.common.util.XML"%>
|
2006-01-26 00:37:29 -05:00
|
|
|
<%@ page import="org.apache.solr.core.SolrCore,
|
|
|
|
org.apache.solr.schema.IndexSchema,
|
|
|
|
java.io.File,
|
|
|
|
java.net.InetAddress,
|
|
|
|
java.net.UnknownHostException"%>
|
|
|
|
<%@ page import="java.util.Date"%>
|
2006-05-02 13:44:15 -04:00
|
|
|
<%@include file="header.jsp" %>
|
2006-01-26 00:37:29 -05:00
|
|
|
<%
|
|
|
|
|
|
|
|
String action = request.getParameter("action");
|
|
|
|
String enableActionStatus = "";
|
|
|
|
boolean isValid = false;
|
|
|
|
|
|
|
|
if (action != null) {
|
|
|
|
// Validate fname
|
|
|
|
if ("Enable".compareTo(action) == 0) isValid = true;
|
|
|
|
if ("Disable".compareTo(action) == 0) isValid = true;
|
|
|
|
}
|
|
|
|
if (isValid) {
|
|
|
|
if ("Enable".compareTo(action) == 0) {
|
|
|
|
try {
|
2006-05-05 22:12:13 -04:00
|
|
|
File enableFile = new File(enabledFile);
|
2006-01-26 00:37:29 -05:00
|
|
|
if (enableFile.createNewFile()) {
|
2006-05-02 13:44:15 -04:00
|
|
|
enableActionStatus += "Enable Succeeded (enable file ";
|
|
|
|
enableActionStatus += enabledFile;
|
|
|
|
enableActionStatus += " created)";
|
2006-01-26 00:37:29 -05:00
|
|
|
} else {
|
|
|
|
enableActionStatus += "Already Enabled";
|
|
|
|
}
|
|
|
|
} catch(Exception e) {
|
|
|
|
enableActionStatus += "Enable Failed: " + e.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ("Disable".compareTo(action) == 0) {
|
|
|
|
try {
|
2006-05-05 22:12:13 -04:00
|
|
|
File enableFile = new File(enabledFile);
|
2006-01-26 00:37:29 -05:00
|
|
|
if (enableFile.delete()) {
|
2006-05-02 13:44:15 -04:00
|
|
|
enableActionStatus = "Disable Succeeded (enable file ";
|
|
|
|
enableActionStatus += enabledFile;
|
|
|
|
enableActionStatus += " removed)";
|
2006-01-26 00:37:29 -05:00
|
|
|
} else {
|
|
|
|
enableActionStatus = "Already Disabled";
|
|
|
|
}
|
|
|
|
} catch(Exception e) {
|
|
|
|
enableActionStatus += "Disable Failed: " + e.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
enableActionStatus = "Illegal Action";
|
|
|
|
}
|
2006-05-05 22:12:13 -04:00
|
|
|
// :TODO: might want to rework this so any logging change happens *after*
|
2009-07-09 15:23:59 -04:00
|
|
|
SolrCore.log.info(enableActionStatus);
|
2006-01-26 00:37:29 -05:00
|
|
|
%>
|
|
|
|
<br clear="all">
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<H3>Action:</H3>
|
|
|
|
</td>
|
|
|
|
<td>
|
2006-12-16 03:38:09 -05:00
|
|
|
<% XML.escapeCharData(action, out); %><br>
|
2006-01-26 00:37:29 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<H4>Result:</H4>
|
|
|
|
</td>
|
|
|
|
<td>
|
2006-12-16 03:38:09 -05:00
|
|
|
<% XML.escapeCharData(enableActionStatus, out); %><br>
|
2006-01-26 00:37:29 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br><br>
|
2007-12-21 17:23:39 -05:00
|
|
|
<a href=".">Return to Admin Page</a>
|
2006-01-26 00:37:29 -05:00
|
|
|
</body>
|
|
|
|
</html>
|