Skip to content

Commit 9f3a7ca

Browse files
committed
GBIF support refinements
1 parent c33615e commit 9f3a7ca

17 files changed

Lines changed: 637 additions & 147 deletions

WEB-INF/web.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,11 @@
220220
<tracking-mode>COOKIE</tracking-mode>
221221
</session-config>
222222

223+
<resource-ref>
224+
<description>DB Connection</description>
225+
<res-ref-name>jdbc/AntSource</res-ref-name>
226+
<res-type>javax.sql.DataSource</res-type>
227+
<res-link>jdbc/AntSource</res-link>
228+
</resource-ref>
229+
223230
</web-app>

doc/release.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Release 8.111
2+
GBIF support refinements.
3+
14
Release 8.110
25
GBIF support for date types and long values for type_status and habitat.
36

src/org/calacademy/antweb/home/TaxonDb.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public Genus getGenus(String subfamily, String genus) throws SQLException, Antwe
3939
String taxonName = getTaxonName(subfamily, genus, null, null, "genus");
4040
return (Genus) getTaxon(taxonName);
4141
}
42+
public Genus getGenus(String genus) throws SQLException, AntwebException {
43+
String taxonName = getTaxonName(null, genus, null, null, "genus");
44+
return (Genus) getTaxon(taxonName);
45+
}
4246
public Species getSpecies(String subfamily, String genus, String species) throws SQLException, AntwebException {
4347
String taxonName = getTaxonName(subfamily, genus, species, null, "species");
4448
return (Species) getTaxon(taxonName);
@@ -72,7 +76,7 @@ public Taxon getTaxon(String taxonName) throws SQLException { //, tring tableNam
7276

7377
String theQuery = "";
7478

75-
boolean log = true && "myrmicinaetetramorium vernicosum".equals(taxonName);
79+
boolean log = false && AntwebProps.isDevMode() && "formicinaecamponotus".equals(taxonName); // && "myrmicinaetetramorium vernicosum".equals(taxonName);
7680
ResultSet rset = null;
7781
PreparedStatement stmt = null;
7882
try {
@@ -95,7 +99,7 @@ public Taxon getTaxon(String taxonName) throws SQLException { //, tring tableNam
9599

96100
int count = 0;
97101
while (rset.next()) {
98-
if (log) s_log.debug("getTaxon() IN query:" + theQuery);
102+
//if (log) A.log("getTaxon() IN query:" + theQuery);
99103

100104
++count; // Only one record expected
101105

@@ -206,12 +210,13 @@ public Taxon getTaxon(String taxonName) throws SQLException { //, tring tableNam
206210
//It may not be found during Worldants, for instance amblyoponinae, but after the cleanup process it will...
207211
String warning = " taxon not found taxonName:" + taxonName;
208212
//if (AntwebProps.isDevMode()) warning += " theQuery:" + theQuery;
209-
s_log.debug("getTaxon() " + warning + " query:" + theQuery + " taxonFromMgr:" + TaxonMgr.getTaxon(taxonName) + " antcatCount:" + getAntcatCount());
213+
//A.log("getTaxon() " + warning + " query:" + theQuery + " taxonFromMgr:" + TaxonMgr.getTaxon(taxonName) + " antcatCount:" + getAntcatCount());
210214
return null;
211215
}
212216

213-
if (AntwebProps.isDevMode() && "myrmicinaestrumigenys emmae".equals("taxonName")) {
214-
s_log.warn("getTaxon() name:" + taxonName + " taxon:" + taxon.getTaxonName() + " query:" + theQuery);
217+
if (log) {
218+
A.log("getTaxon() name:" + taxonName + " taxon:" + taxon.getTaxonName() + " query:" + theQuery);
219+
//AntwebUtil.logShortStackTrace(10);
215220
}
216221
return taxon;
217222
}

src/org/calacademy/antweb/home/UploadDb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public String getAntwebSubfamily(String genus)
684684
debugSubfamilyList += ", " + subfamily;
685685
}
686686
}
687-
if (AntwebProps.isDevMode() && count == 0) s_log.error("getAntwebSubfamily() Problem? Not sure. No subfamily for genus:" + genus + " subfamilySet:" + debugSubfamilyList);
687+
if (AntwebProps.isDevMode() && count == 0) A.iLog("getAntwebSubfamily() Problem? Not sure. No subfamily for genus:" + genus + " subfamilySet:" + debugSubfamilyList);
688688
if (count > 1) s_log.error("getAntwebSubfamily() more than one subfamily for genus:" + genus + " subfamilySet:" + debugSubfamilyList);
689689
} finally {
690690
DBUtil.close(stmt, rset, "UploadDb.getAntwebSubfamily()");

0 commit comments

Comments
 (0)