[owncloud-devel] Adding custom properties on webdav protocol

Vincent Petry pvince81 at owncloud.com
Mon Apr 27 08:38:30 GMT 2015

Hi Benoit,

An example how to do it is the TagsPlugin from OC 8 which brings tags
and favorites:
It will show you how to override beforeGetProperties to do what you're
trying to achieve:

HOWEVER there is one open issue: currently apps cannot register their
own Sabre plugins into the default remote.php.
So unless you hard-code the register call here
the plugin approach will not work unfortunately.
I raised https://github.com/owncloud/core/issues/15879 to discuss such
possibilities in the future.

Another approach would be to rely on the existing custom properties
plugin which already allows you to pass custom properties to a PROPPATCH
call and retrieve them later through PROPFIND. Such properties are
always stored in the "oc_properties" table.

Hope this helps a bit.



On 27.04.2015 10:25, Benoît Pitet wrote:
> Hi all !
> I would like to add some custom properties associated to each files managed
> by owncloud I would like to retrieve this properties throught the webdav
> protocol like "<oc:permissions/>", "<oc:size/>" properties.
> I write a custom app with a custom table to store my properties for each
> file (imitating the "files_tashbin" and "files_version") and now I would
> like to retrieve and inject this properties on the webdav protocol.
> Looking at Sabre documentation and owncloud source code, I found that I
> could extend the 'OC_Connector_Sabre_FilesPlugin' class and override the
> 'beforeGetProperties' and this should do the trick.
> But how can I inject this plugin on the default 'OC_Connector_Sabre_Server'
> server when my app is activated ?
> Or is there any other way to do that ?
> Thanks for any response.
> Benoit
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150427/3caa10cf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150427/3caa10cf/attachment.sig>

More information about the Devel mailing list