java.lang.Object
org.gcube.social_networking.social_networking_client_library.BaseClient
org.gcube.social_networking.social_networking_client_library.CommentClient

public class CommentClient extends BaseClient
Comments client: the operations of the service that also notify (the post owner and the other commenters, the mentioned users). The raw store operations without notifications are in LibClient.
  • Constructor Details

  • Method Details

    • getCommentsByPostId

      public List<org.gcube.portal.databook.shared.Comment> getCommentsByPostId(String postId)
      Comments of a post, oldest first.
      Parameters:
      postId - the key of the post
    • getCommentsUser

      public List<org.gcube.portal.databook.shared.Comment> getCommentsUser()
      Comments of the user of the token.
    • writeComment

      public org.gcube.portal.databook.shared.Comment writeComment(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.
      Returns:
      the written comment
    • getComment

      public org.gcube.portal.databook.shared.Comment getComment(String commentId)
      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 Comment matching the given id
    • editComment

      public org.gcube.portal.databook.shared.Comment editComment(String commentId, String text)
      Edit an existing comment.

      Endpoint: POST 2/comments/edit-comment

      Identity 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 edit
      text - the updated text of the comment
      Returns:
      the updated Comment
    • deleteComment

      public Boolean deleteComment(String commentId)
      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