diff --git a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/UnmanagedDOIProvider.java b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/UnmanagedDOIProvider.java index d4e674f8396..472306d6237 100644 --- a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/UnmanagedDOIProvider.java +++ b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/UnmanagedDOIProvider.java @@ -70,7 +70,7 @@ public List getProviderInformation() { @Override public String getProviderType() { - return "unamagedDOI"; + return "unmanagedDOI"; } // PID recognition diff --git a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/XmlMetadataTemplate.java b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/XmlMetadataTemplate.java index a74a9f34bc9..a3954a6aa1d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/XmlMetadataTemplate.java +++ b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/XmlMetadataTemplate.java @@ -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(); @@ -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 @@ -287,7 +287,7 @@ public void writeCreators(XMLStreamWriter xmlw, List authorList, writeEntityElements(xmlw, "creator", null, creatorObj, affiliation, nameIdentifier, nameIdentifierScheme); } - + } } if (nothingWritten) { @@ -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 contributorTypes = new HashSet<>(Arrays.asList("ContactPerson", "DataCollector", "DataCurator", "DataManager", "Distributor", "Editor", - "HostingInstitution", "Other", "Producer", "ProjectLeader", "ProjectManager", "ProjectMember", "RegistrationAgency", "RegistrationAuthority", + private Set 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) { @@ -634,7 +634,7 @@ private void writeEntityElements(XMLStreamWriter xmlw, String elementName, Strin orgName = jo.getString("termName"); } } - + if (isROR) { attributeMap.put("schemeURI", "https://ror.org"); @@ -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); } @@ -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"); // - + ArrayList placeList = new ArrayList(); for (String placePart : place) { if (!StringUtils.isBlank(placePart)) { @@ -1396,7 +1396,7 @@ private void writeGeoLocations(XMLStreamWriter xmlw, DvObject dvObject) throws X XmlWriterUtil.writeFullElement(xmlw, "geoLocationPlace", Strings.join(placeList, ", ")); xmlw.writeEndElement(); // } - + } boolean boundingBoxFound = false; boolean productionPlaceFound = false; @@ -1537,7 +1537,7 @@ private void writeFundingReferences(XMLStreamWriter xmlw, DvObject dvObject) thr funder = jo.getString("termName"); } } - + xmlw.writeStartElement("fundingReference"); // XmlWriterUtil.writeFullElement(xmlw, "funderName", StringEscapeUtils.escapeXml10(funder)); if (isROR) { diff --git a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DOIDataCiteRegisterService.java b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DOIDataCiteRegisterService.java index a4d788de4df..858c763786d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DOIDataCiteRegisterService.java +++ b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DOIDataCiteRegisterService.java @@ -174,7 +174,7 @@ public static String getMetadataFromDvObject(String identifier, Map metadata, DvObject dvObject) { DoiMetadata doiMetadata = new DoiMetadata(); - + doiMetadata.setIdentifier(identifier.substring(identifier.indexOf(':') + 1)); doiMetadata.setCreators(Arrays.asList(metadata.get("datacite.creator").split("; "))); diff --git a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DataCiteDOIProvider.java b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DataCiteDOIProvider.java index 5630844fb32..fad7d7c0fb3 100644 --- a/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DataCiteDOIProvider.java +++ b/src/main/java/edu/harvard/iq/dataverse/pidproviders/doi/datacite/DataCiteDOIProvider.java @@ -226,8 +226,7 @@ protected String getProviderKeyName() { @Override public String getProviderType() { - // TODO Auto-generated method stub - return null; + return "DOI"; } public String getMdsUrl() { diff --git a/src/main/java/edu/harvard/iq/dataverse/pidproviders/handle/UnmanagedHandlePidProvider.java b/src/main/java/edu/harvard/iq/dataverse/pidproviders/handle/UnmanagedHandlePidProvider.java index 075e10d8164..6093cc6202a 100644 --- a/src/main/java/edu/harvard/iq/dataverse/pidproviders/handle/UnmanagedHandlePidProvider.java +++ b/src/main/java/edu/harvard/iq/dataverse/pidproviders/handle/UnmanagedHandlePidProvider.java @@ -109,6 +109,6 @@ public String getUrlPrefix() { @Override public String getProviderType() { - return "unamagedHandle"; + return "unmanagedHandle"; } } diff --git a/src/main/resources/edu/harvard/iq/dataverse/pidproviders/doi/datacite_metadata_template.xml b/src/main/resources/edu/harvard/iq/dataverse/pidproviders/doi/datacite_metadata_template.xml new file mode 100644 index 00000000000..e69de29bb2d