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
,HTMLTransformer
public abstract class AbstractRichTextTransformer extends Object implements RichTextTransformer, Serviceable
Abstract class forRichTextTransformer
s relying on Cocoon pipelines to actually transform HTML to RichText back and forth.
-
-
Constructor Summary
Constructors Constructor Description AbstractRichTextTransformer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract String
_getSourceUriForHTML2RichText()
Returns the internalSource
URI used to process the HTML editor content.protected abstract String
_getSourceUriForRichText2HTML()
Returns the internalSource
URI used to process the RichText's InputStream.void
service(ServiceManager manager)
void
transform(String source, RichText dest)
void
transform(String source, ModifiableRichText dest)
Deprecated.void
transformForEditing(RichText source, DataContext dataContext, StringBuilder dest)
Transform aRichText
into aStringBuilder
.void
transformForEditing(ModifiableRichText source, StringBuilder dest)
Deprecated.void
transformForRendering(RichText source, ContentHandler handler)
SAXes aRichText
into aContentHandler
for rendering purposes.void
transformForRendering(RichText source, ContentHandler handler)
Deprecated.
-
-
-
Constructor Detail
-
AbstractRichTextTransformer
public AbstractRichTextTransformer()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
transform
@Deprecated public void transform(String source, ModifiableRichText dest) throws AmetysRepositoryException, IOException
Deprecated.Description copied from interface:RichTextTransformer
Transform aString
into aModifiableRichText
.- Specified by:
transform
in interfaceRichTextTransformer
- Parameters:
source
- the source.dest
- theModifiableRichText
to populate.- Throws:
AmetysRepositoryException
- if an error occurs.IOException
- if an error occurs.
-
transform
public void transform(String source, RichText dest) throws AmetysRepositoryException, IOException
Description copied from interface:RichTextTransformer
- Specified by:
transform
in interfaceRichTextTransformer
- Parameters:
source
- the source.dest
- theRichText
to populate.- Throws:
AmetysRepositoryException
- if an error occurs.IOException
- if an error occurs.
-
_getSourceUriForHTML2RichText
protected abstract String _getSourceUriForHTML2RichText()
Returns the internalSource
URI used to process the HTML editor content.- Returns:
- the internal
Source
URI used to process the HTML editor content.
-
transformForEditing
@Deprecated public void transformForEditing(ModifiableRichText source, StringBuilder dest) throws AmetysRepositoryException, IOException
Deprecated.Description copied from interface:RichTextTransformer
Transform aModifiableRichText
into aStringBuilder
.- Specified by:
transformForEditing
in interfaceRichTextTransformer
- Parameters:
source
- the source.dest
- theStringBuilder
to populate.- Throws:
AmetysRepositoryException
- if an error occurs.IOException
- if an error occurs.
-
transformForEditing
public void transformForEditing(RichText source, DataContext dataContext, StringBuilder dest) throws AmetysRepositoryException, IOException
Description copied from interface:RichTextTransformer
Transform aRichText
into aStringBuilder
.- Specified by:
transformForEditing
in interfaceRichTextTransformer
- Parameters:
source
- the source.dataContext
- the context of the rich textdest
- theStringBuilder
to populate.- Throws:
AmetysRepositoryException
- if an error occurs.IOException
- if an error occurs.
-
_getSourceUriForRichText2HTML
protected abstract String _getSourceUriForRichText2HTML()
Returns the internalSource
URI used to process the RichText's InputStream.- Returns:
- the internal
Source
URI used to process the RichText's InputStream.
-
transformForRendering
@Deprecated public void transformForRendering(RichText source, ContentHandler handler) throws AmetysRepositoryException, SAXException, IOException
Deprecated.Description copied from interface:RichTextTransformer
SAXes aRichText
into aContentHandler
for rendering purposes.- Specified by:
transformForRendering
in interfaceRichTextTransformer
- Parameters:
source
- the source.handler
- theStringBuilder
to populate.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
transformForRendering
public void transformForRendering(RichText source, ContentHandler handler) throws AmetysRepositoryException, SAXException, IOException
Description copied from interface:RichTextTransformer
SAXes aRichText
into aContentHandler
for rendering purposes.- Specified by:
transformForRendering
in interfaceRichTextTransformer
- Parameters:
source
- the source.handler
- theStringBuilder
to populate.- Throws:
AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.
-
-