Add file open endpoint for Collabora Office
The idea is to have a button inside of Collabora Online / LibreOffice that allows the user to switch to editing online by clicking it.
Richdocuments would:
- [x] Provide an endpoint with a path parameter to open the file for the user
- It should be enough to get the file id and redirect to the files app with the openfile parameter
- [x] Expose the endpoint URL through capabilities, so that it can be picked up by the client
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.
- [ ] https://github.com/nextcloud/desktop/issues/4880
- [ ] Fetch the endpoint from the capabilities
- [ ] For each sync folder put a .ini file in the root, containing the format below
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