Class 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) $
    • Constructor Detail

      • CommunityResource

        public CommunityResource()
    • 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