BBDB::Export - export data from The Insidious Big Brother Database.
version 0.015
use BBDB::Export; # export to LDIF my $exporter = BBDB::Export::LDIF->new( { bbdb_file => "/path/to/.bbdb", output_file => "export.ldif", dc => "dc=geekfarm, dc=org", } ); $exporter->export(); # sync with ldap via ldapadd and ldapdelete my $exporter = BBDB::Export::LDAP->new( { bbdb_file => "/path/to/.bbdb", output_file => "/tmp/tempfile", dc => "dc=geekfarm, dc=org", ldappass => "supersecret", } ); $exporter->export(); # export to vcards my $exporter = BBDB::Export::vCard->new( { bbdb_file => "/path/to/.bbdb", output_dir => "/some/path/", } ); $exporter->export(); # create .mail_aliases my $exporter = BBDB::Export::MailAliases->new( { bbdb_file => "/path/to/.bbdb", output_file => ".mail_aliases", } ); $exporter->export();
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. Current export options include building an LDIF, vCard, or .mail_aliases, and automatically updating an ldap server.
For a fully functional command line converter, see the bbdb-export script that comes with this module.
BBDB::Export should not be used directly. Use any of the available subclasses using the examples above. For more examples of using BBDB::Export, see the test cases.
When writing a new class, you can define the following subroutines:
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 );
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.
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.
run an external command, e.g. ldapadd
report informational messages to the user.
report error messages to the user.
report debugging info to user. this information will only be displayed if verbose output is enabled.
- 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.
wu <VVu@geekfarm.org>
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.
To install BBDB::Export, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BBDB::Export
CPAN shell
perl -MCPAN -e shell install BBDB::Export
For more information on module installation, please visit the detailed CPAN module installation guide.