Class CommentClient
LibClient.-
Field Summary
Fields inherited from class org.gcube.social_networking.social_networking_client_library.BaseClient
SG3_BRIDGE_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteComment(String commentId) Delete an existing comment.org.gcube.portal.databook.shared.CommenteditComment(String commentId, String text) Edit an existing comment.org.gcube.portal.databook.shared.CommentgetComment(String commentId) Retrieve a single comment by identifier if its parent post belongs to the token's context.List<org.gcube.portal.databook.shared.Comment>getCommentsByPostId(String postId) Comments of a post, oldest first.List<org.gcube.portal.databook.shared.Comment>Comments of the user of the token.org.gcube.portal.databook.shared.CommentwriteComment(String postId, String text) Writes a comment of the user of the token on a post; the service stores it, extracts hashtags and mentions and sends the notifications.Methods inherited from class org.gcube.social_networking.social_networking_client_library.BaseClient
getServiceEndpoint
-
Constructor Details
-
CommentClient
- Throws:
Exception
-
-
Method Details
-
getCommentsByPostId
Comments of a post, oldest first.- Parameters:
postId- the key of the post
-
getCommentsUser
Comments of the user of the token. -
writeComment
Writes a comment of the user of the token on a post; the service stores it, extracts hashtags and mentions and sends the notifications.- Returns:
- the written comment
-
getComment
Retrieve a single comment by identifier if its parent post belongs to the token's context.Endpoint:
GET 2/comments/get-comment?id={commentId}Identity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; parent post must be visible in the caller's context.
- Parameters:
commentId- the identifier (UUID) of the comment- Returns:
- the
Commentmatching the given id
-
editComment
Edit an existing comment.Endpoint:
POST 2/comments/edit-commentIdentity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; caller must be the author of the comment. Parent post must belong to the caller's context. Hashtags and occurrences are updated server-side.
- Parameters:
commentId- the identifier (UUID) of the comment to edittext- the updated text of the comment- Returns:
- the updated
Comment
-
deleteComment
Delete an existing comment.Endpoint:
POST 2/comments/delete-comment?id={commentId}Identity semantics: acts as the token's caller (the user owning the token in context). Requires a user token; caller must be the comment author, the owner of the parent post, or a VRE-Manager in the token context. Parent post must belong to the context. Hashtags of the comment are cleaned up server-side.
- Parameters:
commentId- the identifier (UUID) of the comment to delete- Returns:
- true when the comment has been deleted
-