Skip to content

Commit

Permalink
Widgets / download and dynamic record info not available (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
François Prunayre committed Aug 6, 2012
1 parent 0412227 commit ad34762
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
Expand Up @@ -162,10 +162,18 @@ GeoNetwork.data.MetadataResultsFastStore = function(){
}

function getDownload(v, record){
if (record.download) {
return record.download[0].value;
if (record.geonet_info && record.geonet_info.download) {
return record.geonet_info.download[0].value;
} else {
return '';
return 'false';
}
}

function getDynamic(v, record){
if (record.geonet_info && record.geonet_info.dynamic) {
return record.geonet_info.dynamic[0].value;
} else {
return 'false';
}
}

Expand Down Expand Up @@ -341,6 +349,9 @@ GeoNetwork.data.MetadataResultsFastStore = function(){
}, {
name: 'download',
convert: getDownload
}, {
name: 'dynamic',
convert: getDynamic
}, {
name: 'ownername',
convert: getOwnerName
Expand Down
Expand Up @@ -206,16 +206,19 @@ GeoNetwork.Templates.FULL = new Ext.XTemplate(
// FIXME : this call require the catalogue to be named catalogue, static call ?
// FIXME : ref to app
'<tpl for="links">',
'<tpl if="values.type == \'application/vnd.ogc.wms_xml\' || values.type == \'OGC:WMS\'">',
'<tpl if="parent.dynamic==\'true\' && (values.type == \'application/vnd.ogc.wms_xml\' || values.type == \'OGC:WMS\')">',
'<a href="#" class="md-mn addLayer" title="' + OpenLayers.i18n('addToMap') + ' {title}" alt="Add layer to map" onclick="app.switchMode(\'1\', true);app.getIMap().addWMSLayer([[\'{[escape(values.title)]}\', \'{href}\', \'{name}\', \'{id}\']]);">&nbsp;</a>',
'</tpl>',
'<tpl if="values.type == \'application/vnd.google-earth.kml+xml\'">',
'<tpl if="parent.dynamic==\'true\' && values.type == \'application/vnd.google-earth.kml+xml\'">',
'<a href="{href}" class="md-mn md-mn-kml" title="' + OpenLayers.i18n('viewKml') + ' {title}" alt="Open kml">&nbsp;</a>',
'</tpl>',
'<tpl if="values.type == \'application/zip\' || values.type == \'application/x-compressed\'">',
'<tpl if="parent.download==\'true\' && (values.type == \'application/zip\' || values.type == \'application/x-compressed\')">',
'<a href="{href}" class="md-mn md-mn-zip" title="' + OpenLayers.i18n('downloadLink') + ' {title}" alt="Download">&nbsp;</a>',
'</tpl>',
'<tpl if="values.type == \'text/html\'">',
'<tpl if="parent.download==\'true\' && values.protocol.indexOf(\'WWW:DOWNLOAD\')!=-1">',
'<a href="{href}" class="md-mn md-mn-zip" title="' + OpenLayers.i18n('downloadLink') + ' {title}" alt="Download">&nbsp;</a>',
'</tpl>',
'<tpl if="values.type == \'text/html\'">',
'<a href="{href}" class="md-mn md-mn-www" title="' + OpenLayers.i18n('webLink') + ' {title}" alt="Web link" target="_blank">&nbsp;</a>',
'</tpl>',
// FIXME : no else ops, how to display other links ?
Expand Down

0 comments on commit ad34762

Please sign in to comment.