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

Contacts are added to the DataCite metadata #6

Closed
wants to merge 16 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Changed pycsw version to 3.0.0-alpha4. Fixed the mapping for links fo…
…r pycsw.
ahmdthr committed Dec 5, 2023
commit 0c3330762ce6bcb324396be39296a7c8a64729ee
11 changes: 6 additions & 5 deletions geonode/base/models.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import os
import re
import html
import json
import math
import uuid
import logging
@@ -1452,16 +1453,16 @@ def set_center_zoom(self):
except ZeroDivisionError:
pass

def download_links(self):
def download_urls(self):
"""assemble download links for pycsw"""
links = []
for link in self.link_set.all():
if link.link_type == "metadata": # avoid recursion
continue
if link.link_type == "html":
links.append((self.title, "Web address (URL)", "WWW:LINK-1.0-http--link", link.url))
links.append({'name':self.title, 'description':"Web address (URL)", 'protocol':"WWW:LINK-1.0-http--link", 'url':link.url})
elif link.link_type in ("OGC:WMS", "OGC:WFS", "OGC:WCS"):
links.append((self.title, link.name, link.link_type, link.url))
links.append({'name':self.title, 'description':link.name, 'protocol':link.link_type, 'url':link.url})
else:
_link_type = "WWW:DOWNLOAD-1.0-http--download"
try:
@@ -1473,8 +1474,8 @@ def download_links(self):
except Exception as e:
logger.exception(e)
description = f"{self.title} ({link.name} Format)"
links.append((self.title, description, _link_type, link.url))
return links
links.append({'name':self.title, 'description':description, 'protocol':_link_type, 'url':link.url})
return json.dumps(links)

@property
def embed_url(self):
2 changes: 1 addition & 1 deletion geonode/catalogue/backends/generic.py
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ def metadatarecord2dict(self, rec):
}

# locate all distribution links
result["download_links"] = self.extract_links(rec)
result["download_urls"] = self.extract_links(rec)

# construct the link to the Catalogue metadata record (not
# self-indexed)
2 changes: 1 addition & 1 deletion geonode/catalogue/backends/pycsw_local_mappings.py
Original file line number Diff line number Diff line change
@@ -85,6 +85,6 @@
"pycsw:Publisher": "publisher",
"pycsw:Contributor": "contributor",
"pycsw:Relation": "relation",
"pycsw:Links": "links",
"pycsw:Links": "download_urls",
},
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ pyjwt==2.7.0
# geopython dependencies
pyproj<3.6.0
OWSLib==0.29.2
-e git+https://github.com/geopython/pycsw.git#egg=pycsw
-e git+https://github.com/geopython/pycsw.git@3.0.0-alpha4#egg=pycsw
SQLAlchemy==2.0.15 # required by PyCSW
Shapely==1.8.5.post1
mercantile==1.2.1
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ install_requires =
# geopython dependencies
pyproj<3.6.0
OWSLib==0.29.2
pycsw @ git+https://github.com/geopython/pycsw.git@master
pycsw @ git+https://github.com/geopython/pycsw.git@3.0.0-alpha4
SQLAlchemy==2.0.15 # required by PyCSW
Shapely==1.8.5.post1
mercantile==1.2.1