Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for (Issue 2720) - Incomplete OGC:WMS Download Link for Catalog #2721

Merged
merged 1 commit into from
Nov 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion geonode/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,16 @@ def download_links(self):
continue
if url.link_type == 'html':
links.append((self.title, 'Web address (URL)', 'WWW:LINK-1.0-http--link', url.url))
elif url.link_type in ('OGC:WMS', 'OGC:WFS', 'OGC:WCS'):
elif url.link_type in ('OGC:WFS', 'OGC:WCS'):
links.append((self.title, url.name, url.link_type, url.url))
elif url.link_type in ('OGC:WMS'):
if url.resource.layer:
href = "%s?service=%s&request=GetMap&layers=%s" % (url.url,
url.link_type[-3:],
url.resource.layer.typename)
else:
href = url.url
links.append((self.title, url.name, url.link_type, href))
else:
description = '%s (%s Format)' % (self.title, url.name)
links.append((self.title, description, 'WWW:DOWNLOAD-1.0-http--download', url.url))
Expand Down
4 changes: 3 additions & 1 deletion geonode/tests/csw.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def test_csw_outputschema_dc(self):
for link in record.references:
if link['scheme'] == 'OGC:WMS':
self.assertEqual(link['url'],
'http://localhost:8080/geoserver/geonode/wms',
'http://localhost:8080/geoserver/geonode/wms' +
'?service=WMS&request=GetMap&layers=' +
'geonode:san_andres_y_providencia_location',
'Expected a specific OGC:WMS URL')
elif link['scheme'] == 'OGC:WFS':
self.assertEqual(link['url'],
Expand Down