Skip to content

Commit 48c199b

Browse files
committed
1 parent 113ca20 commit 48c199b

File tree

4 files changed

+24
-501
lines changed

4 files changed

+24
-501
lines changed

ScheduledTasks/exp_createTaxonomy.cfm

+1-178
Original file line numberDiff line numberDiff line change
@@ -1,178 +1 @@
1-
<cfoutput>
2-
<cfquery name="ids" datasource="uam_god">
3-
select * from (
4-
select
5-
taxon_name_id
6-
from
7-
identification_taxonomy
8-
where
9-
taxon_name_id not in (select taxon_name_id from taxon_name)
10-
group by taxon_name_id
11-
) where rownum<21
12-
13-
</cfquery>
14-
15-
<cfdump var=#ids#>
16-
<cfloop query="ids">
17-
<!-------
18-
------->
19-
<cfthread action="run" name="t#taxon_name_id#" taxon_name_id="#taxon_name_id#">
20-
21-
<cfquery name="d" datasource="uam_god">
22-
select * from taxonomy where taxon_name_id='#taxon_name_id#'
23-
</cfquery>
24-
<p>running for #d.SCIENTIFIC_NAME#</p>
25-
<cfquery name="tt" datasource="uam_god">
26-
insert into taxon_name (taxon_name_id,scientific_name) values (#d.taxon_name_id#,'#d.SCIENTIFIC_NAME#')
27-
</cfquery>
28-
<cfset orderedTerms="KINGDOM,PHYLUM,PHYLCLASS,SUBCLASS,PHYLORDER,SUBORDER,SUPERFAMILY,FAMILY,SUBFAMILY,TRIBE,GENUS,SUBGENUS,SPECIES,SUBSPECIES">
29-
<cfset pos=1>
30-
<!--- arctos "source_id" is just the taxon_name_id ---->
31-
<cfloop list="#orderedTerms#" index="termtype">
32-
<cfset thisTermVal=evaluate("d." & termtype)>
33-
<cfset thisTermType=termtype>
34-
<cfif len(thisTermVal) gt 0>
35-
<cfif thisTermType is "SUBSPECIES" and len(d.INFRASPECIFIC_RANK) gt 0>
36-
<cfset thisTermType=d.INFRASPECIFIC_RANK>
37-
</cfif>
38-
<cfquery name="meta" datasource="uam_god">
39-
insert into taxon_term (
40-
taxon_term_id,
41-
taxon_name_id,
42-
term,
43-
term_type,
44-
source,
45-
position_in_classification,
46-
classification_id
47-
) values (
48-
sq_taxon_term_id.nextval,
49-
#d.taxon_name_id#,
50-
'#thisTermVal#',
51-
'#lcase(thisTermType)#',
52-
'Arctos',
53-
#pos#,
54-
'#d.taxon_name_id#'
55-
)
56-
</cfquery>
57-
<cfset pos=pos+1>
58-
</cfif>
59-
</cfloop>
60-
<cfset orderedTerms="VALID_CATALOG_TERM_FG|SOURCE_AUTHORITY|AUTHOR_TEXT|TAXON_REMARKS|NOMENCLATURAL_CODE|INFRASPECIFIC_AUTHOR|DISPLAY_NAME|TAXON_STATUS">
61-
<cfloop list="#orderedTerms#" index="termtype" delimiters="|">
62-
<cfset thisTermVal=evaluate("d." & termtype)>
63-
<cfif len(thisTermVal) gt 0>
64-
<cfquery name="meta" datasource="uam_god">
65-
insert into taxon_term (
66-
taxon_term_id,
67-
taxon_name_id,
68-
term,
69-
term_type,
70-
source
71-
) values (
72-
sq_taxon_term_id.nextval,
73-
#d.taxon_name_id#,
74-
'#thisTermVal#',
75-
'#lcase(termtype)#',
76-
'Arctos'
77-
)
78-
</cfquery>
79-
<cfset pos=pos+1>
80-
</cfif>
81-
</cfloop>
82-
<cfhttp url="http://resolver.globalnames.org/name_resolvers.json?names=#d.scientific_name#"></cfhttp>
83-
<cfset x=DeserializeJSON(cfhttp.filecontent)>
84-
<cfloop from="1" to="#ArrayLen(x.data[1].results)#" index="i">
85-
<cfset pos=1>
86-
<!--- because lists are stupid and ignore NULLs.... ---->
87-
<cfif structKeyExists(x.data[1].results[i],"classification_path") and structKeyExists(x.data[1].results[i],"classification_path_ranks")>
88-
<cfset cterms=ListToArray(x.data[1].results[i].classification_path, "|", true)>
89-
<cfset cranks=ListToArray(x.data[1].results[i].classification_path_ranks, "|", true)>
90-
91-
<cfset thisSource=x.data[1].results[i].data_source_title>
92-
<!--- try to use something from them to uniquely identify the hierarchy---->
93-
<!---- failing that, make a local identifier useful only in patching the hierarchy back together ---->
94-
<cfset thisSourceID=x.data[1].results[i].classification_path_ids>
95-
<cfif len(thisSourceID) is 0>
96-
<cfset thisSourceID=CreateUUID()>
97-
</cfif>
98-
<cfset thisScore=x.data[1].results[i].score>
99-
<cfif len(thisScore) is 0><cfset thisScore=0></cfif>
100-
<cfset thisNameString=x.data[1].results[i].name_string>
101-
<cfset thisCanonicalFormName=x.data[1].results[i].canonical_form>
102-
103-
<cfloop from="1" to="#arrayLen(cterms)#" index="listPos">
104-
<cfset thisTerm=cterms[listpos]>
105-
<br>thisTerm: #thisTerm#
106-
<cfif ArrayIsDefined(cranks, listpos)>
107-
<cfset thisRank=cranks[listpos]>
108-
<cfelse>
109-
<cfset thisRank=''>
110-
</cfif>
111-
112-
<cfif len(thisTerm) gt 0>
113-
<cfquery name="meta" datasource="uam_god">
114-
insert into taxon_term (
115-
taxon_term_id,
116-
taxon_name_id,
117-
term,
118-
term_type,
119-
source,
120-
position_in_classification,
121-
classification_id,
122-
gn_score
123-
) values (
124-
sq_taxon_term_id.nextval,
125-
#d.taxon_name_id#,
126-
'#thisTerm#',
127-
'#lcase(thisRank)#',
128-
'#thisSource#',
129-
#pos#,
130-
'#thisSourceID#',
131-
#thisScore#
132-
)
133-
</cfquery>
134-
<cfset pos=pos+1>
135-
</cfif>
136-
</cfloop>
137-
<cfif len(thisNameString) gt 0>
138-
<cfquery name="meta" datasource="uam_god">
139-
insert into taxon_term (
140-
taxon_term_id,
141-
taxon_name_id,
142-
term,
143-
term_type,
144-
source
145-
) values (
146-
sq_taxon_term_id.nextval,
147-
#d.taxon_name_id#,
148-
'#thisNameString#',
149-
'name string',
150-
'#thisSource#'
151-
)
152-
</cfquery>
153-
</cfif>
154-
<cfif len(thisCanonicalFormName) gt 0>
155-
<cfquery name="meta" datasource="uam_god">
156-
insert into taxon_term (
157-
taxon_term_id,
158-
taxon_name_id,
159-
term,
160-
term_type,
161-
source
162-
) values (
163-
sq_taxon_term_id.nextval,
164-
#d.taxon_name_id#,
165-
'#thisCanonicalFormName#',
166-
'canonical name',
167-
'#thisSource#'
168-
)
169-
</cfquery>
170-
</cfif>
171-
</cfif>
172-
</cfloop>
173-
</cfthread>
174-
175-
<!--------
176-
-------->
177-
</cfloop>
178-
</cfoutput>
1+
use the version in 5.4.7

editLocality.cfm

+13
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,15 @@
423423
<option value="#VerificationStatus#">#VerificationStatus#</option>
424424
</cfloop>
425425
</select>
426+
<label for="VerificationStatusIs">
427+
.....where current verificationstatus IS (leave blank to get everything)
428+
</label>
429+
<select name="VerificationStatusIs" id="VerificationStatusIs" size="1" class="reqdClr">
430+
<option value=""></option>
431+
<cfloop query="ctVerificationStatus">
432+
<option value="#VerificationStatus#">#VerificationStatus#</option>
433+
</cfloop>
434+
</select>
426435
<br>
427436
<input type="submit" class="lnkBtn" value="Update Verification Status for all of your specimen_events in this locality to value in pick above">
428437
</form>
@@ -899,10 +908,14 @@
899908
where
900909
COLLECTING_EVENT_ID in (select COLLECTING_EVENT_ID from COLLECTING_EVENT where locality_id = #locality_id#) and
901910
COLLECTION_OBJECT_ID in (select COLLECTION_OBJECT_ID from cataloged_item) -- keep things on the right side of the VPD
911+
<cfif isdefined("VerificationStatusIs") and len(VerificationStatusIs) gt 0>
912+
and VerificationStatus='#VerificationStatusIs#'
913+
</cfif>
902914
</cfquery>
903915
<cflocation addtoken="false" url="editLocality.cfm?locality_id=#locality_id#">
904916
</cfoutput>
905917
</cfif>
918+
<!------------------------------------------------------------------------------------------------------>
906919
<cfif action is "editGeol">
907920
<cfoutput>
908921
<cfloop from="1" to="#number_of_determinations#" index="n">

is_cf_alive.cfm

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--- set up a timer --->
2+
<cfset tickBegin = GetTickCount()>
3+
<!--- fetch arctos ---->
4+
<cfhttp url="http://arctos.database.museum" method="head"></cfhttp>
5+
<cfset tickEnd = GetTickCount()>
6+
<cfset eTime = tickEnd - tickBegin>
7+
<cfif etime lt 5000>
8+
true
9+
</cfif>

0 commit comments

Comments
 (0)