Class CommunityResource


  • @StableMinor(version="17.0",
                 sinceVersion="8.0")
    @Path("/lumis/service/community/rest")
    public class CommunityResource
    extends java.lang.Object
    REST API for community service.
    Since:
    8.0.0
    Version:
    $Revision$ $Date$
    • 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).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deleteCommunityMembership​(@NotNull java.lang.String communityId, @NotNull java.lang.String userId)
      Deletes the membership of a user in a community.
      void deleteCommunityMembershipRequest​(@NotNull java.lang.String communityId, @NotNull java.lang.String userId)
      Deletes a membership request in a community sent by a user.
      lumis.service.community.CommunityResource.CommunityMembership getCommunityMembership​(@NotNull java.lang.String communityId, @NotNull java.lang.String userId)
      Returns information about the membership of a user in a community.
      lumis.service.community.CommunityMembershipRequest getCommunityMembershipRequest​(@NotNull java.lang.String communityId, @NotNull java.lang.String userId)
      Returns information about the request of membership in a community sent by a user.
      void processMembershipRequest​(@NotNull java.lang.String communityId, @NotNull java.lang.String userId, @NotNull CommunityResource.MembershipRequestAction action)
      Processes an action on membership request.
      void requestCommunityMembership​(@NotNull java.lang.String communityId)
      Requests a membership in a community, by the current logged in user.
      lumis.service.community.CommunityResource.CommunityMembership updateCommunityMembership​(@NotNull java.lang.String communityId, @NotNull java.lang.String userId, @NotNull lumis.service.community.CommunityResource.CommunityMembership membership)
      Updates information about the membership of a user in a community.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.lang.String communityId,
                                                                                                    @NotNull @PathParam("userId")
                                                                                                    @NotNull java.lang.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 java.lang.String communityId,
                                                                                                       @NotNull @PathParam("userId")
                                                                                                       @NotNull java.lang.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 java.lang.String communityId,
                                              @NotNull @PathParam("userId")
                                              @NotNull java.lang.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 java.lang.String communityId,
                                                                                                @NotNull @PathParam("userId")
                                                                                                @NotNull java.lang.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 java.lang.String communityId,
                                                     @NotNull @PathParam("userId")
                                                     @NotNull java.lang.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 java.lang.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 java.lang.String communityId,
                                             @NotNull @PathParam("userId")
                                             @NotNull java.lang.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