Class DefaultCommentManager
java.lang.Object
com.atlassian.confluence.impl.content.DefaultContentEntityManager
com.atlassian.confluence.impl.content.DefaultCommentManager
- All Implemented Interfaces:
ContentEntityManager,ContentDraftManagerInternal,ContentEntityManagerInternal,CommentManagerInternal,CommentManager
@ParametersAreNonnullByDefault
public class DefaultCommentManager
extends DefaultContentEntityManager
implements CommentManagerInternal
Manager for page comments.
- Since:
- 7.15
-
Field Summary
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager
ITERATE_ALL -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCommentManager(ContentEntityObjectDaoInternal contentEntityObjectDao, org.hibernate.SessionFactory sessionFactory, WikiToStorageConverter wikiToStorageConverter, com.atlassian.event.api.EventPublisher eventPublisher, CommentDaoInternal commentDao, RelationManager relationManager, CollaborativeEditingHelper collaborativeEditingHelper, AuditingContext auditingContext, RetentionFeatureChecker retentionFeatureChecker, NotificationManager notificationManager) -
Method Summary
Modifier and TypeMethodDescription@NonNull CommentaddCommentToObject(ContentEntityObject ceo, Comment parent, String content) @NonNull CommentaddCommentToObject(ContentEntityObject ceo, Comment parent, String content, @Nullable NewCommentDeduplicator commentDeduplicator) Add a new comment if the given deduplicator determines that it's not a duplicate, or just return the existing duplicate otherwise.@NonNull CommentaddCommentToPage(AbstractPage page, Comment parent, String content) intCount the total number of comments of all types, including previous versionsintcountComments(Searchable searchable) @NonNull Map<Searchable,Integer> countComments(Collection<? extends Searchable> searchables) countUnresolvedComments(Collection<Long> containerIds) Count unresolved comments of comment containers.@Nullable CommentgetComment(long id) @NonNull PageResponse<Comment>getFilteredChildren(Comment comment, LimitedRequest pageRequest, Depth depth, Predicate<? super Comment> filter) Returns the children of a comment, limited to the pagination requested.@NonNull PageResponse<Comment>getFilteredContainerComments(long containerId, LimitedRequest pageRequest, Depth depth, Predicate<? super Comment> filter) Returns the children comments of a ContentEntityObject, limited to the pagination requested.getPageComments(long pageId, Date since) The service get all page comments (page level comments and inline comments)getPageComments(long pageId, Date since, ConfluenceUser ignoreUser) The service get all page comments (page level comments and inline comments) from a particular date except for comments by the given user.getPageLevelComments(long pageId, Date since) The service get all page level comments@NonNull IteratorgetRecentlyUpdatedComments(Space space, int maxResults) voidremoveCommentFromObject(long id) voidremoveCommentFromPage(long id) voidupdateCommentContent(Comment comment, String content) Methods inherited from class com.atlassian.confluence.impl.content.DefaultContentEntityManager
convertFromWikiToStorageFormatIfRequired, createDraft, filteredResponseWithCursor, findAllDraftsFor, findAllDraftsWithUnpublishedChangesForUser, findDraftFor, findDraftFor, findUnpublishedContentWithUserContributions, getById, getById, getById, getByIdsAndFilters, getContributionStatusByUser, getNextVersion, getOtherVersion, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, getVersionHistorySummaries, getVersionsLastEditedByUser, publishCreateEvent, publishRemoveEvent, publishUpdateEvent, refreshContentEntity, removeContentEntities, removeContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, saveNewVersion, saveNewVersionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.core.ContentEntityManager
getById, getContributionStatusByUser, getNextVersion, getOtherVersion, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, getVersionsLastEditedByUser, refreshContentEntity, removeContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, saveNewVersion, saveNewVersion
-
Constructor Details
-
DefaultCommentManager
public DefaultCommentManager(ContentEntityObjectDaoInternal contentEntityObjectDao, org.hibernate.SessionFactory sessionFactory, WikiToStorageConverter wikiToStorageConverter, com.atlassian.event.api.EventPublisher eventPublisher, CommentDaoInternal commentDao, RelationManager relationManager, CollaborativeEditingHelper collaborativeEditingHelper, AuditingContext auditingContext, RetentionFeatureChecker retentionFeatureChecker, NotificationManager notificationManager) - Since:
- 7.16
-
-
Method Details
-
getComment
- Specified by:
getCommentin interfaceCommentManager
-
addCommentToPage
- Specified by:
addCommentToPagein interfaceCommentManager
-
addCommentToObject
- Specified by:
addCommentToObjectin interfaceCommentManager
-
addCommentToObject
public @NonNull Comment addCommentToObject(ContentEntityObject ceo, Comment parent, String content, @Nullable NewCommentDeduplicator commentDeduplicator) Description copied from interface:CommentManagerAdd a new comment if the given deduplicator determines that it's not a duplicate, or just return the existing duplicate otherwise.- Specified by:
addCommentToObjectin interfaceCommentManager
-
updateCommentContent
- Specified by:
updateCommentContentin interfaceCommentManager
-
removeCommentFromPage
public void removeCommentFromPage(long id) - Specified by:
removeCommentFromPagein interfaceCommentManager
-
removeCommentFromObject
public void removeCommentFromObject(long id) - Specified by:
removeCommentFromObjectin interfaceCommentManager
-
getRecentlyUpdatedComments
- Specified by:
getRecentlyUpdatedCommentsin interfaceCommentManager
-
getPageComments
Description copied from interface:CommentManagerThe service get all page comments (page level comments and inline comments)- Specified by:
getPageCommentsin interfaceCommentManager- Parameters:
pageId- page id of commentsince- comment time- Returns:
- all comment
-
getPageComments
Description copied from interface:CommentManagerThe service get all page comments (page level comments and inline comments) from a particular date except for comments by the given user.- Specified by:
getPageCommentsin interfaceCommentManager- Parameters:
pageId- page id of commentsince- comment timeignoreUser- user excepted- Returns:
- all comment
-
getFilteredContainerComments
public @NonNull PageResponse<Comment> getFilteredContainerComments(long containerId, LimitedRequest pageRequest, Depth depth, Predicate<? super Comment> filter) Returns the children comments of a ContentEntityObject, limited to the pagination requested.- Specified by:
getFilteredContainerCommentsin interfaceCommentManagerInternal- Parameters:
containerId-pageRequest-depth-predicates-- Returns:
- the paginated response of Comment entities
-
countComments
- Specified by:
countCommentsin interfaceCommentManager
-
countComments
- Specified by:
countCommentsin interfaceCommentManager
-
countAllCommentVersions
public int countAllCommentVersions()Description copied from interface:CommentManagerCount the total number of comments of all types, including previous versions- Specified by:
countAllCommentVersionsin interfaceCommentManager- Returns:
- the total number of comments
-
countUnresolvedComments
Description copied from interface:CommentManagerCount unresolved comments of comment containers.- Specified by:
countUnresolvedCommentsin interfaceCommentManager- Parameters:
containerIds- the list of comment containers ids- Returns:
- The map of container id and its unresolved comment count
-
getFilteredChildren
public @NonNull PageResponse<Comment> getFilteredChildren(Comment comment, LimitedRequest pageRequest, Depth depth, Predicate<? super Comment> filter) Returns the children of a comment, limited to the pagination requested.- Specified by:
getFilteredChildrenin interfaceCommentManagerInternal- Parameters:
comment- the comment to find children forpageRequest- the pagination requesteddepth- the depth to return children topredicates- optional predicates used to filter the comments- Returns:
- the paginated response of Comment entities
-
getPageLevelComments
Description copied from interface:CommentManagerThe service get all page level comments- Specified by:
getPageLevelCommentsin interfaceCommentManager- Parameters:
pageId- page id of commentsince- comment time- Returns:
- page level comments
-