public class

DefaultContentAdapter

extends Object
implements ContentEntityAdapter
java.lang.Object
   ↳ com.atlassian.confluence.content.DefaultContentAdapter

Class Overview

This gets set on content if the plugin content adapter for that content type can't be found (it's broken, disabled or deleted)

Summary

Fields
public static final ContentEntityAdapter INSTANCE
Public Methods
Option<String> getAttachmentUrlPath(CustomContentEntityObject pluginContentEntityObject, Attachment attachment)
Return the URL path to view the a particular attachment of the content
Option<String> getAttachmentsUrlPath(CustomContentEntityObject pluginContentEntityObject)
Return the URL path to view the list of attachments on the content
BodyType getDefaultBodyType(CustomContentEntityObject pluginContentEntityObject)
Get the default type for BodyContent objects attached to this content.
Option<String> getDisplayTitle(CustomContentEntityObject pluginContentEntityObject)
Gets the display-friendly title for the content.
Option<String> getExcerpt(CustomContentEntityObject pluginContentEntityObject)
Get a text-only summary of the content that is suitable for use in activity streams, search results and other places where a short placeholder for the content is necessary.
Option<String> getNameForComparison(CustomContentEntityObject pluginContentEntityObject)
Return the sorting-friendly title for the content, if the content is to be sorted in alphabetical order.
Option<String> getUrlPath(CustomContentEntityObject pluginContentEntityObject)
Gets the URL string (relative to the Confluence application context) at which this content can be viewed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.content.ContentEntityAdapter

Fields

public static final ContentEntityAdapter INSTANCE

Public Methods

public Option<String> getAttachmentUrlPath (CustomContentEntityObject pluginContentEntityObject, Attachment attachment)

Return the URL path to view the a particular attachment of the content

Parameters
pluginContentEntityObject the content to view attachments for
attachment the attachment to link to
Returns
  • the URL path to view attachments on the content, or none to use to the default

public Option<String> getAttachmentsUrlPath (CustomContentEntityObject pluginContentEntityObject)

Return the URL path to view the list of attachments on the content

Parameters
pluginContentEntityObject the content to view attachments for
Returns
  • the URL path to view attachments on the content, or none to use to the default

public BodyType getDefaultBodyType (CustomContentEntityObject pluginContentEntityObject)

Get the default type for BodyContent objects attached to this content.

Parameters
pluginContentEntityObject the content to get the body type of
Returns
  • the default BodyType for that content

public Option<String> getDisplayTitle (CustomContentEntityObject pluginContentEntityObject)

Gets the display-friendly title for the content. For example, a Comment does not have a title of its own, but where the UI needs to display the title of a comment, it uses "Re: Title Of Page Being Commented On".

Parameters
pluginContentEntityObject the content to calculate the display title for
Returns
  • the display title of that content, or none to use to the default

public Option<String> getExcerpt (CustomContentEntityObject pluginContentEntityObject)

Get a text-only summary of the content that is suitable for use in activity streams, search results and other places where a short placeholder for the content is necessary. The default implementation takes the first 255 characters of the content's main body with most markup characters removed.

Parameters
pluginContentEntityObject the content to excerpt
Returns
  • the excerpt for that content, or none to use the default

public Option<String> getNameForComparison (CustomContentEntityObject pluginContentEntityObject)

Return the sorting-friendly title for the content, if the content is to be sorted in alphabetical order.

Parameters
pluginContentEntityObject the content to calculate the sorting title for
Returns
  • the sorting title of that content, or none to use to the default

public Option<String> getUrlPath (CustomContentEntityObject pluginContentEntityObject)

Gets the URL string (relative to the Confluence application context) at which this content can be viewed.

Parameters
pluginContentEntityObject the content to be viewed
Returns
  • the relative URL path to that content, or none to use to the default