Package uk.ac.bbsrc.tgac.miso.core.data.impl

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


              String scientificName = j.getString("scientificName");
              DateFormat df = new SimpleDateFormat("dd/mm/yyyy");
              String type = j.getString("sampleType");
              String locationBarcode = j.getString("locationBarcode");

              Sample news = new SampleImpl();
              news.setProject(p);
              news.setAlias(alias);
              news.setDescription(descr);
              news.setScientificName(scientificName);
              news.setSecurityProfile(sp);
              news.setSampleType(type);
              news.setLocationBarcode(locationBarcode);

              if (j.has("receivedDate") && !"".equals(j.getString("receivedDate"))) {
                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));
              }

              saveSet.add(news);
            }
            else {
View Full Code Here


    return lst;
  }

  @Override
  public Collection<Sample> listSamplesByAlias(String alias) {
    final Sample s = new SampleImpl();
    s.setId(1L);
    s.setName("SAM1");
    s.setAlias("RD_S1_MockSample");
    s.setAccession("");
    s.setDescription("Mock Sample 1");
    s.setScientificName("Homo sapiens");
    s.setTaxonIdentifier("9606");
    s.setIdentificationBarcode("SAM1::RD_S1_MockSample");
    s.setLocationBarcode("Freezer1");
    s.setSampleType("GENOMIC");
    s.setReceivedDate(new Date());

    s.setSecurityProfile(new SecurityProfile());

    Project p = new ProjectImpl();
    p.setProjectId(1L);
    p.setAlias("MockInputProject");
    s.setProject(p);

    return new ArrayList<Sample>(){{add(s);}};
  }
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl

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.