001
014
015 package com.liferay.portal.kernel.comment;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.util.Function;
019 import com.liferay.portal.security.permission.PermissionChecker;
020 import com.liferay.portal.service.ServiceContext;
021
022
025 public interface CommentManager {
026
027 public long addComment(
028 long userId, long groupId, String className, long classPK,
029 String body,
030 Function<String, ServiceContext> serviceContextFunction)
031 throws PortalException;
032
033 public long addComment(
034 long userId, long groupId, String className, long classPK,
035 String userName, String subject, String body,
036 Function<String, ServiceContext> serviceContextFunction)
037 throws PortalException;
038
039 public long addComment(
040 long userId, String className, long classPK, String userName,
041 long parentCommentId, String subject, String body,
042 Function<String, ServiceContext> serviceContextFunction)
043 throws PortalException;
044
045 public void addDiscussion(
046 long userId, long groupId, String className, long classPK,
047 String userName)
048 throws PortalException;
049
050 public void deleteComment(long commentId) throws PortalException;
051
052 public void deleteDiscussion(String className, long classPK)
053 throws PortalException;
054
055 public void deleteGroupComments(long groupId) throws PortalException;
056
057 public Comment fetchComment(long commentId);
058
059 public int getCommentsCount(String className, long classPK);
060
061 public Discussion getDiscussion(
062 long userId, long groupId, String className, long classPK,
063 Function<String, ServiceContext> serviceContextFunction)
064 throws PortalException;
065
066 public DiscussionPermission getDiscussionPermission(
067 PermissionChecker permissionChecker);
068
069 public DiscussionStagingHandler getDiscussionStagingHandler();
070
071 public boolean hasDiscussion(String className, long classPK)
072 throws PortalException;
073
074 public void moveDiscussionToTrash(String className, long classPK);
075
076 public void restoreDiscussionFromTrash(String className, long classPK);
077
078 public void subscribeDiscussion(
079 long userId, long groupId, String className, long classPK)
080 throws PortalException;
081
082 public void unsubscribeDiscussion(
083 long userId, String className, long classPK)
084 throws PortalException;
085
086 public long updateComment(
087 long userId, String className, long classPK, long commentId,
088 String subject, String body,
089 Function<String, ServiceContext> serviceContextFunction)
090 throws PortalException;
091
092 }