Package com.atlassian.confluence.plugin
Interface CustomContentProvider
public interface CustomContentProvider
Allows plugins to provide comprehensive support for their custom content types.
This includes view restrictions, scan filtering, and content type metadata.
Plugins implement this interface to integrate their permission models with Confluence's REST API and control how their content appears in Confluence operations.
Currently, each provider only handles one content type. Each plugin can have one or more providers.
- Since:
- 9.2.11
-
Method Summary
Modifier and TypeMethodDescriptiongetRelevantViewRestrictions(List<CustomContentEntityObject> customContentEntityObjects) Provides view restrictions for content with the given list of custom content entity objects.Returns the custom content type for scan api.Returns a list of classes that this provider supports for event handling.default booleanisScannableContent(String contentPluginKey) Indicates whether content with this content type should be included in scan operations.
-
Method Details
-
getContentPluginKey
String getContentPluginKey()- Returns:
- The content plugin key this provider handles. This refers to the PluginModuleKey for the custom content. (e.g., "com.atlassian.confluence.extra.team-calendars:calendar-content-type")
-
getRelevantViewRestrictions
Optional<Map<ContentId,RelevantViewRestrictions>> getRelevantViewRestrictions(List<CustomContentEntityObject> customContentEntityObjects) Provides view restrictions for content with the given list of custom content entity objects. This method is called when the REST API requests view restrictions for custom content.- Parameters:
customContentEntityObjects- The list of custom content entity objects to get restrictions for- Returns:
- MapView restrictions or empty if this provider doesn't handle this specific case
-
isScannableContent
Indicates whether content with this content type should be included in scan operations. This allows plugins to exclude utility/metadata content from general content scans.- Parameters:
contentPluginKey- The content type to check- Returns:
- true if content should be scannable, false to exclude from scans
-
getScanType
Returns the custom content type for scan api. This is used to filter content by a specific category.- Returns:
- A user-friendly type name (e.g., "calendar", "question")
-
getSupportedEventClasses
Returns a list of classes that this provider supports for event handling. This allows the system to process events related to custom content types during Incremental sync.- Returns:
- List of supported event classes
-