Interface Excerpter
-
- All Known Implementing Classes:
DefaultExcerpter
public interface Excerpter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
createExcerpt(Content content)
Creates an excerpt block from the provided content object without any tags excluded, using an implementation specific number of blocks.String
createExcerpt(ContentEntityObject contentEntityObject, String outputType)
Creates an excerpt of the contentEntityObject without any tags excluded including an implementation specific number of blockingString
createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config)
Creates an excerpt of the contentEntityObject excluding any html tags that are in the exclude set.List<javax.activation.DataSource>
extractImageSrc(ContentEntityObject ceo, int numImages)
List<javax.activation.DataSource>
extractImageSrc(ContentEntityObject ceo, int numImages, boolean useThumbnails)
List<String>
extractImageSrc(String contentHtml, int numImages)
List<URI>
extractImageThumbnailUris(ContentEntityObject contentEntity, int maxUris)
Returns the URIs of thumbnails for each of the images attached to the specified content entity.String
getExcerpt(ContentEntityObject ceo)
Returns the already created excerpts of content.String
getExcerptSummary(ContentEntityObject ceo)
Returns the summary of an already created excerpt of content.String
getText(String content)
Returns the text from a fragment of XHTML content.
-
-
-
Method Detail
-
createExcerpt
String createExcerpt(Content content) throws Exception
Creates an excerpt block from the provided content object without any tags excluded, using an implementation specific number of blocks. This uses the EXPORT_VIEW content representation, and as such this should be already expanded- Parameters:
content
- - the content entity object to create an excerpt of- Returns:
- Throws:
Exception
- - if an excerpt cannot be created for this content object
-
createExcerpt
String createExcerpt(ContentEntityObject contentEntityObject, String outputType) throws Exception
Creates an excerpt of the contentEntityObject without any tags excluded including an implementation specific number of blocking- Parameters:
contentEntityObject
- - contentEntityObject to create an excerpt ofoutputType
- - 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
-
createExcerpt
String createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config) throws XMLStreamException, com.atlassian.plugin.web.renderer.RendererException
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:
contentEntity
- - contentEntityObject to create an excerpt ofoutputType
- - the output type in which to render the content, @see RenderContextOutputTypeconfig
- - 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 ContentEntityObjectXMLStreamException
com.atlassian.plugin.web.renderer.RendererException
-
extractImageSrc
List<String> extractImageSrc(String contentHtml, int numImages) throws XMLStreamException
- Throws:
XMLStreamException
-
extractImageThumbnailUris
List<URI> extractImageThumbnailUris(ContentEntityObject contentEntity, int maxUris) throws XhtmlException
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 entitymaxUris
- 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.
-
extractImageSrc
List<javax.activation.DataSource> extractImageSrc(ContentEntityObject ceo, int numImages) throws XMLStreamException, XhtmlException
- Throws:
XMLStreamException
XhtmlException
-
extractImageSrc
List<javax.activation.DataSource> extractImageSrc(ContentEntityObject ceo, int numImages, boolean useThumbnails) throws XMLStreamException, XhtmlException
- Throws:
XMLStreamException
XhtmlException
-
getExcerpt
String getExcerpt(ContentEntityObject ceo)
Returns the already created excerpts of content.- Returns:
- the excerpt
- Since:
- 6.2.0
-
getExcerptSummary
String getExcerptSummary(ContentEntityObject ceo)
Returns the summary of an already created excerpt of content.- Returns:
- the excerpt summary
- Since:
- 6.2.0
-
-