Search in sources :

Example 1 with TransferPool

use of uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool in project miso-lims by miso-lims.

the class Dtos method to.

public static Transfer to(@Nonnull TransferDto from) {
    Transfer to = new Transfer();
    setLong(to::setId, from.getId(), false);
    setString(to::setTransferRequestName, from.getTransferRequestName());
    setDateTime(to::setTransferTime, from.getTransferTime());
    setObject(to::setSenderLab, LabImpl::new, from.getSenderLabId());
    setObject(to::setSenderGroup, Group::new, from.getSenderGroupId());
    setString(to::setRecipient, from.getRecipient());
    setObject(to::setRecipientGroup, Group::new, from.getRecipientGroupId());
    addTransferItems(to::getSampleTransfers, from.getItems(), EntityType.SAMPLE, TransferSample::new, SampleImpl::new, SampleBoxPosition::new, Sample::setBoxPosition);
    addTransferItems(to::getLibraryTransfers, from.getItems(), EntityType.LIBRARY, TransferLibrary::new, LibraryImpl::new, LibraryBoxPosition::new, Library::setBoxPosition);
    addTransferItems(to::getLibraryAliquotTransfers, from.getItems(), EntityType.LIBRARY_ALIQUOT, TransferLibraryAliquot::new, LibraryAliquot::new, LibraryAliquotBoxPosition::new, LibraryAliquot::setBoxPosition);
    addTransferItems(to::getPoolTransfers, from.getItems(), EntityType.POOL, TransferPool::new, PoolImpl::new, PoolBoxPosition::new, Pool::setBoxPosition);
    return to;
}
Also used : Group(com.eaglegenomics.simlims.core.Group) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) ParentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentSample) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) Sample(uk.ac.bbsrc.tgac.miso.core.data.Sample) WorksetSample(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetSample) GrandparentSample(uk.ac.bbsrc.tgac.miso.core.data.impl.view.GrandparentSample) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) LibraryAliquotBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryAliquotBoxPosition) LibraryBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryBoxPosition) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) WorksetLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibraryAliquot) OrderLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.OrderLibraryAliquot) DetailedLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryAliquot) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) PoolImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) SampleBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.SampleBoxPosition) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) PoolBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.PoolBoxPosition) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedLibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryImpl) Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) InstrumentStatusPositionRunPool(uk.ac.bbsrc.tgac.miso.core.data.impl.view.instrumentstatus.InstrumentStatusPositionRunPool) 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) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) ParentLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.view.ParentLibrary) DetailedLibrary(uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary) WorksetLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.workset.WorksetLibrary) Library(uk.ac.bbsrc.tgac.miso.core.data.Library) SampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl) DetailedSampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)

Example 2 with TransferPool

use of uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool in project miso-lims by miso-lims.

the class TransferController method addBoxItems.

private <T extends Boxable, U extends TransferItem<T>> void addBoxItems(String idString, Transfer transfer) throws IOException {
    if (idString == null) {
        return;
    }
    for (Long id : LimsUtils.parseIds(idString)) {
        Box box = boxService.get(id);
        if (box == null) {
            throw new ClientErrorException(String.format("No box found for ID: %d", id));
        }
        for (BoxPosition item : box.getBoxPositions().values()) {
            long itemId = item.getBoxableId().getTargetId();
            switch(item.getBoxableId().getTargetType()) {
                case SAMPLE:
                    TransferSample transferSample = new TransferSample();
                    transferSample.setItem(sampleService.get(itemId));
                    transfer.getSampleTransfers().add(transferSample);
                    break;
                case LIBRARY:
                    TransferLibrary transferLibrary = new TransferLibrary();
                    transferLibrary.setItem(libraryService.get(itemId));
                    transfer.getLibraryTransfers().add(transferLibrary);
                    break;
                case LIBRARY_ALIQUOT:
                    TransferLibraryAliquot transferLibraryAliquot = new TransferLibraryAliquot();
                    transferLibraryAliquot.setItem(libraryAliquotService.get(itemId));
                    transfer.getLibraryAliquotTransfers().add(transferLibraryAliquot);
                    break;
                case POOL:
                    TransferPool transferPool = new TransferPool();
                    transferPool.setItem(poolService.get(itemId));
                    transfer.getPoolTransfers().add(transferPool);
                    break;
                default:
                    throw new IllegalArgumentException("Unexpected boxable type: " + item.getBoxableId().getTargetType());
            }
        }
    }
}
Also used : TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) ClientErrorException(uk.ac.bbsrc.tgac.miso.webapp.controller.component.ClientErrorException) Box(uk.ac.bbsrc.tgac.miso.core.data.Box) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) BoxPosition(uk.ac.bbsrc.tgac.miso.core.data.BoxPosition)

Example 3 with TransferPool

use of uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool in project miso-lims by miso-lims.

the class NotificationManager method makePoolTable.

private static ContainerTag makePoolTable(Collection<TransferPool> transferPools) {
    ContainerTag headerRow = tr(makeTh("Alias"), makeTh("Barcode"), makeTh("Location"));
    List<ContainerTag> rows = new ArrayList<>();
    List<TransferPool> sorted = sortByAlias(transferPools);
    for (TransferPool transferPool : sorted) {
        Pool pool = transferPool.getItem();
        List<DomContent> cells = new ArrayList<>();
        cells.add(makeTd(pool.getAlias()));
        cells.add(makeTd(pool.getIdentificationBarcode()));
        cells.add(makeTd(makeLocationLabel(transferPool)));
        rows.add(tr().with(cells));
    }
    return makeTable(headerRow, rows);
}
Also used : TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) ArrayList(java.util.ArrayList) DomContent(j2html.tags.DomContent) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) ContainerTag(j2html.tags.ContainerTag)

Example 4 with TransferPool

use of uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool in project miso-lims by miso-lims.

the class DefaultTransferService method loadChildEntities.

@Override
protected void loadChildEntities(Transfer object) throws IOException {
    loadChildEntity(object.getSenderGroup(), object::setSenderGroup, groupService);
    loadChildEntity(object.getSenderLab(), object::setSenderLab, labService);
    loadChildEntity(object.getRecipientGroup(), object::setRecipientGroup, groupService);
    for (TransferSample item : object.getSampleTransfers()) {
        loadItem(item, item::setItem, sampleService, SampleBoxPosition::new, Sample::setBoxPosition);
    }
    for (TransferLibrary item : object.getLibraryTransfers()) {
        loadItem(item, item::setItem, libraryService, LibraryBoxPosition::new, Library::setBoxPosition);
    }
    for (TransferLibraryAliquot item : object.getLibraryAliquotTransfers()) {
        loadItem(item, item::setItem, libraryAliquotService, LibraryAliquotBoxPosition::new, LibraryAliquot::setBoxPosition);
    }
    for (TransferPool item : object.getPoolTransfers()) {
        loadItem(item, item::setItem, poolService, PoolBoxPosition::new, Pool::setBoxPosition);
    }
}
Also used : TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) Sample(uk.ac.bbsrc.tgac.miso.core.data.Sample) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) LibraryAliquotBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryAliquotBoxPosition) LibraryBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryBoxPosition) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) SampleBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.SampleBoxPosition) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) PoolBoxPosition(uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.PoolBoxPosition) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) Library(uk.ac.bbsrc.tgac.miso.core.data.Library)

Example 5 with TransferPool

use of uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool in project miso-lims by miso-lims.

the class TransferController method create.

@PostMapping("/new")
public ModelAndView create(@RequestParam Map<String, String> form, ModelMap model) throws IOException {
    String sampleIdString = getStringInput("sampleIds", form, false);
    String libraryIdString = getStringInput("libraryIds", form, false);
    String libraryAliquotIdString = getStringInput("libraryAliquotIds", form, false);
    String poolIdString = getStringInput("poolIds", form, false);
    String boxIdString = getStringInput("boxIds", form, false);
    Transfer transfer = new Transfer();
    addItems("sample", sampleIdString, sampleService, TransferSample::new, transfer::getSampleTransfers);
    addItems("library", libraryIdString, libraryService, TransferLibrary::new, transfer::getLibraryTransfers);
    addItems("library aliquot", libraryAliquotIdString, libraryAliquotService, TransferLibraryAliquot::new, transfer::getLibraryAliquotTransfers);
    addItems("pool", poolIdString, poolService, TransferPool::new, transfer::getPoolTransfers);
    addBoxItems(boxIdString, transfer);
    model.put("title", "New Transfer");
    return setupForm(transfer, PageMode.CREATE, true, false, model);
}
Also used : TransferLibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot) TransferPool(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool) TransferLibrary(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary) Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) TransferSample(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

TransferPool (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferPool)5 TransferLibrary (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibrary)4 TransferLibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferLibraryAliquot)4 TransferSample (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.TransferSample)4 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)3 Library (uk.ac.bbsrc.tgac.miso.core.data.Library)2 Sample (uk.ac.bbsrc.tgac.miso.core.data.Sample)2 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)2 LibraryAliquotBoxPosition (uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryAliquotBoxPosition)2 LibraryBoxPosition (uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.LibraryBoxPosition)2 PoolBoxPosition (uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.PoolBoxPosition)2 SampleBoxPosition (uk.ac.bbsrc.tgac.miso.core.data.impl.boxposition.SampleBoxPosition)2 Transfer (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer)2 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)1 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)1 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)1 Group (com.eaglegenomics.simlims.core.Group)1 ContainerTag (j2html.tags.ContainerTag)1 DomContent (j2html.tags.DomContent)1 ArrayList (java.util.ArrayList)1