@ParametersAreNonnullByDefault public interface PageManager extends ContentEntityManager
ITERATE_ALL
Modifier and Type | Method and Description |
---|---|
BlogPost |
findNextBlogPost(BlogPost post) |
BlogPost |
findNextBlogPost(String key,
Date time) |
BlogPost |
findPreviousBlogPost(BlogPost post) |
BlogPost |
findPreviousBlogPost(String key,
Date time) |
AbstractPage |
getAbstractPage(long id)
Retrieve the AbstractPage subclass with the given content ID.
|
List<AbstractPage> |
getAbstractPages(Iterable<Long> ids)
Retrieve a collection of the AbstractPage subclass with the given content IDs.
|
AttachmentManager |
getAttachmentManager()
Deprecated.
since 5.8 do not use. Implementation detail mistakenly added to manager interface.
|
int |
getAuthoredPagesCountByUser(String username)
Get the number of pages that have been created by a particular user
|
BlogPost |
getBlogPost(long id)
Retrieve the blog post with the given content ID.
|
BlogPost |
getBlogPost(String spaceKey,
String pageTitle,
Calendar day)
Retrieve the latest version of a blog post by its space key, title, and the day on which it was
published.
|
BlogPost |
getBlogPost(String spaceKey,
String pageTitle,
Calendar day,
boolean eagerLoadComments)
Retrieve the latest version of a blog post by its space key, title, and the day on which it was
published.
|
long |
getBlogPostCount(String key,
Calendar postingDay,
int period)
Get total number of blogPost.
|
List<BlogPost> |
getBlogPosts(Space space,
boolean currentOnly) |
List |
getBlogPosts(String spaceKey,
Calendar postingDate,
int period)
Get list of blogPost by Date.
|
List |
getBlogPosts(String spaceKey,
Calendar postingDate,
int period,
int startIndex,
int maxResultCount)
Get list of blogPost by Date.
|
int |
getCommentCountOnPage(long pageId)
Counts the number of comments on the page specified by the given id.
|
int |
getCountOfLatestXhtmlContent(long endContentId)
Count the number of AbstractPages that have an ID lower than the specified ID, excluding older versions.
|
Collection<Long> |
getDescendantIds(Page page)
Finds the ids of a page's descendants
|
List<Page> |
getDescendants(Page page)
Finds all descendant pages of the given page
|
List<String> |
getDescendantTitles(Page page)
Finds all descendant titles of the given page
|
Collection |
getDescendentIds(Page page)
Deprecated.
since 5.5 use
getDescendantIds(Page) |
List |
getDescendents(Page page)
Deprecated.
since 5.5.1. Use
getDescendants(Page) |
long |
getHighestCeoId()
Get the highest content ID in the database, excluding older versions of content.
|
Set<Date> |
getMonthsWithBlogPosts(String spaceKey,
Calendar year)
Returns the set of months in the specified year (represented as a Calendar with the year and month fields populated)
for which blog posts exist in the specified space.
|
BlogPost |
getNewestBlogPost(String spaceKey)
Retrieves the most recently created blog post in the given space.
|
NotificationManager |
getNotificationManager()
Deprecated.
since 5.8 do not use. Implementation detail mistakenly added to manager interface.
|
List<ContentEntityObject> |
getOrderedXhtmlContentFromContentId(long startContentId,
long endContentId,
int maxRows)
Gets the latest versions of AbstractPages between the given IDs limited by the specified number of rows.
|
List |
getOrphanedPages(String spaceKey)
Retrieve a list of pages in a given space that are not linked to.
|
Page |
getPage(long id)
Retrieve the page with the given content ID.
|
Page |
getPage(String spaceKey,
String pageTitle)
Retrieve the latest version of a page by its space key and title.
|
Page |
getPage(String spaceKey,
String pageTitle,
boolean eagerLoadComments)
Deprecated.
since 3.0, use
getPageWithComments(String, String) instead. |
AbstractPage |
getPageByVersion(AbstractPage mostRecentPage,
int version)
returns the historical version of a page
|
Collection<Long> |
getPageIds(Space space)
Get the ids of all pages (current and historical) in the given space.
|
List |
getPageInTrash(String spaceKey,
String title) |
List<Page> |
getPages(Iterable<Long> ids)
Retrieve a collection of pages with the given content IDs.
|
List<Page> |
getPages(Space space,
boolean currentOnly) |
List |
getPagesCreatedOrUpdatedSinceDate(Date date)
Get the list of all pages created or updated since a particular date.
|
List |
getPagesStartingWith(Space space,
String s) |
Page |
getPageWithComments(String spaceKey,
String pageTitle)
Retrieve the latest version of a page by its space key and title.
|
List |
getPermissionPages(Space space)
Retrieve all pages within a particular space that have page level permissions applied to them.
|
List<AbstractPage> |
getPossibleBlogRedirectsInSpace(Space space,
String blogTitle,
int maxResultCount)
Searches for blogs in the space specified, looking for those that have the given title in a
previous version.
|
List<AbstractPage> |
getPossibleBlogRedirectsNotInSpace(Space space,
String blogTitle,
int maxResultCount)
Searches for pages in all spaces except the one specified, looking for those that have the given title in a
previous version.
|
List |
getPossibleRedirects(String pageTitle)
Deprecated.
|
List |
getPossibleRedirectsForSpace(Space space,
String pageTitle)
Deprecated.
|
List<AbstractPage> |
getPossibleRedirectsInSpace(Space space,
String pageTitle,
int maxResultCount)
Searches for pages in the space specified, looking for those that have the given title in a
previous version.
|
List<AbstractPage> |
getPossibleRedirectsNotInSpace(Space space,
String pageTitle,
int maxResultCount)
Searches for pages in all spaces except the one specified, looking for those that have the given title in a
previous version.
|
List<ContentEntityObject> |
getPreviousVersionsOfPageWithTaskId(long pageId,
long taskId,
int maxRows)
Get previous versions of a CEO that contain the given task ID sorted by versions in descending order.
|
List |
getRecentlyAddedBlogPosts(int maxPosts,
Date timeSince,
String spaceKey) |
List |
getRecentlyAddedBlogPosts(int maxCount,
String spaceKey)
Retrieve the most recently created blog posts in a given space.
|
List |
getRecentlyAddedPages(int maxCount,
String spaceKey)
Retrieve the most recently created pages in a given space.
|
List |
getRecentlyUpdatedPages(int maxCount,
String spaceKey)
Retrieve the most recently modified pages in a given space.
|
List |
getTopLevelPages(Space space)
Get all the pages in a space that do not have a parent page.
|
ListBuilder<Page> |
getTopLevelPagesBuilder(Space space)
Get the pages in a space that do not have a parent page.
|
List |
getUndefinedPages(String spaceKey)
Retrieve a list of link destinations in a given space that do not have pages.
|
Set<Date> |
getYearsWithBlogPosts(String spaceKey)
Returns the set of years (represented as a Date with the year field populated)
for which blog posts exist in the specified space.
|
boolean |
isPageRecentlyUpdatedForUser(Page page,
com.atlassian.user.User user)
Returns true if the page has been created or modified since the user last logged in.
|
void |
moveBlogPostToTopLevel(BlogPost blogPost,
Space space)
Move a blog post to the top level of
targetSpace . |
void |
moveChildrenToNewParent(Page oldParent,
Page newParent)
Moves all the children from one page to another
The new parent should NOT be the child of the old parent, this method will return with no operation in that case
|
void |
movePageAfter(Page page,
Page refPage)
Move the provided page (first argument) after the reference page (second argument).
|
void |
movePageAsChild(Page page,
Page refPage)
Move the provided page (first argument) as a child of the reference page (second argument).
|
void |
movePageBefore(Page page,
Page refPage)
Move the provided page (first argument) before the reference page (second argument).
|
void |
movePageToTopLevel(Page page,
Space space)
Move a page to the top level of
targetSpace . |
void |
refreshPage(ContentEntityObject page)
Refresh the page object in the hibernate session.
|
void |
removeAllBlogPosts(Space space) |
void |
removeAllPages(Space space)
Removes all pages in the space.
|
void |
removeAllPages(Space space,
com.atlassian.core.util.ProgressMeter progress)
Removes all pages in the space.
|
void |
removePageFromAncestorCollections(Page page)
Removes the page and its ancestors from the ancestor collection of all descendants.
|
void |
renamePage(AbstractPage page,
String newPageTitle)
Call this function if you want to rename the page only.
|
void |
renamePageWithoutNotifications(AbstractPage page,
String newPageTitle)
Call this function if you want to rename the page only, and don't want notifications generated.
|
void |
restorePage(AbstractPage page)
Restores a trashed page, effectively moving it out of the trash and promoting it back to being normal page.
|
void |
revertChildPageOrder(Page parentPage)
Removes manual ordering of child pages.
|
void |
setAttachmentManager(AttachmentManager attachmentManager)
Deprecated.
since 5.8 do not use. Implementation detail mistakenly added to manager interface.
|
void |
setChildPageOrder(Page parentPage,
List<Long> childIds)
Sets ordering of child pages for a supplied page, based on a map of child ids to positions.
|
void |
setNotificationManager(NotificationManager notificationManager)
Deprecated.
since 5.8 do not use. Implementation detail mistakenly added to manager interface.
|
boolean |
spaceHasBlogPosts(String spaceKey) |
void |
trashPage(AbstractPage page) |
void |
updatePageInAncestorCollections(Page page,
Page parentPage)
Updates the ancestors of a page and all it's descendant pages with the new parent page
and its ancestors.
|
getById, getNextVersion, getOtherVersion, getPageAndBlogPostsVersionsLastEditedByUser, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, getVersionsLastEditedByUser, refreshContentEntity, removeContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, saveNewVersion, saveNewVersion, updateContentLinkingTo, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo
@Nullable Page getPage(long id)
id
- the database content ID for the page to return@Nonnull List<Page> getPages(Iterable<Long> ids)
ids
- an Iterable of content IDs for the pages to return@Nullable AbstractPage getAbstractPage(long id)
id
- the database content ID for the page to return@Nonnull List<AbstractPage> getAbstractPages(Iterable<Long> ids)
ids
- an Iterable of content IDs for the pages or blogposts to return@Nullable BlogPost getBlogPost(long id)
id
- the database content ID for the blog post to return@Nullable Page getPage(String spaceKey, String pageTitle)
Both the space key and page title matches are case-insensitive.
@Nullable Page getPageWithComments(String spaceKey, String pageTitle)
Both the space key and page title matches are case-insensitive.
int getCommentCountOnPage(long pageId)
pageId
- the id to check for comments on@Deprecated @Nullable Page getPage(String spaceKey, String pageTitle, boolean eagerLoadComments)
getPageWithComments(String, String)
instead.
Both the space key and page title matches are case-insensitive.
@Nullable BlogPost getBlogPost(String spaceKey, String pageTitle, Calendar day)
Both the space key and page title matches are case-insensitive.
@Nullable BlogPost getBlogPost(String spaceKey, String pageTitle, Calendar day, boolean eagerLoadComments)
Both the space key and page title matches are case-insensitive.
@Nullable BlogPost getNewestBlogPost(@Nullable String spaceKey)
spaceKey
- the key of the space to retrieve the most recently created blog post for.@Nonnull List getRecentlyAddedBlogPosts(int maxCount, @Nullable String spaceKey)
For queries like this, you're probably much better off using the SearchManager
maxCount
- the maximum number of blog posts to retrievespaceKey
- the key of the space to retrieve the posts from, or null to retrieve posts from all spaces@Nonnull List getRecentlyAddedPages(int maxCount, @Nullable String spaceKey)
For queries like this, you're probably much better off using the SearchManager
maxCount
- the maximum number of pages to retrievespaceKey
- the key of the space to retrieve the pages from, or null to retrieve posts from all spaces@Nonnull List getRecentlyUpdatedPages(int maxCount, @Nullable String spaceKey)
For queries like this, you're probably much better off using the SearchManager
maxCount
- the maximum number of pages to retrievespaceKey
- the key of the space to retrieve the pages from, or null to retrieve posts from all spaces@Nonnull List getOrphanedPages(@Nullable String spaceKey)
The orphaned pages search is not 100% accurate, as the algorithm used to track links doesn't account for all links. Hopefully this can be fixed with future versions of the wiki renderer that allow more accurate tracking of link destinations.
spaceKey
- the key of the space to look for orphans in, or null to search all spaces@Nonnull List getUndefinedPages(@Nullable String spaceKey)
The undefined pages search is not 100% accurate, as the algorithm used to track links doesn't account for all links. Hopefully this can be fixed with future versions of the wiki renderer that allow more accurate tracking of link destinations.
spaceKey
- the key of the space to look for undefined pages in, or null to search all spaces@Nonnull List getPermissionPages(Space space)
space
- the space to searchint getAuthoredPagesCountByUser(String username)
username
- the username of the user to search forboolean isPageRecentlyUpdatedForUser(Page page, @Nullable com.atlassian.user.User user)
page
- the page in questionuser
- the user or null if it is the anonymous user@Nonnull List getPagesCreatedOrUpdatedSinceDate(Date date)
date
- the date the pages must have been created or edited after@Nonnull List getBlogPosts(String spaceKey, Calendar postingDate, int period)
spaceKey
- the space to look for posts inpostingDate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supported@Nonnull List getBlogPosts(String spaceKey, Calendar postingDate, int period, int startIndex, int maxResultCount)
spaceKey
- the space to look for posts inpostingDate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supportedstartIndex
- start number of postsmaxResultCount
- Maximum number of posts to return@Nonnull Set<Date> getYearsWithBlogPosts(String spaceKey)
spaceKey
- the key of the space to look for blog posts in.@Nonnull Set<Date> getMonthsWithBlogPosts(String spaceKey, Calendar year)
spaceKey
- the key of the space to look for blog posts in.year
- the year to examine blog posts for, represented as a Calendar with the year field specified.@Nonnull Collection<Long> getPageIds(Space space)
space
- space to retrieve page ids from, can not be null.@Deprecated NotificationManager getNotificationManager()
@Deprecated void setNotificationManager(NotificationManager notificationManager)
@Deprecated AttachmentManager getAttachmentManager()
@Deprecated void setAttachmentManager(AttachmentManager attachmentManager)
void renamePage(AbstractPage page, String newPageTitle)
page
- to renamenewPageTitle
- new title for pagevoid renamePageWithoutNotifications(AbstractPage page, String newPageTitle)
page
- to renamenewPageTitle
- new title for page@Deprecated @Nonnull List getPossibleRedirectsForSpace(Space space, String pageTitle)
getPossibleRedirectsInSpace(Space, String, int)
or getPossibleRedirectsNotInSpace(Space, String, int)
@Nonnull List<AbstractPage> getPossibleRedirectsNotInSpace(Space space, String pageTitle, int maxResultCount)
space
- Space to exclude from search. If null, all spaces are searched.pageTitle
- title of a page in a previous version.maxResultCount
- maximum pages to return@Nonnull List<AbstractPage> getPossibleRedirectsInSpace(Space space, String pageTitle, int maxResultCount)
space
- Space to search. Must not be null.pageTitle
- title of a page in a previous version.maxResultCount
- maximum pages to return@Nonnull List<AbstractPage> getPossibleBlogRedirectsInSpace(Space space, String blogTitle, int maxResultCount)
space
- Space to search. Must not be null.blogTitle
- title of a blog in a previous version.maxResultCount
- maximum blogs to return@Nonnull List<AbstractPage> getPossibleBlogRedirectsNotInSpace(Space space, String blogTitle, int maxResultCount)
space
- Space to exclude from search. If null, all spaces are searched.blogTitle
- title of a blog post to locatemaxResultCount
- maximum blog posts to return@Deprecated @Nonnull List getPossibleRedirects(String pageTitle)
getPossibleRedirectsInSpace(Space, String, int)
or getPossibleRedirectsNotInSpace(Space, String, int)
@Nonnull List getRecentlyAddedBlogPosts(int maxPosts, @Nullable Date timeSince, String spaceKey)
boolean spaceHasBlogPosts(String spaceKey)
@Deprecated @Nonnull List getDescendents(Page page)
getDescendants(Page)
@Nonnull List<Page> getDescendants(Page page)
page
- @Nonnull List<String> getDescendantTitles(Page page)
page
- void updatePageInAncestorCollections(Page page, Page parentPage)
page
- the page being updated with new ancestorsparentPage
- the new parent page of the page being updatedvoid removePageFromAncestorCollections(Page page)
@Deprecated @Nonnull Collection getDescendentIds(Page page)
getDescendantIds(Page)
@Nonnull Collection<Long> getDescendantIds(Page page)
page
- @Nonnull List getTopLevelPages(Space space)
@Nullable AbstractPage getPageByVersion(AbstractPage mostRecentPage, int version)
mostRecentPage
- - must specify the most recent recent version of the page (page must be associated with a space)version
- - historical version to retrievevoid removeAllPages(Space space)
This can be a lengthy operation and should be performed in a long running task. Current Hibernate session will be cleared as part of this method.
space
- the space to remove pages from.void removeAllPages(Space space, com.atlassian.core.util.ProgressMeter progress)
This can be a lengthy operation and should be performed in a long running task. Current Hibernate session will be cleared as part of this method.
space
- the space to remove pages from.progress
- progress meter to report progress on, can not be null.void removeAllBlogPosts(Space space)
void trashPage(AbstractPage page)
@Nonnull ListBuilder<Page> getTopLevelPagesBuilder(Space space)
This method will return only pages the current user can view.
space
- the space in which to look for pagesvoid restorePage(AbstractPage page)
page
- a trashed pagevoid movePageAfter(Page page, Page refPage)
page
- the page to moverefPage
- the page which the first page will be placed aftervoid movePageBefore(Page page, Page refPage)
page
- the page to moverefPage
- the page which the first page will be placed beforevoid movePageAsChild(Page page, Page refPage)
The location of the page in the reference page's children is dependent on their existing order. If they are not explicitly ordered, the page will have a default location in the list. If the children have an existing order, the page will be added as the last child of the reference page.
page
- the page to moverefPage
- the page which the first page will be made a child ofvoid moveChildrenToNewParent(Page oldParent, Page newParent)
The location of the children under their new parent is dependent on the new parent's existing order. If they are not explicitly ordered, the children will be in their default location in the list. If the new parent have an existing order, the children will be ordered under the new parent.
oldParent
- the page whose children you want to movenewParent
- the page whose the children will now belong tovoid movePageToTopLevel(Page page, Space space)
targetSpace
. If the top-level pages are manually ordered, the page
will be added to the end of the child pages.page
- the page to movespace
- the space to move the page tovoid moveBlogPostToTopLevel(BlogPost blogPost, Space space)
targetSpace
.blogPost
- the blogPost to movespace
- the space to move the page tovoid setChildPageOrder(Page parentPage, List<Long> childIds)
parentPage
- the page for which children should be ordered.childIds
- children page IDs in the new ordervoid revertChildPageOrder(Page parentPage)
parentPage
- the page for which children should be unordered.@Nonnull List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId, long endContentId, int maxRows)
startContentId
- The minimum IDendContentId
- The maximum IDmaxRows
- The maximum number of rows to returnint getCountOfLatestXhtmlContent(long endContentId)
endContentId
- The maximum IDlong getHighestCeoId()
@Nonnull List<ContentEntityObject> getPreviousVersionsOfPageWithTaskId(long pageId, long taskId, int maxRows)
pageId
- The ID of the latest version of the pagetaskId
- The task ID to look for in previous versionsmaxRows
- The maximum number of previous versions to returnlong getBlogPostCount(String key, @Nullable Calendar postingDay, int period)
key
- the space to look for posts inpostingDay
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supported@Nonnull void refreshPage(ContentEntityObject page)
page
- the page to refreshCopyright © 2003–2016 Atlassian. All rights reserved.