|
||||||||||
| 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 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 | |
|---|---|
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. |
AttachmentManager |
getAttachmentManager()
|
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 postTitle,
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 postTitle,
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. |
List<BlogPost> |
getBlogPosts(Space space,
boolean currentOnly)
|
List |
getBlogPosts(String spaceKey,
Calendar postingDate,
int period)
|
ContentEntityObject |
getById(long id)
Override default implementation to explicitly return an AbstractPage. |
int |
getCommentCountOnPage(long pageId)
Counts the number of comments on the page specified by the given id. |
Collection |
getDescendentIds(Page page)
|
List |
getDescendents(Page page)
|
NotificationManager |
getNotificationManager()
|
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. |
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(Space space,
boolean currentOnly)
|
List |
getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
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. |
PermissionManager |
getPermissionManager()
|
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 |
getPossibleRedirects(String pageTitle)
|
List<AbstractPage> |
getPossibleRedirectsForSpace(Space space,
String pageTitle)
|
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 |
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<Page> |
getTopLevelPages(Space space)
Get all the pages in a space that do not have a parent page. |
ListBuilder<Page> |
getTopLevelPagesBuilder(Space space)
NOTE: Despite our best intentions, we still have to retrieve all the top level pages and order them outside the database. |
List |
getUndefinedPages(String spaceKey)
Retrieve a list of link destinations in a given space that do not have pages. |
List<Page> |
getUnsortedTopLevelPages(Space 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 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 pages in the space. |
void |
removeAllPages(Space space,
com.atlassian.core.util.ProgressMeter progress)
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,
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 |
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,
List<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 |
setHibernateSessionManager(HibernateSessionManager hibernateSessionManager)
|
void |
setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
|
void |
setIndexer(ConfluenceIndexer indexer)
|
void |
setLoginManager(LoginManager loginManager)
|
void |
setNotificationManager(NotificationManager notificationManager)
|
void |
setSpaceDao(SpaceDao spaceDao)
|
boolean |
spaceHasBlogPosts(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 String EXCERPT_KEY
| Constructor Detail |
|---|
public DefaultPageManager()
| Method Detail |
|---|
public void renamePage(AbstractPage page,
String newPageTitle)
PageManager
renamePage in interface PageManagerpage - to renamenewPageTitle - new title for page
public void renamePageWithoutNotifications(AbstractPage page,
String newPageTitle)
PageManager
renamePageWithoutNotifications in interface PageManagerpage - to renamenewPageTitle - new title for page
public List<BlogPost> getBlogPosts(Space space,
boolean currentOnly)
getBlogPosts in interface PageManager
public List<AbstractPage> getPossibleRedirectsForSpace(Space space,
String pageTitle)
getPossibleRedirectsForSpace in interface PageManager
public List<AbstractPage> getPossibleRedirectsInSpace(Space space,
String pageTitle,
int maxResultCount)
PageManager
getPossibleRedirectsInSpace in interface PageManagerspace - Space to search. Must not be null.pageTitle - title of a page in a previous version.maxResultCount - maximum pages to return
public List<AbstractPage> getPossibleBlogRedirectsInSpace(Space space,
String blogTitle,
int maxResultCount)
PageManager
getPossibleBlogRedirectsInSpace in interface PageManagerspace - Space to search. Must not be null.blogTitle - title of a blog in a previous version.maxResultCount - maximum blogs to return
public List<AbstractPage> getPossibleRedirectsNotInSpace(Space space,
String pageTitle,
int maxResultCount)
PageManager
getPossibleRedirectsNotInSpace in interface PageManagerspace - Space to exclude from search. If null, all spaces are searched.pageTitle - title of a page in a previous version.maxResultCount - maximum pages to returnpublic List getPossibleRedirects(String pageTitle)
getPossibleRedirects in interface PageManager
public List getRecentlyAddedBlogPosts(int maxPosts,
Date timeSince,
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 ContentEntityObject getById(long id)
getById in interface ContentEntityManagergetById in class DefaultContentEntityManagerpublic BlogPost getBlogPost(long id)
PageManager
getBlogPost in interface PageManagerid - the database content ID for the blog post to return
public Page getPage(String spaceKey,
String pageTitle)
PageManager
getPage in interface PageManager
public Page getPageWithComments(String spaceKey,
String pageTitle)
PageManager
getPageWithComments in interface PageManagerpublic int getCommentCountOnPage(long pageId)
PageManager
getCommentCountOnPage in interface PageManagerpageId - the id to check for comments on
@Deprecated
public Page getPage(String spaceKey,
String pageTitle,
boolean eagerLoadComments)
PageManager
getPage in interface PageManager
public List getPageInTrash(String spaceKey,
String title)
getPageInTrash in interface PageManagerpublic boolean spaceHasBlogPosts(String spaceKey)
spaceHasBlogPosts in interface PageManagerpublic List getDescendents(Page page)
getDescendents in interface PageManager
public void updatePageInAncestorCollections(Page page,
@Nullable
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)
PageManager
removeAllPages in interface PageManagerspace - the space to remove pages from.
public void removeAllPages(Space space,
com.atlassian.core.util.ProgressMeter progress)
removeAllPages in interface PageManagerspace - the space to remove all pages for.progress - progress meter to report progress on, can not be null.public void removeAllBlogPosts(Space space)
removeAllBlogPosts in interface PageManagerpublic Collection getDescendentIds(Page page)
getDescendentIds in interface PageManagerpublic List<Page> getTopLevelPages(Space space)
PageManager
getTopLevelPages in interface PageManagerpublic List<Page> getUnsortedTopLevelPages(Space space)
public ListBuilder<Page> getTopLevelPagesBuilder(Space space)
getTopLevelPagesBuilder in interface PageManagerspace - the space in which to look for pages
public BlogPost findPreviousBlogPost(String key,
Date time)
findPreviousBlogPost in interface PageManager
public BlogPost findNextBlogPost(String key,
Date time)
findNextBlogPost in interface PageManagerpublic void trashPage(AbstractPage page)
trashPage in interface PageManagerpublic void restorePage(AbstractPage page)
PageManager
restorePage in interface PageManagerpage - a trashed page
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 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 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 setChildPageOrder(Page parentPage,
List<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(String spaceKey,
String postTitle,
Calendar day)
PageManager
getBlogPost in interface PageManager
public BlogPost getBlogPost(String spaceKey,
String postTitle,
Calendar day,
boolean eagerLoadComments)
PageManager
getBlogPost in interface PageManager
public List getRecentlyAddedBlogPosts(int maxCount,
String spaceKey)
PageManagerSearchManager
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 List getRecentlyAddedPages(int maxCount,
String spaceKey)
PageManagerSearchManager
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 List getRecentlyUpdatedPages(int maxCount,
String spaceKey)
PageManagerSearchManager
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 List getOrphanedPages(String spaceKey)
PageManager
getOrphanedPages in interface PageManagerspaceKey - the key of the space to look for orphans in, or null to search all spaces
public List getUndefinedPages(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 List getPermissionPages(Space space)
PageManager
getPermissionPages in interface PageManagerspace - the space to search
public void saveContentEntity(ContentEntityObject obj,
SaveContext saveContext)
saveContentEntity in interface ContentEntityManagersaveContentEntity in class DefaultContentEntityManagerobj - - 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 ContentEntityManagersaveContentEntity in class DefaultContentEntityManagersaveContext - - 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*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(String username)
PageManager
getAuthoredPagesCountByUser in interface PageManagerusername - the username of the user to search for
public boolean isPageRecentlyUpdatedForUser(Page page,
com.atlassian.user.User user)
PageManager
isPageRecentlyUpdatedForUser in interface PageManagerpage - the page in questionuser - the user or null if it is the anonymous user
public List getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
PageManager
getPagesCreatedOrUpdatedSinceDate in interface PageManagerpreviousLoginDate - the date the pages must have been created or edited after
public List getBlogPosts(String spaceKey,
Calendar postingDate,
int period)
getBlogPosts in interface PageManager
public List<Page> getPages(Space space,
boolean currentOnly)
getPages in interface PageManagerpublic Collection<Long> getPageIds(Space space)
PageManager
getPageIds in interface PageManagerspace - space to retrieve page ids from, can not be null.
public List getPagesStartingWith(Space space,
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 setIndexer(ConfluenceIndexer indexer)
setIndexer in class DefaultContentEntityManagerpublic void setContentPropertyManager(ContentPropertyManager contentPropertyManager)
public void setAbstractPageDao(AbstractPageDao abstractPageDao)
public void setSpaceDao(SpaceDao spaceDao)
public PermissionManager getPermissionManager()
public void setChangeIndexer(ChangeIndexer changeIndexer)
public void setLoginManager(LoginManager loginManager)
public void setHibernateSessionManager(HibernateSessionManager hibernateSessionManager)
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||