| 6 |
Data::Storage - Interface for accessing various Storage implementations for Perl in an independent way |
Data::Storage - Interface for accessing various Storage implementations for Perl in an independent way |
| 7 |
|
|
| 8 |
|
|
| 9 |
=head1 AIMS |
=head1 ABSTRACT ;-) |
| 10 |
|
|
| 11 |
|
Data Storage |
| 12 |
|
|
| 13 |
|
"Where is the wisdom? Lost in the knowledge. |
| 14 |
|
Where is the knowledge? Lost in the information." |
| 15 |
|
- T.S. Eliot |
| 16 |
|
|
| 17 |
|
"Where is the information? Lost in the data. |
| 18 |
|
Where is the data? Lost in the #@$%?!& database." |
| 19 |
|
- Joe Celko |
| 20 |
|
|
| 21 |
|
|
| 22 |
|
from: MacPerl: Power and Ease - Chapter 15 |
| 23 |
|
url: http://www.macperl.com/ptf_book/r/MP/330.Data_Storage.html |
| 24 |
|
|
| 25 |
|
|
| 26 |
|
=head1 INTENTIONS |
| 27 |
|
|
| 28 |
- should encapsulate Tangram, DBI, DBD::CSV and LWP:: to access them in an unordinary (more convenient) way ;) |
- should encapsulate Tangram, DBI, DBD::CSV and LWP:: to access them in an unordinary (more convenient) way ;) |
| 29 |
- introduce a generic layered structure, refactor *SUBLAYER*-stuff, make (e.g.) this possible: |
- introduce a generic layered structure, refactor *SUBLAYER*-stuff, make (e.g.) this possible: |
| 30 |
Perl Data::Storage[DBD::CSV] -> Perl LWP:: -> Internet HTTP/FTP/* -> Host Daemon -> csv-file |
Perl Data::Storage[DBD::CSV] -> Perl LWP:: -> Internet HTTP/FTP/* -> Host Daemon -> csv-file |
| 31 |
- provide generic synchronization mechanisms across arbitrary/multiple storages based on ident/checksum |
- provide generic synchronization mechanisms across arbitrary/multiple storages based on ident/checksum |
| 32 |
maybe it's possible to have schema-, structural- and semantical modifications synchronized??? |
maybe it's possible to have schema-, structural- and semantical modifications synchronized??? |
| 33 |
|
- might be similar to http://sourceforge.net/projects/perl-repository |
| 34 |
|
|
| 35 |
|
|
| 36 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
| 37 |
|
|
| 38 |
=head2 BASIC ACCESS |
=head2 ACCESS |
| 39 |
|
|
| 40 |
=head2 ADVANCED ACCESS |
# connect to LDAP |
| 41 |
|
my $ldapLocator = Data::Storage::Locator->new( |
| 42 |
... via inheritance: |
ldap => { |
| 43 |
|
type => "NetLDAP", |
| 44 |
use Data::Storage; |
dsn => "ldap:host=192.168.10.150;binddn='cn=root, o=netfrag.org, c=de';pass=secret", |
| 45 |
my $proxyObj = new HttpProxy; |
basedn => "o=netfrag.org, c=de", |
| 46 |
$proxyObj->{url} = $url; |
want_transactions => 0, |
| 47 |
$proxyObj->{payload} = $content; |
syncable => 1, |
| 48 |
$self->{storage}->insert($proxyObj); |
}, |
| 49 |
|
); |
| 50 |
use Data::Storage; |
my $ldapStorage = Data::Storage->new($ldapLocator); |
| 51 |
my $proxyObj = HttpProxy->new( |
$ldapStorage->connect(); |
| 52 |
url => $url, |
|
| 53 |
payload => $content, |
# connect to MAPI |
| 54 |
); |
my $mapiLocator = Data::Storage::Locator->new( |
| 55 |
$self->{storage}->insert($proxyObj); |
outlook => { |
| 56 |
|
type => "MAPI", |
| 57 |
|
showProfileChooser => $self->{config}->get("mapi_showProfileChooser"), |
| 58 |
|
ProfileName => $self->{config}->get("mapi_ProfileName"), |
| 59 |
|
ProfilePass => $self->{config}->get("mapi_ProfilePass"), |
| 60 |
|
syncable => 1, |
| 61 |
|
}, |
| 62 |
|
); |
| 63 |
|
my $mapiStorage = Data::Storage->new($mapiLocator); |
| 64 |
|
$mapiStorage->connect(); |
| 65 |
|
|
| 66 |
|
|
| 67 |
=head2 SYNCHRONIZATION |
=head2 SYNCHRONIZATION |
| 68 |
|
|
| 69 |
|
This functionality is (in the meanwhile) provided by the Data::Transfer::Sync module. |
| 70 |
|
|
| 71 |
|
=head3 proposal V1 |
| 72 |
|
|
| 73 |
my $nodemapping = { |
my $nodemapping = { |
| 74 |
'LangText' => 'langtexts.csv', |
'LangText' => 'langtexts.csv', |
| 75 |
'Currency' => 'currencies.csv', |
'Currency' => 'currencies.csv', |
| 121 |
# create new sync object |
# create new sync object |
| 122 |
my $sync = Data::Transfer::Sync->new( |
my $sync = Data::Transfer::Sync->new( |
| 123 |
storages => { |
storages => { |
| 124 |
L => $self->{bizWorks}->{backend}, |
L => $self->{storage}->{backend}, |
| 125 |
R => $self->{bizWorks}->{resources}, |
R => $self->{storage}->{resources}, |
| 126 |
}, |
}, |
| 127 |
id_authorities => [qw( L ) ], |
id_authorities => [qw( L ) ], |
| 128 |
checksum_authorities => [qw( L ) ], |
checksum_authorities => [qw( L ) ], |
| 145 |
|
|
| 146 |
} |
} |
| 147 |
|
|
| 148 |
|
=head3 proposal V2 |
| 149 |
|
|
| 150 |
|
# create a new synchronization object |
| 151 |
|
my $sync = Data::Transfer::Sync->new( 'sync_version' => $sync_version, __parent => $self ); |
| 152 |
|
|
| 153 |
|
# configure the synchronization-object |
| 154 |
|
$sync->configure( |
| 155 |
|
source => { |
| 156 |
|
storage => { |
| 157 |
|
handle => $mapiStorage, |
| 158 |
|
#isIdentAuthority => 1, |
| 159 |
|
#isChecksumAuthority => 1, |
| 160 |
|
#writeProtected => 1, |
| 161 |
|
}, |
| 162 |
|
}, |
| 163 |
|
target => { |
| 164 |
|
storage => { |
| 165 |
|
handle => $ldapStorage, |
| 166 |
|
#idAuthority => 1, |
| 167 |
|
#isChecksumAuthority => 1, |
| 168 |
|
#isWriteProtected => 0, |
| 169 |
|
}, |
| 170 |
|
}, |
| 171 |
|
verbose => 1, |
| 172 |
|
); |
| 173 |
|
|
| 174 |
|
|
| 175 |
=head2 NOTE |
=head2 NOTE |
| 176 |
|
|
| 221 |
|
|
| 222 |
=head1 AUTHORS / COPYRIGHT |
=head1 AUTHORS / COPYRIGHT |
| 223 |
|
|
| 224 |
The Data::Storage module is Copyright (c) 2002 Andreas Motl. |
The Data::Storage module is Copyright (c) 2002-2004 Andreas Motl. |
| 225 |
All rights reserved. |
All rights reserved. |
| 226 |
|
Mail to <andreas.motl (at) ilo.de> for improvements and suggestions. |
| 227 |
|
|
| 228 |
You may distribute it under the terms of either the GNU General Public |
You may distribute it under the terms of either the GNU General Public |
| 229 |
License or the Artistic License, as specified in the Perl README file. |
License or the Artistic License, as specified in the Perl README file. |
| 230 |
|
|
| 231 |
|
=head1 CONTRIBUTORS |
| 232 |
|
|
| 233 |
|
Sebastian Utz <su (at) rotamente.com> |
| 234 |
|
|
| 235 |
=head1 ACKNOWLEDGEMENTS |
=head1 ACKNOWLEDGEMENTS |
| 236 |
|
|
| 237 |
Larry Wall for Perl, Tim Bunce for DBI, Jean-Louis Leroy for Tangram and Set::Object, |
Larry Wall for Perl, Tim Bunce for DBI, Jean-Louis Leroy for Tangram and Set::Object, |
| 238 |
Sam Vilain for Class::Tangram, Jochen Wiedmann and Jeff Zucker for DBD::CSV & Co., |
Sam Vilain for Class::Tangram, Jochen Wiedmann and Jeff Zucker for DBD::CSV & Co., |
| 239 |
Adam Spiers for MySQL::Diff and all contributors. |
Adam Spiers for MySQL::Diff and all contributors. |
| 240 |
|
|
|
|
|
| 241 |
=head1 SUPPORT / WARRANTY |
=head1 SUPPORT / WARRANTY |
| 242 |
|
|
| 243 |
Data::Storage is free software. IT COMES WITHOUT WARRANTY OF ANY KIND. |
Data::Storage is free software. IT COMES WITHOUT WARRANTY OF ANY KIND. |
| 245 |
|
|
| 246 |
=head1 TODO |
=head1 TODO |
| 247 |
|
|
| 248 |
|
o interface with Jeff Zucker's AnyData:: modules, e.g. AnyData::Storage::RAM |
| 249 |
|
o what about DBD::RAM? (DBD::RAM - a DBI driver for files and data structures) |
| 250 |
|
o use DBD::Proxy! |
| 251 |
|
o what about DBIx::AnyDBD? |
| 252 |
|
o enhance schema information: |
| 253 |
|
- DBIx::SystemCatalog |
| 254 |
|
- DBIx::SystemCatalog::MSSQL? |
| 255 |
|
- Data::Reporter |
| 256 |
|
|
| 257 |
|
|
| 258 |
=head2 BUGS |
=head2 BUGS |
| 259 |
|
|