You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by va...@apache.org on 2015/12/11 06:40:40 UTC
svn commit: r1719263 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/core/ solr/core/src/java/org/apache/solr/handler/admin/ solr/webapp/
solr/webapp/web/js/angular/controllers/ solr/webapp/web/js/scripts/
Author: varun
Date: Fri Dec 11 05:40:40 2015
New Revision: 1719263
URL: http://svn.apache.org/viewvc?rev=1719263&view=rev
Log:
SOLR-6992: Fix Files UI to show the managed-schema file as well (merged trunk r1719261)
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
lucene/dev/branches/branch_5x/solr/webapp/ (props changed)
lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/files.js
lucene/dev/branches/branch_5x/solr/webapp/web/js/scripts/files.js
Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1719263&r1=1719262&r2=1719263&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Fri Dec 11 05:40:40 2015
@@ -46,6 +46,9 @@ Bug Fixes
* SOLR-8401: Windows start script fails when executed from a different drive.
(Nicolas Gavalda via Erick Erickson)
+* SOLR-6992: Fix "Files" UI to show the managed-schema file as well.
+ (Shawn Heisey, Varun Thacker)
+
Other Changes
----------------------
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java?rev=1719263&r1=1719262&r2=1719263&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java Fri Dec 11 05:40:40 2015
@@ -275,19 +275,6 @@ public class ShowFileRequestHandler exte
}
return true;
}
-
- // Make sure that if the schema is managed, we don't allow editing. Don't really want to put
- // this in the init since we're not entirely sure when the managed schema will get initialized relative to this
- // handler.
- SolrCore core = req.getCore();
- IndexSchema schema = core.getLatestSchema();
- if (schema instanceof ManagedIndexSchema) {
- String managed = schema.getResourceName();
-
- if (fname.equalsIgnoreCase(managed)) {
- return true;
- }
- }
return false;
}
Modified: lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/files.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/files.js?rev=1719263&r1=1719262&r2=1719263&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/files.js (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/files.js Fri Dec 11 05:40:40 2015
@@ -71,7 +71,12 @@ solrAdminApp.controller('FilesController
process("", $scope.tree);
if ($scope.file && $scope.file != '' && $scope.file.split('').pop()!='/') {
- var extension = $scope.file.match( /\.(\w+)$/)[1] || '';
+ var extension;
+ if ($scope.file == "managed-schema") {
+ extension = contentTypeMap['xml'];
+ } else {
+ extension = $scope.file.match( /\.(\w+)$/)[1] || '';
+ }
var contentType = (contentTypeMap[extension] || 'text/plain' ) + ';charset=utf-8';
Files.get({core: $routeParams.core, file: $scope.file, contentType: contentType}, function(data) {
Modified: lucene/dev/branches/branch_5x/solr/webapp/web/js/scripts/files.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/js/scripts/files.js?rev=1719263&r1=1719262&r2=1719263&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/js/scripts/files.js (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/js/scripts/files.js Fri Dec 11 05:40:40 2015
@@ -163,8 +163,13 @@ sammy.get
var endpoint = file_endpoint + '?file=' + selected_file;
var content_type_map = { xml : 'text/xml', html : 'text/html', js : 'text/javascript', json : 'application/json', 'css' : 'text/css' };
- var file_ext = selected_file.match( /\.(\w+)$/ );
- endpoint += '&contentType=' + ( content_type_map[ file_ext[1] || '' ] || 'text/plain' ) + ';charset=utf-8';
+ if (selected_file == 'managed-schema') {
+ endpoint += '&contentType=' + 'text/xml' + ';charset=utf-8';
+ } else {
+ var file_ext = selected_file.match( /\.(\w+)$/ );
+ endpoint += '&contentType=' + ( content_type_map[ file_ext[1] || '' ] || 'text/plain' ) + ';charset=utf-8';
+ }
+
var public_url = window.location.protocol + '//' + window.location.host + endpoint;