Interface EditorFormatService
-
- All Known Implementing Classes:
DefaultEditorFormatService
public interface EditorFormatServiceProvides methods that convert between edit and storage formats.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EmbeddedImageconvertEditToEmbeddedImage(String editFragment, ConversionContext context)Returns aEmbeddedImagefrom the suppliededitFragment.LinkconvertEditToLink(String editFragment, ConversionContext context)Returns aMacroDefinitionfrom the suppliededitFragment.MacroDefinitionconvertEditToMacroDefinition(String editFragment, ConversionContext context)Returns aMacroDefinitionfrom the suppliededitFragment.StringconvertEditToStorage(String editFragment, ConversionContext context)Returns an storage format fragment for the suppliededitFragment.StringconvertEmbeddedImageToEdit(EmbeddedImage embeddedImage, ConversionContext context)Returns an edit format fragment for the suppliedembeddedImage.StringconvertLinkToEdit(Link link, ConversionContext context)Returns an edit format fragment for the suppliedlink.StringconvertMacroDefinitionToEdit(MacroDefinition macroDefinition, ConversionContext context)Returns an edit format fragment for the suppliedmacroDefinition.StringconvertStorageToEdit(String storageFragment, ConversionContext context)Returns an edit format fragment for the suppliedstorageFragment.StringconvertWikiToEdit(String wikiContent, ConversionContext context)Returns the XHTML edit format equivalent of the suppliedwikiContent(Wiki markup).
-
-
-
Method Detail
-
convertWikiToEdit
String convertWikiToEdit(String wikiContent, ConversionContext context) throws XhtmlException
Returns the XHTML edit format equivalent of the suppliedwikiContent(Wiki markup).- Parameters:
wikiContent- to be converted.context- for the conversion.- Returns:
- the XHTML storage format equivalent.
- Throws:
XhtmlException- if there are any problems during the conversion.
-
convertStorageToEdit
String convertStorageToEdit(String storageFragment, ConversionContext context) throws XMLStreamException, XhtmlException
Returns an edit format fragment for the suppliedstorageFragment.- Parameters:
storageFragment- to be converted (for example the body of a macro).context- for the conversion.- Returns:
- the edit format fragment (HTML rather than XML).
- Throws:
XMLStreamException- if there was a problem reading the storage fragment.XhtmlException- if there was a problem creating the edit fragment.
-
convertEditToStorage
String convertEditToStorage(String editFragment, ConversionContext context) throws XMLStreamException, XhtmlException
Returns an storage format fragment for the suppliededitFragment.- Parameters:
editFragment- to be converted (for example the body of a macro).context- for the conversion.- Returns:
- the storage format fragment.
- Throws:
XMLStreamException- if there was a problem reading the edit fragment.XhtmlException- if there was a problem creating the storage fragment.
-
convertMacroDefinitionToEdit
String convertMacroDefinitionToEdit(MacroDefinition macroDefinition, ConversionContext context) throws XhtmlException
Returns an edit format fragment for the suppliedmacroDefinition.The body of the macro definition is expected to be in storage format. It will be transformed to editor format as part of the conversion carried out in this method.
- Parameters:
macroDefinition- that describes the macro. The body of this macro definition (returned byMacroDefinition.getBody()is expected to be in storage format.context- for the conversion.- Returns:
- the edit format fragment (HTML rather than XML).
- Throws:
XhtmlException- if there was a problem creating the fragment.
-
convertLinkToEdit
String convertLinkToEdit(Link link, ConversionContext context) throws XhtmlException
Returns an edit format fragment for the suppliedlink.- Parameters:
link- that describes the link.context- for the conversion.- Returns:
- the edit format fragment.
- Throws:
XhtmlException- if there was a problem creating the fragment.
-
convertEmbeddedImageToEdit
String convertEmbeddedImageToEdit(EmbeddedImage embeddedImage, ConversionContext context) throws XhtmlException
Returns an edit format fragment for the suppliedembeddedImage.- Parameters:
embeddedImage- that describes the resource (such as an image).context- for the conversion.- Returns:
- the edit format fragment.
- Throws:
XhtmlException- if there was a problem creating the fragment.
-
convertEditToMacroDefinition
MacroDefinition convertEditToMacroDefinition(String editFragment, ConversionContext context) throws XMLStreamException, XhtmlException
Returns aMacroDefinitionfrom the suppliededitFragment.- Parameters:
editFragment- which should be the edit format definition of the macro (as XML rather than HTML).context- for the conversion.- Returns:
- the MacroDefinition.
- Throws:
XMLStreamException- if there was a problem reading the edit fragment.XhtmlException- if there was a problem creating the MacroDefinition.
-
convertEditToLink
Link convertEditToLink(String editFragment, ConversionContext context) throws XMLStreamException, XhtmlException
Returns aMacroDefinitionfrom the suppliededitFragment.- Parameters:
editFragment- which should be the edit format definition of the link (as XML rather than HTML).context- for the conversion.- Returns:
- the MacroDefinition.
- Throws:
XMLStreamException- if there was a problem reading the edit fragment.XhtmlException- if there was a problem creating the Link.
-
convertEditToEmbeddedImage
EmbeddedImage convertEditToEmbeddedImage(String editFragment, ConversionContext context) throws XMLStreamException, XhtmlException
Returns aEmbeddedImagefrom the suppliededitFragment.- Parameters:
editFragment- which should be the edit format definition of the embedded image (as XHTML rather than HTML).context- for the conversion.- Returns:
- the EmbeddedImage represented by the supplied editFragment.
- Throws:
XMLStreamException- if there was a problem reading the edit fragment.XhtmlException- if there was a problem creating the EmbeddedImage.
-
-