<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
    default-lazy-init="true">

    <bean class="org.dspace.external.service.impl.ExternalDataServiceImpl"/>

    <bean class="org.dspace.importer.external.liveimportclient.service.LiveImportClientImpl"/>

    <bean class="org.dspace.external.provider.impl.MockDataProvider" init-method="init">
        <property name="sourceIdentifier" value="mock"/>
    </bean>

    <!-- SHERPA data providers set up to use mock SHERPA service -->
    <bean class="org.dspace.external.provider.impl.SHERPAv2JournalISSNDataProvider" init-method="init">
        <property name="sourceIdentifier" value="sherpaJournalIssn"/>
        <property name="sherpaService" ref="org.dspace.app.sherpa.MockSHERPAService" />
        <property name="supportedEntityTypes">
            <list>
                <value>Journal</value>
            </list>
        </property>
    </bean>
    <bean class="org.dspace.external.provider.impl.SHERPAv2JournalDataProvider" init-method="init">
        <property name="sourceIdentifier" value="sherpaJournal"/>
        <property name="sherpaService" ref="org.dspace.app.sherpa.MockSHERPAService" />
        <property name="supportedEntityTypes">
            <list>
                <value>Journal</value>
            </list>
        </property>
    </bean>
    <bean class="org.dspace.external.provider.impl.SHERPAv2PublisherDataProvider" init-method="init">
        <property name="sourceIdentifier" value="sherpaPublisher"/>
        <property name="sherpaService" ref="org.dspace.app.sherpa.MockSHERPAService" />
        <property name="supportedEntityTypes">
            <list>
                <value>OrgUnit</value>
            </list>
        </property>
    </bean>
    <bean class="org.dspace.external.provider.impl.OrcidV3AuthorDataProvider" init-method="init">
        <property name="sourceIdentifier" value="orcid"/>
        <property name="orcidUrl" value="${orcid.domain-url}" />
        <property name="clientId" value="${orcid.application-client-id}" />
        <property name="clientSecret" value="${orcid.application-client-secret}" />
        <property name="OAUTHUrl" value="${orcid.token-url}" />
        <property name="orcidRestConnector" ref="orcidRestConnector"/>
        <property name="supportedEntityTypes">
            <list>
                <value>Person</value>
            </list>
        </property>
    </bean>

    <bean id="orcidRestConnector" class="org.dspace.external.OrcidRestConnector">
        <constructor-arg value="${orcid.api-url}"/>
    </bean>
    
    <bean id="orcidPublicationDataProvider" class="org.dspace.external.provider.impl.OrcidPublicationDataProvider">
        <property name="sourceIdentifier" value="orcidWorks"/>
        <property name="fieldMapping" ref="orcidPublicationDataProviderFieldMapping"/>
        <property name="supportedEntityTypes">
            <list>
                <value>Publication</value>
            </list>
        </property>
    </bean>

    <bean id="pubmedLiveImportDataProvider" class="org.dspace.external.provider.impl.LiveImportDataProvider">
        <property name="metadataSource" ref="pubmedImportService"/>
        <property name="sourceIdentifier" value="pubmed"/>
        <property name="recordIdMetadata" value="dc.identifier.other"/>
        <property name="supportedEntityTypes">
            <list>
                <value>Publication</value>
                <value>none</value>
            </list>
        </property>
    </bean>

    <bean id="scopusLiveImportDataProvider" class="org.dspace.external.provider.impl.LiveImportDataProvider">
        <property name="metadataSource" ref="ScopusImportService"/>
        <property name="sourceIdentifier" value="scopus"/>
        <property name="recordIdMetadata" value="dc.identifier.scopus"/>
        <property name="supportedEntityTypes">
            <list>
                <value>Publication</value>
            </list>
        </property>
    </bean>
    
    <bean class="org.dspace.app.suggestion.MockSuggestionExternalDataSource" />

    <bean id="dataciteLiveImportDataProvider" class="org.dspace.external.provider.impl.LiveImportDataProvider">
        <property name="metadataSource" ref="DataCiteImportService"/>
        <property name="sourceIdentifier" value="datacite"/>
        <property name="recordIdMetadata" value="dc.identifier.doi"/>
        <property name="supportedEntityTypes">
            <list>
                <value>Publication</value>
                <value>none</value>
            </list>
        </property>
    </bean>
</beans>

