Hi devs,
While working with @trrenty to improve the OnlyOffice Connector with optional LibreOffice conversion (when OnlyOffice doesn’t support the input or the automatic conversion done by OnlyOffice is not good enough) we were surprised to discover that our office conversion API doesn’t support ODT to DOCX conversion, even though LibreOffice itself supports it. The reason is because the file that configures the office conversion, document-formats.js
, is not up to date. How we got here:
- initially we were using mirkonasato/jodconverter whose JAR included a
document-formats.js
file; we didn’t provide a custom version but the users could overwrite the config by placing a modified version of this file inWEB-INF/classes
- the original repository of
jodconverter
stopped being maintained so we forked it and made some changes; thedocument-formats.js
file supported only 1 change XJODC-2: Force a specific Publish Mode for the impress_html_Export fi… · xwiki-attic/jodconverter@927f059 · GitHub - another fork, sbraconnier/jodconverter, started being maintained and used so we switched to it in XWiki 11.0 and 10.11.9 (see XWIKI-15031); as part of the switch @surli moved the “custom”
document-formats.js
(from our fork) intoxwiki-platform
- sbraconnier/jodconverter renamed
document-formats.js
intodocument-formats.json
and modified it to support new conversions - @surli updated the syntax used in our
document-formats.js
to match what is expected by sbraconnier/jodconverter 4.4.0 in XWIKI-18241 but the actual configuration remained the same - @surli modified the ODT filter in XWIKI-19818
This means that ATM we use an old configuration (document-formats.js
) with two customizations (XJODC-2: Force a specific Publish Mode for the impress_html_Export fi… · xwiki-attic/jodconverter@927f059 · GitHub and XWIKI-19818: ODT export doesn't produce 'real' odt documents but 'off… · xwiki/xwiki-platform@c6d7578 · GitHub) that overwrites the default config from sbraconnier/jodconverter which is quite different (it supports additional conversions, among other things).
How do we deal with this? Short term we should probably take the latest document-formats.json
, apply our 2 customizations and modify our code to look for .json
also besides .js
(for backwards compatibility). But on the long run, does it make sense to provide our own version of document-formats.json
?
- if not, then we should try to push our changes to sbraconnier/jodconverter (assuming that others may benefit from them) and remove our own version
- if yes, then at least add a comment in the POM where the
jodconverter
version is specified to not forget to merge thedocument-formats.json
changes when upgradingjodconverter
.
WDYT?
Thanks,
Marius