[haiku-development] Re: People/Person format extension

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 02 Nov 2011 15:59:31 +0100

Le 02/11/2011 15:51, Barrett a écrit :
> Hello everybody,
> 
> i had no time to spend into Haiku development after gsoc, but i'll have
> some time in the next weeks.
> I need to discuss some things with you before to rework the code and make
> it enough mature to get it integrated into Haiku.
> 
> The object of this discussion is if and how extend the Person format.
> 
> At the moment Person does not guarantee data preservation when converting a
> vcard into a People file, for example the BContact's PostalBox and
> Neighborhood fields are not supported by people.
> 
> Since i think that the format must be keep simple, there's no need to store
> all data as attributes.
> My idea is something similar to what is already done for contacts image, by
> extending the format to store some basic set of fields (i.e. name, address,
> email, notes etc.) into attributes, and extended fields (i.e. various type
> of images, like personal or organization, file revision field, format
> version, timezone etc.) into the file with a defined structure, like
> flattened BContactFields. However, the possibility to add user defined
> attributes will be preserved.

There is no such "file format" to Peole files exactly because they
aren't files in terms of content.

Besides, there is no reason to define yet another format for that.
Should we choose to switch to a file-backed format for contacts they we
must use vCard, as it's the standard.
I think Caya already uses them.
vCard has an extension mechanism that we can use to store what we want:
http://en.wikipedia.org/wiki/VCard#vCard_extensions

Then we can just keep the attributes around for quick search but have
the contact editor update them from the file content.

> The compatibility with old versions will be guaranteed by the presence of
> one translator per file format. The old format translator for safety will
> check if a file is written using the new format returning B_NO_TRANSLATOR
> accordingly. Likewise the new format will check if a file is written using
> the old format.

Using a Translator to save to people files is an option yes, though if
we keep the same attributes it should work as is in most apps.

Oh you mean from a flattened object ?
Well I suppose the app can use whatever format internally, but it should
definitely save as vCard.
And keep extra data it doesn't know about when saving back...

> * People2 will be a format with support for native features and a native
> and compatible (via translators) replacement to vcard.

As I said, no need to invent "People2" just due to the Not Invented Here
syndrom.


François.

Other related posts: