@Override protected void populate(Element xml, Sample sample) { xml.setAttribute("alias", sample.getAlias()); xml.setAttribute("center_name", centreName); Element sampleTitle = xml.getOwnerDocument().createElementNS(null, "TITLE"); sampleTitle.setTextContent(sample.getAlias()); xml.appendChild(sampleTitle); Element sampleName = xml.getOwnerDocument().createElementNS(null, "SAMPLE_NAME"); Element sampleScientificName = xml.getOwnerDocument().createElementNS(null, "SCIENTIFIC_NAME"); sampleScientificName.setTextContent(sample.getScientificName()); sampleName.appendChild(sampleScientificName); // 2/11/2011 Antony Colles moved IF !=null statement, to help produce valid submission XML. Element sampleTaxonIdentifier = xml.getOwnerDocument().createElementNS(null, "TAXON_ID"); if (!isStringEmptyOrNull(sample.getTaxonIdentifier())) { sampleTaxonIdentifier.setTextContent(sample.getTaxonIdentifier()); } else { sampleTaxonIdentifier.setTextContent("000001"); } sampleName.appendChild(sampleTaxonIdentifier); xml.appendChild(sampleName); Element sampleDescription = xml.getOwnerDocument().createElementNS(null, "DESCRIPTION"); sampleDescription.setTextContent(sample.getDescription()); xml.appendChild(sampleDescription); }
private static SampleDto copySampleFields(@Nonnull Sample from, @Nonnull SampleDto dto, boolean includeBoxPositions) { dto.setId(from.getId()); dto.setName(from.getName()); dto.setDescription(from.getDescription()); dto.setUpdatedById(from.getLastModifier().getUserId()); dto.setIdentificationBarcode(from.getIdentificationBarcode());
target.setDescription(source.getDescription()); target.setSampleType(source.getSampleType()); target.setReceivedDate(source.getReceivedDate()); target.setDescription(source.getDescription()); target.setDiscarded(source.isDiscarded()); if (target.isDiscarded()) {
v.setSampleAccession(sam.getAccession()); v.setSampleAlias(sam.getAlias()); v.setSampleDescription(sam.getDescription()); v.setSampleId(sam.getId()); v.setSampleName(sam.getName());