Class ConversationsServiceImpl
- java.lang.Object
-
- org.sakaiproject.conversations.impl.ConversationsServiceImpl
-
- All Implemented Interfaces:
Observer,ConversationsService
@Transactional public class ConversationsServiceImpl extends Object implements ConversationsService, Observer
-
-
Field Summary
-
Fields inherited from interface org.sakaiproject.conversations.api.ConversationsService
POSTS_CACHE_NAME, PROP_DISABLE_DISCUSSIONS, PROP_MAX_THREAD_DEPTH, PROP_THREADS_PAGE_SIZE, REFERENCE_ROOT, SORT_NAME_ASCENDING, SORT_NAME_DESCENDING, SORT_POSTS_CREATED_ASCENDING, SORT_POSTS_CREATED_DESCENDING, SORT_REACTIONS_MADE_ASCENDING, SORT_REACTIONS_MADE_DESCENDING, SORT_TOPICS_CREATED_ASCENDING, SORT_TOPICS_CREATED_DESCENDING, SORT_TOPICS_VIEWED_ASCENDING, SORT_TOPICS_VIEWED_DESCENDING, STATS_CACHE_NAME, TOOL_ID
-
-
Constructor Summary
Constructors Constructor Description ConversationsServiceImpl()
-
Method Summary
-
-
-
Method Detail
-
init
public void init()
-
update
public void update(Observable observable, Object arg)
-
getEntityPrefix
public String getEntityPrefix()
-
getBlankTopic
public TopicTransferBean getBlankTopic(String siteId) throws ConversationsPermissionsException
- Specified by:
getBlankTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getTopic
public Optional<TopicTransferBean> getTopic(String topicId) throws ConversationsPermissionsException
- Specified by:
getTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
currentUserCanViewTopic
public boolean currentUserCanViewTopic(ConversationsTopic topic)
- Specified by:
currentUserCanViewTopicin interfaceConversationsService
-
getTopicsForSite
public List<TopicTransferBean> getTopicsForSite(String siteId) throws ConversationsPermissionsException
- Specified by:
getTopicsForSitein interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getTopicPortalUrl
public Optional<String> getTopicPortalUrl(String topicId)
- Specified by:
getTopicPortalUrlin interfaceConversationsService
-
getPostPortalUrl
public Optional<String> getPostPortalUrl(String topicId, String postId)
- Specified by:
getPostPortalUrlin interfaceConversationsService
-
getCommentPortalUrl
public Optional<String> getCommentPortalUrl(String commentId)
- Specified by:
getCommentPortalUrlin interfaceConversationsService
-
saveTopic
public TopicTransferBean saveTopic(TopicTransferBean topicBean, boolean sendMessage) throws ConversationsPermissionsException
- Specified by:
saveTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
pinTopic
public void pinTopic(String topicId, boolean pinned) throws ConversationsPermissionsException
- Specified by:
pinTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
lockTopic
public TopicTransferBean lockTopic(String topicId, boolean locked, boolean needsModerator) throws ConversationsPermissionsException
- Specified by:
lockTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
recursivelyLockPosts
public void recursivelyLockPosts(ConversationsPost post, Boolean locked)
-
hideTopic
public ConversationsTopic hideTopic(String topicId, boolean hidden, boolean needsModerator) throws ConversationsPermissionsException
- Specified by:
hideTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
bookmarkTopic
public void bookmarkTopic(String topicId, boolean bookmarked) throws ConversationsPermissionsException
- Specified by:
bookmarkTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
deleteTopic
public void deleteTopic(String topicId) throws ConversationsPermissionsException
- Specified by:
deleteTopicin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
saveTopicReactions
public Map<Reaction,Integer> saveTopicReactions(String topicId, Map<Reaction,Boolean> reactions) throws ConversationsPermissionsException
- Specified by:
saveTopicReactionsin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getPost
public Optional<PostTransferBean> getPost(String postId) throws ConversationsPermissionsException
- Specified by:
getPostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
savePost
public PostTransferBean savePost(PostTransferBean postBean, boolean sendMessage) throws ConversationsPermissionsException
- Specified by:
savePostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
currentUserCanViewPost
public boolean currentUserCanViewPost(ConversationsPost post)
- Specified by:
currentUserCanViewPostin interfaceConversationsService
-
currentUserCanViewComment
public boolean currentUserCanViewComment(ConversationsComment comment)
- Specified by:
currentUserCanViewCommentin interfaceConversationsService
-
getNumberOfThreadPages
@Transactional(readOnly=true) public int getNumberOfThreadPages(String siteId, String topicId) throws ConversationsPermissionsException
- Specified by:
getNumberOfThreadPagesin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getPostsByTopicId
@Transactional(readOnly=true) public Collection<PostTransferBean> getPostsByTopicId(String siteId, String topicId, Integer page, PostSort postSort, String requestedPostId) throws ConversationsPermissionsException
- Specified by:
getPostsByTopicIdin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
deletePost
public void deletePost(String siteId, String topicId, String postId, boolean setTopicResolved) throws ConversationsPermissionsException
- Specified by:
deletePostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
lockPost
public PostTransferBean lockPost(String siteId, String topicId, String postId, boolean locked) throws ConversationsPermissionsException
- Specified by:
lockPostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
hidePost
public PostTransferBean hidePost(String siteId, String topicId, String postId, boolean hidden) throws ConversationsPermissionsException
- Specified by:
hidePostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
savePostReactions
public Map<Reaction,Integer> savePostReactions(String topicId, String postId, Map<Reaction,Boolean> reactions) throws ConversationsPermissionsException
- Specified by:
savePostReactionsin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
markPostsViewed
public void markPostsViewed(Set<String> postIds, String topicId) throws ConversationsPermissionsException
- Specified by:
markPostsViewedin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getComment
public Optional<CommentTransferBean> getComment(String commentId) throws ConversationsPermissionsException
- Specified by:
getCommentin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
saveComment
public CommentTransferBean saveComment(CommentTransferBean commentBean) throws ConversationsPermissionsException
- Specified by:
saveCommentin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
deleteComment
public void deleteComment(String siteId, String commentId) throws ConversationsPermissionsException
- Specified by:
deleteCommentin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
upvotePost
public PostTransferBean upvotePost(String siteId, String topicId, String postId) throws ConversationsPermissionsException
- Specified by:
upvotePostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
unUpvotePost
public PostTransferBean unUpvotePost(String siteId, String postId) throws ConversationsPermissionsException
- Specified by:
unUpvotePostin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
saveTag
public Tag saveTag(Tag tag) throws ConversationsPermissionsException
- Specified by:
saveTagin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
createTags
public List<Tag> createTags(List<Tag> tags) throws ConversationsPermissionsException
- Specified by:
createTagsin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getTagsForSite
@Transactional(readOnly=true) public List<Tag> getTagsForSite(String siteId) throws ConversationsPermissionsException
- Specified by:
getTagsForSitein interfaceConversationsService- Throws:
ConversationsPermissionsException
-
deleteTag
public void deleteTag(Long tagId) throws ConversationsPermissionsException
- Specified by:
deleteTagin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getSettingsForSite
public Settings getSettingsForSite(String siteId) throws ConversationsPermissionsException
- Specified by:
getSettingsForSitein interfaceConversationsService- Throws:
ConversationsPermissionsException
-
saveSettings
public Settings saveSettings(Settings settings) throws ConversationsPermissionsException
- Specified by:
saveSettingsin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getConvStatusForSiteAndUser
public ConvStatus getConvStatusForSiteAndUser(String siteId, String userId) throws ConversationsPermissionsException
- Specified by:
getConvStatusForSiteAndUserin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
saveConvStatus
public void saveConvStatus(ConvStatus convStatus) throws ConversationsPermissionsException
- Specified by:
saveConvStatusin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getSiteStats
@Transactional(readOnly=true) public Map<String,Object> getSiteStats(String siteId, Instant from, Instant to, int page, String sort) throws ConversationsPermissionsException
- Specified by:
getSiteStatsin interfaceConversationsService- Throws:
ConversationsPermissionsException
-
getEventKeys
public String[] getEventKeys()
-
-