--- nfo/perl/libs/Data/Storage.pod 2003/01/19 03:13:26 1.1 +++ nfo/perl/libs/Data/Storage.pod 2003/05/13 07:27:56 1.4 @@ -6,39 +6,70 @@ Data::Storage - Interface for accessing various Storage implementations for Perl in an independent way -=head1 AIMS +=head1 ABSTRACT ;-) + + Data Storage + + "Where is the wisdom? Lost in the knowledge. + Where is the knowledge? Lost in the information." + - T.S. Eliot + + "Where is the information? Lost in the data. + Where is the data? Lost in the #@$%?!& database." + - Joe Celko + + + from: MacPerl: Power and Ease - Chapter 15 + url: http://www.macperl.com/ptf_book/r/MP/330.Data_Storage.html + + +=head1 INTENTIONS - should encapsulate Tangram, DBI, DBD::CSV and LWP:: to access them in an unordinary (more convenient) way ;) - introduce a generic layered structure, refactor *SUBLAYER*-stuff, make (e.g.) this possible: Perl Data::Storage[DBD::CSV] -> Perl LWP:: -> Internet HTTP/FTP/* -> Host Daemon -> csv-file - provide generic synchronization mechanisms across arbitrary/multiple storages based on ident/checksum maybe it's possible to have schema-, structural- and semantical modifications synchronized??? - + - might be similar to http://sourceforge.net/projects/perl-repository + =head1 SYNOPSIS -=head2 BASIC ACCESS +=head2 ACCESS -=head2 ADVANCED ACCESS - - ... via inheritance: - - use Data::Storage; - my $proxyObj = new HttpProxy; - $proxyObj->{url} = $url; - $proxyObj->{payload} = $content; - $self->{storage}->insert($proxyObj); - - use Data::Storage; - my $proxyObj = HttpProxy->new( - url => $url, - payload => $content, - ); - $self->{storage}->insert($proxyObj); + # connect to LDAP + my $ldapLocator = Data::Storage::Locator->new( + ldap => { + type => "NetLDAP", + dsn => "ldap:host=192.168.10.150;binddn='cn=root, o=netfrag.org, c=de';pass=secret", + basedn => "o=netfrag.org, c=de", + want_transactions => 0, + syncable => 1, + }, + ); + my $ldapStorage = Data::Storage->new($ldapLocator); + $ldapStorage->connect(); + + # connect to MAPI + my $mapiLocator = Data::Storage::Locator->new( + outlook => { + type => "MAPI", + showProfileChooser => $self->{config}->get("mapi_showProfileChooser"), + ProfileName => $self->{config}->get("mapi_ProfileName"), + ProfilePass => $self->{config}->get("mapi_ProfilePass"), + syncable => 1, + }, + ); + my $mapiStorage = Data::Storage->new($mapiLocator); + $mapiStorage->connect(); =head2 SYNCHRONIZATION + This functionality is (in the meanwhile) provided by the Data::Transfer::Sync module. + +=head3 proposal V1 + my $nodemapping = { 'LangText' => 'langtexts.csv', 'Currency' => 'currencies.csv', @@ -90,8 +121,8 @@ # create new sync object my $sync = Data::Transfer::Sync->new( storages => { - L => $self->{bizWorks}->{backend}, - R => $self->{bizWorks}->{resources}, + L => $self->{storage}->{backend}, + R => $self->{storage}->{resources}, }, id_authorities => [qw( L ) ], checksum_authorities => [qw( L ) ], @@ -114,6 +145,32 @@ } +=head3 proposal V2 + + # create a new synchronization object + my $sync = Data::Transfer::Sync->new( 'sync_version' => $sync_version, __parent => $self ); + + # configure the synchronization-object + $sync->configure( + source => { + storage => { + handle => $mapiStorage, + #isIdentAuthority => 1, + #isChecksumAuthority => 1, + #writeProtected => 1, + }, + }, + target => { + storage => { + handle => $ldapStorage, + #idAuthority => 1, + #isChecksumAuthority => 1, + #isWriteProtected => 0, + }, + }, + verbose => 1, + ); + =head2 NOTE @@ -184,6 +241,15 @@ =head1 TODO + o interface with Jeff Zucker's AnyData:: modules, e.g. AnyData::Storage::RAM + o what about DBD::RAM? (DBD::RAM - a DBI driver for files and data structures) + o use DBD::Proxy! + o what about DBIx::AnyDBD? + o enhance schema information: + - DBIx::SystemCatalog + - DBIx::SystemCatalog::MSSQL? + - Data::Reporter + =head2 BUGS