Package com.eaglegenomics.simlims.core

Examples of com.eaglegenomics.simlims.core.User


  }

  public JSONObject getSampleQCUsers(HttpSession session, JSONObject json) {
    try {
      Collection<String> users = new HashSet<String>();
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      users.add(user.getFullName());

      if (json.has("sampleId") && !json.get("sampleId").equals("")) {
        Long sampleId = Long.parseLong(json.getString("sampleId"));
        Sample sample = requestManager.getSampleById(sampleId);
View Full Code Here


    Long sampleId = json.getLong("sampleId");
    String internalOnly = json.getString("internalOnly");
    String text = json.getString("text");

    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Sample sample = requestManager.getSampleById(sampleId);
      Note note = new Note();

      internalOnly = internalOnly.equals("on") ? "true" : "false";
View Full Code Here

    }
  }

  public JSONObject printSampleBarcodes(HttpSession session, JSONObject json) {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());

      String serviceName = null;
      if (json.has("serviceName")) {
        serviceName = json.getString("serviceName");
      }
View Full Code Here

    String locationBarcode = json.getString("locationBarcode");

    try {
      String newLocation = LimsUtils.lookupLocation(locationBarcode);
      if (newLocation != null) {
        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
        Sample sample = requestManager.getSampleById(sampleId);
        String oldLocation = sample.getLocationBarcode();
        sample.setLocationBarcode(newLocation);

        Note note = new Note();
        note.setInternalOnly(true);
        note.setText("Location changed from " + oldLocation + " to " + newLocation + " by " + user.getLoginName() + " on " + new Date());
        note.setOwner(user);
        note.setCreationDate(new Date());
        sample.getNotes().add(note);
        requestManager.saveSampleNote(sample, note);
        requestManager.saveSample(sample);
View Full Code Here

      return JSONUtils.SimpleJSONError("This scientific name is not of a known taxonomy. You may have problems when trying to submit this data to public repositories.");
    }
  }

  public JSONObject deleteSample(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("sampleId")) {
        Long sampleId = json.getLong("sampleId");
        try {
          requestManager.deleteSample(requestManager.getSampleById(sampleId));
          return JSONUtils.SimpleJSONResponse("Sample deleted");
View Full Code Here

      return JSONUtils.SimpleJSONError(e.getMessage());
    }
  }

  public JSONObject deletePool(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("poolId")) {
        Long poolId = json.getLong("poolId");
        try {
          requestManager.deletePool(requestManager.getPoolById(poolId));
          return JSONUtils.SimpleJSONResponse("Pool deleted");
View Full Code Here

public JSONObject previewProject(HttpSession session, JSONObject json) {
    StringBuffer sb = new StringBuffer();
    String projectId = (String) json.get("projectId");

    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Project project = requestManager.getProjectById(Long.parseLong(projectId));

      session.setAttribute("project", project);

      String studyHTML = "";
View Full Code Here

      pqcs.add(s);
    }

    if (ids.size() > 0 && platformType != null && concentration != null) {
      try {
        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());

        List<Dilution> dils = new ArrayList<Dilution>();
        for (Integer id : ids) {
          dils.add(requestManager.getDilutionByIdAndPlatform(id.longValue(), platformType));
        }
View Full Code Here

    }
  }

  public JSONObject printPlateBarcodes(HttpSession session, JSONObject json) {
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());

      String serviceName = null;
      if (json.has("serviceName")) {
        serviceName = json.getString("serviceName");
      }
View Full Code Here

    String locationBarcode = json.getString("locationBarcode");

    try {
      String newLocation = LimsUtils.lookupLocation(locationBarcode);
      if (newLocation != null) {
        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
        //Plate<LinkedList<Plateable>, Plateable> plate = requestManager.<LinkedList<Plateable>, Plateable> getPlateById(plateId);
        Plate<? extends List<? extends Plateable>, ? extends Plateable> plate = requestManager.getPlateById(plateId);
        plate.setLocationBarcode(locationBarcode);
        /*
        Note note = new Note();
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.