Skip to content

Commit

Permalink
118436: Move duplicate MetadataFieldConfig to a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
YanaDePauw committed Sep 30, 2024
1 parent 7851cd8 commit aed813d
Show file tree
Hide file tree
Showing 21 changed files with 339 additions and 838 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
<property name="authUrl" value="${epo.authUrl}" />
<property name="searchUrl" value="${epo.searchUrl}" />
<!-- date filed mapped metadata, see epo-integration.xml -->
<property name="dateFiled" ref="epo.dc.date.filed" />
<property name="applicationNumber" ref="epo.dc.identifier" />
<property name="dateFiled" ref="dc.date.submitted" />
<property name="applicationNumber" ref="dc.identifier" />
</bean>
<bean id="epoMetadataFieldMapping" class="org.dspace.importer.external.epo.service.EpoFieldMapping"/>

Expand Down Expand Up @@ -195,9 +195,4 @@
</bean>
<bean id="ADSMetadataFieldMapping" class="org.dspace.importer.external.ads.ADSFieldMapping"/>

<!-- Metadatafield used to check against if it's already imported or not during the JSONLookupSearcher-->
<bean id="lookupID" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier.other"/>
</bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -29,61 +29,15 @@

<util:map id="mapOfmetadata"
map-class="java.util.HashMap" key-type="java.lang.String" value-type="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<entry key="awardNumber" value-ref="openaireAwardNumber" />
<entry key="fundingStream" value-ref="openaireFundingStream" />
<entry key="awardURI" value-ref="openaireAwardURI" />
<entry key="funderName" value-ref="openaireFunderName" />
<entry key="funderIdentifier" value-ref="openaireFunderIdentifier" />
<entry key="dcTitle" value-ref="openaireTitle" />
<entry key="titleAlternative" value-ref="openaireTitleAlternative" />
<entry key="dcIdentifier" value-ref="openaireIdentifier" />
<entry key="coverageSpatial" value-ref="openaireSpatial" />
<entry key="dcDescription" value-ref="openaireDescription" />
<entry key="dcSubject" value-ref="openaireSubject" />
<entry key="awardNumber" value-ref="oaire.awardNumber" />
<entry key="fundingStream" value-ref="oaire.fundingStream" />
<entry key="awardURI" value-ref="oaire.awardURI" />
<entry key="funderName" value-ref="project.funder.name" />
<entry key="funderIdentifier" value-ref="project.funder.identifier" />
<entry key="dcTitle" value-ref="dc.title" />
<entry key="titleAlternative" value-ref="dc.title.alternative" />
<entry key="coverageSpatial" value-ref="dc.coverage.spatial" />
<entry key="dcSubject" value-ref="dc.subject" />
</util:map>

<bean id="openaireAwardNumber" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="oaire.awardNumber"/>
</bean>

<bean id="openaireFundingStream" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="oaire.fundingStream"/>
</bean>

<bean id="openaireAwardURI" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="oaire.awardURI"/>
</bean>

<bean id="openaireFunderName" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="project.funder.name"/>
</bean>

<bean id="openaireFunderIdentifier" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="project.funder.identifier"/>
</bean>

<bean id="openaireTitle" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.title"/>
</bean>

<bean id="openaireTitleAlternative" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.title.alternative"/>
</bean>

<bean id="openaireIdentifier" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier"/>
</bean>

<bean id="openaireSpatial" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.coverage.spatial"/>
</bean>

<bean id="openaireDescription" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.description"/>
</bean>

<bean id="openaireSubject" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.subject"/>
</bean>

</beans>
</beans>
55 changes: 11 additions & 44 deletions dspace/config/spring/api/ads-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
<!-- allows us to use spring annotations in beans -->

<util:list id="adsMetadataFieldMap" value-type="org.dspace.importer.external.metadatamapping.contributor.MetadataContributor">
<description>Defines which metadatum is mapped on which metadatum. Note that while the key must be unique it
only matters here for postprocessing of the value. The mapped MetadatumContributor has full control over
what metadatafield is generated.
</description>
<description>Defines which metadatum is mapped on which metadatum.</description>
<ref bean="adsAbstractContrib"/>
<ref bean="adsAuthorContrib"/>
<ref bean="adsDoiContrib"/>
Expand All @@ -29,84 +26,54 @@
</util:list>

<bean id="adsTitleContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.title"/>
<property name="field" ref="dc.title"/>
<property name="query" value="/title"/>
</bean>
<bean id="ads.title" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.title"/>
</bean>

<bean id="adsSourceContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.source"/>
<property name="field" ref="dc.source"/>
<property name="query" value="/pub"/>
</bean>
<bean id="ads.source" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.source"/>
</bean>

<bean id="adsLangContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.lang"/>
<property name="field" ref="dc.language.iso"/>
<property name="query" value="/lang"/>
</bean>
<bean id="ads.lang" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.language.iso"/>
</bean>

<bean id="adsKeywordContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.keywrd"/>
<property name="field" ref="dc.subject"/>
<property name="query" value="/keyword"/>
</bean>
<bean id="ads.keywrd" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.subject"/>
</bean>

<bean id="adsIssueContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.issue"/>
<property name="field" ref="dc.date.issued"/>
<property name="query" value="/year"/>
</bean>
<bean id="ads.issue" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.date.issued"/>
</bean>

<bean id="adsIdContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.id"/>
<property name="field" ref="dc.identifier.other"/>
<property name="query" value="/bibcode"/>
</bean>
<bean id="ads.id" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier.other"/>
</bean>

<bean id="adsTypeContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.type"/>
<property name="field" ref="dc.type"/>
<property name="query" value="/doctype"/>
</bean>
<bean id="ads.type" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.type"/>
</bean>

<bean id="adsDoiContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.doi"/>
<property name="field" ref="dc.identifier.doi"/>
<property name="query" value="/doi"/>
</bean>
<bean id="ads.doi" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier.doi"/>
</bean>

<bean id="adsAuthorContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.author"/>
<property name="field" ref="dc.contributor.author"/>
<property name="query" value="/author"/>
</bean>
<bean id="ads.author" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.contributor.author"/>
</bean>

<bean id="adsAbstractContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="ads.abstract"/>
<property name="field" ref="dc.description.abstract"/>
<property name="query" value="/abstract"/>
</bean>
<bean id="ads.abstract" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.description.abstract"/>
</bean>

<bean class="java.lang.Integer" id="maxRetry">
<constructor-arg value="3"/>
Expand Down
44 changes: 9 additions & 35 deletions dspace/config/spring/api/arxiv-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

<util:list id="arxivMetadataFieldMap"
value-type="org.dspace.importer.external.metadatamapping.contributor.MetadataContributor">
<description>Defines which metadatum is mapped on which metadatum.
</description>
<description>Defines which metadatum is mapped on which metadatum.</description>
<ref bean="arxivTitleContrib"/>
<ref bean="arxivSummaryContrib"/>
<ref bean="arxivPublishedContrib"/>
Expand All @@ -27,79 +26,54 @@


<bean id="arxivOtherContrib" class="org.dspace.importer.external.arxiv.metadatamapping.contributor.ArXivIdMetadataContributor">
<property name="field" ref="arxiv.identifier.other"/>
<property name="field" ref="dc.identifier.other"/>
<property name="query" value="ns:id"/>
<property name="prefixToNamespaceMapping" ref="arxivBasePrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.identifier.other" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier.other"/>
</bean>


<bean id="arxivTitleContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="arxiv.title"/>
<property name="field" ref="dc.title"/>
<property name="query" value="ns:title"/>
<property name="prefixToNamespaceMapping" ref="arxivBasePrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.title" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.title"/>
</bean>

<bean id="arxivSummaryContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="arxiv.summary"/>
<property name="field" ref="dc.description.abstract"/>
<property name="query" value="ns:summary"/>
<property name="prefixToNamespaceMapping" ref="arxivBasePrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.summary" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.description.abstract"/>
</bean>

<bean id="arxivPublishedContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathDateFormatMetadataContributor">
<property name="field" ref="arxiv.published"/>
<property name="field" ref="dc.date.issued"/>
<property name="query" value="ns:published"/>
<property name="prefixToNamespaceMapping" ref="arxivBasePrefixToNamespaceMapping"/>
<property name="dateFormatFrom" value="yyyy-MM-dd'T'HH:mm:ss'Z'"/>
<property name="dateFormatTo" value="yyyy-MM-dd"></property>
</bean>
<bean id="arxiv.published" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.date.issued"/>
</bean>

<bean id="arxivDoiContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="arxiv.arxiv.doi"/>
<property name="field" ref="dc.identifier"/>
<property name="query" value="arxiv:doi"/>
<property name="prefixToNamespaceMapping" ref="arxivArxivPrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.arxiv.doi" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier"/>
</bean>

<bean id="arxivJournalContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="arxiv.arxiv.journal_ref"/>
<property name="field" ref="dc.source"/>
<property name="query" value="arxiv:journal_ref"/>
<property name="prefixToNamespaceMapping" ref="arxivArxivPrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.arxiv.journal_ref" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.source"/>
</bean>

<bean id="arxivCategoryTermContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="arxiv.category.term"/>
<property name="field" ref="dc.subject"/>
<property name="query" value="ns:category/@term"/>
<property name="prefixToNamespaceMapping" ref="arxivBasePrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.category.term" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.subject"/>
</bean>

<bean id="arxivAuthorContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleXpathMetadatumContributor">
<property name="field" ref="arxiv.author.name"/>
<property name="field" ref="dc.contributor.author"/>
<property name="query" value="ns:author/name"/>
<property name="prefixToNamespaceMapping" ref="arxivBasePrefixToNamespaceMapping"/>
</bean>
<bean id="arxiv.author.name" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.contributor.author"/>
</bean>

<util:map id="arxivBasePrefixToNamespaceMapping" map-class="java.util.HashMap"
key-type="java.lang.String" value-type="java.lang.String">
Expand Down
12 changes: 6 additions & 6 deletions dspace/config/spring/api/bibtex-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@
</util:list>

<bean id="bibtexJissnContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcJissn"/>
<property name="field" ref="dc.identifier.issn"/>
<property name="key" value="ISSN" />
</bean>

<bean id="bibtexIssuedContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcIssued"/>
<property name="field" ref="dc.date.issued"/>
<property name="key" value="year" />
</bean>

<bean id="bibtexJournalContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcJournal"/>
<property name="field" ref="dc.source"/>
<property name="key" value="journal" />
</bean>

<bean id="bibtexAuthorsContrib" class="org.dspace.importer.external.metadatamapping.contributor.SplitMetadataContributor">
<constructor-arg name="innerContributor">
<bean class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcAuthors"/>
<property name="field" ref="dc.contributor.author"/>
<property name="key" value="author" />
</bean>
</constructor-arg>
<constructor-arg name="regex" value="\sand\s"/>
</bean>

<bean id="bibtexTitleContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcTitle"/>
<property name="field" ref="dc.title"/>
<property name="key" value="title" />
</bean>

<bean id="bibtexTypeContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcType"/>
<property name="field" ref="dc.type"/>
<property name="key" value="type" />
</bean>

Expand Down
14 changes: 7 additions & 7 deletions dspace/config/spring/api/characterseparated-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,37 @@


<bean id="charSepTitleContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcTitle"/>
<property name="field" ref="dc.title"/>
<property name="key" value="0" />
</bean>

<bean id="charSepAuthorsContrib" class="org.dspace.importer.external.metadatamapping.contributor.EnhancedSimpleMetadataContributor">
<property name="field" ref="dcAuthors"/>
<property name="field" ref="dc.contributor.author"/>
<property name="key" value="1" />
</bean>

<bean id="charSepDateContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcIssued"/>
<property name="field" ref="dc.date.issued"/>
<property name="key" value="2" />
</bean>

<bean id="charSepJournalContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcJournal"/>
<property name="field" ref="dc.source"/>
<property name="key" value="3" />
</bean>

<bean id="charSepAbstractContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcAbstract"/>
<property name="field" ref="dc.description.abstract"/>
<property name="key" value="4" />
</bean>

<bean id="charSepJissnContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcJissn"/>
<property name="field" ref="dc.identifier.issn"/>
<property name="key" value="5" />
</bean>

<bean id="charSepTypeContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleMetadataContributor">
<property name="field" ref="dcSubtype"/>
<property name="field" ref="dc.type"/>
<property name="key" value="6" />
</bean>

Expand Down
Loading

0 comments on commit aed813d

Please sign in to comment.