AddressBook
view release on metacpan or search on metacpan
0.12 12/27/2000
- Major changes to HTML backend
- added AddressBook::Entry->fill and AddressBook::Entry->chop methods
- added AddressBook::Config->getMeta method
- various changes to support multi-valued attributes
- calculated attribute config changes
0.11 12/05/2000
- "databases" section of config file now contains tags named for each
backend.
0.10 12/04/2000
* First publically available release
- Documentation added
- Constructor syntax enhancements
0.05 11/27/2000
examples/ldap-abook.conf view on Meta::CPAN
write_format="Tr(td([$fullname . ($description ? " ($description)" : ''),
table(Tr([map{($attributes{$_}) ? td([$_,$attributes{$_}]) : '' } ('Home','Work','Pager','Mobile') ]))]))"
intra_attr_sep="<br>"
/>
<LDAP
objectclass="abookPerson"
hostname="localhost"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields = "cn"
/>
<PDB
phone_display = "($category eq 'personal') ? 'Home,Work,E-mail' : 'Work,Home,E-mail'"
key_fields = "Name,First name"
port="/dev/pilot"
/>
</databases>
</AddressBook_config>
lib/AddressBook/Config.pm view on Meta::CPAN
calculate="$firstname . ' ' . $lastname">
<db type="LDAP" name="cn" />
<db type="HTML" name="Full Name" />
</field>
</fields>
<databases>
<LDAP objectclass="inetOrgPerson"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields="cn"
/>
</databases>
</AddressBook_config>
This defines three attributes with cannonical names "firstname", "lastname", and
"fullname". These are accessed in the LDAP backend context as "givenname", "sn" and
"cn", and in the HTML backend context as "First Name", "Last Name" and "Full Name"
respectively.
lib/AddressBook/Config.pm view on Meta::CPAN
<db type="ldap_server_2" name="sn" />
</field>
</fields>
<databases>
<ldap_server_1 driver="LDAP"
hostname="server_1"
objectclass="inetOrgPerson"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields="cn"
/>
<ldap_server_2 driver="LDAP"
hostname="server_2"
objectclass="inetOrgPerson"
base="o=abook"
dn_calculate="'cn='.$cn"
username="cn=Manager,o=abook"
password="secret"
key_fields="cn"
/>
</databases>
</AddressBook_config>
See the various backend man pages for information on the <database> configuration
attributes. See also the sample configuration files in the 'examples' directory.
=cut
lib/AddressBook/DB/BBDB.pm view on Meta::CPAN
=item part(name [value])
Called to get or set all or part of a BBDB object. The parts of the
object are:
all first last aka company phone address net notes
any other value in the name argument results in death. Some of these
parts, namely phone, address, net, and notes have an internal
structure and are returned as references to arrays. The others are
returned just as strings. The optional second argument sets the part
of this BBDB object to the value you provided. There is no
consistency checking at this point, so be sure the value you are
setting this to is correct.
my $first = $bbdb->part('first'); # get the value of the first field
$bbdb->part('last','Laxen'); # set the value of the last field
my $everything = $bbdb->part('all'); # get the whole record
=item BBDB::simple(file_name,[array_ref_of_bbdb])
This is a "simple" interface for reading or writing an entire BBDB
file. If called with one argument, it returns a reference to an array of BBDB
objects. Each object contains the data from the file. Thus the
number of BBDB entries equals C<scalar(@$bbdb)> if you use:
$bbdb = BBDB::simple('/home/henry/.bbdb');
If called with two arguments, the first is the filename to create, and
the second is a reference to an array of BBDB objects, such as was
returned in the one argument version. The objects are scanned for
unique user defined fields, which are written out as the 2nd line in
the BBDB file, and then the individual records are written out.
=item decode(string)
Takes a string as written in a BBDB file of a single BBDB record
and decodes it into its PERL representation. Returns undef if
it couldn't decode the record for some reason, otherwise returns
true.
lib/AddressBook/DB/PDB.pm view on Meta::CPAN
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.
=item phone_display
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'
( run in 0.920 second using v1.01-cache-2.11-cpan-39bf76dae61 )