Collabora CODE - .uno:InsertDoc - how to supply file to WOPI client?

99 Views Asked by At

I am testing CODE 23.05.0.5.

I would like to insert a document into the active editor programatically using the .uno:InsertDoc command.

I have created the following function:

function sendInsertDoc(name) {
  post({'MessageId': 'Send_UNO_Command',
    'Values': {
      'Command': '.uno:InsertDoc',
      'Args': {
        Name: {
          type: 'string',
          value: `${name}.docx`
        },
        Filter: {
          type: 'string',
          value: ``
        },
      }
    }
  });
}

And when I call it, sendInsertDoc('123'), I see:

kit-03405-00023 2023-06-18 16:06:51.956260 +0000 [ kitbroker_12e ] DBG #17: child_ws: recv [child-617a uno .uno:InsertDoc {"Name":{"type":"string","value":"123.docx"},"Filter":{"type":"string","value":""}} | kit/Kit.cpp:2453

... in the docker-compose logs, from the WOPI / CODE client.

However there is no mention of an incoming request for the file to the WOPI host ... which I find puzzling.

How to I supply the file to the WOPI client? ... there are no error messages in the console, nothing at all other than the message from Kit.cpp.

The example sendInsertBookMarkUNOCommand() from here: https://github.com/CollaboraOnline/online/blob/master/browser/html/framed.doc.html#L39 works as expected.

Any ideas please?

0

There are 0 best solutions below