MacOSX: Address book integration

From Apache OpenOffice Wiki
Revision as of 02:47, 17 July 2007 by Cremlae (Talk | contribs)

Jump to: navigation, search

This page is part of Google Summer_of_Code_2007 proposal by Omer Bar-or and mentored by Sebastien Plisson

Proposal

I propose to integrate the Mac OS X Address Book with OpenOffice.org (both Aqua and X11 versions), as described on the OpenOffice.org project page for the Google Summer of Code. This task would provide the equivalent of the Mozilla address book integration already found in OpenOffice.org, but using the Mac OS X Address Book API. Additionally, not mentioned in the project page, is the issue of combining two address books (Mozilla and OS X), which would require handling collisions or selecting one of the two address books to use.

This project has four phases, the first three of which are described briefly on OpenOffice.org's project page. a) Familiarize oneself with the current OOo Mozilla Address Book integration - this task belongs first because it will be a guide for exactly which parts of the Max OS X Address Book API are important (see (b)). This task involves first experimenting with the Mozilla address book implementation by changing bits of the code and seeing how those changes manifest in the OOo address book functionality, then creating an equivalent to the Mozilla address book integration that works with a text file (since nothing makes a person more familiar with code than building it). b) Familiarize oneself with the Mac OS X Address Book API - after (a), the information needed from the Mac OS X Address Book should be known, so this task is largely a matter of reading up on the API and seeing what is available and in what forms. One place to look, if the API itself is unclear, is Quicksilver's Apple Address Book Module, which uses the API. The result of this task is a small program that uses the Mac OS X Address Book API to create the text file from which the section of code created in task (a) reads. c) Make a prototype for OOo Mac OS X address book integration - given (a) and (b), this process is straightforward. One replaces the reading from and writing to a text file from (a) with the interaction with the Mac OS X Address Book API from (b). d) Develop strategies for handling conflicts between the two address books - this task first entails familiarizing oneself with OOo's strategies for conflict resolution, especially if a strategy is already in place for address book integration. If a strategy is not in place, the second part of this task involves creating a strategy specific to address books. And, finally, if time permits, completing this task means prototyping the strategy using the Mac OS X Address Book and Mozilla integrations.

Current Status

(For a more regularly updated current status, please see: http://tpa.omer.bar-or.org/posts/OpenOffice.org/)

The initial version of the address book integration is complete and available as the cws macaddressbook01, which is currently synced to m220. It is still not fully tested.

To download it

  1. Download OpenOffice.org m220
    1. mkdir SRC680_m220
    2. cd SRC680_m220
    3. export CVSROOT=":pserver:anoncvs@anoncvs.services.openoffice.org:/cvs"
    4. cvs login
    5. (Password is: anoncvs)
    6. cvs -z3 co -r SRC680_m220 OpenOffice2
  2. Remove or move the modules required by macaddressbook01, I prefer:
    1. mkdir ORIGINALS
    2. mv connectivity dbaccess extensions scp2 ORIGINALS/
  3. Download macaddressbook01 (assuming you are still logged into cvs)
    1. cvs -z3 co -r cws_src680_macaddressbook01 connectivity dbaccess extensions scp2
  4. Configure and build OpenOffice.org as you like:
    1. I follow the directions in AquaBuild. You can also do the X11 build.

To add the add the address book as a data source

  1. Open OpenOffice.org
  2. Go to "File"->"Wizards"->"Address Data Source..."
  3. Select "Mac OS X Address Book"
  4. Click "Next"
  5. If you have groups in your address book, choose one (the top one, "Address Book," is all of the records in your address book), and click "Next"
  6. If you want, change the name or file name of your data source.
  7. Click "Finish"
  8. View your data sources (either: press F4, click on the "Data Sources" icon in your toolbar, or go to "View"->"Data Sources"
  9. If the address book data source is not expanded automatically, expand it (by the name you gave it in 7), then expand "Tables" and click on a table of your choosing.
  10. You should see all of your address book records now in OpenOffice.org!

To mail merge

  1. View your data sources and click on the Mail Merge button (or go to "Tools"->"Mail Merge Wizard")
  2. Click "Next" twice.
  3. If you opened the mail merge wizard via "Tools"->"Mail Merge Wizard," you'll need to select a data source by clicking on "Select Address List" and choosing the name of your data source.
  4. Click on "Match Fields"
  5. Match each field that the mail merge wizard requires with a column from the data source, until the preview (at the bottom) has no sections that read "not yet matched." The columns in the data source should be in an order very similar to the one expected by the mail merge wizard.
  6. Click "Next" until you cannot any longer (when you reach step 8 in the wizard)
  7. If you want, save, print, or send the record. (Otherwise, quit the wizard now.)
  8. If you did save, print, or send, click "Finish."

To show the data source's labels in a non-English language

  1. Add language directories to OOo (since it does not yet support native localization)
    1. Close OpenOffice.org if it is open.
    2. View the contents of the "OpenOffice.org 2.3.app" package. e.g., cd /Applications/OpenOffice.org\ 2.3.app/
    3. Go into the "Contents" folder
    4. Go into the "Resources" folder
    5. Create a directory named "en.lproj"
    6. Create a directory with the code of the language you want followed by ".lproj" (e.g., "es.lproj" for Spanish, "fr.lproj" for French, &c.)
  2. Change your locale in System Preferences
    1. Go into System Preferences
    2. Go into the International preference pane
    3. Drag the language you want up to the top of the list
    4. Close System Preferences
  3. Open OpenOffice.org
  4. View your data sources
  5. The address book's labels should now be in the language you want (if it is supported by Mac OS X)!

Other things to note and/or test

  • You can sort, filter, and do anything else that is available via the data source toolbar (as long as it is not grayed out). You can even sort by multiple columns (using the "AZ" button that has no arrows).
  • If you have two groups of the same name in your address book, or two fields of the same name in any record, the first group/field will show up normally, whereas the second will have a " (2)" appended to it. (The third would have a " (3)" and so forth.) For example, if I have two home phone numbers for someone, the first will be listed under "phone: home" and the second under "phone: home (2)", and if I have two groups named "friend" (for whatever reason), the first will be the table named "friend", and the second will be the table named "friend (2)".
  • You can view data sources, hide data sources, refresh the data source, and change tables as much as you like.
  • You can copy from the data source into your documents, though copy and paste in non-ASCII characters does not yet seem to be supported by the aqua port. (It does work with the X11 build.)

Student Task List

Two tasks remain:

  1. Continue to test/debug
  2. Complete migration to Cocoa
Personal tools