Package com.eaglegenomics.simlims.core

Examples of com.eaglegenomics.simlims.core.User


  }

  public JSONObject unwatchOverview(HttpSession session, JSONObject json) {
    Long overviewId = json.getLong("overviewId");
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      ProjectOverview overview = requestManager.getProjectOverviewById(overviewId);
      if (!overview.getProject().getSecurityProfile().getOwner().equals(user)) {
        if (overview.getWatchers().contains(user)) {
          watchManager.unwatch(overview, user);
          watchManager.unwatch(overview.getProject(), user);
View Full Code Here


  public JSONObject listWatchOverview(HttpSession session, JSONObject json) {
    Long overviewId = json.getLong("overviewId");
    StringBuilder sb = new StringBuilder();
    JSONObject j = new JSONObject();
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      ProjectOverview overview = requestManager.getProjectOverviewById(overviewId);
      sb.append("<ul class='bullets' style='margin-left: -30px;'>");
      for (User theUser : overview.getWatchers()) {
        sb.append("<li>");
        sb.append(theUser.getFullName());
View Full Code Here

  public JSONObject illuminaExperimentSearch(HttpSession session, JSONObject json) {
    StringBuffer sb = new StringBuffer();
    String searchStr = (String) json.get("str");
    String resultId = (String) json.get("id");
    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      if (searchStr.length() > 1) {
        String str = searchStr.toLowerCase();

        StringBuilder b = new StringBuilder();
View Full Code Here

  public SystemAlert() {
    super(getDummySystemUser());
  }

  private static User getDummySystemUser() {
    User dummySystemUser = new UserImpl();
    dummySystemUser.setUserId(LimsUtils.SYSTEM_USER_ID);
    return dummySystemUser;
  }
View Full Code Here

    }
    return JSONUtils.SimpleJSONError("Failed to add server");
  }

  public JSONObject deleteSequencerReference(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("refId")) {
        Long refId = json.getLong("refId");
        try {
          requestManager.deleteSequencerReference(requestManager.getSequencerReferenceById(refId));
          return JSONUtils.SimpleJSONResponse("Sequencer Reference deleted");
View Full Code Here

    Run run = (Run) session.getAttribute("run_" + cId);

    String newRuntype = json.getString("platformtype");

    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Long runId = AbstractRun.UNSAVED_ID;

      if (json.has("runId") && !json.getString("runId").equals("")) {
        //edit existing run
        Map<String, Object> responseMap = new HashMap<String, Object>();
View Full Code Here

    String cId = json.getString("run_cId");
    try {
      SequencerReference sr = requestManager.getSequencerReferenceById(sequencerReferenceId);
      PlatformType pt = sr.getPlatform().getPlatformType();
      Map<String, Object> responseMap = new HashMap<String, Object>();
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());

      Run run = dataObjectFactory.getRunOfType(pt, user);
      run.setSequencerReference(sr);

      session.setAttribute("run_" + cId, run);
View Full Code Here

  }

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

      StringBuilder sb = new StringBuilder();
      for (String name : users) {
        sb.append("<option value='" + name + "'>" + name + "</option>");
      }
View Full Code Here

      return JSONUtils.SimpleJSONError("Please supply a barcode to lookup.");
    }
  }

  public JSONObject generateIlluminaDemultiplexCSV(HttpSession session, JSONObject json) throws IOException {
    User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
    IlluminaRun r = (IlluminaRun) requestManager.getRunById(json.getLong("runId"));
    SequencerPartitionContainer<SequencerPoolPartition> f = requestManager.getSequencerPartitionContainerById(json.getLong("containerId"));
    if (r != null && f != null) {
      String casavaVersion = "1.8.2";
      if (json.has("casavaVersion") && !"".equals(json.getString("casavaVersion"))) {
        casavaVersion = json.getString("casavaVersion");
      }

      String sheet = RunProcessingUtils.buildIlluminaDemultiplexCSV(r, f, casavaVersion, user.getFullName());
      return JSONUtils.SimpleJSONResponse(sheet);
    }
    return JSONUtils.SimpleJSONError("No run or container found with that ID.");
  }
View Full Code Here

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

    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Run run = requestManager.getRunById(runId);
      Note note = new Note();

      internalOnly = internalOnly.equals("on") ? "true" : "false";
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.