<?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>
		<Namespace>
			<prefix>gml</prefix>
			<uri>http://www.opengis.net/gml</uri>
		</Namespace>
	</namespaces>
	<sourceDataStores>
		<DataStore>
			<id>datastore</id>
			<parameters>
				<Parameter>
					<name>dbtype</name>
					<value>postgisng</value>
				</Parameter>
				<Parameter>
					<name>schema</name>
					<value>${ct.schema}</value>
				</Parameter>
				<Parameter>
					<name>database</name>
					<value>${ct.database}</value>
				</Parameter>
				<Parameter>
					<name>host</name>
					<value>${ct.host}</value>
				</Parameter>
					<Parameter>
					<name>port</name>
					<value>${ct.port}</value>
				</Parameter>
				<Parameter>
					<name>user</name>
					<value>${ct.user}</value>
				</Parameter>
				<Parameter>
					<name>passwd</name>
					<value>${ct.password}</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>
	<typeMappings>
		<FeatureTypeMapping>
			<sourceDataStore>datastore</sourceDataStore>
			<!--<sourceType>geoCoordinateSimple</sourceType>-->
			<sourceType>geoCoordinateWithSrid</sourceType>
			<targetElement>ct:AddressCoordinate</targetElement>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>ct:AddressId</targetAttribute>
					<sourceExpression>
						<OCQL>AddressId</OCQL>
					</sourceExpression>
					 <encodeIfEmpty>true</encodeIfEmpty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>ct:Geom</targetAttribute>
					<sourceExpression>
						<OCQL>singlegeom</OCQL>
					</sourceExpression>
					 <encodeIfEmpty>true</encodeIfEmpty>
				</AttributeMapping>
				<!--<AttributeMapping>
					<targetAttribute>FEATURE_LINK</targetAttribute>
					<sourceExpression>
						<OCQL>AddressId</OCQL>
					</sourceExpression>
				</AttributeMapping>-->
			</attributeMappings>
		</FeatureTypeMapping>
	</typeMappings>
</as:AppSchemaDataAccess>
