Skip to content
Snippets Groups Projects
Commit 6f41dbe4 authored by vkovtun's avatar vkovtun
Browse files

SSDM-8751 Fixing wrong link submitted back from Zenodo and shown in the application report.

parent 1e503d11
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -2,5 +2,5 @@ label = Zenodo Exports API ...@@ -2,5 +2,5 @@ label = Zenodo Exports API
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.JythonIngestionService class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.JythonIngestionService
script-path = zenodoExports.py script-path = zenodoExports.py
limit-data-size-megabytes=${zenodo-exports-api-limit-data-size-megabytes:4000} limit-data-size-megabytes=${zenodo-exports-api-limit-data-size-megabytes:4000}
zenodoUrl=${zenodo-exports-api-zenodoUrl:https://localhost} zenodoUrl=https://sandbox.zenodo.org
accessToken=${zenodo-exports-api-accessToken} accessToken=dkN5iagpbJfh4wmK2fM4sVyzCyNmCF6aM5XCZufT9t986HGmk1RGGwUjIdlb
\ No newline at end of file \ No newline at end of file
...@@ -225,7 +225,7 @@ class ZenodoCallable(object): ...@@ -225,7 +225,7 @@ class ZenodoCallable(object):
actionCompleted = True actionCompleted = True
elif publicationJson.get('submitted'): elif publicationJson.get('submitted'):
operationLog.info('Publication #%d submitted. Registering metadata.' % publicationJson.get('id')) operationLog.info('Publication #%d submitted. Registering metadata.' % publicationJson.get('id'))
self.registerPublicationInOpenbis(publicationJson.get('metadata')) self.registerPublicationInOpenbis(publicationJson.get('metadata'), publicationJson.get('links'))
actionCompleted = True actionCompleted = True
else: else:
operationLog.info('Publication #%d not submitted yet.' % publicationJson.get('id')) operationLog.info('Publication #%d not submitted yet.' % publicationJson.get('id'))
...@@ -244,13 +244,13 @@ class ZenodoCallable(object): ...@@ -244,13 +244,13 @@ class ZenodoCallable(object):
return actionCompleted return actionCompleted
def registerPublicationInOpenbis(self, publicationMetadataJson): def registerPublicationInOpenbis(self, publicationMetadataJson, publicationLinksJson):
sessionToken = self.params.get('sessionToken') sessionToken = self.params.get('sessionToken')
v3 = ServiceProvider.getV3ApplicationService() v3 = ServiceProvider.getV3ApplicationService()
id = CustomASServiceCode('publication-api') id = CustomASServiceCode('publication-api')
options = CustomASServiceExecutionOptions() \ options = CustomASServiceExecutionOptions() \
.withParameter('method', 'insertPublication') \ .withParameter('method', 'insertPublication') \
.withParameter('publicationURL', self.selfUrl) \ .withParameter('publicationURL', publicationLinksJson.get('doi')) \
.withParameter('openBISRelatedIdentifiers', self.permIdsStr) \ .withParameter('openBISRelatedIdentifiers', self.permIdsStr) \
.withParameter('name', publicationMetadataJson.get('title')) \ .withParameter('name', publicationMetadataJson.get('title')) \
.withParameter('publicationDescription', publicationMetadataJson.get('description')) \ .withParameter('publicationDescription', publicationMetadataJson.get('description')) \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment