Modifier and Type | Field and Description |
---|---|
static Set<String> |
DEFAULT_EXCLUDE_SET |
static int |
DEFAULT_MAX_BLOCKS_FOR_EXCERPT |
static String |
EXCERPT_MACRO_NAME |
Constructor and Description |
---|
DefaultExcerpter(XMLOutputFactory xmlFragmentOutputFactory,
XmlEventReaderFactory xmlEventReaderFactory,
HtmlToXmlConverter htmlToXmlConverter,
SettingsManager settingsManager,
Renderer viewRenderer,
Unmarshaller<EmbeddedImage> embeddedImageUnmarshaller,
FragmentTransformer fragmentTransformer,
AttachmentResourceIdentifierResolver attachmentResolver,
DataSourceFactory datasourceFactory,
ThumbnailManager thumbnailManager,
XhtmlContent xhtmlContent,
ExcerptHelper excerptHelper,
I18NBeanFactory i18NBeanFactory,
LocaleManager localeManager) |
Modifier and Type | Method and 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 contentEntity,
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.
|
String |
createExcerpt(ContentEntityObject contentEntity,
String outputType,
Set<String> excludeSet,
int maxBlocksForExcerpt)
Deprecated.
|
String |
createExcerpt(String contentHtml,
ExcerptConfig config) |
List<DataSource> |
extractImageSrc(ContentEntityObject ceo,
int maxImages) |
List<DataSource> |
extractImageSrc(ContentEntityObject ceo,
int maxImages,
boolean alwaysUseThumbnails) |
List<String> |
extractImageSrc(String contentHtml,
int maxImages) |
List<URI> |
extractImageThumbnailUris(ContentEntityObject contentEntity,
int maxUris)
Returns the URIs of thumbnails for each of the images attached to the specified content entity.
|
protected List<XMLEvent> |
filterEmptyAndExcludedEvents(XMLEventReader reader,
Set<String> excludeSet) |
String |
getExcerpt(ContentEntityObject content)
Returns the already created excerpts of content.
|
String |
getExcerptSummary(ContentEntityObject content)
Returns the summary of an already created excerpt of content.
|
String |
getText(String content)
Returns the text from a fragment of XHTML content.
|
String |
renderContent(ContentEntityObject contentEntity,
String outputType)
Deprecated.
|
public static final int DEFAULT_MAX_BLOCKS_FOR_EXCERPT
public static final String EXCERPT_MACRO_NAME
public DefaultExcerpter(XMLOutputFactory xmlFragmentOutputFactory, XmlEventReaderFactory xmlEventReaderFactory, HtmlToXmlConverter htmlToXmlConverter, SettingsManager settingsManager, Renderer viewRenderer, Unmarshaller<EmbeddedImage> embeddedImageUnmarshaller, FragmentTransformer fragmentTransformer, AttachmentResourceIdentifierResolver attachmentResolver, DataSourceFactory datasourceFactory, ThumbnailManager thumbnailManager, XhtmlContent xhtmlContent, ExcerptHelper excerptHelper, I18NBeanFactory i18NBeanFactory, LocaleManager localeManager)
public String createExcerpt(Content content) throws Exception
Excerpter
createExcerpt
in interface Excerpter
content
- - the content entity object to create an excerpt ofException
- - if an excerpt cannot be created for this content objectpublic String createExcerpt(ContentEntityObject contentEntity, String outputType) throws Exception
Excerpter
createExcerpt
in interface Excerpter
contentEntity
- - contentEntityObject to create an excerpt ofoutputType
- - the output type in which to render the content, @see RenderContextOutputTypeException
- - if an excerpt could not be created for this ContentEntityObject@Deprecated public String createExcerpt(ContentEntityObject contentEntity, String outputType, Set<String> excludeSet, int maxBlocksForExcerpt) throws Exception
createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config)
Exception
public String createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config) throws XMLStreamException
Excerpter
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
createExcerpt
in interface Excerpter
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 ExcerptConfigXMLStreamException
@Deprecated public String renderContent(ContentEntityObject contentEntity, String outputType)
public String createExcerpt(String contentHtml, ExcerptConfig config) throws XMLStreamException
XMLStreamException
public List<DataSource> extractImageSrc(ContentEntityObject ceo, int maxImages) throws XMLStreamException, XhtmlException
extractImageSrc
in interface Excerpter
XMLStreamException
XhtmlException
public List<DataSource> extractImageSrc(ContentEntityObject ceo, int maxImages, boolean alwaysUseThumbnails) throws XMLStreamException, XhtmlException
extractImageSrc
in interface Excerpter
XMLStreamException
XhtmlException
public List<String> extractImageSrc(String contentHtml, int maxImages) throws XMLStreamException
extractImageSrc
in interface Excerpter
XMLStreamException
protected List<XMLEvent> filterEmptyAndExcludedEvents(XMLEventReader reader, Set<String> excludeSet)
public List<URI> extractImageThumbnailUris(ContentEntityObject contentEntity, int maxUris) throws XhtmlException
Excerpter
URIs are returned in order that the images appear in the document. Obviously only URIs for thumbnailable images will be returned.
extractImageThumbnailUris
in interface Excerpter
contentEntity
- the content entitymaxUris
- the maximum URI's to returnXhtmlException
- if there is an error parsing the contents for image references.public String getExcerpt(ContentEntityObject content)
Excerpter
getExcerpt
in interface Excerpter
public String getExcerptSummary(ContentEntityObject content)
Excerpter
getExcerptSummary
in interface Excerpter
Copyright © 2003–2019 Atlassian. All rights reserved.