*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • martin.weise/fairnb
1 result
Show changes
Commits on Source (3)
...@@ -98,6 +98,14 @@ class InvenioRDMConnector: ...@@ -98,6 +98,14 @@ class InvenioRDMConnector:
return response return response
def create_doi(self, url: str):
response = rq.post(
url,
headers=self.headers,
).json()
return response
def download_file( def download_file(
self, record_id: str, filename: str, out_path: pathlib.Path, expand: bool = True self, record_id: str, filename: str, out_path: pathlib.Path, expand: bool = True
): ):
......
...@@ -78,15 +78,18 @@ class InvenioRDMEntity(Entity): ...@@ -78,15 +78,18 @@ class InvenioRDMEntity(Entity):
self.record_metadata self.record_metadata
).json() ).json()
record_id = create_response["id"] record_id = create_response["id"]
self.invenio_manager.upload_record(dir_path,
regex, create_doi_response = self.invenio_manager.connector.create_doi(create_response["links"]["reserve_doi"])
only_filename=False if self.location.is_dir() else True) uri = create_doi_response["links"]["doi"]
self.invenio_manager.upload_record(
dir_path,
regex,
only_filename=False if self.location.is_dir() else True)
if self.publish_record: if self.publish_record:
publish_response = self.invenio_manager.publish_record() publish_response = self.invenio_manager.publish_record()
uri = publish_response["links"]["self_doi"] uri = publish_response["links"]["self_doi"]
else:
uri = create_response["links"]["record"] # Invalid until published
metadata = EntityProvenance.new( metadata = EntityProvenance.new(
name=self.name, name=self.name,
......