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 Comment
addCommentToObject
(ContentEntityObject ceo, Comment parent, String content) @NonNull Comment
addCommentToObject
(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 Comment
addCommentToPage
(AbstractPage page, Comment parent, String content) int
Count the total number of comments of all types, including previous versionsint
countComments
(Searchable searchable) @NonNull Map<Searchable,
Integer> countComments
(Collection<? extends Searchable> searchables) countUnresolvedComments
(Collection<Long> containerIds) Count unresolved comments of comment containers.@Nullable Comment
getComment
(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 Iterator
getRecentlyUpdatedComments
(Space space, int maxResults) void
removeCommentFromObject
(long id) void
removeCommentFromPage
(long id) void
updateCommentContent
(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, saveNewVersion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getComment
in interfaceCommentManager
-
addCommentToPage
- Specified by:
addCommentToPage
in interfaceCommentManager
-
addCommentToObject
- Specified by:
addCommentToObject
in interfaceCommentManager
-
addCommentToObject
public @NonNull Comment addCommentToObject(ContentEntityObject ceo, Comment parent, String content, @Nullable NewCommentDeduplicator commentDeduplicator) Description copied from interface:CommentManager
Add a new comment if the given deduplicator determines that it's not a duplicate, or just return the existing duplicate otherwise.- Specified by:
addCommentToObject
in interfaceCommentManager
-
updateCommentContent
- Specified by:
updateCommentContent
in interfaceCommentManager
-
removeCommentFromPage
public void removeCommentFromPage(long id) - Specified by:
removeCommentFromPage
in interfaceCommentManager
-
removeCommentFromObject
public void removeCommentFromObject(long id) - Specified by:
removeCommentFromObject
in interfaceCommentManager
-
getRecentlyUpdatedComments
- Specified by:
getRecentlyUpdatedComments
in interfaceCommentManager
-
getPageComments
Description copied from interface:CommentManager
The service get all page comments (page level comments and inline comments)- Specified by:
getPageComments
in interfaceCommentManager
- Parameters:
pageId
- page id of commentsince
- comment time- Returns:
- all comment
-
getPageComments
Description copied from interface:CommentManager
The service get all page comments (page level comments and inline comments) from a particular date except for comments by the given user.- Specified by:
getPageComments
in 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:
getFilteredContainerComments
in interfaceCommentManagerInternal
- Parameters:
containerId
-pageRequest
-depth
-predicates
-- Returns:
- the paginated response of Comment entities
-
countComments
- Specified by:
countComments
in interfaceCommentManager
-
countComments
- Specified by:
countComments
in interfaceCommentManager
-
countAllCommentVersions
public int countAllCommentVersions()Description copied from interface:CommentManager
Count the total number of comments of all types, including previous versions- Specified by:
countAllCommentVersions
in interfaceCommentManager
- Returns:
- the total number of comments
-
countUnresolvedComments
Description copied from interface:CommentManager
Count unresolved comments of comment containers.- Specified by:
countUnresolvedComments
in 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:
getFilteredChildren
in 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:CommentManager
The service get all page level comments- Specified by:
getPageLevelComments
in interfaceCommentManager
- Parameters:
pageId
- page id of commentsince
- comment time- Returns:
- page level comments
-