nextcloud/lib/private/Files
Arthur Schiwon 2ea872d156
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-16 12:46:37 +02:00
..
AppData Move CappedMemoryCache to OCP 2022-07-14 15:54:31 +02:00
Cache PoC: SystemTags endpoint to return tags used by a user with meta data 2023-05-16 12:46:37 +02:00
Config more filesystem setup performance instrumentation 2023-02-10 11:11:13 +01:00
Lock Adapt LockScope to LockContext rename 2022-04-07 11:52:16 +02:00
Mount fix tests 2023-02-07 15:50:10 +01:00
Node PoC: SystemTags endpoint to return tags used by a user with meta data 2023-05-16 12:46:37 +02:00
Notify Update php licenses 2021-06-04 22:02:41 +02:00
ObjectStore feat(s3): Use multipart upload for chunked uploading 2023-03-09 15:31:12 +01:00
Search extend path-prefix optimizer to remove all cases of path_hash= when encountering a path prefix filter 2023-04-03 14:55:05 +00:00
SimpleFS Type sizes as int|float throughout the code base 2023-02-07 11:23:31 +01:00
Storage Get rid of more int casts in file size manipulations 2023-05-15 17:26:18 +02:00
Stream Fix psalm errors related to filesizes 2023-02-07 11:23:29 +01:00
Template Add app config for default template path 2023-01-24 09:39:31 +00:00
Type composer run cs:fix 2023-01-20 11:45:08 +01:00
Utils split out some path manipulation logic 2022-04-04 15:40:12 +02:00
FileInfo.php Allow float sizes in FileInfo for 32bits 2023-02-07 11:23:31 +01:00
Filesystem.php Fix psalm errors 2023-02-07 11:23:32 +01:00
SetupManager.php do onetime user setup before getting any mount from providers 2023-03-24 16:10:29 +00:00
SetupManagerFactory.php make mount cache duration configurable 2022-03-24 17:36:53 +01:00
View.php fix: Use proper path for quota fetching 2023-03-07 07:21:20 +00:00