| 6 |
## |
## |
| 7 |
## ---------------------------------------------------------------------------------------- |
## ---------------------------------------------------------------------------------------- |
| 8 |
## $Log$ |
## $Log$ |
| 9 |
|
## Revision 1.10 2002/12/19 01:07:16 joko |
| 10 |
|
## + fixed output done via $logger |
| 11 |
|
## |
| 12 |
|
## Revision 1.9 2002/12/16 07:02:34 jonen |
| 13 |
|
## + added comment |
| 14 |
|
## |
| 15 |
|
## Revision 1.8 2002/12/15 02:03:09 joko |
| 16 |
|
## + fixed logging-messages |
| 17 |
|
## + additional metadata-checks |
| 18 |
|
## |
| 19 |
## Revision 1.7 2002/12/13 21:49:34 joko |
## Revision 1.7 2002/12/13 21:49:34 joko |
| 20 |
## + sub configure |
## + sub configure |
| 21 |
## + sub checkOptions |
## + sub checkOptions |
| 127 |
$opts->{erase} ||= 0; |
$opts->{erase} ||= 0; |
| 128 |
#$opts->{import} ||= 0; |
#$opts->{import} ||= 0; |
| 129 |
|
|
| 130 |
$logger->info( __PACKAGE__ . "->prepareOptions( source_node $opts->{source_node} mode $opts->{mode} erase $opts->{erase} prepare $opts->{prepare} )"); |
$logger->notice( __PACKAGE__ . "->prepareOptions( source_node $opts->{source_node} mode $opts->{mode} erase $opts->{erase} prepare $opts->{prepare} )"); |
| 131 |
|
|
| 132 |
if (!$opts->{mapping} || !$opts->{mapping_module}) { |
if (!$opts->{mapping} || !$opts->{mapping_module}) { |
| 133 |
$logger->warning( __PACKAGE__ . "->prepareOptions: No mapping supplied - please check key 'mappings' in BizWorks/Config.pm"); |
$logger->warning( __PACKAGE__ . "->prepareOptions: No mapping supplied - please check key 'mappings' in BizWorks/Config.pm"); |
| 329 |
|
|
| 330 |
# check partners/nodes: does partner exist / is node available? |
# check partners/nodes: does partner exist / is node available? |
| 331 |
foreach my $partner (keys %{$self->{meta}}) { |
foreach my $partner (keys %{$self->{meta}}) { |
| 332 |
next if $self->{meta}->{$partner}->{storage}->{locator}->{type} eq 'DBI'; # for DBD::CSV - re-enable for others |
|
| 333 |
|
# 1. check partners & storages |
| 334 |
|
if (!$self->{meta}->{$partner}) { |
| 335 |
|
$logger->critical( __PACKAGE__ . "->syncNodes: Could not find partner '$partner' in configuration metadata." ); |
| 336 |
|
return; |
| 337 |
|
} |
| 338 |
|
|
| 339 |
|
my $dbkey = $self->{meta}->{$partner}->{dbkey}; |
| 340 |
|
|
| 341 |
|
if (!$self->{meta}->{$partner}->{storage}) { |
| 342 |
|
$logger->critical( __PACKAGE__ . "->syncNodes: Could not access storage of partner '$partner' (named '$dbkey'), looks like a configuration-error." ); |
| 343 |
|
return; |
| 344 |
|
} |
| 345 |
|
|
| 346 |
|
# TODO: |
| 347 |
|
# 2. check if partners (and nodes?) are actually available.... |
| 348 |
|
# eventually pre-check mode of access-attempt (read/write) here to provide an "early-croak" if possible |
| 349 |
|
|
| 350 |
|
# 3. check nodes |
| 351 |
|
next if $self->{meta}->{$partner}->{storage}->{locator}->{type} eq 'DBI'; # HACK for DBD::CSV - re-enable for others |
| 352 |
|
# get node-name |
| 353 |
my $node = $self->{meta}->{$partner}->{node}; |
my $node = $self->{meta}->{$partner}->{node}; |
| 354 |
if (!$self->{meta}->{$partner}->{storage}->existsChildNode($node)) { |
if (!$self->{meta}->{$partner}->{storage}->existsChildNode($node)) { |
| 355 |
$logger->critical( __PACKAGE__ . "->syncNodes: Could not reach \"$node\" at \"$partner\"." ); |
$logger->critical( __PACKAGE__ . "->syncNodes: Could not reach node \"$node\" at partner \"$partner\"." ); |
| 356 |
return; |
return; |
| 357 |
} |
} |
| 358 |
|
|
| 359 |
} |
} |
| 360 |
|
|
| 361 |
# TODO: |
# TODO: |
| 651 |
} |
} |
| 652 |
|
|
| 653 |
|
|
| 654 |
|
# refactor this as some core-function to do a generic dump resolving data-encapsulations of e.g. Set::Object |
| 655 |
sub _dumpCompact { |
sub _dumpCompact { |
| 656 |
my $self = shift; |
my $self = shift; |
| 657 |
|
|