|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PageManager
Manages the retrieval and manipulation both pages and blog entries. (Really this class manages "AbstractPage", but calling it AbstractPageManager would be just as confusing).
Field Summary |
---|
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager |
---|
ITERATE_ALL |
Method Summary | |
---|---|
BlogPost |
findNextBlogPost(BlogPost post)
|
BlogPost |
findNextBlogPost(java.lang.String key,
java.util.Date time)
|
BlogPost |
findPreviousBlogPost(BlogPost post)
|
BlogPost |
findPreviousBlogPost(java.lang.String key,
java.util.Date time)
|
AbstractPage |
getAbstractPage(long id)
Retrieve the AbstractPage subclass with the given content ID. |
AttachmentManager |
getAttachmentManager()
|
int |
getAuthoredPagesCountByUser(java.lang.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(java.lang.String spaceKey,
java.lang.String pageTitle,
java.util.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(java.lang.String spaceKey,
java.lang.String pageTitle,
java.util.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. |
java.util.List<BlogPost> |
getBlogPosts(Space space,
boolean currentOnly)
|
java.util.List |
getBlogPosts(java.lang.String spaceKey,
java.util.Calendar postingDate,
int period)
|
int |
getCommentCountOnPage(long pageId)
Counts the number of comments on the page specified by the given id. |
java.util.Collection |
getDescendentIds(Page page)
|
java.util.List |
getDescendents(Page page)
|
java.util.Set<java.util.Date> |
getMonthsWithBlogPosts(java.lang.String spaceKey,
java.util.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(java.lang.String spaceKey)
Retrieves the most recently created blog post in the given space. |
NotificationManager |
getNotificationManager()
|
java.util.List |
getOrphanedPages(java.lang.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(java.lang.String spaceKey,
java.lang.String pageTitle)
Retrieve the latest version of a page by its space key and title. |
Page |
getPage(java.lang.String spaceKey,
java.lang.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 |
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 |
getPageInTrash(java.lang.String spaceKey,
java.lang.String title)
|
java.util.List<Page> |
getPages(Space space,
boolean currentOnly)
|
java.util.List |
getPagesCreatedOrUpdatedSinceDate(java.util.Date date)
Get the list of all pages created or updated since a particular date. |
java.util.List |
getPagesStartingWith(Space space,
java.lang.String s)
|
Page |
getPageWithComments(java.lang.String spaceKey,
java.lang.String pageTitle)
Retrieve the latest version of a page by its space key and title. |
java.util.List |
getPermissionPages(Space space)
Retrieve all pages within a particular space that have page level permissions applied to them. |
java.util.List<AbstractPage> |
getPossibleBlogRedirectsInSpace(Space space,
java.lang.String blogTitle,
int maxResultCount)
Searches for blogs in the space specified, looking for those that have the given title in a previous version. |
java.util.List |
getPossibleRedirects(java.lang.String pageTitle)
Deprecated. Since 3.1. Use getPossibleRedirectsInSpace(Space, String, int) or getPossibleRedirectsNotInSpace(Space, String, int) |
java.util.List |
getPossibleRedirectsForSpace(Space space,
java.lang.String pageTitle)
Deprecated. Since 3.1. Use getPossibleRedirectsInSpace(Space, String, int) or getPossibleRedirectsNotInSpace(Space, String, int) |
java.util.List<AbstractPage> |
getPossibleRedirectsInSpace(Space space,
java.lang.String pageTitle,
int maxResultCount)
Searches for pages in the space specified, looking for those that have the given title in a previous version. |
java.util.List<AbstractPage> |
getPossibleRedirectsNotInSpace(Space space,
java.lang.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. |
java.util.List |
getRecentlyAddedBlogPosts(int maxPosts,
java.util.Date timeSince,
java.lang.String spaceKey)
|
java.util.List |
getRecentlyAddedBlogPosts(int maxCount,
java.lang.String spaceKey)
Retrieve the most recently created blog posts in a given space. |
java.util.List |
getRecentlyAddedPages(int maxCount,
java.lang.String spaceKey)
Retrieve the most recently created pages in a given space. |
java.util.List |
getRecentlyUpdatedPages(int maxCount,
java.lang.String spaceKey)
Retrieve the most recently modified pages in a given space. |
java.util.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. |
java.util.List |
getUndefinedPages(java.lang.String spaceKey)
Retrieve a list of link destinations in a given space that do not have pages. |
java.util.Set<java.util.Date> |
getYearsWithBlogPosts(java.lang.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 |
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 |
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,
java.lang.String newPageTitle)
Call this function if you want to rename the page only. |
void |
renamePageWithoutNotifications(AbstractPage page,
java.lang.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)
|
void |
setChildPageOrder(Page parentPage,
java.util.List<java.lang.Long> childIds)
Sets ordering of child pages for a supplied page, based on a map of child ids to positions. |
void |
setNotificationManager(NotificationManager notificationManager)
|
boolean |
spaceHasBlogPosts(java.lang.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. |
Method Detail |
---|
Page getPage(long id)
id
- the database content ID for the page to return
AbstractPage getAbstractPage(long id)
id
- the database content ID for the page to return
BlogPost getBlogPost(long id)
id
- the database content ID for the blog post to return
Page getPage(java.lang.String spaceKey, java.lang.String pageTitle)
Page getPageWithComments(java.lang.String spaceKey, java.lang.String pageTitle)
int getCommentCountOnPage(long pageId)
pageId
- the id to check for comments on
@Deprecated Page getPage(java.lang.String spaceKey, java.lang.String pageTitle, boolean eagerLoadComments)
getPageWithComments(String, String)
instead.
BlogPost getBlogPost(java.lang.String spaceKey, java.lang.String pageTitle, java.util.Calendar day)
BlogPost getBlogPost(java.lang.String spaceKey, java.lang.String pageTitle, java.util.Calendar day, boolean eagerLoadComments)
BlogPost getNewestBlogPost(java.lang.String spaceKey)
spaceKey
- the key of the space to retrieve the most recently created blog post for.
java.util.List getRecentlyAddedBlogPosts(int maxCount, java.lang.String spaceKey)
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
java.util.List getRecentlyAddedPages(int maxCount, java.lang.String spaceKey)
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
java.util.List getRecentlyUpdatedPages(int maxCount, java.lang.String spaceKey)
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
java.util.List getOrphanedPages(java.lang.String spaceKey)
spaceKey
- the key of the space to look for orphans in, or null to search all spaces
java.util.List getUndefinedPages(java.lang.String spaceKey)
spaceKey
- the key of the space to look for undefined pages in, or null to search all spaces
java.util.List getPermissionPages(Space space)
space
- the space to search
int getAuthoredPagesCountByUser(java.lang.String username)
username
- the username of the user to search for
boolean isPageRecentlyUpdatedForUser(Page page, @Nullable com.atlassian.user.User user)
page
- the page in questionuser
- the user or null if it is the anonymous user
java.util.List getPagesCreatedOrUpdatedSinceDate(java.util.Date date)
date
- the date the pages must have been created or edited after
java.util.List getBlogPosts(java.lang.String spaceKey, java.util.Calendar postingDate, int period)
java.util.List<BlogPost> getBlogPosts(Space space, boolean currentOnly)
java.util.Set<java.util.Date> getYearsWithBlogPosts(java.lang.String spaceKey)
spaceKey
- the key of the space to look for blog posts in.
java.util.Set<java.util.Date> getMonthsWithBlogPosts(java.lang.String spaceKey, java.util.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.
java.util.List<Page> getPages(Space space, boolean currentOnly)
java.util.Collection<java.lang.Long> getPageIds(Space space)
space
- space to retrieve page ids from, can not be null.
java.util.List getPagesStartingWith(Space space, java.lang.String s)
BlogPost findNextBlogPost(BlogPost post)
BlogPost findPreviousBlogPost(BlogPost post)
NotificationManager getNotificationManager()
void setNotificationManager(NotificationManager notificationManager)
AttachmentManager getAttachmentManager()
void setAttachmentManager(AttachmentManager attachmentManager)
void renamePage(AbstractPage page, java.lang.String newPageTitle)
page
- to renamenewPageTitle
- new title for pagevoid renamePageWithoutNotifications(AbstractPage page, java.lang.String newPageTitle)
page
- to renamenewPageTitle
- new title for page@Deprecated java.util.List getPossibleRedirectsForSpace(Space space, java.lang.String pageTitle)
getPossibleRedirectsInSpace(Space, String, int)
or getPossibleRedirectsNotInSpace(Space, String, int)
java.util.List<AbstractPage> getPossibleRedirectsNotInSpace(Space space, java.lang.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 returnjava.util.List<AbstractPage> getPossibleRedirectsInSpace(Space space, java.lang.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 returnjava.util.List<AbstractPage> getPossibleBlogRedirectsInSpace(Space space, java.lang.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@Deprecated java.util.List getPossibleRedirects(java.lang.String pageTitle)
getPossibleRedirectsInSpace(Space, String, int)
or getPossibleRedirectsNotInSpace(Space, String, int)
java.util.List getRecentlyAddedBlogPosts(int maxPosts, java.util.Date timeSince, java.lang.String spaceKey)
java.util.List getPageInTrash(java.lang.String spaceKey, java.lang.String title)
boolean spaceHasBlogPosts(java.lang.String spaceKey)
java.util.List getDescendents(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)
java.util.Collection getDescendentIds(Page page)
java.util.List getTopLevelPages(Space space)
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 retrieve
void 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)
BlogPost findPreviousBlogPost(java.lang.String key, java.util.Date time)
BlogPost findNextBlogPost(java.lang.String key, java.util.Date time)
void trashPage(AbstractPage page)
ListBuilder<Page> getTopLevelPagesBuilder(Space space)
space
- the space in which to look for pages
void 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)
page
- the page to moverefPage
- the page which the first page will be made a child ofvoid 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 setChildPageOrder(Page parentPage, java.util.List<java.lang.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |