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
Constructors Constructor Description DefaultCommentManager(ContentEntityObjectDao<ContentEntityObject> contentEntityObjectDao, org.hibernate.SessionFactory sessionFactory, WikiToStorageConverter wikiToStorageConverter, com.atlassian.event.api.EventPublisher eventPublisher, CommentDaoInternal commentDao, RelationManager relationManager, CollaborativeEditingHelper collaborativeEditingHelper, AuditingContext auditingContext, RetentionFeatureChecker retentionFeatureChecker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @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)intcountAllCommentVersions()Count the total number of comments of all types, including previous versionsintcountComments(Searchable searchable)@NonNull Map<Searchable,Integer>countComments(Collection<? extends Searchable> searchables)@NonNull Map<Long,Integer>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>... predicates)Returns the children of a comment, limited to the pagination requested.@NonNull PageResponse<Comment>getFilteredContainerComments(long containerId, LimitedRequest pageRequest, Depth depth, Predicate<? super Comment>... predicates)Returns the children comments of a ContentEntityObject, limited to the pagination requested.@NonNull List<Comment>getPageComments(long pageId, Date since)The service get all page comments (page level comments and inline comments)@NonNull List<Comment>getPageComments(long pageId, Date since, String ignoreUsername)The service get all page comments (page level comments and inline comments) from a particular date except for comments by the given username.@NonNull List<Comment>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, 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.internal.pages.CommentManagerInternal
getChildren, getContainerComments
-
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
-
Methods inherited from interface com.atlassian.confluence.internal.ContentEntityManagerInternal
getByIds
-
-
-
-
Constructor Detail
-
DefaultCommentManager
public DefaultCommentManager(ContentEntityObjectDao<ContentEntityObject> contentEntityObjectDao, org.hibernate.SessionFactory sessionFactory, WikiToStorageConverter wikiToStorageConverter, com.atlassian.event.api.EventPublisher eventPublisher, CommentDaoInternal commentDao, RelationManager relationManager, CollaborativeEditingHelper collaborativeEditingHelper, AuditingContext auditingContext, RetentionFeatureChecker retentionFeatureChecker)
- Since:
- 7.16
-
-
Method Detail
-
getComment
public @Nullable Comment getComment(long id)
- Specified by:
getCommentin interfaceCommentManager
-
addCommentToPage
public @NonNull Comment addCommentToPage(AbstractPage page, Comment parent, String content)
- Specified by:
addCommentToPagein interfaceCommentManager
-
addCommentToObject
public @NonNull Comment addCommentToObject(ContentEntityObject ceo, Comment parent, String content)
- 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
public void updateCommentContent(Comment comment, String content)
- 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
public @NonNull Iterator getRecentlyUpdatedComments(Space space, int maxResults)
- Specified by:
getRecentlyUpdatedCommentsin interfaceCommentManager
-
getPageComments
public @NonNull List<Comment> getPageComments(long pageId, Date since)
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
public @NonNull List<Comment> getPageComments(long pageId, Date since, String ignoreUsername)
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 username.- Specified by:
getPageCommentsin interfaceCommentManager- Parameters:
pageId- page id of commentsince- comment timeignoreUsername- username excepted- Returns:
- all comment
-
getFilteredContainerComments
public @NonNull PageResponse<Comment> getFilteredContainerComments(long containerId, LimitedRequest pageRequest, Depth depth, Predicate<? super Comment>... predicates)
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
public @NonNull Map<Searchable,Integer> countComments(Collection<? extends Searchable> searchables)
- Specified by:
countCommentsin interfaceCommentManager
-
countComments
public int countComments(Searchable searchable)
- 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
public @NonNull Map<Long,Integer> countUnresolvedComments(Collection<Long> containerIds)
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>... predicates)
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
public @NonNull List<Comment> getPageLevelComments(long pageId, Date since)
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
-
-