Examples of TaxonSearchResults


Examples of org.cipres.treebase.domain.search.TaxonSearchResults

          else if ( objectIdentifier.equals("uBio") ) {
            taxa.addAll(doTaxonSearch(request,newSearchCommand,searchTerms[i],SearchIndex.ID,NamingAuthority.UBIO));
          }               
        } 
      }
      TaxonSearchResults tsr = new TaxonSearchResults(taxa);
      saveSearchResults(request, tsr);
      if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) {
        return samePage(request);
      }
      else {
View Full Code Here

Examples of org.cipres.treebase.domain.search.TaxonSearchResults

    return results;   
  }
 
  private ModelAndView modifySearchResults(HttpServletRequest request,
      HttpServletResponse response, BindException errors) throws InstantiationException {
    TaxonSearchResults results = searchResults(request).convertToTaxa();
   
    String buttonName = request.getParameter("taxonResultsaction");
    if (buttonName.equals("addCheckedToResults")) {
//      Map<String,String> parameterMap = request.getParameterMap();
      Collection<Taxon> newTaxa = new HashSet<Taxon> ();
      for (String taxonIdString : request.getParameterValues("selection")) {
        Taxon tx;
        try {
          tx = getTaxonLabelService().findTaxonByIDString(taxonIdString);
        } catch (MalformedTreebaseIDString e) {
          // This can only occur if the ID numbers in our web form are
          // malformed, so it represents a programming error.  20090312 MJD
          throw new Error(e);
        }
        if (tx != null) newTaxa.add(tx);
      }
      results.union(newTaxa);
      saveSearchResults(request, results);
    }
    return samePage(request);
  }
View Full Code Here

Examples of org.cipres.treebase.domain.search.TaxonSearchResults

  }
 
  public void testTaxonSearchSerialization() {
    Document doc = DocumentFactory.safeCreateDocument();
    NexmlDocumentWriter ndw = new NexmlDocumentWriter(null, mTaxonLabelHome, doc);   
    TaxonSearchResults tasr = ssr.convertToTaxa();
    ndw.fromTreeBaseToXml(tasr);
    assertNotNull(doc.getXmlString());
  }
View Full Code Here

Examples of org.cipres.treebase.domain.search.TaxonSearchResults

    //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") &&
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.