You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ry...@apache.org on 2007/12/21 23:23:41 UTC

svn commit: r606335 - in /lucene/solr/trunk: client/java/solrj/src/org/apache/solr/client/solrj/ client/java/solrj/src/org/apache/solr/client/solrj/embedded/ client/java/solrj/src/org/apache/solr/client/solrj/impl/ client/java/solrj/src/org/apache/solr...

Author: ryan
Date: Fri Dec 21 14:23:39 2007
New Revision: 606335

URL: http://svn.apache.org/viewvc?rev=606335&view=rev
Log:
SOLR-350 -- dropping 'default' core usage and requiring the core name in the URL.  Also fixes broken admin links (SOLR-441)

Added:
    lucene/solr/trunk/src/webapp/resources/index.jsp
      - copied, changed from r603752, lucene/solr/trunk/src/webapp/resources/index.html
Removed:
    lucene/solr/trunk/src/webapp/resources/index.html
Modified:
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/BaseSolrServer.java
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java
    lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java
    lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java
    lucene/solr/trunk/example/multicore/multicore.xml
    lucene/solr/trunk/src/java/org/apache/solr/common/params/MultiCoreParams.java
    lucene/solr/trunk/src/java/org/apache/solr/core/MultiCore.java
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
    lucene/solr/trunk/src/java/org/apache/solr/handler/admin/MultiCoreHandler.java
    lucene/solr/trunk/src/webapp/resources/admin/_info.jsp
    lucene/solr/trunk/src/webapp/resources/admin/action.jsp
    lucene/solr/trunk/src/webapp/resources/admin/analysis.jsp
    lucene/solr/trunk/src/webapp/resources/admin/distributiondump.jsp
    lucene/solr/trunk/src/webapp/resources/admin/form.jsp
    lucene/solr/trunk/src/webapp/resources/admin/header.jsp
    lucene/solr/trunk/src/webapp/resources/admin/index.jsp
    lucene/solr/trunk/src/webapp/resources/admin/logging.xsl
    lucene/solr/trunk/src/webapp/resources/admin/ping.xsl
    lucene/solr/trunk/src/webapp/resources/admin/registry.xsl
    lucene/solr/trunk/src/webapp/resources/admin/stats.xsl
    lucene/solr/trunk/src/webapp/resources/admin/threaddump.xsl
    lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/SolrServer.java Fri Dec 21 14:23:39 2007
@@ -37,6 +37,9 @@
   // A general method to allow various methods 
   NamedList<Object> request( final SolrRequest request ) throws SolrServerException, IOException;
   
+  void setDefaultCore( String core );
+  String getDefaultCore();
+  
   // Standard methods
   UpdateResponse add( SolrInputDocument doc ) throws SolrServerException, IOException;
   UpdateResponse add( Collection<SolrInputDocument> docs ) throws SolrServerException, IOException;

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java Fri Dec 21 14:23:39 2007
@@ -96,19 +96,29 @@
     SolrCore core = this.core;
     MultiCore multicore = MultiCore.getRegistry();
     if( useMultiCore ) {
+      String c = getDefaultCore();
       if( request.getCore() != null ) {
+        c = request.getCore();
+      }
+      if( c != null ) {
         if( !multicore.isEnabled() ) {
           throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, 
               "multicore access is not enabled" );
         }
-        core = multicore.getCore( request.getCore() );
+        if( c.length() > 0 ) {
+          core = multicore.getCore( c );
+        }
+        else {
+          core = multicore.getDefaultCore();
+        }
         if( core == null ) {
           throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, 
-              "Unknown core: "+request.getCore() );
+              "Unknown core: "+c );
         }
       }
       else {
-        core = multicore.getDefaultCore();
+        throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, 
+            "missing core" );
       }
     }
 

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/BaseSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/BaseSolrServer.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/BaseSolrServer.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/BaseSolrServer.java Fri Dec 21 14:23:39 2007
@@ -37,7 +37,9 @@
  * @version $Id$
  * @since solr 1.3
  */
-public abstract class BaseSolrServer implements SolrServer {
+public abstract class BaseSolrServer implements SolrServer 
+{
+  protected String defaultCore = null;
   
   public UpdateResponse add(Collection<SolrInputDocument> docs, boolean overwrite ) throws SolrServerException, IOException {
     UpdateRequest req = new UpdateRequest();
@@ -97,5 +99,13 @@
 
   public QueryResponse query(SolrParams params) throws SolrServerException {
     return new QueryRequest( params ).process( this );
+  }
+
+  public String getDefaultCore() {
+    return defaultCore;
+  }
+
+  public void setDefaultCore(String defaultCore) {
+    this.defaultCore = defaultCore;
   }
 }

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.java Fri Dec 21 14:23:39 2007
@@ -121,8 +121,12 @@
     }
     
     // modify the path for multicore access
+    String core = getDefaultCore();
     if( request.getCore() != null ) {
-      path = "/@"+request.getCore()+path;
+      core= request.getCore();
+    }
+    if( core != null && core.length() > 0 ) {
+      path = "/"+core+path;
     }
     
     if( params == null ) {

Modified: lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java (original)
+++ lucene/solr/trunk/client/java/solrj/src/org/apache/solr/client/solrj/request/MultiCoreRequest.java Fri Dec 21 14:23:39 2007
@@ -49,11 +49,21 @@
     super( METHOD.GET, path );
   }
 
+  public final void setCoreParam( String v )
+  {
+    this.core = v;
+  }
+
   @Override
   public final void setCore( String v )
   {
-    this.core = v;
-    // this does not change the path!
+    throw new UnsupportedOperationException( "MultiCoreRequest does not use a core.");
+  }
+  
+  @Override
+  public final String getCore()
+  {
+    return ""; // force it to invalid core
   }
   
   //---------------------------------------------------------------------------------------
@@ -100,18 +110,10 @@
   //
   //---------------------------------------------------------------------------------------
 
-  public static MultiCoreResponse setDefault( String name, SolrServer server ) throws SolrServerException, IOException
-  {
-    MultiCoreRequest req = new MultiCoreRequest();
-    req.setCore( name );
-    req.setAction( MultiCoreAction.SETASDEFAULT );
-    return req.process( server );
-  }
-
   public static MultiCoreResponse reloadCore( String name, SolrServer server ) throws SolrServerException, IOException
   {
     MultiCoreRequest req = new MultiCoreRequest();
-    req.setCore( name );
+    req.setCoreParam( name );
     req.setAction( MultiCoreAction.RELOAD );
     return req.process( server );
   }
@@ -119,8 +121,8 @@
   public static MultiCoreResponse getStatus( String name, SolrServer server ) throws SolrServerException, IOException
   {
     MultiCoreRequest req = new MultiCoreRequest();
+    req.setCoreParam( name );
     req.setAction( MultiCoreAction.STATUS );
-    req.setCore( name );
     return req.process( server );
   }
 }

Modified: lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java (original)
+++ lucene/solr/trunk/client/java/solrj/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java Fri Dec 21 14:23:39 2007
@@ -17,16 +17,12 @@
 
 package org.apache.solr.client.solrj;
 
-import org.apache.solr.client.solrj.request.LukeRequest;
 import org.apache.solr.client.solrj.request.MultiCoreRequest;
 import org.apache.solr.client.solrj.request.QueryRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest.ACTION;
-import org.apache.solr.client.solrj.response.LukeResponse;
 import org.apache.solr.client.solrj.response.MultiCoreResponse;
 import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.util.NamedList;
 
 
 /**
@@ -44,9 +40,6 @@
   public void testMultiCore() throws Exception
   {
     SolrServer solr = getSolrServer();
-
-    MultiCoreRequest.setDefault( "core1", solr );
-    MultiCoreRequest.setDefault( "core0", solr );
     
     UpdateRequest up = new UpdateRequest();
     up.setAction( ACTION.COMMIT, true, true );
@@ -101,9 +94,11 @@
     assertEquals( 0, r.process( solr ).getResults().size() );
     
     // Now test Changing the default core
+    solr.setDefaultCore( "core0" );
     assertEquals( 1, solr.query( new SolrQuery( "id:AAA" ) ).getResults().size() );
     assertEquals( 0, solr.query( new SolrQuery( "id:BBB" ) ).getResults().size() );
-    MultiCoreRequest.setDefault( "core1", solr );
+
+    solr.setDefaultCore( "core1" );
     assertEquals( 0, solr.query( new SolrQuery( "id:AAA" ) ).getResults().size() );
     assertEquals( 1, solr.query( new SolrQuery( "id:BBB" ) ).getResults().size() );
   

Modified: lucene/solr/trunk/example/multicore/multicore.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/example/multicore/multicore.xml?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/example/multicore/multicore.xml (original)
+++ lucene/solr/trunk/example/multicore/multicore.xml Fri Dec 21 14:23:39 2007
@@ -27,6 +27,6 @@
   sharedLib: path to a lib files that will be shared across all cores
 -->
 <multicore adminPath="/admin/multicore" persistent="true" >
- <core name="core0" instanceDir="core0" default="true"/>
- <core name="core1" instanceDir="core1" />
+  <core name="core0" instanceDir="core0" default="true"/>
+  <core name="core1" instanceDir="core1" />
 </multicore>

Modified: lucene/solr/trunk/src/java/org/apache/solr/common/params/MultiCoreParams.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/common/params/MultiCoreParams.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/common/params/MultiCoreParams.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/common/params/MultiCoreParams.java Fri Dec 21 14:23:39 2007
@@ -28,6 +28,9 @@
 
   /** Persistent -- should it save the multicore state? **/
   public final static String PERSISTENT = "persistent";
+
+  /** The name of the the core to swap names with **/
+  public final static String WITH = "with";
   
   /** What action **/
   public final static String ACTION = "action";
@@ -37,7 +40,7 @@
     LOAD,
     UNLOAD,
     RELOAD,
-    SETASDEFAULT;
+    SWAP;
     
     public static MultiCoreAction get( String p )
     {

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/MultiCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/MultiCore.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/MultiCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/MultiCore.java Fri Dec 21 14:23:39 2007
@@ -20,7 +20,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -125,7 +124,7 @@
                 "multicore.xml defines multiple default cores. "+
                 getDefaultCore().getName() + " and " + core.getName() );
           }
-          this.setDefaultCore( core );
+          defaultCore = core;
           hasDefault = true;
         }
       } 
@@ -171,9 +170,13 @@
       throw new RuntimeException( "Can not register a null core." );
     }
     String name = core.getName();
-    if( name == null || name.length() == 0 ) {
-      throw new RuntimeException( "Invalid core name." );
+    if( name == null || 
+        name.length() < 1 ||
+        name.indexOf( '/'  ) >= 0 ||
+        name.indexOf( '\\' ) >= 0 ){
+      throw new RuntimeException( "Invalid core name: "+name );
     }
+    
     SolrCore old = cores.put(name, core);
     if( old == null ) {
       log.info( "registering core: "+name );
@@ -183,6 +186,21 @@
     return old;
   }
 
+  public void swap(SolrCore c0, SolrCore c1) {
+    if( c0 == null || c1 == null ) {
+      throw new RuntimeException( "Can not swap a null core." );
+    }
+    synchronized( cores ) {
+      String n0 = c0.getName();
+      String n1 = c1.getName();
+      cores.put(n0, c1);
+      cores.put(n1, c0);
+      c0.setName( n1 );
+      c1.setName( n0 );
+    }
+    log.info( "swaped: "+c0.getName() + " with " + c1.getName() );
+  }
+
   /**
    * While the new core is loading, requests will continue to be dispatched to
    * and processed by the old core
@@ -194,28 +212,21 @@
    */
   public void reload(SolrCore core) throws ParserConfigurationException, IOException, SAXException 
   {
-    boolean wasDefault = (core==defaultCore);
-    
     SolrResourceLoader loader = new SolrResourceLoader( core.getResourceLoader().getInstanceDir() );
     SolrConfig config = new SolrConfig( loader, core.getConfigFile(), null );
     IndexSchema schema = new IndexSchema( config, core.getSchemaFile() );
     SolrCore loaded = new SolrCore( core.getName(), core.getDataDir(), config, schema );
     this.register( loaded );
-    if( wasDefault ) {
-      this.setDefaultCore( loaded );
-    }
     
     // TODO? -- add some kind of hook to close the core after all references are 
     // gone...  is finalize() enough?
   }
-  
-  public void setDefaultCore( SolrCore core )
+
+  public void remove( String name ) 
   {
-    defaultCore = core;
-    cores.put( null, core );
-    cores.put( "", core );
+    cores.remove( name );
   }
-  
+    
   public SolrCore getDefaultCore() {
     return defaultCore;
   }
@@ -224,13 +235,7 @@
    * @return a Collection of registered SolrCores
    */
   public Collection<SolrCore> getCores() {
-    ArrayList<SolrCore> c = new ArrayList<SolrCore>(cores.size());
-    for( Map.Entry<String, SolrCore> entry : cores.entrySet() ) {
-      if( entry.getKey() != null && entry.getKey().length() > 0 ) {
-        c.add( entry.getValue() );
-      }
-    }
-    return c;
+    return cores.values();
   }
   
   public SolrCore getCore(String name) {
@@ -268,5 +273,4 @@
   public File getConfigFile() {
     return configFile;
   }
-
 }

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Fri Dec 21 14:23:39 2007
@@ -83,7 +83,7 @@
 
   public static Logger log = Logger.getLogger(SolrCore.class.getName());
 
-  private final String name;
+  private String name;
   private final SolrConfig solrConfig;
   private final IndexSchema schema;
   private final String dataDir;
@@ -135,6 +135,10 @@
   
   public String getName() {
     return name;
+  }
+
+  public void setName(String v) {
+    this.name = v;
   }
   
   /**

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/admin/MultiCoreHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/admin/MultiCoreHandler.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/admin/MultiCoreHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/admin/MultiCoreHandler.java Fri Dec 21 14:23:39 2007
@@ -67,6 +67,7 @@
     
     // Pick the action
     SolrParams params = req.getParams();
+    SolrParams required = params.required();
     MultiCoreAction action = MultiCoreAction.STATUS;
     String a = params.get( MultiCoreParams.ACTION );
     if( a != null ) {
@@ -109,13 +110,20 @@
     }
     else {
       switch( action ) {
-      case SETASDEFAULT:
-        manager.setDefaultCore( core );
-        rsp.add( "default", core.getName() );
-        break;
-        
+      
       case RELOAD: {
         manager.reload( core );
+        break;
+      } 
+
+      case SWAP: {
+        String name = required.get( MultiCoreParams.WITH );
+        SolrCore swap = manager.getCore( name );
+        if( swap == null ) {
+          throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
+              "Unknown core: "+name );
+        }
+        manager.swap( core, swap );
         break;
       } 
         

Modified: lucene/solr/trunk/src/webapp/resources/admin/_info.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/_info.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/_info.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/_info.jsp Fri Dec 21 14:23:39 2007
@@ -28,10 +28,6 @@
 <%
   // 
   SolrCore  core = (SolrCore) request.getAttribute("org.apache.solr.SolrCore");
-  if (core == null) {
-    String coreParam = request.getParameter("core");
-    core = coreParam != null? org.apache.solr.core.MultiCore.getRegistry().getCore(coreParam) : null;
-  }
   if (core == null)
     core = SolrCore.getSolrCore();
     

Modified: lucene/solr/trunk/src/webapp/resources/admin/action.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/action.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/action.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/action.jsp Fri Dec 21 14:23:39 2007
@@ -111,6 +111,6 @@
   </tr>
 </table>
 <br><br>
-    <a href=".?core=<%=core.getName()%>">Return to Admin Page</a>
+    <a href=".">Return to Admin Page</a>
 </body>
 </html>

Modified: lucene/solr/trunk/src/webapp/resources/admin/analysis.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/analysis.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/analysis.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/analysis.jsp Fri Dec 21 14:23:39 2007
@@ -60,7 +60,6 @@
 <h2>Field Analysis</h2>
 
 <form method="GET" action="analysis.jsp">
-<input type='hidden' name='core' value='<%=core.getName()%>'>
 <table>
 <tr>
   <td>

Modified: lucene/solr/trunk/src/webapp/resources/admin/distributiondump.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/distributiondump.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/distributiondump.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/distributiondump.jsp Fri Dec 21 14:23:39 2007
@@ -153,6 +153,6 @@
 <%= buffer %>
 </table>
 <br><br>
-    <a href=".?<%=core.getName()%>">Return to Admin Page</a>
+    <a href=".">Return to Admin Page</a>
 </body>
 </html>

Modified: lucene/solr/trunk/src/webapp/resources/admin/form.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/form.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/form.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/form.jsp Fri Dec 21 14:23:39 2007
@@ -19,7 +19,6 @@
 
 <br clear="all">
 <form name="queryForm" method="GET" action="../select">
-<input name='core' type='hidden' value='<%=core.getName()%>'>
 <!-- these are good defaults to have if people bookmark the resulting
      URLs, but they should not show up in the form since they are very
      output type specific.

Modified: lucene/solr/trunk/src/webapp/resources/admin/header.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/header.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/header.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/header.jsp Fri Dec 21 14:23:39 2007
@@ -29,7 +29,7 @@
 </head>
 
 <body>
-<a href="?core=<%=core.getName()%>"><img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="Solr"></a>
+<a href="."><img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="Solr"></a>
 <h1>Solr Admin (<%= collectionName %>)
 <%= enabledStatus==null ? "" : (isEnabled ? " - Enabled" : " - Disabled") %> </h1>
 

Modified: lucene/solr/trunk/src/webapp/resources/admin/index.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/index.jsp?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/index.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/index.jsp Fri Dec 21 14:23:39 2007
@@ -34,15 +34,15 @@
 	<h3>Solr</h3>
   </td>
   <td>
-    [<a href="get-file.jsp?core=<%=core.getName()%>&file=<%=core.getSchemaFile()%>">Schema</a>]
-    [<a href="get-file.jsp?core=<%=core.getName()%>&file=<%=core.getConfigFile()%>">Config</a>]
-    [<a href="analysis.jsp?core=<%=core.getName()%>&highlight=on">Analysis</a>]
+    [<a href="get-file.jsp?file=<%=core.getSchemaFile()%>">Schema</a>]
+    [<a href="get-file.jsp?file=<%=core.getConfigFile()%>">Config</a>]
+    [<a href="analysis.jsp?highlight=on">Analysis</a>]
     <br>
-    [<a href="stats.jsp?core=<%=core.getName()%>">Statistics</a>]
-    [<a href="registry.jsp?core=<%=core.getName()%>">Info</a>]
-    [<a href="distributiondump.jsp?core=<%=core.getName()%>">Distribution</a>]
-    [<a href="ping?core=<%=core.getName()%>">Ping</a>]
-    [<a href="logging.jsp?core=<%=core.getName()%>">Logging</a>]
+    [<a href="stats.jsp">Statistics</a>]
+    [<a href="registry.jsp">Info</a>]
+    [<a href="distributiondump.jsp">Distribution</a>]
+    [<a href="ping">Ping</a>]
+    [<a href="logging.jsp">Logging</a>]
   </td>
 </tr>
 
@@ -53,7 +53,7 @@
   while (icore.hasNext()) {
     SolrCore acore = icore.next();
     if (acore == core) continue;
-    %>[<a href=".?core=<%=acore.getName()%>"><%=acore.getName()%></a>]<%         
+    %>[<a href="../../<%=acore.getName()%>/admin/"><%=acore.getName()%></a>]<%         
   }%></td></tr><%
 }%>
 
@@ -62,17 +62,17 @@
     <strong>App server:</strong><br>
   </td>
   <td>
-    [<a href="get-properties.jsp?core=<%=core.getName()%>">Java Properties</a>]
-    [<a href="threaddump.jsp?core=<%=core.getName()%>">Thread Dump</a>]
+    [<a href="get-properties.jsp">Java Properties</a>]
+    [<a href="threaddump.jsp">Thread Dump</a>]
   <%
     if (enabledFile!=null)
     if (isEnabled) {
   %>
-  [<a href="action.jsp?core=<%=core.getName()%>&action=Disable">Disable</a>]
+  [<a href="action.jsp?action=Disable">Disable</a>]
   <%
     } else {
   %>
-  [<a href="action.jsp?core=<%=core.getName()%>&action=Enable">Enable</a>]
+  [<a href="action.jsp?action=Enable">Enable</a>]
   <%
     }
   %>
@@ -80,7 +80,7 @@
 </tr>
 
 
-<jsp:include page="get-file.jsp?core=<%=core.getName()%>&file=admin-extra.html&optional=y" flush="true"/>
+<jsp:include page="get-file.jsp?file=admin-extra.html&optional=y" flush="true"/>
 
 </table><P>
 
@@ -91,7 +91,7 @@
 	<h3>Make a Query</h3>
   </td>
   <td>
-[<a href="form.jsp?core=<%=core.getName()%>">Full Interface</a>]
+[<a href="form.jsp">Full Interface</a>]
   </td>
   
 </tr>
@@ -102,7 +102,6 @@
   <td colspan=2>
 	<form name=queryForm method="GET" action="../select/">
         <textarea class="std" rows="4" cols="40" name="q"><%= defaultSearch %></textarea>
-        <input name="core" type="hidden" value="<%=core.getName()%>">
         <input name="version" type="hidden" value="2.2">
 	<input name="start" type="hidden" value="0">
 	<input name="rows" type="hidden" value="10">

Modified: lucene/solr/trunk/src/webapp/resources/admin/logging.xsl
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/logging.xsl?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/logging.xsl (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/logging.xsl Fri Dec 21 14:23:39 2007
@@ -1,119 +1,89 @@
-<?xml version="1.0" encoding="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.
--->
-<!-- $Id$ -->
-<!-- $URL$ -->
-
-<xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  version="1.0">
-
-  <xsl:output
-    method="html"
-    indent="yes"
-    doctype-public="-//W3C//DTD HTML 4.01//EN"
-    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
-
-  <xsl:template match="/">
-    <html>
-      <head>
-        <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
-	<link rel="icon" href="/favicon.ico" type="image/ico"></link>
-	<link rel="shortcut icon" href="/favicon.ico" type="image/ico"></link>
-        <title>Solr Admin: Logging</title>
-      </head>
-      <body>
-        <a href="">
-	   <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR">
-	   </img>
-	</a>
-        <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
-        <div style="margin-top: 1em;">
-          <xsl:apply-templates/>
-        <div>
-        </div>
-          <xsl:element name='a'>
-            <xsl:attribute name='href'>.?core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-            <xsl:text>Return to Admin Page</xsl:text>
-          </xsl:element>
-        </div>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:include href="meta.xsl"/>
-
-  <xsl:template match="solr/logging">
-
-<br clear="all"/>
-<h2>Solr Logging</h2>
-<table>
-  <tr>
-    <td>
-      <H3>Log Level:</H3>
-    </td>
-    <td>
-<xsl:value-of select="logLevel" />
-    </td>
-  </tr>
-  <tr>
-    <td>
-    Set Level
-    </td>
-    <td>
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=ALL&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>ALL</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=CONFIG&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>CONFIG</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=FINE&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>FINE</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=FINER&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>FINER</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=FINEST&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>FINEST</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=INFO&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>INFO</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=OFF&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>OFF</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=SEVERE&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>SEVERE</xsl:text>
-    </xsl:element>]
-    [<xsl:element name='a'>
-    <xsl:attribute name='href'>action.jsp?log=WARNING&amp;core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-      <xsl:text>WARNING</xsl:text>
-    </xsl:element>]
-    </td>
-  </tr>
-</table>
-
-  </xsl:template>
-</xsl:stylesheet>
+<?xml version="1.0" encoding="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.
+-->
+<!-- $Id$ -->
+<!-- $URL$ -->
+
+<xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0">
+
+  <xsl:output
+    method="html"
+    indent="yes"
+    doctype-public="-//W3C//DTD HTML 4.01//EN"
+    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
+
+  <xsl:template match="/">
+    <html>
+      <head>
+        <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
+	<link rel="icon" href="/favicon.ico" type="image/ico"></link>
+	<link rel="shortcut icon" href="/favicon.ico" type="image/ico"></link>
+        <title>Solr Admin: Logging</title>
+      </head>
+      <body>
+        <a href="">
+	   <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR">
+	   </img>
+	</a>
+        <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
+        <div style="margin-top: 1em;">
+          <xsl:apply-templates/>
+        <div>
+        </div>
+          <a href=".">Return to Admin Page</a>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:include href="meta.xsl"/>
+
+  <xsl:template match="solr/logging">
+
+<br clear="all"/>
+<h2>Solr Logging</h2>
+<table>
+  <tr>
+    <td>
+      <H3>Log Level:</H3>
+    </td>
+    <td>
+<xsl:value-of select="logLevel" />
+    </td>
+  </tr>
+  <tr>
+    <td>
+    Set Level
+    </td>
+    <td>
+    [<a href="action.jsp?log=ALL">ALL</a>]
+    [<a href="action.jsp?log=CONFIG">CONFIG</a>]
+    [<a href="action.jsp?log=FINE">FINE</a>]
+    [<a href="action.jsp?log=FINER">FINER</a>]
+    [<a href="action.jsp?log=FINEST">FINEST</a>]
+    [<a href="action.jsp?log=INFO">INFO</a>]
+    [<a href="action.jsp?log=OFF">OFF</a>]
+    [<a href="action.jsp?log=SEVERE">SEVERE</a>]
+    [<a href="action.jsp?log=WARNING">WARNING</a>]
+    </td>
+  </tr>
+</table>
+
+  </xsl:template>
+</xsl:stylesheet>

Modified: lucene/solr/trunk/src/webapp/resources/admin/ping.xsl
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/ping.xsl?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/ping.xsl (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/ping.xsl Fri Dec 21 14:23:39 2007
@@ -1,72 +1,69 @@
-<?xml version="1.0" encoding="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.
--->
-<!-- $Id$ -->
-<!-- $URL$ -->
-
-<xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  version="1.0">
-
-  <xsl:output
-    method="html"
-    indent="yes"
-    doctype-public="-//W3C//DTD HTML 4.01//EN"
-    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
-
-  <xsl:template match="/">
-    <html>
-      <head>
-        <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
-	<link rel="icon" href="/favicon.ico" type="image/ico"></link>
-	<link rel="shortcut icon" href="/favicon.ico" type="image/ico"></link>
-        <title>Solr Admin: Ping</title>
-      </head>
-      <body>
-        <a href="">
-	   <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR">
-	   </img>
-	</a>
-        <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
-        <div style="margin-top: 1em;">
-          <xsl:apply-templates/>
-        <div>
-        </div>
-          <xsl:element name='a'>
-            <xsl:attribute name='href'>.?core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-            <xsl:text>Return to Admin Page (ping)</xsl:text>
-          </xsl:element>
-        </div>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:include href="meta.xsl"/>
-
-  <xsl:template match="solr/ping">
-  <table>
-    <tr>
-      <td>
-        <H3>Ping</H3>
-      </td>
-      <td>
-        <xsl:value-of select="error" />
-      </td>
-    </tr>
-  </table>
-  </xsl:template>
-</xsl:stylesheet>
+<?xml version="1.0" encoding="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.
+-->
+<!-- $Id$ -->
+<!-- $URL$ -->
+
+<xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0">
+
+  <xsl:output
+    method="html"
+    indent="yes"
+    doctype-public="-//W3C//DTD HTML 4.01//EN"
+    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
+
+  <xsl:template match="/">
+    <html>
+      <head>
+        <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
+	<link rel="icon" href="/favicon.ico" type="image/ico"></link>
+	<link rel="shortcut icon" href="/favicon.ico" type="image/ico"></link>
+        <title>Solr Admin: Ping</title>
+      </head>
+      <body>
+        <a href="">
+	   <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR">
+	   </img>
+	</a>
+        <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
+        <div style="margin-top: 1em;">
+          <xsl:apply-templates/>
+        <div>
+        </div>
+          <a href=".">Return to Admin Page</a>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:include href="meta.xsl"/>
+
+  <xsl:template match="solr/ping">
+  <table>
+    <tr>
+      <td>
+        <H3>Ping</H3>
+      </td>
+      <td>
+        <xsl:value-of select="error" />
+      </td>
+    </tr>
+  </table>
+  </xsl:template>
+</xsl:stylesheet>

Modified: lucene/solr/trunk/src/webapp/resources/admin/registry.xsl
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/registry.xsl?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/registry.xsl (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/registry.xsl Fri Dec 21 14:23:39 2007
@@ -48,10 +48,7 @@
           <br clear="all" />
         <xsl:apply-templates/>
         <br /><br />
-        <xsl:element name='a'>
-          <xsl:attribute name='href'>.?core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-          <xsl:text>Return to Admin Page</xsl:text>
-        </xsl:element>
+        <a href="">Return to Admin Page</a>
       </body>
     </html>
   </xsl:template>

Modified: lucene/solr/trunk/src/webapp/resources/admin/stats.xsl
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/stats.xsl?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/stats.xsl (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/stats.xsl Fri Dec 21 14:23:39 2007
@@ -48,10 +48,7 @@
           <br clear="all" />
         <xsl:apply-templates/>
         <br /><br />
-          <xsl:element name='a'>
-            <xsl:attribute name='href'>.?core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-            <xsl:text>Return to Admin Page</xsl:text>
-          </xsl:element>
+        <a href=".">Return to Admin Page</a>
       </body>
     </html>
   </xsl:template>

Modified: lucene/solr/trunk/src/webapp/resources/admin/threaddump.xsl
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/threaddump.xsl?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/threaddump.xsl (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/threaddump.xsl Fri Dec 21 14:23:39 2007
@@ -1,104 +1,101 @@
-<?xml version="1.0" encoding="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.
--->
-<!-- $Id$ -->
-<!-- $URL$ -->
-
-<xsl:stylesheet
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  version="1.0">
-
-  <xsl:output
-    method="html"
-    indent="yes"
-    doctype-public="-//W3C//DTD HTML 4.01//EN"
-    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
-
-  <xsl:template match="/">
-    <html>
-      <head>
-        <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
-        <link rel="icon" href="/favicon.ico" type="image/ico"></link>
-        <link rel="shortcut icon" href="/favicon.ico" type="image/ico"></link>
-        <title>SOLR Info</title>
-      </head>
-      <body>
-        <a href="">
-          <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR"/>
-        </a>
-        <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
-        <h2>Thread Dump</h2>
-        <div style="margin-top: 1em;">
-          <table>
-            <xsl:apply-templates/>
-          </table>
-          <xsl:element name='a'>
-            <xsl:attribute name='href'>.?core=<xsl:value-of select="//solr/core"/></xsl:attribute>
-            <xsl:text>Return to Admin Page</xsl:text>
-          </xsl:element>
-        </div>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:include href="meta.xsl"/>
-
-  <xsl:template match="solr/system/jvm">
-    <tr>
-      <td><xsl:value-of select="name"/> <xsl:value-of select="version"/></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="solr/system/threadCount">
-    <tr>
-      <td>
-        Thread Count:
-        current=<xsl:value-of select="current"/>,
-        peak=<xsl:value-of select="peak"/>,
-        daemon=<xsl:value-of select="daemon"/></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="solr/system/threadDump">
-    <div>Full Thread Dump:</div>
-    <xsl:for-each select="thread">
-      <!-- OG: TODO: add suspended/native conditionals -->
-      <tr>
-        <td style="margin-left: 1em; font-weight: bold;">
-          '<xsl:value-of select="name"/>' 
-          Id=<xsl:value-of select="id"/>, 
-          <xsl:value-of select="state"/> 
-          on lock=<xsl:value-of select="lock"/>, 
-          total cpu time=<xsl:value-of select="cpuTime"/> 
-          user time=<xsl:value-of select="userTime"/>
-        </td>
-      </tr>
-      <xsl:apply-templates select="stackTrace"/>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="stackTrace">
-    <tr>
-      <td style="margin-left: 1em;">
-        <xsl:for-each select="line">
-          <xsl:value-of select="."/><br/>
-        </xsl:for-each>
-      </td>
-    </tr>
-  </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="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.
+-->
+<!-- $Id$ -->
+<!-- $URL$ -->
+
+<xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0">
+
+  <xsl:output
+    method="html"
+    indent="yes"
+    doctype-public="-//W3C//DTD HTML 4.01//EN"
+    doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
+
+  <xsl:template match="/">
+    <html>
+      <head>
+        <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
+        <link rel="icon" href="/favicon.ico" type="image/ico"></link>
+        <link rel="shortcut icon" href="/favicon.ico" type="image/ico"></link>
+        <title>SOLR Info</title>
+      </head>
+      <body>
+        <a href="">
+          <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR"/>
+        </a>
+        <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
+        <h2>Thread Dump</h2>
+        <div style="margin-top: 1em;">
+          <table>
+            <xsl:apply-templates/>
+          </table>
+          <a href=".">Return to Admin Page</a>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:include href="meta.xsl"/>
+
+  <xsl:template match="solr/system/jvm">
+    <tr>
+      <td><xsl:value-of select="name"/> <xsl:value-of select="version"/></td>
+    </tr>
+  </xsl:template>
+
+  <xsl:template match="solr/system/threadCount">
+    <tr>
+      <td>
+        Thread Count:
+        current=<xsl:value-of select="current"/>,
+        peak=<xsl:value-of select="peak"/>,
+        daemon=<xsl:value-of select="daemon"/></td>
+    </tr>
+  </xsl:template>
+
+  <xsl:template match="solr/system/threadDump">
+    <div>Full Thread Dump:</div>
+    <xsl:for-each select="thread">
+      <!-- OG: TODO: add suspended/native conditionals -->
+      <tr>
+        <td style="margin-left: 1em; font-weight: bold;">
+          '<xsl:value-of select="name"/>' 
+          Id=<xsl:value-of select="id"/>, 
+          <xsl:value-of select="state"/> 
+          on lock=<xsl:value-of select="lock"/>, 
+          total cpu time=<xsl:value-of select="cpuTime"/> 
+          user time=<xsl:value-of select="userTime"/>
+        </td>
+      </tr>
+      <xsl:apply-templates select="stackTrace"/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="stackTrace">
+    <tr>
+      <td style="margin-left: 1em;">
+        <xsl:for-each select="line">
+          <xsl:value-of select="."/><br/>
+        </xsl:for-each>
+      </td>
+    </tr>
+  </xsl:template>
+
+</xsl:stylesheet>

Copied: lucene/solr/trunk/src/webapp/resources/index.jsp (from r603752, lucene/solr/trunk/src/webapp/resources/index.html)
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/index.jsp?p2=lucene/solr/trunk/src/webapp/resources/index.jsp&p1=lucene/solr/trunk/src/webapp/resources/index.html&r1=603752&r2=606335&rev=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/index.html (original)
+++ lucene/solr/trunk/src/webapp/resources/index.jsp Fri Dec 21 14:23:39 2007
@@ -1,4 +1,4 @@
-<!--
+<%--
  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.
@@ -13,7 +13,8 @@
  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.
--->
+--%>
+
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="solr-admin.css">
@@ -25,6 +26,15 @@
 <body>
 <h1>Welcome to Solr!</h1>
 <a href="."><img border="0" align="right" height="61" width="142" src="admin/solr-head.gif" alt="Solr"/></a>
+
+<% 
+  org.apache.solr.core.MultiCore multicore = org.apache.solr.core.MultiCore.getRegistry();
+  if( multicore.isEnabled() ) { 
+    for( org.apache.solr.core.SolrCore core : multicore.getCores() ) {%>
+<a href="<%= core.getName() %>/admin/">Admin <%= core.getName() %> </a><br/>
+<% }} else { %>
 <a href="admin/">Solr Admin</a>
+<% } %>
+
 </body>
 </html>

Modified: lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java?rev=606335&r1=606334&r2=606335&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java Fri Dec 21 14:23:39 2007
@@ -76,13 +76,9 @@
       log.info( "looking for multicore.xml: "+multiconfig.getAbsolutePath() );
       if( multiconfig.exists() ) {
         multicore.load( instanceDir, multiconfig );
+        core = multicore.getDefaultCore();
       }
       if( multicore.isEnabled() ) {
-        core = multicore.getDefaultCore();
-        if( core == null ) {
-          throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-              "Multicore configuration does not include a default" );
-        }
         singlecore = null;
       }
       else {
@@ -93,22 +89,22 @@
       log.info("user.dir=" + System.getProperty("user.dir"));
       
       // Read global configuration
-      // Only the first registerd core configures the following attributes 
-      Config solrConfig = core.getSolrConfig();
+      // Only the first registered core configures the following attributes 
+      Config globalConfig = core.getSolrConfig();
 
-      long uploadLimitKB = solrConfig.getInt( 
+      long uploadLimitKB = globalConfig.getInt( 
           "requestDispatcher/requestParsers/@multipartUploadLimitInKB", 2000 ); // 2MB default
       
-      boolean enableRemoteStreams = solrConfig.getBool( 
+      boolean enableRemoteStreams = globalConfig.getBool( 
           "requestDispatcher/requestParsers/@enableRemoteStreaming", false ); 
 
       parsers = new SolrRequestParsers( enableRemoteStreams, uploadLimitKB );
       
       // Let this filter take care of /select?xxx format
-      this.handleSelect = solrConfig.getBool( "requestDispatcher/@handleSelect", false ); 
+      this.handleSelect = globalConfig.getBool( "requestDispatcher/@handleSelect", false ); 
       
       // should it keep going if we hit an error?
-      abortOnConfigurationError = solrConfig.getBool("abortOnConfigurationError",true);
+      abortOnConfigurationError = globalConfig.getBool("abortOnConfigurationError",true);
     }
     catch( Throwable t ) {
       // catch this so our filter still works
@@ -125,7 +121,12 @@
       out.println( "Check your log files for more detailed information on what may be wrong.\n" );
       out.println( "If you want solr to continue after configuration errors, change: \n");
       out.println( " <abortOnConfigurationError>false</abortOnConfigurationError>\n" );
-      out.println( "in solrconfig.xml\n" );
+      if( multicore.isEnabled() ) {
+        out.println( "in multicore.xml\n" );
+      } 
+      else {
+        out.println( "in solrconfig.xml\n" );
+      }
       
       for( Throwable t : SolrConfig.severeErrors ) {
         out.println( "-------------------------------------------------------------" );
@@ -179,54 +180,51 @@
         }
         
         // By default use the single core.  If multicore is enabled, look for one.
+        SolrRequestHandler handler = null;
         SolrCore core = singlecore;
         if( core == null ) {
-          // try to get the corename as a request parameter first
-          String corename = null;
-          if( path.startsWith( "/@" ) ) { // multicore
-            idx = path.indexOf( '/', 2 );
-            if( idx < 1 ) {
-              throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, 
-                  "MultiCore path must contain a '/'.  For example: /@corename/handlerpath" );
-            }
-            corename = path.substring( 2, idx );
-            path = path.substring( idx );
-            
-            core = multicore.getCore( corename );
-            if( core == null ) {
-              throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, 
-                "Can not find core: '"+corename+"'" );
-            }
+          // Perhaps this is a muli-core admin page?
+          if( path.equals( multicore.getAdminPath() ) ) {
+            handler = multicore.getMultiCoreHandler();
           }
           else {
-            core = multicore.getDefaultCore();
+            idx = path.indexOf( "/", 1 );
+            if( idx > 1 ) {
+              // try to get the corename as a request parameter first
+              String corename = path.substring( 1, idx );
+              path = path.substring( idx );
+              core = multicore.getCore( corename );
+              // invalid core name is ok.  It could fall through to some other request
+            }
           }
         }
         
-        SolrRequestHandler handler = null;
-        if( path.length() > 1 ) { // don't match "" or "/" as valid path
-          handler = core.getRequestHandler( path );
-        }
-        if( handler == null && handleSelect ) {
-          if( "/select".equals( path ) || "/select/".equals( path ) ) {
-            solrReq = parsers.parse( core, path, req );
-            String qt = solrReq.getParams().get( CommonParams.QT );
-            if( qt != null && qt.startsWith( "/" ) ) {
-              throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Invalid query type.  Do not use /select to access: "+qt);
-            }
-            handler = core.getRequestHandler( qt );
-            if( handler == null ) {
-              throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "unknown handler: "+qt);
+        if( core != null ) {
+          // Only try to parse the handler *if* a valid core exists
+          // when multi-core is enabled, the path can lead to a null core.
+          if( handler == null && path.length() > 1 ) { // don't match "" or "/" as valid path
+            handler = core.getRequestHandler( path );
+          }
+          if( handler == null && handleSelect ) {
+            if( "/select".equals( path ) || "/select/".equals( path ) ) {
+              solrReq = parsers.parse( core, path, req );
+              String qt = solrReq.getParams().get( CommonParams.QT );
+              if( qt != null && qt.startsWith( "/" ) ) {
+                throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Invalid query type.  Do not use /select to access: "+qt);
+              }
+              handler = core.getRequestHandler( qt );
+              if( handler == null ) {
+                throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "unknown handler: "+qt);
+              }
             }
           }
         }
-
-        // Perhaps this is a muli-core admin page?
-        if( handler == null && path.equals( multicore.getAdminPath() ) ) {
-          handler = multicore.getMultiCoreHandler();
-        } 
         
         if( handler != null ) {
+          if( core == null ) {
+            core = multicore.getDefaultCore();
+          }
+          
           if( solrReq == null ) {
             solrReq = parsers.parse( core, path, req );
           }
@@ -245,21 +243,15 @@
           return;
         }
         // otherwise, let's ensure the core is in the SolrCore request attribute so
-        // the servlet can retrieve it
+        // the servlet/jsp can retrieve it
         else {
-          // TEMP -- to support /admin multicore grab the core from the request
-          // TODO -- for muticore /admin support, strip the corename from the path
-          // and forward to the /admin jsp file
-          //  req.getRequestDispatcher( path ).forward( request, response );
-          String corename = request.getParameter("core");
-          if( corename != null ) {
-            core = multicore.getCore( corename );
-            if( core == null ) {
-              throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, 
-                "Can not find core: '"+corename+"'" );
-            }
-          }
           req.setAttribute("org.apache.solr.SolrCore", core);
+          
+          // Modify the request so each core gets its own /admin
+          if( singlecore == null && path.startsWith( "/admin" ) ) {
+            req.getRequestDispatcher( path ).forward( request, response );
+            return;
+          }
         }
       }
       catch( Throwable ex ) {