From b02a8d519969fb75b3090448d3f19d5a4b64ea82 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 6983c7b21437287246c50bb84f120c0255b6d45a 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 c4cf4c2a2e050c67ecc34c4f7d4db5aa85aee8b9 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 c0bb4593bce064bc4ef590906483b4cccd19f3ef 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 d2d253a97f524f3266c040a6fdcaecee02e091b6 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 dc029fe75bedafbac680b431525df28df42a804b 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