Search in sources :

Example 1 with DTSequencingRun

use of ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTSequencingRun in project irida by phac-nml.

the class SequencingRunController method listSequencingRuns.

/**
 * Get a list of all the sequencing runs
 *
 * @param params a {@link DataTablesParams} of the sort and paging options
 * @param locale the locale used by the browser for the current request.
 * @return A DatatablesResponse of DTSequencingRun of the runs
 */
@RequestMapping(value = "/ajax/list")
@ResponseBody
public DataTablesResponse listSequencingRuns(@DataTablesRequest DataTablesParams params, Locale locale) {
    Sort sort = params.getSort();
    Page<SequencingRun> list = sequencingRunService.list(params.getCurrentPage(), params.getLength(), sort);
    List<DTSequencingRun> runs = list.getContent().stream().map(s -> new DTSequencingRun(s, messageSource.getMessage(UPLOAD_STATUS_MESSAGE_BASE + s.getUploadStatus().toString(), null, locale))).collect(Collectors.toList());
    return new DataTablesResponse(params, list, runs);
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) java.util(java.util) SequencingObjectService(ca.corefacility.bioinformatics.irida.service.SequencingObjectService) ImmutableMap(com.google.common.collect.ImmutableMap) DataTablesRequest(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.config.DataTablesRequest) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) DTSequencingRun(ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTSequencingRun) Autowired(org.springframework.beans.factory.annotation.Autowired) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) Controller(org.springframework.stereotype.Controller) SequencingRunService(ca.corefacility.bioinformatics.irida.service.SequencingRunService) Page(org.springframework.data.domain.Page) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) SequencingObject(ca.corefacility.bioinformatics.irida.model.sequenceFile.SequencingObject) Collectors(java.util.stream.Collectors) SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) Model(org.springframework.ui.Model) DataTablesResponseModel(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.models.DataTablesResponseModel) DataTablesResponse(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse) User(ca.corefacility.bioinformatics.irida.model.user.User) Sort(org.springframework.data.domain.Sort) DataTablesParams(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesParams) MessageSource(org.springframework.context.MessageSource) DTSequencingRun(ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTSequencingRun) SequencingRun(ca.corefacility.bioinformatics.irida.model.run.SequencingRun) DTSequencingRun(ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTSequencingRun) Sort(org.springframework.data.domain.Sort) DataTablesResponse(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

SequencingRun (ca.corefacility.bioinformatics.irida.model.run.SequencingRun)1 SequencingObject (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequencingObject)1 User (ca.corefacility.bioinformatics.irida.model.user.User)1 DataTablesParams (ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesParams)1 DataTablesResponse (ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse)1 DataTablesRequest (ca.corefacility.bioinformatics.irida.ria.web.components.datatables.config.DataTablesRequest)1 DataTablesResponseModel (ca.corefacility.bioinformatics.irida.ria.web.components.datatables.models.DataTablesResponseModel)1 DTSequencingRun (ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTSequencingRun)1 SequencingObjectService (ca.corefacility.bioinformatics.irida.service.SequencingObjectService)1 SequencingRunService (ca.corefacility.bioinformatics.irida.service.SequencingRunService)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 MessageSource (org.springframework.context.MessageSource)1 Page (org.springframework.data.domain.Page)1 Sort (org.springframework.data.domain.Sort)1 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)1 Controller (org.springframework.stereotype.Controller)1 Model (org.springframework.ui.Model)1