Package lumis.service.community
Class CommunityResource
- java.lang.Object
-
- lumis.service.community.CommunityResource
-
@StableMinor(version="14.2", sinceVersion="8.0") @Path("/lumis/service/community/rest") public class CommunityResource extends Object
REST API for community service.- Since:
- 8.0.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommunityResource.MembershipRequestAction
Action parameter values available for use in#processMembershipRequest(String, String, String)
.
-
Constructor Summary
Constructors Constructor Description CommunityResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteCommunityMembership(@NotNull String communityId, @NotNull String userId)
Deletes the membership of a user in a community.void
deleteCommunityMembershipRequest(@NotNull String communityId, @NotNull String userId)
Deletes a membership request in a community sent by a user.lumis.service.community.CommunityResource.CommunityMembership
getCommunityMembership(@NotNull String communityId, @NotNull String userId)
Returns information about the membership of a user in a community.lumis.service.community.CommunityMembershipRequest
getCommunityMembershipRequest(@NotNull String communityId, @NotNull String userId)
Returns information about the request of membership in a community sent by a user.void
processMembershipRequest(@NotNull String communityId, @NotNull String userId, @NotNull CommunityResource.MembershipRequestAction action)
Processes an action on membership request.void
requestCommunityMembership(@NotNull String communityId)
Requests a membership in a community, by the current logged in user.lumis.service.community.CommunityResource.CommunityMembership
updateCommunityMembership(@NotNull String communityId, @NotNull String userId, @NotNull lumis.service.community.CommunityResource.CommunityMembership membership)
Updates information about the membership of a user in a community.
-
-
-
Method Detail
-
getCommunityMembership
@GET @Path("/communities/{communityId:[A-F0-9]{32}}/memberships/{userId:[A-F0-9]{32}}") @Produces("application/json") public lumis.service.community.CommunityResource.CommunityMembership getCommunityMembership(@NotNull @PathParam("communityId") @NotNull String communityId, @NotNull @PathParam("userId") @NotNull String userId) throws PortalException
Returns information about the membership of a user in a community.- Parameters:
communityId
- the community identifier.userId
- the user identifier.- Returns:
- the membership information, or not found response if no such membership exists.
- Throws:
PortalException
- Since:
- 8.0.0
-
updateCommunityMembership
@PUT @Path("/communities/{communityId:[A-F0-9]{32}}/memberships/{userId:[A-F0-9]{32}}") @Produces("application/json") public lumis.service.community.CommunityResource.CommunityMembership updateCommunityMembership(@NotNull @PathParam("communityId") @NotNull String communityId, @NotNull @PathParam("userId") @NotNull String userId, @NotNull @NotNull lumis.service.community.CommunityResource.CommunityMembership membership) throws PortalException
Updates information about the membership of a user in a community.Only the community administrator may execute this operation.
- Parameters:
communityId
- the community identifier.userId
- the user identifier.membership
- information of the membership to be updated. Sample JSON expected:{"type":"administrator"}
- Returns:
- the membership information, or not found response if no such membership exists.
- Throws:
PortalException
- Since:
- 8.0.0
-
deleteCommunityMembership
@DELETE @Path("/communities/{communityId:[A-F0-9]{32}}/memberships/{userId:[A-F0-9]{32}}") @Produces("application/json") public void deleteCommunityMembership(@NotNull @PathParam("communityId") @NotNull String communityId, @NotNull @PathParam("userId") @NotNull String userId) throws PortalException
Deletes the membership of a user in a community. Only the membership user or a community's administrator may execute this operation.- Parameters:
communityId
- the community identifier.userId
- the user identifier.- Throws:
PortalException
- Since:
- 8.0.0
-
getCommunityMembershipRequest
@GET @Path("/communities/{communityId:[A-F0-9]{32}}/membershiprequests/{userId:[A-F0-9]{32}}") @Produces("application/json") public lumis.service.community.CommunityMembershipRequest getCommunityMembershipRequest(@NotNull @PathParam("communityId") @NotNull String communityId, @NotNull @PathParam("userId") @NotNull String userId) throws PortalException
Returns information about the request of membership in a community sent by a user.- Parameters:
communityId
- the community identifier.userId
- the user identifier.- Returns:
- the membership request information, or not found response if no such request exists.
- Throws:
PortalException
- Since:
- 8.0.0
-
deleteCommunityMembershipRequest
@DELETE @Path("/communities/{communityId:[A-F0-9]{32}}/membershiprequests/{userId:[A-F0-9]{32}}") @Produces("application/json") public void deleteCommunityMembershipRequest(@NotNull @PathParam("communityId") @NotNull String communityId, @NotNull @PathParam("userId") @NotNull String userId) throws PortalException
Deletes a membership request in a community sent by a user. Only the user who sent the request may execute this operation.- Parameters:
communityId
- the community identifier.userId
- the user identifier.- Throws:
PortalException
- Since:
- 8.0.0
-
requestCommunityMembership
@POST @Path("/communities/{communityId:[A-F0-9]{32}}/membershiprequests") public void requestCommunityMembership(@NotNull @PathParam("communityId") @NotNull String communityId) throws PortalException
Requests a membership in a community, by the current logged in user.If the community is
CommunityPrivacy.PRIVATE
, this method must return a not found response.If the community is
CommunityPrivacy.RESTRICTED
, the membership request is created and the user will become a member of the community when a community administrator approves the request.If the community is
CommunityPrivacy.PUBLIC
, the membership request is automatically accepted and the user becomes a member of the community.- Parameters:
communityId
- the community identifier.- Throws:
PortalException
- Since:
- 8.0.0
-
processMembershipRequest
@POST @Path("/communities/{communityId:[A-F0-9]{32}}/membershiprequests/{userId:[A-F0-9]{32}}") public void processMembershipRequest(@NotNull @PathParam("communityId") @NotNull String communityId, @NotNull @PathParam("userId") @NotNull String userId, @NotNull @QueryParam("action") @NotNull CommunityResource.MembershipRequestAction action) throws PortalException
Processes an action on membership request.- Parameters:
communityId
- the membership request's community identifier.userId
- the identifier of user who created the membership request.action
- the action to be performed.- Throws:
PortalException
- Since:
- 8.0.0
-
-