com.atlassian.confluence.content.render.xhtml.view.excerpt
Class DefaultExcerpter

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.view.excerpt.DefaultExcerpter
All Implemented Interfaces:
Excerpter

public class DefaultExcerpter
extends Object
implements Excerpter


Field Summary
 
Fields inherited from interface com.atlassian.confluence.content.render.xhtml.view.excerpt.Excerpter
BLOCK_ELEMENT_SET, CONTAINER_ELEMENT_SET
 
Constructor Summary
DefaultExcerpter(XMLOutputFactory xmlFragmentOutputFactory, XmlEventReaderFactory xmlEventReaderFactory, HtmlToXmlConverter htmlToXmlConverter, SettingsManager settingsManager, Renderer viewRenderer, Unmarshaller<EmbeddedImage> embeddedImageUnmarshaller, FragmentTransformer fragmentTransformer, AttachmentResourceIdentifierResolver attachmentResolver, DataSourceFactory datasourceFactory, ThumbnailManager thumbnailManager, XhtmlContent xhtmlContent)
           
 
Method Summary
 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)
           
 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 excludeSet)
           
 String renderContent(ContentEntityObject contentEntity, String outputType)
          Deprecated. 
protected  void skipCurrentNode(Iterator<XMLEvent> reader)
          skips the current node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExcerpter

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)
Method Detail

createExcerpt

public String createExcerpt(ContentEntityObject contentEntity,
                            String outputType)
                     throws Exception
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 interface Excerpter
Parameters:
contentEntity - - 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

createExcerpt

public String createExcerpt(ContentEntityObject contentEntity,
                            String outputType,
                            Set<String> excludeSet,
                            int maxBlocksForExcerpt)
                     throws Exception
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 interface Excerpter
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:
XMLStreamException

renderContent

@Deprecated
public String renderContent(ContentEntityObject contentEntity,
                                       String outputType)
Deprecated. 


createExcerpt

public String createExcerpt(String contentHtml,
                            ExcerptConfig config)
                     throws XMLStreamException
Throws:
XMLStreamException

extractImageSrc

public List<DataSource> extractImageSrc(ContentEntityObject ceo,
                                        int maxImages)
                                 throws XMLStreamException,
                                        XhtmlException
Specified by:
extractImageSrc in interface Excerpter
Throws:
XMLStreamException
XhtmlException

extractImageSrc

public List<DataSource> extractImageSrc(ContentEntityObject ceo,
                                        int maxImages,
                                        boolean alwaysUseThumbnails)
                                 throws XMLStreamException,
                                        XhtmlException
Specified by:
extractImageSrc in interface Excerpter
Throws:
XMLStreamException
XhtmlException

extractImageSrc

public List<String> extractImageSrc(String contentHtml,
                                    int maxImages)
                             throws XMLStreamException
Specified by:
extractImageSrc in interface Excerpter
Throws:
XMLStreamException

filterEmptyAndExcludedEvents

protected List<XMLEvent> filterEmptyAndExcludedEvents(XMLEventReader reader,
                                                      Set excludeSet)

skipCurrentNode

protected void skipCurrentNode(Iterator<XMLEvent> reader)
                        throws XMLStreamException
skips the current node

Parameters:
reader -
Throws:
XMLStreamException

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 interface Excerpter
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.


Copyright © 2003-2013 Atlassian. All Rights Reserved.