<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Example XML mapping configuration file -->
<oodt:xmlps xmlns:oodt="http://incubator.apache.org/oodt/0.1-incubating"
	name="Example Query Handler" id="project:subproject:exampleps">
	<!-- 
	 attribute:
	   default (required): This is the name of the master table part of the
	          from clause in the generated query. The default table *does not*
	          require a definition in the underlying <table.. tags below, though
	          post OODT-548 these will be silently ignored.	
	 -->
	<tables default="Table1">
		<table name="Table2" join="join_key" tofld="base_table_join_key" />
		<table name="Table3" join="join_key" tofld="base_table_join_key" />
	</tables>
	<!-- 
		field:
		
		type (required):   dynamic or constant. If you choose dynamic, then the field
		value is read from the row in the ResultSet returned
		from the database. If constant, then each returned row
		from the ResultSet is annotated with the value specified
		in the 'value' attribute.
		
	  name (required):   the name of the attribute that you want returned
		in the product server.
		
		string (optional): whether or not the internal db representation at the local
		site for this field is a STRING, or something else (e.g., a number, etc.). Possible 
		values for this attribute are "true", to indicate that the field is a string, or
		"false", to indicate that it is something else. If this attribute is omitted, a value
		of "false" is assumed, and the attribute will not be quoted in the where clause of
		the underlying SQL statement generated.
		
		dbname (optional): the name of the field within the underlying db. If not
		specified, then assumed to be name
		
		table (optional):  if provided, then the attribute a is selected as
		'table'.'a',and then returned. If omitted, the attribute
		is assumed to come from the default table returned from the
		PS query.
		
		value (optional):  is necessary to provide if type='constant' is selected.
		
		scope (optional):  limits the scope of a field's existence: acceptable values
		are &quot;query&quot;, which signifies that the field is only applicable when
		translating queries: and &quot;return&quot;, which signifies the field is only
		applicable as a return field when converting database results into CDEResults.
		
	-->
	<field type="dynamic" name="CDE_NAME1" dbname="site_specific_name1" table="Table1" />
	<field type="dynamic" name="CDE_NAME2" dbname="site_specific_name2" table="Table2" />
	<field type="dynamic" name="CDE_NAME3" dbname="site_specific_name3" table="Table2" />
	<field type="constant" name="CDE_NAME4" value="constant_value" />
</oodt:xmlps>
