Appointments
Appointments copied to clipboard
Usage of private Nextcloud APIs
Hey,
I'm one of the maintainers of the Calendar and Dav app of Nextcloud. It seems that this app is using a lot of private APIs, meaning whenever we have to change a class in the dav app, this app will most likely break.
There are two official / public APIs for calendar data:
- CalDAV
-
OCP\Calendar\IManager
If you need help migrating to public APIs, feel free to reach out.
I am just following direction at CalDAV/CalDavBackend.php
- ... * This default may well be good enough for personal use, and calendars * that aren't very large. But if you anticipate high usage, big calendars * or high loads, you are strongly advised to optimize certain paths. * * The best way to do so is override this method and to optimize * specifically for 'common filters'. * ...
If you have any suggestions on how to optimize the calendarQuery(...)
function in any other way please let me know.
Thanks
My point was that you shouldn’t be using CaldavBackend.php at all. It’s a private class of the DAV app, not a public stable API.
I see, I'll look into public APIs. Thank you.
Off subject question: Is there a way to add options to this menu from my app? Some kind of overlay API maybe ?
Thanks again.
Off subject question: Is there a way to add options to this menu from my app? Some kind of overlay API maybe ?
Not so far, but we are working on ways to make the calendar extensible. https://github.com/nextcloud/calendar/issues/812
@SergeyMosin Can you make sure to use public APIs before claiming the bounty, please? Just to make sure the app will not break with a next version of nextcloud or calendar app...
@nolens The back-end code has been refactored to use IBackendConnector Interface which in it's current implementation uses Sabre\CalDAV\Backend\BackendInterface of the CalDavBackend. The chances of CalDavBackend not supporting the Sabre\CalDAV\Backend\BackendInterface in the near future are very slim. Plus when https://github.com/nextcloud/server/issues/20154 is finally resolved and https://github.com/nextcloud/server/pull/20178 is pulled, looks like NC20 is the current milestone, it is going to be very easy to "plugin" the new \OCP\Calendar\IManagerV2
@georgehrke Could you please comment on that? Is this a stable and promising path for the foreseeable future, from your perspective?
I would like like to pay Sergey his bounty, at the same time, I would like to make sure we are on a future compatible codebase here.
@nolens If this app would be build on top of https://github.com/nextcloud/server/pull/20178, it would use only supported APIs and should work for plenty of Nextcloud versions to come.
It would still not solve https://github.com/nextcloud/calendar/issues/1023, because that should be integrated directly into the calendar app, not as a separate app. (But as far as i can tell, this app is already offering more than what i had in mind for https://github.com/nextcloud/calendar/issues/1023)
So, @SergeyMosin
Plus when nextcloud/server#20154 is finally resolved and nextcloud/server#20178 is pulled, looks like NC20 is the current milestone, it is going to be very easy to "plugin" the new
Is this what you are going to do, once nextcloud/server#20178 can be used?
@nolens Yep, it is a relatively easy update.
Basic public calendar write API has been added in nextcloud/server#29188
@tcitworld Nice! Thank you.