Search in sources :

Example 1 with DTProjectGroup

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

the class ProjectMembersController method getProjectGroupMembers.

/**
 * Get a page of groups on the project for display in a DataTable.
 *
 * @param params
 *            the datatables criteria for filtering/sorting groups
 * @param projectId
 *            the id of the project we're looking at
 * @return a {@link DataTablesResponseModel} of groups on the project
 */
@RequestMapping(value = "/{projectId}/settings/ajax/groups")
@ResponseBody
public DataTablesResponse getProjectGroupMembers(@DataTablesRequest DataTablesParams params, @PathVariable final Long projectId) {
    final Project project = projectService.read(projectId);
    final Page<UserGroupProjectJoin> userGroupsForProject = userGroupService.getUserGroupsForProject(params.getSearchValue(), project, params.getCurrentPage(), params.getLength(), params.getSort());
    List<DataTablesResponseModel> responseModels = new ArrayList<>();
    for (UserGroupProjectJoin userGroupProjectJoin : userGroupsForProject) {
        responseModels.add(new DTProjectGroup(userGroupProjectJoin));
    }
    return new DataTablesResponse(params, userGroupsForProject, responseModels);
}
Also used : Project(ca.corefacility.bioinformatics.irida.model.project.Project) DataTablesResponseModel(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.models.DataTablesResponseModel) DTProjectGroup(ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTProjectGroup) UserGroupProjectJoin(ca.corefacility.bioinformatics.irida.model.user.group.UserGroupProjectJoin) DataTablesResponse(ca.corefacility.bioinformatics.irida.ria.web.components.datatables.DataTablesResponse)

Aggregations

Project (ca.corefacility.bioinformatics.irida.model.project.Project)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 DTProjectGroup (ca.corefacility.bioinformatics.irida.ria.web.models.datatables.DTProjectGroup)1