| 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
ExcerptercreateExcerpt in interface Excerptercontent - - 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
ExcerptercreateExcerpt in interface ExcerptercontentEntity - - 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)Exceptionpublic String createExcerpt(ContentEntityObject contentEntity, String outputType, ExcerptConfig config) throws XMLStreamException
ExcerpterThe 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 ExcerptercontentEntity - - 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
XMLStreamExceptionpublic List<DataSource> extractImageSrc(ContentEntityObject ceo, int maxImages) throws XMLStreamException, XhtmlException
extractImageSrc in interface ExcerpterXMLStreamExceptionXhtmlExceptionpublic List<DataSource> extractImageSrc(ContentEntityObject ceo, int maxImages, boolean alwaysUseThumbnails) throws XMLStreamException, XhtmlException
extractImageSrc in interface ExcerpterXMLStreamExceptionXhtmlExceptionpublic List<String> extractImageSrc(String contentHtml, int maxImages) throws XMLStreamException
extractImageSrc in interface ExcerpterXMLStreamExceptionprotected List<XMLEvent> filterEmptyAndExcludedEvents(XMLEventReader reader, Set<String> excludeSet)
public List<URI> extractImageThumbnailUris(ContentEntityObject contentEntity, int maxUris) throws XhtmlException
ExcerpterURIs are returned in order that the images appear in the document. Obviously only URIs for thumbnailable images will be returned.
extractImageThumbnailUris in interface ExcerptercontentEntity - 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)
ExcerptergetExcerpt in interface Excerpterpublic String getExcerptSummary(ContentEntityObject content)
ExcerptergetExcerptSummary in interface ExcerpterCopyright © 2003–2018 Atlassian. All rights reserved.