-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Combination of EML annotation and custom xml safe generated identifiers raise error on save #2038
Comments
Combination of EML annotation and custom xml safe generated identifiers raise error on save + replaces the use of this.getXMLSafeID() with this.getUniqueEntityId(this) in `EML211.serialize()` to make sure that the identifier is unique. Closes #2038
Hi @laurenwalker, this is a pretty high priority issue as it is preventing us from editing datasets with annotations. Thanks! |
@vchendrix You say that "The problem is that |
@mbjones Happy to explain further. When there are annotations the <?xml version="1.0"?>
<eml:eml xmlns:eml="https://eml.ecoinformatics.org/eml-2.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stmml="http://www.xml-cml.org/schema/stmml-1.1"
packageId="urn:uuid:e727256e-e3ce-42d6-a932-1acada618b9c" system="ess-dive" xsi:schemaLocation="https://eml.ecoinformatics.org/eml-2.2.0 https://eml.ecoinformatics.org/eml-2.2.0/eml.xsd">
<dataset id="urn-uuid-e727256e-e3ce-42d6-a932-1acada618b9c">
... However, the ess-dive theme's identifiers are already xml safe and do not produce a different id and thus I submitted a solution that utilizes an existing function in //Since there is at least one annotation, the dataset node needs to have an id attribute.
- datasetNode.attr("id", this.getXMLSafeID());
+ datasetNode.attr("id", this.getUniqueEntityId(this)); |
This solution looks good to me. Merged to |
Describe the bug
When updating a dataset with a repository that implements a custom MetacatUI theme that generates custom identifiers which are already xml safe (e.g. ess-dive-dd8dedc5a811a10-20220713T153145487), the following error is raised
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The problem is that
eml.packageId
andeml.dataset.id
are the same and that causes this error. Looking in the code I can see that replace the use ofthis.getXMLSafeID()
withthis.getUniqueEntityId(this)
to make sure that the identifier is unique.metacatui/src/js/models/metadata/eml211/EML211.js
Line 952 in 47e7b55
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: