From 4cf51e4516d0aabf04b53dbac22eb9343ba1d210 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Mon, 20 Apr 2020 08:28:43 +0200 Subject: [PATCH 1/6] Create activity.rst --- developer_manual/client_apis/activity.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 developer_manual/client_apis/activity.rst diff --git a/developer_manual/client_apis/activity.rst b/developer_manual/client_apis/activity.rst new file mode 100644 index 000000000..7f769a2df --- /dev/null +++ b/developer_manual/client_apis/activity.rst @@ -0,0 +1 @@ +Find the documentation in the Activities repo here: `https://github.com/nextcloud/activity/blob/master/docs/endpoint-v2.md` From 8295c97134c38bb05c6da1c614c6004ca408d41b Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Mon, 20 Apr 2020 08:30:13 +0200 Subject: [PATCH 2/6] Rename activity.rst to activity-api.rst --- developer_manual/client_apis/{activity.rst => activity-api.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename developer_manual/client_apis/{activity.rst => activity-api.rst} (100%) diff --git a/developer_manual/client_apis/activity.rst b/developer_manual/client_apis/activity-api.rst similarity index 100% rename from developer_manual/client_apis/activity.rst rename to developer_manual/client_apis/activity-api.rst From c854a7a7852e345d933e4fa19c4c21b5eac630b3 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Mon, 20 Apr 2020 08:29:48 +0200 Subject: [PATCH 3/6] Update index.rst --- developer_manual/client_apis/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/developer_manual/client_apis/index.rst b/developer_manual/client_apis/index.rst index 199702897..edc80bd6e 100644 --- a/developer_manual/client_apis/index.rst +++ b/developer_manual/client_apis/index.rst @@ -13,4 +13,5 @@ Client APIs RemoteWipe/index ocs-share-api ocs-sharee-api + activity From e857ef7d5bbe334fc11bc21401152b11bdb2b37e Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Mon, 20 Apr 2020 08:30:23 +0200 Subject: [PATCH 4/6] Update index.rst --- developer_manual/client_apis/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_manual/client_apis/index.rst b/developer_manual/client_apis/index.rst index edc80bd6e..f87f3fdb0 100644 --- a/developer_manual/client_apis/index.rst +++ b/developer_manual/client_apis/index.rst @@ -13,5 +13,5 @@ Client APIs RemoteWipe/index ocs-share-api ocs-sharee-api - activity + activity-api From 9b0f9f335dc384f6b35a405b4f4248539e6f25f0 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Mon, 20 Apr 2020 08:38:56 +0200 Subject: [PATCH 5/6] Create comments.rst --- .../client_apis/WebDAV/comments.rst | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 developer_manual/client_apis/WebDAV/comments.rst diff --git a/developer_manual/client_apis/WebDAV/comments.rst b/developer_manual/client_apis/WebDAV/comments.rst new file mode 100644 index 000000000..76bae303d --- /dev/null +++ b/developer_manual/client_apis/WebDAV/comments.rst @@ -0,0 +1,95 @@ +## Comments + +Comments have a PHP API within OCP and also via WebDAV. Basic documentation below. + + +### Endpoint + +The Comments resource has an endpoint: + +``` +remote.php/comments/$OBJECTTYPE/$OBJECTID [/$COMMENTID] +``` + +The `ObjectID` endpoint accepts: +* `POST` for creating a comment +* `PROPFIND` to list comments, and also the read mark. You need to specify +attributes in the request. +* `PROPPATCH` to update the read mark, property name: +{http://owncloud.org/ns}readMarker +* `REPORT` to search comments + +The `CommentID` endpoint accepts: +* `PROPPATCH` to update the comment +* `DELETE` to delete it +* `PROPFIND` to list all properties + +For a list of properties, see: +`https://github.com/nextcloud/server/blob/master/apps/dav/lib/Comments/CommentNode.php#L108` + +### Examples of usage + +REPORT request: + +``` +curl -u user:pwd -i --data-binary "@report.xml" -X REPORT -H "Content-Type: text/xml" http://test.nextcloud.bla/master/remote.php/dav/comments/files/2156 +``` + +report.xml your receive: + +``` + + + 5 + 0 + 2016-01-18 22:10:30 + +``` + +Example Output (without headers): + +``` + + + + + 3 + 0 + 0 + 0 + first + comment + users + master + files + 2156 + 2016-01-18 22:01:16 + 2016-01-20 14:01:24 + + + + + 2 + 0 + 0 + 0 + first + comment + users + master + files + 2156 + 2016-01-18 22:01:12 + 2016-01-20 14:01:24 + + + +``` + +If you want a real life example of use, the announcement center has comments implemented. +See the comments related files in `https://github.com/nextcloud/announcementcenter/tree/master/js` +for frontend matters. Backendwise `OCP\Comments\ICommentsManager` is mostly close for housekeeping. +It was introduced in https://github.com/nextcloud/announcementcenter/pull/12, but +there are also some follow up PRs. + + From 408cb70b9a6051e7f4b4303cb6f2b176d4724712 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Mon, 20 Apr 2020 08:39:09 +0200 Subject: [PATCH 6/6] Update index.rst --- developer_manual/client_apis/WebDAV/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/developer_manual/client_apis/WebDAV/index.rst b/developer_manual/client_apis/WebDAV/index.rst index 873e46dcc..522b7b6d4 100644 --- a/developer_manual/client_apis/WebDAV/index.rst +++ b/developer_manual/client_apis/WebDAV/index.rst @@ -11,3 +11,4 @@ Webdav trashbin versions chunking + comments