|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 |
|---|
contentEntityObjectDao, eventManager, indexer, 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)
Retrieve the latest version of a page by its space key and title. |
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)
|
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 *CreateEventss. |
protected void |
publishRemoveEvent(ContentEntityObject obj)
This method publishes *RemoveEvents. |
protected void |
publishUpdateEvent(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
This method publishes *UpdateEvents. |
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)
|
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 |
setAbstractPageDao(AbstractPageDao abstractPageDao)
|
void |
setAttachmentManager(AttachmentManager attachmentManager)
|
void |
setBlogPostDao(BlogPostDao blogPostDao)
|
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)
|
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 |
| 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 PageManagerpage - to renamenewPageTitle - new title for page
public 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 PageManagerpublic 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 PageManagerpublic void setBlogPostDao(BlogPostDao blogPostDao)
public Page getPage(long id)
PageManager
getPage in interface PageManagerid - the database content ID for the page to return
public AbstractPage getAbstractPage(long id)
PageManager
getAbstractPage in interface PageManagerid - the database content ID for the page to return
public BlogPost getBlogPost(long id)
PageManager
getBlogPost in interface PageManagerid - 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 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 PageManagerpublic boolean spaceHasBlogPosts(java.lang.String spaceKey)
spaceHasBlogPosts in interface PageManagerpublic java.util.List getDescendents(Page page)
getDescendents in interface PageManager
public void updatePageInAncestorCollections(Page page,
Page newParent)
PageManager
updatePageInAncestorCollections in interface PageManagerpage - the page being updated with new ancestorsnewParent - the new parent page of the page being updatedpublic void removePageFromAncestorCollections(Page page)
PageManager
removePageFromAncestorCollections in interface PageManagerpublic void removeAllPages(Space space)
removeAllPages in interface PageManagerspace - the space to remove all pages for.public void removeAllBlogPosts(Space space)
removeAllBlogPosts in interface PageManagerpublic java.util.Collection getDescendentIds(Page page)
getDescendentIds in interface PageManagerpublic 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 PageManagerpublic void trashPage(AbstractPage page)
trashPage in interface PageManagerpublic void restorePage(AbstractPage page)
restorePage in interface PageManager
public void movePageToTopLevel(Page page,
Space space)
PageManagertargetSpace. If the top-level pages are manually ordered, the page
will be added to the end of the child pages.
movePageToTopLevel in interface PageManagerpage - the page to movespace - the space to move the page to
public void movePage(Page sourcePage,
Space targetSpace)
movePageToTopLevel(Page, Space)
movePage in interface PageManager
public void movePageAfter(Page page,
Page refPage)
PageManager
movePageAfter in interface PageManagerpage - the page to moverefPage - the page which the first page will be placed after
public void movePageBefore(Page page,
Page refPage)
PageManager
movePageBefore in interface PageManagerpage - the page to moverefPage - the page which the first page will be placed before
public 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 PageManagerpage - the page to movenewParent - the page which the first page will be made a child of
public 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 PageManagerparentPage - the page for which children should be ordered.childIds - children page IDs in the new orderpublic void revertChildPageOrder(Page parentPage)
PageManager
revertChildPageOrder in interface PageManagerparentPage - the page for which children should be unordered.
public AbstractPage getPageByVersion(AbstractPage mostRecentPage,
int version)
PageManager
getPageByVersion in interface PageManagermostRecentPage - - 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)
PageManagerSmartListManager provides a more flexible (and more efficient) way
to perform this query, including accounting for user permissions.
getRecentlyAddedBlogPosts in interface PageManagermaxCount - 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)
PageManagerSmartListManager provides a more flexible (and more efficient) way
to perform this query, including accounting for user permissions.
getRecentlyAddedPages in interface PageManagermaxCount - 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)
PageManagerSmartListManager provides a more flexible (and more efficient) way
to perform this query, including accounting for user permissions.
getRecentlyUpdatedPages in interface PageManagermaxCount - 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 PageManagerspaceKey - 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 PageManagerspaceKey - 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 PageManagerspace - the space to search
public void saveContentEntity(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
ContentEntityManager
saveContentEntity in interface ContentEntityManagersaveContentEntity in class DefaultContentEntityManagersaveContext - - a SaveContext holding additional parameters for the manager to use when saving.protected void publishCreateEvent(ContentEntityObject obj)
DefaultContentEntityManager*CreateEventss.
Specific content entity object manager that need to publish those events should override this method.
publishCreateEvent in class DefaultContentEntityManagerobj - the created content entity object
protected void publishUpdateEvent(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
DefaultContentEntityManager*UpdateEvents.
Specific content entity object manager that need to publish those events should override this method.
publishUpdateEvent in class DefaultContentEntityManagerobj - the updated content entity objectorigObj - the old version of the content entity object, for history purposesaveContext - the associated SaveContextprotected void publishRemoveEvent(ContentEntityObject obj)
DefaultContentEntityManager*RemoveEvents.
Specific content entity object manager that need to publish those events should override this method.
publishRemoveEvent in class DefaultContentEntityManagerobj - the removed content entity objectpublic int getAuthoredPagesCountByUser(java.lang.String username)
PageManager
getAuthoredPagesCountByUser in interface PageManagerusername - the username of the user to search for
public java.util.List getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)
PageManager
getPagesCreatedOrUpdatedSinceDate in interface PageManagerpreviousLoginDate - 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 PageManagerpublic BlogPost findPreviousBlogPost(BlogPost post)
findPreviousBlogPost in interface PageManagerpublic BlogPost findNextBlogPost(BlogPost post)
findNextBlogPost in interface PageManagerpublic NotificationManager getNotificationManager()
getNotificationManager in interface PageManagerpublic void setNotificationManager(NotificationManager notificationManager)
setNotificationManager in interface PageManagerpublic AttachmentManager getAttachmentManager()
getAttachmentManager in interface PageManagerpublic void setAttachmentManager(AttachmentManager attachmentManager)
setAttachmentManager in interface PageManagerpublic void setIndexer(ConfluenceIndexer indexer)
setIndexer in class DefaultContentEntityManagerpublic void setContentPropertyManager(ContentPropertyManager contentPropertyManager)
public void setAbstractPageDao(AbstractPageDao abstractPageDao)
public PermissionManager getPermissionManager()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||