Author: ehatcher
Date: Fri Jun 19 14:10:26 2009
New Revision: 786516
URL: http://svn.apache.org/viewvc?rev=786516&view=rev
Log:
SOLR-1230: Enhance data import developer console to work with all
DataImportHandler request handlers
Modified:
lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp
lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/debug.jsp
Modified: lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt?rev=786516&r1=786515&r2=786516&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt Fri Jun 19 14:10:26
2009
@@ -142,7 +142,11 @@
32.SOLR-1092: Added a new command named 'import' which does not automatically
clean the index. This is useful and
more appropriate when one needs to import only some of the
entities.
(Noble Paul via shalin)
-33.SOLR-11153: 'deltaImportQuery' is honored on child entities as well (noble)
+
+33.SOLR-1153: 'deltaImportQuery' is honored on child entities as well (noble)
+
+34.SOLR-1230: Enhanced dataimport.jsp to work with all DataImportHandler
request handler configurations,
+ rather than just a hardcoded /dataimport handler. (ehatcher)
Optimizations
----------------------
Modified:
lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp?rev=786516&r1=786515&r2=786516&view=diff
==============================================================================
---
lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp
(original)
+++
lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp
Fri Jun 19 14:10:26 2009
@@ -1,3 +1,6 @@
+<%@ page import="org.apache.solr.request.SolrRequestHandler" %>
+<%@ page import="java.util.Map" %>
+<%@ page import="org.apache.solr.handler.dataimport.DataImportHandler" %>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%--
Licensed to the Apache Software Foundation (ASF) under one or more
@@ -16,9 +19,36 @@
limitations under the License.
--%>
<%-- do a verbatim include so we can use the local vars --%>
+<%...@include file="_info.jsp"%>
<html>
+<%
+ String handler = request.getParameter("handler");
+
+ if (handler == null) {
+ Map<String, SolrRequestHandler> handlers = core.getRequestHandlers();
+%>
+<head>
+ <title>DataImportHandler Interactive Development</title>
+ <link rel="stylesheet" type="text/css" href="solr-admin.css">
+</head>
+<body>
+Select handler:
+<ul>
+<%
+ for (String key : handlers.keySet()) {
+ if (handlers.get(key) instanceof DataImportHandler) { %>
+ <li><a href="dataimport.jsp?handler=<%=key%>"><%=key%></a></li>
+<%
+ }
+ }
+%>
+</ul>
+</body>
+<% } else { %>
+
<frameset cols = "50%, 50%">
- <frame src ="debug.jsp" />
- <frame src ="../dataimport?command=full-import&debug=on&verbose=true"
name="result"/>
+ <frame src ="debug.jsp?handler=<%=handler%>" />
+ <frame src ="../select?qt=<%=handler%>&command=status" name="result"/>
</frameset>
+<% } %>
</html>
Modified:
lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/debug.jsp
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/debug.jsp?rev=786516&r1=786515&r2=786516&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/debug.jsp
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/webapp/admin/debug.jsp
Fri Jun 19 14:10:26 2009
@@ -27,10 +27,17 @@
</head>
<body>
<h1>DataImportHandler Development Console</h1>
-<br />
-<form action="../dataimport" target="result" method="post">
-<input type="hidden" name="debug" value="on">
+<%
+ String handler = request.getParameter("handler"); // must be specified
+%>
+<form action="../select" target="result" method="get">
+<input type="hidden" name="debug" value="on"/>
+<input type="hidden" name="qt" value="<%=handler%>"/>
<table>
+ <tr>
+ <th>Handler: </th>
+ <td><%=handler%> <a href="dataimport.jsp" target="_top">change
handler</a></td>
+ </tr>
<tr>
<td colspan="2">
<table width="100%">
@@ -49,7 +56,7 @@
name="clean" type="checkbox"></td>
<td><strong>Start Row</strong> <input
name="start" size="4" type="text"
value="0"></td>
- <td><strong>No:of Rows</strong> <input
name="rows"
+ <td><strong>No. of Rows</strong> <input
name="rows"
type="text" size="4" value="10"></td>
</tr>
</table>
@@ -61,17 +68,18 @@
</tr>
<tr>
<td colspan="2"><textarea id="txtDataConfig" rows="30"
cols="80" name="dataConfig"></textarea></td>
- <script type="text/javascript" language="Javascript">
- $.get('../dataimport?command=show-config',
function(data){
- $('#txtDataConfig').attr('value', data);
- });
- </script>
+ <script type="text/javascript" language="javascript">
+ $.get("../select?qt=<%=handler%>&command=show-config", function(data){
+ $('#txtDataConfig').attr('value', data);
+ });
+ </script>
</tr>
</table>
</form>
-<form action="../dataimport" target="result" method="get">
+<form action="../select" target="result" method="get">
<input type="hidden" name="clean" value="false">
<input type="hidden" name="commit" value="true">
+ <input type="hidden" name="qt" value="<%=handler%>"/>
<input class="stdbutton" type="submit" name="command"
value="full-import">
<input class="stdbutton" type="submit" name="command"
value="delta-import">
<input class="stdbutton" type="submit" name="command" value="status">
@@ -84,13 +92,15 @@
<input type="hidden" name="rows" value="0">
<input class="stdbutton" type="submit" value="Documents Count">
</form>
-<form action="../dataimport" target="result" method="get">
+<form action="../select" target="result" method="get">
+ <input type="hidden" name="qt" value="<%=handler%>"/>
<input type="hidden" name="verbose" value="true">
<input type="hidden" name="clean" value="true">
<input type="hidden" name="commit" value="true">
<input type="hidden" name="command" value="full-import">
<input class="stdbutton" type="submit" value="Full Import with
Cleaning">
</form>
+
<a href="index.jsp" target="_parent">Return to Admin Page</a>
</body>
</html>