diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-09-12 17:09:46 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-19 11:06:29 +0200 |
commit | 361f008c705009eee8d7435f46095760ac706456 (patch) | |
tree | 95e7033befa4ff0fc20e60f5df2a4b249575d636 /apps/files/lib | |
parent | 5e48ce98c70fa511ea2c1caeb332594912c9d96a (diff) | |
download | nextcloud-server-361f008c705009eee8d7435f46095760ac706456.tar.gz nextcloud-server-361f008c705009eee8d7435f46095760ac706456.zip |
Make it possible to filter by tags with REPORT method
Enhanced the REPORT method on the Webdav endpoint and added a
"oc:favorite" filter rule. When set, it will return a flat list of
results filtered with only favorite files.
The web UI was also adjusted to use this REPORT method instead of the
private API endpoint.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Controller/ApiController.php | 17 | ||||
-rw-r--r-- | apps/files/lib/Service/TagService.php | 21 |
2 files changed, 0 insertions, 38 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 7ce83bfca15..d6f88581b96 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -174,23 +174,6 @@ class ApiController extends Controller { } /** - * Returns a list of all files tagged with the given tag. - * - * @NoAdminRequired - * - * @param string $tagName tag name to filter by - * @return DataResponse - */ - public function getFilesByTag($tagName) { - $nodes = $this->tagService->getFilesByTag($tagName); - $files = $this->formatNodes($nodes); - foreach ($files as &$file) { - $file['tags'] = [$tagName]; - } - return new DataResponse(['files' => $files]); - } - - /** * Returns a list of recently modifed files. * * @NoAdminRequired diff --git a/apps/files/lib/Service/TagService.php b/apps/files/lib/Service/TagService.php index 04e962b5e17..4482fb45371 100644 --- a/apps/files/lib/Service/TagService.php +++ b/apps/files/lib/Service/TagService.php @@ -90,26 +90,5 @@ class TagService { // list is up to date, in case of concurrent changes ? return $tags; } - - /** - * Get all files for the given tag - * - * @param string $tagName tag name to filter by - * @return Node[] list of matching files - * @throws \Exception if the tag does not exist - */ - public function getFilesByTag($tagName) { - try { - $fileIds = $this->tagger->getIdsForTag($tagName); - } catch (\Exception $e) { - return []; - } - - $allNodes = []; - foreach ($fileIds as $fileId) { - $allNodes = array_merge($allNodes, $this->homeFolder->getById((int) $fileId)); - } - return $allNodes; - } } |