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

Support additional Exporter MIME Types #10295

Merged
merged 29 commits into from
Jun 27, 2024
Merged

Conversation

lubitchv
Copy link
Contributor

@lubitchv lubitchv commented Feb 2, 2024

What this PR does / why we need it:
Per comments, this PR which originally added a PDF formatted DDI codebook exporter has been reduced to just adding "." as a possible response type in the exporter API. The exporter itself now follows the external exporter model and is in the gdcc/exporter-ddipdf repo.

Which issue(s) this PR closes:
Closes #9481

Special notes for your reviewer:

Suggestions on how to test this:
See comments at the end.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

@pdurbin pdurbin added the Size: 3 A percentage of a sprint. 2.1 hours. label Feb 28, 2024
@pdurbin pdurbin changed the title 9481 pdf codebook Provide DDI codebook in PDF format Feb 28, 2024
@pdurbin pdurbin added the Type: Feature a feature request label Feb 28, 2024
@qqmyers
Copy link
Member

qqmyers commented Apr 4, 2024

@lubitchv - have you been able to look at using the new external exporter mechanism for this? It would be nice to have a real exporter use it and that would allow v6.2 (v6.1?) instances to drop it in, but since you created this ~in parallel, I don't think we should hold this up if you'd rather this go forward as is (or if we need to see if anyone else is interested/able to make the changes to package it as an external exporter jar).

@lubitchv
Copy link
Contributor Author

lubitchv commented Apr 4, 2024

No, I did not yet looked at the external exporters. If you could push this PR as it is it would be great. I do plan to look at the external exporters, just did not have time to do that.

qqmyers added a commit to gdcc/dataverse-exporters that referenced this pull request Apr 10, 2024
@qqmyers qqmyers self-assigned this Apr 10, 2024
@qqmyers
Copy link
Member

qqmyers commented Apr 17, 2024

The current plan is to use the separate PR at gdcc/dataverse-exporters#11 to produce an external jar for the ddi pdf exporter and to modify this PR to just include changes/docs required in the core repository. Changes TBD so this is waiting for changes before continuing through review/QA.

@pdurbin pdurbin assigned pdurbin and unassigned pdurbin May 1, 2024
@pdurbin
Copy link
Member

pdurbin commented Jun 7, 2024

@qqmyers is that still the plan? To use https://github.com/gdcc/dataverse-exporters ?

I'm asking because I prefer a separate repo, like I did for https://github.com/gdcc/exporter-croissant

Either way, this PR needs to be converted to "docs only", right? Should this be moved back to "in progress"?

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

Code will go to https://github.com/gdcc/exporter-ddipdf. This PR will just be the api change.


@Override
public String getFormatName() {
return "pdf";
Copy link
Member

Choose a reason for hiding this comment

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

Should probably be more unique than this - perhaps ddi-pdf or codebookpdf? (I see the HTML Codebook exporter is just 'html' but with external exporters allowed, it would be better to avoid accidental name conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it has to correspond to the name in the api call for exporters and in UI page call for the exporter, in other words it is a name of the exporter that is used in calls of the exporter


@Override
public String getMediaType() {
return MediaType.WILDCARD;
Copy link
Member

Choose a reason for hiding this comment

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

Can this be pdf? I see that Datasets adds / but does this have to match that to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried pdf, it does not seem to work and the only thing that worked was WILDCARD

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:outline="http://worldbank.org/toolkit/cdrom/outline" exclude-result-prefixes="outline">
<xsl:param name="language-code" select="'en'"/>
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean it is always using en? Or is there some way that the language code is getting sent in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is always using English in this case. I do not know how to sent to xsl, that is why I were asking you about the language.

@@ -206,7 +206,7 @@ public Response getDataset(@Context ContainerRequestContext crc, @PathParam("id"
// WORKS on published datasets, which are open to the world. -- L.A. 4.5
@GET
@Path("/export")
@Produces({"application/xml", "application/json", "application/html", "application/ld+json" })
@Produces({"application/xml", "application/json", "application/html", "*/*" })
Copy link
Member

Choose a reason for hiding this comment

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

@lubitchv - Is this the only line that needs to get into core Dataverse at this point? And if so, can it leave the application/ld_json and add / after that? (Then all the current internal exporters are covered explicitly - a minor point.)

Beyond that, #10533 is adding a place to document new exporters in the guides, so it would be nice to add the new ddi-pdf exporter there, but, if this line is needed to make it work and we want that in v.6.3, we 'll need a one line PR asap and the docs could get updated afterwards.

BTW - just created a gdcc/exporter-ddipdf and am asking Oliver to help get the jar out to maven central. I'll add you to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think "/" can be added after "application/ld+json"

Copy link
Member

Choose a reason for hiding this comment

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

@lubitchv - great - if you can make this change and delete the rest of the changes, this can go forward.

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

Coordinating w/ @lubitchv and @poikilotherm, the ddipdf previewer is now in https://github.com/gdcc/exporter-ddipdf and this PR is just a one line change to add "." to the list of possible mimetypes exporters can produce, which is a general improvement to support external exporters.

For QA, probably regression testing is all that's needed, although on could check the open api output (assuming that includes allowed mimetpyes).

@qqmyers qqmyers added this to the 6.3 milestone Jun 25, 2024
@qqmyers qqmyers changed the title Provide DDI codebook in PDF format Support additional Exporter MIME Types Jun 26, 2024
@sekmiller sekmiller self-assigned this Jun 27, 2024
@sekmiller sekmiller merged commit 8fc3f0d into IQSS:develop Jun 27, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours. Type: Feature a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XML to PDF converter for codebook 2.5
4 participants