Written: July 7th, 2007, 4:01 (UTC) By: omer
I have neglected this blog lately as I've worked through various small bugs and features of the address book code, but there are several interesting new developments (or, at least, interesting for me). Most importantly, earlier today I did a compiled the X11 version of OpenOffice.org for Mac OS X and discovered happily that my address book code not only compiles on it but also works just fine. Other updates: OpenOffice.org no longer crashes on close (in fact, this was a bug outside of my code and was fixed by Frank Schönheit); the address book can now fully handle non-Latin alphabets (thanks to Florian Heckl); all data types from the OS X address book are now stored as the correct data type in OOo (so, for example, timestamps are now stored as timestamps rather than strings); fields from the address book are now displayed in a more logical manner (first name, then middle name, then last name, ...) rather than alphabetically; sorting records now works; and, if you have multiple groups in your address book, they'll each show up as a table in OOo.
I have also (finally) got my work in a presentable form. It is in two files, a patch file and a tarball, the patch for changes to files that already exist in OOo code and the tarball for files that I created. Apply both of them at the root OOo directory. The affected modules are connectivity, dbaccess, extensions, and scp2. Finally, I have created a cws for the address book integration (named "macaddressbook01"), and I am about to request that someone add those modules to the cws and apply the patch and tarball to them.
That said, here is what I think remains for my Google Summer of Code project:
- Look into optimizing the address book with mail-merge (to get OOo to automatically fill in at least some fields automatically). I've been looking into this a bit already, and I'm not sure how much I'll be able to do (and, I don't believe that other address books, at least KDE, do anything). One of the major issues I want to see if I can help is that OOo current requires the user to supply a column for "title" (e.g., "Mr."), and while the Mac OS X Address Book stores title information, it does not display it in the Mac OS X Address Book application, so many users will likely not have it filled in, which means that it will (currently) not show up in OOo (which I made only show columns that have some information in them). I'm still not sure what I'll do about this...
- Inernationalization of labels - given that I am using English, the fact that all of the address book's labels are in English has not stood out to me, but I recently discovered that the Address Book Carbon API comes with a localization function that, if I am not mistaken, gives the labels in the user's selected locale. I am not sure if I want to use it yet, depending on exactly what it does, but it at least looks like a promising (and hopefully not too difficult) fix.
- Handle groups of the same name - the Mac OS X Address Book lets you create groups of the same name (so, I can have two groups named "family"). OOo's address book integration is built on top of its databasing software base, such that requests for information are in the form of SQL queries, meaning that the name of the table really should be unique (so that "Select * From 'family'" makes sense). I've run into this problem before, with the freedom that Mac OS X Address Book users have in creating multiple identical fields (e.g., two home phone numbers). My solution then was to add a new a number at the end of all duplicates, so the first field would be "Phone: Home," while the second would be "Phone: Home (2)," the third "Phone: Home (3)," and so forth. I will likely do the same for groups.
- Clean up column sorting - as noted earlier, the columns are in a better order, but I am not very happy with the way I did it, since it is a bit ugly. I'll try to think of a better way of handling this.
- Comment the code better... at least the files that I created from scratch.
- Finally, the last rather large project I have set for myself is moving the whole address book over to use the Cocoa API, since that is the direction that the OOo porting project is taking. Luckily, I'm not expecting this move to be especially difficult, since I think that all of the changes will be isolated to a few files. We'll see!
Of course, these changes are assuming that others looking at my code are not appalled and demand that I start over or restructure the whole thing. If that happens, they'll all have to go on the backburner, and hopefully I'll have time to look into them later. I guess we'll soon see!
Oh, and finally, a fun screen shot follows of the addressbook working in X11. You'll see that one of the entries is written in Hebrew :)