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

Make Dataverse produce valid DDI 3648 #9484

Merged
merged 22 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5b015a8
first quick rearrangements in the ddi export util (#3648)
landreev Mar 23, 2023
d5f1e84
rewrote the sumDscr section method to comply with the order of elemen…
landreev Mar 23, 2023
1517b59
added a couple of todo:s as reminders #3648
landreev Mar 23, 2023
b8dddac
rearranged the geographicCoverage fields, to maintain the order in th…
landreev Mar 24, 2023
645c343
This should be enough to produce a valid ddi w/no constraint or schem…
landreev Mar 24, 2023
e79a414
more/better sequence order fixes. #3648
landreev Mar 28, 2023
ce9a941
changed this test so that it does NOT expect the exported xml to be i…
landreev Mar 28, 2023
9eacbe3
updated mini-dataset ddi export #3648
landreev Mar 28, 2023
5297fb8
wrong file, oops #3648
landreev Mar 28, 2023
bfb72cd
updated mini-dataset ddi export #3648
landreev Mar 28, 2023
bf21975
the "full", all-fields-populated dataset export, updated. #3648
landreev Mar 28, 2023
82debde
tests (should be passing now). #3648
landreev Mar 28, 2023
de66928
Merge branch 'develop' into 3648-invalid-ddi
landreev Mar 29, 2023
308a8ee
comments (#3648)
landreev Mar 29, 2023
496ab1c
the json "all fields" that @kcondon fixed (making it importable via t…
landreev Apr 11, 2023
35db2a8
just a comment that was no longer needed. #3648
landreev Apr 14, 2023
b6c2599
made the sample "all default fields" dataset json we provide in the g…
landreev Apr 17, 2023
14603c2
adjusted the ddi exporter to accommodate productionPlace having been …
landreev Apr 19, 2023
74497e5
Got rid of the dubious "role=logo" attribute export. #3648
landreev Apr 19, 2023
4717311
cleaned up a comment to satisfy style checker. #3648
landreev Apr 19, 2023
9545531
changed an exception catch that was resulting in a misleading erro me…
landreev Apr 20, 2023
b9bb909
Merge branch 'develop' into 3648-invalid-ddi
landreev Apr 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions scripts/api/data/dataset-create-new-all-default-fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,9 @@
},
{
"typeName": "productionPlace",
"multiple": false,
"multiple": true,
"typeClass": "primitive",
"value": "ProductionPlace"
"value": ["ProductionPlace"]
},
{
"typeName": "contributor",
Expand Down Expand Up @@ -899,51 +899,51 @@
"typeName": "westLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "10"
"value": "-72"
},
"eastLongitude": {
"typeName": "eastLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "20"
"value": "-70"
},
"northLongitude": {
"typeName": "northLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "30"
"value": "43"
},
"southLongitude": {
"typeName": "southLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "40"
"value": "42"
}
},
{
"westLongitude": {
"typeName": "westLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "50"
"value": "-18"
},
"eastLongitude": {
"typeName": "eastLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "60"
"value": "-13"
},
"northLongitude": {
"typeName": "northLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "70"
"value": "29"
},
"southLongitude": {
"typeName": "southLongitude",
"multiple": false,
"typeClass": "primitive",
"value": "80"
"value": "28"
}
}
]
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/export/ExportService.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void exportFormat(Dataset dataset, String formatName) throws ExportExcept
if (e.getProviderName().equals(formatName)) {
DatasetVersion releasedVersion = dataset.getReleasedVersion();
if (releasedVersion == null) {
throw new IllegalStateException("No Released Version");
throw new ExportException("No published version found during export. " + dataset.getGlobalId().toString());
}
final JsonObjectBuilder datasetAsJsonBuilder = JsonPrinter.jsonAsDatasetDto(releasedVersion);
cacheExport(releasedVersion, formatName, datasetAsJsonBuilder.build(), e);
Expand All @@ -263,7 +263,18 @@ public void exportFormat(Dataset dataset, String formatName) throws ExportExcept
} catch (ServiceConfigurationError serviceError) {
throw new ExportException("Service configuration error during export. " + serviceError.getMessage());
} catch (IllegalStateException e) {
throw new ExportException("No published version found during export. " + dataset.getGlobalId().toString());
// IllegalStateException can potentially mean very different, and
// unexpected things. An exporter attempting to get a single primitive
// value from a fieldDTO that is in fact a Multiple and contains a
// json vector (this has happened, for example, when the code in the
// DDI exporter was not updated following a metadata fieldtype change),
// will result in IllegalStateException.
throw new ExportException("IllegalStateException caught when exporting "
+ formatName
+ " for dataset "
+ dataset.getGlobalId().toString()
+ "; may or may not be due to a mismatch between an exporter code and a metadata block update. "
+ e.getMessage());
}

//As with exportAll, we should update the lastexporttime for the dataset
Expand Down
Loading