public interface

Excerpter

com.atlassian.confluence.content.render.xhtml.view.excerpt.Excerpter
Known Indirect Subclasses

Summary

Fields
public static final Set<String> BLOCK_ELEMENT_SET
public static final Set<String> CONTAINER_ELEMENT_SET
Public Methods
String createExcerpt(ContentEntityObject contentEntityObject, String outputType)
Creates an excerpt of the contentEntityObject without any tags excluded including an implementation specific number of blocking
String createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config)
Creates an excerpt of the contentEntityObject excluding any html tags that are in the exclude set.
List<String> extractImageSrc(String contentHtml, int numImages)
List<DataSource> extractImageSrc(ContentEntityObject ceo, int numImages)
List<DataSource> extractImageSrc(ContentEntityObject ceo, int numImages, boolean useThumbnails)
List<URI> extractImageThumbnailUris(ContentEntityObject contentEntity, int maxUris)
Returns the URIs of thumbnails for each of the images attached to the specified content entity.

Fields

public static final Set<String> BLOCK_ELEMENT_SET

public static final Set<String> CONTAINER_ELEMENT_SET

Public Methods

public String createExcerpt (ContentEntityObject contentEntityObject, String outputType)

Creates an excerpt of the contentEntityObject without any tags excluded including an implementation specific number of blocking

Parameters
contentEntityObject - contentEntityObject to create an excerpt of
outputType - the output type in which to render the content, @see RenderContextOutputType
Returns
  • a html excerpt of the content entity object
Throws
Exception - if an excerpt could not be created for this ContentEntityObject

public String createExcerpt (ContentEntityObject contentEntity, String outputType, ExcerptConfig config)

Creates an excerpt of the contentEntityObject excluding any html tags that are in the exclude set. The number of blocks with content to be included in the excerpt is specified with the maxBlocksForExcerpt parameter. A block with content is any element with a

Parameters
outputType - the output type in which to render the content, @see RenderContextOutputType
config - a parameter object that allows the content of the excerpt to be customized. @see ExcerptConfig
Returns
  • a html excerpt of the content entity object
Throws
Exception - if an excerpt could not be created for this ContentEntityObject
RendererException
XMLStreamException

public List<String> extractImageSrc (String contentHtml, int numImages)

Throws
XMLStreamException

public List<DataSource> extractImageSrc (ContentEntityObject ceo, int numImages)

Throws
XMLStreamException
XhtmlException

public List<DataSource> extractImageSrc (ContentEntityObject ceo, int numImages, boolean useThumbnails)

Throws
XMLStreamException
XhtmlException

public List<URI> extractImageThumbnailUris (ContentEntityObject contentEntity, int maxUris)

Returns the URIs of thumbnails for each of the images attached to the specified content entity. URIs are returned in order that the images appear in the document. Obviously only URIs for thumbnailable images will be returned.

Parameters
contentEntity the content entity
maxUris the maximum URI's to return
Returns
  • ordered list of thumbnails URIs
Throws
XhtmlException if there is an error parsing the contents for image references.