|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.core.DefaultContentEntityManager com.atlassian.confluence.pages.DefaultPageManager
public class DefaultPageManager
Field Summary | |
---|---|
static java.lang.String |
EXCERPT_KEY
|
Fields inherited from class com.atlassian.confluence.core.DefaultContentEntityManager |
---|
attachmentManager, contentEntityObjectDao, eventManager, indexer, labelManager, linkManager |
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager |
---|
ITERATE_ALL |
Constructor Summary | |
---|---|
DefaultPageManager()
|
Method Summary | |
---|---|
void |
appendPage(Page sourcePage,
Page targetParent)
Deprecated. since 2.9 use movePageAsChild(Page, Page) |
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 postTitle,
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 postTitle,
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 |
getBlogPosts(Space space,
boolean currentOnly)
|
java.util.List |
getBlogPosts(java.lang.String spaceKey,
java.util.Calendar postingDate,
int period)
|
java.util.Collection |
getDescendentIds(Page page)
|
java.util.List |
getDescendents(Page page)
|
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. |
AbstractPage |
getPageByVersion(AbstractPage mostRecentPage,
int version)
returns the historical version of a page |
java.util.List |
getPageInTrash(java.lang.String spaceKey,
java.lang.String title)
|
java.util.List |
getPages(Space space,
boolean currentOnly)
|
java.util.List |
getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)
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. |
PermissionManager |
getPermissionManager()
|
java.util.List |
getPermissionPages(Space space)
Retrieve all pages within a particular space that have page level permissions applied to them. |
java.util.List |
getPossibleRedirects(java.lang.String pageTitle)
|
java.util.List<Page> |
getPossibleRedirectsForSpace(Space space,
java.lang.String pageTitle)
|
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<Page> |
getTopLevelPages(Space space)
|
java.util.List |
getUndefinedPages(java.lang.String spaceKey)
Retrieve a list of link destinations in a given space that do not have pages. |
void |
movePage(Page page,
Page refPage,
int offset)
Deprecated. since 2.9 use movePageBefore(Page, Page) and movePageAfter(Page, Page) |
void |
movePage(Page sourcePage,
Space targetSpace)
Deprecated. since 2.9 use movePageToTopLevel(Page, Space) |
void |
movePageAfter(Page page,
Page refPage)
Move the provided page (first argument) after the reference page (second argument). |
void |
movePageAsChild(Page page,
Page newParent)
Move the source page to the end of targetPage's children list. |
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 . |
protected void |
publishCreateEvent(ContentEntityObject obj)
This method publishes *CreateEvents s. |
protected void |
publishRemoveEvent(ContentEntityObject obj)
This method publishes *RemoveEvent s. |
protected void |
publishUpdateEvent(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
This method publishes *UpdateEvent s. |
void |
removeAllBlogPosts(Space space)
|
void |
removeAllPages(Space space)
removes all the pages in a space (including all dependencies like attachments and notifications) |
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 |
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 |
saveContentEntity(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
In order to create a history for this object, we need to pass in the modified as well as the original version of the object. |
void |
saveContentEntity(ContentEntityObject obj,
SaveContext saveContext)
|
void |
setAbstractPageDao(AbstractPageDao abstractPageDao)
|
void |
setBlogPostDao(BlogPostDao blogPostDao)
|
void |
setChangeIndexer(ChangeIndexer changeIndexer)
|
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 |
setContentPropertyManager(ContentPropertyManager contentPropertyManager)
|
void |
setIndexer(ConfluenceIndexer indexer)
|
void |
setNotificationManager(NotificationManager notificationManager)
|
void |
setSpaceDao(SpaceDao spaceDao)
|
boolean |
spaceHasBlogPosts(java.lang.String spaceKey)
|
void |
trashPage(AbstractPage page)
|
void |
updatePageInAncestorCollections(Page page,
Page newParent)
Updates the ancestors of a page and all it's descendant pages with the new parent page and its ancestors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.confluence.pages.PageManager |
---|
setAttachmentManager |
Field Detail |
---|
public static final java.lang.String EXCERPT_KEY
Constructor Detail |
---|
public DefaultPageManager()
Method Detail |
---|
public void renamePage(AbstractPage page, java.lang.String newPageTitle)
renamePage
in interface PageManager
page
- to renamenewPageTitle
- new title for pagepublic java.util.List getBlogPosts(Space space, boolean currentOnly)
getBlogPosts
in interface PageManager
public java.util.List<Page> getPossibleRedirectsForSpace(Space space, java.lang.String pageTitle)
getPossibleRedirectsForSpace
in interface PageManager
public java.util.List getPossibleRedirects(java.lang.String pageTitle)
getPossibleRedirects
in interface PageManager
public java.util.List getRecentlyAddedBlogPosts(int maxPosts, java.util.Date timeSince, java.lang.String spaceKey)
getRecentlyAddedBlogPosts
in interface PageManager
public void setBlogPostDao(BlogPostDao blogPostDao)
public Page getPage(long id)
PageManager
getPage
in interface PageManager
id
- the database content ID for the page to return
public AbstractPage getAbstractPage(long id)
PageManager
getAbstractPage
in interface PageManager
id
- the database content ID for the page to return
public BlogPost getBlogPost(long id)
PageManager
getBlogPost
in interface PageManager
id
- the database content ID for the blog post to return
public Page getPage(java.lang.String spaceKey, java.lang.String pageTitle)
PageManager
getPage
in interface PageManager
public Page getPageWithComments(java.lang.String spaceKey, java.lang.String pageTitle)
PageManager
getPageWithComments
in interface PageManager
@Deprecated public Page getPage(java.lang.String spaceKey, java.lang.String pageTitle, boolean eagerLoadComments)
PageManager
getPage
in interface PageManager
public java.util.List getPageInTrash(java.lang.String spaceKey, java.lang.String title)
getPageInTrash
in interface PageManager
public boolean spaceHasBlogPosts(java.lang.String spaceKey)
spaceHasBlogPosts
in interface PageManager
public java.util.List getDescendents(Page page)
getDescendents
in interface PageManager
public void updatePageInAncestorCollections(Page page, Page newParent)
PageManager
updatePageInAncestorCollections
in interface PageManager
page
- the page being updated with new ancestorsnewParent
- the new parent page of the page being updatedpublic void removePageFromAncestorCollections(Page page)
PageManager
removePageFromAncestorCollections
in interface PageManager
public void removeAllPages(Space space)
removeAllPages
in interface PageManager
space
- the space to remove all pages for.public void removeAllBlogPosts(Space space)
removeAllBlogPosts
in interface PageManager
public java.util.Collection getDescendentIds(Page page)
getDescendentIds
in interface PageManager
public java.util.List<Page> getTopLevelPages(Space space)
getTopLevelPages
in interface PageManager
public BlogPost findPreviousBlogPost(java.lang.String key, java.util.Date time)
findPreviousBlogPost
in interface PageManager
public BlogPost findNextBlogPost(java.lang.String key, java.util.Date time)
findNextBlogPost
in interface PageManager
public void trashPage(AbstractPage page)
trashPage
in interface PageManager
public void restorePage(AbstractPage page)
PageManager
restorePage
in interface PageManager
page
- a trashed pagepublic void movePageToTopLevel(Page page, Space space)
PageManager
targetSpace
. If the top-level pages are manually ordered, the page
will be added to the end of the child pages.
movePageToTopLevel
in interface PageManager
page
- the page to movespace
- the space to move the page topublic void movePage(Page sourcePage, Space targetSpace)
movePageToTopLevel(Page, Space)
movePage
in interface PageManager
public void movePageAfter(Page page, Page refPage)
PageManager
movePageAfter
in interface PageManager
page
- the page to moverefPage
- the page which the first page will be placed afterpublic void movePageBefore(Page page, Page refPage)
PageManager
movePageBefore
in interface PageManager
page
- the page to moverefPage
- the page which the first page will be placed beforepublic void movePage(Page page, Page refPage, int offset)
movePageBefore(Page, Page)
and movePageAfter(Page, Page)
movePage
in interface PageManager
public void movePageAsChild(Page page, Page newParent)
movePageAsChild
in interface PageManager
page
- the page to movenewParent
- the page which the first page will be made a child ofpublic void appendPage(Page sourcePage, Page targetParent)
movePageAsChild(Page, Page)
appendPage
in interface PageManager
public void setChildPageOrder(Page parentPage, java.util.List<java.lang.Long> childIds)
PageManager
setChildPageOrder
in interface PageManager
parentPage
- the page for which children should be ordered.childIds
- children page IDs in the new orderpublic void revertChildPageOrder(Page parentPage)
PageManager
revertChildPageOrder
in interface PageManager
parentPage
- the page for which children should be unordered.public AbstractPage getPageByVersion(AbstractPage mostRecentPage, int version)
PageManager
getPageByVersion
in interface PageManager
mostRecentPage
- - must specify the most recent recent version of the page (page must be associated with a space)version
- - historical version to retrieve
public BlogPost getBlogPost(java.lang.String spaceKey, java.lang.String postTitle, java.util.Calendar day)
PageManager
getBlogPost
in interface PageManager
public BlogPost getBlogPost(java.lang.String spaceKey, java.lang.String postTitle, java.util.Calendar day, boolean eagerLoadComments)
PageManager
getBlogPost
in interface PageManager
public java.util.List getRecentlyAddedBlogPosts(int maxCount, java.lang.String spaceKey)
PageManager
SmartListManager
provides a more flexible (and more efficient) way
to perform this query, including accounting for user permissions.
getRecentlyAddedBlogPosts
in interface PageManager
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
public java.util.List getRecentlyAddedPages(int maxCount, java.lang.String spaceKey)
PageManager
SmartListManager
provides a more flexible (and more efficient) way
to perform this query, including accounting for user permissions.
getRecentlyAddedPages
in interface PageManager
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
public java.util.List getRecentlyUpdatedPages(int maxCount, java.lang.String spaceKey)
PageManager
SmartListManager
provides a more flexible (and more efficient) way
to perform this query, including accounting for user permissions.
getRecentlyUpdatedPages
in interface PageManager
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
public java.util.List getOrphanedPages(java.lang.String spaceKey)
PageManager
getOrphanedPages
in interface PageManager
spaceKey
- the key of the space to look for orphans in, or null to search all spaces
public java.util.List getUndefinedPages(java.lang.String spaceKey)
PageManager
getUndefinedPages
in interface PageManager
spaceKey
- the key of the space to look for undefined pages in, or null to search all spaces
public java.util.List getPermissionPages(Space space)
PageManager
getPermissionPages
in interface PageManager
space
- the space to search
public void saveContentEntity(ContentEntityObject obj, SaveContext saveContext)
saveContentEntity
in interface ContentEntityManager
saveContentEntity
in class DefaultContentEntityManager
obj
- - the ContentEntityObject
to savesaveContext
- - a SaveContext
object for the manager.
DuplicateDataRuntimeException
- if the supplied page has a duplicate title.public void saveContentEntity(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
ContentEntityManager
saveContentEntity
in interface ContentEntityManager
saveContentEntity
in class DefaultContentEntityManager
saveContext
- - a SaveContext
holding additional parameters for the manager to use when saving.
DuplicateDataRuntimeException
- if the supplied page has a duplicate title.protected void publishCreateEvent(ContentEntityObject obj)
DefaultContentEntityManager
*CreateEvents
s.
Specific content entity object manager that need to publish those events should override this method.
publishCreateEvent
in class DefaultContentEntityManager
obj
- the created content entity objectprotected void publishUpdateEvent(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
DefaultContentEntityManager
*UpdateEvent
s.
Specific content entity object manager that need to publish those events should override this method.
publishUpdateEvent
in class DefaultContentEntityManager
obj
- the updated content entity objectorigObj
- the old version of the content entity object, for history purposesaveContext
- the associated SaveContext
protected void publishRemoveEvent(ContentEntityObject obj)
DefaultContentEntityManager
*RemoveEvent
s.
Specific content entity object manager that need to publish those events should override this method.
publishRemoveEvent
in class DefaultContentEntityManager
obj
- the removed content entity objectpublic int getAuthoredPagesCountByUser(java.lang.String username)
PageManager
getAuthoredPagesCountByUser
in interface PageManager
username
- the username of the user to search for
public java.util.List getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)
PageManager
getPagesCreatedOrUpdatedSinceDate
in interface PageManager
previousLoginDate
- the date the pages must have been created or edited after
public java.util.List getBlogPosts(java.lang.String spaceKey, java.util.Calendar postingDate, int period)
getBlogPosts
in interface PageManager
public java.util.List getPages(Space space, boolean currentOnly)
getPages
in interface PageManager
public java.util.List getPagesStartingWith(Space space, java.lang.String s)
getPagesStartingWith
in interface PageManager
public BlogPost findPreviousBlogPost(BlogPost post)
findPreviousBlogPost
in interface PageManager
public BlogPost findNextBlogPost(BlogPost post)
findNextBlogPost
in interface PageManager
public NotificationManager getNotificationManager()
getNotificationManager
in interface PageManager
public void setNotificationManager(NotificationManager notificationManager)
setNotificationManager
in interface PageManager
public AttachmentManager getAttachmentManager()
getAttachmentManager
in interface PageManager
public void setIndexer(ConfluenceIndexer indexer)
setIndexer
in class DefaultContentEntityManager
public void setContentPropertyManager(ContentPropertyManager contentPropertyManager)
public void setAbstractPageDao(AbstractPageDao abstractPageDao)
public void setSpaceDao(SpaceDao spaceDao)
public PermissionManager getPermissionManager()
public void setChangeIndexer(ChangeIndexer changeIndexer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |