Package com.eaglegenomics.simlims.core

Examples of com.eaglegenomics.simlims.core.User


      return JSONUtils.SimpleJSONError("Only logged-in admins can delete objects.");
    }
  }

  public JSONObject deleteEmPCR(HttpSession session, JSONObject json) {
    User user;
    try {
      user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
    }
    catch (IOException e) {
      e.printStackTrace();
      return JSONUtils.SimpleJSONError("Error getting currently logged in user.");
    }

    if (user != null && user.isAdmin()) {
      if (json.has("empcrId")) {
        Long empcrId = json.getLong("empcrId");
        try {
          requestManager.deleteEmPCR(requestManager.getEmPcrById(empcrId));
          return JSONUtils.SimpleJSONResponse("EmPCR deleted");
View Full Code Here


      return JSONUtils.SimpleJSONError("Only logged-in admins can delete objects.");
    }
  }

  public JSONObject deleteEmPCRDilution(HttpSession session, JSONObject json) {
    User user;
    try {
      user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
    }
    catch (IOException e) {
      e.printStackTrace();
      return JSONUtils.SimpleJSONError("Error getting currently logged in user.");
    }

    if (user != null && user.isAdmin()) {
      if (json.has("deleteEmPCRDilution")) {
        Long deleteEmPCRDilution = json.getLong("deleteEmPCRDilution");
        try {
          requestManager.deleteEmPcrDilution(requestManager.getEmPcrDilutionById(deleteEmPCRDilution));
          return JSONUtils.SimpleJSONResponse("EmPCRDilution deleted");
View Full Code Here

  }

  @RequestMapping("/activity/activities")
  public ModelAndView listActivities() throws IOException {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext()  .getAuthentication().getName());
      Collection<Activity> activities = new HashSet<Activity>();
      for (Activity activity : protocolManager.listAllActivities()) {
        if (activity instanceof ManualActivity) {
          activities.add(activity);
        }
View Full Code Here

    try {
      for (MultipartFile fileItem : getMultipartFiles(request)) {
        uploadFile(Project.class, projectId, fileItem);
        File f = filesManager.getFile(Project.class, projectId, fileItem.getOriginalFilename().replaceAll("\\s+", "_"));
        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
        List<Sample> samples = FormUtils.importSampleInputSpreadsheet(f, user, requestManager, libraryNamingScheme);

        ObjectMapper mapper = new ObjectMapper();

        JSONArray a = new JSONArray();
View Full Code Here

      JSONObject o = new JSONObject();

      for (MultipartFile fileItem : getMultipartFiles(request)) {
        uploadFile(Project.class, projectId, fileItem);
        File f = filesManager.getFile(Project.class, projectId, fileItem.getOriginalFilename().replaceAll("\\s+", "_"));
        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
        //Map<String, Pool<Plate<LinkedList<Library>, Library>>> pooledPlates = FormUtils.importPlateInputSpreadsheet(f, user, requestManager, libraryNamingScheme);
        Map<String, PlatePool> pooledPlates = FormUtils.importPlateInputSpreadsheet(f, user, requestManager, libraryNamingScheme);

        ObjectMapper mapper = new ObjectMapper();
        mapper.getSerializationConfig().addMixInAnnotations(Sample.class, SampleRecursionAvoidanceMixin.class);
View Full Code Here

      JSONObject o = new JSONObject();

      for (MultipartFile fileItem : getMultipartFiles(request)) {
        uploadFile(Plate.class, "forms", fileItem);
        File f = filesManager.getFile(Plate.class, "forms", fileItem.getOriginalFilename().replaceAll("\\s+", "_"));
        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
        //Map<String, Pool<Plate<LinkedList<Library>, Library>>> pooledPlates = FormUtils.importPlateInputSpreadsheet(f, user, requestManager, libraryNamingScheme);
        Map<String, PlatePool> pooledPlates = FormUtils.importPlateInputSpreadsheet(f, user, requestManager, libraryNamingScheme);

        ObjectMapper mapper = new ObjectMapper();
        mapper.getSerializationConfig().addMixInAnnotations(Sample.class, SampleRecursionAvoidanceMixin.class);
View Full Code Here

          noteDAO.saveRunNote(run, n);
        }
      }

      //if this is saved by a user, and not automatically saved by the notification system
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      watcherDAO.removeWatchedEntityByUser(run, user);

      for (User u : run.getWatchers()) {
        watcherDAO.saveWatchedEntityUser(run, u);
      }
View Full Code Here

              noteDAO.saveRunNote(run, n);
            }
          }

          //if this is saved by a user, and not automatically saved by the notification system
          User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
          watcherDAO.removeWatchedEntityByUser(run, user);

          for (User u : run.getWatchers()) {
            watcherDAO.saveWatchedEntityUser(run, u);
          }
View Full Code Here

  @RequestMapping(value = "/{plateId}", method = RequestMethod.GET)
  public ModelAndView setupForm(@PathVariable Long plateId,
                                ModelMap model) throws IOException {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Plate<? extends List<? extends Plateable>, ? extends Plateable> plate = null;
      if (plateId == AbstractPlate.UNSAVED_ID) {
        plate = dataObjectFactory.getPlateOfSize(96, user);
        model.put("title", "New Plate");
      }
View Full Code Here

  }

  @RequestMapping(value = "/import", method = RequestMethod.GET)
  public ModelAndView importPlate(ModelMap model) throws IOException {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Plate<? extends List<? extends Plateable>, ? extends Plateable> plate = dataObjectFactory.getPlateOfSize(96, user);
      model.put("title", "Import Plate");
      model.put("formObj", plate);
      model.put("plate", plate);
      model.put("availableTagBarcodes", populateAvailableTagBarcodes());
View Full Code Here

TOP

Related Classes of com.eaglegenomics.simlims.core.User

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.