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 |
|
|
241 |
|
|
242 |
=head1 TODO |
=head1 TODO |
243 |
|
|
244 |
|
o interface with Jeff Zucker's AnyData:: modules, e.g. AnyData::Storage::RAM |
245 |
|
o what about DBD::RAM? (DBD::RAM - a DBI driver for files and data structures) |
246 |
|
o use DBD::Proxy! |
247 |
|
o what about DBIx::AnyDBD? |
248 |
|
o enhance schema information: |
249 |
|
- DBIx::SystemCatalog |
250 |
|
- DBIx::SystemCatalog::MSSQL? |
251 |
|
- Data::Reporter |
252 |
|
|
253 |
|
|
254 |
=head2 BUGS |
=head2 BUGS |
255 |
|
|