<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess 
	xmlns:as="http://www.geotools.org/app-schema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
	<namespaces>
		<Namespace>
			<prefix>ct</prefix>
			<uri>http://geoserver.org/ct</uri>
		</Namespace>
		<Namespace>
			<prefix>xlink</prefix>
			<uri>http://www.w3.org/1999/xlink</uri>
		</Namespace>
	</namespaces>
	<sourceDataStores>
		<DataStore>
			<id>datastore</id>
			<parameters>
				<Parameter>
					<name>dbtype</name>
					<value>postgisng</value>
				</Parameter>
				<Parameter>
					<name>schema</name>
					<value>public</value>
				</Parameter>			
				<Parameter>
					<name>database</name>
					<value>ctTest</value>
				</Parameter>
				<Parameter>
					<name>host</name>
					<value>localhost</value>
				</Parameter>
				<Parameter>
					<name>port</name>
					<value>5432</value>
				</Parameter>
				<Parameter>
					<name>user</name>
					<value>ct</value>
				</Parameter>
				<Parameter>
					<name>passwd</name>
					<value>ct</value>
				</Parameter>
				<Parameter>
					<name>Expose primary keys</name>
					<value>true</value>
				</Parameter>
				<Parameter>
					<name>validate connections</name>
					<value>true</value>
				</Parameter>
				<Parameter>
					<name>Support on the fly geometry simplification</name>
					<value>true</value>
				</Parameter>
				<Parameter>
					<name>Connection timeout</name>
					<value>20</value>
				</Parameter>
				<Parameter>
					<name>namespace</name>
					<value>http://geoserver.org/ct</value>
				</Parameter>
			</parameters>
		</DataStore>
	</sourceDataStores>
	<targetTypes>
		<FeatureType>
			<schemaUri>source.xsd</schemaUri>
		</FeatureType>
	</targetTypes>
	
	<includedTypes>
		<!--<Include>ct_datastore2.xml</Include>-->
		<Include>ct_email.xml</Include>
		<Include>ct_web.xml</Include>
	</includedTypes>

	<typeMappings>
		<FeatureTypeMapping>
			<sourceDataStore>datastore</sourceDataStore>
			<sourceType>Person</sourceType>
			<targetElement>ct:Person</targetElement>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>Id</targetAttribute>
					<sourceExpression>
						<OCQL>Id</OCQL>
					</sourceExpression>
					 <encodeIfEmpty>true</encodeIfEmpty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>Name</targetAttribute>
					<sourceExpression>
						<OCQL>Name</OCQL>
					</sourceExpression>
					 <encodeIfEmpty>true</encodeIfEmpty>
				</AttributeMapping>
				<AttributeMapping>
				  <targetAttribute>Email</targetAttribute>
				  <sourceExpression>
						  <OCQL>Id</OCQL>
						  <linkElement>ct:Email</linkElement>
						  <linkField>FEATURE_LINK</linkField>
				  </sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
				  <targetAttribute>Web</targetAttribute>
				  <sourceExpression>
						  <OCQL>Id</OCQL>
						  <linkElement>ct:Web</linkElement>
						  <linkField>FEATURE_LINK</linkField>
				  </sourceExpression>
				</AttributeMapping>
			</attributeMappings>
		</FeatureTypeMapping>
	</typeMappings>
</as:AppSchemaDataAccess>
