You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ry...@apache.org on 2011/05/26 18:19:01 UTC

svn commit: r1127983 [9/9] - in /lucene/dev/trunk/solr/src/webapp/web: ./ css/ img/ img/ico/ js/ tpl/

Added: lucene/dev/trunk/solr/src/webapp/web/logging.json
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/logging.json?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/logging.json (added)
+++ lucene/dev/trunk/solr/src/webapp/web/logging.json Thu May 26 16:18:58 2011
@@ -0,0 +1,113 @@
+{
+	"levels" : ["FINEST", "FINE", "CONFIG", "INFO", "WARNING", "SEVERE"],
+	"logger" : {
+		"root" : {
+			"level": { "effective_level" : "INFO" },
+			"effective_level" : "INFO"
+		},
+		"global" : { "effective_level" : "INFO" },
+		"javax" : null,
+		"javax.management" : { "effective_level" : "INFO" },
+		"javax.management.mbeanserver" : { "effective_level" : "INFO" },
+		"javax.management.misc" : { "effective_level" : "INFO" },
+		"javax.management.mlet" : { "effective_level" : "INFO" },
+		"javax.management.modelmbean" : { "effective_level" : "INFO" },
+		"javax.management.monitor" : { "effective_level" : "INFO" },
+		"javax.management.notification" : { "effective_level" : "INFO" },
+		"javax.management.relation" : { "effective_level" : "INFO" },
+		"javax.management.snmp" : { "effective_level" : "INFO" },
+		"javax.management.snmp.daemon" : { "effective_level" : "INFO" },
+		"javax.management.timer" : { "effective_level" : "INFO" },
+		"org" : null,
+		"org.apache" : null,
+		"org.apache.solr" : null,
+		"org.apache.solr.analysis" : null,
+		"org.apache.solr.analysis.BaseTokenFilterFactory" : { "effective_level" : "INFO" },
+		"org.apache.solr.analysis.BaseTokenStreamFactory" : { "effective_level" : "INFO" },
+		"org.apache.solr.analysis.BaseTokenizerFactory" : { "effective_level" : "INFO" },
+		"org.apache.solr.cloud" : null,
+		"org.apache.solr.cloud.SolrZkServer" : { "effective_level" : "INFO" },
+		"org.apache.solr.cloud.ZkController" : { "effective_level" : "INFO" },
+		"org.apache.solr.common" : null,
+		"org.apache.solr.common.cloud" : null,
+		"org.apache.solr.common.cloud.CloudState" : { "effective_level" : "INFO" },
+		"org.apache.solr.common.cloud.ConnectionManager" : { "effective_level" : "INFO" },
+		"org.apache.solr.common.cloud.DefaultConnectionStrategy" : { "effective_level" : "INFO" },
+		"org.apache.solr.common.cloud.SolrZkClient" : { "effective_level" : "INFO" },
+		"org.apache.solr.common.cloud.ZkStateReader" : { "effective_level" : "INFO" },
+		"org.apache.solr.common.util" : null,
+		"org.apache.solr.common.util.ConcurrentLRUCache" : { "effective_level" : "INFO" },
+		"org.apache.solr.common.util.SystemIdResolver" : { "effective_level" : "INFO" },
+		"org.apache.solr.core" : null,
+		"org.apache.solr.core.Config" : { "effective_level" : "INFO" },
+		"org.apache.solr.core.CoreContainer" : { "effective_level" : "INFO" },
+		"org.apache.solr.core.JmxMonitoredMap" : { "effective_level" : "INFO" },
+		"org.apache.solr.core.RequestHandlers" : { "effective_level" : "INFO" },
+		"org.apache.solr.core.SolrConfig" : { "effective_level" : "INFO" },
+		"org.apache.solr.core.SolrCore" : { "effective_level" : "INFO" },
+		"org.apache.solr.core.SolrResourceLoader" : { "effective_level" : "INFO" },
+		"org.apache.solr.handler" : null,
+		"org.apache.solr.handler.XmlUpdateRequestHandler" : { "effective_level" : "INFO" },
+		"org.apache.solr.handler.admin" : null,
+		"org.apache.solr.handler.admin.LukeRequestHandler" : { "effective_level" : "INFO" },
+		"org.apache.solr.handler.admin.SystemInfoHandler" : { "effective_level" : "INFO" },
+		"org.apache.solr.handler.component" : null,
+		"org.apache.solr.handler.component.QueryElevationComponent" : { "effective_level" : "INFO" },
+		"org.apache.solr.handler.component.SearchHandler" : { "effective_level" : "INFO" },
+		"org.apache.solr.handler.component.SpellCheckComponent" : { "effective_level" : "INFO" },
+		"org.apache.solr.highlight" : null,
+		"org.apache.solr.highlight.DefaultSolrHighlighter" : { "effective_level" : "INFO" },
+		"org.apache.solr.highlight.SolrHighlighter" : { "effective_level" : "INFO" },
+		"org.apache.solr.response" : null,
+		"org.apache.solr.response.BinaryResponseWriter" : { "effective_level" : "INFO" },
+		"org.apache.solr.response.XSLTResponseWriter" : { "effective_level" : "INFO" },
+		"org.apache.solr.schema" : null,
+		"org.apache.solr.schema.FieldType" : { "effective_level" : "INFO" },
+		"org.apache.solr.schema.IndexSchema" : { "effective_level" : "INFO" },
+		"org.apache.solr.search" : null,
+		"org.apache.solr.search.SolrIndexSearcher" : { "effective_level" : "INFO" },
+		"org.apache.solr.servlet" : null,
+		"org.apache.solr.servlet.NewLogLevelSelection" : { "effective_level" : "INFO" },
+		"org.apache.solr.servlet.SolrDispatchFilter" : { "effective_level" : "INFO" },
+		"org.apache.solr.servlet.SolrRequestParsers" : { "effective_level" : "INFO" },
+		"org.apache.solr.spelling" : null,
+		"org.apache.solr.spelling.AbstractLuceneSpellChecker" : { "effective_level" : "INFO" },
+		"org.apache.solr.spelling.IndexBasedSpellChecker" : { "effective_level" : "INFO" },
+		"org.apache.solr.update" : null,
+		"org.apache.solr.update.SolrIndexConfig" : { "effective_level" : "INFO" },
+		"org.apache.solr.update.UpdateHandler" : { "effective_level" : "INFO" },
+		"org.apache.solr.util" : null,
+		"org.apache.solr.util.plugin" : null,
+		"org.apache.solr.util.plugin.AbstractPluginLoader" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper" : null,
+		"org.apache.zookeeper.ClientCnxn" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.CreateMode" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.ZooKeeper" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.common" : null,
+		"org.apache.zookeeper.common.PathTrie" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.jmx" : null,
+		"org.apache.zookeeper.jmx.MBeanRegistry" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server" : null,
+		"org.apache.zookeeper.server.ConnectionBean" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.DataTree" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.FinalRequestProcessor" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.NIOServerCnxn" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.PrepRequestProcessor" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.Request" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.SessionTrackerImpl" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.SyncRequestProcessor" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.WatchManager" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.ZKDatabase" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.ZooKeeperServer" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.ZooKeeperServerMain" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.persistence" : null,
+		"org.apache.zookeeper.server.persistence.FileSnap" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.persistence.FileTxnLog" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.persistence.FileTxnSnapLog" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.persistence.Util" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.quorum" : null,
+		"org.apache.zookeeper.server.quorum.QuorumPeerConfig" : { "effective_level" : "INFO" },
+		"org.apache.zookeeper.server.util" : null,
+		"org.apache.zookeeper.server.util.SerializeUtils" : { "effective_level" : "INFO" }
+	}
+}
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/analysis.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/analysis.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/analysis.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/analysis.html Thu May 26 16:18:58 2011
@@ -0,0 +1,69 @@
+<div id="analysis">
+
+    <div class="block" id="field-analysis">
+    
+        <h2><span>Field Analysis</span></h2>
+        <div class="content">
+    
+        <div class="message-container">
+            <div class="message"></div>
+        </div>
+        
+        <form method="get">
+            
+            <ul class="clearfix">
+                
+                <li class="index">
+                    
+                    <label for="analysis_fieldvalue_index">Field Value (Index)</label>
+                    <textarea name="analysis.fieldvalue" id="analysis_fieldvalue_index"></textarea>
+                    
+                </li>
+                
+                <li class="query">
+                    
+                    <label for="analysis_fieldvalue_query">Field Value (Query)</label>
+                    <textarea name="analysis.query" id="analysis_fieldvalue_query"></textarea>
+                    
+                </li>
+
+                <li class="settings clearfix">
+
+                    <label for="type_or_name">Analyse Fieldname / FieldType:</label>
+                    <select id="type_or_name"></select>
+
+                    <div>
+
+                        <button type="submit">Analyse Values</button>
+
+                    </div>
+
+                </li>
+                
+            </ul>
+            
+        </form>
+        
+        </div>
+    </div>
+    
+    <div class="block analysis-result">
+        
+        <h2>
+            <span>{headline}</span>
+            <div class="verbose_output">
+                <a>Verbose Output</label>
+            </div>
+        </h2>
+        <div class="content">
+        
+        <div class="message-container">
+            <div class="message"></div>
+        </div>
+        
+        <div class="analysis-result-content clearfix">{content}</div>
+        
+        </div>
+    </div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/cloud.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/cloud.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/cloud.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/cloud.html Thu May 26 16:18:58 2011
@@ -0,0 +1,19 @@
+<div id="cloud">
+
+	<div class="block" id="zookeeper">
+
+	    <h2><span>Zookeeper-Data</span></h2>
+	    
+	    <div class="message-container">
+	        <div class="message"></div>
+	    </div>
+
+	    <div class="content">
+
+			<a><span>Fetch Zookeeper Data</span></a>
+
+	    </div>
+
+    </div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/cores.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/cores.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/cores.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/cores.html Thu May 26 16:18:58 2011
@@ -0,0 +1,217 @@
+<div id="cores" class="clearfix">
+
+	<div id="frame">
+
+		<div id="actions" class="actions clearfix">
+			
+			<div class="button-holder">
+				<div class="button">
+					<a class="reload">Reload</a>
+				</div>
+			</div>
+			
+			<div class="button-holder options rename">
+				<div class="button">
+					<a class="rename">Rename</a>
+				</div>
+				<div class="button-content">
+
+					<form>
+
+						<p class="clearfix"><label for="rename_core">from:</label>
+						<input type="text" name="core" id="rename_core" disabled="disabled"></p>
+
+						<p class="clearfix"><label for="rename_other">to:</label>
+						<input type="text" name="other" id="rename_other"></p>
+
+						<p class="clearfix buttons">
+							<a class="submit"><span>Rename</span></a>
+							<a class="reset"><span>Cancel</span></a>
+						</p>
+
+					</form>
+
+				</div>
+			</div>
+			
+			<div class="button-holder options swap">
+				<div class="button">
+					<a class="swap">Swap</a>
+				</div>
+				<div class="button-content">
+
+					<form>
+
+						<p class="clearfix"><label for="swap_core">this:</label>
+						<select name="core" id="swap_core" class="core" disabled="disabled">
+						</select></p>
+
+						<p class="clearfix"><label for="swap_other">and:</label>
+						<select class="other" id="swap_other" class="other">
+						</select></p>
+
+						<p class="clearfix buttons">
+							<a class="submit"><span>Swap</span></a>
+							<a class="reset"><span>Cancel</span></a>
+						</p>
+
+					</form>
+				
+				</div>
+			</div>
+			
+			<div class="button-holder">
+				<div class="button">
+					<a class="unload">Unload</a>
+				</div>
+			</div>
+			
+			<div class="button-holder">
+				<div class="button">
+					<a class="optimize">Optimize</a>
+				</div>
+			</div>
+
+		</div>
+
+		<div id="data">
+
+			<div class="block" id="core-data">
+
+			    <h2><span></span></h2>
+			    
+			    <div class="message-container">
+			        <div class="message"></div>
+			    </div>
+
+			    <div class="content">
+
+					<ul>
+
+						<li class="startTime"><dl class="clearfix">
+							<dt><span>startTime:</span></dt>
+								<dd class="timeago"></dd>
+						</dl></li>
+
+						<li class="instanceDir"><dl class="clearfix">
+							<dt><span>instanceDir:</span></dt>
+								<dd></dd>
+						</dl></li>
+
+						<li class="dataDir"><dl class="clearfix">
+							<dt><span>dataDir:</span></dt>
+								<dd></dd>
+						</dl></li>
+				
+					</ul>
+				
+				</div>
+			</div>
+
+			<div class="block" id="index-data">
+
+			    <h2><span>Index</span></h2>
+			    
+			    <div class="message-container">
+			        <div class="message"></div>
+			    </div>
+
+			    <div class="content">
+			    
+					<ul>
+
+						<li class="lastModified"><dl class="clearfix">
+							<dt><span>lastModified:</span></dt>
+								<dd class="timeago"></dd>
+						</dl></li>
+
+						<li class="version"><dl class="clearfix">
+							<dt><span>version:</span></dt>
+								<dd></dd>
+						</dl></li>
+
+						<li class="numDocs"><dl class="clearfix">
+							<dt><span>numDocs:</span></dt>
+								<dd></dd>
+						</dl></li>
+
+						<li class="maxDoc"><dl class="clearfix">
+							<dt><span>maxDoc:</span></dt>
+								<dd></dd>
+						</dl></li>
+
+						<li class="optimized"><dl class="clearfix">
+							<dt><span>optimized:</span></dt>
+								<dd class="ico"><span></span></dd>
+						</dl></li>
+
+						<li class="current"><dl class="clearfix">
+							<dt><span>current:</span></dt>
+								<dd class="ico"><span></span></dd>
+						</dl></li>
+
+						<li class="hasDeletions"><dl class="clearfix">
+							<dt><span>hasDeletions:</span></dt>
+								<dd class="ico"><span></span></dd>
+						</dl></li>
+
+						<li class="directory"><dl class="clearfix">
+							<dt><span>directory:</span></dt>
+								<dd></dd>
+						</dl></li>
+					
+					</ul>
+				
+				</div>
+			</div>
+
+		</div>
+	
+	</div>
+
+	<div id="navigation">
+
+		<div class="actions">
+			
+			<div class="button-holder options add">
+				<div class="button">
+					<a class="add">Add Core</a>
+				</div>
+				<div class="button-content">
+
+					<form>
+
+						<p class="clearfix"><label for="add_name">name:</label>
+						<input type="text" name="name" id="add_name"></p>
+
+						<p class="clearfix"><label for="add_instanceDir">instanceDir:</label>
+						<input type="text" name="instanceDir" id="add_instanceDir"></p>
+
+						<p class="clearfix"><label for="add_config">config:</label>
+						<input type="text" name="config" id="add_config"></p>
+
+						<p class="clearfix"><label for="add_schema">schema:</label>
+						<input type="text" name="schema" id="add_schema"></p>
+
+						<p class="clearfix"><label for="add_dataDir">dataDir:</label>
+						<input type="text" name="dataDir" id="dataDir"></p>
+
+						<p class="clearfix buttons">
+							<a class="submit"><span>Add Core</span></a>
+							<a class="reset"><span>Cancel</span></a>
+						</p>
+
+					</form>
+
+				</div>
+			</div>
+		
+		</div>
+
+		<div id="list">
+
+		</div>
+	
+	</div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/dashboard.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/dashboard.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/dashboard.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/dashboard.html Thu May 26 16:18:58 2011
@@ -0,0 +1,174 @@
+<div id="dashboard">
+
+    <div class="clearfix">
+
+        <div class="block" id="statistics">
+
+            <h2><span>Statistics</span></h2>
+            
+            <div class="message-container">
+                <div class="message"></div>
+            </div>
+
+            <div class="content">
+                
+                <dl>
+                    
+                    <dt class="index_last-modified">lastModified:</dt>
+                        <dd class="index_last-modified value timeago"></dd>
+
+                    <dt class="index_num-docs">numDocs:</dt>
+                        <dd class="index_num-docs value"></dd>
+
+                    <dt class="index_max-doc">maxDoc:</dt>
+                        <dd class="index_max-doc value"></dd>
+
+                    <dt class="index_optimized">optimized:</dt>
+                        <dd class="index_optimized value ico"><span></span>
+                        <a>optimize now</a></dd>
+
+                    <dt class="index_current">current:</dt>
+                        <dd class="index_current value ico"><span></span></dd>
+
+                    <dt class="index_has-deletions">deletions:</dt>
+                        <dd class="index_has-deletions value ico"><span></span></dd>
+
+                </dl>
+           
+            </div>
+        </div>
+
+        <div class="block" id="admin-extra">
+
+            <h2><span>Admin Extra</span></h2>
+            
+            <div class="message-container">
+                <div class="message"></div>
+            </div>
+
+            <div class="content">
+
+            </div>
+        
+        </div>
+
+    </div>
+    <div class="clearfix">
+
+        <div class="block" id="replication">
+
+            <h2><span class="is-replicating">Replication</span></h2>
+            
+            <div class="message-container">
+                <div class="message"></div>
+            </div>
+
+            <div class="content">
+                
+                <table border="0" cellspacing="0" cellpadding="0">
+                    <thead>
+                        <tr>
+                            <td>&nbsp;</td>
+                            <th class="slave">slave</th>
+                            <th>master</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr>
+                            <th>indexVersion</th>
+                            <td class="slave value details_slave_master-details_index-version"></td>
+                            <td class="value details_index-version"></td>
+                        </tr>
+                        <tr>
+                            <th>generation</th>
+                            <td class="slave value details_slave_master-details_generation"></td>
+                            <td class="value details_generation"></td>
+                        </tr>
+                        <tr>
+                            <th>indexSize</th>
+                            <td class="slave value details_slave_master-details_index-size"></td>
+                            <td class="value details_index-size"></td>
+                        </tr>
+                    </tbody>
+                </table>
+
+                <dl class="clearfix slave">
+
+                    <dt class="details_slave_master-url">masterUrl</dt>
+                        <dd class="value details_slave_master-url"></dd>
+
+                    <dt class="details_slave_poll-interval">poll every</dt>
+                        <dd class="value details_slave_poll-interval"></dd>
+
+                    <dt class="details_slave_index-replicated-at">last replicated</dt>
+                        <dd class="value timeago details_slave_index-replicated-at"></dd>
+
+                    <dt class="details_slave_next-execution-at">replicate next</dt>
+                        <dd class="value timeago details_slave_next-execution-at"></dd>
+
+                    <dt class="details_slave_replication-failed-at">last failed</dt>
+                        <dd class="value timeago details_slave_replication-failed-at"></dd>
+
+                </dl>
+
+<!--
+indexVersion:
+    1295900553587
+generation:
+    2
+indexSize:
+    4.25 KB
+
+// slave
+
+indexVersion:
+    1295900553587
+generation:
+    2
+indexSize:
+    4.25 KB
+masterUrl:
+    http://localhost:8985/solr/replication
+pollInterval:
+    00:00:60
+indexReplicatedAt:
+    Tue Mar 01 19:37:00 UTC 2011
+nextExecutionAt:
+    Tue Mar 01 19:38:00 UTC 2011
+replicationFailedAt:
+    Tue Mar 01 19:37:00 UTC 2011
+lastCycleBytesDownloaded:
+    0
+previousCycleTimeInSeconds:
+    0
+isPollingDisabled:
+    false
+isReplicating:
+    false 
+-->
+            
+            </div>
+        </div>
+
+        <div class="block" id="dataimport">
+
+            <h2><span>DataImport-Handler</span></h2>
+            
+            <div class="message-container">
+                <div class="message"></div>
+            </div>
+
+            <div class="content">
+
+<!--
+status:
+    idle
+info:
+-->
+
+            </div>
+        </div>
+
+    </div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/dataimport.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/dataimport.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/dataimport.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/dataimport.html Thu May 26 16:18:58 2011
@@ -0,0 +1,121 @@
+<link rel="stylesheet" type="text/css" href="css/syntax.css">
+<div id="dataimport" class="clearfix">
+
+	<div id="frame">
+
+		<div id="current_state">
+
+			<span class="time"></span>
+			<div class="info">
+				<strong></strong>
+
+				<div class="details"></div>
+			</div>
+		
+		</div>
+
+		<div id="config-error">
+
+			Dataimport XML-Configuration is not valid
+
+		</div>
+
+        <div class="block hidden" id="config">
+
+            <h2>
+            	<a class="toggle"><span>Dataimport Configuration</span></a>
+            	<a class="reload_config" title="Reload Configuration">Reload</a>
+        	</h2>
+            
+            <div class="message-container">
+                <div class="message"></div>
+            </div>
+
+            <div class="content">
+
+				<div id="dataimport_config">
+
+					<div class="loader">Loading ...</div>
+				
+				</div>
+
+            </div>
+        </div>
+	
+	</div>
+
+	<div id="form">
+
+		<fieldset class="handler">
+			<legend>handler</legend>
+			<div class="fieldset">
+
+				<ul>
+				</ul>
+		
+			</div>
+		</fieldset>
+
+		<form action="#" method="get">
+
+			<fieldset>
+				<legend>import</legend>
+				<div class="fieldset">
+
+					<label for="command">
+						<a rel="help">command</a>
+					</label>
+					<select name="command" id="command">
+						<option>full-import</option>
+						<option>delta-import</option>
+					</select>
+
+					<label for="verbose" class="checkbox">
+						<input type="checkbox" name="verbose" id="verbose" value="true">
+						<a rel="help">verbose</a>
+					</label>
+
+					<label for="clean" class="checkbox">
+						<input type="checkbox" name="clean" id="clean" value="true">
+						<a rel="help">clean</a>
+					</label>
+
+					<label for="commit" class="checkbox">
+						<input type="checkbox" name="commit" id="commit" value="true">
+						<a rel="help">commit</a>
+					</label>
+
+					<label for="optimize" class="checkbox">
+						<input type="checkbox" name="optimize" id="optimize" value="true">
+						<a rel="help">optimize</a>
+					</label>
+
+					<label for="entity">
+						<a rel="help">entity</a>
+					</label>
+					<select name="entity" id="entity">
+						<option value=""></option>
+					</select>
+
+					<label for="start">
+						<a rel="help">start</a>,
+						<a rel="help">rows</a>
+					</label>
+					<input type="text" name="start" id="start" value="0">
+					<input type="text" name="rows" id="rows" value="10">
+
+					<label for="custom_parameters">
+						<a rel="help">custom parameters</a>
+					</label>
+					<input type="text" name="custom_parameters" id="custom_parameters" value="">
+			
+				</div>
+			</fieldset>
+
+			<button type="submit">Execute Import</button>
+		
+		</form>
+	
+	</div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/index.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/index.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/index.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/index.html Thu May 26 16:18:58 2011
@@ -0,0 +1,107 @@
+<div id="index">
+
+    <div class="clearfix">
+
+		<div class="block" id="data">
+
+		    <h2><span>Dashboard</span></h2>
+		    
+		    <div class="message-container">
+		        <div class="message"></div>
+		    </div>
+
+		    <div class="content">
+
+		    	<ul class="data">
+
+		    		<li class="start_time"><dl class="clearfix">
+		    			<dt><span>startTime</span></dt>
+		    				<dd class="timeago"></dd>
+		    		</dl></li>
+
+		    		<li class="host"><dl class="clearfix">
+			    		<dt><span>host</span></dt>
+			    			<dd></dd>
+		    		</dl></li>
+
+		    		<li class="cwd"><dl class="clearfix">
+			    		<dt><span>cwd</span></dt>
+							<dd></dd>
+		    		</dl></li>
+
+		    		<li class="jvm"><dl class="clearfix">
+			    		<dt><span>JVM</span></dt>
+			    			<dd></dd>
+		    		</dl></li>
+
+		    		<li class="command_line_args"><dl class="clearfix">
+			    		<dt><span>commandLineArgs</span></dt>
+							<dd></dd>
+		    		</dl></li>
+		    	
+		    	</ul>
+
+		    	<ul class="lucene">
+
+		    		<li class="solr_spec_version"><dl class="clearfix">
+			    		<dt><span>solr-spec-version</span></dt>
+			    			<dd></dd>
+		    		</dl></li>
+		    		
+		    		<li class="solr_impl_version"><dl class="clearfix">
+			    		<dt class=""><span>solr-impl-version</span></dt>
+			    			<dd></dd>
+		    		</dl></li>
+		    		
+		    		<li class="lucene_spec_version"><dl class="clearfix">
+			    		<dt><span>lucene-spec-version</span></dt>
+			    			<dd></dd>
+		    		</dl></li>
+
+		    		<li class="lucene_impl_version"><dl class="clearfix">		    		
+			    		<dt><span>lucene-impl-version</span></dt>
+			    			<dd></dd>
+		    		</dl></li>
+		    	
+		    	</ul>
+
+		    </div>
+
+		</div>
+	
+		<div class="block" id="memory">
+
+		    <h2><span>Memory</span></h2>
+		    
+		    <div class="message-container">
+		        <div class="message"></div>
+		    </div>
+
+		    <div class="content">
+
+		    	<div id="memory-bar">
+
+		    		<div id="memory-bar-max">
+		    			<span class="memory-bar-max value"></span>
+
+		    			<div id="memory-bar-total" class="bar">
+		    				<span class="memory-bar-total value"></span>
+
+		    				<div id="memory-bar-used" class="bar">
+		    					<span class="memory-bar-used value"></span>
+
+		    				</div>
+
+		    			</div>
+
+		    		</div>
+
+		    	</div>
+
+		    </div>
+
+		</div>
+
+	</div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/query.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/query.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/query.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/query.html Thu May 26 16:18:58 2011
@@ -0,0 +1,244 @@
+<div id="query" class="clearfix">
+
+	<div id="form">
+
+		<form action="#" method="get">
+
+			<fieldset>
+				<legend>common</legend>
+				<div class="fieldset">
+
+				<label for="q">
+					q
+				</label>
+				<textarea name="q" id="q">*:*</textarea>
+
+				<label for="fq">
+					<a rel="help">fq</a>
+				</label>
+				<input type="text" id="fq" name="fq" class="multiple">
+
+				<label for="sort">
+					<a rel="help">sort</a>
+				</label>
+				<input type="text" id="sort" name="sort" class="multiple">
+
+				<label for="start">
+					<a rel="help">start</a>,
+					<a rel="help">rows</a>
+				</label>
+				<input type="text" name="start" id="start" value="0">
+				<input type="text" name="rows" id="rows" value="10">
+
+				<label for="fl">
+					<a rel="help">fl</a>
+				</label>
+				<input type="text" name="fl" id="fl" value="*">
+
+				<label for="qt">
+					<a rel="help">qt</a>
+				</label>
+				<input type="text" name="qt" id="qt" value="">
+
+				<label for="debugQuery" class="checkbox">
+					<input type="checkbox" name="debugQuery" id="debugQuery" value="true">
+					<a rel="help">debugQuery</a>
+				</label>
+
+				</div>
+			</fieldset>
+
+			<fieldset class="optional">
+				<legend>
+					<label for="dismax" class="checkbox">
+						<input type="checkbox" name="dismax" id="dismax" value="true">
+						dismax
+					</label>
+				</legend>
+				<div class="fieldset">
+
+				<label for="q_alt">q.alt</label>
+				<input type="text" name="q.alt" id="q_alt">
+
+				<label for="qf">qf</label>
+				<input type="text" name="qf" id="qf">
+
+				<label for="mm">mm</label>
+				<input type="text" name="mm" id="mm">
+
+				<label for="pf">pf</label>
+				<input type="text" name="pf" id="pf">
+
+				<label for="ps">ps</label>
+				<input type="text" name="ps" id="ps">
+
+				<label for="qs">qs</label>
+				<input type="text" name="qs" id="qs">
+
+				<label for="tie">tie</label>
+				<input type="text" name="tie" id="tie">
+
+				<label for="bq">bq</label>
+				<input type="text" name="bq" id="bq">
+
+				<label for="bf">bf</label>
+				<input type="text" name="bf" id="bf">
+			
+			</fieldset>
+
+			<fieldset class="optional">
+				<legend>
+					<label for="hl" class="checkbox">
+						<input type="checkbox" name="hl" id="hl" value="true">
+						hl
+					</label>
+				</legend>
+				<div class="fieldset">
+
+				<label for="hl_fl">hl.fl</label>
+				<input type="text" name="hl.fl" id="hl_fl" value="">
+
+				<label for="hl_simple_pre">hl.simple.pre</label>
+				<input type="text" name="hl.simple.pre" id="hl_simple_pre" value="<em>">
+
+				<label for="hl_simple_post">hl.simple.post</label>
+				<input type="text" name="hl.simple.post" id="hl_simple_post" value="</em>">
+
+				<label for="hl_requireFieldMatch" class="checkbox">
+					<input type="checkbox" name="hl.requireFieldMatch" id="hl_requireFieldMatch" value="true">
+					hl.requireFieldMatch
+				</label>
+
+				<label for="hl_usePhraseHighlighter" class="checkbox">
+					<input type="checkbox" name="hl.usePhraseHighlighter" id="hl_usePhraseHighlighter" value="true">
+					hl.usePhraseHighlighter
+				</label>
+
+				<label for="hl_highlightMultiTerm" class="checkbox">
+					<input type="checkbox" name="hl.highlightMultiTerm" id="hl_highlightMultiTerm" value="true">
+					hl.highlightMultiTerm
+				</label>
+			
+				</div>
+			</fieldset>
+
+			<fieldset class="optional">
+				<legend>
+					<label for="facet" class="checkbox">
+						<input type="checkbox" name="facet" id="facet" value="true">
+						facet
+					</label>
+				</legend>
+				<div class="fieldset">
+
+				<label for="facet_query">facet.query</label>
+				<textarea name="facet.query" id="facet_query"></textarea>
+
+				<label for="facet_field">facet.field</label>
+				<input type="text" name="facet.field" id="facet_field">
+
+				<label for="facet_prefix">facet.prefix</label>
+				<input type="text" name="facet.prefix" id="facet_prefix">
+
+				</div>
+			</fieldset>
+
+			<fieldset class="optional">
+				<legend>
+					<label for="spatial" class="checkbox">
+						<input type="checkbox" name="spatial" id="spatial" value="true">
+						spatial
+					</label>
+				</legend>
+				<div class="fieldset">
+
+				<label for="pt">pt</label>
+				<input type="text" name="pt" id="pt">
+
+				<label for="sfield">sfield</label>
+				<input type="text" name="sfield" id="sfield">
+
+				<label for="d">d</label>
+				<input type="text" name="d" id="d">
+				
+				</div>
+			</fieldset>
+
+			<fieldset class="optional">
+				<legend>
+					<label for="spellcheck" class="checkbox">
+						<input type="checkbox" name="spellcheck" id="spellcheck" value="true">
+						spellcheck
+					</label>
+				</legend>
+				<div class="fieldset">
+
+				<label for="spellcheck_build" class="checkbox">
+					<input type="checkbox" name="spellcheck.build" id="spellcheck_build" value="true">
+					spellcheck.build
+				</label>
+
+				<label for="spellcheck_reload" class="checkbox">
+					<input type="checkbox" name="spellcheck.reload" id="spellcheck_reload" value="true">
+					spellcheck.reload
+				</label>
+
+				<label for="spellcheck_q">spellcheck.q</label>
+				<input type="text" name="spellcheck.q" id="spellcheck_q">
+
+				<label for="spellcheck_dictionary">spellcheck.dictionary</label>
+				<input type="text" name="spellcheck.dictionary" id="spellcheck_dictionary">
+
+				<label for="spellcheck_count">spellcheck.count</label>
+				<input type="text" name="spellcheck.count" id="spellcheck_count">
+
+				<label for="spellcheck_onlyMorePopular" class="checkbox">
+					<input type="checkbox" name="spellcheck.onlyMorePopular" id="spellcheck_onlyMorePopular" value="true">
+					spellcheck.onlyMorePopular
+				</label>
+
+				<label for="spellcheck_extendedResults" class="checkbox">
+					<input type="checkbox" name="spellcheck.extendedResults" id="spellcheck_extendedResults" value="true">
+					spellcheck.extendedResults
+				</label>
+
+				<label for="spellcheck_collate" class="checkbox">
+					<input type="checkbox" name="spellcheck.collate" id="spellcheck_collate" value="true">
+					spellcheck.collate
+				</label>
+
+				<label for="spellcheck_maxCollations">spellcheck.maxCollations</label>
+				<input type="text" name="spellcheck.maxCollations" id="spellcheck_maxCollations">
+
+				<label for="spellcheck_maxCollationTries">spellcheck.maxCollationTries</label>
+				<input type="text" name="spellcheck.maxCollationTries" id="spellcheck_maxCollationTries">
+
+				<label for="spellcheck_accuracy">spellcheck.accuracy</label>
+				<input type="text" name="spellcheck.accuracy" id="spellcheck_accuracy">
+			
+			</fieldset>
+
+
+			<button type="submit">Execute Query</button>
+
+		</form>
+
+	</div>
+
+	<div id="result">
+
+		<div id="url">
+
+			<input type="text" readonly="readonly">
+		
+		</div>
+
+		<div id="response">
+
+			<iframe src="about:blank"></iframe>
+		
+		</div>
+
+	</div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/replication.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/replication.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/replication.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/replication.html Thu May 26 16:18:58 2011
@@ -0,0 +1,184 @@
+<div id="replication" class="clearfix">
+
+    <div id="frame">
+
+        <div id="error"></div>
+
+        <div class="replicating block">
+
+            <div id="progress">
+
+                <div id="start"><div class="info">
+
+                    <span>Wed May 11 19:41:48 UTC 2011</span>
+                
+                </div></div>
+
+                <div id="speed"><div class="info">
+
+                    <span>5.1 MB</span>/s
+                
+                </div></div>
+
+                <div id="bar">
+
+                    <div id="bar-info"><div class="info">
+
+                        <div class="files"><span>24</span> Files</div>
+                        <div class="size"><span>226.85 MB</span></div>
+
+                    </div></div>
+
+                    <div id="eta"><div class="info">
+
+                        ETA: <span>25s</span>
+                    
+                    </div></div>
+
+                    <div id="done" style="width: 20.0%;">
+
+                        <div class="percent">
+
+                            <span>20</span>%
+
+                        </div>
+
+                        <div id="done-info"><div class="info">
+
+                            <div class="files"><span>2</span> Files</div>
+                            <div class="size"><span>91.76 MB</span></div>
+
+                        </div></div>
+
+                    </div>
+
+                </div>
+
+            </div>
+
+            <div id="current-file" class="clearfix">
+
+                <div class="label"><span class="loader">Current File:</span></div>
+                <div class="file">_a.fdt</div>
+                <div class="progress">
+                    <span class="done">84 MB</span> / <span class="total">102.98 MB</span> [<span class="percent">81</span>%]
+                </div>
+
+            </div>
+        
+        </div>
+
+        <div id="iterations" class="slaveOnly block clearfix">
+
+            <div class="label"><span class="">Iterations:</span></div>
+            <div class="iterations">
+                <ul>
+                </ul>
+                <a>
+                    <span class="expand">Show all Iterations</span>
+                    <span class="collapse">Hide past Iterations</span>
+                </a>
+            </div>
+        
+        </div>
+
+        <div id="details" class="block clearfix">
+
+            <table border="0" cellspacing="0" cellpadding="0">
+
+                <thead>
+
+                    <tr>
+                        
+                        <td><span>Index</span></td>
+                        <th>Version</th>
+                        <th><abbr title="Generation">Gen</abbr></th>
+                        <th>Size</th>
+                    
+                    </tr>
+                
+                </thead>
+                <tbody>
+
+                    <tr class="master">
+
+                        <th>Master:</th>
+                        <td class="version"><div></div></td>
+                        <td class="generation"><div></div></td>
+                        <td class="size"><div></div></td>
+
+                    </tr>
+
+                    <tr class="slave slaveOnly">
+
+                        <th>Slave:</th>
+                        <td class="version"><div></div></td>
+                        <td class="generation"><div></div></td>
+                        <td class="size"><div></div></td>
+
+                    </tr>
+
+                </tbody>
+
+            </table>
+
+        </div>
+
+        <div id="settings" class="settings block clearfix slaveOnly">
+
+            <div class="label"><span>Settings:</span></div>
+            <ul>
+                <li class="masterUrl"><dl class="clearfix">
+                    <dt>master url:</dt>
+                        <dd></dd>
+                </dl></li>
+                <li class="isPollingDisabled"><dl class="clearfix">
+                    <dt>polling enable:</dt>
+                        <dd class="ico">&nbsp;</dd>
+                </dl></li>
+            </ul>
+        
+        </div>
+
+        <div id="master-settings" class="settings block clearfix">
+
+            <div class="label"><span>Settings (Master):</span></div>
+            <ul>
+                <li class="replicationEnabled"><dl class="clearfix">
+                    <dt>replication enable:</dt>
+                        <dd class="ico">&nbsp;</dd>
+                </dl></li>
+                <li class="replicateAfter"><dl class="clearfix">
+                    <dt>replicateAfter:</dt>
+                        <dd></dd>
+                </dl></li>
+                <li class="confFiles"><dl class="clearfix">
+                    <dt>confFiles:</dt>
+                        <dd></dd>
+                </dl></li>
+            </ul>
+        
+        </div>
+    
+    </div>
+
+    <div id="navigation">
+
+        <button class="refresh-status">Refresh Status</button>
+
+        <div class="slaveOnly">        
+            <button class="optional replicate-now" data-command="fetchindex">Replicate now</button>
+            <button class="optional abort-replication" data-command="abortfetch">Abort Replication</button>
+
+            <button class="optional disable-polling" data-command="disablepoll">Disable Polling</button>
+            <button class="optional enable-polling" data-command="enablepoll">Enable Polling</button>
+        </div>
+
+        <div class="masterOnly">
+            <button class="optional disable-replication" data-command="disablereplication">Disable Replication</button>
+            <button class="optional enable-replication" data-command="enablereplication">Enable Replication</button>
+        </div>
+    
+    </div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser.html Thu May 26 16:18:58 2011
@@ -0,0 +1,24 @@
+<div id="schema-browser" class="loaded">
+
+    <div class="clearfix">
+
+        <div id="data">
+
+            #data
+
+        </div>
+
+        <div id="related">
+
+            <select>
+                <option value="" selected="selected">Please select ..</option>
+            </select>
+
+            <dl>
+            </dl>
+
+        </div>
+
+    </div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_dynamic-field.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_dynamic-field.html?rev=1127983&view=auto
==============================================================================
    (empty)

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_field.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_field.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_field.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_field.html Thu May 26 16:18:58 2011
@@ -0,0 +1,109 @@
+<div id="field">
+
+	<div class="field-options">
+
+		<dl class="options clearfix">
+
+			<dt class="field-type">Field-Type:</dt>
+
+			<dt class="properties">Properties:</dt>
+
+			<dt class="schema">Schema:</dt>
+
+			<dt class="index">Index:</dt>
+
+			<dt class="position-increment-gap"><abbr title="Position Increment Gap">PI Gap</abbr>:</dt>
+
+			<dt class="docs">Docs:</dt>
+
+			<dt class="distinct">Distinct:</dt>
+			
+		</dl>
+
+		<ul class="analyzer">
+			<li class="clearfix index">
+
+				<p>Index Analyzer:</p>
+				<dl>
+					<dt></dt>
+				</dl>
+
+				<ul>
+					<li class="clearfix tokenizer">
+						<p>Tokenizer:</p>
+						<dl>
+						</dl>
+					</li>
+					<li class="clearfix filters">
+						<p>Filters:</p>
+						<dl>
+						</dl>
+					</li>
+				</ul>
+				
+			</li>
+			<li class="clearfix query">
+
+				<p>Query Analyzer:</p>
+				<dl>
+					<dt></dt>
+				</dl>
+
+				<ul>
+					<li class="clearfix tokenizer">
+						<p>Tokenizer:</p>
+						<dl>
+						</dl>
+					</li>
+					<li class="clearfix filters">
+						<p>Filters:</p>
+						<dl>
+						</dl>
+					</li>
+				</ul>
+				
+			</li>
+		</ul>
+
+	</div>
+
+	<div class="topterms-holder">
+
+		<p class="head">Top <span class="shown"></span><span class="max-holder">/<span class="max"></span></span> Terms:</p>
+
+		<table border="0" cellspacing="0" cellpadding="0">
+
+			<thead>
+
+				<tr>
+
+					<th class="position" title="Position">&nbsp;</th>
+					<th class="term">Term</th>
+					<th class="frequency" title="Frequency">Frq</th>
+				
+				</tr>
+
+			</thead>
+
+		</table>
+
+		<p class="navi clearfix">
+			<a class="less"><span>less</span></a>
+			<a class="more"><span>more</span></a>
+		</p>
+
+	</div>
+
+	<div class="histogram-holder">
+
+		<p class="head">Histogram:</p>
+
+		<div class="histogram"></div>
+
+		<dl class="clearfix">
+
+		</dl>
+	
+	</div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_index.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_index.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_index.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_index.html Thu May 26 16:18:58 2011
@@ -0,0 +1,11 @@
+<div id="index">
+
+	<dl class="clearfix">
+
+		<dt class="unique-key-field">Unique Key Field:</dt>
+
+		<dt class="default-search-field">Default Search Field:</dt>
+	
+	</dl>	
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_type.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/schema-browser_type.html?rev=1127983&view=auto
==============================================================================
    (empty)

Added: lucene/dev/trunk/solr/src/webapp/web/tpl/threads.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/tpl/threads.html?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/tpl/threads.html (added)
+++ lucene/dev/trunk/solr/src/webapp/web/tpl/threads.html Thu May 26 16:18:58 2011
@@ -0,0 +1,29 @@
+<div id="threads">
+
+    <div id="thread-dump">
+
+        <table border="0" cellpadding="0" cellspacing="0">
+
+            <thead>
+
+                <tr>
+
+                    <td class="ico spacer">&nbsp;</td>
+                    <th>id</th>
+                    <th>name</th>
+                    <th>cpuTime</th>
+                    <th>userTime</th>
+                
+                </tr>
+
+            </thead>
+
+            <tbody>
+
+            </tbody>
+
+        </table>
+    
+    </div>
+
+</div>
\ No newline at end of file

Added: lucene/dev/trunk/solr/src/webapp/web/zookeeper.jsp
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/webapp/web/zookeeper.jsp?rev=1127983&view=auto
==============================================================================
--- lucene/dev/trunk/solr/src/webapp/web/zookeeper.jsp (added)
+++ lucene/dev/trunk/solr/src/webapp/web/zookeeper.jsp Thu May 26 16:18:58 2011
@@ -0,0 +1,506 @@
+<%@ page contentType="application/json; charset=utf-8" pageEncoding="UTF-8" %>
+<%@ page trimDirectiveWhitespaces="true" %>
+
+<%@ page import="javax.servlet.jsp.JspWriter" %>
+<%@ page import="java.io.IOException" %>
+<%@ page import="org.apache.zookeeper.*" %>
+<%@ page import="org.apache.zookeeper.data.Stat" %>
+<%@ page import="org.apache.solr.core.*" %>
+<%@ page import="org.apache.solr.cloud.*" %>
+<%@ page import="org.apache.solr.common.cloud.*" %>
+<%@ page import="org.apache.solr.common.util.*" %>
+<%@ page import="java.util.concurrent.TimeoutException" %>
+<%@ page import="java.io.*" %>
+<%@ page import="java.util.*" %>
+<%@ page import="java.net.URLEncoder" %>
+
+<% SolrCore core = (SolrCore)request.getAttribute( "org.apache.solr.SolrCore" ); %>
+
+<%!
+
+static class ZKPrinter
+{
+
+	static boolean FULLPATH_DEFAULT = false;
+
+	boolean indent = true;
+	boolean fullpath = FULLPATH_DEFAULT;
+	boolean detail = false;
+
+	String addr; // the address passed to us
+	String keeperAddr; // the address we're connected to
+
+	boolean doClose;  // close the client after done if we opened it
+
+	HttpServletResponse response;
+	JspWriter out;
+	SolrZkClient zkClient;
+
+	private boolean levelchange;
+	int level;
+	int maxData = 95;
+
+	public ZKPrinter(HttpServletResponse response, JspWriter out, SolrCore core, String addr)
+        throws IOException
+    {
+		this.response = response;
+		this.out = out;
+		this.addr = addr;
+
+		if (addr == null)
+		{
+			ZkController controller = core.getCoreDescriptor().getCoreContainer().getZkController();
+			if (controller != null)
+			{
+				// this core is zk enabled
+				keeperAddr = controller.getZkServerAddress();
+				zkClient = controller.getZkClient();
+				if (zkClient != null && zkClient.isConnected())
+				{
+					return;
+				}
+				else
+				{
+					// try a different client with this address
+					addr = keeperAddr;
+				}
+			}
+		}
+
+		keeperAddr = addr;
+		if (addr == null)
+		{
+			response.setStatus(404);
+			out.println
+			(
+				"{" +
+				"\"status\": 404" +
+				", \"error\" : \"Zookeeper is not configured for this Solr Core. Please try connecting to an alternate zookeeper address.\"" +
+				"}"
+			);
+			return;
+		}
+
+		try
+		{
+			zkClient = new SolrZkClient(addr, 10000);
+			doClose = true;
+		}
+		catch (TimeoutException e)
+		{
+			response.setStatus(503);
+			out.println
+			(
+				"{" +
+				"\"status\": 503" +
+				", \"error\" : \"Could not connect to zookeeper at '" + addr + "'\"" +
+				"}"
+			);
+			zkClient = null;
+			return;
+		}
+		catch (InterruptedException e)
+		{
+			// Restore the interrupted status
+			Thread.currentThread().interrupt();
+			response.setStatus(503);
+			out.println
+			(
+				"{" +
+				"\"status\": 503" +
+				", \"error\" : \"Could not connect to zookeeper at '" + addr + "'\"" +
+				"}"
+			);
+			zkClient = null;
+			return;
+		}
+
+    }
+
+    public void close()
+    {
+		try
+		{
+			if (doClose)
+			{
+				zkClient.close();
+			}
+        } catch (InterruptedException e)
+        {
+            // ignore exception on close
+        }
+    }
+
+    // main entry point
+    void print(String path) throws IOException
+    {
+		if (zkClient == null)
+		{
+		return;
+		}
+
+		// normalize path
+		if (path == null)
+		{
+			path = "/";
+		}
+		else
+		{
+			path.trim();
+			if (path.length() == 0)
+			{
+				path = "/";
+			}
+		}
+		
+		if (path.endsWith("/") && path.length() > 1)
+		{
+			path = path.substring(0, path.length() - 1);
+		}
+
+		int idx = path.lastIndexOf('/');
+		String parent = idx >= 0 ? path.substring(0, idx) : path;
+		if (parent.length() == 0)
+		{
+			parent = "/";
+		}
+
+		out.println("{");
+
+		if (detail)
+		{
+			printZnode(path);
+			out.println(", ");
+		}
+
+		out.println("\"tree\" : [");
+		printTree(path);
+		out.println("]");
+
+		out.println("}");
+    }
+
+	void exception(Exception e)
+	{
+		try
+		{
+			response.setStatus(500);
+			out.println
+			(
+				"{" +
+				"\"status\": 500" +
+				", \"error\" : \"" + e.toString() + "\"" +
+				"}"
+			);
+		}
+		catch (IOException e1)
+		{
+			// nothing we can do
+		}
+	}
+
+	void xmlescape(String s)
+	{
+		try
+		{
+			XML.escapeCharData(s, out);
+		}
+		catch (IOException e)
+		{
+			throw new RuntimeException(e);
+		}
+	}
+
+    // collapse all whitespace to a single space or escaped newline
+    String compress(String str) {
+      StringBuilder sb = new StringBuilder();
+      for (int i = 0; i < str.length(); i++) {
+        char ch = str.charAt(i);
+        boolean whitespace = false;
+        boolean newline = false;
+        while (Character.isWhitespace(ch)) {
+          whitespace = true;
+          if (ch == '\n')
+            newline = true;
+          if (++i >= str.length())
+            return sb.toString();
+          ch = str.charAt(i);
+        }
+
+        if (newline) {
+          // sb.append("\\n");
+          sb.append("  ");  // collapse newline to two spaces
+        } else if (whitespace) {
+          sb.append(' ');
+        }
+
+        // TODO: handle non-printable chars
+        sb.append(ch);
+
+        if (sb.length() >= maxData)
+          return sb.toString() + " ...";
+      }
+      return sb.toString();
+    }
+
+    void url(String label, String path, boolean detail) throws IOException {
+      try {
+        out.print("<a href=\"zookeeper.jsp?");
+        if (path != null) {
+          out.print("path=");
+          out.print(URLEncoder.encode(path, "UTF-8"));
+        }
+        if (detail) {
+          out.print("&detail=" + detail);
+        }
+        if (fullpath != FULLPATH_DEFAULT) {
+          out.print("&fullpath=" + fullpath);
+        }
+        if (addr != null) {
+          out.print("&addr=");
+          out.print(URLEncoder.encode(addr, "UTF-8"));
+        }
+
+        out.print("\">");
+        xmlescape(label);
+        out.print("</a>");
+
+      } catch (UnsupportedEncodingException e) {
+        exception(e);
+      }
+    }
+
+    void printTree(String path) throws IOException
+    {
+		String label = path;
+		if (!fullpath)
+		{
+			int idx = path.lastIndexOf('/');
+			label = idx > 0 ? path.substring(idx + 1) : path;
+		}
+
+		//url(label, path, true);
+		out.println("{");
+		out.println("\"data\" : \"" + label + "\"");
+
+		Stat stat = new Stat();
+		try
+		{
+			byte[] data = zkClient.getData(path, null, stat);
+
+			if( stat.getEphemeralOwner() != 0 )
+			{
+				out.println(", \"ephemeral\" : true");
+				out.println(", \"version\" : \"" + stat.getVersion() + "\"");
+			}
+			
+			/*
+			if (stat.getNumChildren() != 0)
+			{
+				out.println(", \"children_count\" : \"" + stat.getNumChildren() + "\"");
+			}
+			*/
+
+			//if (data != null)
+			if( stat.getDataLength() != 0 )
+			{
+
+				String str;
+				try
+				{
+					str = new String(data, "UTF-8");
+					str = str.replaceAll("\\\"", "\\\\\"");
+
+					out.print(", \"content\" : \"");
+					//xmlescape(compress(str));
+					out.print(compress(str));
+					out.println("\"");
+				}
+				catch (UnsupportedEncodingException e)
+				{
+					// not UTF8
+					StringBuilder sb = new StringBuilder("BIN(");
+					sb.append("len=" + data.length);
+					sb.append("hex=");
+					int limit = Math.min(data.length, maxData / 2);
+					for (int i = 0; i < limit; i++)
+					{
+						byte b = data[i];
+						sb.append(StrUtils.HEX_DIGITS[(b >> 4) & 0xf]);
+						sb.append(StrUtils.HEX_DIGITS[b & 0xf]);
+					}
+					if (limit != data.length)
+					{
+						sb.append("...");
+					}
+					sb.append(")");
+					str = sb.toString();
+					//out.print(str);
+				}
+			}
+
+		}
+		catch (IllegalArgumentException e)
+		{
+			// path doesn't exist (must have been removed)
+			out.println("(path gone)");
+		}
+		catch (KeeperException e)
+		{
+			e.printStackTrace();
+		}
+		catch (InterruptedException e)
+		{
+			e.printStackTrace();
+		}
+
+		if( stat.getNumChildren() > 0 )
+		{
+			out.print(", \"children\" : [");
+
+			List<String> children = null;
+			try
+			{
+				children = zkClient.getChildren(path, null);
+			}
+			catch (KeeperException e)
+			{
+				exception(e);
+				return;
+			}
+			catch (InterruptedException e)
+			{
+				exception(e);
+			}
+				catch (IllegalArgumentException e)
+			{
+				// path doesn't exist (must have been removed)
+				out.println("(children gone)");
+			}
+
+			Integer i = 0;
+			for( String child : children )
+			{
+				if( 0 != i )
+				{
+					out.print(", ");
+				}
+
+				String childPath = path + (path.endsWith("/") ? "" : "/") + child;
+				printTree( childPath );
+
+				i++;
+			}
+
+			out.println("]");
+		}
+
+		out.println("}");
+    }
+
+    String time(long ms) {
+      return (new Date(ms)).toString() + " (" + ms + ")";
+    }
+
+	void printZnode(String path) throws IOException
+	{
+		try
+		{
+			Stat stat = new Stat();
+			byte[] data = zkClient.getData(path, null, stat);
+
+			out.println("\"znode\" : {");
+
+			out.print("\"path\" : \"");
+			xmlescape(path);
+			out.println("\"");
+
+			out.println(", \"version\" : \"" + stat.getVersion() + "\"");
+			out.println(", \"aversion\" : \"" + stat.getAversion() + "\"");
+			out.println(", \"cversion\" : \"" + stat.getCversion() + "\"");
+			out.println(", \"ctime\" : \"" + time(stat.getCtime()) + "\"");
+			out.println(", \"mtime\" : \"" + time(stat.getMtime()) + "\"");
+			out.println(", \"czxid\" : \"" + stat.getCzxid() + "\"");
+			out.println(", \"mzxid\" : \"" + stat.getMzxid() + "\"");
+			out.println(", \"pzxid\" : \"" + stat.getPzxid() + "\"");
+			out.println(", \"children_count\" : \"" + stat.getNumChildren() + "\"");
+			out.println(", \"ephemeralOwner\" : \"" + stat.getEphemeralOwner() + "\"");
+			out.println(", \"dataLength\" : \"" + stat.getDataLength() + "\"");
+
+			if( stat.getDataLength() != 0 )
+			{
+				boolean isBinary = false;
+				String str;
+				try
+				{
+					str = new String(data, "UTF-8");
+				}
+				catch (UnsupportedEncodingException e)
+				{
+					// The results are unspecified
+					// when the bytes are not properly encoded.
+
+					// not UTF8
+					StringBuilder sb = new StringBuilder(data.length * 2);
+					for (int i = 0; i < data.length; i++)
+					{
+						byte b = data[i];
+						sb.append(StrUtils.HEX_DIGITS[(b >> 4) & 0xf]);
+						sb.append(StrUtils.HEX_DIGITS[b & 0xf]);
+						if ((i & 0x3f) == 0x3f)
+						{
+							sb.append("\n");
+						}
+					}
+					str = sb.toString();
+				}
+				str = str.replaceAll("\\\"", "\\\\\"");
+
+				out.print(", \"data\" : \"");
+				//xmlescape(str);
+				out.print(str);
+				out.println("\"");
+			}
+
+			out.println("}");
+
+		}
+		catch (KeeperException e)
+		{
+			exception(e);
+			return;
+		}
+		catch (InterruptedException e)
+		{
+			exception(e);
+		}
+	}
+
+	}
+
+%>
+
+<%
+
+String path = request.getParameter("path");
+String addr = request.getParameter("addr");
+
+if (addr != null && addr.length() == 0)
+{
+    addr = null;
+}
+
+String detailS = request.getParameter("detail");
+boolean detail = detailS != null && detailS.equals("true");
+
+ZKPrinter printer = new ZKPrinter(response, out, core, addr);
+printer.detail = detail;
+String tryAddr = printer.keeperAddr != null ? printer.keeperAddr : "localhost:2181";
+
+try {
+	printer.print(path);
+} finally {
+	printer.close();
+}
+
+%>
\ No newline at end of file