Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Webdav REPORT on files endpoint #359

Closed
PVince81 opened this issue Mar 22, 2017 · 2 comments · Fixed by #1990
Closed

Document Webdav REPORT on files endpoint #359

PVince81 opened this issue Mar 22, 2017 · 2 comments · Fixed by #1990
Assignees
Milestone

Comments

@PVince81
Copy link
Contributor

  1. Favorite some files in the web UI
  2. Create a file "report-favorite.xml" with the following contents
<?xml version="1.0" encoding="utf-8" ?>
<oc:filter-files xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns" >
        <a:prop>
                <!-- add Webdav properties to query here, like for PROPFIND -->
                <a:getetag/>
                <a:resourcetype/>
                <a:getcontentlength/>
        </a:prop>
        <!-- required filter rules, at least one needs to be specified -->
        <oc:filter-rules>
                <!-- add filter rules here -->
                <oc:favorite>1</oc:favorite>
        </oc:filter-rules>
        <!-- optional search block for pagination -->
        <oc:search>
                <!-- offset to retrieve (here 200 would be page 2) -->
                <oc:offset>200</oc:offset>
                <!-- number of results to retrieve -->
                <oc:limit>100</oc:limit>
        </oc:search>
</oc:filter-files>
  1. curl -u admin:admin -X REPORT -H "Content-Type: text/xml" --data-binary "@report-favorite.xml" 'http://localhost/owncloud/remote.php/dav/files/admin/'

This will return a multistatus result containing all favorite files from any subdirectory:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/owncloud/remote.php/dav/files/admin/welcome.txt</d:href>
    <d:propstat>
      <d:prop>
        <d:getetag>"e974c6a3c7d8886158b2911ab6cc7fea"</d:getetag>
        <d:resourcetype/>
        <d:getcontentlength>163</d:getcontentlength>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/owncloud/remote.php/dav/files/admin/sub/another</d:href>
    <d:propstat>
      <d:prop>
        <d:getetag>"58d2b5c6912da"</d:getetag>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <d:getcontentlength/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

It only returns the required properties just like PROPFIND.

@settermjd settermjd self-assigned this Mar 23, 2017
@settermjd settermjd transferred this issue from owncloud-archive/documentation Nov 20, 2018
@settermjd settermjd added this to the Backlog milestone May 21, 2019
@settermjd
Copy link
Contributor

It seems that a lot of this API endpoint has already been documented. I'm updating it to ensure that it is inline with this issue.

@settermjd
Copy link
Contributor

@PVince81, can you provide a complete list of filter-rules properties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants