public interface

CustomContentManager

implements ContentEntityManager
com.atlassian.confluence.content.CustomContentManager
Known Indirect Subclasses

Summary

Nested Classes
enum CustomContentManager.SortField  
enum CustomContentManager.SortOrder  
[Expand]
Inherited Constants
From interface com.atlassian.confluence.core.ContentEntityManager
Public Methods
Collection<CustomContentEntityObject> findAllInSpace(Space space)
This method is deprecated. this method is evil. Do not call.
<T> Iterator<T> findByQuery(ContentQuery<T> query, int offset, int maxResults)
Get the results of a query for PluginContentEntityObjects
Iterator<CustomContentEntityObject> findCurrentInSpace(Space space, String contentModuleKey, 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 PluginContentEntityObjects.
int findTotalInSpace(Space space, String contentModuleKey)
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
CustomContentEntityObject newPluginContentEntityObject(String contentModuleKey)
Create a new CustomContentEntityObject for the given module.
void removeAllInSpace(String contentModuleKey, Space space)
Remove all plugin content of a particular type from a given space.
void removeAllPluginContentInSpace(Space space)
Remove all plugin content (of all types) from a given space.
[Expand]
Inherited Methods
From interface com.atlassian.confluence.core.ContentEntityManager

Public Methods

public Collection<CustomContentEntityObject> findAllInSpace (Space space)

This method is deprecated.
this method is evil. Do not call.

This method is required for space exports to work properly. Which is a good sign that space exports are evil and need to be rewritten. If you call it from anywhere else, I will kill a puppy.

Parameters
space a space
Returns
  • all plugin content within that space

public Iterator<T> findByQuery (ContentQuery<T> query, int offset, int maxResults)

Get the results of a query for PluginContentEntityObjects

Parameters
query the query to perform
offset the first result to return
maxResults the maximum number of results to return
Returns
  • an iterator of the results of the query

public Iterator<CustomContentEntityObject> findCurrentInSpace (Space space, String contentModuleKey, 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.

Parameters
space the space to retrieve content from
contentModuleKey the plugin module complete key of the content to be searched for
sortField what field to sort the content on
sortOrder which direction to sort the content in
Returns
  • an iterator of the non-deleted, non-historical versions of content of the given type in that space

public T findFirstObjectByQuery (ContentQuery<T> query)

Find the first result of a query for PluginContentEntityObjects. This is a convenience method for queries where we expect to only retrieve a single result.

Parameters
query the query to perform
Returns
  • the first result of the query, or null if no results are returned

public int findTotalInSpace (Space space, String contentModuleKey)

Get the total count of current, non-deleted content of the given type in the given space.

Parameters
space the space to count content in
contentModuleKey the plugin module complete key of the content to be searched for
Returns
  • the total number of non-deleted, non-historical versions of content of the given type in that space

public CustomContentEntityObject getById (long id)

Find a single CustomContentEntityObject by its id

Parameters
id the ID of the entity to retrieve
Returns
  • the entity, or null if no such entity exists.

public CustomContentEntityObject newPluginContentEntityObject (String contentModuleKey)

Create a new CustomContentEntityObject for the given module. This method will ensure that the plugin delegate and various necessary arguments are set.

Parameters
contentModuleKey the module complete key of the content's ContentAdapter module
Returns
  • a blank entity object for that plugin

public void removeAllInSpace (String contentModuleKey, Space space)

Remove all plugin content of a particular type from a given space.

Parameters
contentModuleKey the plugin module complete key of the content to be searched for
space the space from which to delete all content of that type

public void removeAllPluginContentInSpace (Space space)

Remove all plugin content (of all types) from a given space. This usually happens when a space is removed. Plugins wishing to perform extra work on space removal should listen for the PluginContentWillBeRemovedForSpaceEvent event.