SOLR-3312 Remove static reference to schema/solrconfig

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1325268 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Matheis 2012-04-12 14:06:53 +00:00
parent e166ebdd2c
commit c23ba0564c
4 changed files with 10 additions and 6 deletions

View File

@ -809,6 +809,8 @@ public class CoreAdminHandler extends RequestHandlerBase {
info.add("name", core.getName()); info.add("name", core.getName());
info.add("instanceDir", normalizePath(core.getResourceLoader().getInstanceDir())); info.add("instanceDir", normalizePath(core.getResourceLoader().getInstanceDir()));
info.add("dataDir", normalizePath(core.getDataDir())); info.add("dataDir", normalizePath(core.getDataDir()));
info.add("config", core.getConfigResource());
info.add("schema", core.getSchemaResource());
info.add("startTime", new Date(core.getStartTime())); info.add("startTime", new Date(core.getStartTime()));
info.add("uptime", System.currentTimeMillis() - core.getStartTime()); info.add("uptime", System.currentTimeMillis() - core.getStartTime());
RefCounted<SolrIndexSearcher> searcher = core.getSearcher(); RefCounted<SolrIndexSearcher> searcher = core.getSearcher();

View File

@ -46,8 +46,6 @@ limitations under the License.
app_config.solr_path = '${contextPath}'; app_config.solr_path = '${contextPath}';
app_config.core_admin_path = '${adminPath}'; app_config.core_admin_path = '${adminPath}';
app_config.schema_path = '/admin/file?file=schema.xml&contentType=text/xml;charset=utf-8';
app_config.config_path = '/admin/file?file=solrconfig.xml&contentType=text/xml;charset=utf-8';
</script> </script>

View File

@ -169,14 +169,16 @@ var solr_admin = function( app_config )
} }
else else
{ {
self.menu_element self.menu_element
.addClass( 'singlecore' ); .addClass( 'singlecore' );
} }
for( var core_name in response.status ) for( var core_name in response.status )
{ {
var core_path = config.solr_path + '/' + core_name; var core_path = config.solr_path + '/' + core_name;
var schema = response['status'][core_name]['schema'];
var solrconfig = response['status'][core_name]['config'];
if( !core_name ) if( !core_name )
{ {
core_name = 'singlecore'; core_name = 'singlecore';
@ -188,7 +190,7 @@ var solr_admin = function( app_config )
environment_basepath = core_path; environment_basepath = core_path;
} }
var core_tpl = '<li id="' + core_name + '" data-basepath="' + core_path + '">' + "\n" var core_tpl = '<li id="' + core_name + '" data-basepath="' + core_path + '" schema="' + schema + '" config="' + solrconfig + '">' + "\n"
+ ' <p><a href="#/' + core_name + '">' + core_name + '</a></p>' + "\n" + ' <p><a href="#/' + core_name + '">' + core_name + '</a></p>' + "\n"
+ ' <ul>' + "\n" + ' <ul>' + "\n"

View File

@ -22,11 +22,13 @@ sammy.get
function( context ) function( context )
{ {
var core_basepath = this.active_core.attr( 'data-basepath' ); var core_basepath = this.active_core.attr( 'data-basepath' );
var filetype = context.params.splat[1]; // either schema or config
var filename = this.active_core.attr( filetype );
$.ajax $.ajax
( (
{ {
url : core_basepath + app.config[ context.params.splat[1] + '_path' ], url : core_basepath + "/admin/file?file=" + filename + "&contentType=text/xml;charset=utf-8",
dataType : 'xml', dataType : 'xml',
context : $( '#content' ), context : $( '#content' ),
beforeSend : function( xhr, settings ) beforeSend : function( xhr, settings )