Search in sources :

Example 1 with SelectionMode

use of org.sonar.api.server.ws.WebService.SelectionMode in project sonarqube by SonarSource.

the class UsersAction method getMembership.

private static String getMembership(String selected) {
    SelectionMode selectionMode = SelectionMode.fromParam(selected);
    String membership = GroupMembershipQuery.ANY;
    if (SelectionMode.SELECTED == selectionMode) {
        membership = GroupMembershipQuery.IN;
    } else if (SelectionMode.DESELECTED == selectionMode) {
        membership = GroupMembershipQuery.OUT;
    }
    return membership;
}
Also used : SelectionMode(org.sonar.api.server.ws.WebService.SelectionMode)

Example 2 with SelectionMode

use of org.sonar.api.server.ws.WebService.SelectionMode in project sonarqube by SonarSource.

the class ProjectsAction method loadProjects.

private List<ProjectQprofileAssociationDto> loadProjects(String profileKey, DbSession session, String selected, String query) {
    List<ProjectQprofileAssociationDto> projects = Lists.newArrayList();
    SelectionMode selectionMode = SelectionMode.fromParam(selected);
    if (SelectionMode.SELECTED == selectionMode) {
        projects.addAll(dbClient.qualityProfileDao().selectSelectedProjects(profileKey, query, session));
    } else if (SelectionMode.DESELECTED == selectionMode) {
        projects.addAll(dbClient.qualityProfileDao().selectDeselectedProjects(profileKey, query, session));
    } else {
        projects.addAll(dbClient.qualityProfileDao().selectProjectAssociations(profileKey, query, session));
    }
    return projects;
}
Also used : ProjectQprofileAssociationDto(org.sonar.db.qualityprofile.ProjectQprofileAssociationDto) SelectionMode(org.sonar.api.server.ws.WebService.SelectionMode)

Example 3 with SelectionMode

use of org.sonar.api.server.ws.WebService.SelectionMode in project sonarqube by SonarSource.

the class GroupsAction method getMembership.

private String getMembership(String selected) {
    SelectionMode selectionMode = SelectionMode.fromParam(selected);
    String membership = GroupMembershipQuery.ANY;
    if (SelectionMode.SELECTED == selectionMode) {
        membership = GroupMembershipQuery.IN;
    } else if (SelectionMode.DESELECTED == selectionMode) {
        membership = GroupMembershipQuery.OUT;
    }
    return membership;
}
Also used : SelectionMode(org.sonar.api.server.ws.WebService.SelectionMode)

Aggregations

SelectionMode (org.sonar.api.server.ws.WebService.SelectionMode)3 ProjectQprofileAssociationDto (org.sonar.db.qualityprofile.ProjectQprofileAssociationDto)1