Examples of LibraryDilution


Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

    for (String s : codes) {
      if (LimsUtils.isBase64String(s)) {
        //Base64-encoded string, most likely a barcode image beeped in. decode and search
        s = new String(Base64.decodeBase64(s));
      }
      LibraryDilution ed = requestManager.getLibraryDilutionByBarcode(s);
      if (ed != null) {
        sb.append("<span>");
        sb.append("<input type='checkbox' value='" + s + "' name='importdilslist' id='importdilslist_" + ed.getName() + "'/>");
        sb.append("<label for='importdilslist_" + ed.getName() + "'>" + ed.getName() + " (" + s + ")</label>");
        sb.append("</span>");
      }
    }
    sb.append("</div>");
    sb.append("<a onclick='Utils.ui.checkAll(\"importdilslist\"); return false;' href='javascript:void(0);'>All</a> " +
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

      JSONArray ls = JSONArray.fromObject(json.getString("dilutions"));
      for (JSONObject l : (Iterable<JSONObject>)ls) {
        try {
          Long dilutionId = l.getLong("dilutionId");
          String platform = l.getString("platform");
          LibraryDilution dilution = requestManager.getLibraryDilutionById(dilutionId);
          //autosave the barcode if none has been previously generated
          if (dilution.getIdentificationBarcode() == null || "".equals(dilution.getIdentificationBarcode())) {
            requestManager.saveLibraryDilution(dilution);
          }
          File f = mps.getLabelFor(dilution);
          if (f!=null) thingsToPrint.add(f);
          thingsToPrint.add(f);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

  public JSONObject getLibraryDilutionBarcode(HttpSession session, JSONObject json) {
    Long dilutionId = json.getLong("dilutionId");
    File temploc = new File(session.getServletContext().getRealPath("/")+"temp/");
    try {
      LibraryDilution dil = requestManager.getLibraryDilutionById(dilutionId);
      barcodeFactory.setPointPixels(1.5f);
      barcodeFactory.setBitmapResolution(600);
      RenderedImage bi = barcodeFactory.generateSquareDataMatrix(dil, 400);
      if (bi != null) {
        File tempimage = misoFileManager.generateTemporaryFile("barcode-", ".png", temploc);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

        }
      }
      if (json.has("libraryId") && !json.get("libraryId").equals("")) {
        Long libraryId = Long.parseLong(json.getString("libraryId"));
        Library library = requestManager.getLibraryById(libraryId);
        LibraryDilution newDilution = dataObjectFactory.getLibraryDilution();
        newDilution.setSecurityProfile(library.getSecurityProfile());
        newDilution.setDilutionCreator(json.getString("dilutionCreator"));
        newDilution.setCreationDate(new SimpleDateFormat("dd/MM/yyyy").parse(json.getString("dilutionDate")));
        //newDilution.setLocationBarcode(json.getString("locationBarcode"));
        newDilution.setConcentration(Double.parseDouble(json.getString("results")));
        library.addDilution(newDilution);
        requestManager.saveLibraryDilution(newDilution);

        StringBuilder sb = new StringBuilder();
        sb.append("<tr>");
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

  public JSONObject changeLibraryDilutionRow(HttpSession session, JSONObject json) {
    try {
      JSONObject response = new JSONObject();
      Long dilutionId = Long.parseLong(json.getString("dilutionId"));
      LibraryDilution dilution = requestManager.getLibraryDilutionById(dilutionId);
      response.put("results", "<input type='text' id='" + dilutionId + "' value='" + dilution.getConcentration() + "'/>");
      response.put("edit", "<a href='javascript:void(0);' onclick='Library.dilution.editLibraryDilution(\"" + dilutionId + "\");'>Save</a>");
      return response;
    }
    catch (Exception e) {
      log.error("Failed to display Library Dilution of this Library: ", e);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

  public JSONObject editLibraryDilution(HttpSession session, JSONObject json) {
    try {
      if (json.has("dilutionId") && !json.get("dilutionId").equals("")) {
        Long dilutionId = Long.parseLong(json.getString("dilutionId"));
        LibraryDilution dilution = requestManager.getLibraryDilutionById(dilutionId);
        dilution.setConcentration(Double.parseDouble(json.getString("result")));
        requestManager.saveLibraryDilution(dilution);
        return JSONUtils.SimpleJSONResponse("OK");
      }
    }
    catch (Exception e) {
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

          return JSONUtils.SimpleJSONError("Please enter a value for '" +k+ "'");
        }
      }
      if (json.has("dilutionId") && !json.get("dilutionId").equals("")) {
        Long dilutionId = Long.parseLong(json.getString("dilutionId"));
        LibraryDilution dilution = requestManager.getLibraryDilutionById(dilutionId);
        emPCR pcr = dataObjectFactory.getEmPCR();
        pcr.setSecurityProfile(dilution.getSecurityProfile());
        pcr.setPcrCreator(json.getString("pcrCreator"));
        pcr.setCreationDate(new SimpleDateFormat("dd/MM/yyyy").parse(json.getString("pcrDate")));
        pcr.setConcentration(Double.parseDouble(json.getString("results")));
        pcr.setLibraryDilution(dilution);
        requestManager.saveEmPCR(pcr);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

      namedTemplate.update(EMPCR_UPDATE, params);
      */
    }

    if (this.cascadeType != null) {
      LibraryDilution ld = pcr.getLibraryDilution();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
        if (ld != null) libraryDilutionDAO.save(ld);
      }
      else if (this.cascadeType.equals(CascadeType.REMOVE)) {
        if (ld != null) {
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

  public boolean remove(emPCR e) throws IOException {
    NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
    if (e.isDeletable() &&
           (namedTemplate.update(EMPCR_DELETE,
                            new MapSqlParameterSource().addValue("pcrId", e.getId())) == 1)) {
      LibraryDilution ld = e.getLibraryDilution();
      if (this.cascadeType.equals(CascadeType.PERSIST)) {
        if (ld != null) libraryDilutionDAO.save(ld);
      }
      else if (this.cascadeType.equals(CascadeType.REMOVE)) {
        if (ld != null) {
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryDilution

    }
  }

  public class LibraryDilutionMapper implements RowMapper<LibraryDilution> {
    public LibraryDilution mapRow(ResultSet rs, int rowNum) throws SQLException {
      LibraryDilution libraryDilution = dataObjectFactory.getLibraryDilution();
      libraryDilution.setId(rs.getLong("dilutionId"));
      libraryDilution.setName(rs.getString("name"));
      libraryDilution.setConcentration(rs.getDouble("concentration"));
      libraryDilution.setIdentificationBarcode(rs.getString("identificationBarcode"));
      libraryDilution.setCreationDate(rs.getDate("creationDate"));
      libraryDilution.setDilutionCreator(rs.getString("dilutionUserName"));

      //libraryDilution.setLastUpdated(rs.getTimestamp("lastUpdated"));

      try {
        libraryDilution.setSecurityProfile(securityProfileDAO.get(rs.getLong("securityProfile_profileId")));
        Library library = libraryDAO.get(rs.getLong("library_libraryId"));
        libraryDilution.setLibrary(library);
      }
      catch (IOException e1) {
        e1.printStackTrace();
      }
      return libraryDilution;
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.