Search in sources :

Example 11 with Box

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));
}
Also used : BoxVisualization(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BoxVisualization) BoxImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl) Box(uk.ac.bbsrc.tgac.miso.core.data.Box) BoxPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BoxPage) Test(org.junit.Test)

Example 12 with Box

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);
}
Also used : SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) Box(uk.ac.bbsrc.tgac.miso.core.data.Box)

Example 13 with Box

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);
}
Also used : Workset(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.Workset) Box(uk.ac.bbsrc.tgac.miso.core.data.Box)

Example 14 with Box

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);
}
Also used : Workset(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.Workset) Box(uk.ac.bbsrc.tgac.miso.core.data.Box)

Example 15 with Box

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;
}
Also used : BoxImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl) Box(uk.ac.bbsrc.tgac.miso.core.data.Box) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) BoxSize(uk.ac.bbsrc.tgac.miso.core.data.BoxSize) StorageLocation(uk.ac.bbsrc.tgac.miso.core.data.impl.StorageLocation) BoxUse(uk.ac.bbsrc.tgac.miso.core.data.BoxUse)

Aggregations

Box (uk.ac.bbsrc.tgac.miso.core.data.Box)65 Test (org.junit.Test)23 BoxPosition (uk.ac.bbsrc.tgac.miso.core.data.BoxPosition)21 BoxImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.BoxImpl)17 BoxableId (uk.ac.bbsrc.tgac.miso.core.data.BoxableId)16 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)12 PostMapping (org.springframework.web.bind.annotation.PostMapping)11 BoxPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BoxPage)11 BoxableView (uk.ac.bbsrc.tgac.miso.core.data.impl.view.box.BoxableView)10 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)9 BoxVisualization (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BoxVisualization)9 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)8 List (java.util.List)8 IOException (java.io.IOException)7 Set (java.util.Set)7 Collectors (java.util.stream.Collectors)7 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)7 Autowired (org.springframework.beans.factory.annotation.Autowired)6 GetMapping (org.springframework.web.bind.annotation.GetMapping)6