<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
						http://www.springframework.org/schema/beans/spring-beans.xsd
						http://www.springframework.org/schema/context  
    					http://www.springframework.org/schema/context/spring-context-3.0.xsd">
	
	<bean id="systemMetadata200Subprocessor"
	  	class="org.dataone.cn.indexer.parser.BaseXPathDocumentSubprocessor">
	  	<property name="xmlNamespaceConfig" ref="xmlNamespaceConfig" />
	    <property name="fieldList">
			<list>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="id" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/identifier/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="seriesId" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/seriesId/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="fileName" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/fileName/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="mediaType" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/mediaType/@name" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.CommonRootSolrField"
						p:multivalue="true"
						p:root-ref="mediaTypePropertyListRoot">
						<constructor-arg name="name" value="mediaTypeProperty" />
				</bean>				
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="formatId" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/formatId/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="formatType" />
					<constructor-arg name="xpath" value="/d200:systemMetadata/formatId/text()" />
					<property name="converter" ref="formatIdToFormatTypeConverter" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="size" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/size/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="checksum" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/checksum/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="submitter" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/submitter/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="checksumAlgorithm" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/checksum/@algorithm" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="rightsHolder" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/rightsHolder/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="replicationAllowed" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/replicationPolicy/@replicationAllowed" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="numberReplicas" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/replicationPolicy/@numberReplicas" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="preferredReplicationMN" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/replicationPolicy/preferredMemberNode/text()" />
					<property name="multivalue" value="true" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="blockedReplicationMN" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/replicationPolicy/blockedMemberNode/text()" />
					<property name="multivalue" value="true" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="obsoletes" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/obsoletes/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="obsoletedBy" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/obsoletedBy/text()" />
				</bean>
				
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="archived" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/archived/text()" />
					<property name="defaultValue" value="false" />
				</bean>
				
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="dateUploaded" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/dateUploaded/text()" />
					<property name="converter" ref="dateConverter" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="dateModified" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/dateSysMetadataModified/text()" />
					<property name="converter" ref="dateConverter" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="datasource" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/originMemberNode/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="authoritativeMN" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/authoritativeMemberNode/text()" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="replicaMN" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/replica/replicaMemberNode/text()" />
					<property name="multivalue" value="true" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
                    <constructor-arg name="name" value="replicationStatus" />
                    <constructor-arg name="xpath"
                        value="/d200:systemMetadata/replica/replicationStatus/text()" />
                    <property name="multivalue" value="true" />
                </bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="replicaVerifiedDate" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/replica/replicaVerified/text()" />
					<property name="multivalue" value="true" />
					<property name="converter" ref="dateConverter" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="readPermission" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/accessPolicy/allow[permission= 'read']/subject/text()" />
					<property name="multivalue" value="true" />
					<property name="dedupe" value="true" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="writePermission" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/accessPolicy/allow[permission= 'write']/subject/text()" />
					<property name="multivalue" value="true" />
					<property name="dedupe" value="true" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="changePermission" />
					<constructor-arg name="xpath"
						value="/d200:systemMetadata/accessPolicy/allow[permission= 'changePermission']/subject/text()" />
					<property name="multivalue" value="true" />
					<property name="dedupe" value="true" />
				</bean>
				<bean class="org.dataone.cn.indexer.parser.SolrField">
					<constructor-arg name="name" value="isPublic" />
					<constructor-arg name="xpath"
						value="(//accessPolicy/allow[permission= 'read']/subject[text()='public']/text() | //accessPolicy/allow[permission= 'write']/subject[text()='public']/text() | //accessPolicy/allow[permission= 'changePermission']/subject[text()='public']/text() | //rightsHolder[text()='public']/text())[1]" />
					<property name="converter" ref="booleanPublicConverter" />
				</bean>
		        <bean class="org.dataone.cn.indexer.parser.ResolveSolrField">
					<constructor-arg name="name" value="dataUrl" />
		        </bean>
			</list>
		</property>
	</bean>
	
	<bean id="mediaTypePropertyListRoot" class="org.dataone.cn.indexer.parser.utility.RootElement"
		p:name="mediaTypeProperty"
		p:xPath='/d200:systemMetadata/mediaType/property'
		p:template="[mediaTypePropertyName] [mediaTypePropertyValue]">
		<property name="leafs">
			<list>
				<ref bean="mediaTypePropertyNameLeaf" />
				<ref bean="mediaTypePropertyValueLeaf" />
			</list>
		</property>
	</bean>	
	
	<bean id="mediaTypePropertyNameLeaf" class="org.dataone.cn.indexer.parser.utility.LeafElement"
		p:name="mediaTypePropertyName"
		p:xPath='@name' />
		
	<bean id="mediaTypePropertyValueLeaf" class="org.dataone.cn.indexer.parser.utility.LeafElement"
		p:name="mediaTypePropertyValue"
		p:xPath='text()' />
	
	
</beans>