Skip to content

Commit

Permalink
SOLR-3202: remove JSP support and the old admin UI
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1297578 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ryan McKinley committed Mar 6, 2012
1 parent 936fa2c commit 0f05fed
Show file tree
Hide file tree
Showing 44 changed files with 126 additions and 5,192 deletions.
4 changes: 0 additions & 4 deletions dev-tools/eclipse/dot.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@
<classpathentry kind="lib" path="solr/example/lib/jetty-6.1.26-patched-JETTY-1340.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-util-6.1.26-patched-JETTY-1340.jar"/>
<classpathentry kind="lib" path="solr/example/lib/servlet-api-2.5-20081211.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jsp-2.1/core-3.1.1.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jsp-2.1/jsp-2.1-glassfish-2.1.v20091210.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jsp-2.1/jsp-2.1-jetty-6.1.26.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jsp-2.1/jsp-api-2.1-glassfish-2.1.v20091210.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/carrot2-core-3.5.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/hppc-0.3.3.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/jackson-core-asl-1.5.2.jar"/>
Expand Down
15 changes: 0 additions & 15 deletions dev-tools/maven/pom.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,6 @@
<artifactId>jetty-util</artifactId>
<version>${patched.jetty.version}</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1-glassfish</artifactId>
<version>2.1.v20091210</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1-jetty</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-api-2.1-glassfish</artifactId>
<version>2.1.v20091210</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions dev-tools/maven/solr/core/pom.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@
<artifactId>jetty-util</artifactId>
<optional>true</optional> <!-- Only used for tests and one command-line utility: JettySolrRunner -->
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1-jetty</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ Other Changes

* SOLR-2607: Removed obsolete client/ folder (ehatcher, Eric Pugh, janhoy)

* SOLR-3202: Dropping Support for JSP. New Admin UI is all client side (ryan)


Documentation
----------------------

Expand Down
13 changes: 2 additions & 11 deletions solr/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<target name="compile" description="Compile the source code."
depends="compile-core, compile-contrib"/>
<target name="test" description="Validate, then run core, solrj, and contrib unit tests."
depends="validate, test-jsp, test-core, test-contrib"/>
depends="validate, test-core, test-contrib"/>
<target name="test-core" description="Runs the core and solrj unit tests."
depends="test-solr-core, test-solrj"/>
<target name="compile-test" description="Compile unit tests."
Expand Down Expand Up @@ -169,14 +169,7 @@
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>

<!-- Webapp targets -->
<target name="test-jsp">
<ant dir="webapp" target="test" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>


<!-- Validation (license/ notice checks). -->
<target name="validate" depends="compile-tools" description="Validate legal stuff.">
<license-check-macro dir="${basedir}">
Expand All @@ -189,8 +182,6 @@
<additional-filters>
<replaceregex pattern="/jetty-util([^/]+)$" replace="/jetty-util" flags="gi" />
<replaceregex pattern="/jetty-6([^/]+)$" replace="/jetty" flags="gi" />
<replaceregex pattern="/jsp-2.1-glassfish([^/]+)$" replace="/jsp-2.1-glassfish" flags="gi" />
<replaceregex pattern="/jsp-api-2.1-glassfish([^/]+)$" replace="/jsp-api-2.1-glassfish" flags="gi" />
</additional-filters>
</license-check-macro>
</target>
Expand Down
79 changes: 79 additions & 0 deletions solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* 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.
*/

package org.apache.solr.servlet;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.core.CoreContainer;


/**
* A simple servlet to load the Solr Admin UI
*
* @since solr 4.0
*/
public final class LoadAdminUiServlet extends HttpServlet {

@Override
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html");

PrintWriter out = response.getWriter();
File f = new File(getServletContext().getRealPath("admin.html"));
if(f.exists()) {
// This attribute is set by the SolrDispatchFilter
CoreContainer cores = (CoreContainer) request.getAttribute("org.apache.solr.CoreContainer");

String html = IOUtils.toString(new FileInputStream(f), "UTF-8");

String[] search = new String[] {
"${contextPath}",
"${adminPath}"
};
String[] replace = new String[] {
request.getContextPath(),
cores.getAdminPath()
};

out.println( StringUtils.replaceEach(html, search, replace) );
}
else {
out.println("solr");
}
}

@Override
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
doGet(request, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public void doGet(HttpServletRequest request,
out.write("<title>Solr Admin: JDK Log Level Selector</title>\n");
out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"solr-admin.css\" />");
out.write("</head><body>\n");
out.write("<a href=\".\"><img border=\"0\" align=\"right\" height=\"78\" width=\"142\" src=\"solr_small.png\" alt=\"Solr\"></a>");
out.write("<h1>JDK Log Level Selector</h1>");
out.write("<a href=\".\"><img border=\"0\" align=\"right\" height=\"78\" width=\"142\" src=\"img/solr.png\" alt=\"Solr\"></a>");
out.write("<h1 style='margin-bottom:5px;'>JDK Log Level Selector</h1>");
out.write("<h2 style='color:#AA0000; margin-top:0px;'>This will be removed before Solr 4.0. See <a href='/#/logging'>logging</a></h1>");

out.write("<p>Below is the complete JDK Log hierarchy with " +
"intermediate logger/categories synthesized. " +
Expand Down
Binary file removed solr/example/lib/jsp-2.1/core-3.1.1.jar
Binary file not shown.
212 changes: 0 additions & 212 deletions solr/example/lib/jsp-2.1/core-LICENSE-EPL.txt

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 0f05fed

Please sign in to comment.