The current share api is pretty much limited to only allow file sharing but there are apps like polls, deck and others that want to share other content. It would be pretty awesome in case of privacy settings and databse design and DRY to have one central share / comments api under the OCP namespace. Also UI / UX changes and things like the circles api need to be adopted in a lot of different apps instead of one central place. Took me some time to go threw all the sharing frontend / backend stuff to get the parts i needed to implement it in my app. Especially with features like activity entries and share notifications it becomes a bunch of code to maintain and update.
Comments have a PHP API within OCP and also via WebDAV. Later is not documented, unfortunately, yet.
If it helps a brief intro:
The Comments resource has an endpoint:
remote.php/comments/$OBJECTTYPE/$OBJECTID [/$COMMENTID]
The ObjectID endpoint accepts:
The CommentID endpoint accepts:
For a list of properties, see:
https://github.com/nextcloud/server/blob/master/apps/dav/lib/Comments/CommentNode.php#L108
Examples of usage can be found in this PR (check the comments):
https://github.com/owncloud/core/pull/21664/
And if you want a usage example of it, 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 also some follow up PRs.
What might help in Sharing is that for 13 we introduced OCP\Collaboration\Collaborators\ISearch which on PHP level enables you to look for people , groups, etc. you can share to. Initially this was the driver behind file_sharing's sharee endpoint, which for instance is used by Deck. It was taken out of the Controller and refactored into this public API.
Then we also introduced an AutoCompletion Controller endpoint for frontend matters. It is used by Comments autocomplete, but can be reused for anything related to collaboration, like finding users, groups etc to share with. It makes use of the previously mentioned ISearch thing. See https://github.com/nextcloud/server/blob/master/core/Controller/AutoCompleteController.php#L67, endpoint path is /autocomplete/get.
P.S.: to comments: files also have comment related attributes (鈫抴ebdav), comments-href, comments-count and comments-unread. First points to the related comments resource, the others just say how many comments were left and how many are unread.
Thanks for the detailed response :) i will have a look at the mentioned apis.
Should be all good, closing
@tobiasKaminsky as discussed
Most helpful comment
Comments
Comments have a PHP API within OCP and also via WebDAV. Later is not documented, unfortunately, yet.
If it helps a brief intro:
The Comments resource has an endpoint:
remote.php/comments/$OBJECTTYPE/$OBJECTID [/$COMMENTID]
The ObjectID endpoint accepts:
attributes in the request.
{http://owncloud.org/ns}readMarker
The CommentID endpoint accepts:
For a list of properties, see:
https://github.com/nextcloud/server/blob/master/apps/dav/lib/Comments/CommentNode.php#L108
Examples of usage can be found in this PR (check the comments):
https://github.com/owncloud/core/pull/21664/
And if you want a usage example of it, 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\ICommentsManageris mostly close for housekeeping. It was introduced in https://github.com/nextcloud/announcementcenter/pull/12, but there also some follow up PRs.Sharing
What might help in Sharing is that for 13 we introduced
OCP\Collaboration\Collaborators\ISearchwhich on PHP level enables you to look for people , groups, etc. you can share to. Initially this was the driver behind file_sharing's sharee endpoint, which for instance is used by Deck. It was taken out of the Controller and refactored into this public API.Then we also introduced an AutoCompletion Controller endpoint for frontend matters. It is used by Comments autocomplete, but can be reused for anything related to collaboration, like finding users, groups etc to share with. It makes use of the previously mentioned
ISearchthing. See https://github.com/nextcloud/server/blob/master/core/Controller/AutoCompleteController.php#L67, endpoint path is/autocomplete/get.