Skip to content

file citation via API - #10246

Merged
sekmiller merged 15 commits into
developfrom
10240-file-citation
Feb 16, 2024
Merged

sekmiller merged 15 commits into
developfrom
10240-file-citation

Conversation

@pdurbin

@pdurbin pdurbin commented Jan 18, 2024 •

Copy link
Copy Markdown
Member

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
@github-actions

This comment has been minimized.

@pdurbin
pdurbin force-pushed the 10240-file-citation branch from 926ebfb to 5214d7b Compare January 22, 2024 15:15
@coveralls

coveralls commented Jan 22, 2024 •

Copy link
Copy Markdown

Coverage Status

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

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@pdurbin
pdurbin force-pushed the 10240-file-citation branch from 286657f to f34f82b Compare January 22, 2024 21:21
@github-actions

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
@github-actions

This comment has been minimized.

@GPortas GPortas self-assigned this Jan 24, 2024
Comment thread doc/sphinx-guides/source/api/native-api.rst Outdated
Comment thread doc/sphinx-guides/source/api/native-api.rst Outdated
Comment thread doc/sphinx-guides/source/api/native-api.rst
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Files.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Files.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Files.java Outdated
Comment thread src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java Outdated
Comment thread src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java Outdated
Comment thread src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java Outdated
Comment thread src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Conflicts:
src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@pdurbin pdurbin removed their assignment Feb 9, 2024
@pdurbin

pdurbin commented Feb 9, 2024

Copy link
Copy Markdown
Member Author

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

@github-actions

This comment has been minimized.

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

@Test
public void testFileCitationToStringHtmlFilePid() throws ParseException {

Copy link
Copy Markdown
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!

@GPortas GPortas left a comment

Copy link
Copy Markdown
Contributor

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
@github-actions

Copy link
Copy Markdown

📦 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
Copy Markdown
Contributor

@pdurbin

pdurbin commented Feb 15, 2024

Copy link
Copy Markdown
Member Author

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

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