Package org.cipres.treebase.domain.study

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


   * @see org.cipres.treebase.domain.study.StudyHome#findByTrees(java.util.Set)
   */
  public Collection<Study> findByTrees(Set<PhyloTree> trees) {
    Set<Study> result = new HashSet<Study>();
    for (PhyloTree t : trees) {
      Study s = t.getStudy();
      if (s != null) {
        result.add(s);
      }
    }
    return result;
View Full Code Here


    if (files.isEmpty()) {
      return new ModelAndView(getCancelView());
    }

    Study study = ControllerUtil.findStudy(request, getStudyService());
    Submission submission = study.getSubmission();
    MyProgressionListener listener = new MyProgressionListener();

    getSubmissionService().addNexusFiles(submission, files, listener);
    getStudyService().addNexusFiles(study, files);
View Full Code Here

  @Override
  protected Map referenceData(HttpServletRequest request) throws Exception {

    Collection<Study> studies = getStudyService().findByName(PARSER_STUDY_NAME, true);

    Study s = null;
    if (studies.isEmpty()) {

      // TODO: these code will not work.
      // s = new Study();
      // s.setName(PARSER_STUDY_NAME);
View Full Code Here

   */
  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
    throws Exception {

    String study_id = ServletRequestUtils.getStringParameter(request, "id", null);
    Study study = mStudyService.findByID(Long.parseLong(study_id));
    ControllerUtil.saveStudy(request, study, Constants.SEARCH_ACTION);
    request.getSession().setAttribute("search", "y");
    return new ModelAndView(new RedirectView("analysisDisplay.html"));
  }
View Full Code Here

   
    private Map getRecordMap(Submission submission){
     
      Map map= new HashMap();
     
      Study study=submission.getStudy();
      Citation citation=study.getCitation();
      String publisher=null;
      if(!study.isPublished())return null;
     
      //System.out.println("ctype: "+citation.getCitationType());
      try{
      if(citation.getCitationType().toUpperCase().contains("BOOK"))
           publisher=((BookCitation)citation).getPublisher();
      else publisher=((ArticleCitation)citation).getJournal();
     
     
      List<Person> authors=citation.getAuthors();
      
   
      map.put("title", IdentifyUtil.escape4XML(study.getId(),citation.getTitle()));
      map.put("creator", authors)
      //VG 2010-11-17  fixing SF:3079602 (multiple keywords into multiple <dc:subject> elements)
      //--map.put("subject", IdentifyUtil.escape4XML(study.getId(),citation.getKeywords()));
      map.put("subject", splitKeywords(study.getId(),citation.getKeywords()));
        if(study.getName()!=null&study.getNotes()!=null)     
          map.put("description", IdentifyUtil.escape4XML(study.getId(),study.getName()+" "+study.getNotes()));
        else if(study.getNotes()==null)
          map.put("description",IdentifyUtil.escape4XML(study.getId(),study.getName()));
        else
          map.put("description",IdentifyUtil.escape4XML(study.getId(),study.getNotes()));
      map.put("publisher", IdentifyUtil.escape4XML(study.getId(),publisher));           
      map.put("date", citation.getPublishYear());
      map.put("identifier", "purl.org/phylo/treebase/phylows/study/TB2:S"+study.getId());
      map.put("datestamp", study.getLastModifiedDate());
     
      }catch(Exception e){
        //study 253 citation= null, data should be fixed
         System.err.println("study "+study.getId()+
            " citation= "+e.toString());
         return null;
      }
     
      //map.put("type", "text");
View Full Code Here

   *      javax.servlet.http.HttpServletResponse)
   */
  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
    throws Exception {

    Study study = ControllerUtil.findStudy(request, mStudyService);
    Submission submission = (Submission) study.getSubmission();

    StudyCommand studyCommand = new StudyCommand();
    // copy study information
    studyCommand.setStudy(study);
    // study from TBI do not contain submission_id
    if (submission != null) {
      studyCommand.setSubmission_id(submission.getId());
    }

    List<Analysis> analysisList = study.getAnalyses();
    List<AnalysisCommand> analysisCommandList = new ArrayList<AnalysisCommand>();
    List<Analysis> changedAnalyses = new ArrayList<Analysis>();

    StringBuilder errBuilder = new StringBuilder();
    for (Analysis analysis : analysisList) {
View Full Code Here

    mSubmissionHome = pSubmissionHome;
 
 
  public ModelAndView handleRequest(HttpServletRequest pRequest, HttpServletResponse pResponse)
  throws Exception {
    Study study = null;
    if (pRequest.getParameter("treeid") != null) {
      String treeId = pRequest.getParameter("treeid");
      PhyloTree tree = getPhyloTreeService().findByID(Long.parseLong(treeId));
      study = tree.getStudy();
    }
    if (pRequest.getParameter("treeblockid") != null) {
      String treeBlockId = pRequest.getParameter("treeblockid");
      Long value = Long.parseLong(treeBlockId);
      TreeBlock treeBlock = getPhyloTreeHome().findTreeBlockById(value);
      study = getSubmissionHome().findByTreeBlock(treeBlock).getStudy();
    }
    if ( ControllerUtil.isReviewerAccessGranted(pRequest) || ( study != null && study.isPublished() ) ) {
      return super.handleRequest(pRequest, pResponse);
    }
    else {
      return new ModelAndView("redirect:/accessviolation.html");
    }   
View Full Code Here

    // Map<String, Object> studyMap = (Map)
    // request.getSession().getAttribute(Constants.STUDY_MAP);

    Citation c = null;
    Study study = ControllerUtil.findStudy(request, getStudyService());
    // if (studyMap != null) {

    // map Citation object data to CitationCommand object
    c = study.getCitation();
    // }

    if (c == null) {
      // citation has not been created yet
      // create a default citaiton:
      c = getCitationService().createCitation(selectedCitationType);

      // set default for URL
      c.setURL("http://");

      study.setCitation(c);
      c.setStudy(study);
    } else if (selectedCitationType != null
      && !c.getCitationType().equalsIgnoreCase(selectedCitationType)) {

      // morph the citation to the selected type:
      c.setCitationType(selectedCitationType);
      c = Citation.factory(c);

      study.setCitation(c);
      c.setStudy(study);
    }

    // if (citation != null) {
    // BeanUtils.copyProperties(citationCommand, citation);
View Full Code Here

    }
   
    String publicationStatusUpdate = citation.getStatusDescriptionUpdate();
    if (request.getParameter(ACTION_SUBMIT) != null) {
      User user = ControllerUtil.getUser(request, mUserService);
      Study study = ControllerUtil.findStudy(request, mStudyService);
      if (citation.isCitationTypeChanged()) {
        // need to create a new citation object for the study:
        replaceCitation(study, citation);
      } else if (citation != study.getCitation()) {
        study.setCitation(citation);
        citation.setStudy(study);
      }
      if (publicationStatusUpdate != null) {
        CitationStatus publicationStatus = getCitationService()
          .findCitationStatusByDescription(publicationStatusUpdate);
        citation.setCitationStatus(publicationStatus);
      }
      mStudyService.update(study);
      ControllerUtil.saveStudy(request, study);
      return new ModelAndView(new RedirectView("citationForm.html"));
    } else if (request.getParameter(ACTION_UPDATE) != null) {
      if (publicationStatusUpdate != null) {
        CitationStatus publicationStatus = getCitationService()
          .findCitationStatusByDescription(publicationStatusUpdate);
        citation.setCitationStatus(publicationStatus);
      }
      //if (citation.isCitationTypeChanged()) {
        Study study = ControllerUtil.findStudy(request, mStudyService);
        replaceCitation(study, citation);
        mStudyService.update(study);
      //} else {
        getCitationService().update(citation);
      //}
View Full Code Here

    HttpServletRequest request,
    HttpServletResponse response,
    Object command,
    BindException errors) throws Exception {

    Study study = (Study) command;
    User user = ControllerUtil.getUser(request, mUserService);
   
    if (request.getParameter(ACTION_SUBMIT) != null) {
      // Study must be submitted with citation together
      // here we are just saving the data to the session
      // request.getSession().setAttribute(Constants.STUDY_KEY, study);

      // BeanUtils.copyProperties(citationCommand.getCitationMap(citationType),
      // citationCommand);

      // FIXME citation
      // Citation c = new ArticleCitation();
      // c.setStudy(study);
      // study.setCitation(c);

      // retrieve Study object from session to be submitted with citation
      // Study study = (Study) request.getSession().getAttribute(Constants.STUDY_KEY);
      // citationCommand.getCitationMap(citationType).setStudy(study);
      Submission submission = mSubmissionService.createSubmission(user, study);

      // save Study object to session and remove
      ControllerUtil.saveStudy(request, submission.getStudy());

    } else if (request.getParameter(ACTION_UPDATE) != null) {
      mStudyService.update(study);
    } else if (request.getParameter(ACTION_DELETE) != null) {

      study = getStudyService().update(study);
      getSubmissionService().deleteSubmission(study.getSubmission());
      return new ModelAndView(new RedirectView("submissionList.html"));
    } else if (request.getParameter(ACTION_CANCEL) != null) {
      return new ModelAndView(getCancelView());
    }
    return new ModelAndView(getSuccessView());
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.