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

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

public interface PageDao
extends ContentEntityObjectDao


Method Summary
 java.util.List<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(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<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)
          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> findPagesWithHistoricalTitleInPermittedSpace(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.
 int getAuthoredPagesCountByUser(java.lang.String username)
           
 int getCommentCountOnPage(long id)
          Count the number of comments on the passed in page.
 java.util.List<java.lang.Long> getDescendentIds(Page page)
           
 java.util.List<Page> getDescendents(Page 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)
           
 java.util.List<Page> getPages(Space space, boolean currentOnly)
           
 java.util.Collection<Page> getPagesByIds(java.util.Collection<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)
           
 java.util.List<Page> getUndefinedPages(java.lang.String spaceKey)
           
 
Methods inherited from interface com.atlassian.confluence.core.persistence.ContentEntityObjectDao
countContentBySpaceIdAndStatus, 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.Collection<Page> getPagesByIds(java.util.Collection<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)

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

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

findBlogsWithHistoricalTitleInPermittedSpace

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

findPagesWithHistoricalTitleInAllPermittedSpacesExcept

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

java.util.List<Page> getDescendents(Page page)

getDescendentIds

java.util.List<java.lang.Long> getDescendentIds(Page page)

getTopLevelPages

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

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


Copyright © 2003-2014 Atlassian. All Rights Reserved.