Search in sources :

Example 1 with DTProjectMember

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);
}
Also used : Project(ca.corefacility.bioinformatics.irida.model.project.Project) User(ca.corefacility.bioinformatics.irida.model.user.User) ProjectUserJoin(ca.corefacility.bioinformatics.irida.model.joins.impl.ProjectUserJoin) DataTablesResponseModel(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.models.DataTablesResponseModel) Join(ca.corefacility.bioinformatics.irida.model.joins.Join) ProjectUserJoin(ca.corefacility.bioinformatics.irida.model.joins.impl.ProjectUserJoin) UserGroupProjectJoin(ca.corefacility.bioinformatics.irida.model.user.group.UserGroupProjectJoin) DataTablesResponse(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse) DTProjectMember(ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTProjectMember)

Aggregations

Join (ca.corefacility.bioinformatics.irida.model.joins.Join)1 ProjectUserJoin (ca.corefacility.bioinformatics.irida.model.joins.impl.ProjectUserJoin)1 Project (ca.corefacility.bioinformatics.irida.model.project.Project)1 User (ca.corefacility.bioinformatics.irida.model.user.User)1 UserGroupProjectJoin (ca.corefacility.bioinformatics.irida.model.user.group.UserGroupProjectJoin)1 DataTablesResponse (ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse)1 DataTablesResponseModel (ca.corefacility.bioinformatics.irida.ria.web.components.datatables.models.DataTablesResponseModel)1 DTProjectMember (ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTProjectMember)1