public class ContentBodyConversionServiceImpl extends Object implements ContentBodyConversionService
| Constructor and Description |
|---|
ContentBodyConversionServiceImpl(FormatConverter formatConverter,
ContentEntityManagerInternal contentEntityManager,
ExceptionTolerantMigrator xhtmlRoundTripMigrator,
WikiToXhtmlMigrator wikiToXhtmlMigrator,
Renderer viewRenderer,
SettingsManager settingsManager) |
| Modifier and Type | Method and Description |
|---|---|
ContentBody |
convert(ContentBody contentBody,
ContentRepresentation toFormat)
Convert a ContentBody value into another format, performing validation during the conversion.
|
ContentBody |
convertBody(Content content,
ContentRepresentation toFormat)
Convert the single ContentBody value in a
Content body map into another format, performing
validation during the conversion. |
com.atlassian.fugue.Option<ContentBody> |
getBodyToConvert(Content content,
ContentRepresentation toFormat)
Given a
Content object for which the body could be converted to a given ContentRepresentation,
returns the ContentBody that would be used for the conversion. |
public ContentBodyConversionServiceImpl(FormatConverter formatConverter, ContentEntityManagerInternal contentEntityManager, ExceptionTolerantMigrator xhtmlRoundTripMigrator, WikiToXhtmlMigrator wikiToXhtmlMigrator, Renderer viewRenderer, SettingsManager settingsManager)
public ContentBody convertBody(Content content, ContentRepresentation toFormat) throws ServiceException
ContentBodyConversionServiceContent body map into another format, performing
validation during the conversion.
This is a wrapper method for ContentBodyConversionService.convert(ContentBody, ContentRepresentation) that assumes
a single entry in the Body map to save the calling code having to manually extract it.
convertBody in interface ContentBodyConversionServicecontent - the content to convert the ContentBody of, if this specifies a contentId then the persisted
content will be used to generated the conversionContext.toFormat - the ContentRepresentation to convert toBadRequestException - if any validation errors are found during the conversionServiceExceptionpublic ContentBody convert(ContentBody contentBody, ContentRepresentation toFormat) throws ServiceException
ContentBodyConversionServiceconvert in interface ContentBodyConversionServicecontentBody - the content to converttoFormat - the ContentRepresentation to convert toBadRequestException - if any validation errors are found during the conversionServiceExceptionpublic com.atlassian.fugue.Option<ContentBody> getBodyToConvert(Content content, ContentRepresentation toFormat)
ContentBodyConversionServiceContent object for which the body could be converted to a given ContentRepresentation,
returns the ContentBody that would be used for the conversion.
If the supplied Content contains no ContentBody objects, or if none of those ContentBodies are suitable for conversion into the ContentRepresentation, an Option.none() result will be returned.
getBodyToConvert in interface ContentBodyConversionServicecontent - content to convert the body oftoFormat - the representation that will be converted toCopyright © 2003–2015 Atlassian. All rights reserved.