diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-07-12 12:26:08 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-07-20 21:24:33 +0300 |
commit | ee7abfcc5a7230852e7c14bcbe33def703de38aa (patch) | |
tree | 5588312e1158230a672fb27e2b2e44ec7160251c /lib | |
parent | 21059397a906a6032cd6551034f06f0e9ef09ac4 (diff) |
Add supported mimetypes to capabilities
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AppInfo/Application.php | 3 | ||||
-rw-r--r-- | lib/Capabilities.php | 53 |
2 files changed, 56 insertions, 0 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index e9469d89..d85d6997 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -22,6 +22,7 @@ namespace OCA\Richdocuments\AppInfo; use OC\AppFramework\Utility\TimeFactory; +use OCA\Richdocuments\Capabilities; use OCA\Richdocuments\WOPI\DiscoveryManager; use OCP\AppFramework\App; use OCP\AppFramework\IAppContainer; @@ -32,5 +33,7 @@ class Application extends App { public function __construct (array $urlParams = array()) { parent::__construct(self::APPNAME, $urlParams); + + $this->getContainer()->registerCapability(Capabilities::class); } } diff --git a/lib/Capabilities.php b/lib/Capabilities.php new file mode 100644 index 00000000..7ba4534f --- /dev/null +++ b/lib/Capabilities.php @@ -0,0 +1,53 @@ +<?php +/** + * @copyright Copyright (c) 2018, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @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 OCA\Richdocuments; + +use OCP\Capabilities\ICapability; +use OCP\IURLGenerator; + +class Capabilities implements ICapability { + + /** @var IURLGenerator */ + private $urlGenerator; + + public function __construct(IURLGenerator $urlGenerator) { + $this->urlGenerator = $urlGenerator; + } + + public function getCapabilities() { + return [ + 'richdocuments' => [ + 'mimetypes' => [ + 'application/vnd.oasis.opendocument.text', + 'application/vnd.oasis.opendocument.spreadsheet', + 'application/vnd.oasis.opendocument.presentation', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + ], + ], + ]; + } + +} |