 <p>
 	Find seed taxonomy. Terms are exact-match case-sensitive.
 </p>
-<form id="f_ds_filter">
-	<input type="hidden" name="source" id="source" value="<cfoutput>#d.source#</cfoutput>">
+<form id="f_ds_filter" method="post" action="taxonomyTree.cfm">
+	<cfoutput>
+		<input type="hidden" name="datasource_id" id="datasource_id" value="#d.datasource_id">
+		<input type="hidden" name="dataset_name" id="dataset_name" value="#d.dataset_name">
+		<input type="hidden" name="action" id="action" value="go_seed_ds">
+		<input type="hidden" name="source" id="source" value="#d.source#">
+	</cfoutput>
+
+
+
 	<label for="kingdom">kingdom</label>
 	<input type="text" name="kingdom" id="kingdom" placeholder="kingdom" size="60">
 



	-- "seed" table
	create table d (
		scientific_name varchar2(255) not null,
		taxon_name_id number not null,
		dataset_id number not null,


	<label for="genus">genus</label>
	<input type="text" name="genus" id="genus" placeholder="genus" size="60">
	<br><input type="button" id="inspect" value="inspect">
	<p>
		After using the "inspect" button, and having found a reasonable number of taxa,
		<input type="submit" onclick="goPullSeed" value="pull seed data">
	</p>
</form>


</cfif>


<cfif action is "go_seed_ds">

	<cfquery name="seed" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" result="r">
		insert into htax_seed (scientific_name,taxon_name_id,dataset_id) (
		select distinct (
			scientific_name,
			taxon_name.taxon_name_id,
			#dataset_id#
		from
			taxon_name,
			taxon_term
		where
			taxon_name.taxon_name_id=taxon_term.taxon_name_id and
			taxon_term.source='#source#'
			<cfif len(kingdom) gt 0>
				and term_type='kingdom' and term='#kingdom#'
			</cfif>
			<cfif len(phylum) gt 0>
				and term_type='phylum' and term='#phylum#'
			</cfif>
			<cfif len(class) gt 0>
				and term_type='class' and term='#class#'
			</cfif>
			<cfif len(order) gt 0>
				and term_type='order' and term='#order#'
			</cfif>
			<cfif len(family) gt 0>
				and term_type='family' and term='#family#'
			</cfif>
			<cfif len(genus) gt 0>
				and term_type='genus' and term='#genus#'
			</cfif>
	</cfquery>
	<p>
		Result: <cfdump var=#r#>
	</p>
	<p>
		<a href="taxonomyTree.cfm?action=manageDataset&dataset_name=#dataset_name#">back to manage</a>
	</p>


</cfif>


<cfif action is "manageLocalTree">
	<div id="statusDiv" style="position:fixed;top:100;right:0;margin-right:2em;padding:.2em;border:1px solid red;z-index:9999999;">status</div>

