Package org.cipres.treebase.domain.study

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


  /**
   * Default constructor Creation date: May 17, 2006 2:11:05 PM
   */
  public CitationCommand() {
    citationMap.put(BookCitation.CITATION_TYPE_BOOK, new BookCitation());
    citationMap.put(ArticleCitation.CITATION_TYPE_ARTICLE, new ArticleCitation());
    citationMap.put(InBookCitation.CITATION_TYPE_BOOKSECTION, new InBookCitation());
  }
View Full Code Here


   */
  public Citation afactory(String pCitationType) {
    if (BookCitation.CITATION_TYPE_BOOK.compareToIgnoreCase(pCitationType) == 0) {
      return new BookCitation();
    } else if (ArticleCitation.CITATION_TYPE_ARTICLE.compareToIgnoreCase(pCitationType) == 0){
      return new ArticleCitation();
    } else if (InBookCitation.CITATION_TYPE_BOOKSECTION.compareToIgnoreCase(pCitationType) == 0) {
      return new InBookCitation();
    }
   
    //default:
    return new ArticleCitation();
  }
View Full Code Here

    } catch (DocumentException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
   
    citation = new ArticleCitation();
    loadData();
  }
View Full Code Here

    // 1. create a new study:
    String newName = testName + " test " + Math.random();
    StudyStatus inprogress = getStudyStatusHome().findStatusInProgress();

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

    Analysis a1 = new Analysis();
    a1.setName("1 " + newName);
    Analysis a2 = new Analysis();
    a2.setName("2 " + newName);

    Study s = new Study();
    s.setName(newName);
    s.setStudyStatus(inprogress);
    s.setCitation(c);
    c.setStudy(s);
    s.addAnalysis(a1);
    s.addAnalysis(a2);

    TaxonLabel label = new TaxonLabel();
    label.setTaxonLabel(newName);
    label.setStudy(s);

    getStudyHome().store(label);
    getStudyHome().store(s);

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

    onSetUp();

    // Notes: this is important: why?? there are two copies of s in the same session.
    // how???
    s = (Study) hibernateTemplate.merge(s);

    Long studyID = s.getId();
    Long citationID = c.getId();
    logger.info("study created: " + s.getName() + "id = " + studyID);
    logger.info("citation created: " + c.getTitle() + "id = " + citationID);
    logger.info("analysis created: " + a1.getName() + "id = " + a1.getId());
    logger.info("analysis created: " + a2.getName() + "id = " + a2.getId());
    logger.info("taxonLabel created: " + label.getTaxonLabel() + "id = " + label.getId());

    // 2. verify
View Full Code Here

    // 1. create a new study:
    String newName = testName + " test " + Math.random();
    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);
    getStudyHome().store(s);

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

    Long studyID = s.getId();
    Long citationID = c.getId();
    logger.info("study created: " + s.getName() + "id = " + studyID);
    logger.info("citation created: " + c.getTitle() + "id = " + citationID);

    Analysis a1 = new Analysis();
    a1.setName("1 " + newName);
    Analysis a2 = new Analysis();
    a2.setName("2 " + newName);
View Full Code Here

    // 1. create a new study:
    String newName = testName + " test " + Math.random();
    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);

    Analysis a1 = new Analysis();
    a1.setName("1 " + newName);
    Analysis a2 = new Analysis();
    a2.setName("2 " + newName);
    s.addAnalysis(a1);
    s.addAnalysis(a2);

    getStudyHome().store(s);

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

    Long studyID = s.getId();
    Long citationID = c.getId();
    Long a1ID = a1.getId();
    Long a2ID = a2.getId();

    logger.info("study created: " + s.getName() + "id = " + studyID);
    logger.info("citation created: " + c.getTitle() + "id = " + citationID);
    logger.info("2 analyses created: id= " + a1ID + ", " + a2ID);

    // 2. verify
    String sqlStr = "select count(*) from Study where study_id=" + s.getId();
    int count = jdbcTemplate.queryForInt(sqlStr);
View Full Code Here

    // 1. create a new study:
    String newName = testName + " test " + Math.random();
    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);

    Analysis a1 = new Analysis();
    a1.setName("1 " + newName);
    Analysis a2 = new Analysis();
    a2.setName("2 " + newName);
    s.addAnalysis(a1);
    s.addAnalysis(a2);

    getStudyHome().store(s);

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

    Long studyID = s.getId();
    Long citationID = c.getId();
    Long a1ID = a1.getId();
    Long a2ID = a2.getId();

    logger.info("study created: " + s.getName() + "id = " + studyID);
    logger.info("citation created: " + c.getTitle() + "id = " + citationID);
    logger.info("2 analyses created: id= " + a1ID + ", " + a2ID);
    assertTrue("need to return Analysis ID.", a1.getId() != null && a2.getId() != null);

    // 2. verify
    String sqlStr = "select count(*) from analysis where study_id=" + s.getId();
View Full Code Here

        LOGGER.info("setAuthorizationChecked(true)");
        setAuthorizationChecked(true);
      } else {
        LOGGER.info("setAuthorizationChecked(false)");
        setAuthorizationChecked(false);
        return new ArticleCitation();
      }

      ControllerUtil.saveStudy(request, study); // user has made selection
      // Added by Madhu to set the session variables
      if (study.isReady()) {
        request.getSession().setAttribute("publicationState", "Ready");
      } else if (study.isPublished()) {
        request.getSession().setAttribute("publicationState", "Published");
      } else {
        request.getSession().setAttribute("publicationState", "NotReady");
      }

    } else {
      request.getSession().setAttribute("publicationState", "NotReady");
    }

    Citation citation = study.getCitation();
    if (citation == null) {
      return new ArticleCitation();
    } else {
      return citation;
    }
  }
View Full Code Here

        LOGGER.info("setAuthorizationChecked(true)");
        setAuthorizationChecked(true);
      } else {
        LOGGER.info("setAuthorizationChecked(false)");
        setAuthorizationChecked(false);
        return new ArticleCitation();
      }

      ControllerUtil.saveStudy(request, study); // user has made selection
      // Added by Madhu to set the session variables
      if (study.isReady()) {
View Full Code Here

        LOGGER.info("setAuthorizationChecked(true)");
        setAuthorizationChecked(true);
      } else {
        LOGGER.info("setAuthorizationChecked(false)");
        setAuthorizationChecked(false);
        return new ArticleCitation();
      }

      ControllerUtil.saveStudy(request, study); // user has made selection
      // Added by Madhu to set the session variables
      if (study.isReady()) {
        request.getSession().setAttribute("publicationState", "Ready");
      } else if (study.isPublished()) {
        request.getSession().setAttribute("publicationState", "Published");
      } else {
        request.getSession().setAttribute("publicationState", "NotReady");
      }

    } else {
      request.getSession().setAttribute("publicationState", "NotReady");
    }

    Citation citation = study.getCitation();
    if (citation == null) {
      return new ArticleCitation();
    } else {
      return citation;
    }

  } 
View Full Code Here

TOP

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

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.