Package org.cipres.treebase.domain.study

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


    if (TreebaseUtil.isEmpty(pFileName)) {
      return "";
    }
    StringBuilder sb = new StringBuilder();
   
    Study study = findBySubmissionID(pSubmissionId);
    TreebaseUtil.attachStudyHeader(study, sb);

    // first: get the list of matrices and tree blocks:
    Collection<Matrix> matrices = getMatrixHome().findByNexusFileName(pSubmissionId, pFileName);
    Collection<TreeBlock> treeBlocks = getPhyloTreeHome().findTreeBlocksByNexusFileName(
View Full Code Here


    // Need to make sure the object belongs to the current session:
    // Analysis currentAnalysis = update(pAnalysis);
    Analysis currentAnalysis = pAnalysis;

    // manage bi-directional relationships:
    Study study = currentAnalysis.getStudy();
    if (study != null) {
      study.removeAnalysis(currentAnalysis);
    }

    // Cascade delete:
    // * analysis step:
    getAnalysisStepService().deleteAnalysisSteps(currentAnalysis.getAnalysisStepsReadOnly());
View Full Code Here

//It is good if this Exception is thrown, becasue the Taxon Label cannot be an integer or a long.   
    }

//    Checking for the duplication of the Taxon Labels (String) in the Set
   
    Study study = myTaxonLabel.getStudy(); //ControllerUtil.findStudy(request, mStudyService);
    List<TaxonLabel> taxonLabelSet = study.getSubmission().getSubmittedTaxonLabelsReadOnly();
         
    Iterator<TaxonLabel> itTxnLbl = taxonLabelSet.iterator();
   
    String testLbl = null;
    long testId = 0L;
View Full Code Here

      return;
    }

    // relationship managmenet:
    // * study: the study relatioinship should be handled by caller!
    Study study = pCitation.getStudy();
    if (study != null && study.getCitation() == pCitation) {
      // we might have a problem here, the caller better assign a new citation
      // before commit:
      study.setCitation(null);
    }
    pCitation.setStudy(null);

    getCitationHome().deletePersist(pCitation);

View Full Code Here

    //String k = tm.keySet().iterator().next();
    //assertEquals(TID, k);
  }

  public void testStudy() {
    Study s = aux.study(new FakeStudyService());
    assertEquals(SID, s.getTB1StudyID());
  }
View Full Code Here

  private class FakeStudyService extends MockStudyService {
    @Override
    public Collection<Study> findByTBStudyID(String studyID) {
      Collection<Study> results = new HashSet<Study>();
      if (studyID.equals(SID)) {
        Study s = new Study();
        s.setTB1StudyID(studyID);
        results.add(s);
      }
      return results;
    }
View Full Code Here

    long studyId = jdbcTemplate.queryForLong(studyStr);
    logger.info("study id: " + studyId);
    assertTrue(studyId > 0);

    // 2. query
    Study s = (Study) loadObject(Study.class, studyId);
    assertTrue(s != null);
    //table study and matrix may not agree on "published"
    //assertTrue(s.isPublished() == false);

    int count = getFixture().updatePublishedFlagByStudy(s, true);
    logger.debug("update Count = " + count);
    assertTrue(count > 0);

    // force commit immediately, important:
    setComplete();
    endTransaction();

    // 3. verify
    String treeCountStr = "select count(m.matrix_id) from matrix m "
      + " where m.study_ID = " + s.getId() + " and m.published is true";
    int countVeri = jdbcTemplate.queryForInt(treeCountStr);
    logger.debug("verify Count = " + countVeri);
    assertTrue(countVeri == count);

    //4. change it back:
View Full Code Here

    StudyStatus inprogress = getStudyStatusHome().findStatusInProgress();

    // Citation c = new ArticleCitation();
    // c.setTitle(newName);

    Study s = new Study();
    s.setName(newName);
    s.setStudyStatus(inprogress);
    // s.setCitation(c);
    // c.setStudy(s);

    // add nexus:
    String fileName = "test nexus";
    String nexus = "#NEXUS\n"
      + "a       ctgactcctgaggagaagtctgccgttactgccctgtggggcaaggtgaacgtggatgaagttggtggtgag gccctgggcaggctgctggtggtctacccttggacccagaggttctttgagtcctttggggatctgtccact cctgatgctgttatgggcaaccctaaggtgaaggctcatggcaagaaagtgctcggtgcctttagtgatggc ctggctcacctggacaacctcaagggcacctttgccacactgagtgagctgcactgtgacaagctgcacgtg gatcctgagaacttcaggctcctgggcaacgtgctggtctgtgtgctggcccatcactttggcaaagaattc accccaccagtgcaggctgcctatcagaaagtggtggctggtgtggctaatgccctggcccacaagtatcac\n"
      + "b       ctgactgctgaagagaaggccgccgtcactgccctgtggggcaaggtagacgtggaagatgttggtggtgag gccctgggcaggctgctggtcgtctacccatggacccagaggttctttgactcctttggggacctgtccact cctgccgctgttatgagcaatgctaaggtcaaggcccatggcaaaaaggtgctgaacgcctttagtgacggc atggctcatctggacaacctcaagggcacctttgctaagctgagtgagctgcactgtgacaaattgcacgtg gatcctgagaatttcaggctcttgggcaatgtgctggtgtgtgtgctggcccaccactttggcaaagaattc accccgcaggttcaggctgcctatcagaaggtggtggctggtgtggctactgccttggctcacaagtaccac\n"
      + "c       ctgactcctgatgagaagaatgccgtttgtgccctgtggggcaaggtgaatgtggaagaagttggtggtgag gccctgggcaggctgctggttgtctacccatggacccagaggttctttgactcctttggggacctgtcctct ccttctgctgttatgggcaaccctaaagtgaaggcccacggcaagaaggtgctgagtgcctttagcgagggc ctgaatcacctggacaacctcaagggcacctttgctaagctgagtgagctgcattgtgacaagctgcacgtg gaccctgagaacttcaggctcctgggcaacgtgctggtggttgtcctggctcaccactttggcaaggatttc accccacaggtgcaggctgcctatcagaaggtggtggctggtgtggctactgccctggctcacaaataccac\n"
      + "d       ctgtccggtgaggagaagtctgcggtcactgccctgtggggcaaggtgaatgtggaagaagttggtggtgag accctgggcaggctgctggttgtctacccatggacccagaggttcttcgagtcctttggggacctgtccact gcttctgctgttatgggcaaccctaaggtgaaggctcatggcaagaaggtgctggctgccttcagtgagggt ctgagtcacctggacaacctcaaaggcaccttcgctaagctgagtgaactgcattgtgacaagctgcacgtg gatcctgagaacttcaggctcctgggcaacgtgctggttattgtgctgtctcatcactttggcaaagaattc actcctcaggtgcaggctgcctatcagaaggtggtggctggtgtggccaatgccctggctcacaaataccac\n"
      + "e       ctgtccagtgaggagaagtctgcggtcactgccctgtggggcaaggtgaatgtggaagaagttggtggtgag gccctgggcaggctgctggttgtctacccatggacccagaggttcttcgagtcctttggggacctgtcctct gcaaatgctgttatgaacaatcctaaggtgaaggctcatggcaagaaggtgctggctgccttcagtgagggt ctgagtcacctggacaacctcaaaggcacctttgctaagctgagtgaactgcactgtgacaagctgcacgtg gatcctgagaacttcaggctcctgggcaacgtgctggttattgtgctgtctcatcattttggcaaagaattc actcctcaggtgcaggctgcctatcagaaggtggtggctggtgtggccaatgccctggctcacaaataccac\n"
      + "f       ctgactgctgaggagaaggctgccgtcaccgccttttggggcaaggtgaaagtggatgaagttggtggtgag gccctgggcaggctgctggttgtctacccctggactcagaggttctttgagtcctttggggacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n"
      + "g       ctgtccgatgcggtcaacgctgccgtcaccgccttttggggcaaggtgaaagtggatcaagttggtggtgag gccctgggcaggccgctggttgtctaccgctggactcagaggtgctatgagtcctttggagacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n";

    //XXX rav 18/11/09 - we no longer use Clobs, we use text for nexus strings
    //Clob nexusC = Hibernate.createClob(nexus);
    //s.addNexusFile(fileName, nexusC);
    s.addNexusFile(fileName, nexus);

    getFixture().store(s);

    // force commit immeidately, important:
    setComplete();
    endTransaction();

    Long studyID = s.getId();

    logger.info("study created: " + s.getName() + "id = " + studyID);

    // 2. verify
    String sqlStr = "select count(*) from Study_nexusFile where study_id=" + s.getId();
    int count = jdbcTemplate.queryForInt(sqlStr);
    assertTrue(count == 1);

    // assertTrue("need to return Analysis ID.", a1.getId() != null);

View Full Code Here

    long studyId = 1L;

    logger.info("study id: " + studyId);
    assertTrue(studyId > 0);

    Study s = (Study) hibernateTemplate.get(Study.class, studyId);

    //2. set tb id and get id
    String tbStudyID = "TestTB1StudyId";
   
    getFixture().setTBStudyID(s, tbStudyID);
   
    // force commit immediately, important:
    setComplete();
    endTransaction();

    //3. test:
    Collection<Study> tbStudyIDVerify = getFixture().findByTB1StudyID(tbStudyID);
   
     //4. verify
     assertTrue(tbStudyIDVerify != null && tbStudyIDVerify.size() == 1);
     Study result = tbStudyIDVerify.iterator().next();
     assertTrue(result.getTB1StudyID().equals(tbStudyID));

     //5. put it back
      getFixture().setTBStudyID(s, null);
      setComplete();
      endTransaction();
View Full Code Here

  /**
   *
   * @see org.cipres.treebase.domain.study.StudyHome#findByAccessionNumber(java.lang.String)
   */
  public Study findByAccessionNumber(String pAccessionNumber) {
    Study returnVal = null;

    if (!TreebaseUtil.isEmpty(pAccessionNumber)) {
      Criteria c = getSession().createCriteria(Study.class);
      c.add(Expression.eq("accessionNumber", pAccessionNumber));

View Full Code Here

TOP

Related Classes of org.cipres.treebase.domain.study.Study

Copyright © 2018 www.massapicom. 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.