Package com.eaglegenomics.simlims.core

Examples of com.eaglegenomics.simlims.core.Note


                Date date = df.parse(j.getString("receivedDate"));
                news.setReceivedDate(date);
              }

              if (!j.getString("note").equals("")) {
                Note note = new Note();
                note.setOwner(sp.getOwner());
                note.setText(j.getString("note"));
                note.setInternalOnly(true);

                if (j.has("receivedDate") && !"".equals(j.getString("receivedDate"))) {
                  Date date = df.parse(j.getString("receivedDate"));
                  note.setCreationDate(date);
                }
                else {
                  note.setCreationDate(new Date());
                }

                news.setNotes(Arrays.asList(note));
              }
View Full Code Here


    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";

      note.setInternalOnly(Boolean.parseBoolean(internalOnly));
      note.setText(text);
      note.setOwner(user);
      note.setCreationDate(new Date());
      sample.getNotes().add(note);
      requestManager.saveSampleNote(sample, note);
      requestManager.saveSample(sample);
    }
    catch (IOException e) {
View Full Code Here

        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);
      }
      else {
View Full Code Here

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

    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      Library library = requestManager.getLibraryById(libraryId);
      Note note = new Note();
      internalOnly = internalOnly.equals("on") ? "true" : "false";
      note.setInternalOnly(Boolean.parseBoolean(internalOnly));
      note.setText(text);
      note.setOwner(user);
      note.setCreationDate(new Date());
      library.getNotes().add(note);
      requestManager.saveLibraryNote(library, note);
      requestManager.saveLibrary(library);
    }
    catch (IOException e) {
View Full Code Here

        User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
        Library library = requestManager.getLibraryById(libraryId);
        String oldLocation = library.getLocationBarcode();
        library.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());
        library.getNotes().add(note);
        requestManager.saveLibraryNote(library, note);
        requestManager.saveLibrary(library);
      }
      else {
View Full Code Here

    try {
      User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
      ProjectOverview overview = requestManager.getProjectOverviewById(overviewId);
      Project project = overview.getProject();

      Note note = new Note();

      internalOnly = internalOnly.equals("on") ? "true" : "false";

      note.setInternalOnly(Boolean.parseBoolean(internalOnly));
      note.setText(text);
      note.setOwner(user);
      note.setCreationDate(new Date());
      overview.getNotes().add(note);
      requestManager.saveProjectOverviewNote(overview, note);
      requestManager.saveProject(project);
    }
    catch (IOException e) {
View Full Code Here

    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";

      note.setInternalOnly(Boolean.parseBoolean(internalOnly));
      note.setText(text);
      note.setOwner(user);
      note.setCreationDate(new Date());
      run.getNotes().add(note);
      requestManager.saveRunNote(run, note);
      requestManager.saveRun(run);
    }
    catch (IOException e) {
View Full Code Here

          }

          Node n9 = ttre.getChildNodes().item(9);
          if (n9.getFirstChild() != null) {
            if (!"".equals(n9.getFirstChild().getTextContent())) {
              Note n = new Note();
              n.setText(n9.getFirstChild().getTextContent());
              s.addNote(n);
            }
          }

          samples.add(s);
View Full Code Here

    return note.getNoteId();
  }

  public Note get(long noteId) throws IOException {
    List eResults = template.query(NOTE_SELECT_BY_ID, new Object[]{noteId}, new NoteMapper());
    Note e = eResults.size() > 0 ? (Note) eResults.get(0) : null;
    return e;
  }
View Full Code Here

    return template.query(NOTES_BY_RELATED_RUN, new Object[]{runId}, new NoteMapper());
  }

  public class NoteMapper implements RowMapper<Note> {
    public Note mapRow(ResultSet rs, int rowNum) throws SQLException {
      Note note = new Note();
      note.setNoteId(rs.getLong("noteId"));
      note.setCreationDate(rs.getDate("creationDate"));
      note.setInternalOnly(rs.getBoolean("internalOnly"));
      note.setText(rs.getString("text"));

      try {
        note.setOwner(securityDAO.getUserById(rs.getLong("owner_userId")));
      }
      catch (IOException e) {
        e.printStackTrace();
      }
View Full Code Here

TOP

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

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.