[owncloud-devel] File Metadata/tags

Vincent Petry pvince81 at owncloud.com
Tue Jun 30 06:38:15 GMT 2015


I see at least two different kind of user-defined metadata that can be
associated with files.

1) Tags like labels: "Important", "Personal", "Todo", etc:

The public API is under the \OCP\ITags and \OCP\ITagManager PHP
interfaces (call \OC::$server->getTagManager())
They can also be set through WebDAV PROPFIND/PROPPATCH on files using
the oc:tags attribute (see
https://github.com/owncloud/core/pull/12865#issuecomment-67346274 for
example queries)
Such tags are stored in the database in the table "oc_vcategory" with
the type "files" and "oc_vcategory_to_object" maps them to file ids.
Currently such tags are only used to set the special "Favorite" tag.

There are plans for 8.2 to implement a user interface for arbitrary
tags: https://github.com/owncloud/core/issues/16325

Some apps like the Contacts app already have their own tags and use the
same OCP API.

2) Key/Value pairs which could also be called attributes or properties:

The WebDAV spec allows for setting custom key/value pairs that are
associated with files.
These are completely unrelated to the tags above and use a different
Such properties can be set/read using PROPPATCH/PROPFIND:
For example a PROPPATCH body:
<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:">
   <foo xmlns="http://example.com/customnamespace

There is currently no PHP API to set such properties as they aren't used
elsewhere and no plans to add any as far as I know.
The WebDAV properties are mapped with files in the "oc_properties" table.

Hope this helps a bit.



On 29.06.2015 21:57, Devin Ceartas wrote:
> I am beginning some client-sponsored development work to create a
> flexible system for associating user-defined metadata with files in
> owncloud.
> My starting point is the favorites plugin
> (https://github.com/owncloud/core/blob/64138b0af50dacab4ec8da20406c0131d8dee423/apps/files/js/favoritesplugin.js)
> My intention is to first understand how this plugin is implemented and
> be able to mimic it's behavior with alternative meta-data tags. From
> there I will work to develop a way to add new meta-data
> attributes/tags through a user-interface.
> I would be most thankful for any information relating to past, current
> or planned similar features or any other guidance. Thanks.
> devin
> -- 
> contact info: http://nacredata.com/devin
> Ask me about Google Apps for Work: hosting your domain-branded email,
> calendar and cloud storage on Google's infrastructure.
> _______________________________________________
> 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/20150630/129cdd47/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/20150630/129cdd47/attachment.sig>

More information about the Devel mailing list