Package lumis.service.commentit
Class CommentItResource
- java.lang.Object
-
- lumis.service.commentit.CommentItResource
-
@StableMinor(version="14.2", sinceVersion="8.0") @Path("/lumis/service/commentit/rest") public class CommentItResource extends Object
REST API for CommentIt 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
CommentItResource.CommentsItem
JAXB object used to represent theCommentItResource.CommentsList
of a single item (itemId on a specific CommentIt service instance).static class
CommentItResource.CommentsItemList
JAXB object used to return a list ofCommentItResource.CommentsItem
.static class
CommentItResource.CommentsList
JAXB object used to return a list ofComment
objects.
-
Constructor Summary
Constructors Constructor Description CommentItResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response
addComment(@NotNull Comment comment)
Adds aComment
.void
deleteComment(@NotNull String commentId)
Delete theComment
with the identifierComment
getComment(@NotNull String id)
Returns aComment
by its identifier.CommentItResource.CommentsItemList
getCommentsItems(@NotNull String serviceInstanceId, @NotNull @NotEmpty List<String> itemIds, @NotNull Integer limit)
Get the newestComment
objects of the specified items, organized inCommentItResource.CommentsItem
structures, up to the specified amount.
-
-
-
Method Detail
-
addComment
@POST @Path("/comments") @Produces("application/json") @Consumes("application/json") public Response addComment(@NotNull @NotNull Comment comment) throws PortalException
Adds aComment
.- Parameters:
comment
- theComment
to add.- Returns:
- A
Response
with the path to theComment
and the addedComment
. - 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 String id) throws PortalException
Returns aComment
by its identifier.- Parameters:
id
- The identifier of theComment
.- Returns:
- the
Comment
or aResponse.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 String serviceInstanceId, @NotNull @NotEmpty @QueryParam("itemIds") @NotNull @NotEmpty List<String> itemIds, @NotNull @QueryParam("limit") @NotNull Integer limit) throws PortalException
Get the newestComment
objects of the specified items, organized inCommentItResource.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 theComment
objects fromlimit
- The maximum number ofComment
objects to get.- Returns:
- A
CommentItResource.CommentsItemList
object with theCommentItResource.CommentsList
with a list ofComment
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 String commentId) throws PortalException
Delete theComment
with the identifier- Parameters:
commentId
- the identifier of theComment
to delete- Throws:
PortalException
- Since:
- 8.0.0
-
-