//String query = request.getParameter("query");
CQLParser parser = new CQLParser();
CQLNode root = parser.parse(query);
root = normalizeParseTree(root);
Set<Taxon> queryResults = doCQLQuery(root, new HashSet<Taxon>(),request);
TaxonSearchResults tsr = new TaxonSearchResults(queryResults);
saveSearchResults(request, tsr);
if ( TreebaseUtil.isEmpty(request.getParameter("format")) ||
(! request.getParameter("format").equals("rss1") &&
! request.getParameter("format").equals("nexus") &&
! request.getParameter("format").equals("nexml")) ) {
return samePage(request);
}
else {
SearchResults<?> res = tsr;
String schema = null;
if ( ! TreebaseUtil.isEmpty(request.getParameter("recordSchema")) ) {
schema = request.getParameter("recordSchema");
if ( schema.equals("tree" ) ) {
res = tsr.convertToTrees();
}
else if ( schema.equals("matrix") ) {
res = tsr.convertToMatrices();
}
else if ( schema.equals("study") ) {
res = tsr.convertToStudies();
}
}
this.saveSearchResults(request, res);
if (schema.equals("tree") &&