Skip to content

Commit

Permalink
restore VLT005+VLT006 (mistakenly replaced by VaaS only VLT005A in DA…
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-pol committed Jun 29, 2023
1 parent 43ff73c commit 50f7fee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,10 @@ else if (isMigration) {
}

if (isMigration) {
var otherId = getIdentifiers(ddm)
.filter(Identifier::hasXsiTypeDoi)
.findFirst()
.map(Node::getTextContent)
.orElse(null);

dataVaultFieldBuilder.addBagId(vaultMetadata.getBagId()); // VLT003A
dataVaultFieldBuilder.addNbn(vaultMetadata.getNbn()); // VLT004A
if (null != otherId) // Vault service only
dataVaultFieldBuilder.addDansOtherId(otherId); // VLT005A
dataVaultFieldBuilder.addDansOtherId(vaultMetadata.getOtherId()); // VLT005
dataVaultFieldBuilder.addDansOtherIdVersion(vaultMetadata.getOtherIdVersion()); // VLT006
dataVaultFieldBuilder.addSwordToken(vaultMetadata.getSwordToken()); // VLT007A
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ void toDataverseDataset_should_include_otherId_from_ddm() throws Exception {
.withDefaultPrettyPrinter()
.writeValueAsString(result);

assertThat(str).doesNotContain("doi:a/b");
assertThat(str).contains("10.17026/easy-dans-doi");
assertThat(str).contains("doi:a/b");
assertThat(str).doesNotContain("10.17026/easy-dans-doi");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public void all_mappings_produces_most_documented_sub_fields() throws Exception
// VLT001-2 dansDataversePid(version) generated by dataverse
"dansBagId", // VLT003A
"dansNbn", // VLT004A
"dansOtherId", // VLT005
"dansOtherIdVersion", // VLT006
"dansSwordToken"); // VLT007A
// TODO terms / restricted files // TRMnnn
assertThat(dastaset.getDatasetVersion().getTermsOfAccess())
Expand Down

0 comments on commit 50f7fee

Please sign in to comment.