use of ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTProjectMember in project irida by phac-nml.
the class ProjectMembersController method getProjectUserMembers.
/**
* Get a page of users on the project for display in a DataTable.
*
* @param params
* the datatables parameters for this DataTable
* @param projectId
* the id of the project we're looking at
* @return a {@link DataTablesResponseModel} of users on the project
*/
@RequestMapping(value = "/{projectId}/settings/ajax/members")
@ResponseBody
public DataTablesResponse getProjectUserMembers(@DataTablesRequest DataTablesParams params, @PathVariable final Long projectId) {
final Project project = projectService.read(projectId);
final Page<Join<Project, User>> usersForProject = userService.searchUsersForProject(project, params.getSearchValue(), params.getCurrentPage(), params.getLength(), params.getSort());
List<DataTablesResponseModel> modelList = new ArrayList<>();
for (Join<Project, User> join : usersForProject) {
modelList.add(new DTProjectMember((ProjectUserJoin) join));
}
return new DataTablesResponse(params, usersForProject, modelList);
}
Aggregations