rjack-solr 4.1.0.0-java → 4.2.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/History.rdoc +5 -0
  2. data/Manifest.txt +7 -3
  3. data/Rakefile +1 -0
  4. data/init/rjack-solr +1 -1
  5. data/lib/rjack-solr/base.rb +1 -1
  6. data/lib/rjack-solr/org.restlet-2.1.1.jar +0 -0
  7. data/lib/rjack-solr/org.restlet.ext.servlet-2.1.1.jar +0 -0
  8. data/lib/rjack-solr/solr-core-4.2.1.jar +0 -0
  9. data/lib/rjack-solr/{solr-solrj-4.1.0.jar → solr-solrj-4.2.1.jar} +0 -0
  10. data/pom.xml +2 -2
  11. data/webapp/META-INF/MANIFEST.MF +3 -3
  12. data/webapp/META-INF/NOTICE.txt +12 -0
  13. data/webapp/WEB-INF/web.xml +14 -0
  14. data/webapp/admin.html +6 -2
  15. data/webapp/css/styles/analysis.css +2 -3
  16. data/webapp/css/styles/cloud.css +52 -0
  17. data/webapp/css/styles/common.css +1 -7
  18. data/webapp/css/styles/index.css +0 -5
  19. data/webapp/css/styles/menu.css +43 -30
  20. data/webapp/css/styles/schema-browser.css +99 -28
  21. data/webapp/img/ico/home.png +0 -0
  22. data/webapp/js/main.js +0 -1
  23. data/webapp/js/scripts/analysis.js +8 -5
  24. data/webapp/js/scripts/app.js +153 -37
  25. data/webapp/js/scripts/cores.js +1 -7
  26. data/webapp/js/scripts/dataimport.js +3 -8
  27. data/webapp/js/scripts/index.js +39 -32
  28. data/webapp/js/scripts/java-properties.js +1 -1
  29. data/webapp/js/scripts/logging.js +2 -2
  30. data/webapp/js/scripts/ping.js +1 -1
  31. data/webapp/js/scripts/plugins.js +2 -6
  32. data/webapp/js/scripts/query.js +2 -2
  33. data/webapp/js/scripts/schema-browser.js +148 -148
  34. data/webapp/js/scripts/threads.js +1 -1
  35. data/webapp/tpl/analysis.html +1 -1
  36. data/webapp/tpl/cloud.html +11 -0
  37. data/webapp/tpl/schema-browser.html +19 -11
  38. metadata +21 -13
  39. data/lib/rjack-solr/solr-core-4.1.0.jar +0 -0
  40. data/webapp/js/lib/jquery.sparkline.js +0 -1271
@@ -45,6 +45,11 @@
45
45
  padding-bottom: 15px;
46
46
  }
47
47
 
48
+ #content #schema-browser #related .ukf-dsf dt
49
+ {
50
+ display: none;
51
+ }
52
+
48
53
  #content #schema-browser #related dl
49
54
  {
50
55
  margin-top: 15px;
@@ -140,11 +145,60 @@
140
145
  width: 100px;
141
146
  }
142
147
 
143
- #content #schema-browser #data #field .field-options .options dd
148
+ #content #schema-browser #data #field .field-options .flags
144
149
  {
145
- margin-right: 5px;
150
+ margin-top: 10px;
151
+ margin-bottom: 20px;
152
+ }
153
+
154
+ #content #schema-browser #data #field .field-options .flags thead td
155
+ {
156
+ color: #c0c0c0;
157
+ padding-right: 5px;
158
+ width: 100px;
159
+ }
160
+
161
+ #content #schema-browser #data #field .field-options .flags tbody td,
162
+ #content #schema-browser #data #field .field-options .flags th
163
+ {
164
+ padding: 2px 5px;
165
+ }
166
+
167
+ #content #schema-browser #data #field .field-options .flags thead td,
168
+ #content #schema-browser #data #field .field-options .flags tbody th
169
+ {
170
+ padding-left: 0;
171
+ }
172
+
173
+ #content #schema-browser #data #field .field-options .flags thead th,
174
+ #content #schema-browser #data #field .field-options .flags tbody td
175
+ {
176
+ border-left: 1px solid #f0f0f0;
177
+ }
178
+
179
+ #content #schema-browser #data #field .field-options .flags tbody th,
180
+ #content #schema-browser #data #field .field-options .flags tbody td
181
+ {
182
+ border-top: 1px solid #f0f0f0;
183
+ }
184
+
185
+ #content #schema-browser #data #field .field-options .flags tbody .check
186
+ {
187
+ background-color: #fafdfa;
188
+ background-image: url( ../../img/ico/tick.png );
189
+ background-position: 50% 50%;
190
+ text-align: center;
146
191
  }
147
192
 
193
+ #content #schema-browser #data #field .field-options .flags tbody .check span
194
+ {
195
+ display: none;
196
+ }
197
+
198
+ #content #schema-browser #data #field .field-options .flags tbody .text
199
+ {
200
+ color: #c0c0c0;
201
+ }
148
202
 
149
203
  #content #schema-browser #data #field .field-options .analyzer,
150
204
  #content #schema-browser #data #field .field-options .analyzer li,
@@ -336,7 +390,8 @@
336
390
  color: #333;
337
391
  }
338
392
 
339
- #content #schema-browser #data #field .topterms-holder
393
+ #content #schema-browser #data #field .topterms-holder,
394
+ #content #schema-browser #data #field .histogram-holder
340
395
  {
341
396
  border-left: 1px solid #f0f0f0;
342
397
  display: none;
@@ -394,12 +449,12 @@
394
449
  margin-bottom: 5px;
395
450
  }
396
451
 
452
+ /* possible overwrite with inline style */
397
453
  #content #schema-browser .topterms-holder li p
398
454
  {
399
455
  background-color: #999;
400
456
  color: #fff;
401
457
  float: left;
402
- width: 25px;
403
458
  }
404
459
 
405
460
  #content #schema-browser .topterms-holder li p span
@@ -409,6 +464,7 @@
409
464
  text-align: right;
410
465
  }
411
466
 
467
+ /* possible overwrite with inline style */
412
468
  #content #schema-browser .topterms-holder li ul
413
469
  {
414
470
  margin-left: 30px;
@@ -438,51 +494,66 @@
438
494
  background-color: #c0c0c0;
439
495
  }
440
496
 
441
- #content #schema-browser #data #field .histogram-holder
497
+ #content #schema-browser #data #field .histogram-holder ul
442
498
  {
443
- border-left: 1px solid #f0f0f0;
444
- display: none;
445
- float: left;
446
- padding-left: 20px;
447
- padding-right: 20px;
499
+ margin-left: 25px;
448
500
  }
449
501
 
450
- #content #schema-browser #data #field .histogram-holder .histogram
502
+ #content #schema-browser #data #field .histogram-holder li
451
503
  {
452
- height: 150px;
504
+ margin-bottom: 2px;
505
+ position: relative;
506
+ width: 150px;
453
507
  }
454
508
 
455
- #content #schema-browser #data #field .histogram-holder .histogram.single canvas
509
+ #content #schema-browser #data #field .histogram-holder li.odd
510
+ {
511
+ background-color: #f0f0f0;
512
+ }
513
+
514
+ #content #schema-browser #data #field .histogram-holder li dl,
515
+ #content #schema-browser #data #field .histogram-holder li dt
516
+ {
517
+ padding-top: 1px;
518
+ padding-bottom: 1px;
519
+ }
520
+
521
+ #content #schema-browser #data #field .histogram-holder li dl
456
522
  {
457
523
  background-color: #c0c0c0;
524
+ min-width: 1px;
458
525
  }
459
526
 
460
- #content #schema-browser #data #field .histogram-holder dt,
461
- #content #schema-browser #data #field .histogram-holder dd
527
+ #content #schema-browser #data #field .histogram-holder li dt
462
528
  {
463
- float: left;
464
- font-size: 10px;
465
- text-align: center;
529
+ color: #a0a0a0;
530
+ position: absolute;
531
+ overflow: hidden;
532
+ left: -25px;
533
+ top: 0px;
466
534
  }
467
535
 
468
- #content #schema-browser #data #field .histogram-holder span
536
+ #content #schema-browser #data #field .histogram-holder li dt span
469
537
  {
470
- background-color: #f0f0f0;
471
538
  display: block;
472
- width: 20px;
539
+ padding-right: 4px;
540
+ text-align: right;
473
541
  }
474
542
 
475
- #content #schema-browser #data #field .histogram-holder dt
543
+ #content #schema-browser #data #field .histogram-holder li dd
476
544
  {
477
- padding-right: 1px;
545
+ clear: left;
546
+ float: left;
547
+ margin-left: 2px;
548
+ white-space: nowrap;
478
549
  }
479
550
 
480
- #content #schema-browser #data #field .histogram-holder dd
551
+ #content #schema-browser #data #field .histogram-holder li:hover dl
481
552
  {
482
- padding-right: 3px;
553
+ background-color: #b0b0b0;
483
554
  }
484
555
 
485
- #content #schema-browser #data #field .histogram-holder dd span
556
+ #content #schema-browser #data #field .histogram-holder li:hover dt
486
557
  {
487
- width: 25px;
488
- }
558
+ color: #333;
559
+ }
Binary file
data/webapp/js/main.js CHANGED
@@ -25,7 +25,6 @@ require
25
25
  'lib/order!lib/jquery.form',
26
26
  'lib/order!lib/jquery.jstree',
27
27
  'lib/order!lib/jquery.sammy',
28
- 'lib/order!lib/jquery.sparkline',
29
28
  'lib/order!lib/jquery.timeago',
30
29
  'lib/order!lib/jquery.blockUI',
31
30
  'lib/order!lib/highlight',
@@ -42,7 +42,7 @@ sammy.get
42
42
 
43
43
  var type_or_name = $( '#type_or_name', analysis_form );
44
44
  var schema_browser_element = $( '#tor_schema' );
45
- var schema_browser_path = $( 'p > a', active_core ).attr( 'href' ) + '/schema-browser'
45
+ var schema_browser_path = app.core_menu.find( '.schema-browser a' ).attr( 'href' );
46
46
  var schema_browser_map = { 'fieldname' : 'field', 'fieldtype' : 'type' };
47
47
 
48
48
  type_or_name
@@ -247,9 +247,12 @@ sammy.get
247
247
  'submit',
248
248
  function( event )
249
249
  {
250
- var params = compute_analysis_params();
250
+ var params = $.param( compute_analysis_params() )
251
+ .replace( /[\w\.]+=\+*(&)/g, '$1' ) // remove empty parameters
252
+ .replace( /(&)+/, '$1' ) // reduce multiple ampersands
253
+ .replace( /^&/, '' ); // remove leading ampersand
251
254
 
252
- context.redirect( context.path.split( '?' ).shift() + '?' + $.param( params ) );
255
+ context.redirect( context.path.split( '?' ).shift() + '?' + params );
253
256
  return false;
254
257
  }
255
258
  )
@@ -269,7 +272,7 @@ sammy.get
269
272
  dataType : 'json',
270
273
  beforeSend : function( xhr, settings )
271
274
  {
272
- loader.show( button );
275
+ loader.show( $( 'span', button ) );
273
276
  button.attr( 'disabled', true );
274
277
  },
275
278
  success : function( response, status_text, xhr, form )
@@ -325,7 +328,7 @@ sammy.get
325
328
  },
326
329
  complete : function()
327
330
  {
328
- loader.hide( $( 'button', analysis_form ) );
331
+ loader.hide( $( 'span', button ) );
329
332
  button.removeAttr( 'disabled' );
330
333
  }
331
334
  }
@@ -92,20 +92,26 @@ var sammy = $.sammy
92
92
  $( 'li.active', menu_wrapper )
93
93
  .removeClass( 'active' );
94
94
 
95
- if( this.params.splat )
95
+ // global dashboard doesn't have params.splat
96
+ if( !this.params.splat )
96
97
  {
97
- var selector = '~' === this.params.splat[0][0]
98
- ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
99
- : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' );
98
+ this.params.splat = [ '~index' ];
99
+ }
100
100
 
101
- var active_element = $( selector, menu_wrapper );
102
-
103
- if( 0 === active_element.size() )
104
- {
105
- this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
106
- return false;
107
- }
101
+ var selector = '~' === this.params.splat[0][0]
102
+ ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
103
+ : '#core-selector #' + this.params.splat[0].replace( /\./g, '__' );
104
+
105
+ var active_element = $( selector, menu_wrapper );
106
+
107
+ if( 0 === active_element.size() )
108
+ {
109
+ this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' );
110
+ return false;
111
+ }
108
112
 
113
+ if( active_element.hasClass( 'global' ) )
114
+ {
109
115
  active_element
110
116
  .addClass( 'active' );
111
117
 
@@ -115,10 +121,28 @@ var sammy = $.sammy
115
121
  .addClass( 'active' );
116
122
  }
117
123
 
118
- if( !active_element.hasClass( 'global' ) )
124
+ $( '#core-selector option[selected]' )
125
+ .removeAttr( 'selected' )
126
+ .trigger( 'liszt:updated' );
127
+
128
+ $( '#core-selector .chzn-container > a' )
129
+ .addClass( 'chzn-default' );
130
+ }
131
+ else
132
+ {
133
+ active_element
134
+ .attr( 'selected', 'selected' )
135
+ .trigger( 'liszt:updated' );
136
+
137
+ if( !this.params.splat[1] )
119
138
  {
120
- this.active_core = active_element;
139
+ this.params.splat[1] = 'overview';
121
140
  }
141
+
142
+ $( '#core-menu .' + this.params.splat[1] )
143
+ .addClass( 'active' );
144
+
145
+ this.active_core = active_element;
122
146
  }
123
147
  }
124
148
  );
@@ -143,13 +167,20 @@ var solr_admin = function( app_config )
143
167
 
144
168
  plugin_data = null,
145
169
 
146
- this.menu_element = $( '#menu-selector' );
147
- this.config = config;
170
+ this.menu_element = $( '#core-selector select' );
171
+ this.core_menu = $( '#core-menu ul' );
148
172
 
173
+ this.config = config;
149
174
  this.timeout = null;
150
175
 
151
176
  this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
152
177
 
178
+ browser = {
179
+ locale : null,
180
+ language : null,
181
+ country : null
182
+ };
183
+
153
184
  show_global_error = function( error )
154
185
  {
155
186
  var main = $( '#main' );
@@ -197,6 +228,9 @@ var solr_admin = function( app_config )
197
228
  that.menu_element
198
229
  .empty();
199
230
 
231
+ var core_list = [];
232
+ core_list.push( '<option></option>' );
233
+
200
234
  var core_count = 0;
201
235
  for( var core_name in that.cores_data )
202
236
  {
@@ -214,32 +248,24 @@ var solr_admin = function( app_config )
214
248
  classes.push( 'default' );
215
249
  }
216
250
 
217
- var core_tpl = '<li id="' + core_name.replace( /\./g, '__' ) + '" '
251
+ var core_tpl = '<option '
252
+ + ' id="' + core_name.replace( /\./g, '__' ) + '" '
218
253
  + ' class="' + classes.join( ' ' ) + '"'
219
254
  + ' data-basepath="' + core_path + '"'
220
255
  + ' schema="' + cores.status[core_name]['schema'] + '"'
221
256
  + ' config="' + cores.status[core_name]['config'] + '"'
222
- + '>' + "\n"
223
- + ' <p><a href="#/' + core_name + '" title="' + core_name + '">' + core_name + '</a></p>' + "\n"
224
- + ' <ul>' + "\n"
225
-
226
- + ' <li class="ping"><a rel="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"
227
- + ' <li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"
228
- + ' <li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"
229
- + ' <li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"
230
- + ' <li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"
231
- + ' <li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"
232
- + ' <li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"
233
- + ' <li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n"
234
- + ' <li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
235
-
236
- + ' </ul>' + "\n"
237
- + '</li>';
238
-
239
- that.menu_element
240
- .append( core_tpl );
257
+ + ' value="#/' + core_name + '"'
258
+ + ' title="' + core_name + '"'
259
+ + '>'
260
+ + core_name
261
+ + '</option>';
262
+
263
+ core_list.push( core_tpl );
241
264
  }
242
265
 
266
+ that.menu_element
267
+ .append( core_list.join( "\n" ) );
268
+
243
269
  if( cores.initFailures )
244
270
  {
245
271
  var failures = [];
@@ -274,10 +300,28 @@ var solr_admin = function( app_config )
274
300
 
275
301
  this.run = function()
276
302
  {
303
+ var navigator_language = navigator.userLanguage || navigator.language;
304
+ var language_match = navigator_language.match( /^(\w{2})([-_](\w{2}))?$/ );
305
+ if( language_match )
306
+ {
307
+ if( language_match[1] )
308
+ {
309
+ browser.language = language_match[1].toLowerCase();
310
+ }
311
+ if( language_match[3] )
312
+ {
313
+ browser.country = language_match[3].toUpperCase();
314
+ }
315
+ if( language_match[1] && language_match[3] )
316
+ {
317
+ browser.locale = browser.language + '_' + browser.country
318
+ }
319
+ }
320
+
277
321
  $.ajax
278
322
  (
279
323
  {
280
- url : config.solr_path + config.core_admin_path + '?wt=json',
324
+ url : config.solr_path + config.core_admin_path + '?wt=json&indexInfo=false',
281
325
  dataType : 'json',
282
326
  beforeSend : function( arr, form, options )
283
327
  {
@@ -288,6 +332,52 @@ var solr_admin = function( app_config )
288
332
  {
289
333
  that.set_cores_data( response );
290
334
 
335
+ that.menu_element
336
+ .chosen()
337
+ .off( 'change' )
338
+ .on
339
+ (
340
+ 'change',
341
+ function( event )
342
+ {
343
+ location.href = $( 'option:selected', this ).val();
344
+ return false;
345
+ }
346
+ )
347
+ .on
348
+ (
349
+ 'liszt:updated',
350
+ function( event )
351
+ {
352
+ var core_name = $( 'option:selected', this ).text();
353
+
354
+ if( core_name )
355
+ {
356
+ that.core_menu
357
+ .html
358
+ (
359
+ '<li class="overview"><a href="#/' + core_name + '"><span>Overview</span></a></li>' + "\n" +
360
+ '<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
361
+ '<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
362
+ '<li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n" +
363
+ '<li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n" +
364
+ '<li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n" +
365
+ '<li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n" +
366
+ '<li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n" +
367
+ '<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
368
+ '<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
369
+ )
370
+ .show();
371
+ }
372
+ else
373
+ {
374
+ that.core_menu
375
+ .hide()
376
+ .empty();
377
+ }
378
+ }
379
+ );
380
+
291
381
  for( var core_name in response.status )
292
382
  {
293
383
  var core_path = config.solr_path + '/' + core_name;
@@ -318,9 +408,13 @@ var solr_admin = function( app_config )
318
408
  var command_line_args = response.jvm.jmx.commandLineArgs.join( ' | ' );
319
409
 
320
410
  environment_args = command_line_args.match( /-Dsolr.environment=((dev|test|prod)?[\w\d]*)/i );
321
- cloud_args = command_line_args.match( /-Dzk/i );
322
411
  }
323
412
 
413
+ if( response.mode )
414
+ {
415
+ cloud_args = response.mode.match( /solrcloud/i );
416
+ }
417
+
324
418
  // title
325
419
 
326
420
  $( 'title', document )
@@ -468,6 +562,28 @@ var solr_admin = function( app_config )
468
562
  return json_str;
469
563
  };
470
564
 
565
+ this.format_number = function format_number( number )
566
+ {
567
+ var sep = {
568
+ 'de_CH' : '\'',
569
+ 'de' : '.',
570
+ 'en' : ',',
571
+ 'es' : '.',
572
+ 'it' : '.',
573
+ 'ja' : ',',
574
+ 'sv' : ' ',
575
+ 'tr' : '.',
576
+ '_' : '' // fallback
577
+ };
578
+
579
+ return ( number || 0 ).toString().replace
580
+ (
581
+ /\B(?=(\d{3})+(?!\d))/g,
582
+ sep[ browser.locale ] || sep[ browser.language ] || sep['_']
583
+ );
584
+ };
585
+
471
586
  };
472
587
 
588
+ $.ajaxSetup( { cache: false } );
473
589
  var app = new solr_admin( app_config );