summaryrefslogtreecommitdiffstats
path: root/lib/public/Collaboration
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-08-31 22:47:02 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-09-26 23:10:17 +0200
commitea3ac4e656408cd564a91ae6916bd7d65c19e922 (patch)
tree6f9d0502b7e4a8d853ccbc5a884ec5c96fc75241 /lib/public/Collaboration
parent271959b1d97b30388ac55efa94b6d5d1e28fa22d (diff)
downloadnextcloud-server-ea3ac4e656408cd564a91ae6916bd7d65c19e922.tar.gz
nextcloud-server-ea3ac4e656408cd564a91ae6916bd7d65c19e922.zip
Splits off the logic from sharees endpoint thus making it available from
within Nc/via PHP. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/public/Collaboration')
-rw-r--r--lib/public/Collaboration/Collaborators/ISearch.php37
-rw-r--r--lib/public/Collaboration/Collaborators/ISearchPlugin.php37
-rw-r--r--lib/public/Collaboration/Collaborators/ISearchResult.php68
3 files changed, 142 insertions, 0 deletions
diff --git a/lib/public/Collaboration/Collaborators/ISearch.php b/lib/public/Collaboration/Collaborators/ISearch.php
new file mode 100644
index 00000000000..db2e5f7ac05
--- /dev/null
+++ b/lib/public/Collaboration/Collaborators/ISearch.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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\Collaboration\Collaborators;
+
+interface ISearch {
+ /**
+ * @param string $search
+ * @param array $shareTypes
+ * @param bool $lookup
+ * @param int $limit
+ * @param int $offset
+ * @return array with two elements, 1st ISearchResult as array, 2nd a bool indicating whether more result are available
+ * @since 13.0.0
+ */
+ public function search($search, array $shareTypes, $lookup, $limit, $offset);
+}
diff --git a/lib/public/Collaboration/Collaborators/ISearchPlugin.php b/lib/public/Collaboration/Collaborators/ISearchPlugin.php
new file mode 100644
index 00000000000..cae93bfd731
--- /dev/null
+++ b/lib/public/Collaboration/Collaborators/ISearchPlugin.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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\Collaboration\Collaborators;
+
+
+interface ISearchPlugin {
+ /**
+ * @param string $search
+ * @param int $limit
+ * @param int $offset
+ * @param ISearchResult $searchResult
+ * @return bool whether the plugin has more results
+ * @since 13.0.0
+ */
+ public function search($search, $limit, $offset, ISearchResult $searchResult);
+}
diff --git a/lib/public/Collaboration/Collaborators/ISearchResult.php b/lib/public/Collaboration/Collaborators/ISearchResult.php
new file mode 100644
index 00000000000..b8d0a32cc0a
--- /dev/null
+++ b/lib/public/Collaboration/Collaborators/ISearchResult.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @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\Collaboration\Collaborators;
+
+
+interface ISearchResult {
+ /**
+ * @param string $type one of: users, groups, remotes, email, circles, lookup
+ * @param array $matches
+ * @param array|null $exactMatches
+ * @since 13.0.0
+ */
+ public function addResultSet($type, array $matches, array $exactMatches = null);
+
+ /**
+ * @param string $type one of: users, groups, remotes, email, circles, lookup
+ * @param string $collaboratorId
+ * @return bool
+ * @since 13.0.0
+ */
+ public function hasResult($type, $collaboratorId);
+
+ /**
+ * @param string $type one of: users, groups, remotes, email, circles, lookup
+ * @since 13.0.0
+ */
+ public function unsetResult($type);
+
+ /**
+ * @param string $type one of: users, groups, remotes, email, circles, lookup
+ * @since 13.0.0
+ */
+ public function markExactIdMatch($type);
+
+ /**
+ * @param string $type one of: users, groups, remotes, email, circles, lookup
+ * @return bool
+ * @since 13.0.0
+ */
+ public function hasExactIdMatch($type);
+
+ /**
+ * @return array
+ * @since 13.0.0
+ */
+ public function asArray();
+}