Class DefaultExcerpter
java.lang.Object
com.atlassian.confluence.content.render.xhtml.view.excerpt.DefaultExcerpter
- All Implemented Interfaces:
Excerpter
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultExcerpter
(XMLOutputFactory xmlFragmentOutputFactory, XmlEventReaderFactory xmlEventReaderFactory, HtmlToXmlConverter htmlToXmlConverter, SettingsManager settingsManager, Renderer viewRenderer, Unmarshaller<EmbeddedImage> embeddedImageUnmarshaller, FragmentTransformer fragmentTransformer, AttachmentResourceIdentifierResolver attachmentResolver, DataSourceFactory datasourceFactory, ThumbnailManager thumbnailManager, MacroDefinitionTransformer macroDefinitionTransformer, ExcerptHelper excerptHelper, I18NBeanFactory i18NBeanFactory, LocaleManager localeManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateExcerpt
(Content content) Creates an excerpt block from the provided content object without any tags excluded, using an implementation specific number of blocks.createExcerpt
(ContentEntityObject contentEntity, String outputType) Creates an excerpt of the contentEntityObject without any tags excluded including an implementation specific number of blockingcreateExcerpt
(ContentEntityObject contentEntity, String outputType, ExcerptConfig config) Creates an excerpt of the contentEntityObject excluding any html tags that are in the exclude set.createExcerpt
(ContentEntityObject contentEntity, String outputType, Set<String> excludeSet, int maxBlocksForExcerpt) Deprecated.since 5.9.createExcerpt
(String contentHtml, ExcerptConfig config) extractImageSrc
(ContentEntityObject ceo, int maxImages) extractImageSrc
(ContentEntityObject ceo, int maxImages, boolean alwaysUseThumbnails) extractImageSrc
(String contentHtml, int maxImages) extractImageThumbnailUris
(ContentEntityObject contentEntity, int maxUris) Returns the URIs of thumbnails for each of the images attached to the specified content entity.filterEmptyAndExcludedEvents
(XMLEventReader reader, Set<String> excludeSet) getExcerpt
(ContentEntityObject content) Returns the already created excerpts of content.getExcerptSummary
(ContentEntityObject content) Returns the summary of an already created excerpt of content.Returns the text from a fragment of XHTML content.renderContent
(ContentEntityObject contentEntity, String outputType) Deprecated.
-
Field Details
-
DEFAULT_EXCLUDE_SET
-
DEFAULT_MAX_BLOCKS_FOR_EXCERPT
public static final int DEFAULT_MAX_BLOCKS_FOR_EXCERPT- See Also:
-
EXCERPT_MACRO_NAME
- See Also:
-
-
Constructor Details
-
DefaultExcerpter
public DefaultExcerpter(XMLOutputFactory xmlFragmentOutputFactory, XmlEventReaderFactory xmlEventReaderFactory, HtmlToXmlConverter htmlToXmlConverter, SettingsManager settingsManager, Renderer viewRenderer, Unmarshaller<EmbeddedImage> embeddedImageUnmarshaller, FragmentTransformer fragmentTransformer, AttachmentResourceIdentifierResolver attachmentResolver, DataSourceFactory datasourceFactory, ThumbnailManager thumbnailManager, MacroDefinitionTransformer macroDefinitionTransformer, ExcerptHelper excerptHelper, I18NBeanFactory i18NBeanFactory, LocaleManager localeManager) - Since:
- 7.6
-
-
Method Details
-
createExcerpt
Description copied from interface:Excerpter
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- Specified by:
createExcerpt
in interfaceExcerpter
- 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
Description copied from interface:Excerpter
Creates an excerpt of the contentEntityObject without any tags excluded including an implementation specific number of blocking- Specified by:
createExcerpt
in interfaceExcerpter
- Parameters:
contentEntity
- - 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
@Deprecated public String createExcerpt(ContentEntityObject contentEntity, String outputType, Set<String> excludeSet, int maxBlocksForExcerpt) throws Exception Deprecated.- Throws:
Exception
-
createExcerpt
public String createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config) throws XMLStreamException Description copied from interface:Excerpter
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
- Specified by:
createExcerpt
in interfaceExcerpter
- 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:
XMLStreamException
-
renderContent
Deprecated. -
createExcerpt
- Throws:
XMLStreamException
-
extractImageSrc
public List<DataSource> extractImageSrc(ContentEntityObject ceo, int maxImages) throws XMLStreamException, XhtmlException - Specified by:
extractImageSrc
in interfaceExcerpter
- Throws:
XMLStreamException
XhtmlException
-
extractImageSrc
public List<DataSource> extractImageSrc(ContentEntityObject ceo, int maxImages, boolean alwaysUseThumbnails) throws XMLStreamException, XhtmlException - Specified by:
extractImageSrc
in interfaceExcerpter
- Throws:
XMLStreamException
XhtmlException
-
extractImageSrc
- Specified by:
extractImageSrc
in interfaceExcerpter
- Throws:
XMLStreamException
-
filterEmptyAndExcludedEvents
protected List<XMLEvent> filterEmptyAndExcludedEvents(XMLEventReader reader, Set<String> excludeSet) -
extractImageThumbnailUris
public List<URI> extractImageThumbnailUris(ContentEntityObject contentEntity, int maxUris) throws XhtmlException Description copied from interface:Excerpter
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.
- Specified by:
extractImageThumbnailUris
in interfaceExcerpter
- 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.
-
getExcerpt
Description copied from interface:Excerpter
Returns the already created excerpts of content.- Specified by:
getExcerpt
in interfaceExcerpter
- Returns:
- the excerpt
-
getExcerptSummary
Description copied from interface:Excerpter
Returns the summary of an already created excerpt of content.- Specified by:
getExcerptSummary
in interfaceExcerpter
- Returns:
- the excerpt summary
-
getText
Description copied from interface:Excerpter
Returns the text from a fragment of XHTML content.
-