Package org.ametys.cms.transformation
Class AbstractRichTextTransformer
java.lang.Object
org.ametys.cms.transformation.AbstractRichTextTransformer
- All Implemented Interfaces:
RichTextTransformer,Serviceable
- Direct Known Subclasses:
DocbookTransformer,HTMLTransformer
public abstract class AbstractRichTextTransformer
extends Object
implements RichTextTransformer, Serviceable
Abstract class for
RichTextTransformers relying on Cocoon pipelines to actually transform HTML to RichText back and forth.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringReturns the internalSourceURI used to process the HTML editor content.protected abstract StringReturns the internalSourceURI used to process the RichText's InputStream.voidservice(ServiceManager manager) voidvoidtransformForEditing(RichText source, DataContext dataContext, StringBuilder dest) Transform aRichTextinto aStringBuilder.voidtransformForRendering(RichText source, ContentHandler handler) SAXes aRichTextinto aContentHandlerfor rendering purposes.
-
Constructor Details
-
AbstractRichTextTransformer
public AbstractRichTextTransformer()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
transform
Description copied from interface:RichTextTransformer- Specified by:
transformin interfaceRichTextTransformer- Parameters:
source- the source.dest- theRichTextto populate.- Throws:
AmetysRepositoryException- if an error occurs.IOException- if an error occurs.
-
_getSourceUriForHTML2RichText
Returns the internalSourceURI used to process the HTML editor content.- Returns:
- the internal
SourceURI used to process the HTML editor content.
-
transformForEditing
public void transformForEditing(RichText source, DataContext dataContext, StringBuilder dest) throws AmetysRepositoryException, IOException Description copied from interface:RichTextTransformerTransform aRichTextinto aStringBuilder.- Specified by:
transformForEditingin interfaceRichTextTransformer- Parameters:
source- the source.dataContext- the context of the rich textdest- theStringBuilderto populate.- Throws:
AmetysRepositoryException- if an error occurs.IOException- if an error occurs.
-
_getSourceUriForRichText2HTML
Returns the internalSourceURI used to process the RichText's InputStream.- Returns:
- the internal
SourceURI used to process the RichText's InputStream.
-
transformForRendering
public void transformForRendering(RichText source, ContentHandler handler) throws AmetysRepositoryException, SAXException, IOException Description copied from interface:RichTextTransformerSAXes aRichTextinto aContentHandlerfor rendering purposes.- Specified by:
transformForRenderingin interfaceRichTextTransformer- Parameters:
source- the source.handler- theStringBuilderto populate.- Throws:
AmetysRepositoryException- if an error occurs.SAXException- if an error occurs.IOException- if an error occurs.
-