-
Notifications
You must be signed in to change notification settings - Fork 494
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
4597 Fix invalid identify response. #7062
4597 Fix invalid identify response. #7062
Conversation
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.
@JingMa87 and I are pretty sure we want some of the values, such as "repositoryIdentifier" to be configurable.
scheme.appendChild(doc.createTextNode("oai")); | ||
oaiIdentifier.appendChild(scheme); | ||
Element repositoryIdentifier = doc.createElement("repositoryIdentifier"); | ||
repositoryIdentifier.appendChild(doc.createTextNode("dataverse.org")); |
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.
@pdurbin The coverage decreased, do you need a test for all the functions people add? |
@JingMa87 no, that's not necessary. I see you made some changes. Are you ready for more code review? |
@pdurbin Go ahead. |
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.
I left comments in my review. In addition, please resolve the merge conflicts.
@@ -282,7 +282,7 @@ | |||
|
|||
<p:commandButton id="updateEditDataFilesButtonsForUpload" action="#{EditDatafilesPage.uploadFinished()}" update="datasetForm:editDataFilesButtons" rendered="#{showFileButtonUpdate}" style="display:none"/> | |||
<p:commandButton id="updateEditDataFilesButtonsForDelete" action="#{EditDatafilesPage.deleteFilesCompleted()}" update="datasetForm:editDataFilesButtons" rendered="#{showFileButtonUpdate}" style="display:none"/> | |||
<p:commandButton id="AllUploadsFinished" action="#{EditDatafilesPage.uploadFinished()}" update="@form,datasetForm:fileUpload,datasetForm:dropBoxUserButton,datasetForm:uploadMessage,datasetForm:rsyncPanel,datasetForm:filesCounts,datasetForm:filesTable" oncomplete="javascript:bind_bsui_components();javascript:uploadWidgetDropMsg();" style="display:none"/> |
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.
Why is this change to @form
in this pull request?
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.
Good point, I was testing some new functionality but inadvertently pushed these changes so I'll revert them. Same applies to immediate="true"
.
src/main/webapp/dataset.xhtml
Outdated
@@ -1589,7 +1589,7 @@ | |||
</ui:fragment> | |||
<div class="button-block"> | |||
<p:commandButton styleClass="btn btn-default" value="#{bundle.continue}" | |||
onclick="PF('publishDataset').hide();PF('blockDatasetForm').hide();" action="#{DatasetPage.releaseDataset}" immediate="true"/> |
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.
Why is this change to immediate="true"
true` in this pull request?
@@ -0,0 +1 @@ | |||
Added the following database options: Scheme, RepositoryIdentifier, Delimiter, SampleIdentifier. |
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.
Can you please change all these (in the code too, of course) to start with "Harvesting"? That is:
:HarvestingScheme, :HarvestingRepositoryIdentifier, :HarvestingDelimiter, :HarvestingSampleIdentifier
Otherwise, they're too generic, especially :Scheme or :Delimiter.
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.
Whoops, I jumped the gun. Can you please have these start with "Oiapmh" instead? Like this:
:OaipmhScheme, :OaipmhRepositoryIdentifier, :OaipmhDelimiter, :OaipmhSampleIdentifier
Also, can you please document these in doc/sphinx-guides/source/installation/config.rst? Thanks!
String scheme = settingsService.getValueForKey(SettingsServiceBean.Key.Scheme, "oai"); | ||
String repositoryIdentifier = settingsService.getValueForKey(SettingsServiceBean.Key.RepositoryIdentifier, "dataverse.org"); | ||
String delimiter = settingsService.getValueForKey(SettingsServiceBean.Key.Delimiter, ":"); | ||
String sampleIdentifier = settingsService.getValueForKey(SettingsServiceBean.Key.SampleIdentifier, "doi:10.7910/DVN/1HE30F"); |
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.
In http://oval.base-search.net this DOI is giving an error:
ERROR: Identify response well-formed but invalid: Element '{http://www.openarchives.org/OAI/2.0/oai-identifier}sampleIdentifier': [facet 'pattern'] The value 'doi:10.7910/DVN/1HE30F' is not accepted by the pattern 'oai:[a-zA-Z][a-zA-Z0-9-](.[a-zA-Z][a-zA-Z0-9-])+:[a-zA-Z0-9-_.!~*'();/?:@&=+$,%]+'., line 5
In context:
As of 7ebdb42 one validator was looking good: beforeafterBut another one was still showing errors: beforeafterIf it's possible to fix all of these, great! If not, no problem, we're happy for any improvement! Thanks! |
@pdurbin The reason for the error is that the sampleIdentifier has to start with "oai", which is actually not correct for Dataverse since a typical identifier starts with "doi". If this is a problem, we don't necessarily have to use these elements like scheme and sampleIdentifier. The parent |
@JingMa87 I love the idea of removing the description element and having fewer database options. |
@pdurbin You can review the changes now. That XOAI library is really not user friendly tbh. 😦 |
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.
To goal is for the response to the OAI-PMH "Identify" verb to be compliant with the spec, to validate.
What this code seems to do is remove the "description" element, or make it empty, I haven't tested the code.
From looking at demo, there doesn't seem to be anything interesting in this element, just a line about the Java library we use. Here's a screenshot:
I guess I have a slight concern that this is a backward incompatible change but again, since there seems to be nothing of value in "description" blanking it out or removing it seems like an ok approach to me so I'm moving it to QA.
@kcondon you might also want to get opinions from @landreev and/or @jggautier since this is harvesting related.
@pdurbin Would you mind checking with Leonid and Julian on the validity of that approach? I think that should happen before it gets to QA. |
@kcondon sure. Can do. For now I parked this in code review. |
That I'm surprised this was causing the response to be invalid though; I thought the spec basically said there could be any free style xml inside that |
Thanks for the comment from @landreev and the 👍 from @jggautier. I'm moving this to QA. |
@landreev I don't know if they changed it in the meantime but the OAI-PMH XSD says that the content of the description element should have an XSD which determines the child elements (http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd). |
What this PR does / why we need it: Changes the Identify response for a OAI PMH request so it's XSD valid.
Which issue(s) this PR closes: 4597
Closes #4597
Special notes for your reviewer: It's looking good
Suggestions on how to test this: Example call: https://dataverse.harvard.edu/oai?verb=Identify
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?: Perhaps
Additional documentation: