Have you done the following step, as written in the docs?
Additional security is provided by not enabling the Python script provider by default. You need to explicitly install the collaboraofficebasis6.x-python-script-provider and collaboraofficebasis6.x-pyuno packages (replace x with the respective version number) to enable Python scripts.
For your reference, all the necessary instructions for installation using Kubernetes are detailed in the SDK documentation here: Kubernetes Installation Guide.
Additionally, there is a section dedicated to installation using Docker, which you may find helpful: Docker Installation Guide.
Hi @darshan
Thank you for your quick reply. But what I am seeing is the docker image does not provide the collaborabasic provider and pyuno installation after looking into the scripts folder. How do I go about and is there any instructions?
I’m not entirely clear on your use case. Could you provide more details?
Specifically, how are you trying to configure the Docker image in Kubernetes? Some additional context would be very helpful to better understand and assist you.
we are using collabora online for document viewing in our webapp and have implemented the CheckFileInfo, GET and POST
We have created a button that would like to send some selected text from the document and send it to our webapp, but since the postMessage API on the browser does not allow to collect the selected text from the iframe, we were looking into using PythonScripts on the collabora online self hosted server in k8s.
The docker image has /opt/collaboraoffice/share/Scripts/python folder, but after putting a small python script (just a hello world to test) and using a postMessage with CallPythonScript is not actually triggering any output. I noticed that the full libreoffice or the pyuno library is not installed
How do I go about installing pyuno in the docker image and the collaborabasic* packages?
I don’t see the examples that you pointed does any of doing the postMessage of CallPythonScript. I looked at the collaboraoffice online framed.html and framed.doc.html and I see some basic examples like Capitalize(), InsertText(), but I see the error when running it in my linux machine:
Dec 14 18:41:16 collabora-server coolwsd[35831]: kit-35831-35831 2024-12-14 18:41:16.398365 +0000 [ kitbroker_002 ] TRC drainQueue with 1 items: processing| kit/Kit.cpp:2393
Dec 14 18:41:16 collabora-server coolwsd[35831]: kit-35831-35831 2024-12-14 18:41:16.398376 +0000 [ kitbroker_002 ] TRC KitQueue(1) - pop child-00a uno vnd.sun.star.script:Capitalise.py$capitalisePython?language=Python&location=share| kit/KitQueue.cpp:421
Dec 14 18:41:16 collabora-server coolwsd[35831]: kit-35831-35831 2024-12-14 18:41:16.398382 +0000 [ kitbroker_002 ] TRC Kit handling queue message: child-00a uno vnd.sun.star.script:Capitalise.py$capitalisePython?language=Python&location=share| kit/Kit.cpp:2409
Dec 14 18:41:16 collabora-server coolwsd[35831]: kit-35831-35831 2024-12-14 18:41:16.398395 +0000 [ kitbroker_002 ] TRC ToMaster-00a: handling [uno vnd.sun.star.script:Capitalise.py$capitalisePython?language=Python&location=share]| kit/ChildSession.cpp:198
Dec 14 18:41:16 collabora-server coolwsd[35831]: kit-35831-35831 2024-12-14 18:41:16.398418 +0000 [ kitbroker_002 ] TRC ToMaster-00a: uno command vnd.sun.star.script:Capitalise.py$capitalisePython?language=Python&location=share notify: true| kit/ChildSession.cpp:2223
Dec 14 18:41:16 collabora-server coolwsd[35831]: kit-35831-35831 2024-12-14 18:41:16.400675 +0000 [ kitbroker_002 ] TRC Document::ViewCallback [4] [LOK_CALLBACK_UNO_COMMAND_RESULT] [{ “commandName”: “vnd.sun.star.script:Capitalise.py$capitalisePython?language=Python&location=share”, “success”: false, “result”: { “type”: “string”, “value”: “ScriptProtocolHandler::dispatch: caught com.sun.star.script.provider.ScriptFrameworkErrorException: invalid attempt to assign an empty interface of type com.sun.star.script.provider.XScriptProvider! at /opt/collaboraoffice/debugsource/include/com/sun/star/uno/Reference.hxx:105 at /opt/collaboraoffice/debugsource/scripting/source/provider/MasterScriptProvider.cxx:315”}, “wasModified”: true, “startUnixTimeMics”: 84532662149, “saveDurationMics”: 379}].| kit/Kit.cpp:1152
Our use case is as follows:
We wanted to select the text in the document in iframe
send the selected text to an external webservice outside of collabora
receive the response from the external webservice and show the changes in collabora iframe
I see CallPythonScript looks like an external way to call, but since the collaboraoffice is actually trying to call CallPythonScript, it is failing since the collabora is installed in /opt/collaboraoffice where as the libreoffice is in /usr/lib/libreoffice/ and the scripts are within libreoffice