Class UserGroupProfileResource

  • All Implemented Interfaces:
    ProtectedWebResource, WebAuthenticationValidation, WebAuthorizationValidation, SilverpeasWebResource

    @WebService
    @Path("profile/groups")
    @Authenticated
    public class UserGroupProfileResource
    extends RESTWebService
    A REST-based Web service that acts on the user groups in Silverpeas. Each provided method is a way to access a representation of one or several user groups. This representation is vehiculed as a Web entity in the HTTP requests and responses. The user groups that are published depend on some parameters whose the domain isolation and the profile of the user behind the requesting. The domain isolation defines the visibility of a user or a group of groups in a given domain to the others domains in Silverpeas.
    • Field Detail

      • RESPONSE_HEADER_GROUPSIZE

        public static final String RESPONSE_HEADER_GROUPSIZE
        The HTTP header parameter that provides the real size of the group profiles that match a query. This parameter is useful for clients that use the pagination to filter the count of group profiles to sent back.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserGroupProfileResource

        public UserGroupProfileResource()
    • Method Detail

      • getAllRootGroups

        @GET
        @Produces("application/json")
        public javax.ws.rs.core.Response getAllRootGroups​(@QueryParam("ids")
                                                          Set<String> groupIds,
                                                          @QueryParam("withChildren")
                                                          boolean withChildren,
                                                          @QueryParam("name")
                                                          String name,
                                                          @QueryParam("page")
                                                          String page,
                                                          @QueryParam("domain")
                                                          String domain,
                                                          @QueryParam("userStatesToExclude")
                                                          Set<UserState> userStatesToExclude)
        Gets all the root user groups in Silverpeas.
        Parameters:
        groupIds - requested group identifiers. If this parameter is filled, sub groups are also returned.
        withChildren - if true the sub groups are also returned.
        name - a pattern on the name of the root groups to retrieve. If null, all the root groups are fetched.
        domain - the unique identifier of the domain the groups has to be related.
        page - the pagination parameters formatted as "page number;item count in the page". From this parameter is computed the part of groups to sent back: those between ((page number - 1) item count in the page) and ((page number - 1) item count in the page + item count in the page).
        userStatesToExclude - the user states that users taken into account must not be in.
        Returns:
        the JSON representation of the array of the groups matching the pattern.
      • getGroupsInApplication

        @GET
        @Path("application/{instanceId}")
        @Produces("application/json")
        public javax.ws.rs.core.Response getGroupsInApplication​(@PathParam("instanceId")
                                                                String instanceId,
                                                                @QueryParam("withChildren")
                                                                boolean withChildren,
                                                                @QueryParam("roles")
                                                                String roles,
                                                                @QueryParam("matchingAllRoles")
                                                                boolean matchingAllRoles,
                                                                @QueryParam("resource")
                                                                String resource,
                                                                @QueryParam("name")
                                                                String name,
                                                                @QueryParam("page")
                                                                String page,
                                                                @QueryParam("domain")
                                                                String domain,
                                                                @QueryParam("userStatesToExclude")
                                                                Set<UserState> userStatesToExclude)
        Gets the groups of users having the priviledges to access the specified Silverpeas application instance. In the context some groups are parents of others groups, only the parent groups are fetched, no their subgroups.
        Parameters:
        instanceId - the unique identifier of the Silverpeas application instance.
        withChildren - if true the sub groups are also returned.
        roles - the roles the groups must play. Null if no specific roles have to be played by the groups.
        matchingAllRoles - boolean at true if the groups must play all the roles, false otherwise.
        resource - the unique identifier of the resource in the component instance the groups to get must have enough rights to access. This query filter is coupled with the roles one. If it is not set, by default the resource refered is the whole component instance. As for component instance identifier, a resource one is defined by its type followed by its identifier.
        name - the pattern on the name the groups name must match. Null if all groups for the specified application have to be fetched.
        page - the pagination parameters formatted as "page number;item count in the page". From this parameter is computed the part of groups to sent back: those between ((page number - 1) item count in the page) and ((page number - 1) item count in the page + item count in the page).
        domain - the unique identifier of the domain the groups has to be related.
        userStatesToExclude - the user states that users taken into account must not be in.
        Returns:
        the JSON representation of the array with the parent groups having access the application instance.
      • getGroup

        @GET
        @Path("{path: [0-9]+(/groups/[0-9]+)*}")
        @Produces("application/json")
        public UserGroupProfileEntity getGroup​(@PathParam("path")
                                               String groupPath)
        Gets the group of users identified by the specified path.
        Parameters:
        groupPath - the path of group identifiers, from the root group downto the seeked one.
        Returns:
        the JSON representation of the user group.
      • getSubGroups

        @GET
        @Path("{path:[0-9]+/groups(/[0-9]+/groups)*}")
        @Produces("application/json")
        public javax.ws.rs.core.Response getSubGroups​(@PathParam("path")
                                                      String groups,
                                                      @QueryParam("name")
                                                      String name,
                                                      @QueryParam("page")
                                                      String page,
                                                      @QueryParam("withChildren")
                                                      boolean withChildren,
                                                      @QueryParam("userStatesToExclude")
                                                      Set<UserState> userStatesToExclude)
        Gets the direct subgroups of the group of groups identified by the specified path.
        Parameters:
        groups - the path of group identifiers, from the root group downto the group for which the direct subgroups are seeked.
        name - a pattern the subgroup names must match. If null, all the direct subgroups are fetched.
        page - the pagination parameters formatted as "page number;item count in the page". From this parameter is computed the part of groups to sent back: those between ((page number - 1) item count in the page) and ((page number - 1) item count in the page + item count in the page).
        withChildren - if true the sub groups are also returned.
        userStatesToExclude - the user states that users taken into account must not be in.
        Returns:
        a JSON representation of the array of the direct subgroups.
      • getComponentId

        public String getComponentId()
        Description copied from interface: SilverpeasWebResource
        Gets the identifier of the component instance to which the requested resource belongs to.
        Returns:
        the identifier of the Silverpeas component instance.
      • locatedAt

        protected static URI locatedAt​(URI uri)
      • identifiedBy

        protected static URI identifiedBy​(URI uri)