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

file citation via API #10246

Merged
merged 15 commits into from
Feb 16, 2024
Merged

file citation via API #10246

merged 15 commits into from
Feb 16, 2024

Conversation

pdurbin
Copy link
Member

@pdurbin pdurbin commented Jan 18, 2024

What this PR does / why we need it:

Returns a file citation like this:

{
    "status": "OK",
    "data": {
        "message": "Finch, Fiona, 2024, \"Darwin's Finches\", <a href=\"https://doi.org/10.5072/FK2/PULAPK\" target=\"_blank\">https://doi.org/10.5072/FK2/PULAPK</a>, Root, DRAFT VERSION; file.txt [fileName]"
    }
}

This will be used by the the file landing page in the new frontend. See IQSS/dataverse-client-javascript#117

Which issue(s) this PR closes:

Special notes for your reviewer:

As requested in the issue, I followed the conventions in for the dataset-level equivalent of getting the citation: https://guides.dataverse.org/en/6.0/api/native-api.html#get-citation It was added in PR #9592 and updated in PR #10121.

This means that passing the dataset version is required.

I'm somewhat confused by what "direct" means. I see it was added in a commit by @qqmyers in c0c852f . I hope I'm using it right. Some Javadoc would be welcome.

Suggestions on how to test this:

Create datasets, upload files, check the file citation JSON for drafts, published, and deaccessioned. Note that there are automated tests for all of these cases.

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?:

Included.

Additional documentation:

Included: https://dataverse-guide--10246.org.readthedocs.build/en/10246/api/native-api.html#get-file-citation-as-json

@pdurbin pdurbin self-assigned this Jan 18, 2024

This comment has been minimized.

@coveralls
Copy link

coveralls commented Jan 22, 2024

Coverage Status

coverage: 20.134% (-0.007%) from 20.141%
when pulling a2194d9 on 10240-file-citation
into 98231c5 on develop.

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

@pdurbin pdurbin marked this pull request as ready for review January 23, 2024 19:08
@pdurbin pdurbin removed their assignment Jan 23, 2024
@pdurbin pdurbin requested a review from GPortas January 23, 2024 19:08
@pdurbin pdurbin added the SPA These changes are required for the Dataverse SPA label Jan 23, 2024

This comment has been minimized.

@GPortas GPortas self-assigned this Jan 24, 2024

This comment has been minimized.

This comment has been minimized.

Conflicts:
src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java

This comment has been minimized.

This comment has been minimized.

@pdurbin pdurbin removed their assignment Feb 9, 2024
@pdurbin
Copy link
Member Author

pdurbin commented Feb 9, 2024

@GPortas et al., I'm ready for more review. Thanks for all the feedback so far!

This comment has been minimized.

@GPortas GPortas self-assigned this Feb 15, 2024
}

@Test
public void testFileCitationToStringHtmlFilePid() throws ParseException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you for applying the requested changes @pdurbin

@GPortas GPortas removed their assignment Feb 15, 2024
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10240-file-citation
ghcr.io/gdcc/configbaker:10240-file-citation

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@sekmiller sekmiller self-assigned this Feb 15, 2024
@sekmiller
Copy link
Contributor

@pdurbin
Copy link
Member Author

pdurbin commented Feb 15, 2024

@sekmiller huh. I can't reproduce it. It shouldn't have anything to do with this PR.

@sekmiller sekmiller merged commit 82585f9 into develop Feb 16, 2024
12 checks passed
@sekmiller sekmiller deleted the 10240-file-citation branch February 16, 2024 15:30
@pdurbin pdurbin added this to the 6.2 milestone Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 10 A percentage of a sprint. 7 hours. SPA: File Page SPA These changes are required for the Dataverse SPA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an endpoint to retrieve the file citation
7 participants