Class CommunityMembershipResource
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.components.community.web.CommunityWebResource
-
- org.silverpeas.components.community.web.CommunityMembershipResource
-
- All Implemented Interfaces:
org.silverpeas.core.web.rs.ProtectedWebResource,org.silverpeas.core.web.rs.WebAuthenticationValidation,org.silverpeas.core.web.rs.WebAuthorizationValidation,org.silverpeas.core.web.SilverpeasWebResource
@WebService @Path("community/{componentInstanceId}/memberships") @Authorized public class CommunityMembershipResource extends CommunityWebResourceThe memberships to a community of users exposed as a resource through the Web. If the community of users for which memberships are asked doesn't exist, thenNotFoundExceptionis thrown.- Author:
- mmoquillon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.components.community.web.CommunityWebResource
CommunityWebResource.WebFunction<R>
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringRESOURCE_NAME-
Fields inherited from class org.silverpeas.components.community.web.CommunityWebResource
NO_PAGINATION
-
-
Constructor Summary
Constructors Constructor Description CommunityMembershipResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommunityMembershipEntitiesgetActualMemberships(String page)Gets all the actual memberships to the community of users.CommunityMembershipEntitiesgetAllMemberships(String page)Gets all the memberships to the community of users, whatever the status of them.StringgetComponentId()CommunityMembershipEntitygetMembership(String memberId)Gets a given existing membership to the community of users or throwNotFoundExceptionif no such membership exists.CommunityMembershipEntitiesgetPendingMemberships(String page)Gets all the memberships to the community of users pending for validation.protected StringgetResourceBasePath()Gets the relative base path at which are all exposed the resources in the community application.CommunityMembershipEntitygetUserMembership(String userId)Gets the membership of the specified user or throwNotFoundExceptionif no such membership to the community of users exists.protected org.silverpeas.core.web.WebResourceUriinitWebResourceUri()-
Methods inherited from class org.silverpeas.components.community.web.CommunityWebResource
getCommunityUriBuilder, getUserRoles, getWebManager, initURIBuilder, process
-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, identifiedBy, identifiedBy, initContext, isUserDefined, process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
RESOURCE_NAME
protected static final String RESOURCE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getComponentId
public String getComponentId()
-
getResourceBasePath
protected String getResourceBasePath()
Description copied from class:CommunityWebResourceGets the relative base path at which are all exposed the resources in the community application.- Overrides:
getResourceBasePathin classCommunityWebResource- Returns:
- the base path of the resource relative to the URI at which are all exposed the REST-based web services in Silverpeas.
-
initWebResourceUri
protected org.silverpeas.core.web.WebResourceUri initWebResourceUri()
- Overrides:
initWebResourceUriin classorg.silverpeas.core.web.rs.RESTWebService
-
getAllMemberships
@GET @Path("all") @Produces("application/json") public CommunityMembershipEntities getAllMemberships(@QueryParam("page") String page)Gets all the memberships to the community of users, whatever the status of them.- Parameters:
page- a pagination page to restrict the memberships to get.- Returns:
- a web entity representing a paginated collection of memberships.
-
getPendingMemberships
@GET @Path("pending") @Produces("application/json") public CommunityMembershipEntities getPendingMemberships(@QueryParam("page") String page)Gets all the memberships to the community of users pending for validation.- Parameters:
page- a pagination page to restrict the memberships to get.- Returns:
- a web entity representing a paginated collection of memberships.
-
getActualMemberships
@GET @Path("members") @Produces("application/json") public CommunityMembershipEntities getActualMemberships(@QueryParam("page") String page)Gets all the actual memberships to the community of users. These memberships are those they are committed; in other term, the memberships of the members of the community of users.- Parameters:
page- a pagination page to restrict the memberships to get.- Returns:
- a web entity representing a paginated collection of memberships.
-
getUserMembership
@GET @Path("users/{userId}") @Produces("application/json") public CommunityMembershipEntity getUserMembership(@PathParam("userId") String userId)Gets the membership of the specified user or throwNotFoundExceptionif no such membership to the community of users exists.- Parameters:
userId- the unique identifier of the user.- Returns:
- the web entity representing a membership to the community of users.
-
getMembership
@GET @Path("all/{membershipId}") @Produces("application/json") public CommunityMembershipEntity getMembership(@PathParam("membershipId") String memberId)Gets a given existing membership to the community of users or throwNotFoundExceptionif no such membership exists.- Parameters:
memberId- the unique identifier of a membership.- Returns:
- the web entity representing a membership to the community of users.
-
-