Author: ryan
Date: Thu Jan 3 12:15:06 2008
New Revision: 608613
URL: http://svn.apache.org/viewvc?rev=608613&view=rev
Log:
SOLR-142 -- adding deprecation warnings to get-file.jsp and raw-schema.jsp
Added:
lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp (with props)
Modified:
lucene/solr/trunk/CHANGES.txt
lucene/solr/trunk/src/webapp/resources/admin/get-file.jsp
Modified: lucene/solr/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=608613&r1=608612&r2=608613&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Thu Jan 3 12:15:06 2008
@@ -178,6 +178,7 @@
35. SOLR-142: Added RawResponseWriter and ShowFileRequestHandler. This
returns config
files directly. If the AdminHandlers is configured, this will be added
automatically.
+ The jsp files /admin/get-file.jsp and /admin/raw-schema.jsp have been
deprecated.
(ryan)
Changes in runtime behavior
Modified: lucene/solr/trunk/src/webapp/resources/admin/get-file.jsp
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/get-file.jsp?rev=608613&r1=608612&r2=608613&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/get-file.jsp (original)
+++ lucene/solr/trunk/src/webapp/resources/admin/get-file.jsp Thu Jan 3
12:15:06 2008
@@ -21,14 +21,14 @@
java.io.InputStream,
java.io.InputStreamReader,
java.io.Reader,
- java.util.StringTokenizer"%>
+ java.util.StringTokenizer,
+ java.util.logging.Logger"%>
+<%!
+ static Logger log = Logger.getLogger(SolrCore.class.getName());
+%>
<%
-//
-// NOTE -- this file is Deprecated - should use the ShowFileRequestHandler
instead
-//
-
-System.out.println( "WARNING -- using deprecated jsp file: " +
request.getServletPath() );
-
+ // NOTE -- this file will be removed in a future release
+ log.warning("Using deprecated JSP: " +
request.getRequestURL().append("?").append(request.getQueryString()) + " --
check the ShowFileRequestHandler" );
Object ocore = request.getAttribute("org.apache.solr.SolrCore");
SolrCore core = ocore instanceof SolrCore? (SolrCore) ocore :
SolrCore.getSolrCore();
Added: lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp?rev=608613&view=auto
==============================================================================
--- lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp (added)
+++ lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp Thu Jan 3
12:15:06 2008
@@ -0,0 +1,46 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+<%@ page import="org.apache.solr.core.SolrCore,
+ org.apache.solr.schema.IndexSchema"%>
+<%@ page import="java.io.InputStreamReader"%>
+<%@ page import="java.io.Reader"%>
+<%@ page import="java.util.logging.Logger"%>
+<%@ page contentType="text/plain;charset=UTF-8" language="java" %>
+<%!
+ static Logger log = Logger.getLogger(SolrCore.class.getName());
+%>
+<%
+ // NOTE -- this file will be removed in a future release
+ log.warning("Using deprecated JSP: " +
request.getRequestURL().append("?").append(request.getQueryString()) + " --
check the ShowFileRequestHandler" );
+
+ 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();
+
+ IndexSchema schema = core.getSchema();
+ Reader input = new InputStreamReader(schema.getInputStream());
+ char[] buf = new char[4096];
+ while (true) {
+ int len = input.read(buf);
+ if (len<=0) break;
+ out.write(buf,0,len);
+ }
+%>
Propchange: lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/solr/trunk/src/webapp/resources/admin/raw-schema.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL