Search in sources :

Example 6 with IndexChecker

use of uk.ac.bbsrc.tgac.miso.core.util.IndexChecker in project miso-lims by miso-lims.

the class SequencingOrderRestController method search.

@GetMapping(value = "/sequencingorders/search")
@ResponseBody
public List<SequencingOrderDto> search(@RequestParam long poolId, @RequestParam long purposeId, @RequestParam(required = false) Long containerModelId, @RequestParam long parametersId, @RequestParam int partitions) throws IOException {
    Pool pool = getOrThrow(poolService, poolId, "Pool");
    RunPurpose purpose = getOrThrow(runPurposeService, purposeId, "Run purpose");
    SequencingContainerModel containerModel = containerModelId == null ? null : getOrThrow(containerModelService, containerModelId, "Container model");
    SequencingParameters parameters = getOrThrow(sequencingParametersService, parametersId, "Sequencing parameters");
    List<SequencingOrder> results = sequencingOrderService.listByAttributes(pool, purpose, containerModel, parameters, partitions);
    return results.stream().map(so -> Dtos.asDto(so, indexChecker)).collect(Collectors.toList());
}
Also used : RunPurposeService(uk.ac.bbsrc.tgac.miso.core.service.RunPurposeService) PathVariable(org.springframework.web.bind.annotation.PathVariable) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) RequestParam(org.springframework.web.bind.annotation.RequestParam) PaginationFilter(uk.ac.bbsrc.tgac.miso.core.util.PaginationFilter) DataTablesResponseDto(uk.ac.bbsrc.tgac.miso.dto.DataTablesResponseDto) SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) Autowired(org.springframework.beans.factory.annotation.Autowired) SequencingOrderSummaryViewService(uk.ac.bbsrc.tgac.miso.core.service.SequencingOrderSummaryViewService) Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) PutMapping(org.springframework.web.bind.annotation.PutMapping) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) PostMapping(org.springframework.web.bind.annotation.PostMapping) SequencingOrderCompletionDto(uk.ac.bbsrc.tgac.miso.dto.SequencingOrderCompletionDto) PoolDto(uk.ac.bbsrc.tgac.miso.dto.PoolDto) AdvancedSearchParser(uk.ac.bbsrc.tgac.miso.webapp.controller.component.AdvancedSearchParser) PoolPickerEntry(uk.ac.bbsrc.tgac.miso.webapp.util.PoolPickerResponse.PoolPickerEntry) Collectors(java.util.stream.Collectors) IndexChecker(uk.ac.bbsrc.tgac.miso.core.util.IndexChecker) List(java.util.List) SequencingParametersService(uk.ac.bbsrc.tgac.miso.core.service.SequencingParametersService) PoolService(uk.ac.bbsrc.tgac.miso.core.service.PoolService) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingOrderService(uk.ac.bbsrc.tgac.miso.core.service.SequencingOrderService) PoolPickerResponse(uk.ac.bbsrc.tgac.miso.webapp.util.PoolPickerResponse) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Controller(org.springframework.stereotype.Controller) ProviderService(uk.ac.bbsrc.tgac.miso.core.service.ProviderService) SequencingContainerModelService(uk.ac.bbsrc.tgac.miso.core.service.SequencingContainerModelService) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) RequestBody(org.springframework.web.bind.annotation.RequestBody) HttpServletRequest(javax.servlet.http.HttpServletRequest) SequencingOrderSummaryView(uk.ac.bbsrc.tgac.miso.core.data.impl.view.SequencingOrderSummaryView) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) Status(javax.ws.rs.core.Response.Status) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) SequencingOrderDto(uk.ac.bbsrc.tgac.miso.dto.SequencingOrderDto) HttpStatus(org.springframework.http.HttpStatus) PlatformType(uk.ac.bbsrc.tgac.miso.core.data.type.PlatformType) PaginatedDataSource(uk.ac.bbsrc.tgac.miso.core.util.PaginatedDataSource) Collections(java.util.Collections) AsyncOperationManager(uk.ac.bbsrc.tgac.miso.webapp.controller.component.AsyncOperationManager) Identifiable(uk.ac.bbsrc.tgac.miso.core.data.Identifiable) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

IOException (java.io.IOException)6 Collectors (java.util.stream.Collectors)6 Autowired (org.springframework.beans.factory.annotation.Autowired)6 Controller (org.springframework.stereotype.Controller)6 GetMapping (org.springframework.web.bind.annotation.GetMapping)6 PathVariable (org.springframework.web.bind.annotation.PathVariable)6 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)6 IndexChecker (uk.ac.bbsrc.tgac.miso.core.util.IndexChecker)6 Dtos (uk.ac.bbsrc.tgac.miso.dto.Dtos)6 List (java.util.List)5 Stream (java.util.stream.Stream)5 ArrayList (java.util.ArrayList)4 Objects (java.util.Objects)4 Status (javax.ws.rs.core.Response.Status)4 PostMapping (org.springframework.web.bind.annotation.PostMapping)4 RequestParam (org.springframework.web.bind.annotation.RequestParam)4 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)4 User (com.eaglegenomics.simlims.core.User)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)3