T
- the entity typepublic abstract class AbstractContentEntityObjectHibernateDao<T extends ContentEntityObject> extends VersionedHibernateObjectDao<T> implements ContentEntityObjectDaoInternal<T>
HibernateObjectDao.Cacheability
cacheFactory, confluenceUserDao
Constructor and Description |
---|
AbstractContentEntityObjectHibernateDao() |
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.
|
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)
|
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) |
List<ContentEntityObject> |
findPreviousVersions(long originalContentId) |
List<ContentEntityObject> |
findUnpublishedContentWithUserContributions(String username)
Retrieves the drafts for the given
User . |
Iterator<SpaceContentEntityObject> |
getAllCurrentEntities() |
protected T |
getByClassId(long id)
Retrieve the object with a particular id from the database.
|
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(com.atlassian.sal.api.user.UserKey userKey,
LimitedRequest limitedRequest)
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 limitedRequest)
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) |
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
|
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSession, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findContentBySpaceIdAndStatusAndFilter
saveEntity
findLatestVersionsCount, findLatestVersionsIterator, save
findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, getPersistentClass, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
public AbstractContentEntityObjectHibernateDao()
public T getById(long id)
ContentEntityObjectDao
getById
in interface ContentEntityObjectDao<T extends ContentEntityObject>
id
- the id of the object to look upprotected T getByClassId(long id)
HibernateObjectDao
getByClassId
in class HibernateObjectDao<T extends ContentEntityObject>
id
- the id of the object to look uppublic List<ContentEntityObject> getContentAuthoredByUser(String username)
getContentAuthoredByUser
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public Iterator<SpaceContentEntityObject> getAllCurrentEntities()
getAllCurrentEntities
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public Iterator<ContentEntityObject> getRecentlyAddedEntities(String spaceKey, int maxResults)
getRecentlyAddedEntities
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public Iterator<ContentEntityObject> getRecentlyModifiedEntities(int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public Iterator<SpaceContentEntityObject> getRecentlyModifiedEntities(String spaceKey, int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public Iterator<ContentEntityObject> getRecentlyModifiedEntitiesForUser(String username)
getRecentlyModifiedEntitiesForUser
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
getFirstVersionBefore
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
getFirstVersionAfter
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public ContentEntityObject getVersion(long originalVersionContentId, int version)
getVersion
in interface ContentEntityObjectDao<T extends ContentEntityObject>
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<T extends ContentEntityObject>
fromDate
- content modified after this date will be returnedContentEntityObject
s that have been newly added or modified
since the date specifiedpublic List<T> getLastEditedVersionsOf(T content)
ContentEntityObjectDao
getLastEditedVersionsOf
in interface ContentEntityObjectDao<T extends ContentEntityObject>
content
- latest versionpublic List<ContentEntityObject> getTrashedContent(String spaceKey)
getTrashedContent
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public List<ContentEntityObject> getTrashedContents(String spaceKey, int offset, int limit)
getTrashedContents
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public List<SpaceContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, String status, int offset, int count)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao<T extends ContentEntityObject>
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)
ContentEntityObjectDaoInternal.findContentBySpaceIdAndStatusAndFilter(long, String, LimitedRequest, java.util.function.Predicate)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao<T extends ContentEntityObject>
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<T extends ContentEntityObject>
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
public String getObjectType(long id)
getObjectType
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public 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<T extends ContentEntityObject>
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 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<T extends ContentEntityObject>
public PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest limitedRequest)
ContentEntityObjectDao
getPageAndBlogPostsVersionsLastEditedByUser
in interface ContentEntityObjectDao<T extends ContentEntityObject>
userKey
- the key for the user for whom to retrieve the modified contentlimitedRequest
- the requestpublic PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest limitedRequest)
ContentEntityObjectDao
getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts
in interface ContentEntityObjectDao<T extends ContentEntityObject>
userKey
- the key for the user for whom to retrieve the modified contentlimitedRequest
- the requestpublic 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<T extends ContentEntityObject>
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 List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
getVersionHistorySummary
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public PageResponse<VersionHistorySummary> getVersionHistorySummary(long originalContentId, LimitedRequest request)
ContentEntityObjectDao
getVersionHistorySummary
in interface ContentEntityObjectDao<T extends ContentEntityObject>
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<T> originalVersions)
ContentEntityObjectDao
getVersionEditContributors
in interface ContentEntityObjectDao<T extends ContentEntityObject>
originalVersions
- the contents of latest versions, the CURRENT versionspublic List<ContentEntityObject> findPreviousVersions(long originalContentId)
findPreviousVersions
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public List<ContentEntityObject> findHistoricalVersionsAfterVersion(long originalContentId, int version)
findHistoricalVersionsAfterVersion
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public Date getOldestPageCreationDate()
ContentEntityObjectDao
getOldestPageCreationDate
in interface ContentEntityObjectDao<T extends ContentEntityObject>
public List<ContentEntityObject> findAllDraftsFor(long contentId)
ContentEntityObjectDao
findAllDraftsFor
in interface ContentEntityObjectDao<T extends ContentEntityObject>
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
public List<Draft> findAllLegacyDraftsFor(long contentId)
ContentEntityObjectDao
findAllLegacyDraftsFor
in interface ContentEntityObjectDao<T extends ContentEntityObject>
contentId
- id of the content to retrieve the draft forDraft
public ContentEntityObject findDraftFor(long contentId)
ContentEntityObjectDao
findDraftFor
in interface ContentEntityObjectDao<T extends ContentEntityObject>
contentId
- id of the content to retrieve the draft forContentEntityObject.DRAFT
public 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<T extends ContentEntityObject>
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<T extends ContentEntityObject>
creatorName
- the owner of the draftsContentEntityObject
objects)Copyright © 2003–2020 Atlassian. All rights reserved.