use of uk.ac.bbsrc.tgac.miso.core.data.Box in project miso-lims by miso-lims.
the class BoxPageIT method testRemoveTube.
@Test
public void testRemoveTube() {
final String position = "B01";
// confirm values pre-save
BoxPage page = getBoxPage(500L);
BoxVisualization visualization = page.getVisualization();
assertFalse("check that position B01 is full", visualization.isEmptyPosition(position));
Box initial = (Box) getSession().get(BoxImpl.class, 500L);
assertNotNull(initial.getBoxPositions().get(position));
// remove the tube
visualization.selectPosition(position);
visualization.removeTube();
// confirm values post-removal
BoxPage newPage = getBoxPage(500L);
BoxVisualization newVisualization = newPage.getVisualization();
assertTrue(" check that position B01 is now empty", newVisualization.isEmptyPosition(position));
Box box = (Box) getSession().get(BoxImpl.class, 500L);
assertNull(box.getBoxPositions().get(position));
}
use of uk.ac.bbsrc.tgac.miso.core.data.Box in project miso-lims by miso-lims.
the class DefaultPoolService method beforeDelete.
@Override
public void beforeDelete(Pool object) throws IOException {
Set<SequencingOrder> orders = sequencingOrderService.getByPool(object);
sequencingOrderService.bulkDelete(orders);
Box box = object.getBox();
if (box != null) {
box.getBoxPositions().remove(object.getBoxPosition());
boxService.save(box);
}
fileAttachmentService.beforeDelete(object);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Box in project miso-lims by miso-lims.
the class DefaultLibraryService method beforeDelete.
@Override
public void beforeDelete(Library object) throws IOException {
List<Workset> worksets = worksetService.listByLibrary(object.getId());
for (Workset workset : worksets) {
worksetService.removeLibraries(workset, Collections.singleton(object));
}
Box box = object.getBox();
if (box != null) {
box.getBoxPositions().remove(object.getBoxPosition());
boxService.save(box);
}
fileAttachmentService.beforeDelete(object);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Box in project miso-lims by miso-lims.
the class DefaultSampleService method beforeDelete.
@Override
public void beforeDelete(Sample object) throws IOException {
List<Workset> worksets = worksetService.listBySample(object.getId());
for (Workset workset : worksets) {
worksetService.removeSamples(workset, Collections.singleton(object));
}
Box box = object.getBox();
if (box != null) {
box.getBoxPositions().remove(object.getBoxPosition());
boxService.save(box);
}
fileAttachmentService.beforeDelete(object);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Box in project miso-lims by miso-lims.
the class Dtos method to.
public static Box to(@Nonnull BoxDto from) {
Box to = new BoxImpl();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
setString(to::setDescription, from.getDescription());
setString(to::setIdentificationBarcode, from.getIdentificationBarcode());
setString(to::setLocationBarcode, from.getLocationBarcode());
setObject(to::setUse, BoxUse::new, from.getUseId());
setObject(to::setSize, BoxSize::new, from.getSizeId());
setObject(to::setStorageLocation, StorageLocation::new, from.getStorageLocationId());
if (!isStringEmptyOrNull(from.getStorageLocationBarcode())) {
if (to.getStorageLocation() == null) {
to.setStorageLocation(new StorageLocation());
}
StorageLocation storageLocation = to.getStorageLocation();
setString(storageLocation::setIdentificationBarcode, from.getStorageLocationBarcode());
}
return to;
}
Aggregations