com.silverpeas.profile.web
Class UserGroupProfileResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by com.silverpeas.profile.web.UserGroupProfileResource

@Service
@RequestScoped
@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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.silverpeas.web.RESTWebService
RESTWebService.WebProcess<RETURN_VALUE>, RESTWebService.WebTreatment<RETURN_VALUE>
 
Field Summary
static String RESPONSE_HEADER_GROUPSIZE
          The HTTP header parameter that provides the real size of the group profiles that match a query.
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
UserGroupProfileResource()
          Creates a new instance of UserGroupProfileResource
 
Method Summary
 javax.ws.rs.core.Response getAllRootGroups(Set<String> groupIds, String name, String page, String domain, Set<UserState> userStatesToExclude)
          Gets all the root user groups in Silverpeas.
 String getComponentId()
          Gets the identifier of the component instance to which the requested resource belongs to.
 UserGroupProfileEntity getGroup(String groupPath)
          Gets the group of users identified by the specified path.
 javax.ws.rs.core.Response getGroupsInApplication(String instanceId, String roles, String resource, String name, String page, String domain, Set<UserState> userStatesToExclude)
          Gets the groups of users having the priviledges to access the specified Silverpeas application instance.
 javax.ws.rs.core.Response getSubGroups(String groups, String name, String page, Set<UserState> userStatesToExclude)
          Gets the direct subgroups of the group of groups identified by the specified path.
protected static URI identifiedBy(URI uri)
           
protected static URI locatedAt(URI uri)
           
 
Methods inherited from class com.silverpeas.web.RESTWebService
getBundle, getBundleLocation, getGreaterUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getUriInfo, getUserDetail, getUserPreferences, getUserRoles, process, validateUserAuthentication, validateUserAuthorization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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()
Creates a new instance of UserGroupProfileResource

Method Detail

getAllRootGroups

public javax.ws.rs.core.Response getAllRootGroups(Set<String> groupIds,
                                                  String name,
                                                  String page,
                                                  String domain,
                                                  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.
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

public javax.ws.rs.core.Response getGroupsInApplication(String instanceId,
                                                        String roles,
                                                        String resource,
                                                        String name,
                                                        String page,
                                                        String domain,
                                                        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.
roles - the roles the groups must play. Null if no specific roles have to be played by the groups.
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

public UserGroupProfileEntity getGroup(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

public javax.ws.rs.core.Response getSubGroups(String groups,
                                              String name,
                                              String page,
                                              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).
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 class: RESTWebService
Gets the identifier of the component instance to which the requested resource belongs to.

Specified by:
getComponentId in class RESTWebService
Returns:
the identifier of the Silverpeas component instance.

locatedAt

protected static URI locatedAt(URI uri)

identifiedBy

protected static URI identifiedBy(URI uri)


Copyright © 2016 Silverpeas. All Rights Reserved.