Class DelegatingPageDao
- java.lang.Object
-
- com.atlassian.confluence.pages.persistence.dao.DelegatingPageDao
-
- All Implemented Interfaces:
ObjectDao
,ContentEntityObjectDao<Page>
,VersionedObjectDao<Page>
,PageDaoInternal
,ContentEntityObjectDaoInternal<Page>
,ObjectDaoInternal<Page>
,VersionedObjectDaoInternal<Page>
,PageDao
- Direct Known Subclasses:
ReadThroughCachingPageDao
public class DelegatingPageDao extends Object implements PageDaoInternal
APageDaoInternal
implementation that just delegates to another one.Useful mostly for subclassing and overriding of selected methods.
- Since:
- 7.5
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DelegatingPageDao(PageDaoInternal delegateDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
countAllPages()
Counts the total number of all page entities across all spaces, including non-current pagesint
countContentBySpaceIdAndStatus(long spaceId, String status)
Retrieve the count of content for a given space with a particular status.int
countCurrentPages()
Counts the total number of current pages across all spacesint
countDraftPages()
Counts the number of pages that are drafts.int
countPagesInSubtree(@NonNull Page page)
Return total descendant page including input pageint
countPagesWithUnpublishedChanges()
Counts the number of published pages that have unpublished changes.@NonNull List<Page>
findAll()
Find all objects currently persisted of a particular type.List<ContentEntityObject>
findAllDraftsFor(long contentId)
Retrieves a list of drafts for the given content if any drafts exist.List<Draft>
findAllLegacyDraftsFor(long contentId)
Retrieves a list of Legacy drafts for the given content if any exist.@NonNull List<Page>
findAllSorted(String s)
Find all objects currently persisted of a particular type and sort results by named property.@NonNull List<Page>
findAllSorted(String s, boolean cached, int firstRow, int maxRows)
Find all objects currently persisted of a particular type and sort results by named property.List<AbstractPage>
findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder, String blogTitle, Space space, int maxResultCount)
Searches for blog posts in all spaces except the one specified, looking for those that have the given title in a current or previous version, and returns the first maxResultCount results.List<AbstractPage>
findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String blogTitle, Space space, int maxResultCount)
Searches for blogs in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.<T> @NonNull PageResponse<T>
findByClassIds(Iterable<Long> ids, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super T> filter)
Deprecated.@NonNull PageResponse<Page>
findByClassIdsFiltered(Iterable<Long> ids, LimitedRequest limitedRequest, Predicate<? super Page> filter)
Find a list of objects from the same persistent class.List<SpaceContentEntityObject>
findContentBySpaceIdAndStatus(long spaceId, String status, int offset, int count)
Retrieve content for a given space with a particular status.PageResponse<SpaceContentEntityObject>
findContentBySpaceIdAndStatus(long spaceId, String status, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super SpaceContentEntityObject> predicate)
Deprecated.List<ContentPermissionSummary>
findContentPermissionSummaryByIds(Collection<Long> ids)
Get Content creator for bulk permission checkingPageResponse<Page>
findCurrentPages(LimitedRequest request)
Find all current pages.ContentEntityObject
findDraftFor(long contentId)
Retrieves the draft for the given content if exists.List<ContentEntityObject>
findDraftsWithUnpublishedChangesForUser(String creatorName)
Retrieves the drafts for the givenUser
, which contains unpublished changesList<ContentEntityObject>
findHistoricalVersionsAfterVersion(long originalContentId, int version)
long
findLatestVersionsCount()
Returns the number of results for the latest versions of the current persistent class.Iterator<Page>
findLatestVersionsIterator()
Returns an iterator for the latest versions of the current persistent class.List<AbstractPage>
findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
Searches for pages in all spaces except the one specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.List<AbstractPage>
findPagesWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
Searches for pages in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.List<ContentEntityObject>
findPreviousVersions(long originalContentId)
List<ContentEntityObject>
findUnpublishedContentWithUserContributions(String username)
Retrieves the drafts for the givenUser
.PageResponse<AbstractPage>
getAbstractPages(Space space, String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<AbstractPage>
getAbstractPages(Space space, List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<AbstractPage>
getAbstractPages(String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<AbstractPage>
getAbstractPages(List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<AbstractPage>
getAbstractPages(org.joda.time.DateTime date, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<AbstractPage>
getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<AbstractPage>
getAbstractPagesByTitle(String title, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.PageResponse<Page>
getAllChildren(Page page, LimitedRequest pageRequest, Depth depth)
Returns all children of a page (including drafts), limited to the pagination requested.Iterator<SpaceContentEntityObject>
getAllCurrentEntities()
Set<ConfluenceUser>
getAllModifiers(Page page)
Get the Set of allConfluenceUser
that have modified (contributed) a content.Map<Long,Set<ConfluenceUser>>
getAllModifiers(Collection<Long> contentIds)
Get the Set of allConfluenceUser
that have modified (contributed) content.Map<Long,List<Long>>
getAncestorsFor(Collection<Long> ids)
Get the list page ids of the ancestors of the given page ids.int
getAuthoredPagesCountByUser(String username)
PageResponse<BlogPost>
getBlogPosts(Space space, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super BlogPost> filter)
Deprecated.Page
getById(long id)
Retrieve the object with a particular id from the database.PageResponse<Page>
getChildren(Page page, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> predicate, Depth depth)
Deprecated.int
getCommentCountOnPage(long id)
Count the number of comments on the passed in page.List<ContentEntityObject>
getContentAuthoredByUser(String username)
Map<Long,ContributionStatus>
getContributionStatusByUser(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Identifies the most recent contributions made to a Collection of content by the given user.PageDao
getDelegateDao()
List<Long>
getDescendantIds(Page page)
Finds the ids of all descendant pages of the given pageList<Long>
getDescendantIds(Page page, ContentStatus... statuses)
Finds the ids of all descendant pages of the given pageList<Page>
getDescendants(Page page)
Finds all descendant pages (recursive) of the given pageList<String>
getDescendantTitles(Page page)
Finds all descendant titles of the given pagePageResponse<Page>
getDraftChildren(Page page, LimitedRequest pageRequest, Depth depth)
Returns the children of a page which have a status of DRAFT, limited to the pagination requested.ContentEntityObject
getFirstVersionAfter(long originalVersionContentId, int version)
ContentEntityObject
getFirstVersionBefore(long originalVersionContentId, int version)
List<Page>
getLastEditedVersionsOf(Page content)
Retrieves all the last edited versions for each user who has contributed to the specified piece of content.Integer
getMaxSiblingPosition(Page page)
Gets the highest position value of all the page's siblings.String
getObjectType(long id)
Date
getOldestPageCreationDate()
Gets the creation date of the oldest page.List<Page>
getOrphanedPages(String spaceKey)
Page
getPage(Space space, String pageTitle)
Get the page by space and title.PageResponse<AbstractPage>
getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
Retrieve a page of entities, either the current version or historical version, that have been modified by the user, in order of the user's most recent modification.PageResponse<AbstractPage>
getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
Retrieve a page of entities, either the current version or historical version, that have been modified by the user, in order of the user's most recent modification.Page
getPageById(long id)
Get the page with the given id.Page
getPageByIdWithComments(long id)
Get the page with the given id, and perform an eager load of the comments and their children.long
getPageCount(@NonNull String spaceKey)
Get total number of current pages in a spacelong
getPageCount(@NonNull String spaceKey, List<ContentStatus> statuses)
Get total number of pages in a space, within any of the given statuses.Collection<Long>
getPageIds(Space space)
Get the ids of all pages (current and historical) in the given space.List<Page>
getPageInTrash(String spaceKey, String title)
List<Page>
getPages(@Nullable Space space, boolean currentOnly)
PageResponse<Page>
getPages(LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
Deprecated.PageResponse<Page>
getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
Deprecated.List<Page>
getPagesByIds(Iterable<Long> ids)
Get the pages with the given ids.List<Page>
getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
List<Page>
getPagesStartingWith(Space space, String s)
Optional<PageStatisticsDTO>
getPageStatistics()
Fetches statistics about pagesList<Page>
getPagesWithPermissions(Space space)
Get all current pages in a space and eagerly fetch permissions at the same time.Page
getPageWithComments(Space space, String pageTitle)
Get the page by space and title, and perform an eager load of the comments and their children.List<Page>
getPermissionPages(Space space)
Collection<Page>
getPermissionPages(Space space, LimitedRequest requeste)
Pagination permission pages for particular Spacelong
getPermissionPagesCount(Space space)
Get total number of permission pages for particular SpaceClass<Page>
getPersistentClass()
Gets the type ofEntityObject
this Dao works with.Iterator<ContentEntityObject>
getRecentlyAddedEntities(String spaceKey, int maxResults)
List<Page>
getRecentlyAddedPages(int maxCount, String spaceKey)
List<Page>
getRecentlyAuthoredPagesByUser(String username, int maxCount)
Iterator<ContentEntityObject>
getRecentlyModifiedEntities(int maxResults)
Iterator<SpaceContentEntityObject>
getRecentlyModifiedEntities(String spaceKey, int maxResults)
Iterator<ContentEntityObject>
getRecentlyModifiedEntitiesForUser(String username)
List<ContentEntityObject>
getRecentlyModifiedForChangeDigest(Date fromDate)
Retrieves a list ofContentEntityObject
s that have been newly added or modified since the date specified.List<Page>
getRecentlyUpdatedPages(int maxCount, String spaceKey)
List<Page>
getTopLevelPages(Space space)
PageResponse<Page>
getTopLevelPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
Deprecated.List<ContentEntityObject>
getTrashedContent(String spaceKey)
List<ContentEntityObject>
getTrashedContents(String spaceKey, int offset, int limit)
List<SpaceContentEntityObject>
getTrashedEntities(long contentIdOffset, int limit)
Retrieve a batch of trashed content entitiesList<OutgoingLink>
getUndefinedLinks(@Nullable String spaceKey)
List<Page>
getUndefinedPages(String spaceKey)
ContentEntityObject
getVersion(long originalVersionContentId, int version)
Map<Long,List<ConfluenceUser>>
getVersionEditContributors(Iterable<Page> originalVersions)
Get version edit contributors for a set of content identifiers.List<VersionHistorySummary>
getVersionHistorySummary(long originalContentId)
PageResponse<VersionHistorySummary>
getVersionHistorySummary(long originalContentId, LimitedRequest request)
Get version history with pagination.Map<Long,ContentEntityObject>
getVersionsLastEditedByUser(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Gets theContentEntityObject
objects, either the current version or historical version relating to given contentIds of the current version that was the most recent version edited by the given user.Map<Long,ContentEntityObject>
getVersionsLastEditedByUserNew(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Same asContentEntityObjectDao.getVersionsLastEditedByUser(Collection, UserKey)
, but a refined implementation for new Recently Worked On Drafts work.void
refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
Refreshes the object again with the fresh data from db.void
refreshEntity(Page objectToRefresh)
Refreshes the object again with the fresh data from db.void
remove(com.atlassian.core.bean.EntityObject object)
Remove object from persistence.void
removeEntity(Page objectToRemove)
Remove object from persistence.void
replicate(Object objectToReplicate)
Replicate the object.void
replicateEntity(Page objectToReplicate)
Replicate the object.void
save(com.atlassian.core.bean.EntityObject objectToSave)
void
save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject originalObject)
Saves the given current object and historical objectvoid
saveEntity(Page objectToSave)
Saves the given object to the database.void
saveEntity(Page currentObject, @Nullable Page originalObject)
Saves the given current object and historical object.void
saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
saves the object.void
saveRawEntity(Page objectToSave)
Saves the object without updating modification daa.void
saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
This is for internal use only, Do not rely on it as a public API.@NonNull PageResponse<Page>
scanFilteredPages(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable Predicate<? super Page> filter)
Retrieves a page response of all pages in space with specified content statuses.@NonNull PageResponse<Page>
scanFilteredPages(List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable Predicate<? super Page> filter)
Retrieves a page response of all the pages with specified content statuses.-
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.persistence.ContentEntityObjectDao
getTrashedContents
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ContentEntityObjectDaoInternal
findContentBySpaceIdAndStatusAndFilter
-
Methods inherited from interface com.atlassian.confluence.internal.pages.persistence.PageDaoInternal
getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPagesByCreationDate, getFilteredAbstractPagesByTitle, getFilteredBlogPosts, getFilteredChildren, getFilteredPages, getFilteredPages, getFilteredTopLevelPages
-
-
-
-
Constructor Detail
-
DelegatingPageDao
protected DelegatingPageDao(PageDaoInternal delegateDao)
-
-
Method Detail
-
getDelegateDao
public PageDao getDelegateDao()
-
getPage
public Page getPage(Space space, String pageTitle)
Description copied from interface:PageDao
Get the page by space and title.
-
getPageWithComments
public Page getPageWithComments(Space space, String pageTitle)
Description copied from interface:PageDao
Get the page by space and title, and perform an eager load of the comments and their children. This can be used as a performance optimisation when it is known that all comments will be displayed.- Specified by:
getPageWithComments
in interfacePageDao
- Parameters:
space
- The space the page belongs topageTitle
- The title of the page- Returns:
- the page with the given title in the given space, or null if no such page exists
-
remove
public void remove(com.atlassian.core.bean.EntityObject object)
Description copied from interface:ObjectDao
Remove object from persistence.- Specified by:
remove
in interfaceObjectDao
- Specified by:
remove
in interfaceObjectDaoInternal<Page>
-
removeEntity
public void removeEntity(Page objectToRemove)
Description copied from interface:ObjectDaoInternal
Remove object from persistence.- Specified by:
removeEntity
in interfaceObjectDaoInternal<Page>
-
save
public void save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject originalObject)
Description copied from interface:VersionedObjectDao
Saves the given current object and historical object- Specified by:
save
in interfaceVersionedObjectDao<Page>
- Parameters:
objectToSave
- the current object.originalObject
- the original object. This will be mutated to become a historical version as part of this save.
-
saveEntity
public void saveEntity(Page currentObject, @Nullable Page originalObject)
Description copied from interface:VersionedObjectDaoInternal
Saves the given current object and historical object.- Specified by:
saveEntity
in interfaceVersionedObjectDaoInternal<Page>
- Parameters:
currentObject
- the current object.originalObject
- the original object. This will be mutated to become a historical version as part of this save.
-
save
public void save(com.atlassian.core.bean.EntityObject objectToSave)
- Specified by:
save
in interfaceObjectDao
- Specified by:
save
in interfaceObjectDaoInternal<Page>
-
saveEntity
public void saveEntity(Page objectToSave)
Description copied from interface:ObjectDaoInternal
Saves the given object to the database.- Specified by:
saveEntity
in interfaceObjectDaoInternal<Page>
- Parameters:
objectToSave
- the object to save.
-
saveRaw
public void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from interface:ObjectDao
saves the object. if the object is new, this won't set the creation date on the object. if it already exists, then it won't set the date that it was updated.- Specified by:
saveRaw
in interfaceObjectDao
- Specified by:
saveRaw
in interfaceObjectDaoInternal<Page>
- Parameters:
objectToSave
- the object to save.
-
saveRawEntity
public void saveRawEntity(Page objectToSave)
Description copied from interface:ObjectDaoInternal
Saves the object without updating modification daa.If the object is new, this won't set the creation date on the object. If it already exists, then it won't set the date that it was updated.
- Specified by:
saveRawEntity
in interfaceObjectDaoInternal<Page>
- Parameters:
objectToSave
- the object to save.
-
findAll
public @NonNull List<Page> findAll()
Description copied from interface:ObjectDao
Find all objects currently persisted of a particular type.- Specified by:
findAll
in interfaceObjectDao
- Specified by:
findAll
in interfaceObjectDaoInternal<Page>
-
findAllSorted
public @NonNull List<Page> findAllSorted(String s)
Description copied from interface:ObjectDao
Find all objects currently persisted of a particular type and sort results by named property.- Specified by:
findAllSorted
in interfaceObjectDao
- Specified by:
findAllSorted
in interfaceObjectDaoInternal<Page>
- Parameters:
s
- the name of the property to be sorted on. This should be null if no sorting is required.
-
findAllSorted
public @NonNull List<Page> findAllSorted(String s, boolean cached, int firstRow, int maxRows)
Description copied from interface:ObjectDao
Find all objects currently persisted of a particular type and sort results by named property. This version of the method allows more control over the query.- Specified by:
findAllSorted
in interfaceObjectDao
- Specified by:
findAllSorted
in interfaceObjectDaoInternal<Page>
- Parameters:
s
- the name of the property to be sorted on. This should be null if no sorting is required.cached
- control whether the results should be cachedfirstRow
- the index of the first result to be returnedmaxRows
- the maximum number of results required. Use -1 to specify no limit.
-
findByClassIds
@Deprecated public <T> @NonNull PageResponse<T> findByClassIds(Iterable<Long> ids, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super T> filter)
Deprecated.Description copied from interface:ObjectDao
Find a list of objects from the same persistent class.- Specified by:
findByClassIds
in interfaceObjectDao
- Specified by:
findByClassIds
in interfaceObjectDaoInternal<Page>
- Type Parameters:
T
- the type of entity to return- Parameters:
ids
- - the ids of the entities to findlimitedRequest
- the pagination request defining the page size to fetchfilter
- a predicate to do in memory filtering of the result set before returning- Returns:
- a list of objects matching the filters
-
findByClassIdsFiltered
public @NonNull PageResponse<Page> findByClassIdsFiltered(Iterable<Long> ids, LimitedRequest limitedRequest, Predicate<? super Page> filter)
Description copied from interface:ObjectDaoInternal
Find a list of objects from the same persistent class.- Specified by:
findByClassIdsFiltered
in interfaceObjectDaoInternal<Page>
- Parameters:
ids
- - the ids of the entities to findlimitedRequest
- the pagination request defining the page size to fetchfilter
- a predicate to do in memory filtering of the result set before returning- Returns:
- a list of objects matching the filters
-
findLatestVersionsCount
public long findLatestVersionsCount()
Description copied from interface:VersionedObjectDao
Returns the number of results for the latest versions of the current persistent class.- Specified by:
findLatestVersionsCount
in interfaceVersionedObjectDao<Page>
- Returns:
- a long representing the number of results
-
findLatestVersionsIterator
public Iterator<Page> findLatestVersionsIterator()
Description copied from interface:VersionedObjectDao
Returns an iterator for the latest versions of the current persistent class.- Specified by:
findLatestVersionsIterator
in interfaceVersionedObjectDao<Page>
- Returns:
- Iterator
-
findPreviousVersions
public List<ContentEntityObject> findPreviousVersions(long originalContentId)
- Specified by:
findPreviousVersions
in interfaceContentEntityObjectDao<Page>
-
findPagesWithCurrentOrHistoricalTitleInPermittedSpace
public List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
Description copied from interface:PageDao
Searches for pages in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.Only pages in spaces the remote user is able to view will be returned.
- Specified by:
findPagesWithCurrentOrHistoricalTitleInPermittedSpace
in interfacePageDao
pageTitle
- title of a page in a previous version.space
- Space to search. Must not be null.maxResultCount
- maximum pages to return
-
findBlogsWithCurrentOrHistoricalTitleInPermittedSpace
public List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String blogTitle, Space space, int maxResultCount)
Description copied from interface:PageDao
Searches for blogs in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.Only blogs in spaces the remote user is able to view will be returned.
- Specified by:
findBlogsWithCurrentOrHistoricalTitleInPermittedSpace
in interfacePageDao
- Parameters:
permissionQueryBuilder
- required to determine how to construct database queries for space permissions, for the current userblogTitle
- title of a page in a previous version.space
- Space to search. Must not be null.maxResultCount
- maximum pages to return- Returns:
- a list of pages that have the given title in a previous version
-
findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept
public List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder, String blogTitle, Space space, int maxResultCount)
Description copied from interface:PageDao
Searches for blog posts in all spaces except the one specified, looking for those that have the given title in a current or previous version, and returns the first maxResultCount results.Only pages in spaces the remote user is able to view will be returned.
- Specified by:
findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept
in interfacePageDao
blogTitle
- Title of the blog to findspace
- Space to exclude from search. If null, all spaces are searched.maxResultCount
- maximum blog posts to return- Returns:
- a list of blog posts that have or have had the given title
-
findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept
public List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
Description copied from interface:PageDao
Searches for pages in all spaces except the one specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results.Only pages in spaces the remote user is able to view will be returned.
- Specified by:
findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept
in interfacePageDao
pageTitle
- title of a page in a previous version.space
- Space to exclude from search. If null, all spaces are searched.maxResultCount
- maximum pages to return
-
findContentPermissionSummaryByIds
public List<ContentPermissionSummary> findContentPermissionSummaryByIds(Collection<Long> ids)
Description copied from interface:PageDao
Get Content creator for bulk permission checking- Specified by:
findContentPermissionSummaryByIds
in interfacePageDao
- Parameters:
ids
- of Content- Returns:
- list contain information for permission checking
-
getAllCurrentEntities
public Iterator<SpaceContentEntityObject> getAllCurrentEntities()
- Specified by:
getAllCurrentEntities
in interfaceContentEntityObjectDao<Page>
-
getAuthoredPagesCountByUser
public int getAuthoredPagesCountByUser(String username)
- Specified by:
getAuthoredPagesCountByUser
in interfacePageDao
-
getById
public Page getById(long id)
Description copied from interface:ContentEntityObjectDao
Retrieve the object with a particular id from the database. The object must be of the same class as the DAO's getPersistentClass() method returns.- Specified by:
getById
in interfaceContentEntityObjectDao<Page>
- Parameters:
id
- the id of the object to look up- Returns:
- the corresponding object, or null if the object does not exist with the appropriate class and id.
-
getContentAuthoredByUser
public List<ContentEntityObject> getContentAuthoredByUser(String username)
- Specified by:
getContentAuthoredByUser
in interfaceContentEntityObjectDao<Page>
-
getDescendantIds
public List<Long> getDescendantIds(Page page)
Description copied from interface:PageDao
Finds the ids of all descendant pages of the given page- Specified by:
getDescendantIds
in interfacePageDao
- Returns:
- List of page ids
-
getDescendantIds
public List<Long> getDescendantIds(Page page, ContentStatus... statuses)
Description copied from interface:PageDao
Finds the ids of all descendant pages of the given page- Specified by:
getDescendantIds
in interfacePageDao
- Returns:
- List of page ids
-
countPagesInSubtree
public int countPagesInSubtree(@NonNull Page page)
Description copied from interface:PageDao
Return total descendant page including input page- Specified by:
countPagesInSubtree
in interfacePageDao
- Returns:
- total page
-
getDescendants
public List<Page> getDescendants(Page page)
Description copied from interface:PageDao
Finds all descendant pages (recursive) of the given page- Specified by:
getDescendants
in interfacePageDao
- Returns:
- List of descendant pages
-
getDescendantTitles
public List<String> getDescendantTitles(Page page)
Description copied from interface:PageDao
Finds all descendant titles of the given page- Specified by:
getDescendantTitles
in interfacePageDao
- Returns:
- List of descendant titles
-
getFirstVersionAfter
public ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
- Specified by:
getFirstVersionAfter
in interfaceContentEntityObjectDao<Page>
-
getFirstVersionBefore
public ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
- Specified by:
getFirstVersionBefore
in interfaceContentEntityObjectDao<Page>
-
getObjectType
public String getObjectType(long id)
- Specified by:
getObjectType
in interfaceContentEntityObjectDao<Page>
-
getOrphanedPages
public List<Page> getOrphanedPages(String spaceKey)
- Specified by:
getOrphanedPages
in interfacePageDao
-
getPageById
public Page getPageById(long id)
Description copied from interface:PageDao
Get the page with the given id.- Specified by:
getPageById
in interfacePageDao
- Parameters:
id
- of the page to load- Returns:
- the page with the given id, or null if no such page exists
-
getPagesByIds
public List<Page> getPagesByIds(Iterable<Long> ids)
Description copied from interface:PageDao
Get the pages with the given ids.- Specified by:
getPagesByIds
in interfacePageDao
-
getPageByIdWithComments
public Page getPageByIdWithComments(long id)
Description copied from interface:PageDao
Get the page with the given id, and perform an eager load of the comments and their children. This can be used as a performance optimisation when it is known that all comments will be displayed.- Specified by:
getPageByIdWithComments
in interfacePageDao
- Parameters:
id
- of the page to load- Returns:
- the page with the given id, or null if no such page exists
-
getCommentCountOnPage
public int getCommentCountOnPage(long id)
Description copied from interface:PageDao
Count the number of comments on the passed in page.- Specified by:
getCommentCountOnPage
in interfacePageDao
-
getPageInTrash
public List<Page> getPageInTrash(String spaceKey, String title)
- Specified by:
getPageInTrash
in interfacePageDao
-
getAncestorsFor
public Map<Long,List<Long>> getAncestorsFor(Collection<Long> ids)
Description copied from interface:PageDao
Get the list page ids of the ancestors of the given page ids.- Specified by:
getAncestorsFor
in interfacePageDao
- Parameters:
ids
- the list of page ids to get ancestor page ids for- Returns:
- a map where the key is the given page id and the value is a list of all its ancestors' page ids
-
getPagesWithPermissions
public List<Page> getPagesWithPermissions(Space space)
Description copied from interface:PageDao
Get all current pages in a space and eagerly fetch permissions at the same time. This is an optimisation for when you known that permissions will need to be fetched for all or most of the pages later.- Specified by:
getPagesWithPermissions
in interfacePageDao
- Returns:
- a list of all the current pages in a space
-
getPages
@Deprecated public PageResponse<Page> getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
Deprecated.Description copied from interface:PageDao
Retrieves a page response of the current content in the given space.
-
getPages
@Deprecated public PageResponse<Page> getPages(LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
Deprecated.Description copied from interface:PageDao
Retrieves a page response of all the current pages of the Confluence instance.
-
getBlogPosts
@Deprecated public PageResponse<BlogPost> getBlogPosts(Space space, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super BlogPost> filter)
Deprecated.Description copied from interface:PageDao
Retrieves a page response of all the current blog posts in the give space.- Specified by:
getBlogPosts
in interfacePageDao
- Parameters:
space
- the space to locate the blog posts inpageRequest
- the start and offset of the pages to retrievefilter
- the predicate to filter the returned results by, may be null- Returns:
- the paginated list of all the current blog posts by space
-
getPagesCreatedOrUpdatedSinceDate
public List<Page> getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
- Specified by:
getPagesCreatedOrUpdatedSinceDate
in interfacePageDao
-
getPagesStartingWith
public List<Page> getPagesStartingWith(Space space, String s)
- Specified by:
getPagesStartingWith
in interfacePageDao
-
getPermissionPages
public List<Page> getPermissionPages(Space space)
- Specified by:
getPermissionPages
in interfacePageDao
-
getPersistentClass
public Class<Page> getPersistentClass()
Description copied from interface:ObjectDaoInternal
Gets the type ofEntityObject
this Dao works with.- Specified by:
getPersistentClass
in interfaceObjectDao
- Specified by:
getPersistentClass
in interfaceObjectDaoInternal<Page>
- Returns:
- the type
-
getRecentlyAddedEntities
public Iterator<ContentEntityObject> getRecentlyAddedEntities(String spaceKey, int maxResults)
- Specified by:
getRecentlyAddedEntities
in interfaceContentEntityObjectDao<Page>
-
getRecentlyAddedPages
public List<Page> getRecentlyAddedPages(int maxCount, String spaceKey)
- Specified by:
getRecentlyAddedPages
in interfacePageDao
-
getRecentlyAuthoredPagesByUser
public List<Page> getRecentlyAuthoredPagesByUser(String username, int maxCount)
- Specified by:
getRecentlyAuthoredPagesByUser
in interfacePageDao
-
getRecentlyModifiedEntities
public Iterator<ContentEntityObject> getRecentlyModifiedEntities(int maxResults)
- Specified by:
getRecentlyModifiedEntities
in interfaceContentEntityObjectDao<Page>
-
getRecentlyModifiedEntities
public Iterator<SpaceContentEntityObject> getRecentlyModifiedEntities(String spaceKey, int maxResults)
- Specified by:
getRecentlyModifiedEntities
in interfaceContentEntityObjectDao<Page>
-
getRecentlyModifiedEntitiesForUser
public Iterator<ContentEntityObject> getRecentlyModifiedEntitiesForUser(String username)
- Specified by:
getRecentlyModifiedEntitiesForUser
in interfaceContentEntityObjectDao<Page>
-
getRecentlyModifiedForChangeDigest
public List<ContentEntityObject> getRecentlyModifiedForChangeDigest(Date fromDate)
Description copied from interface:ContentEntityObjectDao
Retrieves a list ofContentEntityObject
s that have been newly added or modified since the date specified. This list excludes drafts, space descriptions and mail.- Specified by:
getRecentlyModifiedForChangeDigest
in interfaceContentEntityObjectDao<Page>
- Parameters:
fromDate
- content modified after this date will be returned- Returns:
- a list of
ContentEntityObject
s that have been newly added or modified since the date specified
-
getRecentlyUpdatedPages
public List<Page> getRecentlyUpdatedPages(int maxCount, String spaceKey)
- Specified by:
getRecentlyUpdatedPages
in interfacePageDao
-
getTopLevelPages
public List<Page> getTopLevelPages(Space space)
- Specified by:
getTopLevelPages
in interfacePageDao
-
getTopLevelPages
@Deprecated public PageResponse<Page> getTopLevelPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
Deprecated.- Specified by:
getTopLevelPages
in interfacePageDao
-
getChildren
@Deprecated public PageResponse<Page> getChildren(Page page, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> predicate, Depth depth)
Deprecated.Description copied from interface:PageDao
Returns the children of a page which have a status of CURRENT, limited to the pagination requested.- Specified by:
getChildren
in interfacePageDao
- Parameters:
page
- the page to find children forpageRequest
- the pagination requestedpredicate
- predicate used to entitiesdepth
- the depth to return children to- Returns:
- the paginated response of Page entities
-
getDraftChildren
public PageResponse<Page> getDraftChildren(Page page, LimitedRequest pageRequest, Depth depth)
Description copied from interface:PageDao
Returns the children of a page which have a status of DRAFT, limited to the pagination requested. Will fetch drafts all drafts regardless of whether the current authenticated user has permission to view the drafts- Specified by:
getDraftChildren
in interfacePageDao
- Parameters:
page
- the page to find children forpageRequest
- the pagination requesteddepth
- the depth to return children to- Returns:
- the paginated response of Page entities
-
getAllChildren
public PageResponse<Page> getAllChildren(Page page, LimitedRequest pageRequest, Depth depth)
Description copied from interface:PageDao
Returns all children of a page (including drafts), limited to the pagination requested.- Specified by:
getAllChildren
in interfacePageDao
- Parameters:
page
- the page to find children forpageRequest
- the pagination requesteddepth
- the depth to return children to- Returns:
- the paginated response of Page entities
-
getMaxSiblingPosition
public Integer getMaxSiblingPosition(Page page)
Description copied from interface:PageDao
Gets the highest position value of all the page's siblings. This is useful when we need to find what position to assign to a new page that should go to the bottom.- Specified by:
getMaxSiblingPosition
in interfacePageDao
- Parameters:
page
- The page whose siblings from which to get the max position- Returns:
- The highest position value of all the page's siblings
-
getPageIds
public Collection<Long> getPageIds(Space space)
Description copied from interface:PageDao
Get the ids of all pages (current and historical) in the given space.- Specified by:
getPageIds
in interfacePageDao
- Parameters:
space
- space to retrieve page ids from, can not be null.- Returns:
- a Collection of ids for pages.
-
getAbstractPagesByTitle
@Deprecated public PageResponse<AbstractPage> getAbstractPagesByTitle(String title, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Returns the abstract pages that exactly match the given title, limited to the pagination request. To get just pages or blog posts can be requested just specifying a content type based filter.- Specified by:
getAbstractPagesByTitle
in interfacePageDao
- Parameters:
title
- the title of the page to matchpageRequest
- the pagination requestedfilter
- the predicate to apply to the results before returning- Returns:
- the paginated list of AbstractPages by title
-
getAbstractPagesByCreationDate
@Deprecated public PageResponse<AbstractPage> getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Returns the abstract pages created on the given date, that also match the given filter, limited to the page request. To get just pages or blog posts can be requested just specifying a content type based filter.- Specified by:
getAbstractPagesByCreationDate
in interfacePageDao
- Parameters:
date
- - the creation date to matchpageRequest
- the pagination requestfilter
- the predicate to apply to the results before returning- Returns:
- the paginated list of AbstractPages created on the given date
-
getAbstractPages
@Deprecated public PageResponse<AbstractPage> getAbstractPages(List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Retrieves a page response of all pages found in this instance of Confluence, within any of the given statuses.- Specified by:
getAbstractPages
in interfacePageDao
- Parameters:
contentTypes
- list of content types to findstatuses
- list of statuses the pages can be inpageRequest
- the start and offset of the pages to retrievefilter
- the predicate to filter the returned results by, may be null- Returns:
- the paginated list of pages
-
getAbstractPages
@Deprecated public PageResponse<AbstractPage> getAbstractPages(Space space, List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Retrieves a page response for all content (pages and/or blog posts) in the given space, within any of the specified statuses and content types.- Specified by:
getAbstractPages
in interfacePageDao
- Parameters:
space
- the space to locate the page incontentTypes
- list of content types to findstatuses
- list of statuses the pages can be inpageRequest
- the pagination requestfilter
- the predicate to pages the returned results by, may be null- Returns:
- the paginated list of pages by space, with the given statuses
-
getAbstractPages
@Deprecated public PageResponse<AbstractPage> getAbstractPages(Space space, String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Returns the abstract pages from a space that exactly match the given title and are in any of the specified statuses, and match the given filter, limited to the pagination request. To get just pages or blog posts can be requested just specifying a content type based filter.- Specified by:
getAbstractPages
in interfacePageDao
- Parameters:
space
- space the page belongs totitle
- the title of the page to matchstatuses
- list of statuses the content can be inpageRequest
- the pagination requestedfilter
- the predicate to apply to the results before returning- Returns:
- the paginated list of AbstractPages by space and title, with the given statuses
-
getAbstractPages
@Deprecated public PageResponse<AbstractPage> getAbstractPages(String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Returns the abstract pages that exactly match the given title, are in any of the specified statuses, and match the given filter, limited to the pagination request. To get just pages or blog posts can be requested just specifying a content type based filter.- Specified by:
getAbstractPages
in interfacePageDao
- Parameters:
title
- the title of the page to matchstatuses
- list of statuses the content can be inpageRequest
- the pagination requestedfilter
- the predicate to apply to the results before returning- Returns:
- the paginated list of AbstractPages by title
-
getAbstractPages
@Deprecated public PageResponse<AbstractPage> getAbstractPages(org.joda.time.DateTime date, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDao
Returns the abstract pages created on the given date and are in the , that also match the given filter, limited to the page request. To get just pages or blog posts can be requested just specifying a content type based filter.- Specified by:
getAbstractPages
in interfacePageDao
- Parameters:
date
- the creation date to matchstatuses
- list of statuses the content can be inpageRequest
- the pagination requestfilter
- the predicate to apply to the results before returning- Returns:
- the paginated list of AbstractPages created on the given date
-
getOldestPageCreationDate
public Date getOldestPageCreationDate()
Description copied from interface:ContentEntityObjectDao
Gets the creation date of the oldest page.- Specified by:
getOldestPageCreationDate
in interfaceContentEntityObjectDao<Page>
- Returns:
- creation date of the oldest page in Confluence
-
getTrashedContent
public List<ContentEntityObject> getTrashedContent(String spaceKey)
- Specified by:
getTrashedContent
in interfaceContentEntityObjectDao<Page>
-
getTrashedContents
public List<ContentEntityObject> getTrashedContents(String spaceKey, int offset, int limit)
- Specified by:
getTrashedContents
in interfaceContentEntityObjectDao<Page>
-
getUndefinedPages
public List<Page> getUndefinedPages(String spaceKey)
- Specified by:
getUndefinedPages
in interfacePageDao
-
getUndefinedLinks
public final List<OutgoingLink> getUndefinedLinks(@Nullable String spaceKey)
- Specified by:
getUndefinedLinks
in interfacePageDao
-
getVersion
public ContentEntityObject getVersion(long originalVersionContentId, int version)
- Specified by:
getVersion
in interfaceContentEntityObjectDao<Page>
-
getVersionHistorySummary
public List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
- Specified by:
getVersionHistorySummary
in interfaceContentEntityObjectDao<Page>
-
getVersionHistorySummary
public PageResponse<VersionHistorySummary> getVersionHistorySummary(long originalContentId, LimitedRequest request)
Description copied from interface:ContentEntityObjectDao
Get version history with pagination. So we don't have issue with super long history.- Specified by:
getVersionHistorySummary
in interfaceContentEntityObjectDao<Page>
- Parameters:
originalContentId
- the content Id of latest version, the CURRENT versionrequest
- page request contains start, limit fields for pagination purpose.- Returns:
- PageResponse of version history.
-
getVersionEditContributors
public Map<Long,List<ConfluenceUser>> getVersionEditContributors(Iterable<Page> originalVersions)
Description copied from interface:ContentEntityObjectDao
Get version edit contributors for a set of content identifiers. This returns the last modified of all versions of the content.- Specified by:
getVersionEditContributors
in interfaceContentEntityObjectDao<Page>
- Parameters:
originalVersions
- the contents of latest versions, the CURRENT versions- Returns:
- A map between content if and list of contributor users (null indicates anonymous).
-
getAllModifiers
public Set<ConfluenceUser> getAllModifiers(Page page)
Description copied from interface:ContentEntityObjectDao
Get the Set of allConfluenceUser
that have modified (contributed) a content. This includes users for existing and deleted historical versions.- Specified by:
getAllModifiers
in interfaceContentEntityObjectDao<Page>
- Parameters:
page
- the content for which contributions have been made- Returns:
- a Set of
ConfluenceUser
that have contributed to the content
-
getAllModifiers
public Map<Long,Set<ConfluenceUser>> getAllModifiers(Collection<Long> contentIds)
Description copied from interface:ContentEntityObjectDao
Get the Set of allConfluenceUser
that have modified (contributed) content. This includes users for existing and deleted historical versions.- Specified by:
getAllModifiers
in interfaceContentEntityObjectDao<Page>
- Parameters:
contentIds
- the content IDs of interest- Returns:
- a
Map
of content IDs to aSet
ofConfluenceUser
that have contributed to the content
-
getVersionsLastEditedByUser
public Map<Long,ContentEntityObject> getVersionsLastEditedByUser(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Description copied from interface:ContentEntityObjectDao
Gets theContentEntityObject
objects, either the current version or historical version relating to given contentIds of the current version that was the most recent version edited by the given user. Only content with a "current" status are returned.- Specified by:
getVersionsLastEditedByUser
in interfaceContentEntityObjectDao<Page>
- Parameters:
contentIds
- the ids of the content we're interested in. These *must* be ids of the latest version.userKey
- the userKey of the user that we're interested in- Returns:
- the
ContentEntityObject
objects relating to the version of the given contentIds that were last edited by the given user.
-
getVersionsLastEditedByUserNew
public Map<Long,ContentEntityObject> getVersionsLastEditedByUserNew(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Description copied from interface:ContentEntityObjectDao
Same asContentEntityObjectDao.getVersionsLastEditedByUser(Collection, UserKey)
, but a refined implementation for new Recently Worked On Drafts work. TODO: replaceContentEntityObjectDao.getVersionsLastEditedByUser(Collection, UserKey)
with the implementation of this method- Specified by:
getVersionsLastEditedByUserNew
in interfaceContentEntityObjectDao<Page>
-
getContributionStatusByUser
public Map<Long,ContributionStatus> getContributionStatusByUser(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Description copied from interface:ContentEntityObjectDao
Identifies the most recent contributions made to a Collection of content by the given user. A contribution can either be a page publish, unpublished changes to a draft or anything that triggers a touch relation.It takes a Collection of contentIds and returns a Map of contentIds to ContributionStatuses for the supplied Ids.
If non existing ContentIds are used, they will not be present in the returned Map. If no contribution status can be found for the supplied contentIds, they will not be present in the returned Map.
Anonymous users are not supported.
- Specified by:
getContributionStatusByUser
in interfaceContentEntityObjectDao<Page>
- Parameters:
contentIds
- the IDs of the content we want to query. These *must* be IDs of the latest versionuserKey
- the userKey of the user who's changes we are interested in- Returns:
- the
ContributionStatus
of each content
-
refresh
public void refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
Description copied from interface:ObjectDao
Refreshes the object again with the fresh data from db.- Specified by:
refresh
in interfaceObjectDao
- Specified by:
refresh
in interfaceObjectDaoInternal<Page>
-
refreshEntity
public void refreshEntity(Page objectToRefresh)
Description copied from interface:ObjectDaoInternal
Refreshes the object again with the fresh data from db.- Specified by:
refreshEntity
in interfaceObjectDaoInternal<Page>
-
replicate
public void replicate(Object objectToReplicate)
Description copied from interface:ObjectDao
Replicate the object. Replication does not generate a new id if the object does not exist in database and it overwrites the database row if the object already exists in database.- Specified by:
replicate
in interfaceObjectDao
- Specified by:
replicate
in interfaceObjectDaoInternal<Page>
-
replicateEntity
public void replicateEntity(Page objectToReplicate)
Description copied from interface:ObjectDaoInternal
Replicate the object. Replication does not generate a new id if the object does not exist in database and it overwrites the database row if the object already exists in database.- Specified by:
replicateEntity
in interfaceObjectDaoInternal<Page>
-
getLastEditedVersionsOf
public List<Page> getLastEditedVersionsOf(Page content)
Description copied from interface:ContentEntityObjectDao
Retrieves all the last edited versions for each user who has contributed to the specified piece of content. That is, if a user has contributed multiple edits, only the version that corresponds to their latest edit will be added to the list returned. Result will be sorted with the earliest version coming first.- Specified by:
getLastEditedVersionsOf
in interfaceContentEntityObjectDao<Page>
- Parameters:
content
- content (must be the latest version)- Returns:
- the last edited versions for each user who has contributed to the specified piece of content.
-
findContentBySpaceIdAndStatus
public List<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, int offset, int count)
Description copied from interface:ContentEntityObjectDao
Retrieve content for a given space with a particular status. Results will be sorted by descending date of last modification.- Specified by:
findContentBySpaceIdAndStatus
in interfaceContentEntityObjectDao<Page>
- Parameters:
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g.ContentEntityObject.DELETED
offset
- the offset of the first item to retrieve (0-based)count
- the maximum number of items to retrieve- Returns:
- the list of content matching the query
-
findContentBySpaceIdAndStatus
@Deprecated public PageResponse<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super SpaceContentEntityObject> predicate)
Deprecated.Description copied from interface:ContentEntityObjectDao
Retrieve content for a given space with a particular status. Results will be sorted by descending date of last modification.- Specified by:
findContentBySpaceIdAndStatus
in interfaceContentEntityObjectDao<Page>
- Parameters:
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g.ContentEntityObject.DELETED
limitedRequest
- - the start and offset of the pages to retrievepredicate
- - a predicate to filter the returned results by- Returns:
- a PageResponse of ContentEntityObjects in the space with the given status
-
countContentBySpaceIdAndStatus
public int countContentBySpaceIdAndStatus(long spaceId, String status)
Description copied from interface:ContentEntityObjectDao
Retrieve the count of content for a given space with a particular status.- Specified by:
countContentBySpaceIdAndStatus
in interfaceContentEntityObjectDao<Page>
- Parameters:
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g.ContentEntityObject.DELETED
- Returns:
- the number of content objects with that status in that space
-
findHistoricalVersionsAfterVersion
public List<ContentEntityObject> findHistoricalVersionsAfterVersion(long originalContentId, int version)
- Specified by:
findHistoricalVersionsAfterVersion
in interfaceContentEntityObjectDao<Page>
-
findAllDraftsFor
public List<ContentEntityObject> findAllDraftsFor(long contentId)
Description copied from interface:ContentEntityObjectDao
Retrieves a list of drafts for the given content if any drafts exist.- Specified by:
findAllDraftsFor
in interfaceContentEntityObjectDao<Page>
- Parameters:
contentId
- id of the content to retrieve the draft for- Returns:
- a non-null list of drafts, with 0 or more elements.
- See Also:
ContentEntityObject.DRAFT
-
findAllLegacyDraftsFor
public List<Draft> findAllLegacyDraftsFor(long contentId)
Description copied from interface:ContentEntityObjectDao
Retrieves a list of Legacy drafts for the given content if any exist.- Specified by:
findAllLegacyDraftsFor
in interfaceContentEntityObjectDao<Page>
- Parameters:
contentId
- id of the content to retrieve the draft for- Returns:
- a non-null list of drafts, with 0 or more elements.
- See Also:
Draft
-
findDraftFor
public ContentEntityObject findDraftFor(long contentId)
Description copied from interface:ContentEntityObjectDao
Retrieves the draft for the given content if exists.- Specified by:
findDraftFor
in interfaceContentEntityObjectDao<Page>
- Parameters:
contentId
- id of the content to retrieve the draft for- Returns:
- the draft for the given content if exists, null otherwise
- See Also:
ContentEntityObject.DRAFT
-
getPageAndBlogPostsVersionsLastEditedByUser
public PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
Description copied from interface:ContentEntityObjectDao
Retrieve a page of entities, either the current version or historical version, that have been modified by the user, in order of the user's most recent modification. Only content with a "current" status are returned.- Specified by:
getPageAndBlogPostsVersionsLastEditedByUser
in interfaceContentEntityObjectDao<Page>
- Parameters:
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the request
-
getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts
public PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
Description copied from interface:ContentEntityObjectDao
Retrieve a page of entities, either the current version or historical version, that have been modified by the user, in order of the user's most recent modification. Only content with "current" or "draft" status are returned.- Specified by:
getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts
in interfaceContentEntityObjectDao<Page>
- Parameters:
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the request
-
findUnpublishedContentWithUserContributions
public List<ContentEntityObject> findUnpublishedContentWithUserContributions(String username)
Description copied from interface:ContentEntityObjectDao
Retrieves the drafts for the givenUser
. IMPORTANT: this method doesn't return published shared drafts, only personal drafts and unpublished shared drafts- Specified by:
findUnpublishedContentWithUserContributions
in interfaceContentEntityObjectDao<Page>
- Parameters:
username
- the owner of the drafts- Returns:
- a list of
ContentEntityObject
with theContentEntityObject.DRAFT
status
-
findDraftsWithUnpublishedChangesForUser
public List<ContentEntityObject> findDraftsWithUnpublishedChangesForUser(String creatorName)
Description copied from interface:ContentEntityObjectDao
Retrieves the drafts for the givenUser
, which contains unpublished changes- Specified by:
findDraftsWithUnpublishedChangesForUser
in interfaceContentEntityObjectDao<Page>
- Parameters:
creatorName
- the owner of the drafts- Returns:
- a list of drafts (
ContentEntityObject
objects)
-
countAllPages
public int countAllPages()
Description copied from interface:PageDao
Counts the total number of all page entities across all spaces, including non-current pages- Specified by:
countAllPages
in interfacePageDao
- Returns:
- the number of pages
-
getPageStatistics
public Optional<PageStatisticsDTO> getPageStatistics()
Description copied from interface:PageDao
Fetches statistics about pages- Specified by:
getPageStatistics
in interfacePageDao
- Returns:
- a PageStatisticsDTO with information about pages such as total, current, and draft count
-
countCurrentPages
public int countCurrentPages()
Description copied from interface:PageDao
Counts the total number of current pages across all spaces- Specified by:
countCurrentPages
in interfacePageDao
- Returns:
- the number of current pages
-
findCurrentPages
public PageResponse<Page> findCurrentPages(LimitedRequest request)
Description copied from interface:PageDaoInternal
Find all current pages.- Specified by:
findCurrentPages
in interfacePageDaoInternal
- Parameters:
request
- the limited pagination request.- Returns:
- a pagination response of the current pages.
-
getPermissionPages
public Collection<Page> getPermissionPages(Space space, LimitedRequest requeste)
Description copied from interface:PageDaoInternal
Pagination permission pages for particular Space- Specified by:
getPermissionPages
in interfacePageDaoInternal
- Returns:
- Collection of permission pages within the request range
-
getPermissionPagesCount
public long getPermissionPagesCount(Space space)
Description copied from interface:PageDaoInternal
Get total number of permission pages for particular Space- Specified by:
getPermissionPagesCount
in interfacePageDaoInternal
- Returns:
- the count
-
countDraftPages
public int countDraftPages()
Description copied from interface:PageDao
Counts the number of pages that are drafts. This does not include drafts of pages that have already been published (i.e. pages with unpublished changes).- Specified by:
countDraftPages
in interfacePageDao
- Returns:
- the number of draft pages
-
countPagesWithUnpublishedChanges
public int countPagesWithUnpublishedChanges()
Description copied from interface:PageDao
Counts the number of published pages that have unpublished changes.- Specified by:
countPagesWithUnpublishedChanges
in interfacePageDao
- Returns:
- the number of pages with unpublished changes.
-
getPageCount
public long getPageCount(@NonNull String spaceKey)
Description copied from interface:PageDao
Get total number of current pages in a space- Specified by:
getPageCount
in interfacePageDao
- Parameters:
spaceKey
- the space to look for pages in- Returns:
- a count number of pages
-
getPageCount
public long getPageCount(@NonNull String spaceKey, List<ContentStatus> statuses)
Description copied from interface:PageDao
Get total number of pages in a space, within any of the given statuses.- Specified by:
getPageCount
in interfacePageDao
- Parameters:
spaceKey
- the space to look for pages instatuses
- list of statuses the pages can be in- Returns:
- a count number of pages
-
getTrashedEntities
public List<SpaceContentEntityObject> getTrashedEntities(long contentIdOffset, int limit)
Description copied from interface:ContentEntityObjectDaoInternal
Retrieve a batch of trashed content entities- Specified by:
getTrashedEntities
in interfaceContentEntityObjectDaoInternal<Page>
- Parameters:
contentIdOffset
- ids of returned entities must be greater than or equal to this valuelimit
- maximum number of entities to return
-
saveRawWithoutReindex
public void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from interface:ContentEntityObjectDaoInternal
This is for internal use only, Do not rely on it as a public API.
Perform a saveRaw but without performing the re-index; it is unnecessary in the context of a migration or upgrade.
- Specified by:
saveRawWithoutReindex
in interfaceContentEntityObjectDaoInternal<Page>
-
scanFilteredPages
public @NonNull PageResponse<Page> scanFilteredPages(List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable Predicate<? super Page> filter)
Description copied from interface:PageDaoInternal
Retrieves a page response of all the pages with specified content statuses.- Specified by:
scanFilteredPages
in interfacePageDaoInternal
- Parameters:
statuses
- list of content status which we are interested to fetchpageRequest
- limit and cursor of the pages to retrieve. Cursor in pageRequest can't be null.filter
- the predicate to filter the returned results by, may be null- Returns:
- the paginated list of pages
-
scanFilteredPages
public @NonNull PageResponse<Page> scanFilteredPages(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable Predicate<? super Page> filter)
Description copied from interface:PageDaoInternal
Retrieves a page response of all pages in space with specified content statuses.- Specified by:
scanFilteredPages
in interfacePageDaoInternal
- Parameters:
space
- the space to locate the page instatuses
- content status to matchpageRequest
- limit and cursor of the pages to retrieve. Cursor in pageRequest can't be null.filter
- the predicate to filter the returned results by, may be null- Returns:
- the paginated list of pages
-
-