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 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
countAllCommentVersions()
Count the total number of comments of all types, including previous versionsint
countComments(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 Comment
getComment(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 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.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:
getComment
in interfaceCommentManager
-
addCommentToPage
public @NonNull Comment addCommentToPage(AbstractPage page, Comment parent, String content)
- Specified by:
addCommentToPage
in interfaceCommentManager
-
addCommentToObject
public @NonNull Comment addCommentToObject(ContentEntityObject ceo, Comment parent, String content)
- 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
public void updateCommentContent(Comment comment, String content)
- 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
public @NonNull Iterator getRecentlyUpdatedComments(Space space, int maxResults)
- Specified by:
getRecentlyUpdatedComments
in interfaceCommentManager
-
getPageComments
public @NonNull List<Comment> getPageComments(long pageId, Date since)
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
public @NonNull List<Comment> getPageComments(long pageId, Date since, String ignoreUsername)
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 username.- Specified by:
getPageComments
in 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:
getFilteredContainerComments
in 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:
countComments
in interfaceCommentManager
-
countComments
public int countComments(Searchable searchable)
- 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
public @NonNull Map<Long,Integer> countUnresolvedComments(Collection<Long> containerIds)
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>... predicates)
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
public @NonNull List<Comment> getPageLevelComments(long pageId, Date since)
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
-
-