1 blob to many blobs conversion ?

I need to convert 1 file to many HTML pages (1 HTML page per 1 office document) I know how to do the conversion outside of Nuxeo (python script, that can be run in command line or via web service). The result HTML pages can be put in a zip file, for example. Then the HTML pages have to be attached to the original nuxeo document (file).

I don't know how to achieve this with Nuxeo. I saw we can use external command-line converters but how to return a list of blobs ? Then where to call this external conversion ? In an automation chain triggered by the “before document modification” event handler ? As an asynchronous task ? But what will the user see when creating/modifying a doc ?

Any ideas or examples with such topics would by very appreciated ! Thanks

0 votes

1 answers

1200 views

ANSWER

This is possible in an automation chain in Studio. You can use Conversion -> Blob.RunConverter, then Files -> Blob.CreateZip and save to the document. As for "before document modification" and synchronous/asynchronous tasks, it depends on your use cases. And what the user will see also depends on your use case. Should the zip be emailed to the user? Or should it download automatically once it is available? Or something else?
05/28/2019



The process don't actually use the zip file. I mentionned it in case it can simplify the integration in Nuxeo. These HTML files (and their associated PNG images) are produced to be sent to very poor devices with low bandwith. These devices can't use office or PDF files. When a document manager creates a new document in Nuxeo, the conversion must be run so the manager can see if the result is acceptable or not. If yes the document can be published. So new page providers have to use these HTML converted files so the document manager can browse them. Final users don't use Nuxeo to read the HTML production. An external process runs to parse publised docs for devices. What I'm looking for is example with such asynchronous 1 to n conversion. How can I send the results back to the automation scripting ? And how a page provider can present 1 of the attached files ? Thanks

0 votes