public class DelegatingPageDao extends Object implements PageDaoInternal
PageDaoInternal
implementation that just delegates to another one.
Useful mostly for subclassing and overriding of selected methods.
Modifier | Constructor and Description |
---|---|
protected |
DelegatingPageDao(PageDaoInternal delegateDao) |
Modifier and Type | Method and Description |
---|---|
int |
countAllPages()
Counts the total number of all page entities across all spaces, including non-current pages
|
int |
countContentBySpaceIdAndStatus(long spaceId,
String status)
Retrieve the count of content for a given space with a particular status.
|
int |
countCurrentPages()
Counts the total number of current pages across all spaces
|
int |
countDraftPages()
Counts the number of pages that are drafts.
|
int |
countPagesInSubtree(@NonNull Page page)
Return total descendant page including input page
|
int |
countPagesWithUnpublishedChanges()
Counts the number of published pages that have unpublished changes.
|
@NonNull List<Page> |
findAll()
Find all objects currently persisted of a particular type.
|
List<ContentEntityObject> |
findAllDraftsFor(long contentId)
Retrieves a list of drafts for the given content if any drafts exist.
|
List<Draft> |
findAllLegacyDraftsFor(long contentId)
Retrieves a list of Legacy drafts for the given content if any exist.
|
@NonNull List<Page> |
findAllSorted(String s)
Find all objects currently persisted of a particular type and sort results by named property.
|
@NonNull List<Page> |
findAllSorted(String s,
boolean cached,
int firstRow,
int maxRows)
Find all objects currently persisted of a particular type and sort results by named property.
|
List<AbstractPage> |
findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder,
String blogTitle,
Space space,
int maxResultCount)
Searches for blog posts in all spaces except the one specified, looking for those that have the given title in a
current or previous version, and returns the first maxResultCount results.
|
List<AbstractPage> |
findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder,
String blogTitle,
Space space,
int maxResultCount)
Searches for blogs in the space specified, looking for those that have the given title in a previous version, and
returns the first maxResultCount results.
|
<T> @NonNull PageResponse<T> |
findByClassIds(Iterable<Long> ids,
LimitedRequest limitedRequest,
com.google.common.base.Predicate<? super T> filter)
Deprecated.
|
@NonNull PageResponse<Page> |
findByClassIdsFiltered(Iterable<Long> ids,
LimitedRequest limitedRequest,
Predicate<? super Page> filter)
Find a list of objects from the same persistent class.
|
List<SpaceContentEntityObject> |
findContentBySpaceIdAndStatus(long spaceId,
String status,
int offset,
int count)
Retrieve content for a given space with a particular status.
|
PageResponse<SpaceContentEntityObject> |
findContentBySpaceIdAndStatus(long spaceId,
String status,
LimitedRequest limitedRequest,
com.google.common.base.Predicate<? super SpaceContentEntityObject> predicate)
Deprecated.
|
List<ContentPermissionSummary> |
findContentPermissionSummaryByIds(Collection<Long> ids)
Get Content creator for bulk permission checking
|
PageResponse<Page> |
findCurrentPages(LimitedRequest request)
Find all current pages.
|
ContentEntityObject |
findDraftFor(long contentId)
Retrieves the draft for the given content if exists.
|
List<ContentEntityObject> |
findDraftsWithUnpublishedChangesForUser(String creatorName)
Retrieves the drafts for the given
User , which contains unpublished changes |
List<ContentEntityObject> |
findHistoricalVersionsAfterVersion(long originalContentId,
int version) |
long |
findLatestVersionsCount()
Returns the number of results for the latest versions
of the current persistent class.
|
Iterator<Page> |
findLatestVersionsIterator()
Returns an iterator for the latest versions of the current
persistent class.
|
List<AbstractPage> |
findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder,
String pageTitle,
Space space,
int maxResultCount)
Searches for pages in all spaces except the one specified, looking for those that have the given title in a
previous version, and returns the first maxResultCount results.
|
List<AbstractPage> |
findPagesWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder,
String pageTitle,
Space space,
int maxResultCount)
Searches for pages in the space specified, looking for those that have the given title in a previous version, and
returns the first maxResultCount results.
|
List<ContentEntityObject> |
findPreviousVersions(long originalContentId) |
List<ContentEntityObject> |
findUnpublishedContentWithUserContributions(String username)
Retrieves the drafts for the given
User . |
PageResponse<AbstractPage> |
getAbstractPages(org.joda.time.DateTime date,
List<ContentStatus> statuses,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<AbstractPage> |
getAbstractPages(List<ContentType> contentTypes,
List<ContentStatus> statuses,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<AbstractPage> |
getAbstractPages(Space space,
List<ContentType> contentTypes,
List<ContentStatus> statuses,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<AbstractPage> |
getAbstractPages(Space space,
String title,
List<ContentStatus> statuses,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<AbstractPage> |
getAbstractPages(String title,
List<ContentStatus> statuses,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<AbstractPage> |
getAbstractPagesByCreationDate(org.joda.time.DateTime date,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<AbstractPage> |
getAbstractPagesByTitle(String title,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super AbstractPage> filter)
Deprecated.
|
PageResponse<Page> |
getAllChildren(Page page,
LimitedRequest pageRequest,
Depth depth)
Returns all children of a page (including drafts), limited to the pagination requested.
|
Iterator<SpaceContentEntityObject> |
getAllCurrentEntities() |
Map<Long,Set<ConfluenceUser>> |
getAllModifiers(Collection<Long> contentIds)
Get the Set of all
ConfluenceUser that have modified (contributed) content. |
Set<ConfluenceUser> |
getAllModifiers(Page page)
Get the Set of all
ConfluenceUser that have modified (contributed) a content. |
Map<Long,List<Long>> |
getAncestorsFor(Collection<Long> ids)
Get the list page ids of the ancestors of the given page ids.
|
int |
getAuthoredPagesCountByUser(String username) |
PageResponse<BlogPost> |
getBlogPosts(Space space,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super BlogPost> filter)
Deprecated.
|
Page |
getById(long id)
Retrieve the object with a particular id from the database.
|
PageResponse<Page> |
getChildren(Page page,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super Page> predicate,
Depth depth)
Deprecated.
|
int |
getCommentCountOnPage(long id)
Count the number of comments on the passed in page.
|
List<ContentEntityObject> |
getContentAuthoredByUser(String username) |
Map<Long,ContributionStatus> |
getContributionStatusByUser(Collection<ContentId> contentIds,
com.atlassian.sal.api.user.UserKey userKey)
Identifies the most recent contributions made to a Collection of content by the given user.
|
PageDao |
getDelegateDao() |
List<Long> |
getDescendantIds(Page page)
Finds the ids of all descendant pages of the given page
|
List<Long> |
getDescendantIds(Page page,
ContentStatus... statuses)
Finds the ids of all descendant pages of the given page
|
List<Page> |
getDescendants(Page page)
Finds all descendant pages (recursive) of the given page
|
List<String> |
getDescendantTitles(Page page)
Finds all descendant titles of the given page
|
PageResponse<Page> |
getDraftChildren(Page page,
LimitedRequest pageRequest,
Depth depth)
Returns the children of a page which have a status of DRAFT, limited to the pagination requested.
|
ContentEntityObject |
getFirstVersionAfter(long originalVersionContentId,
int version) |
ContentEntityObject |
getFirstVersionBefore(long originalVersionContentId,
int version) |
List<Page> |
getLastEditedVersionsOf(Page content)
Retrieves all the last edited versions for each user who has contributed to the specified piece of content.
|
Integer |
getMaxSiblingPosition(Page page)
Gets the highest position value of all the page's siblings.
|
String |
getObjectType(long id) |
Date |
getOldestPageCreationDate()
Gets the creation date of the oldest page.
|
List<Page> |
getOrphanedPages(String spaceKey) |
Page |
getPage(Space space,
String pageTitle)
Get the page by space and title.
|
PageResponse<AbstractPage> |
getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey,
LimitedRequest request)
Retrieve a page of entities, either the current version or historical version, that have been modified by the user,
in order of the user's most recent modification.
|
PageResponse<AbstractPage> |
getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts(com.atlassian.sal.api.user.UserKey userKey,
LimitedRequest request)
Retrieve a page of entities, either the current version or historical version, that have been modified by the user,
in order of the user's most recent modification.
|
Page |
getPageById(long id)
Get the page with the given id.
|
Page |
getPageByIdWithComments(long id)
Get the page with the given id, and perform an eager load of the comments and their children.
|
long |
getPageCount(@NonNull String spaceKey)
Get total number of current pages in a space
|
long |
getPageCount(@NonNull String spaceKey,
List<ContentStatus> statuses)
Get total number of pages in a space, within any of the given statuses.
|
Collection<Long> |
getPageIds(Space space)
Get the ids of all pages (current and historical) in the given space.
|
List<Page> |
getPageInTrash(String spaceKey,
String title) |
PageResponse<Page> |
getPages(LimitedRequest pageRequest,
com.google.common.base.Predicate<? super Page> filter)
Deprecated.
|
List<Page> |
getPages(@Nullable Space space,
boolean currentOnly) |
PageResponse<Page> |
getPages(Space space,
LimitedRequest pageRequest,
com.google.common.base.Predicate<? super Page> filter)
Deprecated.
|
List<Page> |
getPagesByIds(Iterable<Long> ids)
Get the pages with the given ids.
|
List<Page> |
getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate) |
List<Page> |
getPagesStartingWith(Space space,
String s) |
Optional<PageStatisticsDTO> |
getPageStatistics()
Fetches statistics about pages
|
List<Page> |
getPagesWithPermissions(Space space)
Get all current pages in a space and eagerly fetch permissions at the same time.
|
Page |
getPageWithComments(Space space,
String pageTitle)
Get the page by space and title, and perform an eager load of the comments and their children.
|
List<Page> |
getPermissionPages(Space space) |
Collection<Page> |
getPermissionPages(Space space,
LimitedRequest requeste)
Pagination permission pages for particular Space
|
long |
getPermissionPagesCount(Space space)
Get total number of permission pages for particular Space
|
Class<Page> |
getPersistentClass()
Gets the type of
EntityObject this Dao works with. |
Iterator<ContentEntityObject> |
getRecentlyAddedEntities(String spaceKey,
int maxResults) |
List<Page> |
getRecentlyAddedPages(int maxCount,
String spaceKey) |
List<Page> |
getRecentlyAuthoredPagesByUser(String username,
int maxCount) |
Iterator<ContentEntityObject> |
getRecentlyModifiedEntities(int maxResults) |
Iterator<SpaceContentEntityObject> |
getRecentlyModifiedEntities(String spaceKey,
int maxResults) |
Iterator<ContentEntityObject> |
getRecentlyModifiedEntitiesForUser(String username) |
List<ContentEntityObject> |
getRecentlyModifiedForChangeDigest(Date fromDate)
Retrieves a list of
ContentEntityObject s that have been newly added or modified
since the date specified. |
List<Page> |
getRecentlyUpdatedPages(int maxCount,
String spaceKey) |
List<Page> |
getTopLevelPages(Space space) |
PageResponse<Page> |
getTopLevelPages(Space space,
LimitedRequest limitedRequest,
com.google.common.base.Predicate<? super Page> predicate)
Deprecated.
|
List<ContentEntityObject> |
getTrashedContent(String spaceKey) |
List<ContentEntityObject> |
getTrashedContents(String spaceKey,
int offset,
int limit) |
List<SpaceContentEntityObject> |
getTrashedEntities(long contentIdOffset,
int limit)
Retrieve a batch of trashed content entities
|
List<OutgoingLink> |
getUndefinedLinks(@Nullable String spaceKey) |
List<Page> |
getUndefinedPages(String spaceKey) |
ContentEntityObject |
getVersion(long originalVersionContentId,
int version) |
Map<Long,List<ConfluenceUser>> |
getVersionEditContributors(Iterable<Page> originalVersions)
Get version edit contributors for a set of content identifiers.
|
List<VersionHistorySummary> |
getVersionHistorySummary(long originalContentId) |
PageResponse<VersionHistorySummary> |
getVersionHistorySummary(long originalContentId,
LimitedRequest request)
Get version history with pagination.
|
Map<Long,ContentEntityObject> |
getVersionsLastEditedByUser(Collection<Long> contentIds,
com.atlassian.sal.api.user.UserKey userKey)
Gets the
ContentEntityObject objects, either the current version or historical version relating to
given contentIds of the current version that was the most recent version edited by the given user. |
Map<Long,ContentEntityObject> |
getVersionsLastEditedByUserNew(Collection<Long> contentIds,
com.atlassian.sal.api.user.UserKey userKey)
Same as
ContentEntityObjectDao.getVersionsLastEditedByUser(Collection, UserKey) , but a refined implementation for
new Recently Worked On Drafts work. |
void |
refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
Refreshes the object again with the fresh data from db.
|
void |
refreshEntity(Page objectToRefresh)
Refreshes the object again with the fresh data from db.
|
void |
remove(com.atlassian.core.bean.EntityObject object)
Remove object from persistence.
|
void |
removeEntity(Page objectToRemove)
Remove object from persistence.
|
void |
replicate(Object objectToReplicate)
Replicate the object.
|
void |
replicateEntity(Page objectToReplicate)
Replicate the object.
|
void |
save(com.atlassian.core.bean.EntityObject objectToSave) |
void |
save(com.atlassian.core.bean.EntityObject objectToSave,
com.atlassian.core.bean.EntityObject originalObject)
Saves the given current object and historical object
|
void |
saveEntity(Page objectToSave)
Saves the given object to the database.
|
void |
saveEntity(Page currentObject,
@Nullable Page originalObject)
Saves the given current object and historical object.
|
void |
saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
saves the object.
|
void |
saveRawEntity(Page objectToSave)
Saves the object without updating modification daa.
|
void |
saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
This is for internal use only, Do not rely on it as a public API.
|
@NonNull PageResponse<Page> |
scanFilteredPages(List<ContentStatus> statuses,
LimitedRequest pageRequest,
@Nullable Predicate<? super Page> filter)
Retrieves a page response of all the pages with specified content statuses.
|
@NonNull PageResponse<Page> |
scanFilteredPages(Space space,
List<ContentStatus> statuses,
LimitedRequest pageRequest,
@Nullable Predicate<? super Page> filter)
Retrieves a page response of all pages in space with specified content statuses.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPagesByCreationDate, getFilteredAbstractPagesByTitle, getFilteredBlogPosts, getFilteredChildren, getFilteredPages, getFilteredPages, getFilteredTopLevelPages
findContentBySpaceIdAndStatusAndFilter
protected DelegatingPageDao(PageDaoInternal delegateDao)
public PageDao getDelegateDao()
public Page getPage(Space space, String pageTitle)
PageDao
public Page getPageWithComments(Space space, String pageTitle)
PageDao
getPageWithComments
in interface PageDao
space
- The space the page belongs topageTitle
- The title of the pagepublic void remove(com.atlassian.core.bean.EntityObject object)
ObjectDao
remove
in interface ObjectDao
remove
in interface ObjectDaoInternal<Page>
public void removeEntity(Page objectToRemove)
ObjectDaoInternal
removeEntity
in interface ObjectDaoInternal<Page>
public void save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject originalObject)
VersionedObjectDao
save
in interface VersionedObjectDao<Page>
objectToSave
- the current object.originalObject
- the original object. This will be mutated to become a historical version as part of this save.public void saveEntity(Page currentObject, @Nullable Page originalObject)
VersionedObjectDaoInternal
saveEntity
in interface VersionedObjectDaoInternal<Page>
currentObject
- the current object.originalObject
- the original object. This will be mutated to become a historical version as part of this save.public void save(com.atlassian.core.bean.EntityObject objectToSave)
save
in interface ObjectDao
save
in interface ObjectDaoInternal<Page>
public void saveEntity(Page objectToSave)
ObjectDaoInternal
saveEntity
in interface ObjectDaoInternal<Page>
objectToSave
- the object to save.public void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
ObjectDao
saveRaw
in interface ObjectDao
saveRaw
in interface ObjectDaoInternal<Page>
objectToSave
- the object to save.public void saveRawEntity(Page objectToSave)
ObjectDaoInternal
If the object is new, this won't set the creation date on the object. If it already exists, then it won't set the date that it was updated.
saveRawEntity
in interface ObjectDaoInternal<Page>
objectToSave
- the object to save.public @NonNull List<Page> findAll()
ObjectDao
findAll
in interface ObjectDao
findAll
in interface ObjectDaoInternal<Page>
public @NonNull List<Page> findAllSorted(String s)
ObjectDao
findAllSorted
in interface ObjectDao
findAllSorted
in interface ObjectDaoInternal<Page>
s
- the name of the property to be sorted on. This should be null if no sorting is required.public @NonNull List<Page> findAllSorted(String s, boolean cached, int firstRow, int maxRows)
ObjectDao
findAllSorted
in interface ObjectDao
findAllSorted
in interface ObjectDaoInternal<Page>
s
- the name of the property to be sorted on. This should be null if no sorting is required.cached
- control whether the results should be cachedfirstRow
- the index of the first result to be returnedmaxRows
- the maximum number of results required. Use -1 to specify no limit.@Deprecated public <T> @NonNull PageResponse<T> findByClassIds(Iterable<Long> ids, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super T> filter)
ObjectDao
findByClassIds
in interface ObjectDao
findByClassIds
in interface ObjectDaoInternal<Page>
T
- the type of entity to returnids
- - the ids of the entities to findlimitedRequest
- the pagination request defining the page size to fetchfilter
- a predicate to do in memory filtering of the result set before returningpublic @NonNull PageResponse<Page> findByClassIdsFiltered(Iterable<Long> ids, LimitedRequest limitedRequest, Predicate<? super Page> filter)
ObjectDaoInternal
findByClassIdsFiltered
in interface ObjectDaoInternal<Page>
ids
- - the ids of the entities to findlimitedRequest
- the pagination request defining the page size to fetchfilter
- a predicate to do in memory filtering of the result set before returningpublic long findLatestVersionsCount()
VersionedObjectDao
findLatestVersionsCount
in interface VersionedObjectDao<Page>
public Iterator<Page> findLatestVersionsIterator()
VersionedObjectDao
findLatestVersionsIterator
in interface VersionedObjectDao<Page>
public List<ContentEntityObject> findPreviousVersions(long originalContentId)
findPreviousVersions
in interface ContentEntityObjectDao<Page>
public List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
PageDao
Only pages in spaces the remote user is able to view will be returned.
findPagesWithCurrentOrHistoricalTitleInPermittedSpace
in interface PageDao
pageTitle
- title of a page in a previous version.space
- Space to search. Must not be null.maxResultCount
- maximum pages to returnpublic List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInPermittedSpace(SpacePermissionQueryBuilder permissionQueryBuilder, String blogTitle, Space space, int maxResultCount)
PageDao
Only blogs in spaces the remote user is able to view will be returned.
findBlogsWithCurrentOrHistoricalTitleInPermittedSpace
in interface PageDao
permissionQueryBuilder
- required to determine how to construct database queries for space permissions, for
the current userblogTitle
- title of a page in a previous version.space
- Space to search. Must not be null.maxResultCount
- maximum pages to returnpublic List<AbstractPage> findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder, String blogTitle, Space space, int maxResultCount)
PageDao
Only pages in spaces the remote user is able to view will be returned.
findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept
in interface PageDao
blogTitle
- Title of the blog to findspace
- Space to exclude from search. If null, all spaces are searched.maxResultCount
- maximum blog posts to returnpublic List<AbstractPage> findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept(SpacePermissionQueryBuilder permissionQueryBuilder, String pageTitle, Space space, int maxResultCount)
PageDao
Only pages in spaces the remote user is able to view will be returned.
findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept
in interface PageDao
pageTitle
- title of a page in a previous version.space
- Space to exclude from search. If null, all spaces are searched.maxResultCount
- maximum pages to returnpublic List<ContentPermissionSummary> findContentPermissionSummaryByIds(Collection<Long> ids)
PageDao
findContentPermissionSummaryByIds
in interface PageDao
ids
- of Contentpublic Iterator<SpaceContentEntityObject> getAllCurrentEntities()
getAllCurrentEntities
in interface ContentEntityObjectDao<Page>
public int getAuthoredPagesCountByUser(String username)
getAuthoredPagesCountByUser
in interface PageDao
public Page getById(long id)
ContentEntityObjectDao
getById
in interface ContentEntityObjectDao<Page>
id
- the id of the object to look uppublic List<ContentEntityObject> getContentAuthoredByUser(String username)
getContentAuthoredByUser
in interface ContentEntityObjectDao<Page>
public List<Long> getDescendantIds(Page page)
PageDao
getDescendantIds
in interface PageDao
public List<Long> getDescendantIds(Page page, ContentStatus... statuses)
PageDao
getDescendantIds
in interface PageDao
public int countPagesInSubtree(@NonNull Page page)
PageDao
countPagesInSubtree
in interface PageDao
public List<Page> getDescendants(Page page)
PageDao
getDescendants
in interface PageDao
public List<String> getDescendantTitles(Page page)
PageDao
getDescendantTitles
in interface PageDao
public ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
getFirstVersionAfter
in interface ContentEntityObjectDao<Page>
public ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
getFirstVersionBefore
in interface ContentEntityObjectDao<Page>
public String getObjectType(long id)
getObjectType
in interface ContentEntityObjectDao<Page>
public List<Page> getOrphanedPages(String spaceKey)
getOrphanedPages
in interface PageDao
public Page getPageById(long id)
PageDao
getPageById
in interface PageDao
id
- of the page to loadpublic List<Page> getPagesByIds(Iterable<Long> ids)
PageDao
getPagesByIds
in interface PageDao
public Page getPageByIdWithComments(long id)
PageDao
getPageByIdWithComments
in interface PageDao
id
- of the page to loadpublic int getCommentCountOnPage(long id)
PageDao
getCommentCountOnPage
in interface PageDao
public List<Page> getPageInTrash(String spaceKey, String title)
getPageInTrash
in interface PageDao
public Map<Long,List<Long>> getAncestorsFor(Collection<Long> ids)
PageDao
getAncestorsFor
in interface PageDao
ids
- the list of page ids to get ancestor page ids forpublic List<Page> getPagesWithPermissions(Space space)
PageDao
getPagesWithPermissions
in interface PageDao
@Deprecated public PageResponse<Page> getPages(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
PageDao
@Deprecated public PageResponse<Page> getPages(LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> filter)
PageDao
@Deprecated public PageResponse<BlogPost> getBlogPosts(Space space, LimitedRequest pageRequest, com.google.common.base.Predicate<? super BlogPost> filter)
PageDao
getBlogPosts
in interface PageDao
space
- the space to locate the blog posts inpageRequest
- the start and offset of the pages to retrievefilter
- the predicate to filter the returned results by, may be nullpublic List<Page> getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
getPagesCreatedOrUpdatedSinceDate
in interface PageDao
public List<Page> getPagesStartingWith(Space space, String s)
getPagesStartingWith
in interface PageDao
public List<Page> getPermissionPages(Space space)
getPermissionPages
in interface PageDao
public Class<Page> getPersistentClass()
ObjectDaoInternal
EntityObject
this Dao works with.getPersistentClass
in interface ObjectDao
getPersistentClass
in interface ObjectDaoInternal<Page>
public Iterator<ContentEntityObject> getRecentlyAddedEntities(String spaceKey, int maxResults)
getRecentlyAddedEntities
in interface ContentEntityObjectDao<Page>
public List<Page> getRecentlyAddedPages(int maxCount, String spaceKey)
getRecentlyAddedPages
in interface PageDao
public List<Page> getRecentlyAuthoredPagesByUser(String username, int maxCount)
getRecentlyAuthoredPagesByUser
in interface PageDao
public Iterator<ContentEntityObject> getRecentlyModifiedEntities(int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao<Page>
public Iterator<SpaceContentEntityObject> getRecentlyModifiedEntities(String spaceKey, int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao<Page>
public Iterator<ContentEntityObject> getRecentlyModifiedEntitiesForUser(String username)
getRecentlyModifiedEntitiesForUser
in interface ContentEntityObjectDao<Page>
public List<ContentEntityObject> getRecentlyModifiedForChangeDigest(Date fromDate)
ContentEntityObjectDao
ContentEntityObject
s that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.getRecentlyModifiedForChangeDigest
in interface ContentEntityObjectDao<Page>
fromDate
- content modified after this date will be returnedContentEntityObject
s that have been newly added or modified
since the date specifiedpublic List<Page> getRecentlyUpdatedPages(int maxCount, String spaceKey)
getRecentlyUpdatedPages
in interface PageDao
public List<Page> getTopLevelPages(Space space)
getTopLevelPages
in interface PageDao
@Deprecated public PageResponse<Page> getTopLevelPages(Space space, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super Page> predicate)
getTopLevelPages
in interface PageDao
@Deprecated public PageResponse<Page> getChildren(Page page, LimitedRequest pageRequest, com.google.common.base.Predicate<? super Page> predicate, Depth depth)
PageDao
getChildren
in interface PageDao
page
- the page to find children forpageRequest
- the pagination requestedpredicate
- predicate used to entitiesdepth
- the depth to return children topublic PageResponse<Page> getDraftChildren(Page page, LimitedRequest pageRequest, Depth depth)
PageDao
getDraftChildren
in interface PageDao
page
- the page to find children forpageRequest
- the pagination requesteddepth
- the depth to return children topublic PageResponse<Page> getAllChildren(Page page, LimitedRequest pageRequest, Depth depth)
PageDao
getAllChildren
in interface PageDao
page
- the page to find children forpageRequest
- the pagination requesteddepth
- the depth to return children topublic Integer getMaxSiblingPosition(Page page)
PageDao
getMaxSiblingPosition
in interface PageDao
page
- The page whose siblings from which to get the max positionpublic Collection<Long> getPageIds(Space space)
PageDao
getPageIds
in interface PageDao
space
- space to retrieve page ids from, can not be null.@Deprecated public PageResponse<AbstractPage> getAbstractPagesByTitle(String title, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPagesByTitle
in interface PageDao
title
- the title of the page to matchpageRequest
- the pagination requestedfilter
- the predicate to apply to the results before returning@Deprecated public PageResponse<AbstractPage> getAbstractPagesByCreationDate(org.joda.time.DateTime date, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPagesByCreationDate
in interface PageDao
date
- - the creation date to matchpageRequest
- the pagination requestfilter
- the predicate to apply to the results before returning@Deprecated public PageResponse<AbstractPage> getAbstractPages(List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPages
in interface PageDao
contentTypes
- list of content types to findstatuses
- list of statuses the pages can be inpageRequest
- the start and offset of the pages to retrievefilter
- the predicate to filter the returned results by, may be null@Deprecated public PageResponse<AbstractPage> getAbstractPages(Space space, List<ContentType> contentTypes, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPages
in interface PageDao
space
- the space to locate the page incontentTypes
- list of content types to findstatuses
- list of statuses the pages can be inpageRequest
- the pagination requestfilter
- the predicate to pages the returned results by, may be null@Deprecated public PageResponse<AbstractPage> getAbstractPages(Space space, String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPages
in interface PageDao
space
- space the page belongs totitle
- the title of the page to matchstatuses
- list of statuses the content can be inpageRequest
- the pagination requestedfilter
- the predicate to apply to the results before returning@Deprecated public PageResponse<AbstractPage> getAbstractPages(String title, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPages
in interface PageDao
title
- the title of the page to matchstatuses
- list of statuses the content can be inpageRequest
- the pagination requestedfilter
- the predicate to apply to the results before returning@Deprecated public PageResponse<AbstractPage> getAbstractPages(org.joda.time.DateTime date, List<ContentStatus> statuses, LimitedRequest pageRequest, com.google.common.base.Predicate<? super AbstractPage> filter)
PageDao
getAbstractPages
in interface PageDao
date
- the creation date to matchstatuses
- list of statuses the content can be inpageRequest
- the pagination requestfilter
- the predicate to apply to the results before returningpublic Date getOldestPageCreationDate()
ContentEntityObjectDao
getOldestPageCreationDate
in interface ContentEntityObjectDao<Page>
public List<ContentEntityObject> getTrashedContent(String spaceKey)
getTrashedContent
in interface ContentEntityObjectDao<Page>
public List<ContentEntityObject> getTrashedContents(String spaceKey, int offset, int limit)
getTrashedContents
in interface ContentEntityObjectDao<Page>
public List<Page> getUndefinedPages(String spaceKey)
getUndefinedPages
in interface PageDao
public final List<OutgoingLink> getUndefinedLinks(@Nullable String spaceKey)
getUndefinedLinks
in interface PageDao
public ContentEntityObject getVersion(long originalVersionContentId, int version)
getVersion
in interface ContentEntityObjectDao<Page>
public List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
getVersionHistorySummary
in interface ContentEntityObjectDao<Page>
public PageResponse<VersionHistorySummary> getVersionHistorySummary(long originalContentId, LimitedRequest request)
ContentEntityObjectDao
getVersionHistorySummary
in interface ContentEntityObjectDao<Page>
originalContentId
- the content Id of latest version, the CURRENT versionrequest
- page request contains start, limit fields for pagination purpose.public Map<Long,List<ConfluenceUser>> getVersionEditContributors(Iterable<Page> originalVersions)
ContentEntityObjectDao
getVersionEditContributors
in interface ContentEntityObjectDao<Page>
originalVersions
- the contents of latest versions, the CURRENT versionspublic Set<ConfluenceUser> getAllModifiers(Page page)
ContentEntityObjectDao
ConfluenceUser
that have modified (contributed) a content.
This includes users for existing and deleted historical versions.getAllModifiers
in interface ContentEntityObjectDao<Page>
page
- the content for which contributions have been madeConfluenceUser
that have contributed to the contentpublic Map<Long,Set<ConfluenceUser>> getAllModifiers(Collection<Long> contentIds)
ContentEntityObjectDao
ConfluenceUser
that have modified (contributed) content.
This includes users for existing and deleted historical versions.getAllModifiers
in interface ContentEntityObjectDao<Page>
contentIds
- the content IDs of interestMap
of content IDs to a Set
of ConfluenceUser
that have contributed to the contentpublic Map<Long,ContentEntityObject> getVersionsLastEditedByUser(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
ContentEntityObjectDao
ContentEntityObject
objects, either the current version or historical version relating to
given contentIds of the current version that was the most recent version edited by the given user. Only content
with a "current" status are returned.getVersionsLastEditedByUser
in interface ContentEntityObjectDao<Page>
contentIds
- the ids of the content we're interested in. These *must* be ids of the latest version.userKey
- the userKey of the user that we're interested inContentEntityObject
objects relating to the version of the given contentIds that were last
edited by the given user.public Map<Long,ContentEntityObject> getVersionsLastEditedByUserNew(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
ContentEntityObjectDao
ContentEntityObjectDao.getVersionsLastEditedByUser(Collection, UserKey)
, but a refined implementation for
new Recently Worked On Drafts work.
TODO: replace ContentEntityObjectDao.getVersionsLastEditedByUser(Collection, UserKey)
with the implementation of this methodgetVersionsLastEditedByUserNew
in interface ContentEntityObjectDao<Page>
public Map<Long,ContributionStatus> getContributionStatusByUser(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey)
ContentEntityObjectDao
It takes a Collection of contentIds and returns a Map of contentIds to ContributionStatuses for the supplied Ids.
If non existing ContentIds are used, they will not be present in the returned Map. If no contribution status can be found for the supplied contentIds, they will not be present in the returned Map.
Anonymous users are not supported.
getContributionStatusByUser
in interface ContentEntityObjectDao<Page>
contentIds
- the IDs of the content we want to query. These *must* be IDs of the latest versionuserKey
- the userKey of the user who's changes we are interested inContributionStatus
of each contentpublic void refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
ObjectDao
refresh
in interface ObjectDao
refresh
in interface ObjectDaoInternal<Page>
public void refreshEntity(Page objectToRefresh)
ObjectDaoInternal
refreshEntity
in interface ObjectDaoInternal<Page>
public void replicate(Object objectToReplicate)
ObjectDao
replicate
in interface ObjectDao
replicate
in interface ObjectDaoInternal<Page>
public void replicateEntity(Page objectToReplicate)
ObjectDaoInternal
replicateEntity
in interface ObjectDaoInternal<Page>
public List<Page> getLastEditedVersionsOf(Page content)
ContentEntityObjectDao
getLastEditedVersionsOf
in interface ContentEntityObjectDao<Page>
content
- content (must be the latest version)public List<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, int offset, int count)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao<Page>
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
offset
- the offset of the first item to retrieve (0-based)count
- the maximum number of items to retrieve@Deprecated public PageResponse<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super SpaceContentEntityObject> predicate)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao<Page>
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
limitedRequest
- - the start and offset of the pages to retrievepredicate
- - a predicate to filter the returned results bypublic int countContentBySpaceIdAndStatus(long spaceId, String status)
ContentEntityObjectDao
countContentBySpaceIdAndStatus
in interface ContentEntityObjectDao<Page>
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
public List<ContentEntityObject> findHistoricalVersionsAfterVersion(long originalContentId, int version)
findHistoricalVersionsAfterVersion
in interface ContentEntityObjectDao<Page>
public List<ContentEntityObject> findAllDraftsFor(long contentId)
ContentEntityObjectDao
findAllDraftsFor
in interface ContentEntityObjectDao<Page>
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
public List<Draft> findAllLegacyDraftsFor(long contentId)
ContentEntityObjectDao
findAllLegacyDraftsFor
in interface ContentEntityObjectDao<Page>
contentId
- id of the content to retrieve the draft forDraft
public ContentEntityObject findDraftFor(long contentId)
ContentEntityObjectDao
findDraftFor
in interface ContentEntityObjectDao<Page>
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
public PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
ContentEntityObjectDao
getPageAndBlogPostsVersionsLastEditedByUser
in interface ContentEntityObjectDao<Page>
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the requestpublic PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
ContentEntityObjectDao
getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts
in interface ContentEntityObjectDao<Page>
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the requestpublic List<ContentEntityObject> findUnpublishedContentWithUserContributions(String username)
ContentEntityObjectDao
User
.
IMPORTANT: this method doesn't return published shared drafts, only personal drafts and unpublished shared draftsfindUnpublishedContentWithUserContributions
in interface ContentEntityObjectDao<Page>
username
- the owner of the draftsContentEntityObject
with the
ContentEntityObject.DRAFT
statuspublic List<ContentEntityObject> findDraftsWithUnpublishedChangesForUser(String creatorName)
ContentEntityObjectDao
User
, which contains unpublished changesfindDraftsWithUnpublishedChangesForUser
in interface ContentEntityObjectDao<Page>
creatorName
- the owner of the draftsContentEntityObject
objects)public int countAllPages()
PageDao
countAllPages
in interface PageDao
public Optional<PageStatisticsDTO> getPageStatistics()
PageDao
getPageStatistics
in interface PageDao
public int countCurrentPages()
PageDao
countCurrentPages
in interface PageDao
public PageResponse<Page> findCurrentPages(LimitedRequest request)
PageDaoInternal
findCurrentPages
in interface PageDaoInternal
request
- the limited pagination request.public Collection<Page> getPermissionPages(Space space, LimitedRequest requeste)
PageDaoInternal
getPermissionPages
in interface PageDaoInternal
public long getPermissionPagesCount(Space space)
PageDaoInternal
getPermissionPagesCount
in interface PageDaoInternal
public int countDraftPages()
PageDao
countDraftPages
in interface PageDao
public int countPagesWithUnpublishedChanges()
PageDao
countPagesWithUnpublishedChanges
in interface PageDao
public long getPageCount(@NonNull String spaceKey)
PageDao
getPageCount
in interface PageDao
spaceKey
- the space to look for pages inpublic long getPageCount(@NonNull String spaceKey, List<ContentStatus> statuses)
PageDao
getPageCount
in interface PageDao
spaceKey
- the space to look for pages instatuses
- list of statuses the pages can be inpublic List<SpaceContentEntityObject> getTrashedEntities(long contentIdOffset, int limit)
ContentEntityObjectDaoInternal
getTrashedEntities
in interface ContentEntityObjectDaoInternal<Page>
contentIdOffset
- ids of returned entities must be greater than or equal to this valuelimit
- maximum number of entities to returnpublic void saveRawWithoutReindex(com.atlassian.core.bean.EntityObject objectToSave)
ContentEntityObjectDaoInternal
This is for internal use only, Do not rely on it as a public API.
Perform a saveRaw but without performing the re-index; it is unnecessary in the context of a migration or upgrade.
saveRawWithoutReindex
in interface ContentEntityObjectDaoInternal<Page>
public @NonNull PageResponse<Page> scanFilteredPages(List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable Predicate<? super Page> filter)
PageDaoInternal
scanFilteredPages
in interface PageDaoInternal
statuses
- list of content status which we are interested to fetchpageRequest
- limit and cursor of the pages to retrieve. Cursor in pageRequest can't be null.filter
- the predicate to filter the returned results by, may be nullpublic @NonNull PageResponse<Page> scanFilteredPages(Space space, List<ContentStatus> statuses, LimitedRequest pageRequest, @Nullable Predicate<? super Page> filter)
PageDaoInternal
scanFilteredPages
in interface PageDaoInternal
space
- the space to locate the page instatuses
- content status to matchpageRequest
- limit and cursor of the pages to retrieve. Cursor in pageRequest can't be null.filter
- the predicate to filter the returned results by, may be nullCopyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences