Skip to content

Commit

Permalink
issue planetfederal#235 : enhancements CSW: add link plus button and …
Browse files Browse the repository at this point in the history
…configurable URL template to full metadata record
  • Loading branch information
justb4 committed Aug 19, 2014
1 parent 2f304b2 commit 2f12b42
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/script/plugins/CSWCatalogueSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ gxp.plugins.CSWCatalogueSource = Ext.extend(gxp.plugins.CatalogueSource, {
})
}, this.proxyOptions || {})),
reader: new GeoExt.data.CSWRecordsReader({
fields: ['title', 'abstract', 'URI', 'bounds', 'projection', 'references']
fields: ['identifier', 'title', 'abstract', 'URI', 'bounds', 'projection', 'references']
})
});
gxp.plugins.LayerSource.prototype.createStore.apply(this, arguments);
Expand Down
86 changes: 61 additions & 25 deletions src/script/widgets/CatalogueSearchPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ gxp.CatalogueSearchPanel = Ext.extend(Ext.Panel, {
datasourceLabel: "Data source",
filterLabel: "Filter search by",
removeSourceTooltip: "Switch back to original source",
showMetaDataTooltip: "Show full metadata",
/* end i18n */

/** private: method[initComponent]
Expand Down Expand Up @@ -353,33 +354,68 @@ gxp.CatalogueSearchPanel = Ext.extend(Ext.Panel, {
loadMask: true,
hideHeaders: true,
store: this.sources[this.selectedSource].store,
columns: [{
id: 'title',
// xtype: "templatecolumn",
// tpl: '<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>',
columns: [
{
id: 'title',
// xtype: "templatecolumn",
// tpl: '<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>',

// tpl: new Ext.XTemplate('<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>'),
sortable: true,
dataIndex: 'title',
renderer: recordRenderer
}, {
xtype: "actioncolumn",
width: 30,
items: [{
getClass: function(v, meta, rec) {
var ows = this.findWMS(rec.get("URI")) || this.findWMS(rec.get("references"));
if (ows !== false) {
return "gxp-icon-addlayers";
// tpl: new Ext.XTemplate('<div ext:qtip="{abstract}"><b>{title}</b><br/>{abstract}</div>'),
sortable: true,
dataIndex: 'title',
renderer: recordRenderer
},
{
xtype: "actioncolumn",
width: 15,
items: [
{
getClass: function (v, meta, rec) {
if (this.sources[this.selectedSource].fullMetadataUrlTpl) {
return "gxp-icon-metadata";
}
},
tooltip: this.showMetaDataTooltip,
handler: function (grid, rowIndex, colIndex) {
var rec = this.grid.store.getAt(rowIndex);
var id = rec.get("identifier")[0];

// GeoNetwork cases where id is embedded in capitals but id should be lowercase
// e.g. "{0FECD83D-66DF-49AB-8406-DB3EF00709C5}"
if (id.indexOf('{') > -1) {
id = id.toLowerCase();
}
var urlTemplate = this.sources[this.selectedSource].fullMetadataUrlTpl;
if (urlTemplate) {
var url = urlTemplate.apply({id: id});
window.open(url, "MDWindow", "width=800, height=600");
}
},
scope: this
}
},
tooltip: this.addMapTooltip,
handler: function(grid, rowIndex, colIndex) {
var rec = this.grid.store.getAt(rowIndex);
this.addLayer(rec);
},
scope: this
}]
}],
]
},
{
xtype: "actioncolumn",
width: 15,
items: [
{
getClass: function (v, meta, rec) {
var ows = this.findWMS(rec.get("URI")) || this.findWMS(rec.get("references"));
if (ows !== false) {
return "gxp-icon-addlayers";
}
},
tooltip: this.addMapTooltip,
handler: function (grid, rowIndex, colIndex) {
var rec = this.grid.store.getAt(rowIndex);
this.addLayer(rec);
},
scope: this
}
]
}
],
autoExpandColumn: 'title',
autoHeight: true
}]
Expand Down
6 changes: 6 additions & 0 deletions src/theme/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,12 @@ div.olMap div.gx-overlay-playback {
background-image: url(data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9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YO7+I9Bzx6cjtQIuRk7RnOcd8Z/HFFMi+6v09/wCtFAFpwD1Gf8aiMa/3R+XtiiigBhjX+6PyphiX+6PyoooAcoxwB+FFFFAH/9k=)
}

.gxp-icon-metadata {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHpSURBVDjLhZNbbxJhEIb3T/RWw78g2fjLvLE2ppe1TYNtvGuNRo6BcA4kIBBOgXCU3QXploCAmNQE/VY55PWbj7CWcPBibuab95l3ZmelZrOJRqOBWq2GarWKSqWCcrmMUqmEYrF4BEA6FFK9XsdyudyKfr8vILlc7iBEos4k6PV6orOu6yaEctwF0un0XohElqmYulGiUCiUptMp5vO5yBMwm80ikUjshEjUdV3IxX+45Z5hGPj29RcykbF463a7SKVSiMfjWxCJOq8tLxYLkPj72MCbEw3nz1WkwytIp9MhF4hEIhsQic/IJpOJKJrNZqKz7aWGm7Mu3l/quDppmxBN08gFAoGACZHy+fwzPiMbj1dFSvVBdL49v8PHq/stiKqq5AJer1dABCWTych8RjYajURRu/EDtmMV7y7+QWzHGj4FV++tVotcwO12H5mzJJNJmc/IhsPhFuSDTcfb0w6uTz/zr7MQLkKhEJxO59ONjfL55FgsxgaDgQm5fKHg+lUbtxdt/Jwaj8UWc4THEY1G5XA4zOgSxeLqD7h5/QW/jbkpdjgcFnOJu44jGAzKfr+f0SWuPzGJeX5DvBdA4fP5rHzTjA5MUZSd4oMACo/HY3W5XIzEdrvdsvOU//e78q5WLn6y7/0viZYv/mL7AwwAAAAASUVORK5CYII=);
width: 16px;
height: 16px;
}

.x-btn .gxp-icon-metadata, .x-menu-item .gxp-icon-metadata, .x-tree-node .gxp-icon-metadata {
/* tag_purple.png */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHpSURBVDjLhZNbbxJhEIb3T/RWw78g2fjLvLE2ppe1TYNtvGuNRo6BcA4kIBBOgXCU3QXploCAmNQE/VY55PWbj7CWcPBibuab95l3ZmelZrOJRqOBWq2GarWKSqWCcrmMUqmEYrF4BEA6FFK9XsdyudyKfr8vILlc7iBEos4k6PV6orOu6yaEctwF0un0XohElqmYulGiUCiUptMp5vO5yBMwm80ikUjshEjUdV3IxX+45Z5hGPj29RcykbF463a7SKVSiMfjWxCJOq8tLxYLkPj72MCbEw3nz1WkwytIp9MhF4hEIhsQic/IJpOJKJrNZqKz7aWGm7Mu3l/quDppmxBN08gFAoGACZHy+fwzPiMbj1dFSvVBdL49v8PHq/stiKqq5AJer1dABCWTych8RjYajURRu/EDtmMV7y7+QWzHGj4FV++tVotcwO12H5mzJJNJmc/IhsPhFuSDTcfb0w6uTz/zr7MQLkKhEJxO59ONjfL55FgsxgaDgQm5fKHg+lUbtxdt/Jwaj8UWc4THEY1G5XA4zOgSxeLqD7h5/QW/jbkpdjgcFnOJu44jGAzKfr+f0SWuPzGJeX5DvBdA4fP5rHzTjA5MUZSd4oMACo/HY3W5XIzEdrvdsvOU//e78q5WLn6y7/0viZYv/mL7AwwAAAAASUVORK5CYII=);
Expand Down

0 comments on commit 2f12b42

Please sign in to comment.