Plugin opens Libreoffice after user’s click. To say simply user opens the Libreoffice.
We have java-application (Spring framework). We try to realise the next functionality:
User clicks on link (…/webdav/id/document_name.odt) and as the result system opens the document in Libreoffice.
User can edit the document and save it in database (PostgreSQL).
Opening document functionality works correctly:
We have written a simple servlet (Configure Tomcat WebDAV Access In 3 Easy Steps | MuleSoft step-1).
The servlet handles the request from Libreoffice (PROPFIND,OPTIONS,GET)
When our application gets the PROPFIND-request from Libreoffice our server writes the next responce:
<?xml version="1.0" encoding="utf-8" ?>
http://localhost:8080/julia/webdav/id/document_name.odt
application/vnd.oasis.opendocument.text
HTTP/1.1 200 OK
HTTP/1.1 404 Not Found
When our application gets GET-request our server writes file data (byte[]) from database as the responce
When our application gets OPTIONS-request our server writes the next headers in the responce:
“DAV”, “1, 2, ordered-collections”
“Allow”, “OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, ORDERPATCH”
“MS-Author-Via”, “DAV”
After all Libreoffice opens our document and user can edit it.
If user edits the document and tries to save, server will not get request with changes. So our application can’t save the modified document in database. (PUT or POST). Server gets only PROPFIND-request, OPTIONS-request and HEAD-request.
Example: Screenshot by Lightshot