public abstract class AbstractRichTextTransformer extends Object implements RichTextTransformer, Serviceable
RichTextTransformer
s relying on Cocoon pipelines to actually transform HTML to RichText back and forth.Modifier and Type | Field and Description |
---|---|
private ServiceManager |
_manager |
private SourceResolver |
_sourceResolver |
Constructor and Description |
---|
AbstractRichTextTransformer() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
_getSourceUriForHTML2RichText()
Returns the internal
Source URI used to process the HTML editor content. |
protected abstract String |
_getSourceUriForRichText2HTML()
Returns the internal
Source URI used to process the RichText's InputStream. |
void |
service(ServiceManager manager) |
void |
transform(String source,
ModifiableRichText dest)
|
void |
transformForEditing(ModifiableRichText source,
StringBuilder dest)
Transform a
RichText into a StringBuilder . |
void |
transformForRendering(RichText source,
ContentHandler handler)
SAXes a
RichText into a ContentHandler for rendering purposes. |
private SourceResolver _sourceResolver
private ServiceManager _manager
public AbstractRichTextTransformer()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void transform(String source, ModifiableRichText dest) throws AmetysRepositoryException, IOException
RichTextTransformer
transform
in interface RichTextTransformer
source
- the source.dest
- the rich text to populate.AmetysRepositoryException
- if an error occurs.IOException
- if an error occurs.protected abstract String _getSourceUriForHTML2RichText()
Source
URI used to process the HTML editor content.Source
URI used to process the HTML editor content.public void transformForEditing(ModifiableRichText source, StringBuilder dest) throws AmetysRepositoryException, IOException
RichTextTransformer
RichText
into a StringBuilder
.transformForEditing
in interface RichTextTransformer
source
- the source.dest
- the StringBuilder
to populate.AmetysRepositoryException
- if an error occurs.IOException
- if an error occurs.protected abstract String _getSourceUriForRichText2HTML()
Source
URI used to process the RichText's InputStream.Source
URI used to process the RichText's InputStream.public void transformForRendering(RichText source, ContentHandler handler) throws AmetysRepositoryException, SAXException, IOException
RichTextTransformer
RichText
into a ContentHandler
for rendering purposes.transformForRendering
in interface RichTextTransformer
source
- the source.handler
- the StringBuilder
to populate.AmetysRepositoryException
- if an error occurs.SAXException
- if an error occurs.IOException
- if an error occurs.