Class WopiDocumentConverterAdapter
- All Implemented Interfaces:
org.imixs.workflow.Adapter,org.imixs.workflow.SignalAdapter
There is no need to implement the libraries in case a Collabora instance is up and running. In this case the rest API endpoint 'lool/convert-to/' provides a convenience function. See details here: https://www.collaboraoffice.com/de/document-conversion/
Documents can be converted into different formats by calling the corresponding endpoint.
- https://localhost:9980/lool/convert-to/pdf for pdf
- https://localhost:9980/lool/convert-to/png for png
The rest service automatically detects the input document format.
The adapter simply posts a given document to the service endpoint. The adapter can be configured by the event workflow result:
<wopi-converter name=
"api-endpoint">https://localhost:9980/lool/convert-to/</wopi-converter>
<wopi-converter name="filename">......</wopi-converter>
<wopi-converter name="convert-to">pdf</wopi-converter>
The Collabora API endpoint must point to a collabora instance. The 'filename' is the file attached to the current workitem. This can also be a regular expression. The option 'convert-to' is optional and default value is 'pdf'
- Author:
- rsoika
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.imixs.workflow.ItemCollectionexecute(org.imixs.workflow.ItemCollection document, org.imixs.workflow.ItemCollection event) The execute method expects a 'wop-converter' configuraiton and a corresponding attachement.
-
Field Details
-
DOCUMENT_ERROR
- See Also:
-
CONFIG_ERROR
- See Also:
-
-
Constructor Details
-
WopiDocumentConverterAdapter
public WopiDocumentConverterAdapter()
-
-
Method Details
-
execute
public org.imixs.workflow.ItemCollection execute(org.imixs.workflow.ItemCollection document, org.imixs.workflow.ItemCollection event) throws org.imixs.workflow.exceptions.AdapterException, org.imixs.workflow.exceptions.PluginException The execute method expects a 'wop-converter' configuraiton and a corresponding attachement. The method calls the Collabora Rest API to convert the file into PDF and attaches the new file.- Specified by:
executein interfaceorg.imixs.workflow.Adapter- Throws:
org.imixs.workflow.exceptions.AdapterExceptionorg.imixs.workflow.exceptions.PluginException
-