• Arnaud Fontaine's avatar
    Backport fb9a0d60: Introduce HTML to PDF Transform through Conversion Server... · 0d516372
    Arnaud Fontaine authored
    Backport fb9a0d60: Introduce HTML to PDF Transform through Conversion Server (currently using wkhtmltopdf) (MR !955).
    
    Conversion Server code is no longer bound to OOo, as emphasized by:
      * Renaming of Preference Properties ooodoc_server* to document_conversion_server*.
      * Conversion Server exceptions are already defined in Document.py.
      * Conversion Server also handles video/audio/... conversions.
    
    Thus, refactor the code to connect to Conversion Server by moving it from
    Products.ERP5OOo.Document to Products.ERP5.Document.Document (while keeping
    backward compatibility):
      * Renamed:
        + OOoServerProxy => DocumentConversionServerProxy
        + OOO_SERVER_PROXY_TIMEOUT => DOCUMENT_CONVERSION_SERVER_PROXY_TIMEOUT
        + OOO_SERVER_RETRY => DOCUMENT_CONVERSION_SERVER_RETRY
      * Moved:
        + enc
        + dec
        + global_server_proxy_uri_failure_time
    
    Also, Introduced erp5.module.TransformLib (in erp5_core as currently all Transforms
    are there even though it should probably not be so) to define DocumentConversionServerTransform
    and which will hold libtransforms content when this will be moved to ZODB Components.
    
    Note: Ideally, OOOdCommandTransform should inherit from DocumentConversionServerTransform
    but wkhtmltopdf Handler on Cloudooo side is a hack only implemented in Manager.convertFile()
    whereas OOOdCommandTransform still uses legacy Manager.run_generate(), so leave it as it is
    to avoid breaking things (this will be addressed in a separate MR).
    
    /reviewed-on nexedi/erp5!955
    0d516372
OOoDocument.py 18 KB