diff options
author | Robin Appelman <robin@icewind.nl> | 2017-02-02 18:20:08 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-03-01 14:06:39 +0100 |
commit | df2063ee7b49d051f9081c6fd416dd8791358ada (patch) | |
tree | a90e9f6dbae0767247593941e7c6e95b9c41befb /lib/public/Files | |
parent | 706131b394eef4d346f8019b4978f9a735139b03 (diff) | |
download | nextcloud-server-df2063ee7b49d051f9081c6fd416dd8791358ada.tar.gz nextcloud-server-df2063ee7b49d051f9081c6fd416dd8791358ada.zip |
Implement webdav SEARCH
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/public/Files')
-rw-r--r-- | lib/public/Files/Cache/ICache.php | 12 | ||||
-rw-r--r-- | lib/public/Files/Folder.php | 3 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchBinaryOperator.php | 5 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchComparison.php | 3 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchOperator.php | 5 | ||||
-rw-r--r-- | lib/public/Files/Search/ISearchQuery.php | 24 |
6 files changed, 50 insertions, 2 deletions
diff --git a/lib/public/Files/Cache/ICache.php b/lib/public/Files/Cache/ICache.php index 7d01b1a2908..63993d0a8cb 100644 --- a/lib/public/Files/Cache/ICache.php +++ b/lib/public/Files/Cache/ICache.php @@ -21,6 +21,8 @@ */ namespace OCP\Files\Cache; +use OCP\Files\Search\ISearchOperator; +use OCP\Files\Search\ISearchQuery; /** * Metadata cache for a storage @@ -213,6 +215,16 @@ interface ICache { public function searchByMime($mimetype); /** + * Search for files with a flexible query + * + * @param ISearchQuery $query + * @return ICacheEntry[] + * @throw \InvalidArgumentException if the cache is unable to perform the query + * @since 12.0.0 + */ + public function searchQuery(ISearchQuery $query); + + /** * Search for files by tag of a given users. * * Note that every user can tag files differently. diff --git a/lib/public/Files/Folder.php b/lib/public/Files/Folder.php index 8f8576d8503..52a4b303196 100644 --- a/lib/public/Files/Folder.php +++ b/lib/public/Files/Folder.php @@ -30,6 +30,7 @@ // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\Files; +use OCP\Files\Search\ISearchQuery; /** * @since 6.0.0 @@ -115,7 +116,7 @@ interface Folder extends Node { /** * search for files with the name matching $query * - * @param string $query + * @param string|ISearchQuery $query * @return \OCP\Files\Node[] * @since 6.0.0 */ diff --git a/lib/public/Files/Search/ISearchBinaryOperator.php b/lib/public/Files/Search/ISearchBinaryOperator.php index 248e3de56b8..d5a2d5dc02d 100644 --- a/lib/public/Files/Search/ISearchBinaryOperator.php +++ b/lib/public/Files/Search/ISearchBinaryOperator.php @@ -21,6 +21,9 @@ namespace OCP\Files\Search; +/** + * @since 12.0.0 + */ interface ISearchBinaryOperator extends ISearchOperator { const OPERATOR_AND = 'and'; const OPERATOR_OR = 'or'; @@ -32,6 +35,7 @@ interface ISearchBinaryOperator extends ISearchOperator { * One of the ISearchBinaryOperator::OPERATOR_* constants * * @return string + * @since 12.0.0 */ public function getType(); @@ -41,6 +45,7 @@ interface ISearchBinaryOperator extends ISearchOperator { * One argument for the 'not' operator and two for 'and' and 'or' * * @return ISearchOperator[] + * @since 12.0.0 */ public function getArguments(); } diff --git a/lib/public/Files/Search/ISearchComparison.php b/lib/public/Files/Search/ISearchComparison.php index 05342218616..e5175ee3117 100644 --- a/lib/public/Files/Search/ISearchComparison.php +++ b/lib/public/Files/Search/ISearchComparison.php @@ -33,6 +33,7 @@ interface ISearchComparison extends ISearchOperator { * Get the type of comparison, one of the ISearchComparison::COMPARE_* constants * * @return string + * @since 12.0.0 */ public function getType(); @@ -42,6 +43,7 @@ interface ISearchComparison extends ISearchOperator { * i.e. 'size', 'name' or 'mimetype' * * @return string + * @since 12.0.0 */ public function getField(); @@ -49,6 +51,7 @@ interface ISearchComparison extends ISearchOperator { * Get the value to compare the field with * * @return string|integer|\DateTime + * @since 12.0.0 */ public function getValue(); } diff --git a/lib/public/Files/Search/ISearchOperator.php b/lib/public/Files/Search/ISearchOperator.php index fc1db57f4ca..047792bc782 100644 --- a/lib/public/Files/Search/ISearchOperator.php +++ b/lib/public/Files/Search/ISearchOperator.php @@ -21,6 +21,9 @@ namespace OCP\Files\Search; -interface ISearchCondition { +/** + * @since 12.0.0 + */ +interface ISearchOperator { } diff --git a/lib/public/Files/Search/ISearchQuery.php b/lib/public/Files/Search/ISearchQuery.php index f9c07533a1e..5a701b321b1 100644 --- a/lib/public/Files/Search/ISearchQuery.php +++ b/lib/public/Files/Search/ISearchQuery.php @@ -30,4 +30,28 @@ interface ISearchQuery { * @since 12.0.0 */ public function getSearchOperation(); + + /** + * Get the maximum number of results to return + * + * @return integer + * @since 12.0.0 + */ + public function getLimit(); + + /** + * Get the offset for returned results + * + * @return integer + * @since 12.0.0 + */ + public function getOffset(); + + /** + * The fields and directions to order by + * + * @return ISearchOrder[] + * @since 12.0.0 + */ + public function getOrder(); } |