From fedc3db7f278b02ccbb56713cd1b770e4baea955 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 27 Sep 2018 15:19:31 +0200 Subject: [PATCH] Add basic docs for Trash and Versions webdav API Signed-off-by: Roeland Jago Douma --- .../client_apis/WebDAV/trashbin.rst | 44 +++++++++++++++++++ .../client_apis/WebDAV/versions.rst | 24 ++++++++++ developer_manual/client_apis/index.rst | 4 ++ 3 files changed, 72 insertions(+) create mode 100644 developer_manual/client_apis/WebDAV/trashbin.rst create mode 100644 developer_manual/client_apis/WebDAV/versions.rst diff --git a/developer_manual/client_apis/WebDAV/trashbin.rst b/developer_manual/client_apis/WebDAV/trashbin.rst new file mode 100644 index 000000000..9b787174f --- /dev/null +++ b/developer_manual/client_apis/WebDAV/trashbin.rst @@ -0,0 +1,44 @@ +.. _webdavtrashbin: + +================== +WebDAV Trashbin +================== + +Nextcloud makes the trashbin of a user available via the webdav endpoint. + +Listing the trashbin content +---------------------------- + +To obtain all the files in the trashbin a normal :code:`PROPFIND` has to be send to +:code:`https://cloud.example.com/remote.php/dav/trashbin/USER/trash`. This will +list the content of the trashbin. + +The endpoint provides three extra properties: + +* :code:`{http://nextcloud.org/ns}trashbin-filename` +* :code:`{http://nextcloud.org/ns}trashbin-original-location` +* :code:`{http://nextcloud.org/ns}trashbin-deletion-time` + +The result is a normal response to a :code:`PROPFIND` and can be listed as such. + + +Restoring from the trashbin +--------------------------- + +To restore from the trashbin all that needs to be done is to move the item to +the special restore folder at :code:`https://cloud.example.com/remote.php/dav/trashbin/USER/restore` + +This will automatically restore the item to its original location. + + +Deleting from the trashbin +-------------------------- + +To delete from the trashbin just perform a delete on the item. + + +Emptying the trashbin +--------------------- + +Perform a delete on `https://cloud.example.com/remote.php/dav/trashbin/USER/trash` + diff --git a/developer_manual/client_apis/WebDAV/versions.rst b/developer_manual/client_apis/WebDAV/versions.rst new file mode 100644 index 000000000..91cfa9e23 --- /dev/null +++ b/developer_manual/client_apis/WebDAV/versions.rst @@ -0,0 +1,24 @@ +.. _webdavversions: + +================== +WebDAV Versions +================== + +Nextcloud makes the versions of files available via the webdav endpoint. + +Listing the versions of a file +------------------------------ + +To obtain all the version of a file a normal :code:`PROPFIND` has to be send to +:code:`https://cloud.example.com/remote.php/dav/versions/USER/versions/FILEID`. This will +list the versions for this file. + +The name is the timestamp of the version. + + +Restoring a version +--------------------------- + +To restore a version all that needs to be done is to move a version +the special restore folder at :code:`https://cloud.example.com/remote.php/dav/versions/USER/restore` + diff --git a/developer_manual/client_apis/index.rst b/developer_manual/client_apis/index.rst index 7ff993d08..8ffe3b39f 100644 --- a/developer_manual/client_apis/index.rst +++ b/developer_manual/client_apis/index.rst @@ -13,6 +13,8 @@ WebDAV is the main api for file related operations, it supports listing director An overview of how to use the various WebDAV api's can be found at :doc:`WebDAV/index`, additionally Nextcloud implements rfc5323_ to allow searching the filesystem more information about how to use WebDAV search can be found at :doc:`WebDAV/search`. +Clients can also access :doc:`WebDAV/versions` and :dock:`WebDAV/trashbin` via webdav to integrate with this. + OCS --- @@ -38,6 +40,8 @@ Clients can obtain an apptoken via the login flow. See :doc:`LoginFlow/index` WebDAV/index WebDAV/search + WebDAV/trashbin + WebDAV/versions OCS/index LoginFlow/index