<beans>

 <subprocessor id="eml200Subprocessor"
  class="org.dataone.cn.indexer.parser.ScienceMetadataDocumentSubprocessor">
  <property name="matchDocument"
   value="/d100:systemMetadata/formatId[text() = 'eml://ecoinformatics.org/eml-2.0.0']"></property>
  <property name="fieldList">
   <list>
    <bean id="eml.abstract" class="org.dataone.cn.indexer.parser.MergeSolrField">
      <constructor-arg name="name" value="abstract" />
      <constructor-arg name="xpath"
        value="//dataset/abstract/descendant::text()" />
      <constructor-arg name="delimiter" value=" " />
      <property name="multivalue" value="false" />
      <property name="dedupe" value="false" />
    </bean>

    <bean id="eml.keywords" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="keywords" />
        <constructor-arg name="xpath"
            value="//dataset/keywordSet/keyword/text()" />
        <property name="multivalue" value="true" />
        <property name="dedupe" value="true" />
    </bean>

    <bean id="eml.southBoundCoord" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="southBoundCoord" />
        <constructor-arg name="xpath"
            value="//dataset/coverage/geographicCoverage/boundingCoordinates/southBoundingCoordinate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="solrLatitudeConverter" />
    </bean>

    <bean id="eml.northBoundCoord" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="northBoundCoord" />
        <constructor-arg name="xpath"
            value="//dataset/coverage/geographicCoverage/boundingCoordinates/northBoundingCoordinate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="solrLatitudeConverter" />
    </bean>

    <bean id="eml.westBoundCoord" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="westBoundCoord" />
        <constructor-arg name="xpath"
            value="//dataset/coverage/geographicCoverage/boundingCoordinates/westBoundingCoordinate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="solrLongitudeConverter" />
    </bean>

    <bean id="eml.eastBoundCoord" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="eastBoundCoord" />
        <constructor-arg name="xpath"
            value="//dataset/coverage/geographicCoverage/boundingCoordinates/eastBoundingCoordinate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="solrLongitudeConverter" />
    </bean>

    <bean id="eml.beginDate" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="beginDate" />
        <constructor-arg name="xpath"
            value="//dataset/coverage/temporalCoverage/rangeOfDates/beginDate/calendarDate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="dateConverter" />
    </bean>

    <bean id="eml.endDate" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="endDate" />
        <constructor-arg name="xpath"
            value="//dataset/coverage/temporalCoverage/rangeOfDates/endDate/calendarDate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="dateConverter" />
    </bean>
    
    <bean id="eml.pubDate" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="pubDate" />
        <constructor-arg name="xpath" value="//dataset/pubDate/text()" />
        <property name="multivalue" value="false" />
        <property name="converter" ref="dateConverter" />
    </bean>

    <bean id="eml.title" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="title" />
        <constructor-arg name="xpath" value="//dataset/title/text()" />
        <property name="multivalue" value="false" />
    </bean>
    
    <bean id="eml.project" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="project" />
        <constructor-arg name="xpath" value="//dataset/project/title/text()" />
        <property name="multivalue" value="false" />
    </bean> 

    <bean id="eml.author" class="org.dataone.cn.indexer.parser.CommonRootSolrField"
            p:multivalue="false"
            p:root-ref="authorNameRoot">
            <constructor-arg name="name" value="author" />
    </bean>
    
    <bean id="authorNameRoot" class="org.dataone.cn.indexer.parser.utility.RootElement"
        p:name="author"
        p:xPath="//dataset/creator/individualName"
        p:template="[givenName] [surName]">
        <property name="leafs">
            <list>
                <ref bean="givenNameLeaf"/>
                <ref bean="surNameLeaf"/>
            </list>
        </property>
    </bean>
    
    <bean id="eml.author_lname" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="authorLastName" />
        <constructor-arg name="xpath"
            value="//dataset/creator/individualName/surName/text()" />
        <property name="multivalue" value="true" />
    </bean>
    
    <bean id="eml.investigator" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="investigator" />
        <constructor-arg name="xpath"
            value="//dataset/creator/individualName/surName/text()" />
        <property name="multivalue" value="true" />
    </bean>
    
    <bean id="eml.origin" class="org.dataone.cn.indexer.parser.CommonRootSolrField"
        p:multivalue="true"
        p:root-ref="originRoot">
        <constructor-arg name="name" value="origin" />
    </bean>
    
    <bean id="originRoot" class="org.dataone.cn.indexer.parser.utility.RootElement"
        p:name="origin"
        p:xPath="//dataset/creator" 
        p:template="[individualName]||[organizationName]">
        <property name="leafs"><list><ref bean="organizationNameLeaf"/></list></property>
        <property name="subRoots"><list><ref bean="individualNameRoot" /></list></property>
    </bean>
        
    <bean id="organizationNameLeaf" class="org.dataone.cn.indexer.parser.utility.LeafElement"
        p:name="organizationName"
        p:xPath="organizationName/text()" />
        
    <bean id="individualNameRoot" class="org.dataone.cn.indexer.parser.utility.RootElement"
        p:name="individualName"
        p:xPath="individualName"
        p:template="[givenName] [surName]">
        <property name="leafs">
            <list>
                <ref bean="givenNameLeaf"/>
                <ref bean="surNameLeaf"/>
            </list>
        </property>
    </bean>
    
    <bean id="givenNameLeaf" class="org.dataone.cn.indexer.parser.utility.LeafElement"
        p:name="givenName"
        p:xPath="givenName/text()" />
        
    <bean id="surNameLeaf" class="org.dataone.cn.indexer.parser.utility.LeafElement"
        p:name="surName"
        p:xPath="surName/text()"/>
    
    <bean id="eml.contactOrganization" class="org.dataone.cn.indexer.parser.SolrField">
        <constructor-arg name="name" value="contactOrganization" />
        <constructor-arg name="xpath"
          value="//dataset/creator/organizationName/text()" />
        <property name="multivalue" value="true" />
        <property name="dedupe" value="true"/>
    </bean>
    
    <bean id="eml.fileID" class="org.dataone.cn.indexer.parser.ResolveSolrField">
        <constructor-arg name="name" value="fileID" />
    </bean>
    
    <bean id="eml.fullText" class="org.dataone.cn.indexer.parser.FullTextSolrField">
        <constructor-arg name="name" value="text" />
        <constructor-arg name="xpath"
            value="//dataset/*[not(self::dataTable)]//text()" />
        <property name="multivalue" value="false" />
        <property name="combineNodes" value="true"/>
    </bean>
    
   </list>
  </property>
 </subprocessor>
</beans>
