-
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
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
@@ -105,4 +122,84 @@ public function getSyncService() { | |||
return $this->getContainer()->query(SyncService::class); | |||
} | |||
|
|||
private function registerSabrePluginsFromApps(\OCA\DAV\Server $server) { | |||
\OC_App::loadApps(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | ||
return \OC::$server->query($plugin); | ||
} catch (QueryException $e) { | ||
if (class_exists($command)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$command? unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh oh... I copied your command code and forgot to replace
try { | ||
return \OC::$server->query($plugin); | ||
} catch (QueryException $e) { | ||
if (class_exists($command)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QueryException is unknown
👍 |
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
sabre
tags 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