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

fix: insert correct identifierType into DataCite export XML #10759

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public List<String> getProviderInformation() {

@Override
public String getProviderType() {
return "unamagedDOI";
return "unmanagedDOI";
}

// PID recognition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void generateXML(DvObject dvObject, OutputStream outputStream) throws XM
// Could/should use dataset metadata language for metadata from DvObject itself?
String language = null; // machine locale? e.g. for Publisher which is global
String metadataLanguage = null; // when set, otherwise = language?

//QDR - used to get ROR name from ExternalVocabularyValue via pidProvider.get
GlobalId pid = null;
pid = dvObject.getGlobalId();
Expand Down Expand Up @@ -211,7 +211,7 @@ private void writeTitles(XMLStreamWriter xmlw, DvObject dvObject, String languag
* from the OpenAire list (the last from PermaLinks) ToDo - If we add,e.g., an
* ARK or PURL provider, this code has to change or we'll need to refactor so
* that the identifiertype and id value can be sent via the JSON/ORE
*
*
* @param xmlw
* The Steam writer
* @param dvObject
Expand Down Expand Up @@ -287,7 +287,7 @@ public void writeCreators(XMLStreamWriter xmlw, List<DatasetAuthor> authorList,
writeEntityElements(xmlw, "creator", null, creatorObj, affiliation, nameIdentifier, nameIdentifierScheme);
}


}
}
if (nothingWritten) {
Expand Down Expand Up @@ -574,8 +574,8 @@ private void writeContributors(XMLStreamWriter xmlw, DvObject dvObject) throws X
}

//List from https://schema.datacite.org/meta/kernel-4/include/datacite-contributorType-v4.xsd
private Set<String> contributorTypes = new HashSet<>(Arrays.asList("ContactPerson", "DataCollector", "DataCurator", "DataManager", "Distributor", "Editor",
"HostingInstitution", "Other", "Producer", "ProjectLeader", "ProjectManager", "ProjectMember", "RegistrationAgency", "RegistrationAuthority",
private Set<String> contributorTypes = new HashSet<>(Arrays.asList("ContactPerson", "DataCollector", "DataCurator", "DataManager", "Distributor", "Editor",
"HostingInstitution", "Other", "Producer", "ProjectLeader", "ProjectManager", "ProjectMember", "RegistrationAgency", "RegistrationAuthority",
"RelatedPerson", "ResearchGroup", "RightsHolder", "Researcher", "Sponsor", "Supervisor", "WorkPackageLeader"));

private String getCanonicalContributorType(String contributorType) {
Expand Down Expand Up @@ -634,7 +634,7 @@ private void writeEntityElements(XMLStreamWriter xmlw, String elementName, Strin
orgName = jo.getString("termName");
}
}

if (isROR) {

attributeMap.put("schemeURI", "https://ror.org");
Expand Down Expand Up @@ -1144,7 +1144,7 @@ private static String getCanonicalPublicationType(String pubIdType) {
// Add entry for Handle,Perma protocols so this can be used with GlobalId/getProtocol()
relatedIdentifierTypeMap.put("hdl".toLowerCase(), "Handle");
relatedIdentifierTypeMap.put("perma".toLowerCase(), "URL");

}
return relatedIdentifierTypeMap.get(pubIdType);
}
Expand Down Expand Up @@ -1386,7 +1386,7 @@ private void writeGeoLocations(XMLStreamWriter xmlw, DvObject dvObject) throws X
geoLocationsWritten = XmlWriterUtil.writeOpenTagIfNeeded(xmlw, "geoLocations", geoLocationsWritten);
for (String[] place : places) {
xmlw.writeStartElement("geoLocation"); // <geoLocation>

ArrayList<String> placeList = new ArrayList<String>();
for (String placePart : place) {
if (!StringUtils.isBlank(placePart)) {
Expand All @@ -1396,7 +1396,7 @@ private void writeGeoLocations(XMLStreamWriter xmlw, DvObject dvObject) throws X
XmlWriterUtil.writeFullElement(xmlw, "geoLocationPlace", Strings.join(placeList, ", "));
xmlw.writeEndElement(); // </geoLocation>
}

}
boolean boundingBoxFound = false;
boolean productionPlaceFound = false;
Expand Down Expand Up @@ -1537,7 +1537,7 @@ private void writeFundingReferences(XMLStreamWriter xmlw, DvObject dvObject) thr
funder = jo.getString("termName");
}
}

xmlw.writeStartElement("fundingReference"); // <fundingReference>
XmlWriterUtil.writeFullElement(xmlw, "funderName", StringEscapeUtils.escapeXml10(funder));
if (isROR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static String getMetadataFromDvObject(String identifier, Map<String, Stri
public static String getMetadataForDeactivateIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) {

DoiMetadata doiMetadata = new DoiMetadata();

doiMetadata.setIdentifier(identifier.substring(identifier.indexOf(':') + 1));
doiMetadata.setCreators(Arrays.asList(metadata.get("datacite.creator").split("; ")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ protected String getProviderKeyName() {

@Override
public String getProviderType() {
// TODO Auto-generated method stub
return null;
return "DOI";
}

public String getMdsUrl() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ public String getUrlPrefix() {

@Override
public String getProviderType() {
return "unamagedHandle";
return "unmanagedHandle";
}
}
Loading