-
Notifications
You must be signed in to change notification settings - Fork 531
metadata export for drafts via API #11398
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
Conversation
This comment has been minimized.
This comment has been minimized.
src/main/java/edu/harvard/iq/dataverse/export/ExportService.java
Outdated
Show resolved
Hide resolved
c7a9458 to
75e6247
Compare
This comment has been minimized.
This comment has been minimized.
Drafts are exported on-the-fly rather than being cached.
75e6247 to
8602eff
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I see some codeQL warnings on this. |
Right. It's preexisting. I kicked of a discussion in Slack about this. |
Thanks, I addressed one of them. Thanks for approving. I'm sending this to QA. |
|
Looks good on my end - tested the various combinations of :latest-published and :draft along with all the metadata exporters. Waiting for the Maven Tests to pass before I merge. Noticed them failing earlier. |
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
|
merging - thanks for the update! |
|
This pull request has been deployed to https://beta.dataverse.org along with an updated croissant jar to handle drafts ( gdcc/exporter-croissant#14 ). I just tested it with this Python script and it seems to work fine: |
What this PR does / why we need it:
#11305 explains that there are use cases where it is desirable to export metadata from datasets while they are still in draft. This pull request delivers this functionality, available via API.
Which issue(s) this PR closes:
Special notes for your reviewer:
Drafts are exported on-the-fly rather than being cached.
The export API is a bit non standard in that it doesn't support our pattern of being able to pass in either the database id or the PID of the dataset. Only the PID is supported. I didn't try to address this. My changes are backward compatible.
From https://github.com/gdcc/dataverse-exporters I only made a pull request to update the Croissant exporter. Once we merge this PR perhaps we can create issues for the remaining exporters to update them as well. Also, in that repo I believe we need to add some more docs to explain that if you upgrade to Dataverse 6.7 you should update exporter whatever to version whatever so that drafts are supported. I gave a heads up about this in the release note snippet.
I had to edit
src/main/java/edu/harvard/iq/dataverse/harvest/server/xoai/DataverseXoaiItemRepository.java. I'm not sure the best way to test it.I took a quick look at making the "export drafts" functionality available via UI but there are a few challenges:
(!DatasetPage.dataset.deaccessioned or (DatasetPage.workingVersion.deaccessioned and DatasetPage.canUpdateDataset())) and !DatasetPage.anonymizedAccess. I didn't want to break anything. By the way, the file page logic is simple (FilePage.fileMetadata.datasetVersion.dataset.released) but perhaps it should match the dataset page? 🤷Suggestions on how to test this:
ddi(ddiandhtmland) andschema.org(schema.organdcroissantat least) had to be updated.Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No.
Is there a release notes update needed for this change?:
Yes, included.
Additional documentation:
Preview docs at https://dataverse-guide--11398.org.readthedocs.build/en/11398/api/native-api.html#export-metadata-of-a-dataset-in-various-formats