Add new uno command and change the output HTML file

Hi folks,

Hope you are doing well.

I want to add a new feature to the CollaboraOffice, in which a button is shown on the client side and when the user clicks on it, a popup shows up. In the popup, we ask for an email and after that, I want to send an uno command to the server to say that the selected text is for the given email. After that, when the user wants to save the doc as HTML, the following output should be generated:

<!DOCTYPE html>
<html lang="en">
<body>
  <div><span>conte</span><span style="font-weight: bold;">nt</span><span data-share-with="['example@gmail.com']"> secret</span></div>
</body>
</html>

We have assumed that the user selected the " secret" part of the content and selected the customized button on the client side and then the popup is shown and the user filled in the input with the “example@gmail.com” email. And after that, the user has saved the document, so the above output is generated.

I have read the code and I have seen that CollaboraOffice is using LOKit under the scene, and every style is transmitted to the LOKit to take effect. In the end, CollaboraOffice has called LOKit to generate the output. So I assume that this logic should not be implemented inside not only the CollaboraOffice server but also the LOKit itself. Is that correct?

Any suggestions?