Skip to content

Commit

Permalink
Merged in DSC-1233-PubMed-provider-does-not-work-properly (pull request
Browse files Browse the repository at this point in the history
DSpace#1066)

DSC-1233 PubMed provider does not import type of publication

Approved-by: Giuseppe Digilio
  • Loading branch information
Micheleboychuk authored and atarix83 committed Sep 12, 2023
2 parents 8071287 + 242db0b commit 0cf9933
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -135,9 +136,8 @@ public int getNumberOfResults(String query) {
* @return
*/
private ExternalDataObject getExternalDataObject(ImportRecord record) {
//return 400 if no record were found
if (record == null) {
throw new IllegalArgumentException("No record found for query or id");
if (Objects.isNull(record)) {
return null;
}
ExternalDataObject externalDataObject = new ExternalDataObject(sourceIdentifier);
String id = getFirstValue(record, recordIdMetadata);
Expand Down
10 changes: 4 additions & 6 deletions dspace/config/spring/api/pubmed-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<entry key-ref="oaire.citation.volume" value-ref="volumeContrib"/>
<entry key-ref="oaire.citation.issue" value-ref="issueContrib"/>
<entry key-ref="dc.identifier.doi" value-ref="doiContrib"/>
<entry key-ref="dc.type" value-ref="typeContrib"/>
<entry key-ref="dc.type" value-ref="pubmedTypeContrib"/>

</util:map>

Expand Down Expand Up @@ -151,16 +151,15 @@
<property name="prefixToNamespaceMapping" ref="prefixToNamespaceMapping"/>
</bean>


<bean id="innerTypeContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<bean id="innerPubmedTypeContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="dc.type"/>
<property name="query" value="descendant::PublicationTypeList/PublicationType"/>
<property name="prefixToNamespaceMapping" ref="prefixToNamespaceMapping"/>
<property name="metadataFieldMapping" ref="pubmedMetadataFieldMapping"/>
</bean>

<bean id="typeContrib" class="org.dspace.importer.external.metadatamapping.contributor.MappedMetadataContributor">
<constructor-arg name="innerContributor" ref="innerTypeContrib"/>
<bean id="pubmedTypeContrib" class="org.dspace.importer.external.metadatamapping.contributor.MappedMetadataContributor">
<constructor-arg name="innerContributor" ref="innerPubmedTypeContrib"/>
<constructor-arg name="mapConverter" ref="mapConverterPubmedToCoarPublicationTypes"/>
</bean>

Expand Down Expand Up @@ -231,6 +230,5 @@
these must be present. If multiple are present the result is undefined.
</description>
</bean>


</beans>

0 comments on commit 0cf9933

Please sign in to comment.