All Versions
DSpace Documentation
...
Each DSpace metadata field that will be used for the mapping must first be configured as a spring bean of classorg.dspace.importer.external.metadatamapping.MetadataFieldConfig.
| Info | ||
|---|---|---|
| ||
<bean id="dc.title" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig"> <constructor-arg value="dc.title"/> </bean> |
...
| Info | ||
|---|---|---|
| ||
<util:map id="FullprefixMapping" key-type="java.lang.String" value-type="java.lang.String"> <description>Defines the namespace mappin for the SimpleXpathMetadatum contributors</description> <entry key="http://purl.org/dc/elements/1.1/" value="dc"/> <entry key="http://www.w3.org/2005/Atom" value="x"/> </util:map> |
| Info | ||
|---|---|---|
| ||
<util:list id="combinedauthorList" value-type="org.dspace.importer.external.metadatamapping.contributor.MetadataContributor" list-class="java.util.LinkedList"> <ref bean="lastNameContrib"/> <ref bean="firstNameContrib"/> </util:list> |
Finally create a spring bean configuration of classorg.dspace.importer.external.metadatamapping.contributor.CombinedMetadatumContributor. This bean expects 3 values:
| Info | ||
|---|---|---|
| ||
<bean id="authorContrib" class="org.dspace.importer.external.metadatamapping.contributor.CombinedMetadatumContributor"> <property name="separator" value=", "/> <property name="metadatumContributors" ref="combinedauthorList"/> <property name="field" ref="dc.contributor.author"/> </bean> |
Each contributor must also be added to the "MetadataFieldMap" used by the MetadataFieldMapping implementation. Each entry of this map maps a metadata field bean to a contributor. For the contributors created above this results in the following configuration:
| Info | ||
|---|---|---|
| ||
<util:map id="org.dspace.importer.external.metadatamapping.MetadataFieldConfig" value-type="org.dspace.importer.external.metadatamapping.contributor.MetadataContributor"> <entry key-ref="dc.title" value-ref="titleContrib"/> <entry key-ref="dc.contributor.author" value-ref="authorContrib"/> </util:map> |
...
| Class | Description |
|---|---|
| SimpleXpathMetadatumContributor | Use an XPath expression to map the XPath result to a metadatum |
| SimpleMetadataContributor | This contributor is used in plain metadata as exposed above. Mapping is easy because it is based on the key used in the DTO. |
| CombinedMetadatumContributor | Use a LinkedList of MetadataContributor to combine into the value the resulting value for each contributor. |
First read the base documentation on external importing (see above). This documentation explains the implementation of the importer framework using PubMed (http://www.ncbi.nlm.nih.gov/pubmed) as an example.
To be able to do the lookup for our configured import-service, we need to be able to know what URL to use to check for publications. This URL the publication-lookup.url setting defined within the [dspace.dir]/config/modules/publication-lookup.cfg. You may choose to modify this setting or override it within your local.cfg.
This setting can be modified in one of two ways:
baseAddress for beans within the [src]/dspace-api/src/main/resources/spring/spring-dspace-addon-import-services.xml Spring config file.publication-lookup.url=http://eutils.ncbi.nlm.nih.gov/entrez/eutils/publication-lookup.url is set to an asterisk ('*'). This default value will attempt to lookup the publication using ALL configured importServices in the [src]/dspace-api/src/main/resources/spring/spring-dspace-addon-import-services.xml Spring config fileThe PubMed metadata mappings are defined in the [dspace.dir]/config/spring/api/pubmed-integration.xml Spring configuration file. These metadata mappings can be tweaked as desired. The format of this file is described in the "Metadata mapping" section above
These classes are simply implementations based of the base classes defined in importer/external. They add characteristic behavior for services/mapping for the PubMed specific data.