Search in sources :

Example 6 with Sop

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

the class EditLibraryController method getBatchPage.

@GetMapping("/batch/{batchId:.+}")
public ModelAndView getBatchPage(@PathVariable String batchId, ModelMap model) throws IOException {
    LibraryBatch batch = null;
    try {
        batch = new LibraryBatch(batchId);
    } catch (IllegalArgumentException e) {
        throw new ClientErrorException("Invalid batch ID");
    }
    User user = userService.get(batch.getUserId());
    Sop sop = sopService.get(batch.getSopId());
    KitDescriptor kit = kitDescriptorService.get(batch.getKitId());
    if (user == null || sop == null || kit == null || kit.getKitType() != KitType.LIBRARY) {
        throw new ClientErrorException("Invalid batch ID");
    }
    LibraryBatchDto batchDto = Dtos.asDto(batch);
    batchDto.setUsername(user.getLoginName());
    batchDto.setSopLabel(sop.getAlias() + "v." + sop.getVersion());
    batchDto.setSopUrl(sop.getUrl());
    batchDto.setKitName(kit.getName());
    ObjectMapper mapper = new ObjectMapper();
    model.put("batchId", StringEscapeUtils.escapeJavaScript(batchId));
    model.put("batchDto", mapper.writeValueAsString(batchDto));
    return new ModelAndView("/WEB-INF/pages/editLibraryBatch.jsp", model);
}
Also used : KitDescriptor(uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor) User(com.eaglegenomics.simlims.core.User) LibraryBatchDto(uk.ac.bbsrc.tgac.miso.dto.LibraryBatchDto) Sop(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop) ModelAndView(org.springframework.web.servlet.ModelAndView) ClientErrorException(uk.ac.bbsrc.tgac.miso.webapp.controller.component.ClientErrorException) LibraryBatch(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryBatch) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 7 with Sop

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

the class HibernateSopDaoIT method getCreateItem.

@Override
public Sop getCreateItem() {
    Sop sop = new Sop();
    sop.setAlias("Test SOP");
    sop.setVersion("1.0");
    sop.setCategory(SopCategory.SAMPLE);
    sop.setUrl("http://sops.test.com/test_sop");
    sop.setArchived(false);
    return sop;
}
Also used : Sop(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop)

Example 8 with Sop

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

the class HibernateSopDaoIT method testGetByAliasAndVersion.

@Test
public void testGetByAliasAndVersion() throws Exception {
    SopCategory category = SopCategory.SAMPLE;
    String alias = "Sample SOP 1";
    String version = "1.0";
    Sop sop = getTestSubject().get(category, alias, version);
    assertNotNull(sop);
    assertEquals(category, sop.getCategory());
    assertEquals(alias, sop.getAlias());
    assertEquals(version, sop.getVersion());
}
Also used : Sop(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop) SopCategory(uk.ac.bbsrc.tgac.miso.core.data.impl.Sop.SopCategory) AbstractHibernateSaveDaoTest(uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest) Test(org.junit.Test)

Aggregations

Sop (uk.ac.bbsrc.tgac.miso.core.data.impl.Sop)8 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)4 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)4 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)4 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)4 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)4 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)4 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)4 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)4 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)4 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)4 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)4 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)4 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)4 KitDescriptor (uk.ac.bbsrc.tgac.miso.core.data.impl.kit.KitDescriptor)3 Test (org.junit.Test)2 AbstractHibernateSaveDaoTest (uk.ac.bbsrc.tgac.miso.AbstractHibernateSaveDaoTest)2 DetailedQcStatusImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedQcStatusImpl)2 DetailedSampleImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedSampleImpl)2 InstrumentImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.InstrumentImpl)2