Apache FOP's ODT render

Integration with FOP

ODT render is integrated with FOP as ODTFOEventHandlerMaker, implementation of FOEventHandler, similar to RTFFOEventHandlerMaker. However, ODT Converter is using only the endPageSequence event to go through the tree separately. Integration can be seen as point for review.

Dependencies

Design

FopOdtConverter is a real entry point for the render. Initialization creates a new ODT document. At the end of generation we should use method writeToOutputStream. In the meantime, just once we should put the highest FONode of the FOP tree.

The method is recursively asking the TagFactory for an appropriate Tag (converter of one type of xslfo element to odt element) to encountered FONode. During the initialization each Tag get to know its "parent" Tag in any purpose. Special execution depending on the parent Tag is implemented thanks to Visitor design pattern (TagExecutable and TagExecutor).

Each Tag has its Style element that collects all xslfo attributes (Property) preformatted to use directly in odt document. Each Style knows the Style of the parent Tag in case of inheritance of xslfo attributes.

Properties are implemented as a sort of Flyweight pattern to avoid, in our case, the initialization time of many classes. Properties are responsible for attributes conversion to odt attributes.

Implementation State

Although, the architecture of ODT render seems to be stable, it is still in initial state of development. Render requires the implementation of each attribute (more than 200) sometimes depending on the Tag they belongs to.