nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.9k stars 772 forks source link

Expose a ini file for edit online in Collabora Office / LibreOffice #4880

Open juliushaertl opened 1 year ago

juliushaertl commented 1 year ago

The idea is to have a button inside of Collabora Online / LibreOffice that allows the user to switch to editing online by clicking it.

Requirement is that richdocuments would implement https://github.com/nextcloud/richdocuments/issues/2418

The desktop client would expose a .editonline.ini (naming could change) file in the root sync folder which contains the edit url as well as the userid and relative path, which can then be read by Collabora Office.

Example 1

The Nextcloud root is synced to ~/Nextcloud, there would be a ~/Nextcloud/.editonline.ini:

[editserver]
    endpoint = https://nextcloud.example.com/index.php/apps/richdocuments/editfromlocal
    userid = admin
    relativepath = /

Considering a file Document.odt is opened, Collabora Office could then construct url to open in the browser: https://nextcloud.example.com/index.php/apps/richdocuments/editfromlocal?user=admin&path=/Document.odt

Example 2

The Nextcloud subdirectory /Engineering is synced to ~/Nextcloud, there would be a ~/Nextcloud/.editonline.ini:

[editserver]
    endpoint = https://nextcloud.example.com/index.php/apps/richdocuments/editfromlocal
    userid = admin
    relativepath = /Engineering

Considering a file Document.odt is opened, Collabora Office could then construct url to open in the browser: https://nextcloud.example.com/index.php/apps/richdocuments/editfromlocal?user=admin&path=/Engineering/Document.odt

juliushaertl commented 1 year ago

@allexzander @mmeeks @tml1024 please have a quick sanity check on the summary :)

juliushaertl commented 1 year ago

cc @tobiasKaminsky

mmeeks commented 1 year ago

Looks great to me - from a naming perspective I think .editonline could perhaps be more generalized - I expect there are other things that this could be used for if it is there =) but - up to you ! Thanks.

allexzander commented 1 year ago

Yes, looks great @juliushaertl . I assume the userid is the first part of e.g. admin@example.cloud.com? As we also have another type of id on the server that looks like a hash (Web Dav ID, or smth.).

@mmeeks As for the generic name, I propose to have it named .external_apps_metadata.ini or just .metadata.ini.

juliushaertl commented 1 year ago

Yes, the user id would be admin in your example.

juliushaertl commented 1 year ago

richdocuments implementation is there in https://github.com/nextcloud/richdocuments/pull/2419 just might need a bit more polishing, but general functionality works.

mmeeks commented 1 year ago

I'd go for .metadata.ini and expect that when it is there it will turn out to be useful for lots of other loosely coupled things =)