nextcloud/lib/private/Files/Cache
Arthur Schiwon 6bff6a5667
PoC: SystemTags endpoint to return tags used by a user with meta data
Target case is photos app: when visiting the tags category, all systemtags
of the whole cloud are retrieved. In subequent steps the next tag is
requested until the browser view is filled with tag tiles (i.e. previews
are requested just as well).

With this approach, we incorpoate the dav search and look for user related
tags that are used by them, and already returns the statistics (number of
files tagged with the respective tag) as well as a file id for the purpose
to load the preview. This defaults to the file with the highest id.

Call:
curl -s -u 'user:password' \
  'https://my.nc.srv/remote.php/dav/systemtags-current' \
  -X PROPFIND -H 'Accept: text/plain' \
  -H 'Accept-Language: en-US,en;q=0.5'  -H 'Depth: 1' \
  -H 'Content-Type: text/plain;charset=UTF-8' \
  --data @/home/doe/request-systemtag-props.xml

With request-systemtag-props.xml:
<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:">
        <d:prop xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
                <oc:id/>
                <oc:display-name/>
                <oc:user-visible/>
                <oc:user-assignable/>
                <oc:can-assign/>
                <nc:files-assigned/>
                <nc:reference-fileid/>
        </d:prop>
</d:propfind>

Example output:
  …
  <d:response>
    <d:href>/master/remote.php/dav/systemtags/84</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>84</oc:id>
        <oc:display-name>Computer</oc:display-name>
        <oc:user-visible>true</oc:user-visible>
        <oc:user-assignable>true</oc:user-assignable>
        <oc:can-assign>true</oc:can-assign>
        <nc:files-assigned>42</nc:files-assigned>
        <nc:reference-fileid>924022</nc:reference-fileid>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/systemtags/97</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>97</oc:id>
        <oc:display-name>Bear</oc:display-name>
        <oc:user-visible>true</oc:user-visible>
        <oc:user-assignable>true</oc:user-assignable>
        <oc:can-assign>true</oc:can-assign>
        <nc:files-assigned>1</nc:files-assigned>
        <nc:reference-fileid>923422</nc:reference-fileid>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  …

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-05-09 23:51:48 +02:00
..
Wrapper fix type hints 2023-04-04 17:05:45 +02:00
Cache.php fix type hints 2023-04-04 17:05:45 +02:00
CacheEntry.php fix null error in getUnencryptedSize 2022-10-13 15:34:48 +02:00
CacheQueryBuilder.php PoC: SystemTags endpoint to return tags used by a user with meta data 2023-05-09 23:51:48 +02:00
FailedCache.php use searchoperation for storage filter instead of db expression 2021-06-14 16:11:25 +02:00
HomeCache.php fix type hints 2023-04-04 17:05:45 +02:00
HomePropagator.php Update php licenses 2021-06-04 22:02:41 +02:00
LocalRootScanner.php Update php licenses 2021-06-04 22:02:41 +02:00
MoveFromCacheTrait.php Update php licenses 2021-06-04 22:02:41 +02:00
NullWatcher.php Update php licenses 2021-06-04 22:02:41 +02:00
Propagator.php Fix unencrypted size calculation for files created before the Encryption storage is enabled 2022-10-03 13:44:14 +02:00
QuerySearchHelper.php PoC: SystemTags endpoint to return tags used by a user with meta data 2023-05-09 23:51:48 +02:00
Scanner.php Merge pull request #36857 from nextcloud/scan-repair-unencrypted-size 2023-04-24 15:24:50 +02:00
SearchBuilder.php composer run cs:fix 2023-01-20 11:45:08 +01:00
Storage.php Fix Executing a query: SQLSTATE[42000] 2022-11-29 11:24:56 -06:00
StorageGlobal.php Fix typos in lib/private subdirectory 2022-07-27 08:52:17 -04:00
Updater.php ignore errors while trying to update parent storage_mtime 2023-04-20 17:16:03 +02:00
Watcher.php more reliable return value for Watcher::checkUpdate 2021-10-15 16:03:18 +02:00