Interface FormatConverter
-
- All Known Implementing Classes:
DefaultFormatConverter
public interface FormatConverter
Provides a convenient service for transforming to and from the storage format into the editor and view formats.- Since:
- 4.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
cleanEditorFormat(String editorFormat, com.atlassian.renderer.RenderContext renderContext)
Cleans the editor formatString
cleanStorageFormat(String storageFormat)
Cleans the storage formatString
convertToEditorFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the editor format.RenderResult
convertToEditorFormatWithResult(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the editor format.String
convertToStorageFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Returns the content that has been submitted as part of a user's attempt to add new content or edit existing content.String
convertToViewFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the view format.String
validateAndConvertToStorageFormat(ConfluenceActionSupport action, String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Validates, and adds any errors to the action.String
validateAndConvertToStorageFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Validates, throwing exceptions if failures found.
-
-
-
Method Detail
-
validateAndConvertToStorageFormat
String validateAndConvertToStorageFormat(ConfluenceActionSupport action, String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Validates, and adds any errors to the action. Returns the storage format if successful.- Parameters:
action
- action to add any errors found intowysiwygContent
-renderContext
-- Returns:
-
validateAndConvertToStorageFormat
String validateAndConvertToStorageFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) throws BadRequestException
Validates, throwing exceptions if failures found. Returns the storage format if successful.- Parameters:
wysiwygContent
-renderContext
-- Returns:
- Throws:
BadRequestException
-
convertToStorageFormat
String convertToStorageFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) throws XhtmlParsingException, XhtmlException
Returns the content that has been submitted as part of a user's attempt to add new content or edit existing content. The content is returned in storage format ready for saving.- Returns:
- the content that has been submitted as part of a user's attempt to add new content or edit existing content.
- Throws:
XhtmlParsingException
XhtmlException
-
convertToEditorFormat
String convertToEditorFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the editor format.- Parameters:
storageFormat
-renderContext
-- Returns:
-
convertToEditorFormatWithResult
RenderResult convertToEditorFormatWithResult(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the editor format.- Parameters:
storageFormat
-renderContext
-- Returns:
-
convertToViewFormat
String convertToViewFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the view format.- Parameters:
storageFormat
-renderContext
-- Returns:
-
cleanEditorFormat
String cleanEditorFormat(String editorFormat, com.atlassian.renderer.RenderContext renderContext) throws XhtmlException
Cleans the editor format- Parameters:
editorFormat
-renderContext
-- Returns:
- a cleaned version of the editorFormat
- Throws:
XhtmlException
-
-