-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Comments DAV Resource #20264
Comments
Base url will be: remote.php/dav/comments/${enityType}/${entityId} In contrary to all other resources this one will not reflect the user in the url because there is no user specific information. |
the data model currently does not reflect this - and this would require a user specific dav resource |
We decided to not do that, but do the read tracking in the timeline feature? |
Yes – back then i misunderstood that we want to keep the possibility open – will adjust. |
but the information about what is read and what not has to be stored user specific - even if it is only timestamp |
Yes but it's part of #20259 |
ah - got it - missed that part |
I see this as my next step. I was having a look on how @PVince81 is dealing with #20786. These are my (live written) thoughts, input welcome. We said we like to have the base URL: Since we also got the "verb" field, I wonder whether we should append it there as well, being $verb. However, this would require to touch interfaces again, since this was not in mind when designing them. Since we only have the comments verb now anyway, it's not a problem. Granted that in a query the desired verb can be passed in a PROPFIND request, that's absolutely not a problem. I understand we need a CommentsCollection which holds some typed collections as reflected by ${entityType}, which so far only will be a Comments/FileCollection. Since we will not support MKCOL here (available collections are rather static and present codewise), in future we like to have this extensible. I don't see it in the scope for 9.0, however. On the other hand, our CommentsManager is made to support different types, which makes it unnecessary overhead. Having $(entityType) in the URL is a challenge, because they are essentially a string in the database – if present. They cannot be created using MKCOL because they are comment-specific, but we cannot leave them out either, since a single ID in the URL is not specific enough. If from a DAV persepective it is OK to enlist just the types that are already known (i.e. present in the database in our implementation) but create nodes on unknown types, we win. I confess, the thought alone is ugly. I wonder whether the thought to create Nodes in comments/ and have the final destination returned is any better? Anyway, both attempts can be misused to pollute the Comments table with wild types. The only way around is to have a way to register possible types. Any new app or extension would do this either on install (requires another table) or on runtime (requires an API method at the CommentsManager). Latter sounds to be the best approach for me. It's not much else than a protected property, prefilled with 'comments' and a registerType() method on the manger's side (and its interface). A comment is represented by a Node, thus CommentNode. It's generic, due to our data structure, and can be used for any entity type. As in @PVince81's system tags approach it will utilize the CommentsManager() to do whatever it is supposed to do: reading, modifying, deleting comments. I understand the Plugin is technically some kind of specific controller. That's my picture now how it is going to look like |
Yes. Let's hard-code the known types for now like I did for system tags. In the future we can provide a mechanism for apps to provide their own additional types. No need for MKCOL 😄 CommentNode might not be enough, you'll also need a CommentMappingNode to represent the mappings inside the relations endpoint. See how I did it for system tags. |
Regarding the verb, I think it could be an attribute "oc:verb" in the CommentMappingNode in the relations endpoint. |
Ok, when looking at your data structure it seems that the comment itself is always the relationship. So you'll only have a single endpoint Adding new comments has to be a POST on the collection |
Regarding replies I also wonder whether we want a tree structure |
Maybe let's make a checklist of all operations that the GUI will need to be able to manage tags, and then write down how the Webdav operation will look like, like I did in #20786 (comment) |
I don't really see what that Mapping is for, but I'll look again. |
Following this theory in a possible feature this would be an endless URL, as replies could have replies. In the current scenario it would work. Thinking as how a file structure would be, then you are right, and remote.php/dav/comments/${entityType}/${entityId}/${commentId}/${replyId}/${yetAnotherReplyId}/${YetOneMoreAnotherReplyId} would be totally valid. |
API specURL root is always remote.php/dav/comments/
|
I don't see a MKCOL showing up neither in the short nor long future :)
→ 'comment' will be hardcoded there of course and for now we can leave out the registerType() method, but it will be easy to add it. |
Regarding "list comments", will it then return a flat list ? And some comments will have a "oc:parentid" attribute to make it possible for the clients to attach them to the matching parent ? Or as said above we could use multi-level comments (sub-collections), but I'd limit it to one-level. Didn't we say we wanted to limit to one level anyway? |
Yes. For now, we decided to do flat-list only anyway (see #20267).
If we decide to go to 1-level in the future, that's how we would change it to. |
Sounds good! |
Just throwing it in here, replies could also be:
Because that describes, what it is? a comment on a comment? So entityType = comment and entityId = comment you want to reply to |
Unsure about the necessity of a tree structure in the URL. If we go for a tree structure, we could just either return all the direct children of commentId or all, and there is no need for a replyId, because you could request just the children of any comment, be it on root level or somewhere deeper in the tree. Anyway, it's not critical to decide this now, but when (if) we need it. |
The "comment on a comment" approach sounds good instead of a full tree. |
Removed Provide an Interface, so a storage may replace the core implementation requirement as this is already realized in the CommentsManager. The DAV part should be generic. In agreement with @PVince81 |
@blizzz for compliance, we should add your new report type to the list of supported reports set (OPTIONS method). To do so, your plugin must override this method https://github.com/fruux/sabre-dav/blob/master/lib/DAV/ServerPlugin.php#L83 Reopen or new ticket ? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Contributes to #16328
PUTto write comments Comments DAV implementation #21664 POSTProvide an Interface, so a storage may replace the core implementationwe should always go via CommentsManager, which can be replaced. No hard references to \OC\Comment$foo Comments DAV implementation #21664@nickvergessen @blizzz @DeepDiver1975 @jancborchardt
The text was updated successfully, but these errors were encountered: