@@ -43,7 +44,7 @@
[Config]
<% } %>
[Analysis]
- [Schema Browser]
+ [Schema Browser] <%if(replicationhandler != null ){%>[Replication]<%}%>
[Statistics]
[Info]
diff --git a/src/webapp/web/admin/replication/header.jsp b/src/webapp/web/admin/replication/header.jsp
new file mode 100644
index 00000000000..16751171684
--- /dev/null
+++ b/src/webapp/web/admin/replication/header.jsp
@@ -0,0 +1,81 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
+<%--
+ 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.
+--%>
+
+<%@ page import="org.apache.solr.common.util.NamedList,
+ org.apache.solr.common.util.SimpleOrderedMap,
+ org.apache.solr.request.LocalSolrQueryRequest,
+ org.apache.solr.request.SolrQueryResponse,
+ org.apache.solr.request.SolrRequestHandler"%>
+
+
+
+
+<%
+request.setCharacterEncoding("UTF-8");
+%>
+
+<%@include file="../_info.jsp" %>
+
+
+
+
+
+
+
+Solr replication admin page
+
+
+<%!
+public NamedList executeCommand(String command, SolrCore core, SolrRequestHandler rh){
+ NamedList namedlist = new SimpleOrderedMap();
+ namedlist.add("command", command);
+ LocalSolrQueryRequest solrqreq = new LocalSolrQueryRequest(core, namedlist);
+ SolrQueryResponse rsp = new SolrQueryResponse();
+ core.execute(rh, solrqreq, rsp);
+ namedlist = rsp.getValues();
+ return namedlist;
+}
+%>
+
+<%
+
+final SolrRequestHandler rh = core.getRequestHandler("/replication");
+NamedList namedlist = executeCommand("details",core,rh);
+NamedList detailsMap = (NamedList)namedlist.get("details");
+
+if("false".equals((String)detailsMap.get("isMaster"))){
+%>
+
+<%}%>
+
+
+
+
+
+
+
+<%= hostname %>:<%= port %>
+cwd=<%= cwd %> SolrHome=<%= solrHome %>
diff --git a/src/webapp/web/admin/replication/index.jsp b/src/webapp/web/admin/replication/index.jsp
new file mode 100644
index 00000000000..a2e025c5a92
--- /dev/null
+++ b/src/webapp/web/admin/replication/index.jsp
@@ -0,0 +1,379 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %>
+<%--
+ 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.
+--%>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.Date" %>
+
+
+<%-- do a verbatim include so we can use the local vars --%>
+<%@include file="header.jsp"
+ %>
+
+
+
+
+<%
+
+ final SolrCore solrcore = core;
+
+%>
+<%
+ if ("false".equals(detailsMap.get("isMaster")))
+ if (detailsMap != null) {%>
+
+
+<%}%>
+
+<%-- List the cores (that arent this one) so we can switch --%>
+<% org.apache.solr.core.CoreContainer cores = (org.apache.solr.core.CoreContainer) request.getAttribute("org.apache.solr.CoreContainer");
+ if (cores != null) {
+ Collection names = cores.getCoreNames();
+ if (names.size() > 1) {%>
+
+
Cores:
+
<%
+ for (String name : names) {
+ %>[<%=name%>
+ ]<%
+ }%>
+
+<%
+ }
+ }%>
+
+
+
+
+
+
+
+
+
+
+
+
+ Current Time: <%= new Date() %>
+
+
+
+
+
+
+ Server Start At: <%= new Date(core.getStartTime()) %>
+