Integrations in snap/flatpak

Can somebody explain the process used to integrate with libreoffice? I’m working to enable the integrations in the snap/flatpak packages, so far the ones that are called as a binary (i.e. texshow, texmaker) work by escaping the confinement in the flatpak.

A temporary list of the working connections is:
Flatpak

  • [X] Texworks
  • [X] Texmaker
  • [X] Lyx

Hi,

LO needs to be started with a writer document first
JabRef;
1.Search for: soffice(.exe) binary and additionally,
for the jars to be present: “unoil.jar”, “jurt.jar”, “juh.jar”, “ridl.jar”
2. Create a UrlClassLoader for the jars (The classLoader is needed so that the LO Boostrap method finds the executable soffice)

3. soffice(.exe) is called via command line arguments (similar as here) to create a socket https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/Getting_a_Service_Manager
4. A connection to the local socket is established

Originally, LO used pipes in the Bootstrap, but the only way I got it working was to use the sockets and pass that UrlClassLoader down.
I think the original problem is that the LO class is searched for in the wrong location: https://github.com/LibreOffice/core/blob/86707f3595c282f80b5e09558a23b539446daca2/ridljar/com/sun/star/comp/helper/Bootstrap.java#L335-L347
If I remember correctly, the problem was that this default LO implementation never searches the LO program directory.

[ ] VIm - Does not find the server
[ ] Emacs - Does not find the server

Vim might be missing the server part in the ubuntu repos…

In the flatpak I can give access to the libreoffice folder, and in the tree I have the jar files.
Unfortunately it still complains about the files being missing…

The folder has to be treated differently, but it is essentially mounted inside the flatpak, so in theory it should work…

I can try to prepare a more debug version with some extra logging so we can see where exactly it fails

By texworks I obviously meant texstudio…