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, PermissionManager permissionManager) -
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 versionslongcountCommentByStatuses(List<ContentStatus> contentStatuses) Retrieve the latest content count of specific content type for a given space with a particular status.intcountComments(Searchable searchable) @NonNull Map<Searchable,Integer> countComments(Collection<? extends Searchable> searchables) longcountSpaceCommentByStatuses(Space space, List<ContentStatus> contentStatuses) Retrieve the latest content count of specific content type for a given space with a particular status.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 commentsgetRecentlyUpdatedComments(Space space, int maxResults) voidremoveCommentFromObject(long id) voidremoveCommentFromPage(long id) @NonNull PageResponse<Comment>scanFilteredComments(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Comment>... filter) Retrieves all the existing comments associated with the instance of Confluence, while applying the specified pagination parameters to limit the number of results returned in each request.@NonNull PageResponse<Comment>scanFilteredComments(List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Comment>... filter) Retrieves all the current comments within the specified space, with the results limited according to the provided pagination parameters.voidupdateCommentContent(Comment comment, String content) Methods inherited from class com.atlassian.confluence.impl.content.DefaultContentEntityManager
convertFromWikiToStorageFormatIfRequired, countContentBySpaceIdAndStatus, createDraft, filteredResponseWithCursor, filteredResponseWithCursor, findAllDraftsFor, findAllDraftsWithUnpublishedChangesForUser, findDraftFor, findDraftFor, findUnpublishedContentWithUserContributions, getById, getById, getById, getByIdsAndFilters, getContentAuthoredByUser, 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, PermissionManager permissionManager) - 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-filter-- Returns:
- the paginated response of Comment entities
-
scanFilteredComments
public @NonNull PageResponse<Comment> scanFilteredComments(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Comment>... filter) Description copied from interface:CommentManagerInternalRetrieves all the existing comments associated with the instance of Confluence, while applying the specified pagination parameters to limit the number of results returned in each request.- Specified by:
scanFilteredCommentsin interfaceCommentManagerInternal- Parameters:
space- the space to locate comments instatuses- list of content status which we are interested to fetchpageRequest- the pagination requestedfilter- a Predicate to apply to the results before returning- Returns:
- the paginated response of Comment entities in the given space
-
scanFilteredComments
public @NonNull PageResponse<Comment> scanFilteredComments(List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Comment>... filter) Description copied from interface:CommentManagerInternalRetrieves all the current comments within the specified space, with the results limited according to the provided pagination parameters.- Specified by:
scanFilteredCommentsin interfaceCommentManagerInternal- Parameters:
statuses- list of content status which we are interested to fetchpageRequest- the pagination requestedfilter- a Predicate to apply to the results before returning- Returns:
- the paginated response of Comment entities in any space
-
countSpaceCommentByStatuses
Description copied from interface:CommentManagerInternalRetrieve the latest content count of specific content type for a given space with a particular status.- Specified by:
countSpaceCommentByStatusesin interfaceCommentManagerInternal- Parameters:
space- the spacecontentStatuses- the statuses of the content being retrieved (e.g.ContentEntityObject.DELETED- Returns:
- the number of content objects with that status in that space
-
countCommentByStatuses
Description copied from interface:CommentManagerInternalRetrieve the latest content count of specific content type for a given space with a particular status.- Specified by:
countCommentByStatusesin interfaceCommentManagerInternal- Parameters:
contentStatuses- the statuses of the content being retrieved (e.g.ContentEntityObject.DELETED- Returns:
- the number of content objects with that status in that space
-
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 tofilter- 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
-