[Kolab-devel] UIDs as url with urn::uuid::

Thomas Brüderli bruederli at kolabsys.com
Wed Mar 14 12:21:48 CET 2012


Hello Christian

I have another question about UIDs in libkolabxml. The lib offers getters
and setters for object UIDs and they're also generated automatically for
new objects. They are saved as URIs with the urn::uuid:: prefix in the xml.

Now I was wondering whether the urn::uuid:: prefix is actually part of the
UID or is it just the protocol used for conforming the spec? Currently the
complete string is returned by uid() and I can also set an arbitrary string
without the prefix with setUid() which will result in an invalid URI saved
in the XML block. For the IMAP storage we also save the UID in the message
subject and use it for searching. This currently also includes the
urn::uuid: prefix.

I think the setters and getters of the lib should handle pure UIDs without
the urn prefix but rather add it when saving (to conform with the spec of
the UID field being represented as an URI) and remove it when reading the
format.

Here's an example of converting from the old Kolab format:
I have an object with UID 20101025160559.58545uuutb65kgsg at localhost. This
results in <uid><uri>20101025160559.58545uuutb65kgsg at localhost</uri></uid>
when saving into the new format which is IMO not correct. Without changing
UIDs of a converted object this should rather result in
<uid><text>20101025160559.58545uuutb65kgsg at localhost</text></uid>

What was the reason to use URIs for saving UIDs anyways?

Regards,
Thomas




More information about the devel mailing list