use of ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTClient 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