use of ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse 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);
}
use of ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse in project irida by phac-nml.
the class ClientsController method getAjaxClientsList.
/**
* Get a {@link DataTablesResponse} for the Clients page.
*
* @param params
* {@link DataTablesParams} for the current DataTable.
*
* @return {@link DataTablesResponse}
*/
@RequestMapping(value = "/ajax/list", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public DataTablesResponse getAjaxClientsList(@DataTablesRequest DataTablesParams params) {
Specification<IridaClientDetails> specification = IridaClientDetailsSpecification.searchClient(params.getSearchValue());
Page<IridaClientDetails> page = clientDetailsService.search(specification, new PageRequest(params.getCurrentPage(), params.getLength(), params.getSort()));
List<DataTablesResponseModel> models = new ArrayList<>();
for (IridaClientDetails client : page.getContent()) {
models.add(new DTClient(client, clientDetailsService.countActiveTokensForClient(client)));
}
return new DataTablesResponse(params, page, models);
}
Aggregations