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

Add internal fileid to webdav response #20567

Merged
merged 1 commit into from
Nov 18, 2015
Merged

Conversation

PVince81
Copy link
Contributor

Introduce a new property "oc:fileid" to return the internal file id.

This is because the original "oc:id" property is a compound and it is
not possible to extract the real id without knowing the instance id. The
instance id is not available to external clients.

Note: this is required for the new web UI impl that uses Webdav: #16902

To test:

  1. Create a folder "test"
  2. Save the following into "propfind.txt"
<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns">
        <a:prop><oc:id/></a:prop>
        <a:prop><oc:fileid/></a:prop>
</a:propfind>
  1. curl -X PROPFIND -H "Content-Type: text/xml" --data-binary "@propfind.txt" http://root:admin@localhost/owncloud/remote.php/webdav/test | xmllint --format -

This PR will output two additional properties, when requested as above:

<d:response>
    <d:href>/owncloud/remote.php/webdav/test/</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>00000003ockbfur1449k</oc:id>
        <oc:fileid>3</oc:fileid>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>

Please review @DeepDiver1975 @nickvergessen @icewind1991 @rullzer

I'm also open to better suggestions. Another alternative is to expose the "instanceid" through some API to make it possible to extract the file id from "oc:id".

Introduce a new property "oc:fileid" to return the internal file id.

This is because the original "oc:id" property is a compound and it is
not possible to extract the real id without knowing the instance id. The
instance id is not available to external clients.
@DeepDiver1975
Copy link
Member

👍

@icewind1991
Copy link
Contributor

👍 looks good

DeepDiver1975 added a commit that referenced this pull request Nov 18, 2015
Add internal fileid to webdav response
@DeepDiver1975 DeepDiver1975 merged commit 90bd53c into master Nov 18, 2015
@DeepDiver1975 DeepDiver1975 deleted the dav-internalfileidprop branch November 18, 2015 13:44
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants