Class CommentItResource


  • @StableMinor(version="17.0",
                 sinceVersion="8.0")
    @Path("/lumis/service/commentit/rest")
    public class CommentItResource
    extends java.lang.Object
    REST API for CommentIt service.
    Since:
    8.0.0
    Version:
    $Revision$ $Date$
    • Constructor Detail

      • CommentItResource

        public CommentItResource()
    • Method Detail

      • addComment

        @POST
        @Path("/comments")
        @Produces("application/json")
        @Consumes("application/json")
        public javax.ws.rs.core.Response addComment​(@NotNull
                                                    @NotNull Comment comment)
                                             throws PortalException
        Adds a Comment.
        Parameters:
        comment - the Comment to add.
        Returns:
        A Response with the path to the Comment and the added Comment.
        Throws:
        PortalException
        Since:
        8.0.0
      • getComment

        @GET
        @Path("/comments/{id:[A-F0-9]{32}}")
        @Produces("application/json")
        public Comment getComment​(@NotNull @PathParam("id")
                                  @NotNull java.lang.String id)
                           throws PortalException
        Returns a Comment by its identifier.
        Parameters:
        id - The identifier of the Comment.
        Returns:
        the Comment or a Response.Status.NOT_FOUND response if not found.
        Throws:
        PortalException
        Since:
        8.0.0
      • getCommentsItems

        @GET
        @Path("/comments-items/{serviceInstanceId:[A-F0-9]{32}}")
        @Produces("application/json")
        public CommentItResource.CommentsItemList getCommentsItems​(@NotNull @PathParam("serviceInstanceId")
                                                                   @NotNull java.lang.String serviceInstanceId,
                                                                   @NotNull @NotEmpty @QueryParam("itemIds")
                                                                   @NotNull @NotEmpty java.util.List<java.lang.String> itemIds,
                                                                   @NotNull @QueryParam("limit")
                                                                   @NotNull java.lang.Integer limit)
                                                            throws PortalException
        Get the newest Comment objects of the specified items, organized in CommentItResource.CommentsItem structures, up to the specified amount.
        Parameters:
        serviceInstanceId - The instance identifier for the CommentIt service being use.
        itemIds - The identifier of the items to retrieve the Comment objects from
        limit - The maximum number of Comment objects to get.
        Returns:
        A CommentItResource.CommentsItemList object with the CommentItResource.CommentsList with a list of Comment objects for each item.
        Throws:
        PortalException
        Since:
        8.0.0
      • deleteComment

        @DELETE
        @Path("/comments/{commentId:[A-F0-9]{32}}")
        public void deleteComment​(@NotNull @PathParam("commentId")
                                  @NotNull java.lang.String commentId)
                           throws PortalException
        Delete the Comment with the identifier
        Parameters:
        commentId - the identifier of the Comment to delete
        Throws:
        PortalException
        Since:
        8.0.0