-
Notifications
You must be signed in to change notification settings - Fork 488
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
Feature/1013 add bibtex support #3020
Changes from all commits
3b5d1bb
dc48119
7c5f770
e976d2f
a578786
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,7 +143,8 @@ public BundleDownloadInstance datafileBundle(@PathParam("fileId") Long fileId, @ | |
|
||
downloadInstance.setFileCitationEndNote(datasetService.createCitationXML(datasetVersion, fileMetadata)); | ||
downloadInstance.setFileCitationRIS(datasetService.createCitationRIS(datasetVersion, fileMetadata)); | ||
|
||
downloadInstance.setFileCitationBibtex(datasetService.createCitationBibtex(datasetVersion, fileMetadata)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bmckinney does this mean that the bibtex citation will be available via API? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pdurbin I believe this means that it will be included in the zip file produced by datafile/bundle/{fileId} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh. What if I want to get the citation in bibtex format via API? Might be nice. And you could write an integration test around it. |
||
|
||
ByteArrayOutputStream outStream = null; | ||
outStream = new ByteArrayOutputStream(); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmckinney I mentioned a while ago that it would be great to have unit tests for this
createCitationBibtex
method but it hasn't been until today at http://irclog.iq.harvard.edu/dataverse/2016-03-22#i_33154 that I got around to explaining my suggestion. As we discussed, it boils down to usingDatasetVersionDTO
andFileMetadataDTO
objects rather than the non-DTO "entity" equivalents you're using now. To see some DTO objects in action see https://github.com/IQSS/dataverse/blob/v4.3/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java and the unit tests that exercise them at https://github.com/IQSS/dataverse/blob/v4.3/src/test/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtilTest.javaThe advantage of using these DTO objects is that you can run the unit tests without having PostgreSQL running.
@scolapasta just asked @kcondon to take a look at this pull request (#3020) so you may want to ping @scolapasta on if he'd like you to add unit tests.