public class DefaultPageManager extends DefaultContentEntityManager implements PageManagerInternal
Modifier and Type | Field and Description |
---|---|
static String |
EXCERPT_KEY |
attachmentManager, contentEntityObjectDao, eventManager, hibernateSessionManager, indexer, labelManager, linkManager
ITERATE_ALL
Constructor and Description |
---|
DefaultPageManager() |
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.
|
PageResponse<AbstractPage> |
getAbstractPagesByCreationDate(org.joda.time.DateTime date,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage>... filter)
Returns the pages and blogposts created on the given date, that also match the given predicate, limited to the page request
|
PageResponse<AbstractPage> |
getAbstractPagesByTitle(String title,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage>... filter)
Returns the pages and blogposts that exactly match the given title, that also match the given predicate, limited to the pagination request
|
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.
|
long |
getBlogPostCount(String spaceKey,
Calendar postingDate,
int period)
Get total number of blogPost.
|
List<BlogPost> |
getBlogPosts(Space space,
boolean currentOnly) |
PageResponse<BlogPost> |
getBlogPosts(Space space,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super BlogPost>... filters)
Returns all the current blogposts in the space, limited to the pagination request
|
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.
|
protected BodyContent |
getBodyContentForRevert(ContentEntityObject historicalVersion) |
AbstractPage |
getById(long id)
Override default implementation to explicitly return an AbstractPage.
|
PageResponse<Page> |
getChildren(Page page,
LimitedRequest pageRequest,
Depth depth)
Returns the children of a page, limited to the pagination requested.
|
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) |
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() |
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.
|
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.
|
PageResponse<Page> |
getPages(LimitedRequest pageRequest,
com.google.common.base.Predicate<? super Page>... filters)
Returns all the current pages in this instance of confluence, limited to the pagination request.
|
List<Page> |
getPages(Space space,
boolean currentOnly) |
PageResponse<Page> |
getPages(Space space,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super Page>... filters)
Returns all the current pages in the space, limited to the pagination request
|
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<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<Page> |
getTopLevelPages(Space space)
Get all the pages in a space that do not have a parent page.
|
PageResponse<Page> |
getTopLevelPages(Space space,
LimitedRequest pageRequest)
Returns the top-level pages in a space, limited to the pagination requested.
|
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) |
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 oldPage,
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
The location of the children under their new parent is dependent on the new parent's existing order.
|
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 |
publishCreateEvent(ContentEntityObject obj,
SaveContext saveContext) |
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 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 |
setI18NBeanFactory(I18NBeanFactory i18NBeanFactory) |
void |
setIndexer(ConfluenceIndexer indexer) |
void |
setLoginManager(LoginManager loginManager) |
void |
setNotificationManager(NotificationManager notificationManager) |
void |
setRevertedContentMigratorRef(com.atlassian.util.concurrent.Supplier<ExceptionTolerantMigrator> migratorRef) |
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.
|
getById, getEventManager, getNextVersion, getOtherVersion, getPageDao, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, refreshContentEntity, removeContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveNewVersion, saveNewVersion, setAttachmentManager, setContentEntityObjectDao, setEventManager, setHibernateSessionManager, setLabelManager, setLinkManager, suppressNotificationsOnEventIfRequired, updateContentLinkingTo, updateContentLinkingTo, updateOutgoingLinksInContent, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo, updateSingleContentLinkinTo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAttachmentManager
getNextVersion, getOtherVersion, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, refreshContentEntity, removeContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveNewVersion, saveNewVersion, setEventManager, updateContentLinkingTo, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo
public static final String EXCERPT_KEY
public void renamePage(AbstractPage page, String newPageTitle)
PageManager
renamePage
in interface PageManager
page
- to renamenewPageTitle
- new title for pagepublic void renamePageWithoutNotifications(AbstractPage page, String newPageTitle)
PageManager
renamePageWithoutNotifications
in interface PageManager
page
- to renamenewPageTitle
- new title for pagepublic 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 PageManager
space
- Space to search. Must not be null.pageTitle
- title of a page in a previous version.maxResultCount
- maximum pages to returnpublic List<AbstractPage> getPossibleBlogRedirectsInSpace(Space space, String blogTitle, int maxResultCount)
PageManager
getPossibleBlogRedirectsInSpace
in interface PageManager
space
- Space to search. Must not be null.blogTitle
- title of a blog in a previous version.maxResultCount
- maximum blogs to returnpublic List<AbstractPage> getPossibleRedirectsNotInSpace(Space space, String pageTitle, int maxResultCount)
PageManager
getPossibleRedirectsNotInSpace
in interface PageManager
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 returnpublic List getPossibleRedirects(String pageTitle)
getPossibleRedirects
in interface PageManager
public List getRecentlyAddedBlogPosts(int maxPosts, Date timeSince, 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 returnpublic List<Page> getPages(Iterable<Long> ids)
PageManager
getPages
in interface PageManager
ids
- an Iterable of content IDs for the pages to returnpublic AbstractPage getAbstractPage(long id)
PageManager
getAbstractPage
in interface PageManager
id
- the database content ID for the page to returnpublic List<AbstractPage> getAbstractPages(Iterable<Long> ids)
PageManager
getAbstractPages
in interface PageManager
ids
- an Iterable of content IDs for the pages or blogposts to returnpublic AbstractPage getById(long id)
getById
in interface ContentEntityManager
getById
in class DefaultContentEntityManager
public BlogPost getBlogPost(long id)
PageManager
getBlogPost
in interface PageManager
id
- the database content ID for the blog post to returnpublic Page getPage(String spaceKey, String pageTitle)
PageManager
getPage
in interface PageManager
public Page getPageWithComments(String spaceKey, String pageTitle)
PageManager
getPageWithComments
in interface PageManager
public PageResponse<AbstractPage> getAbstractPagesByTitle(String title, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage>... filter)
PageManagerInternal
getAbstractPagesByTitle
in interface PageManagerInternal
title
- the title of the page to matchpageRequest
- the pagination requestedfilter
- a Predicate to apply to the results before returningpublic PageResponse<AbstractPage> getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage>... filter)
PageManagerInternal
getAbstractPagesByCreationDate
in interface PageManagerInternal
date
- - the creation date to matchpageRequest
- the pagination requestfilter
- a Predicate to apply to the results before returningpublic int getCommentCountOnPage(long pageId)
PageManager
getCommentCountOnPage
in interface PageManager
pageId
- 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 PageManager
public boolean spaceHasBlogPosts(String spaceKey)
spaceHasBlogPosts
in interface PageManager
public List<Page> getDescendants(Page page)
PageManager
getDescendants
in interface PageManager
public List<String> getDescendantTitles(Page page)
PageManager
getDescendantTitles
in interface PageManager
public List getDescendents(Page page)
getDescendants(Page)
getDescendents
in interface PageManager
public void updatePageInAncestorCollections(Page page, @Nullable 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)
PageManager
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.
removeAllPages
in interface PageManager
space
- the space to remove pages from.public void removeAllPages(Space space, com.atlassian.core.util.ProgressMeter progress)
removeAllPages
in interface PageManager
space
- 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 PageManager
public Collection<Long> getDescendantIds(Page page)
PageManager
getDescendantIds
in interface PageManager
public Collection getDescendentIds(Page page)
getDescendentIds
in interface PageManager
public List<Page> getTopLevelPages(Space space)
PageManager
getTopLevelPages
in interface PageManager
public ListBuilder<Page> getTopLevelPagesBuilder(Space space)
getTopLevelPagesBuilder
in interface PageManager
space
- the space in which to look for pagespublic PageResponse<Page> getTopLevelPages(Space space, LimitedRequest pageRequest)
PageManagerInternal
getTopLevelPages
in interface PageManagerInternal
space
- the space to locate pages inpageRequest
- the pagination requestedpublic PageResponse<Page> getChildren(Page page, LimitedRequest pageRequest, Depth depth)
PageManagerInternal
getChildren
in interface PageManagerInternal
page
- the page to find children forpageRequest
- the pagination requesteddepth
- the depth to return children topublic BlogPost findPreviousBlogPost(String key, Date time)
findPreviousBlogPost
in interface PageManager
public BlogPost findNextBlogPost(String key, 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 moveBlogPostToTopLevel(BlogPost blogPost, Space space)
PageManager
targetSpace
.moveBlogPostToTopLevel
in interface PageManager
blogPost
- the blogPost to movespace
- the space to move the page topublic 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 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 moveChildrenToNewParent(Page oldPage, Page newParent)
PageManager
moveChildrenToNewParent
in interface PageManager
oldPage
- the page whose children you want to movenewParent
- the page whose the children will now belong topublic void setChildPageOrder(Page parentPage, List<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 List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId, long endContentId, int maxRows)
PageManager
getOrderedXhtmlContentFromContentId
in interface PageManager
startContentId
- The minimum IDendContentId
- The maximum IDmaxRows
- The maximum number of rows to returnpublic int getCountOfLatestXhtmlContent(long endContentId)
PageManager
getCountOfLatestXhtmlContent
in interface PageManager
endContentId
- The maximum IDpublic long getHighestCeoId()
PageManager
getHighestCeoId
in interface PageManager
public List<ContentEntityObject> getPreviousVersionsOfPageWithTaskId(long pageId, long taskId, int maxRows)
PageManager
getPreviousVersionsOfPageWithTaskId
in interface PageManager
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 returnpublic 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 retrievepublic 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 BlogPost getNewestBlogPost(String spaceKey)
PageManager
getNewestBlogPost
in interface PageManager
spaceKey
- the key of the space to retrieve the most recently created blog post for.public List getRecentlyAddedBlogPosts(int maxCount, String spaceKey)
PageManager
SearchManager
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 spacespublic List getRecentlyAddedPages(int maxCount, String spaceKey)
PageManager
SearchManager
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 spacespublic List getRecentlyUpdatedPages(int maxCount, String spaceKey)
PageManager
SearchManager
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 spacespublic List getOrphanedPages(String spaceKey)
PageManager
getOrphanedPages
in interface PageManager
spaceKey
- the key of the space to look for orphans in, or null to search all spacespublic List getUndefinedPages(String spaceKey)
PageManager
getUndefinedPages
in interface PageManager
spaceKey
- the key of the space to look for undefined pages in, or null to search all spacespublic List getPermissionPages(Space space)
PageManager
getPermissionPages
in interface PageManager
space
- the space to searchpublic 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 publishCreateEvent(ContentEntityObject obj, SaveContext saveContext)
publishCreateEvent
in class DefaultContentEntityManager
protected 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(String username)
PageManager
getAuthoredPagesCountByUser
in interface PageManager
username
- the username of the user to search forpublic boolean isPageRecentlyUpdatedForUser(Page page, com.atlassian.user.User user)
PageManager
isPageRecentlyUpdatedForUser
in interface PageManager
page
- the page in questionuser
- the user or null if it is the anonymous userprotected BodyContent getBodyContentForRevert(ContentEntityObject historicalVersion)
getBodyContentForRevert
in class DefaultContentEntityManager
public List getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
PageManager
getPagesCreatedOrUpdatedSinceDate
in interface PageManager
previousLoginDate
- the date the pages must have been created or edited afterpublic List getBlogPosts(String spaceKey, Calendar postingDate, int period)
PageManager
getBlogPosts
in interface PageManager
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 supportedpublic List getBlogPosts(String spaceKey, Calendar postingDate, int period, int startIndex, int maxResultCount)
PageManager
getBlogPosts
in interface PageManager
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 returnpublic long getBlogPostCount(String spaceKey, Calendar postingDate, int period)
PageManager
getBlogPostCount
in interface PageManager
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 supportedpublic Set<Date> getYearsWithBlogPosts(String spaceKey)
PageManager
getYearsWithBlogPosts
in interface PageManager
spaceKey
- the key of the space to look for blog posts in.public Set<Date> getMonthsWithBlogPosts(String spaceKey, Calendar year)
PageManager
getMonthsWithBlogPosts
in interface PageManager
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.public List<Page> getPages(Space space, boolean currentOnly)
getPages
in interface PageManager
public PageResponse<Page> getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page>... filters)
PageManagerInternal
getPages
in interface PageManagerInternal
space
- the space to locate pages inpageRequest
- the pagination requestedfilters
- a Predicate to apply to the results before returningpublic PageResponse<Page> getPages(LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page>... filters)
PageManagerInternal
getPages
in interface PageManagerInternal
pageRequest
- the pagination requestedfilters
- a Predicate to apply to the results before returningpublic PageResponse<BlogPost> getBlogPosts(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super BlogPost>... filters)
PageManagerInternal
getBlogPosts
in interface PageManagerInternal
public Collection<Long> getPageIds(Space space)
PageManager
getPageIds
in interface PageManager
space
- space to retrieve page ids from, can not be null.public List getPagesStartingWith(Space space, 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)
public void setLoginManager(LoginManager loginManager)
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
public void setRevertedContentMigratorRef(com.atlassian.util.concurrent.Supplier<ExceptionTolerantMigrator> migratorRef)