Package org.cipres.treebase.domain.study

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


   * submission_id) iii)new submission
   *
   * Creation date: June 5, 2006 5:19:18 PM
   */
  protected Object formBackingObject(HttpServletRequest request) throws ServletException {
    Study study = new Study();
    String submission_id = ServletRequestUtils.getStringParameter(request, "id", null);
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("In studyFormController--");
    }

    if (!TreebaseUtil.isEmpty(submission_id)) {
      study = mStudyService.findBySubmissionID(Long.parseLong(submission_id));
      ControllerUtil.saveStudy(request, study); // user has made selection
      return study;
    }
    // if we start a new form (indicated by URL)
    String form = request.getParameter("form");
    if (form != null && form.equals("new")) {
      // start a new form, remove what's in the session
      request.getSession().removeAttribute(Constants.STUDY_KEY);
      request.getSession().removeAttribute(Constants.STUDY_MAP);
      return new Study();
    }
           
    // if we are updating a data that's already in the db (access from RHS menu)
    study = ControllerUtil.findStudy(request, mStudyService);
    return study;
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 {

    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,
View Full Code Here

        author_editor.setMiddleName(author_editor.getMiddleName().trim());
      }
    }

    // Get the existing list of authors for the citation
    Study study = ControllerUtil.findStudy(request, mStudyService);
    Citation citation = study.getCitation();

    if (citation == null) {
      request.getSession().setAttribute(
        "errors",
        "Please provide the citataion for this study first.");
      return showForm(request, response, bindExp);
    }

    // list of original author/editors associated with the citation
    List<Person> currentPersons = getPeople(citation);

    // Check permission that the user has the edit right:
    // Currently it is not necessary since the only delete link can be hacked by direct editing
    // the url.
    // but the delete can only work with this particular study.
    TBPermission perm = getStudyService().getPermission(request.getRemoteUser(), study.getId());
    if (perm != TBPermission.WRITE) {
      // Give error message and return
      // return;
    }
View Full Code Here

    /*
     * Retrieve the list of authors to show
     */
    // Long submission_id = ControllerUtil.getSubmissionId(request);
    // Study study = mStudyService.findBySubmissionID(submission_id);
    Study study = ControllerUtil.findStudy(request, mStudyService);
    List<Person> people = null;
    if (study != null) {
      Citation citation = study.getCitation();

      if (citation != null) people = getPeople(citation);// study.getAuthors();
    }

    request.getSession().setAttribute(Constants.PEOPLE_LIST, people);
View Full Code Here

   * This method rearranges the authors/editors list based on the new ids arrangement received
   * from the action of 'up' & 'down' buttons on the form.
   */
  private void rearrangeList(String aPersonIdsList, HttpServletRequest request) {

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

    Citation citation = study.getCitation();
    List<Person> oldList = (List<Person>) getPeople(citation);

    if (LOGGER.isDebugEnabled()) {
      LOGGER
        .debug("rearrangeList(String, HttpServletRequest) - Total Elements in the Old List:" + oldList.size()); //$NON-NLS-1$
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 {
View Full Code Here

    List<String> sessionlist = new ArrayList<String>();
    sessionlist.add(request.getRequestURL().toString());
    sessionlist.add(null);
    request.getSession().setAttribute("REQUEST_VIEW_URL", sessionlist);

    Study study = ControllerUtil.findStudy(request, mStudyService);
    Collection<TaxonLabel> taxonLabels = getTaxonLabelHome().findByStudy(study);
    Iterator<TaxonLabel> taxonLabelsIterator = taxonLabels.iterator();
    List<String> errors = new ArrayList<String>();
    while ( taxonLabelsIterator.hasNext() ) {
      TaxonLabel label = taxonLabelsIterator.next();
View Full Code Here

      nexusFileName = (nexusFile).replaceAll("%20", "_");
    }
    if (nexusFileName == null) {
      return null;
    }
    Study study = ControllerUtil.findStudy(req, mStudyService);
    Map<String, String> nexusMap = study.getNexusFiles();   
    String nexusString = nexusMap.get(nexusFileName);
    return nexusString != null
      ? nexusString
      : "File Not Found. File Name is: " + nexusFileName;
  }
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.