Class HibernatePageDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T>
-
- com.atlassian.confluence.internal.persistence.hibernate.AbstractContentEntityObjectHibernateDao<Page>
-
- com.atlassian.confluence.pages.persistence.dao.hibernate.HibernatePageDao
-
- All Implemented Interfaces:
ObjectDao,ContentEntityObjectDao<Page>,VersionedObjectDao<Page>,PageDaoInternal,ContentEntityObjectDaoInternal<Page>,ObjectDaoInternal<Page>,VersionedObjectDaoInternal<Page>,PageDao,org.springframework.beans.factory.InitializingBean
public class HibernatePageDao extends AbstractContentEntityObjectHibernateDao<Page> implements PageDaoInternal
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
-
-
Constructor Summary
Constructors Constructor Description HibernatePageDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcountAllPages()Counts the total number of all page entities across all spaces, including non-current pagesintcountCurrentPages()Counts the total number of current pages across all spacesintcountDraftPages()Counts the number of pages that are drafts.intcountPagesInSubtree(@NonNull Page page)Return total descendant page including input pageintcountPagesWithUnpublishedChanges()Counts the number of published pages that have unpublished changes.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.List<ContentPermissionSummary>findContentPermissionSummaryByIds(Collection<Long> ids)Get Content creator for bulk permission checkingPageResponse<Page>findCurrentPages(LimitedRequest request)Find all current pages.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.PageResponse<AbstractPage>getAbstractPages(Space space, String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<AbstractPage>getAbstractPages(Space space, List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<AbstractPage>getAbstractPages(String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<AbstractPage>getAbstractPages(List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<AbstractPage>getAbstractPages(org.joda.time.DateTime date, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<AbstractPage>getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<AbstractPage>getAbstractPagesByTitle(String title, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super AbstractPage> filter)Deprecated.since 7.0.1.PageResponse<Page>getAllChildren(Page page, LimitedRequest pageRequest, Depth depth)Returns all children of a page (including drafts), limited to the pagination requested.Map<Long,List<Long>>getAncestorsFor(Collection<Long> ids)Get the list page ids of the ancestors of the given page ids.intgetAuthoredPagesCountByUser(String username)PageResponse<BlogPost>getBlogPosts(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super BlogPost> filter)Deprecated.since 7.0.1.PageResponse<Page>getChildren(Page page, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> predicate, Depth depth)Deprecated.since 7.0.1.intgetCommentCountOnPage(long id)Count the number of comments on the passed in page.List<Long>getDescendantIds(Page page)Finds the ids of all descendant pages of the given pageList<Long>getDescendantIds(Page page, ContentStatus... contentStatus)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.IntegergetMaxSiblingPosition(Page page)Gets the highest position value of all the page's siblings.DategetOldestPageCreationDate()Gets the creation date of the oldest page.List<Page>getOrphanedPages(@Nullable String spaceKey)PagegetPage(Space space, String pageTitle)Get the page by space and title.PagegetPage(Space space, String pageTitle, boolean eagerLoadComments)PagegetPageById(long id)Get the page with the given id.PagegetPageByIdWithComments(long id)Get the page with the given id, and perform an eager load of the comments and their children.longgetPageCount(@NonNull String spaceKey)Get total number of current pages in a spacelonggetPageCount(@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.since 7.0.1.PageResponse<Page>getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)Deprecated.since 7.0.1.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(@NonNull Space space)Get all current pages in a space and eagerly fetch permissions at the same time.PagegetPageWithComments(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 limitedRequest)Pagination permission pages for particular SpacelonggetPermissionPagesCount(Space space)Get total number of permission pages for particular SpaceClassgetPersistentClass()Gets the type ofEntityObjectthis Dao works with.List<Page>getRecentlyAddedPages(int maxCount, @Nullable String spaceKey)List<Page>getRecentlyAuthoredPagesByUser(String username, int maxCount)List<Page>getRecentlyUpdatedPages(int maxCount, @Nullable String spaceKey)List<Page>getTopLevelPages(Space space)PageResponse<Page>getTopLevelPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)Deprecated.since 7.0.1.List<OutgoingLink>getUndefinedLinks(@Nullable String spaceKey)List<Page>getUndefinedPages(@Nullable String spaceKey)Deprecated.since 6.6.0, usegetUndefinedLinks(String)voidsaveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)This is for internal use only, Do not rely on it as a public API.PageResponse<Page>scanFilteredPages(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Page> filter)Retrieves a page response of all pages in space with specified content statuses.PageResponse<Page>scanFilteredPages(List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Page> filter)Retrieves a page response of all the pages with specified content statuses.-
Methods inherited from class com.atlassian.confluence.internal.persistence.hibernate.AbstractContentEntityObjectHibernateDao
countContentBySpaceIdAndStatus, findAllDraftsFor, findAllLegacyDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getAllModifiers, getByClassId, getById, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getPagesByCursor, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getTrashedContents, getTrashedContents, getTrashedEntities, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
-
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
countContentBySpaceIdAndStatus, findAllDraftsFor, findAllLegacyDraftsFor, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findPreviousVersions, findUnpublishedContentWithUserContributions, getAllCurrentEntities, getAllModifiers, getAllModifiers, getById, getContentAuthoredByUser, getContributionStatusByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getObjectType, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getTrashedContents, getTrashedContents, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ContentEntityObjectDaoInternal
findContentBySpaceIdAndStatusAndFilter, getTrashedEntities
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ObjectDaoInternal
findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
-
Methods inherited from interface com.atlassian.confluence.internal.pages.persistence.PageDaoInternal
getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPagesByCreationDate, getFilteredAbstractPagesByTitle, getFilteredBlogPosts, getFilteredChildren, getFilteredPages, getFilteredPages, getFilteredTopLevelPages
-
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.VersionedObjectDaoInternal
saveEntity
-
-
-
-
Method Detail
-
getPageById
public Page getPageById(long id)
Description copied from interface:PageDaoGet the page with the given id.- Specified by:
getPageByIdin 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:PageDaoGet the pages with the given ids.- Specified by:
getPagesByIdsin interfacePageDao
-
getCommentCountOnPage
public int getCommentCountOnPage(long id)
Description copied from interface:PageDaoCount the number of comments on the passed in page.- Specified by:
getCommentCountOnPagein interfacePageDao
-
getPageByIdWithComments
public Page getPageByIdWithComments(long id)
Description copied from interface:PageDaoGet 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:
getPageByIdWithCommentsin interfacePageDao- Parameters:
id- of the page to load- Returns:
- the page with the given id, or null if no such page exists
-
getPageWithComments
public Page getPageWithComments(Space space, String pageTitle)
Description copied from interface:PageDaoGet 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:
getPageWithCommentsin 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
-
getPage
public Page getPage(Space space, String pageTitle)
Description copied from interface:PageDaoGet the page by space and title.
-
getPagesWithPermissions
public List<Page> getPagesWithPermissions(@NonNull Space space)
Description copied from interface:PageDaoGet 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:
getPagesWithPermissionsin interfacePageDao- Returns:
- a list of all the current pages in a space
-
getPages
@Deprecated public PageResponse<Page> getPages(LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
Deprecated.Description copied from interface:PageDaoRetrieves a page response of all the current pages of the Confluence instance.
-
getPages
@Deprecated public PageResponse<Page> getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
Deprecated.Description copied from interface:PageDaoRetrieves a page response of the current content in the given space.
-
getBlogPosts
@Deprecated public PageResponse<BlogPost> getBlogPosts(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super BlogPost> filter)
Deprecated.Description copied from interface:PageDaoRetrieves a page response of all the current blog posts in the give space.- Specified by:
getBlogPostsin interfacePageDao- Parameters:
space- the space to locate the blog posts inlimitedRequest- 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
-
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:PageDaoRetrieves 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:
getAbstractPagesin 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(List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDaoRetrieves a page response of all pages found in this instance of Confluence, within any of the given statuses.- Specified by:
getAbstractPagesin 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
-
getPageIds
public Collection<Long> getPageIds(Space space)
Description copied from interface:PageDaoGet the ids of all pages (current and historical) in the given space.- Specified by:
getPageIdsin 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 limitedRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDaoReturns 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:
getAbstractPagesByTitlein interfacePageDao- Parameters:
title- the title of the page to matchlimitedRequest- 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:PageDaoReturns 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:
getAbstractPagesByCreationDatein 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(Space space, String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.Description copied from interface:PageDaoReturns 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:
getAbstractPagesin 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:PageDaoReturns 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:
getAbstractPagesin 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:PageDaoReturns 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:
getAbstractPagesin 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
-
getPagesStartingWith
public List<Page> getPagesStartingWith(Space space, String s)
- Specified by:
getPagesStartingWithin interfacePageDao
-
getRecentlyAddedPages
public List<Page> getRecentlyAddedPages(int maxCount, @Nullable String spaceKey)
- Specified by:
getRecentlyAddedPagesin interfacePageDao
-
getRecentlyUpdatedPages
public List<Page> getRecentlyUpdatedPages(int maxCount, @Nullable String spaceKey)
- Specified by:
getRecentlyUpdatedPagesin interfacePageDao
-
getOrphanedPages
public List<Page> getOrphanedPages(@Nullable String spaceKey)
- Specified by:
getOrphanedPagesin interfacePageDao
-
getUndefinedPages
@Deprecated public List<Page> getUndefinedPages(@Nullable String spaceKey)
Deprecated.since 6.6.0, usegetUndefinedLinks(String)- Specified by:
getUndefinedPagesin interfacePageDao
-
getUndefinedLinks
public final List<OutgoingLink> getUndefinedLinks(@Nullable String spaceKey)
- Specified by:
getUndefinedLinksin interfacePageDao
-
getPermissionPages
public List<Page> getPermissionPages(Space space)
- Specified by:
getPermissionPagesin interfacePageDao
-
getPermissionPages
public Collection<Page> getPermissionPages(Space space, LimitedRequest limitedRequest)
Description copied from interface:PageDaoInternalPagination permission pages for particular Space- Specified by:
getPermissionPagesin interfacePageDaoInternal- Returns:
- Collection of permission pages within the request range
-
getPermissionPagesCount
public long getPermissionPagesCount(Space space)
Description copied from interface:PageDaoInternalGet total number of permission pages for particular Space- Specified by:
getPermissionPagesCountin interfacePageDaoInternal- Returns:
- the count
-
getAuthoredPagesCountByUser
public int getAuthoredPagesCountByUser(String username)
- Specified by:
getAuthoredPagesCountByUserin interfacePageDao
-
getRecentlyAuthoredPagesByUser
public List<Page> getRecentlyAuthoredPagesByUser(String username, int maxCount)
- Specified by:
getRecentlyAuthoredPagesByUserin interfacePageDao
-
getPagesCreatedOrUpdatedSinceDate
public List<Page> getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
- Specified by:
getPagesCreatedOrUpdatedSinceDatein interfacePageDao
-
getPersistentClass
public Class getPersistentClass()
Description copied from interface:ObjectDaoInternalGets the type ofEntityObjectthis Dao works with.- Specified by:
getPersistentClassin interfaceObjectDao- Specified by:
getPersistentClassin interfaceObjectDaoInternal<Page>- Returns:
- the type
-
findPagesWithCurrentOrHistoricalTitleInPermittedSpace
public List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
Description copied from interface:PageDaoSearches 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:
findPagesWithCurrentOrHistoricalTitleInPermittedSpacein interfacePageDaopageTitle- 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:PageDaoSearches 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:
findBlogsWithCurrentOrHistoricalTitleInPermittedSpacein 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:PageDaoSearches 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:
findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExceptin interfacePageDaoblogTitle- 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:PageDaoSearches 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:
findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExceptin interfacePageDaopageTitle- 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:PageDaoGet Content creator for bulk permission checking- Specified by:
findContentPermissionSummaryByIdsin interfacePageDao- Parameters:
ids- of Content- Returns:
- list contain information for permission checking
-
countCurrentPages
public int countCurrentPages()
Description copied from interface:PageDaoCounts the total number of current pages across all spaces- Specified by:
countCurrentPagesin interfacePageDao- Returns:
- the number of current pages
-
findCurrentPages
public PageResponse<Page> findCurrentPages(LimitedRequest request)
Description copied from interface:PageDaoInternalFind all current pages.- Specified by:
findCurrentPagesin interfacePageDaoInternal- Parameters:
request- the limited pagination request.- Returns:
- a pagination response of the current pages.
-
countDraftPages
public int countDraftPages()
Description copied from interface:PageDaoCounts 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:
countDraftPagesin interfacePageDao- Returns:
- the number of draft pages
-
countPagesWithUnpublishedChanges
public int countPagesWithUnpublishedChanges()
Description copied from interface:PageDaoCounts the number of published pages that have unpublished changes.- Specified by:
countPagesWithUnpublishedChangesin interfacePageDao- Returns:
- the number of pages with unpublished changes.
-
getPageCount
public long getPageCount(@NonNull String spaceKey)
Description copied from interface:PageDaoGet total number of current pages in a space- Specified by:
getPageCountin 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:PageDaoGet total number of pages in a space, within any of the given statuses.- Specified by:
getPageCountin interfacePageDao- Parameters:
spaceKey- the space to look for pages instatuses- list of statuses the pages can be in- Returns:
- a count number of pages
-
getPageStatistics
public Optional<PageStatisticsDTO> getPageStatistics()
Description copied from interface:PageDaoFetches statistics about pages- Specified by:
getPageStatisticsin interfacePageDao- Returns:
- a PageStatisticsDTO with information about pages such as total, current, and draft count
-
countAllPages
public int countAllPages()
Description copied from interface:PageDaoCounts the total number of all page entities across all spaces, including non-current pages- Specified by:
countAllPagesin interfacePageDao- Returns:
- the number of pages
-
getPageInTrash
public List<Page> getPageInTrash(String spaceKey, String title)
- Specified by:
getPageInTrashin interfacePageDao
-
getDescendants
public List<Page> getDescendants(Page page)
Description copied from interface:PageDaoFinds all descendant pages (recursive) of the given page- Specified by:
getDescendantsin interfacePageDao- Returns:
- List of descendant pages
-
countPagesInSubtree
public int countPagesInSubtree(@NonNull Page page)
Description copied from interface:PageDaoReturn total descendant page including input page- Specified by:
countPagesInSubtreein interfacePageDao- Returns:
- total page
-
getAncestorsFor
public Map<Long,List<Long>> getAncestorsFor(Collection<Long> ids)
Description copied from interface:PageDaoGet the list page ids of the ancestors of the given page ids.- Specified by:
getAncestorsForin 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
-
getDescendantTitles
public List<String> getDescendantTitles(Page page)
Description copied from interface:PageDaoFinds all descendant titles of the given page- Specified by:
getDescendantTitlesin interfacePageDao- Returns:
- List of descendant titles
-
getDescendantIds
public List<Long> getDescendantIds(Page page)
Description copied from interface:PageDaoFinds the ids of all descendant pages of the given page- Specified by:
getDescendantIdsin interfacePageDao- Returns:
- List of page ids
-
getDescendantIds
public List<Long> getDescendantIds(Page page, ContentStatus... contentStatus)
Description copied from interface:PageDaoFinds the ids of all descendant pages of the given page- Specified by:
getDescendantIdsin interfacePageDao- Returns:
- List of page ids
-
getTopLevelPages
public List<Page> getTopLevelPages(Space space)
- Specified by:
getTopLevelPagesin interfacePageDao
-
getTopLevelPages
@Deprecated public PageResponse<Page> getTopLevelPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
Deprecated.- Specified by:
getTopLevelPagesin 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:PageDaoReturns the children of a page which have a status of CURRENT, limited to the pagination requested.- Specified by:
getChildrenin 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:PageDaoReturns 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:
getDraftChildrenin 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:PageDaoReturns all children of a page (including drafts), limited to the pagination requested.- Specified by:
getAllChildrenin 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:PageDaoGets 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:
getMaxSiblingPositionin 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
-
getOldestPageCreationDate
public Date getOldestPageCreationDate()
Description copied from interface:ContentEntityObjectDaoGets the creation date of the oldest page.- Specified by:
getOldestPageCreationDatein interfaceContentEntityObjectDao<Page>- Overrides:
getOldestPageCreationDatein classAbstractContentEntityObjectHibernateDao<Page>- Returns:
- creation date of the oldest page in Confluence
-
saveRawWithoutReindex
public void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from interface:ContentEntityObjectDaoInternalThis 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:
saveRawWithoutReindexin interfaceContentEntityObjectDaoInternal<Page>
-
scanFilteredPages
public PageResponse<Page> scanFilteredPages(List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Page> filter)
Description copied from interface:PageDaoInternalRetrieves a page response of all the pages with specified content statuses.- Specified by:
scanFilteredPagesin 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 PageResponse<Page> scanFilteredPages(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, Predicate<? super Page> filter)
Description copied from interface:PageDaoInternalRetrieves a page response of all pages in space with specified content statuses.- Specified by:
scanFilteredPagesin 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
-
-