@@ -63,6 +63,7 @@ gxp.CatalogueSearchPanel = Ext.extend(Ext.Panel, {
63
63
datasourceLabel : "Data source" ,
64
64
filterLabel : "Filter search by" ,
65
65
removeSourceTooltip : "Switch back to original source" ,
66
+ showMetaDataTooltip : "Show full metadata" ,
66
67
/* end i18n */
67
68
68
69
/** private: method[initComponent]
@@ -353,33 +354,68 @@ gxp.CatalogueSearchPanel = Ext.extend(Ext.Panel, {
353
354
loadMask : true ,
354
355
hideHeaders : true ,
355
356
store : this . sources [ this . selectedSource ] . store ,
356
- columns : [ {
357
- id : 'title' ,
358
- // xtype: "templatecolumn",
359
- // tpl: '<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>',
357
+ columns : [
358
+ {
359
+ id : 'title' ,
360
+ // xtype: "templatecolumn",
361
+ // tpl: '<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>',
360
362
361
- // tpl: new Ext.XTemplate('<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>'),
362
- sortable : true ,
363
- dataIndex : 'title' ,
364
- renderer : recordRenderer
365
- } , {
366
- xtype : "actioncolumn" ,
367
- width : 30 ,
368
- items : [ {
369
- getClass : function ( v , meta , rec ) {
370
- var ows = this . findWMS ( rec . get ( "URI" ) ) || this . findWMS ( rec . get ( "references" ) ) ;
371
- if ( ows !== false ) {
372
- return "gxp-icon-addlayers" ;
363
+ // tpl: new Ext.XTemplate('<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>'),
364
+ sortable : true ,
365
+ dataIndex : 'title' ,
366
+ renderer : recordRenderer
367
+ } ,
368
+ {
369
+ xtype : "actioncolumn" ,
370
+ width : 15 ,
371
+ items : [
372
+ {
373
+ getClass : function ( v , meta , rec ) {
374
+ if ( this . sources [ this . selectedSource ] . fullMetadataUrlTpl ) {
375
+ return "gxp-icon-metadata" ;
376
+ }
377
+ } ,
378
+ tooltip : this . showMetaDataTooltip ,
379
+ handler : function ( grid , rowIndex , colIndex ) {
380
+ var rec = this . grid . store . getAt ( rowIndex ) ;
381
+ var id = rec . get ( "identifier" ) [ 0 ] ;
382
+
383
+ // GeoNetwork cases where id is embedded in capitals but id should be lowercase
384
+ // e.g. "{0FECD83D-66DF-49AB-8406-DB3EF00709C5}"
385
+ if ( id . indexOf ( '{' ) > - 1 ) {
386
+ id = id . toLowerCase ( ) ;
387
+ }
388
+ var urlTemplate = this . sources [ this . selectedSource ] . fullMetadataUrlTpl ;
389
+ if ( urlTemplate ) {
390
+ var url = urlTemplate . apply ( { id : id } ) ;
391
+ window . open ( url , "MDWindow" , "width=800, height=600" ) ;
392
+ }
393
+ } ,
394
+ scope : this
373
395
}
374
- } ,
375
- tooltip : this . addMapTooltip ,
376
- handler : function ( grid , rowIndex , colIndex ) {
377
- var rec = this . grid . store . getAt ( rowIndex ) ;
378
- this . addLayer ( rec ) ;
379
- } ,
380
- scope : this
381
- } ]
382
- } ] ,
396
+ ]
397
+ } ,
398
+ {
399
+ xtype : "actioncolumn" ,
400
+ width : 15 ,
401
+ items : [
402
+ {
403
+ getClass : function ( v , meta , rec ) {
404
+ var ows = this . findWMS ( rec . get ( "URI" ) ) || this . findWMS ( rec . get ( "references" ) ) ;
405
+ if ( ows !== false ) {
406
+ return "gxp-icon-addlayers" ;
407
+ }
408
+ } ,
409
+ tooltip : this . addMapTooltip ,
410
+ handler : function ( grid , rowIndex , colIndex ) {
411
+ var rec = this . grid . store . getAt ( rowIndex ) ;
412
+ this . addLayer ( rec ) ;
413
+ } ,
414
+ scope : this
415
+ }
416
+ ]
417
+ }
418
+ ] ,
383
419
autoExpandColumn : 'title' ,
384
420
autoHeight : true
385
421
} ]
0 commit comments