Let apps register Sabre plugins or collections#26761
Conversation
|
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975 and @tcitworld to be potential reviewers. |
|
|
|
|
To demo and test this feature, I tried moving the DAV plugins for the comments into the "comments" app in 64b66d7 So far only the root collection seems to work. Might need further tweaking. |
|
|
Solved the auth issue by moving the registration of app sabre plugins into |
010d4a4 to
e31bfce
Compare
| } | ||
|
|
||
| private function registerSabrePluginsFromApps(\OCA\DAV\Server $server) { | ||
| \OC_App::loadApps(); |
There was a problem hiding this comment.
load all apps? in the past we only did load apps of type filesystem to ensure some performance on the dav backend.
new app type? e.g. dav?
There was a problem hiding this comment.
A new app type sounds great, I'll add it
| } | ||
| // FIXME: switch to public API once available | ||
| // load commands using info.xml | ||
| $info = \OC_App::getAppInfo($app); |
There was a problem hiding this comment.
| try { | ||
| return \OC::$server->query($plugin); | ||
| } catch (QueryException $e) { | ||
| if (class_exists($command)) { |
There was a problem hiding this comment.
uh oh... I copied your command code and forgot to replace
| try { | ||
| return \OC::$server->query($plugin); | ||
| } catch (QueryException $e) { | ||
| if (class_exists($command)) { |
v1 only holds files - and it's just the old interface - no need to anything new there |
|
@DeepDiver1975 ok then we can't port the "comments" app to be a "dav" app with Sabre plugins, because then the comments plugin would be missing in the v1 endpoint. The other alternative is to change the web UI to use webdav v2: #25494. But then if there's any client who used to expected the oc:comments-unread property on the old endpoint they'd stop working. (but the likeliness of the existence of such clients is very low) |
comments arn't even part of v1 as of today - right? So no need to add it |
Only one piece is: we have a Webdav property on files that is added through the |
I see - lets hardcode this piece and we are fine |
|
Hardcode, hmmm... There are multiple levels where we can do this:
So I guess 1) is the best approach for now. |
e31bfce to
a050cad
Compare
|
Rebased onto master to be able to use one of the new IAppManager calls. Remaining tasks:
|
a050cad to
ace036b
Compare
|
I refactored the whole thing to simplify it. Please review @DeepDiver1975 @jvillafanez @VicDeo @PhilippSchaffrath First have a look at 07d43a5 which brings the Sabre plugins registration code. |
| foreach ($collections as $collection) { | ||
| try { | ||
| $this->collections[] = $this->container->query($collection); | ||
| } catch (QueryException $e) { |
|
👍 |
|
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. |
Description
See #26195 (comment) for info.xml format.
This checks the
sabretags in info.xml for all apps and automatically registers the Sabre plugins and collections to the root collection.Note that this only happens for v2 remote.php.
Related Issue
Fixes #26195
Motivation and Context
Since we want Webdav to be used for APIs, apps need a way to register Sabre plugins and also to hook their collections to the remote.php/dav collection tree.
How Has This Been Tested?
Manually tested with the customgroups app, not ready yet.
Screenshots (if appropriate):
Types of changes
Checklist:
@DeepDiver1975 check this out