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
 java.util.List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(java.lang.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.
 java.util.List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(java.lang.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.
 java.util.List<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(java.lang.String blogTitle, Space space, int maxResultCount)
          Deprecated. since 5.6.1. Use findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(String, com.atlassian.confluence.spaces.Space, int)
 java.util.List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(java.lang.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.
 java.util.List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInPermittedSpace(java.lang.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.
 java.util.List<Page> findPagesWithHistoricalTitle(java.lang.String pageTitle)
          Deprecated. since 3.1. Use #findPagesWithHistoricalTitleInPermittedSpace or #findPagesWithHistoricalTitleInAllPermittedSpacesExcept .
 java.util.List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(java.lang.String pageTitle, Space space, int maxResultCount)
          Deprecated. since 5.6.1. Use findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(String, com.atlassian.confluence.spaces.Space, int)
 java.util.List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(java.lang.String pageTitle, Space space, int maxResultCount)
          Deprecated. since 5.6.1. Use findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(String, com.atlassian.confluence.spaces.Space, int)
 PageResponse<AbstractPage> getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          Returns the pages and blogposts created on the given date, that also match the given predicate, limited to the page request
 PageResponse<AbstractPage> getAbstractPagesByTitle(java.lang.String title, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
          Returns the pages and blogposts that exactly match the given title, limited to the pagination request
 int getAuthoredPagesCountByUser(java.lang.String username)
           
 PageResponse<BlogPost> getBlogPosts(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super BlogPost> predicate)
          Retrieve a page of the current blog posts in this space
 PageResponse<Page> getChildren(Page page, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate, Depth depth)
           
 int getCommentCountOnPage(long id)
          Count the number of comments on the passed in page.
 java.util.List<java.lang.Long> getDescendantIds(Page page)
          Finds the ids of all descendant pages of the given page
 java.util.List<Page> getDescendants(Page page)
          Finds all descendant pages (recursive) of the given page
 java.util.List<java.lang.String> getDescendantTitles(Page page)
          Finds all descendant titles of the given page
 java.util.List<java.lang.Long> getDescendentIds(Page page)
          Deprecated. since 5.5.1. Use getDescendantIds(com.atlassian.confluence.pages.Page)
 java.util.List<Page> getDescendents(Page page)
          Deprecated. since 5.5.1. Use getDescendants(com.atlassian.confluence.pages.Page)
 java.lang.Integer getMaxSiblingPosition(Page page)
          Gets the highest position value of all the page's siblings.
 java.util.List<Page> getOrphanedPages(java.lang.String spaceKey)
           
 Page getPage(Space space, java.lang.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.
 java.util.Collection<java.lang.Long> getPageIds(Space space)
          Get the ids of all pages (current and historical) in the given space.
 java.util.List<Page> getPageInTrash(java.lang.String spaceKey, java.lang.String title)
           
 PageResponse<Page> getPages(LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
          Retrieve a page of all the current content
 java.util.List<Page> getPages(Space space, boolean currentOnly)
           
 PageResponse<Page> getPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
          Retrieve a page of the current content in this space
 java.util.List<Page> getPagesByIds(java.lang.Iterable<java.lang.Long> ids)
          Get the pages with the given ids.
 java.util.List<Page> getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)
           
 java.util.List<Page> getPagesStartingWith(Space space, java.lang.String s)
           
 Page getPageWithComments(Space space, java.lang.String pageTitle)
          Get the page by space and title, and perform an eager load of the comments and their children.
 java.util.List<Page> getPermissionPages(Space space)
           
 java.util.List<Page> getRecentlyAddedPages(int maxCount, java.lang.String spaceKey)
           
 java.util.List<Page> getRecentlyAuthoredPagesByUser(java.lang.String username, int maxCount)
           
 java.util.List<Page> getRecentlyUpdatedPages(int maxCount, java.lang.String spaceKey)
           
 java.util.List<Page> getTopLevelPages(Space space)
           
 PageResponse<Page> getTopLevelPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
           
 java.util.List<Page> getUndefinedPages(java.lang.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

java.util.List<Page> getPagesByIds(java.lang.Iterable<java.lang.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,
             java.lang.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,
                         java.lang.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

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

getPages

PageResponse<Page> getPages(Space space,
                            LimitedRequest limitedRequest,
                            @Nullable
                            com.google.common.base.Predicate<? super Page> predicate)
Retrieve a page of the current content in this space

Parameters:
space - - the space to retreive the content for
limitedRequest - - the start and offset of the pages to retrieve
predicate - - the predicate to apply
Returns:

getPages

PageResponse<Page> getPages(LimitedRequest limitedRequest,
                            @Nullable
                            com.google.common.base.Predicate<? super Page> predicate)
Retrieve a page of all the current content

Parameters:
limitedRequest - - the start and offset of the pages to retrieve
predicate - - the predicate to apply
Returns:

getBlogPosts

PageResponse<BlogPost> getBlogPosts(Space space,
                                    LimitedRequest pageRequest,
                                    @Nullable
                                    com.google.common.base.Predicate<? super BlogPost> predicate)
Retrieve a page of the current blog posts in this space

Parameters:
space -
pageRequest -
predicate - - the predicate to filter the returned results by, may be null.
Returns:

getPagesStartingWith

java.util.List<Page> getPagesStartingWith(Space space,
                                          java.lang.String s)

getRecentlyAddedPages

java.util.List<Page> getRecentlyAddedPages(int maxCount,
                                           java.lang.String spaceKey)

getRecentlyUpdatedPages

java.util.List<Page> getRecentlyUpdatedPages(int maxCount,
                                             java.lang.String spaceKey)

getOrphanedPages

java.util.List<Page> getOrphanedPages(java.lang.String spaceKey)

getUndefinedPages

java.util.List<Page> getUndefinedPages(java.lang.String spaceKey)

getPermissionPages

java.util.List<Page> getPermissionPages(Space space)

getAuthoredPagesCountByUser

int getAuthoredPagesCountByUser(java.lang.String username)

getRecentlyAuthoredPagesByUser

java.util.List<Page> getRecentlyAuthoredPagesByUser(java.lang.String username,
                                                    int maxCount)

getPagesCreatedOrUpdatedSinceDate

java.util.List<Page> getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)

findPagesWithHistoricalTitle

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


findPagesWithHistoricalTitleInPermittedSpace

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


findBlogsWithHistoricalTitleInPermittedSpace

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


findPagesWithHistoricalTitleInAllPermittedSpacesExcept

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


findPagesWithCurrentOrHistoricalTitleInPermittedSpace

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

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

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

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

java.util.List<Page> getPageInTrash(java.lang.String spaceKey,
                                    java.lang.String title)

getDescendents

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


getDescendants

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

Parameters:
page -
Returns:
List of descendant pages

getDescendantTitles

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

Parameters:
page -
Returns:
List of descendant titles

getDescendentIds

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

Parameters:
page -
Returns:

getDescendantIds

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

Parameters:
page -
Returns:
List of page ids

getTopLevelPages

java.util.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 limitedRequest,
                               com.google.common.base.Predicate<? super Page> predicate,
                               Depth depth)

getMaxSiblingPosition

java.lang.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

java.util.Collection<java.lang.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(java.lang.String title,
                                                   LimitedRequest pageRequest,
                                                   com.google.common.base.Predicate<? super AbstractPage> filter)
Returns the pages and blogposts that exactly match the given title, limited to the pagination request

Parameters:
title - the title of the page to match
pageRequest - the pagination requested
filter - a 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 pages and blogposts created on the given date, that also match the given predicate, limited to the page request

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


Copyright © 2003-2014 Atlassian. All Rights Reserved.