add resource and room interfaces
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
a431cc3b58
commit
29b777e7d1
4 changed files with 250 additions and 0 deletions
55
lib/public/Calendar/Resource/IBackend.php
Normal file
55
lib/public/Calendar/Resource/IBackend.php
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
<?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 IBackend
|
||||||
|
*
|
||||||
|
* @package OCP\Calendar\Resource
|
||||||
|
* @since 14.0.0
|
||||||
|
*/
|
||||||
|
interface IBackend {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a list of all resources in this backend
|
||||||
|
*
|
||||||
|
* @return IResource[]
|
||||||
|
*/
|
||||||
|
public function getAllResources();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a list of all resource identifiers in this backend
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function listAllResources();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a resource by it's id
|
||||||
|
*
|
||||||
|
* @param string $id
|
||||||
|
* @return IResource|null
|
||||||
|
*/
|
||||||
|
public function getResource($id);
|
||||||
|
}
|
70
lib/public/Calendar/Resource/IResource.php
Normal file
70
lib/public/Calendar/Resource/IResource.php
Normal file
|
@ -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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the display name for a resource
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 14.0.0
|
||||||
|
*/
|
||||||
|
public function getDisplayName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the backend class the room is connected with
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 14.0.0
|
||||||
|
*/
|
||||||
|
public function getBackendClassName();
|
||||||
|
}
|
55
lib/public/Calendar/Room/IBackend.php
Normal file
55
lib/public/Calendar/Room/IBackend.php
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
<?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 IBackend
|
||||||
|
*
|
||||||
|
* @package OCP\Calendar\Room
|
||||||
|
* @since 14.0.0
|
||||||
|
*/
|
||||||
|
interface IBackend {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a list of all rooms in this backend
|
||||||
|
*
|
||||||
|
* @return IRoom[]
|
||||||
|
*/
|
||||||
|
public function getAllRooms();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a list of all room identifiers in this backend
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function listAllRooms();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a room by it's id
|
||||||
|
*
|
||||||
|
* @param string $id
|
||||||
|
* @return IRoom|null
|
||||||
|
*/
|
||||||
|
public function getRoom($id);
|
||||||
|
}
|
70
lib/public/Calendar/Room/IRoom.php
Normal file
70
lib/public/Calendar/Room/IRoom.php
Normal file
|
@ -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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the display name for a room
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 14.0.0
|
||||||
|
*/
|
||||||
|
public function getDisplayName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the backend class the room is connected with
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 14.0.0
|
||||||
|
*/
|
||||||
|
public function getBackendClassName();
|
||||||
|
}
|
Loading…
Reference in a new issue