Package org.cipres.treebase.domain.study

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


    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


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

    Study study = ControllerUtil.findStudy(request, mStudyService); // TODO:
    Submission submission = study.getSubmission();
    // old studies do not have submission
    if (submission == null) {
      return new ModelAndView(
        "readOnlyAllTreeList",
        Constants.READONLY_TREE_LIST,
        new ArrayList());
    }

    if (request.getParameter("treeid") != null) {
      getPhyloTreeService().deletePhyloTree(
        getPhyloTreeService().findByID(Long.parseLong(request.getParameter("treeid"))));
    }

    Collection<PhyloTree> phyloTrees = submission.getAllSubmittedTrees();

    return new ModelAndView("readOnlyAllTreeList", Constants.READONLY_TREE_LIST, phyloTrees);
  }
View Full Code Here

  }
 
  private boolean isSubmitter (long objectId,HttpServletRequest request) {
    Study study = ControllerUtil.findStudy(request, getStudyService());
    //Study study = getStudy(objectId,request);
    Submission submission = study.getSubmission();
    TBPermission tbp = getSubmissionService().getPermission(request.getRemoteUser(), submission.getId());
    if (tbp == TBPermission.WRITE || tbp == TBPermission.READ_ONLY || tbp == TBPermission.SUBMITTED_WRITE) {
      return true;
    }
    else {
      return false;
View Full Code Here

  protected Map<String,Object> referenceData(HttpServletRequest pRequest) throws Exception {

    Map<String,Object> resultMap = new HashMap<String,Object>();
    Study study = ControllerUtil.findStudy(pRequest, getStudyService());

    Submission submission = study.getSubmission();
    java.util.Date creationDate = submission.getCreateDate();

    if (creationDate != null) {
      String initiatedDate = DateFormat.getDateInstance(DateFormat.LONG).format(creationDate);
      resultMap.put("initiatedDate", initiatedDate);
    } else {
      resultMap.put("initiatedDate", null);
    }

    resultMap.put("submissionNumber", submission.getSubmissionNumber());
    resultMap.put("submission", submission);
    resultMap.put("studyStatus", study.getStudyStatus().getDescription());

    // Collection<Analysis> anacoll = study.getAnalysesReadOnly();
    // resultMap.put("analysisCollection", anacoll);

    // This line and below, I have taken the code from Lucie's
    // DisplayAnalysisController's handleRequest method. The Analysis shown here
    // as part of the summary is essentially identical to the Analysis section details as read
    // only mode.
    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>();
View Full Code Here

  protected Map<String,Object> referenceData(HttpServletRequest pRequest) throws Exception {
    LOGGER.info("in referenceData");
    Map<String,Object> resultMap = new HashMap<String,Object>();
    Study study = ControllerUtil.findStudy(pRequest, getStudyService());

    Submission submission = study.getSubmission();
    java.util.Date creationDate = submission.getCreateDate();

    if (creationDate != null) {
      String initiatedDate = DateFormat.getDateInstance(DateFormat.LONG).format(creationDate);
      resultMap.put("initiatedDate", initiatedDate);
    } else {
      resultMap.put("initiatedDate", null);
    }

    resultMap.put("submissionNumber", submission.getSubmissionNumber());
    resultMap.put("studyStatus", study.getStudyStatus().getDescription());

    // Collection<Analysis> anacoll = study.getAnalysesReadOnly();
    // resultMap.put("analysisCollection", anacoll);

    // This line and below, I have taken the code from Lucie's
    // DisplayAnalysisController's handleRequest method. The Analysis shown here
    // as part of the summary is essentially identical to the Analysis section details as read
    // only mode.
    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>();
View Full Code Here

    newModel.put("taxon", theTaxon);
   
    newModel.put("matrices", getMatrixService().findByStudy(theStudy));
    newModel.put("trees", getPhyloTreeService().findByStudy(theStudy))
   
    Submission submission = theStudy.getSubmission();
    java.util.Date creationDate = submission.getCreateDate();
   
    if (creationDate != null) {
      String initiatedDate = DateFormat.getDateInstance(DateFormat.LONG).format(creationDate);
      newModel.put("initiatedDate", initiatedDate);
    } else {
      newModel.put("initiatedDate", null);
    }   
   
    newModel.put("submissionNumber", submission.getSubmissionNumber());
    newModel.put("studyStatus", theStudy.getStudyStatus().getDescription())
    StudyCommand studyCommand = new StudyCommand();
    studyCommand.setStudy(theStudy);
    if (submission != null) {
      studyCommand.setSubmission_id(submission.getId());
    }
    List<Analysis> analysisList = theStudy.getAnalyses();
    List<AnalysisCommand> analysisCommandList = new ArrayList<AnalysisCommand>();
    for (Analysis analysis : analysisList) {
View Full Code Here

    Long submissionId = null;

    Study study = getStudyService().findByID(study_id);
    if (study != null) {
      Submission sub = study.getSubmission();
      if (sub != null) {
        submissionId = sub.getId();
      }
    }

    // FIXME: move the method to studyService, handle the case study w/o submission
    TBPermission perm = getSubmissionService().getPermission(username, submissionId);
View Full Code Here

  }

  @Override
  protected Study getStudy(long objectId, HttpServletRequest request) {
    TreeBlock treeBlock = getPhyloTreeHome().findTreeBlockById(objectId);
    Submission submission = getSubmissionHome().findByTreeBlock(treeBlock);
    return submission.getStudy();   
  }
View Full Code Here

    Object command,
    BindException bindExp) throws Exception {

    String studyAccession = request.getParameter("submissionaccession").trim();
    String identifierType = request.getParameter("identifierType").trim();
    Submission sub;

    if (TreebaseUtil.isEmpty(studyAccession)) {     
      return setAttributeAndShowForm(
        request,
        response,
        bindExp,
        "errors",
        "Please provide a study accession number.");
    }   
    if ( identifierType.equals("TB1") ) {
      if ( ! studyAccession.startsWith("S") ) {
        studyAccession = "S" + studyAccession;
      }
      sub = getSubmissionHome().findByStudyAccessionNumber(studyAccession);
    }
    else if( identifierType.equals("TB2") ){
      sub = getSubmissionHome().findBySubmissionNumber(studyAccession);
    }
    else{
      Long pID;
      try{
        pID=Long.parseLong(studyAccession);
        sub = getSubmissionHome().findByStudyID(pID);
      }catch(NumberFormatException nfe){
        sub=null;
      }
       
    }
   
    if (sub == null) {
      return setAttributeAndShowForm(request, response, bindExp, "errors", "Submission accession: '"
        + studyAccession + "' does not exist.");
    }

    request.getSession().setAttribute("SUBMISSION_FROM_SEARCHBYSUBMISSIONID", sub.getId());
    request.getSession().setAttribute("ADMIN_COMING_FROM", "SearchBySubmissionID");

    return new ModelAndView(getSuccessView());

  }
View Full Code Here

  public ModelAndView handleRequest(HttpServletRequest pRequest, HttpServletResponse pResponse)
    throws Exception {

    Long study_id = ControllerUtil.getStudyId(pRequest);
    Study study = mStudyService.findByID(study_id);
    Submission submission = study.getSubmission();
    generateAFileDynamically(pRequest, pResponse, submission.getId());
    return null;
  }
View Full Code Here

TOP

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

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.