Tuesday, May 22, 2007

Multiple databases for only you or multiple users

Your address book consists of the following components:

Core data -- A database file with extension name "GDB" contain essential part of your address book, including contact names, sections, fields, relationships and categories as well as almost all settings.

External files -- While the data fields can store names of external resources like web page addresses and file names, the files pointed by the file names are general stored in local computers or local area network. By default, file names without file path point to files stored in the Files directory of the user directory.

Template files -- While the whole design of Open Contact is very flexible for all users, some users with advanced knowledge of XML/XSL/HTML can modify some template files used by Open Contacts. Please read XML Explained for more details.

The built-in backup function backups the core database only. If you want to backup all components of your address book, you may just simply close the program, and copy all files of the user directory to an external storage.

Sometimes you might want an address book database for all your close contacts, and the other for business customers only. Or, there might be a few users sharing the same PC, each of them may want a personal database located in each personal folder under the "Documents and Settings" folder.

To support multiple databases, technically there can be a lot solutions. Because Open Contacts supports green mode which does not write things into Windows registry, we decided to use the Start-in folder as the location of the data files.

The operations described below might require knowledge of computer literate. If you are uncertain what to do, please ask your close contacts who understand system administration for assistant.

A windows program shortcut includes two paths: one for the target folder where the executable file is located, and the other for the "Start-in" folder where the program is started. If the "Start-in" folder is not defined, the folder is the same as the target folder. For example, checking the properties of the Open Contacts shortcut, you will see the target folder is inside "C:\Program Files\..." and the "Start-in" folder is inside "C:\Documents and Settings\All Users\Documents\Shared Contacts" if you installed for all users.

Open Contacts will locate data files in the "Start-in" folder by default at startup. Open Contacts will first read the "main.ini" file in the "Start-in" folder for the location of the database, then read the database. The other companion data files are all in the "start-in" folder by default.

In the "main.ini" file, if the database name is defined but without file path, the location of the file should be in the Data folder of the "Start-in" folder. So, by default, all data files and templates are located in the "Start-in" folder.

To support multiple personalities of one user or multiple users, please follow the steps below:

1. Copy an existing personal folder to specific folder as a new personal folder

From the "Start-in" folder of an existing shortcut, you locate an existing personal folder. Copy all files to specific folder which will become a new personal folder.

2. Copy a blank database to the data folder of the new personal folder to overwrite the database file copied from the source folder.

In the target folder, there's a blank database file "default.gdb". Copy this file to the data folder of the new personal folder to overwrite existing one. If you had changed the name of the database file or the settings of the INI file manually, you might need to adjust the operation details of this step.

3. Create a new program shortcut with the "Start-in" folder pointing to the personal folder.

If you as system administrator is going to create a new personal folder for another user and the PC is configured using LUA concepts, you might want to create the new copy inside the personal profile area and create the shortcuts there as well.