summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php9
-rw-r--r--lib/composer/composer/autoload_static.php9
-rw-r--r--lib/l10n/fr.js1
-rw-r--r--lib/l10n/fr.json1
-rw-r--r--lib/l10n/it.js1
-rw-r--r--lib/l10n/it.json1
-rw-r--r--lib/l10n/pt_BR.js1
-rw-r--r--lib/l10n/pt_BR.json1
-rw-r--r--lib/l10n/sr.js3
-rw-r--r--lib/l10n/sr.json3
-rw-r--r--lib/private/Calendar/Resource/Manager.php83
-rw-r--r--lib/private/Calendar/Room/Manager.php83
-rw-r--r--lib/private/Preview/Bitmap.php2
-rw-r--r--lib/private/Server.php20
-rw-r--r--lib/private/Settings/Manager.php1
-rw-r--r--lib/public/Calendar/BackendTemporarilyUnavailableException.php32
-rw-r--r--lib/public/Calendar/Resource/IBackend.php70
-rw-r--r--lib/public/Calendar/Resource/IManager.php71
-rw-r--r--lib/public/Calendar/Resource/IResource.php80
-rw-r--r--lib/public/Calendar/Room/IBackend.php70
-rw-r--r--lib/public/Calendar/Room/IManager.php71
-rw-r--r--lib/public/Calendar/Room/IRoom.php80
-rw-r--r--lib/public/IServerContainer.php18
23 files changed, 710 insertions, 1 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index d0ff57de552..b416d6e77bd 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -77,8 +77,15 @@ return array(
'OCP\\BackgroundJob' => $baseDir . '/lib/public/BackgroundJob.php',
'OCP\\BackgroundJob\\IJob' => $baseDir . '/lib/public/BackgroundJob/IJob.php',
'OCP\\BackgroundJob\\IJobList' => $baseDir . '/lib/public/BackgroundJob/IJobList.php',
+ 'OCP\\Calendar\\BackendTemporarilyUnavailableException' => $baseDir . '/lib/public/Calendar/BackendTemporarilyUnavailableException.php',
'OCP\\Calendar\\ICalendar' => $baseDir . '/lib/public/Calendar/ICalendar.php',
'OCP\\Calendar\\IManager' => $baseDir . '/lib/public/Calendar/IManager.php',
+ 'OCP\\Calendar\\Resource\\IBackend' => $baseDir . '/lib/public/Calendar/Resource/IBackend.php',
+ 'OCP\\Calendar\\Resource\\IManager' => $baseDir . '/lib/public/Calendar/Resource/IManager.php',
+ 'OCP\\Calendar\\Resource\\IResource' => $baseDir . '/lib/public/Calendar/Resource/IResource.php',
+ 'OCP\\Calendar\\Room\\IBackend' => $baseDir . '/lib/public/Calendar/Room/IBackend.php',
+ 'OCP\\Calendar\\Room\\IManager' => $baseDir . '/lib/public/Calendar/Room/IManager.php',
+ 'OCP\\Calendar\\Room\\IRoom' => $baseDir . '/lib/public/Calendar/Room/IRoom.php',
'OCP\\Capabilities\\ICapability' => $baseDir . '/lib/public/Capabilities/ICapability.php',
'OCP\\Capabilities\\IPublicCapability' => $baseDir . '/lib/public/Capabilities/IPublicCapability.php',
'OCP\\Collaboration\\AutoComplete\\IManager' => $baseDir . '/lib/public/Collaboration/AutoComplete/IManager.php',
@@ -446,6 +453,8 @@ return array(
'OC\\Cache\\CappedMemoryCache' => $baseDir . '/lib/private/Cache/CappedMemoryCache.php',
'OC\\Cache\\File' => $baseDir . '/lib/private/Cache/File.php',
'OC\\Calendar\\Manager' => $baseDir . '/lib/private/Calendar/Manager.php',
+ 'OC\\Calendar\\Resource\\Manager' => $baseDir . '/lib/private/Calendar/Resource/Manager.php',
+ 'OC\\Calendar\\Room\\Manager' => $baseDir . '/lib/private/Calendar/Room/Manager.php',
'OC\\CapabilitiesManager' => $baseDir . '/lib/private/CapabilitiesManager.php',
'OC\\Collaboration\\AutoComplete\\Manager' => $baseDir . '/lib/private/Collaboration/AutoComplete/Manager.php',
'OC\\Collaboration\\Collaborators\\GroupPlugin' => $baseDir . '/lib/private/Collaboration/Collaborators/GroupPlugin.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 3d5a6536c65..2ada951e03e 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -107,8 +107,15 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\BackgroundJob' => __DIR__ . '/../../..' . '/lib/public/BackgroundJob.php',
'OCP\\BackgroundJob\\IJob' => __DIR__ . '/../../..' . '/lib/public/BackgroundJob/IJob.php',
'OCP\\BackgroundJob\\IJobList' => __DIR__ . '/../../..' . '/lib/public/BackgroundJob/IJobList.php',
+ 'OCP\\Calendar\\BackendTemporarilyUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Calendar/BackendTemporarilyUnavailableException.php',
'OCP\\Calendar\\ICalendar' => __DIR__ . '/../../..' . '/lib/public/Calendar/ICalendar.php',
'OCP\\Calendar\\IManager' => __DIR__ . '/../../..' . '/lib/public/Calendar/IManager.php',
+ 'OCP\\Calendar\\Resource\\IBackend' => __DIR__ . '/../../..' . '/lib/public/Calendar/Resource/IBackend.php',
+ 'OCP\\Calendar\\Resource\\IManager' => __DIR__ . '/../../..' . '/lib/public/Calendar/Resource/IManager.php',
+ 'OCP\\Calendar\\Resource\\IResource' => __DIR__ . '/../../..' . '/lib/public/Calendar/Resource/IResource.php',
+ 'OCP\\Calendar\\Room\\IBackend' => __DIR__ . '/../../..' . '/lib/public/Calendar/Room/IBackend.php',
+ 'OCP\\Calendar\\Room\\IManager' => __DIR__ . '/../../..' . '/lib/public/Calendar/Room/IManager.php',
+ 'OCP\\Calendar\\Room\\IRoom' => __DIR__ . '/../../..' . '/lib/public/Calendar/Room/IRoom.php',
'OCP\\Capabilities\\ICapability' => __DIR__ . '/../../..' . '/lib/public/Capabilities/ICapability.php',
'OCP\\Capabilities\\IPublicCapability' => __DIR__ . '/../../..' . '/lib/public/Capabilities/IPublicCapability.php',
'OCP\\Collaboration\\AutoComplete\\IManager' => __DIR__ . '/../../..' . '/lib/public/Collaboration/AutoComplete/IManager.php',
@@ -476,6 +483,8 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Cache\\CappedMemoryCache' => __DIR__ . '/../../..' . '/lib/private/Cache/CappedMemoryCache.php',
'OC\\Cache\\File' => __DIR__ . '/../../..' . '/lib/private/Cache/File.php',
'OC\\Calendar\\Manager' => __DIR__ . '/../../..' . '/lib/private/Calendar/Manager.php',
+ 'OC\\Calendar\\Resource\\Manager' => __DIR__ . '/../../..' . '/lib/private/Calendar/Resource/Manager.php',
+ 'OC\\Calendar\\Room\\Manager' => __DIR__ . '/../../..' . '/lib/private/Calendar/Room/Manager.php',
'OC\\CapabilitiesManager' => __DIR__ . '/../../..' . '/lib/private/CapabilitiesManager.php',
'OC\\Collaboration\\AutoComplete\\Manager' => __DIR__ . '/../../..' . '/lib/private/Collaboration/AutoComplete/Manager.php',
'OC\\Collaboration\\Collaborators\\GroupPlugin' => __DIR__ . '/../../..' . '/lib/private/Collaboration/Collaborators/GroupPlugin.php',
diff --git a/lib/l10n/fr.js b/lib/l10n/fr.js
index 478681106c0..42b90c01dfe 100644
--- a/lib/l10n/fr.js
+++ b/lib/l10n/fr.js
@@ -75,6 +75,7 @@ OC.L10N.register(
"Sharing" : "Partage",
"Security" : "Sécurité",
"Encryption" : "Chiffrement",
+ "Groupware" : "Travail collaboratif",
"Additional settings" : "Paramètres supplémentaires",
"Personal info" : "Informations personnelles",
"Mobile & desktop" : "Mobile & bureau",
diff --git a/lib/l10n/fr.json b/lib/l10n/fr.json
index 5cd27a1f77b..8796893aee5 100644
--- a/lib/l10n/fr.json
+++ b/lib/l10n/fr.json
@@ -73,6 +73,7 @@
"Sharing" : "Partage",
"Security" : "Sécurité",
"Encryption" : "Chiffrement",
+ "Groupware" : "Travail collaboratif",
"Additional settings" : "Paramètres supplémentaires",
"Personal info" : "Informations personnelles",
"Mobile & desktop" : "Mobile & bureau",
diff --git a/lib/l10n/it.js b/lib/l10n/it.js
index 6a6b24ecf4d..79e05fc9a7c 100644
--- a/lib/l10n/it.js
+++ b/lib/l10n/it.js
@@ -77,6 +77,7 @@ OC.L10N.register(
"Sharing" : "Condivisione",
"Security" : "Sicurezza",
"Encryption" : "Cifratura",
+ "Groupware" : "Groupware",
"Additional settings" : "Impostazioni aggiuntive",
"Personal info" : "Informazioni personali",
"Mobile & desktop" : "Mobile e desktop",
diff --git a/lib/l10n/it.json b/lib/l10n/it.json
index 8dcb32d407c..f564987857d 100644
--- a/lib/l10n/it.json
+++ b/lib/l10n/it.json
@@ -75,6 +75,7 @@
"Sharing" : "Condivisione",
"Security" : "Sicurezza",
"Encryption" : "Cifratura",
+ "Groupware" : "Groupware",
"Additional settings" : "Impostazioni aggiuntive",
"Personal info" : "Informazioni personali",
"Mobile & desktop" : "Mobile e desktop",
diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js
index 47299c24990..d7797d56fe5 100644
--- a/lib/l10n/pt_BR.js
+++ b/lib/l10n/pt_BR.js
@@ -77,6 +77,7 @@ OC.L10N.register(
"Sharing" : "Compartilhamento",
"Security" : "Segurança",
"Encryption" : "Criptografia",
+ "Groupware" : "Groupware",
"Additional settings" : "Configurações adicionais",
"Personal info" : "Informação Pessoal",
"Mobile & desktop" : "Móvel & desktop",
diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json
index 8a3cad36ba1..455c4ff54c0 100644
--- a/lib/l10n/pt_BR.json
+++ b/lib/l10n/pt_BR.json
@@ -75,6 +75,7 @@
"Sharing" : "Compartilhamento",
"Security" : "Segurança",
"Encryption" : "Criptografia",
+ "Groupware" : "Groupware",
"Additional settings" : "Configurações adicionais",
"Personal info" : "Informação Pessoal",
"Mobile & desktop" : "Móvel & desktop",
diff --git a/lib/l10n/sr.js b/lib/l10n/sr.js
index dd22cced58f..cdfa591b810 100644
--- a/lib/l10n/sr.js
+++ b/lib/l10n/sr.js
@@ -4,7 +4,9 @@ OC.L10N.register(
"Cannot write into \"config\" directory!" : "Не могу да уписујем у „config“ директоријум!",
"This can usually be fixed by giving the webserver write access to the config directory" : "Ово се обично може средити давањем права веб серверу да пише у директоријум са подешавањима",
"See %s" : "Погледајте %s",
+ "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "Или, ако пре желите да задржите config.php да је само за читање, поставите опцију \"config_is_read_only\" на true у њему самом.",
"This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Ово се обично може средити давањем права писања веб серверу за директоријум са подешавањима. Погледајте %s",
+ "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "Или, ако пре желите да задржите config.php да је само за читање, поставите опцију \"config_is_read_only\" на true у њему самом. Погледајте %s",
"The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "Фајлови апликације „%$1s“ нису правилно замењени. Проверите да ли је верзија компатибилна са сервером.",
"Sample configuration detected" : "Откривен је пример подешавања",
"It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Откривено је да је прекопиран пример подешавања. Ово може покварити инсталацију и није подржано. Прочитајте документацију пре вршења промена у фајлу config.php",
@@ -75,6 +77,7 @@ OC.L10N.register(
"Sharing" : "Дељење",
"Security" : "Безбедност",
"Encryption" : "Шифровање",
+ "Groupware" : "Радни тимови",
"Additional settings" : "Додатне поставке",
"Personal info" : "Лични подаци",
"Mobile & desktop" : "Мобилни и десктоп",
diff --git a/lib/l10n/sr.json b/lib/l10n/sr.json
index 2d1bb5da8c8..a564f6f9a27 100644
--- a/lib/l10n/sr.json
+++ b/lib/l10n/sr.json
@@ -2,7 +2,9 @@
"Cannot write into \"config\" directory!" : "Не могу да уписујем у „config“ директоријум!",
"This can usually be fixed by giving the webserver write access to the config directory" : "Ово се обично може средити давањем права веб серверу да пише у директоријум са подешавањима",
"See %s" : "Погледајте %s",
+ "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "Или, ако пре желите да задржите config.php да је само за читање, поставите опцију \"config_is_read_only\" на true у њему самом.",
"This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Ово се обично може средити давањем права писања веб серверу за директоријум са подешавањима. Погледајте %s",
+ "Or, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it. See %s" : "Или, ако пре желите да задржите config.php да је само за читање, поставите опцију \"config_is_read_only\" на true у њему самом. Погледајте %s",
"The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "Фајлови апликације „%$1s“ нису правилно замењени. Проверите да ли је верзија компатибилна са сервером.",
"Sample configuration detected" : "Откривен је пример подешавања",
"It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Откривено је да је прекопиран пример подешавања. Ово може покварити инсталацију и није подржано. Прочитајте документацију пре вршења промена у фајлу config.php",
@@ -73,6 +75,7 @@
"Sharing" : "Дељење",
"Security" : "Безбедност",
"Encryption" : "Шифровање",
+ "Groupware" : "Радни тимови",
"Additional settings" : "Додатне поставке",
"Personal info" : "Лични подаци",
"Mobile & desktop" : "Мобилни и десктоп",
diff --git a/lib/private/Calendar/Resource/Manager.php b/lib/private/Calendar/Resource/Manager.php
new file mode 100644
index 00000000000..2d1746cb989
--- /dev/null
+++ b/lib/private/Calendar/Resource/Manager.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Calendar\Resource;
+
+use OCP\Calendar\Resource\IBackend;
+
+class Manager implements \OCP\Calendar\Resource\IManager {
+
+ /** @var IBackend[] holds all registered resource backends */
+ private $backends;
+
+ /**
+ * Registers a resource backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function registerBackend(IBackend $backend) {
+ $this->backends[$backend->getBackendIdentifier()] = $backend;
+ }
+
+ /**
+ * Unregisters a resource backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function unregisterBackend(IBackend $backend) {
+ unset($this->backends[$backend->getBackendIdentifier()]);
+ }
+
+ /**
+ * @return IBackend[]
+ * @since 14.0.0
+ */
+ public function getBackends():array {
+ return array_values($this->backends);
+ }
+
+ /**
+ * @param string $backendId
+ * @return IBackend|null
+ */
+ public function getBackend($backendId):IBackend {
+ if (!isset($this->backends[$backendId])) {
+ return null;
+ }
+
+ return $this->backends[$backendId];
+ }
+
+ /**
+ * removes all registered backend instances
+ * @return void
+ * @since 14.0.0
+ */
+ public function clear() {
+ $this->backends = [];
+ }
+}
diff --git a/lib/private/Calendar/Room/Manager.php b/lib/private/Calendar/Room/Manager.php
new file mode 100644
index 00000000000..9ddf1f1d7b7
--- /dev/null
+++ b/lib/private/Calendar/Room/Manager.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Calendar\Room;
+
+use OCP\Calendar\Room\IBackend;
+
+class Manager implements \OCP\Calendar\Room\IManager {
+
+ /** @var IBackend[] holds all registered resource backends */
+ private $backends;
+
+ /**
+ * Registers a resource backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function registerBackend(IBackend $backend) {
+ $this->backends[$backend->getBackendIdentifier()] = $backend;
+ }
+
+ /**
+ * Unregisters a resource backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function unregisterBackend(IBackend $backend) {
+ unset($this->backends[$backend->getBackendIdentifier()]);
+ }
+
+ /**
+ * @return IBackend[]
+ * @since 14.0.0
+ */
+ public function getBackends():array {
+ return array_values($this->backends);
+ }
+
+ /**
+ * @param string $backendId
+ * @return IBackend|null
+ */
+ public function getBackend($backendId):IBackend {
+ if (!isset($this->backends[$backendId])) {
+ return null;
+ }
+
+ return $this->backends[$backendId];
+ }
+
+ /**
+ * removes all registered backend instances
+ * @return void
+ * @since 14.0.0
+ */
+ public function clear() {
+ $this->backends = [];
+ }
+}
diff --git a/lib/private/Preview/Bitmap.php b/lib/private/Preview/Bitmap.php
index 89b56bfc9e8..1fd42a0ea97 100644
--- a/lib/private/Preview/Bitmap.php
+++ b/lib/private/Preview/Bitmap.php
@@ -50,7 +50,7 @@ abstract class Bitmap extends Provider {
$bp = $this->getResizedPreview($tmpPath, $maxX, $maxY);
} catch (\Exception $e) {
\OC::$server->getLogger()->logException($e, [
- 'message' => 'Imagick says:',
+ 'message' => 'File: ' . $fileview->getAbsolutePath($path) . ' Imagick says:',
'level' => ILogger::ERROR,
'app' => 'core',
]);
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 7824638b212..3c15873206d 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -174,6 +174,12 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerAlias(\OCP\Calendar\IManager::class, \OC\Calendar\Manager::class);
$this->registerAlias('CalendarManager', \OC\Calendar\Manager::class);
+ $this->registerAlias(\OCP\Calendar\Resource\IManager::class, \OC\Calendar\Resource\Manager::class);
+ $this->registerAlias('CalendarResourceBackendManager', \OC\Calendar\Resource\Manager::class);
+
+ $this->registerAlias(\OCP\Calendar\Room\IManager::class, \OC\Calendar\Room\Manager::class);
+ $this->registerAlias('CalendarRoomBackendManager', \OC\Calendar\Room\Manager::class);
+
$this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class);
$this->registerAlias('ContactsManager', \OCP\Contacts\IManager::class);
@@ -1163,6 +1169,20 @@ class Server extends ServerContainer implements IServerContainer {
return $this->query('CalendarManager');
}
+ /**
+ * @return \OCP\Calendar\Resource\IManager
+ */
+ public function getCalendarResourceBackendManager() {
+ return $this->query('CalendarResourceBackendManager');
+ }
+
+ /**
+ * @return \OCP\Calendar\Room\IManager
+ */
+ public function getCalendarRoomBackendManager() {
+ return $this->query('CalendarRoomBackendManager');
+ }
+
private function connectDispatcher() {
$dispatcher = $this->getEventDispatcher();
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php
index a974eb9808d..4ee594c090f 100644
--- a/lib/private/Settings/Manager.php
+++ b/lib/private/Settings/Manager.php
@@ -231,6 +231,7 @@ class Manager implements IManager {
5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))],
10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))],
45 => [new Section('encryption', $this->l->t('Encryption'), 0, $this->url->imagePath('core', 'actions/password.svg'))],
+ 50 => [new Section('groupware', $this->l->t('Groupware'), 0, $this->url->imagePath('core', 'places/contacts-dark.svg'))],
98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
];
diff --git a/lib/public/Calendar/BackendTemporarilyUnavailableException.php b/lib/public/Calendar/BackendTemporarilyUnavailableException.php
new file mode 100644
index 00000000000..632a802359c
--- /dev/null
+++ b/lib/public/Calendar/BackendTemporarilyUnavailableException.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar;
+
+/**
+ * Class BackendTemporarilyUnavailableException
+ *
+ * @package OCP\Calendar
+ * @since 14.0.0
+ */
+class BackendTemporarilyUnavailableException extends \Exception {}
diff --git a/lib/public/Calendar/Resource/IBackend.php b/lib/public/Calendar/Resource/IBackend.php
new file mode 100644
index 00000000000..24635219fe0
--- /dev/null
+++ b/lib/public/Calendar/Resource/IBackend.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Resource;
+use OCP\Calendar\BackendTemporarilyUnavailableException;
+
+/**
+ * Interface IBackend
+ *
+ * @package OCP\Calendar\Resource
+ * @since 14.0.0
+ */
+interface IBackend {
+
+ /**
+ * get a list of all resources in this backend
+ *
+ * @throws BackendTemporarilyUnavailableException
+ * @return IResource[]
+ * @since 14.0.0
+ */
+ public function getAllResources():array;
+
+ /**
+ * get a list of all resource identifiers in this backend
+ *
+ * @throws BackendTemporarilyUnavailableException
+ * @return string[]
+ * @since 14.0.0
+ */
+ public function listAllResources():array;
+
+ /**
+ * get a resource by it's id
+ *
+ * @param string $id
+ * @throws BackendTemporarilyUnavailableException
+ * @return IResource|null
+ * @since 14.0.0
+ */
+ public function getResource($id);
+
+ /**
+ * Get unique identifier of the backend
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getBackendIdentifier():string;
+}
diff --git a/lib/public/Calendar/Resource/IManager.php b/lib/public/Calendar/Resource/IManager.php
new file mode 100644
index 00000000000..8542e13eba7
--- /dev/null
+++ b/lib/public/Calendar/Resource/IManager.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Resource;
+
+/**
+ * Interface IManager
+ *
+ * @package OCP\Calendar\Resource
+ * @since 14.0.0
+ */
+interface IManager {
+
+ /**
+ * Registers a resource backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function registerBackend(IBackend $backend);
+
+ /**
+ * Unregisters a resource backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function unregisterBackend(IBackend $backend);
+
+ /**
+ * @return IBackend[]
+ * @since 14.0.0
+ */
+ public function getBackends():array;
+
+ /**
+ * @param string $backendId
+ * @return IBackend
+ * @since 14.0.0
+ */
+ public function getBackend($backendId):IBackend;
+
+ /**
+ * removes all registered backend instances
+ * @return void
+ * @since 14.0.0
+ */
+ public function clear();
+}
diff --git a/lib/public/Calendar/Resource/IResource.php b/lib/public/Calendar/Resource/IResource.php
new file mode 100644
index 00000000000..1f588ccb48d
--- /dev/null
+++ b/lib/public/Calendar/Resource/IResource.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Resource;
+
+/**
+ * Interface IResource
+ *
+ * @package OCP\Calendar\Resource
+ * @since 14.0.0
+ */
+interface IResource {
+
+ /**
+ * get the resource id
+ *
+ * This id has to be unique within the backend
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getId():string;
+
+ /**
+ * get the display name for a resource
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getDisplayName():string;
+
+ /**
+ * Get a list of groupIds that are allowed to access this resource
+ *
+ * If an empty array is returned, no group restrictions are
+ * applied.
+ *
+ * @return string[]
+ * @since 14.0.0
+ */
+ public function getGroupRestrictions():array;
+
+ /**
+ * get email-address for resource
+ *
+ * The email address has to be globally unique
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getEMail():string;
+
+ /**
+ * Get corresponding backend object
+ *
+ * @return IBackend
+ * @since 14.0.0
+ */
+ public function getBackend():IBackend;
+}
diff --git a/lib/public/Calendar/Room/IBackend.php b/lib/public/Calendar/Room/IBackend.php
new file mode 100644
index 00000000000..f675012ab39
--- /dev/null
+++ b/lib/public/Calendar/Room/IBackend.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Room;
+use OCP\Calendar\BackendTemporarilyUnavailableException;
+
+/**
+ * Interface IBackend
+ *
+ * @package OCP\Calendar\Room
+ * @since 14.0.0
+ */
+interface IBackend {
+
+ /**
+ * get a list of all rooms in this backend
+ *
+ * @throws BackendTemporarilyUnavailableException
+ * @return IRoom[]
+ * @since 14.0.0
+ */
+ public function getAllRooms():array;
+
+ /**
+ * get a list of all room identifiers in this backend
+ *
+ * @throws BackendTemporarilyUnavailableException
+ * @return string[]
+ * @since 14.0.0
+ */
+ public function listAllRooms():array;
+
+ /**
+ * get a room by it's id
+ *
+ * @param string $id
+ * @throws BackendTemporarilyUnavailableException
+ * @return IRoom|null
+ * @since 14.0.0
+ */
+ public function getRoom($id);
+
+ /**
+ * Get unique identifier of the backend
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getBackendIdentifier():string;
+}
diff --git a/lib/public/Calendar/Room/IManager.php b/lib/public/Calendar/Room/IManager.php
new file mode 100644
index 00000000000..39e85c43e45
--- /dev/null
+++ b/lib/public/Calendar/Room/IManager.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Room;
+
+/**
+ * Interface IManager
+ *
+ * @package OCP\Calendar\Room
+ * @since 14.0.0
+ */
+interface IManager {
+
+ /**
+ * Registers a room backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function registerBackend(IBackend $backend);
+
+ /**
+ * Unregisters a room backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function unregisterBackend(IBackend $backend);
+
+ /**
+ * @return IBackend[]
+ * @since 14.0.0
+ */
+ public function getBackends():array;
+
+ /**
+ * @param string $backendId
+ * @return IBackend
+ * @since 14.0.0
+ */
+ public function getBackend($backendId):IBackend;
+
+ /**
+ * removes all registered backend instances
+ * @return void
+ * @since 14.0.0
+ */
+ public function clear();
+}
diff --git a/lib/public/Calendar/Room/IRoom.php b/lib/public/Calendar/Room/IRoom.php
new file mode 100644
index 00000000000..d860bb6fc57
--- /dev/null
+++ b/lib/public/Calendar/Room/IRoom.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Room;
+
+/**
+ * Interface IRoom
+ *
+ * @package OCP\Calendar\Room
+ * @since 14.0.0
+ */
+interface IRoom {
+
+ /**
+ * get the room id
+ *
+ * This id has to be unique within the backend
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getId():string;
+
+ /**
+ * get the display name for a room
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getDisplayName():string;
+
+ /**
+ * Get a list of groupIds that are allowed to access this room
+ *
+ * If an empty array is returned, no group restrictions are
+ * applied.
+ *
+ * @return string[]
+ * @since 14.0.0
+ */
+ public function getGroupRestrictions():array;
+
+ /**
+ * get email-address for room
+ *
+ * The email address has to be globally unique
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getEMail():string;
+
+ /**
+ * Get corresponding backend object
+ *
+ * @return IBackend
+ * @since 14.0.0
+ */
+ public function getBackend():IBackend;
+}
diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php
index c38aaf9f2cb..96015d3f8a8 100644
--- a/lib/public/IServerContainer.php
+++ b/lib/public/IServerContainer.php
@@ -68,6 +68,24 @@ interface IServerContainer extends IContainer {
public function getCalendarManager();
/**
+ * The calendar resource backend manager will act as a broker between consumers
+ * for calendar resource information an providers which actual deliver the room information.
+ *
+ * @return \OCP\Calendar\Resource\IBackend
+ * @since 14.0.0
+ */
+ public function getCalendarResourceBackendManager();
+
+ /**
+ * The calendar room backend manager will act as a broker between consumers
+ * for calendar room information an providers which actual deliver the room information.
+ *
+ * @return \OCP\Calendar\Room\IBackend
+ * @since 14.0.0
+ */
+ public function getCalendarRoomBackendManager();
+
+ /**
* The contacts manager will act as a broker between consumers for contacts information and
* providers which actual deliver the contact information.
*