Skip to content
Snippets Groups Projects
Commit 22feac77 authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

fix: add MA openaire rights tag

parent 06adbe1d
No related branches found
No related tags found
No related merge requests found
Pipeline #342460 passed
...@@ -578,33 +578,34 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract { ...@@ -578,33 +578,34 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract {
OaipmhUtilities.firstEnrtryFieldLoader(this.jsonObj, rightsField + DOT_VALUE)); OaipmhUtilities.firstEnrtryFieldLoader(this.jsonObj, rightsField + DOT_VALUE));
rightsResultList.getRights().add(rights); rightsResultList.getRights().add(rights);
} }
// TODO Check open access right here!
if (rightsResultList.getRights().get(0).getValue() != null) {
Rights openAccesRight = new Rights();
openAccesRight.setRightsURI(EU_OPEN_ACCESS);
rightsResultList.getRights().add(openAccesRight);
}
// ** // **
// DARIAH // DARIAH
// ** // **
else if (this.dariah) { else if (this.dariah) {
Rights rights = new Rights();
List<String> rList = OaipmhUtilities.listFieldLoader(this.jsonObj, rightsField); List<String> rList = OaipmhUtilities.listFieldLoader(this.jsonObj, rightsField);
for (String r : rList) { for (String r : rList) {
Rights rights = new Rights();
// Set rights URI assuming every "http://" or "https://" really IS an URI. // Set rights URI assuming every "http://" or "https://" really IS an URI.
if (r.startsWith("http")) { if (r.startsWith("http")) {
rights.setRightsURI(r); rights.setRightsURI(r);
} }
// Set value in every case, even if doubled with URI. // Set value in every case, even if doubled with URI.
rights.setValue(r); rights.setValue(r);
}
rightsResultList.getRights().add(rights); rightsResultList.getRights().add(rights);
}
} }
} }
// Set mandatory if applicable OpenAIRE rights tag!
if (rightsResultList.getRights().get(0).getValue() != null) {
Rights openAccesRight = new Rights();
openAccesRight.setRightsURI(EU_OPEN_ACCESS);
rightsResultList.getRights().add(openAccesRight);
}
return rightsResultList; return rightsResultList;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment