Examples of StudyService


Examples of org.cipres.treebase.domain.study.StudyService

      String searchTerm,
      boolean exactMatch, CQLRelation relation) throws InstantiationException, ParseException {
   
    String keywordSearchTerm = "%" + searchTerm + "%";
    Collection<Study> matches = new HashSet<Study>();
    StudyService studyService = getSearchService().getStudyService();
    SubmissionService submissionService =  getSearchService().getSubmissionService();
       
    switch (searchType) {
      case byID:
        matches = (Collection<Study>) doSearchByIDString(request, studyService, Study.class, searchTerm);
        break;
      case byLegacyID:
      {
        TreebaseIDString legacyID = null;
        boolean malformed = false;
        try {
          legacyID = new TreebaseIDString(searchTerm, Study.class);
        } catch (MalformedTreebaseIDString e) {
          malformed = true;
        }
        if (malformed || legacyID.getTBClass() != Study.class) {
          addMessage(request, "Legacy ID number '" + searchTerm + "' is not valid; try S#### or just ####");
          matches = null;
          break;
        }
        matches = (Collection<Study>) studyService.findByTBStudyID("S" + legacyID.getId().toString());
        break;
      }
      case inAbstract:
        matches = studyService.findByAbstract(keywordSearchTerm);
        break;
      case inCitation:
        matches = studyService.findByCitation(keywordSearchTerm);
        break;
      case byAuthorName:
        matches = studyService.findByAuthor(searchTerm);
        break;
      case byTitle:
        matches = studyService.findByTitle(keywordSearchTerm);
        break;
      case byKeyword:
        matches = studyService.findByKeyword(keywordSearchTerm);
        break;
      case byLastModifiedDate:
        matches = findByLastModified(searchTerm, relation, submissionService);
        break;
      case byPublicationDate:
        matches = findByPublicationDate(searchTerm, relation, studyService);
        break;
      case byCreationDate:
        matches = findByCreationDate(searchTerm, relation, submissionService);
        break;
      case byDOI:
      {
        Study result = studyService.findByDOI(searchTerm);
        if ( null != result ) {
          matches.add(result);
        }
        break;
      }
      case byJournal:
      {
        if ( exactMatch ) {
          matches = studyService.findByJournal(searchTerm, exactMatch);
        } else {
          matches = studyService.findByJournal(keywordSearchTerm, exactMatch);
        }
        break;
      }
      default:
        throw new Error ("Unknown search type '" + searchType + "'");
View Full Code Here

Examples of org.cipres.treebase.domain.study.StudyService

    if (TreebaseUtil.isEmpty(pKeyword)) {
      return "Keyword cannot be empty.";
    }

    StudyService service = getStudyService();
    String trimmedKeywords = pKeyword.trim();
    String xmlStringByKeyword = service.generateXMLStringByKeyword(trimmedKeywords);
    return xmlStringByKeyword;
    //return getStudyService().generateXMLStringByKeyword(pKeyword.trim());
  }
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.