Examples of EmptyStudyException


Examples of org.cipres.treebase.web.exceptions.EmptyStudyException

   * @return
   */
  public static Long getStudyId(HttpServletRequest request) throws EmptyStudyException {
    Map<String, Object> map = (Map) request.getSession().getAttribute(Constants.STUDY_MAP);
    if (map == null) {
      throw new EmptyStudyException(message_no_study);
    }
    return (Long) map.get("id");
  }
View Full Code Here

Examples of org.cipres.treebase.web.exceptions.EmptyStudyException

      } else {
        id = getStudyId(request);
        study = studyService.findByID(id);
      }
      if (study == null) {
        throw new EmptyStudyException(message_no_study);
      }
    }
    /*
     * XXX I (RAV) added the block below, I realize it's clunky,
     * but I ended up in a condition where the map was null, but
     * the study id was defined, so I did it like this. If there
     * is a better way (which I'm sure there is) please fix this
     * method.
     */
    else {
      id = Long.parseLong(request.getParameter("id").toString())
      study = studyService.findByID(id);
      if (study == null) {
        throw new EmptyStudyException(message_no_study);
      }
    }
    return study;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.