routes.php 2.9 KB
Newer Older
1
<?php
Jenkins for ownCloud's avatar
Jenkins for ownCloud committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * @author Björn Schießle <schiessle@owncloud.com>
 * @author Georg Ehrke <georg@owncloud.com>
 * @author Lukas Reschke <lukas@owncloud.com>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin Appelman <icewind@owncloud.com>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
 *
 * @copyright Copyright (c) 2015, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * 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, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
26
27
28
29
30
31
32
33
34
35
36
namespace OCA\Files_Sharing\AppInfo;

use OCA\Files_Sharing\Application;

$application = new Application();
$application->registerRoutes($this, [
	'resources' => [
		'ExternalShares' => ['url' => '/api/externalShares'],
	]
]);

37
/** @var $this \OCP\Route\IRouter */
38
39
40
41
$this->create('core_ajax_public_preview', '/publicpreview')->action(
	function() {
		require_once __DIR__ . '/../ajax/publicpreview.php';
	});
42

Lukas Reschke's avatar
Lukas Reschke committed
43
44
$this->create('files_sharing_ajax_list', 'ajax/list.php')
	->actionInclude('files_sharing/ajax/list.php');
45
46
$this->create('files_sharing_ajax_publicpreview', 'ajax/publicpreview.php')
	->actionInclude('files_sharing/ajax/publicpreview.php');
Lukas Reschke's avatar
Lukas Reschke committed
47
48
49
50
51
52
$this->create('sharing_external_shareinfo', '/shareinfo')
	->actionInclude('files_sharing/ajax/shareinfo.php');
$this->create('sharing_external_add', '/external')
	->actionInclude('files_sharing/ajax/external.php');
$this->create('sharing_external_test_remote', '/testremote')
	->actionInclude('files_sharing/ajax/testremote.php');
53

Bjoern Schiessle's avatar
Bjoern Schiessle committed
54
55
56
// OCS API

//TODO: SET: mail notification, waiting for PR #4689 to be accepted
57

58
\OC_API::register('get',
59
		'/apps/files_sharing/api/v1/shares',
60
		array('\OCA\Files_Sharing\API\Local', 'getAllShares'),
Bjoern Schiessle's avatar
Bjoern Schiessle committed
61
		'files_sharing');
Bjoern Schiessle's avatar
Bjoern Schiessle committed
62

63
\OC_API::register('post',
64
		'/apps/files_sharing/api/v1/shares',
65
		array('\OCA\Files_Sharing\API\Local', 'createShare'),
Bjoern Schiessle's avatar
Bjoern Schiessle committed
66
		'files_sharing');
Bjoern Schiessle's avatar
Bjoern Schiessle committed
67

68
\OC_API::register('get',
69
		'/apps/files_sharing/api/v1/shares/{id}',
70
		array('\OCA\Files_Sharing\API\Local', 'getShare'),
71
		'files_sharing');
Bjoern Schiessle's avatar
Bjoern Schiessle committed
72

73
\OC_API::register('put',
74
		'/apps/files_sharing/api/v1/shares/{id}',
75
		array('\OCA\Files_Sharing\API\Local', 'updateShare'),
76
		'files_sharing');
77

78
\OC_API::register('delete',
79
		'/apps/files_sharing/api/v1/shares/{id}',
80
		array('\OCA\Files_Sharing\API\Local', 'deleteShare'),
81
		'files_sharing');
Roeland Jago Douma's avatar
Roeland Jago Douma committed
82
83
84
85
86
87

// Register with the capabilities API
\OC_API::register('get',
		'/cloud/capabilities',
		array('OCA\Files_Sharing\Capabilities', 'getCapabilities'),
		'files_sharing', \OC_API::USER_AUTH);