public interface ContentEntityObjectDao<T extends ContentEntityObject> extends VersionedObjectDao<T>
Modifier and Type | Method and Description |
---|---|
int |
countContentBySpaceIdAndStatus(long spaceId,
String status)
Retrieve the count of content for a given space with a particular status.
|
List<ContentEntityObject> |
findAllDraftsFor(long contentId)
Retrieves a list of drafts for the given content if any drafts exist.
|
default List<Draft> |
findAllLegacyDraftsFor(long contentId)
Retrieves a list of Legacy drafts for the given content if any exist.
|
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.
|
ContentEntityObject |
findDraftFor(long contentId)
Retrieves the draft for the given content if exists.
|
List<ContentEntityObject> |
findHistoricalVersionsAfterVersion(long originalContentId,
int version) |
List<ContentEntityObject> |
findPreviousVersions(long originalContentId) |
List<ContentEntityObject> |
findUnpublishedContentWithUserContributions(String username)
Retrives the drafts for the given
User |
Iterator<SpaceContentEntityObject> |
getAllCurrentEntities() |
T |
getById(long id)
Retrieve the object with a particular id from the database.
|
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.
|
ContentEntityObject |
getFirstVersionAfter(long originalVersionContentId,
int version) |
ContentEntityObject |
getFirstVersionBefore(long originalVersionContentId,
int version) |
List<T> |
getLastEditedVersionsOf(T content)
Retrieves all the last edited versions for each user who has contributed to the specified piece of content.
|
String |
getObjectType(long id) |
Date |
getOldestPageCreationDate()
Gets the creation date of the oldest page.
|
PageResponse<AbstractPage> |
getPageAndBlogPostsVersionsLastEditedByUser(@Nullable 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(@Nullable 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.
|
Iterator<ContentEntityObject> |
getRecentlyAddedEntities(String spaceKey,
int maxResults) |
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<ContentEntityObject> |
getTrashedContent(String spaceKey)
Deprecated.
since 6.10.0 use
getTrashedContents(String, int, int) |
default List<ContentEntityObject> |
getTrashedContents(String spaceKey,
int offset,
int limit) |
ContentEntityObject |
getVersion(long originalVersionContentId,
int version) |
Map<Long,List<ConfluenceUser>> |
getVersionEditContributors(Iterable<T> 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)
Deprecated.
since 6.4.0
|
findLatestVersionsCount, findLatestVersionsIterator, save
findAll, findAllSorted, findAllSorted, findByClassIds, getPersistentClass, refresh, remove, replicate, save, saveRaw
T getById(long id)
id
- the id of the object to look upList<ContentEntityObject> getContentAuthoredByUser(String username)
Iterator<SpaceContentEntityObject> getAllCurrentEntities()
Iterator<ContentEntityObject> getRecentlyAddedEntities(String spaceKey, int maxResults)
Iterator<ContentEntityObject> getRecentlyModifiedEntities(int maxResults)
Iterator<SpaceContentEntityObject> getRecentlyModifiedEntities(String spaceKey, int maxResults)
List<ContentEntityObject> getRecentlyModifiedForChangeDigest(Date fromDate)
ContentEntityObject
s that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.fromDate
- content modified after this date will be returnedContentEntityObject
s that have been newly added or modified
since the date specifiedIterator<ContentEntityObject> getRecentlyModifiedEntitiesForUser(String username)
@Deprecated List<ContentEntityObject> getTrashedContent(String spaceKey)
getTrashedContents(String, int, int)
default List<ContentEntityObject> getTrashedContents(String spaceKey, int offset, int limit)
String getObjectType(long id)
ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
ContentEntityObject getVersion(long originalVersionContentId, int version)
List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
PageResponse<VersionHistorySummary> getVersionHistorySummary(long originalContentId, LimitedRequest request)
originalContentId
- the content Id of latest version, the CURRENT versionrequest
- page request contains start, limit fields for pagination purpose.Map<Long,List<ConfluenceUser>> getVersionEditContributors(Iterable<T> originalVersions)
originalVersions
- the contents of latest versions, the CURRENT versionsMap<Long,ContentEntityObject> getVersionsLastEditedByUser(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
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.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.@Deprecated Map<Long,ContentEntityObject> getVersionsLastEditedByUserNew(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
getVersionsLastEditedByUser(Collection, UserKey)
, but a refined implementation for
new Recently Worked On Drafts work.
TODO: replace getVersionsLastEditedByUser(Collection, UserKey)
with the implementation of this methodMap<Long,ContributionStatus> getContributionStatusByUser(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey)
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.
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 contentPageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUser(@Nullable com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the requestPageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts(@Nullable com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the requestList<ContentEntityObject> findPreviousVersions(long originalContentId)
List<ContentEntityObject> findHistoricalVersionsAfterVersion(long originalContentId, int version)
List<T> getLastEditedVersionsOf(T content)
content
- content (must be the latest version)IllegalArgumentException
- if the content is not the latest version or nullList<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, int offset, int count)
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 PageResponse<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super SpaceContentEntityObject> predicate)
ContentEntityObjectDaoInternal.findContentBySpaceIdAndStatusAndFilter(long, String, LimitedRequest, Predicate)
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 byint countContentBySpaceIdAndStatus(long spaceId, String status)
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
Date getOldestPageCreationDate()
List<ContentEntityObject> findAllDraftsFor(long contentId)
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
default List<Draft> findAllLegacyDraftsFor(long contentId)
contentId
- id of the content to retrieve the draft forDraft
ContentEntityObject findDraftFor(long contentId)
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
List<ContentEntityObject> findUnpublishedContentWithUserContributions(String username)
User
username
- the owner of the draftsContentEntityObject
with the
ContentEntityObject.DRAFT
statusCopyright © 2003–2019 Atlassian. All rights reserved.