@ParametersAreNonnullByDefault public class DefaultCustomContentManager extends DefaultContentEntityManager implements CustomContentManager
CustomContentManager.SortField, CustomContentManager.SortOrder
ITERATE_ALL
Constructor and Description |
---|
DefaultCustomContentManager(CustomContentDao customContentDao,
LinkManager linkManager,
ConfluenceIndexer indexer,
LabelManager labelManager,
AttachmentManager attachmentManager,
HibernateSessionManager hibernateSessionManager,
com.google.common.base.Supplier<XhtmlContent> xhtmlContent,
com.atlassian.event.api.EventPublisher eventPublisher,
NotificationManager notificationManager,
ContentTypeManager contentTypeManager,
RelationManager relationManager,
ContentFactory contentFactory,
com.google.common.base.Supplier<UserAccessor> userAccessor) |
Modifier and Type | Method and Description |
---|---|
long |
countChildrenOfType(CustomContentEntityObject content,
String contentModuleKey)
Get the total number of children of a piece of content with the given type
|
Iterator<CustomContentEntityObject> |
findAllChildren(CustomContentEntityObject content)
Get an iterator of all children of a piece of content.
|
Iterator<CustomContentEntityObject> |
findAllContainedOfType(long containerContentId,
String pluginModuleKey)
Get an iterator of contained content of a piece of content with a given type.
|
Collection<CustomContentEntityObject> |
findAllInSpace(Space space)
Deprecated.
|
<T> PageResponse<T> |
findByQuery(ContentQuery<T> query,
boolean cacheable,
LimitedRequest request,
com.google.common.base.Predicate<T> predicate)
Get the results of a query for CustomContentEntityObjects
|
<T> Iterator<T> |
findByQuery(ContentQuery<T> query,
int offset,
int maxResults)
Get the results of a query for CustomContentEntityObjects
|
Iterator<CustomContentEntityObject> |
findChildrenOfType(CustomContentEntityObject content,
String pluginContentKey,
int offset,
int maxResults,
CustomContentManager.SortField sortField,
CustomContentManager.SortOrder sortOrder)
Get an iterator of children of a piece of content with a given type.
|
Iterator<CustomContentEntityObject> |
findCurrentInSpace(Space space,
String pluginContentKey,
int offset,
int maxResults,
CustomContentManager.SortField sortField,
CustomContentManager.SortOrder sortOrder)
Get an iterator of all the current, non-deleted content of the given type in the given space.
|
<T> T |
findFirstObjectByQuery(ContentQuery<T> query)
Find the first result of a query for CustomContentEntityObjects.
|
int |
findTotalInSpace(Space space,
String pluginContentKey)
Get the total count of current, non-deleted content of the given type in the given space.
|
CustomContentEntityObject |
getById(long id)
Find a single CustomContentEntityObject by its id
|
PageResponse<Content> |
getChildrenOfType(ContentEntityObject entity,
String contentModuleKey,
LimitedRequest limitedRequest,
Expansions expansions,
Depth depth,
com.google.common.base.Predicate<? super CustomContentEntityObject> predicate)
Returns the children of a CustomContentEntityObject, limited to the pagination requested.
|
CustomContentEntityObject |
newPluginContentEntityObject(String contentModuleKey)
Create a new CustomContentEntityObject for the given module.
|
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 |
removeAllInSpace(String pluginContentKey,
Space space)
Remove all plugin content of a particular type from a given space.
|
void |
removeAllPluginContent(String contentModuleKey)
Remove all plugin content of a particular type
|
void |
removeAllPluginContentInSpace(Space space)
Remove all plugin content (of all types) from a given space.
|
void |
removeContentEntity(ContentEntityObject obj)
Removes given content entity object and all associated domain objects i.e.
|
void |
setContentFactory(ContentFactory contentFactory) |
void |
setContentTypeManager(ContentTypeManager contentTypeManager) |
CustomContentEntityObject |
updatePluginModuleKey(CustomContentEntityObject content,
String pluginModuleKey)
Update the type of an existing CustomContentEntityObject with the specified module key.
|
createDraft, findDraftFor, findDraftFor, findUnpublishedContentWithUserContributions, getAttachmentManager, getBodyContentForRevert, getById, getById, getByIds, getContentEntityObjectDao, getEventPublisher, getHibernateSessionManager, getIndexer, getLabelManager, getLinkManager, getNextVersion, getNotificationManager, getOtherVersion, getPageAndBlogPostsVersionsLastEditedByUser, getPageDao, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, getVersionHistorySummaries, getVersionsLastEditedByUser, refreshContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, saveNewVersion, saveNewVersion, setAttachmentManager, suppressNotificationsOnEventIfRequired, updateContentLinkingTo, updateContentLinkingTo, updateOutgoingLinksInContent, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo, updateSingleContentLinkinTo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
saveContentEntity
getNextVersion, getOtherVersion, getPageAndBlogPostsVersionsLastEditedByUser, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, getVersionsLastEditedByUser, refreshContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveContentEntity, saveNewVersion, saveNewVersion, updateContentLinkingTo, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo
public DefaultCustomContentManager(CustomContentDao customContentDao, LinkManager linkManager, ConfluenceIndexer indexer, LabelManager labelManager, AttachmentManager attachmentManager, HibernateSessionManager hibernateSessionManager, com.google.common.base.Supplier<XhtmlContent> xhtmlContent, com.atlassian.event.api.EventPublisher eventPublisher, NotificationManager notificationManager, ContentTypeManager contentTypeManager, RelationManager relationManager, ContentFactory contentFactory, com.google.common.base.Supplier<UserAccessor> userAccessor)
@Nonnull public CustomContentEntityObject newPluginContentEntityObject(String contentModuleKey)
CustomContentManager
newPluginContentEntityObject
in interface CustomContentManager
contentModuleKey
- the module complete key of the content's ContentAdapter module@Nonnull public CustomContentEntityObject updatePluginModuleKey(CustomContentEntityObject content, String pluginModuleKey)
CustomContentManager
updatePluginModuleKey
in interface CustomContentManager
pluginModuleKey
- the module complete key of the content's ContentAdapter module@Nullable public CustomContentEntityObject getById(long id)
CustomContentManager
getById
in interface CustomContentManager
getById
in interface ContentEntityManager
getById
in class DefaultContentEntityManager
id
- the ID of the entity to retrieve@Nonnull public <T> Iterator<T> findByQuery(ContentQuery<T> query, int offset, int maxResults)
CustomContentManager
findByQuery
in interface CustomContentManager
query
- the query to performoffset
- the first result to returnmaxResults
- the maximum number of results to return@Nonnull public <T> PageResponse<T> findByQuery(ContentQuery<T> query, boolean cacheable, LimitedRequest request, com.google.common.base.Predicate<T> predicate)
CustomContentManager
findByQuery
in interface CustomContentManager
query
- the query to performcacheable
- whether the results for the given query can be cachedrequest
- the limited pagination requestpredicate
- the filter to apply to the results@Nullable public <T> T findFirstObjectByQuery(ContentQuery<T> query)
CustomContentManager
findFirstObjectByQuery
in interface CustomContentManager
query
- the query to performpublic int findTotalInSpace(Space space, String pluginContentKey)
CustomContentManager
findTotalInSpace
in interface CustomContentManager
space
- the space to count content inpluginContentKey
- the plugin module complete key of the content to be searched for@Nonnull public Iterator<CustomContentEntityObject> findCurrentInSpace(Space space, String pluginContentKey, int offset, int maxResults, CustomContentManager.SortField sortField, CustomContentManager.SortOrder sortOrder)
CustomContentManager
findCurrentInSpace
in interface CustomContentManager
space
- the space to retrieve content frompluginContentKey
- the plugin module complete key of the content to be searched forsortField
- what field to sort the content onsortOrder
- which direction to sort the content inpublic long countChildrenOfType(CustomContentEntityObject content, String contentModuleKey)
CustomContentManager
countChildrenOfType
in interface CustomContentManager
content
- the content to look for children ofcontentModuleKey
- the module key for the type of child to look for@Nonnull public Iterator<CustomContentEntityObject> findChildrenOfType(CustomContentEntityObject content, String pluginContentKey, int offset, int maxResults, CustomContentManager.SortField sortField, CustomContentManager.SortOrder sortOrder)
CustomContentManager
findChildrenOfType
in interface CustomContentManager
content
- the content to look for children ofpluginContentKey
- the module key of the type of child to look foroffset
- the offset of the first resultmaxResults
- the maximum total results to returnsortField
- what field to sort the content onsortOrder
- which direction to sort the content in@Nonnull public PageResponse<Content> getChildrenOfType(ContentEntityObject entity, String contentModuleKey, LimitedRequest limitedRequest, Expansions expansions, Depth depth, com.google.common.base.Predicate<? super CustomContentEntityObject> predicate)
CustomContentManager
getChildrenOfType
in interface CustomContentManager
entity
- the content to look for children ofcontentModuleKey
- the module key of the type of child to look forlimitedRequest
- the pagination requestedexpansions
- the expansions applied to resultsdepth
- the depth to return children topredicate
- predicates used to filter the CustomContentEntityObjects@Nonnull public Iterator<CustomContentEntityObject> findAllChildren(CustomContentEntityObject content)
CustomContentManager
findAllChildren
in interface CustomContentManager
content
- the content to look for children of@Nonnull public Iterator<CustomContentEntityObject> findAllContainedOfType(long containerContentId, String pluginModuleKey)
CustomContentManager
findAllContainedOfType
in interface CustomContentManager
containerContentId
- the content id of the content to look contained forpluginModuleKey
- the module key of the type of contained to look forpublic void removeAllInSpace(String pluginContentKey, Space space)
CustomContentManager
removeAllInSpace
in interface CustomContentManager
pluginContentKey
- the plugin module complete key of the content to be searched forspace
- the space from which to delete all content of that typeprotected 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, @Nullable SaveContext saveContext)
publishCreateEvent
in class DefaultContentEntityManager
protected void publishUpdateEvent(ContentEntityObject obj, @Nullable ContentEntityObject origObj, @Nullable 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 void removeAllPluginContentInSpace(Space space)
CustomContentManager
removeAllPluginContentInSpace
in interface CustomContentManager
public void removeAllPluginContent(String contentModuleKey)
CustomContentManager
removeAllPluginContent
in interface CustomContentManager
contentModuleKey
- the plugin module complete key of the content to be searched forpublic void removeContentEntity(ContentEntityObject obj)
ContentEntityManager
removeContentEntity
in interface ContentEntityManager
removeContentEntity
in class DefaultContentEntityManager
@Deprecated @Nonnull public Collection<CustomContentEntityObject> findAllInSpace(Space space)
findAllInSpace
in interface CustomContentManager
space
- a spacepublic void setContentTypeManager(ContentTypeManager contentTypeManager)
public void setContentFactory(ContentFactory contentFactory)
Copyright © 2003–2016 Atlassian. All rights reserved.