Class CDMRichTextTransformer
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.xml.AbstractXMLPipe
-
- org.apache.cocoon.transformation.AbstractTransformer
-
- org.ametys.plugins.odfsync.cdmfr.transformers.CDMRichTextTransformer
-
- All Implemented Interfaces:
Poolable
,Recyclable
,Component
,LogEnabled
,SitemapModelComponent
,Transformer
,XMLConsumer
,XMLPipe
,XMLProducer
,XMLConsumer
,ContentHandler
,LexicalHandler
public class CDMRichTextTransformer extends AbstractTransformer
This transformer provides a valid docbook output for rich-text issued from CDM-fr:- - no character (break line, bold, text, ...) outside a
para
element - - no
title
outside asection
element
-
-
Field Summary
Fields Modifier and Type Field Description private static String[]
__BLOC_TYPES
private static String[]
__CHARACTER_TYPES
private static String
__TAG_ARTICLE
private static String
__TAG_SECTION
private static String
__TAG_TITLE
(package private) boolean
_inBlock
(package private) boolean
_inDocbook
(package private) boolean
_inSection
(package private) boolean
_inTitle
(package private) int
_sectionCount
(package private) boolean
_startPara
(package private) int
_titleCount
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
-
-
Constructor Summary
Constructors Constructor Description CDMRichTextTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_endParaElement()
private void
_init()
private void
_startParaElement()
void
characters(char[] c, int start, int len)
void
endElement(String uri, String localName, String raw)
void
setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
void
startElement(String uri, String localName, String raw, Attributes attrs)
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
recycle, setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
-
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
__TAG_ARTICLE
private static final String __TAG_ARTICLE
- See Also:
- Constant Field Values
-
__TAG_SECTION
private static final String __TAG_SECTION
- See Also:
- Constant Field Values
-
__TAG_TITLE
private static final String __TAG_TITLE
- See Also:
- Constant Field Values
-
__CHARACTER_TYPES
private static final String[] __CHARACTER_TYPES
-
__BLOC_TYPES
private static final String[] __BLOC_TYPES
-
_sectionCount
int _sectionCount
-
_titleCount
int _titleCount
-
_inDocbook
boolean _inDocbook
-
_inBlock
boolean _inBlock
-
_inSection
boolean _inSection
-
_inTitle
boolean _inTitle
-
_startPara
boolean _startPara
-
-
Constructor Detail
-
CDMRichTextTransformer
public CDMRichTextTransformer()
-
-
Method Detail
-
_init
private void _init()
-
startElement
public void startElement(String uri, String localName, String raw, Attributes attrs) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classAbstractXMLPipe
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String raw) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classAbstractXMLPipe
- Throws:
SAXException
-
characters
public void characters(char[] c, int start, int len) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classAbstractXMLPipe
- Throws:
SAXException
-
_startParaElement
private void _startParaElement() throws SAXException
- Throws:
SAXException
-
_endParaElement
private void _endParaElement() throws SAXException
- Throws:
SAXException
-
setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
-
-