com.atlassian.confluence.pages.persistence.dao
Interface PageDao

All Superinterfaces:
ContentEntityObjectDao, ObjectDao, VersionedObjectDao
All Known Implementing Classes:
CachingPageDao, HibernatePageDao

public interface PageDao
extends ContentEntityObjectDao


Field Summary
 
Fields inherited from interface bucket.core.persistence.ObjectDao
NON_CACHEABLE
 
Method Summary
 List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(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(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<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(String blogTitle, Space space, int maxResultCount)
          Deprecated. since 5.6.1. Use findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(String, com.atlassian.confluence.spaces.Space, int)
 List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(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(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<Page> findPagesWithHistoricalTitle(String pageTitle)
          Deprecated. since 3.1. Use #findPagesWithHistoricalTitleInPermittedSpace or #findPagesWithHistoricalTitleInAllPermittedSpacesExcept .
 List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(String pageTitle, Space space, int maxResultCount)
          Deprecated. since 5.6.1. Use findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(String, com.atlassian.confluence.spaces.Space, int)
 List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(String pageTitle, Space space, int maxResultCount)
          Deprecated. since 5.6.1. Use findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(String, com.atlassian.confluence.spaces.Space, int)
 PageResponse<AbstractPage> getAbstractPages(org.joda.time.DateTime date, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          Returns the abstract pages created on the given date and are in the , that also match the given filter, limited to the page request.
 PageResponse<AbstractPage> getAbstractPages(List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          Retrieves a page response of all pages found in this instance of Confluence, within any of the given statuses.
 PageResponse<AbstractPage> getAbstractPages(Space space, List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          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.
 PageResponse<AbstractPage> getAbstractPages(Space space, String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          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.
 PageResponse<AbstractPage> getAbstractPages(String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          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.
 PageResponse<AbstractPage> getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          Returns the abstract pages created on the given date, that also match the given filter, limited to the page request.
 PageResponse<AbstractPage> getAbstractPagesByTitle(String title, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          Returns the abstract pages that exactly match the given title, limited to the pagination request.
 int getAuthoredPagesCountByUser(String username)
           
 PageResponse<BlogPost> getBlogPosts(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super BlogPost> filter)
          Retrieves a page response of all the current blog posts in the give space.
 PageResponse<Page> getChildren(Page page, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> predicate, Depth depth)
           
 int getCommentCountOnPage(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 page
 List<Page> getDescendants(Page page)
          Finds all descendant pages (recursive) of the given page
 List<String> getDescendantTitles(Page page)
          Finds all descendant titles of the given page
 List<Long> getDescendentIds(Page page)
          Deprecated. since 5.5.1. Use getDescendantIds(com.atlassian.confluence.pages.Page)
 List<Page> getDescendents(Page page)
          Deprecated. since 5.5.1. Use getDescendants(com.atlassian.confluence.pages.Page)
 Integer getMaxSiblingPosition(Page page)
          Gets the highest position value of all the page's siblings.
 List<Page> getOrphanedPages(String spaceKey)
           
 Page getPage(Space space, String pageTitle)
          Get the page by space and title.
 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.
 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)
           
 PageResponse<Page> getPages(LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
          Retrieves a page response of all the current pages of the Confluence instance.
 List<Page> getPages(Space space, boolean currentOnly)
           
 PageResponse<Page> getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
          Retrieves a page response of the current content in the given space.
 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)
           
 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)
           
 List<Page> getRecentlyAddedPages(int maxCount, String spaceKey)
           
 List<Page> getRecentlyAuthoredPagesByUser(String username, int maxCount)
           
 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)
           
 List<Page> getUndefinedPages(String spaceKey)
           
 
Methods inherited from interface com.atlassian.confluence.core.persistence.ContentEntityObjectDao
countContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findHistoricalVersionsAfterVersion, findPreviousVersions, getAllCurrentEntities, getById, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getOldestPageCreationDate, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
 

Method Detail

getPageById

Page getPageById(long id)
Get the page with the given id.

Parameters:
id - of the page to load
Returns:
the page with the given id, or null if no such page exists

getPagesByIds

List<Page> getPagesByIds(Iterable<Long> ids)
Get the pages with the given ids.

Since:
4.2

getPageByIdWithComments

Page getPageByIdWithComments(long id)
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.

Parameters:
id - of the page to load
Returns:
the page with the given id, or null if no such page exists

getCommentCountOnPage

int getCommentCountOnPage(long id)
Count the number of comments on the passed in page.


getPage

Page getPage(Space space,
             String pageTitle)
Get the page by space and title.

Parameters:
space - The space the page belongs to
pageTitle - The title of the page
Returns:
the page with the given title in the given space, or null if no such page exists

getPageWithComments

Page getPageWithComments(Space space,
                         String pageTitle)
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.

Parameters:
space - The space the page belongs to
pageTitle - The title of the page
Returns:
the page with the given title in the given space, or null if no such page exists

getPages

List<Page> getPages(Space space,
                    boolean currentOnly)

getPages

PageResponse<Page> getPages(Space space,
                            LimitedRequest pageRequest,
                            @Nullable
                            com.google.common.base.Predicate<? super Page> filter)
Retrieves a page response of the current content in the given space.

Parameters:
space - the space to locate the page in
pageRequest - the start and offset of the pages to retrieve
filter - the predicate to pages the returned results by, may be null
Returns:

getPages

PageResponse<Page> getPages(LimitedRequest pageRequest,
                            @Nullable
                            com.google.common.base.Predicate<? super Page> filter)
Retrieves a page response of all the current pages of the Confluence instance.

Parameters:
pageRequest - the start and offset of the pages to retrieve
filter - the predicate to filter the returned results by, may be null
Returns:
the paginated list of pages

getBlogPosts

PageResponse<BlogPost> getBlogPosts(Space space,
                                    LimitedRequest pageRequest,
                                    @Nullable
                                    com.google.common.base.Predicate<? super BlogPost> filter)
Retrieves a page response of all the current blog posts in the give space.

Parameters:
space - the space to locate the blog posts in
pageRequest - the start and offset of the pages to retrieve
filter - the predicate to filter the returned results by, may be null
Returns:
the paginated list of all the current blog posts by space

getPagesStartingWith

List<Page> getPagesStartingWith(Space space,
                                String s)

getRecentlyAddedPages

List<Page> getRecentlyAddedPages(int maxCount,
                                 String spaceKey)

getRecentlyUpdatedPages

List<Page> getRecentlyUpdatedPages(int maxCount,
                                   String spaceKey)

getOrphanedPages

List<Page> getOrphanedPages(String spaceKey)

getUndefinedPages

List<Page> getUndefinedPages(String spaceKey)

getPermissionPages

List<Page> getPermissionPages(Space space)

getAuthoredPagesCountByUser

int getAuthoredPagesCountByUser(String username)

getRecentlyAuthoredPagesByUser

List<Page> getRecentlyAuthoredPagesByUser(String username,
                                          int maxCount)

getPagesCreatedOrUpdatedSinceDate

List<Page> getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)

findPagesWithHistoricalTitle

@Deprecated
List<Page> findPagesWithHistoricalTitle(String pageTitle)
Deprecated. since 3.1. Use #findPagesWithHistoricalTitleInPermittedSpace or #findPagesWithHistoricalTitleInAllPermittedSpacesExcept .


findPagesWithHistoricalTitleInPermittedSpace

@Deprecated
List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(String pageTitle,
                                                                           Space space,
                                                                           int maxResultCount)
Deprecated. since 5.6.1. Use findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(String, com.atlassian.confluence.spaces.Space, int)


findBlogsWithHistoricalTitleInPermittedSpace

@Deprecated
List<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(String blogTitle,
                                                                           Space space,
                                                                           int maxResultCount)
Deprecated. since 5.6.1. Use findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(String, com.atlassian.confluence.spaces.Space, int)


findPagesWithHistoricalTitleInAllPermittedSpacesExcept

@Deprecated
List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(String pageTitle,
                                                                                     Space space,
                                                                                     int maxResultCount)
Deprecated. since 5.6.1. Use findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(String, com.atlassian.confluence.spaces.Space, int)


findPagesWithCurrentOrHistoricalTitleInPermittedSpace

List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInPermittedSpace(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.

Only pages in spaces the remote user is able to view will be returned.

Parameters:
pageTitle - title of a page in a previous version.
space - Space to search. Must not be null.
maxResultCount - maximum pages to return

findBlogsWithCurrentOrHistoricalTitleInPermittedSpace

List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(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.

Only blogs in spaces the remote user is able to view will be returned.

Parameters:
blogTitle - 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

List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(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.

Only pages in spaces the remote user is able to view will be returned.

Parameters:
blogTitle - Title of the blog to find
space - 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
Since:
5.6.2

findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept

List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(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.

Only pages in spaces the remote user is able to view will be returned.

Parameters:
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

getPageInTrash

List<Page> getPageInTrash(String spaceKey,
                          String title)

getDescendents

@Deprecated
List<Page> getDescendents(Page page)
Deprecated. since 5.5.1. Use getDescendants(com.atlassian.confluence.pages.Page)


getDescendants

List<Page> getDescendants(Page page)
Finds all descendant pages (recursive) of the given page

Parameters:
page -
Returns:
List of descendant pages

getDescendantTitles

List<String> getDescendantTitles(Page page)
Finds all descendant titles of the given page

Parameters:
page -
Returns:
List of descendant titles

getDescendentIds

@Deprecated
List<Long> getDescendentIds(Page page)
Deprecated. since 5.5.1. Use getDescendantIds(com.atlassian.confluence.pages.Page)

Parameters:
page -
Returns:

getDescendantIds

List<Long> getDescendantIds(Page page)
Finds the ids of all descendant pages of the given page

Parameters:
page -
Returns:
List of page ids

getTopLevelPages

List<Page> getTopLevelPages(Space space)

getTopLevelPages

PageResponse<Page> getTopLevelPages(Space space,
                                    LimitedRequest limitedRequest,
                                    com.google.common.base.Predicate<? super Page> predicate)

getChildren

PageResponse<Page> getChildren(Page page,
                               LimitedRequest pageRequest,
                               com.google.common.base.Predicate<? super Page> predicate,
                               Depth depth)

getMaxSiblingPosition

Integer getMaxSiblingPosition(Page page)
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.

Parameters:
page - The page whose siblings from which to get the max position
Returns:
The highest position value of all the page's siblings
Since:
3.5.12

getPageIds

Collection<Long> getPageIds(Space space)
Get the ids of all pages (current and historical) in the given space.

Parameters:
space - space to retrieve page ids from, can not be null.
Returns:
a Collection of ids for pages.
Since:
4.2

getAbstractPagesByTitle

PageResponse<AbstractPage> getAbstractPagesByTitle(String title,
                                                   LimitedRequest pageRequest,
                                                   com.google.common.base.Predicate<? super AbstractPage> filter)
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.

Parameters:
title - the title of the page to match
pageRequest - the pagination requested
filter - the predicate to apply to the results before returning
Returns:
the paginated list of AbstractPages by title

getAbstractPagesByCreationDate

PageResponse<AbstractPage> getAbstractPagesByCreationDate(org.joda.time.DateTime date,
                                                          LimitedRequest pageRequest,
                                                          com.google.common.base.Predicate<? super AbstractPage> filter)
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.

Parameters:
date - - the creation date to match
pageRequest - the pagination request
filter - the predicate to apply to the results before returning
Returns:
the paginated list of AbstractPages created on the given date

getAbstractPages

PageResponse<AbstractPage> getAbstractPages(List<ContentType> contentTypes,
                                            List<ContentStatus> statuses,
                                            LimitedRequest pageRequest,
                                            @Nullable
                                            com.google.common.base.Predicate<? super AbstractPage> filter)
Retrieves a page response of all pages found in this instance of Confluence, within any of the given statuses.

Parameters:
contentTypes - list of content types to find
statuses - list of statuses the pages can be in
pageRequest - the start and offset of the pages to retrieve
filter - the predicate to filter the returned results by, may be null
Returns:
the paginated list of pages

getAbstractPages

PageResponse<AbstractPage> getAbstractPages(Space space,
                                            List<ContentType> contentTypes,
                                            List<ContentStatus> statuses,
                                            LimitedRequest pageRequest,
                                            @Nullable
                                            com.google.common.base.Predicate<? super AbstractPage> filter)
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.

Parameters:
space - the space to locate the page in
contentTypes - list of content types to find
statuses - list of statuses the pages can be in
pageRequest - the pagination request
filter - the predicate to pages the returned results by, may be null
Returns:
the paginated list of pages by space, with the given statuses

getAbstractPages

PageResponse<AbstractPage> getAbstractPages(Space space,
                                            String title,
                                            List<ContentStatus> statuses,
                                            LimitedRequest pageRequest,
                                            com.google.common.base.Predicate<? super AbstractPage> filter)
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.

Parameters:
space - space the page belongs to
title - the title of the page to match
statuses - list of statuses the content can be in
pageRequest - the pagination requested
filter - the predicate to apply to the results before returning
Returns:
the paginated list of AbstractPages by space and title, with the given statuses

getAbstractPages

PageResponse<AbstractPage> getAbstractPages(String title,
                                            List<ContentStatus> statuses,
                                            LimitedRequest pageRequest,
                                            com.google.common.base.Predicate<? super AbstractPage> filter)
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.

Parameters:
title - the title of the page to match
statuses - list of statuses the content can be in
pageRequest - the pagination requested
filter - the predicate to apply to the results before returning
Returns:
the paginated list of AbstractPages by title

getAbstractPages

PageResponse<AbstractPage> getAbstractPages(org.joda.time.DateTime date,
                                            List<ContentStatus> statuses,
                                            LimitedRequest pageRequest,
                                            com.google.common.base.Predicate<? super AbstractPage> filter)
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.

Parameters:
date - the creation date to match
statuses - list of statuses the content can be in
pageRequest - the pagination request
filter - the predicate to apply to the results before returning
Returns:
the paginated list of AbstractPages created on the given date


Copyright © 2003–2015 Atlassian. All rights reserved.