NAME
BBDB::Export - Modular perl library to export data from emacs big brother database.
SYNOPSIS
use BBDB::Export;
# Export classes include LDAP, LDIF, and MailAliases
my $exporter = BBDB::Export->new(
"BBDB::Export::InsertSubClassNameHere"
{
bbdb_file => "t/cases/$case.bbdb",
output_file => "/Users/wu/.mail_aliases",
}
);
# running export() causes the output_file to be generated
my ( $aliases_got ) = $exporter->export();
DESCRIPTION
This module was designed to export to your bbdb data to a wide array of formats, and also to make it easy to write new modules to export to new formats.
BBDB::Export should not be used directly. Use any of the available subclasses using the example above. See documentation in the subclasses for additional options that should or can be set.
For a fully functional command line converter, see the bbdb-export script that comes with this module.
For more examples of using BBDB::Export, see the test cases.
EXTENDING
When writing a new class, you can define the following subroutines:
- get_record_hash
-
given a record hash, create or modify any keys and values that are needed to export your data. If the fields already provided are sufficient, you don't need to define this method. If you do define this method, you'll need to call this method from the superclass first, e.g.
my ( $self, $record ) = @_; $record = $self->SUPER::get_record_hash( $record );
- process_record
-
given a record hash, generate exported data. Also perform any per-record actions. For example, if you are creating one export file per record, write the current record to a file in this method.
- post_processing
-
run any processing that needs to be done after all records have been processed. For example, if you are creating one file containing all records, write the file in this method.
SEE ALSO
- bbdb - an emacs mode for managing information about contacts
- BBDB - perl module for parsing bbdb data files.
- OpenLDAP - open source ldap implementation
- http://www.onlamp.com/pub/a/onlamp/2003/03/27/ldap_ab.html - how to set up ldap.
- http://www.geekfarm.org - bbdb2ldap.
- PlannerMode - also on geekfarm. A module for exporting emacs todo lists and schedule info to other clients including palm.
AUTHOR
wu <VVu@geekfarm.org>
COPYRIGHT AND LICENSE
Copyright (c) 2005, VVu@geekfarm.org All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the geekfarm.org nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *