AddressBook::DB::PDB - Backend for AddressBook to use PDB (PalmOS) Databases.
use AddressBook; $a = AddressBook->new(source => "PDB",port=>"/dev/pilot"); $b = AddressBook->new(source => "PDB",pdb=>$pdb); $c = AddressBook->new(source => "PDB",dlp=>$dlp);
The PDA::Pilot library module is required in order to use this package. PDA::Pilot is available as part of the pilot-link distribution, which is available at http://www.gnu-designs.com/pilot-link
AddressBook::DB::PDB supports sequential backend database methods. AddressBook::DB::PDB behavior can be modified using the following options:
A list of PDB field names (not cannonical names) which can be used to uniquely identify a database record. Ideally the "id" field of PDB records would be used here, but currently it is not. "Name,First name" is recommended.
A perl statment which, when eval'd, returns a comma-delimited list of "phone labels". Valid phone labels are: Work,Home,Fax,Other,E-Mail,Main,Pager,Mobile. The result of the eval'd phone_display will be used to determine which phone label is default shown in the PalmOS address list. The first label in the comma-delimited list is used unless the record has no value for that label, in which case the second label is used unless it also has no value, in which case the third is used, and so on....
In the phone_display string, other attributes may be referenced as "$<attr>".
For example, if you want the priority of default phone lables to be "Work,Home,E-Mail" for all records in the "Business" category, and the priority to be "Home,Work,E-Mail" for all records in all other categories, you could use the following:
phone_display = "($category eq 'Business') ? 'Work,Home,E-Mail' : 'Home,Work,E-Mail'"
The character to use when joining multi-valued fields. The default is ' & '.
Any of these options can be specified in the constructor, or in the configuration file.
$a = AddressBook->new(source => "PDB"); $a = AddressBook->new(source => "PDB", port => "/dev/pilot");
If a "pdb" parameter is supplied, it will be used as a reference to an already created PDA::Pilot::DLP::DBPtr object. Otherwise, if a "port" is supplied, the user will be prompted to press the hotsync button to establish the connection.
For syncronization purposes, all records which have the "modified" flag set are timestamped with the current time. All records with have the "modified" flag unset are timestamped with "0" (very, very old).
PDB records which have the "deleted" flag set are removed as part of the initialization process. The "archive" flag is ignored.
For convienience, a record's category is treated like any other attribute. New categories are created as necessary. Moving a record to a new category will achieve the expected result during synchronization. However, because renaming a category does not cause affected records to be marked as "modified", category renaming operations will be lost during synchronization.
David L. Leigh, <firstname.lastname@example.org>