6 |
## |
## |
7 |
## ---------------------------------------------------------------------------------------- |
## ---------------------------------------------------------------------------------------- |
8 |
## $Log$ |
## $Log$ |
9 |
|
## Revision 1.7 2003/02/21 08:00:24 joko |
10 |
|
## debugging |
11 |
|
## |
12 |
|
## Revision 1.6 2003/02/14 12:58:47 joko |
13 |
|
## + re-enabled the erase-mechanism |
14 |
|
## |
15 |
## Revision 1.5 2003/02/11 05:26:04 joko |
## Revision 1.5 2003/02/11 05:26:04 joko |
16 |
## + sub _tellWhatIWillDo |
## + sub _tellWhatIWillDo |
17 |
## + re-enabled "branch to execution path for special targets" mechanism |
## + re-enabled "branch to execution path for special targets" mechanism |
154 |
my $self = shift; |
my $self = shift; |
155 |
my $args = shift; |
my $args = shift; |
156 |
|
|
157 |
|
#$logger->notice( "========================== " . __PACKAGE__ . "->syncNodes =============="); |
158 |
$logger->debug( __PACKAGE__ . "->syncNodes: starting" ); |
$logger->debug( __PACKAGE__ . "->syncNodes: starting" ); |
159 |
|
|
160 |
#print Dumper($self); |
#print Dumper($self); |
163 |
#print Dumper($self->{options}); |
#print Dumper($self->{options}); |
164 |
$self->_prepareOptions(); |
$self->_prepareOptions(); |
165 |
|
|
166 |
#print Dumper($self->{options}); |
# trace |
167 |
|
#print Dumper($self->{options}); |
168 |
|
#exit; |
169 |
|
|
170 |
if (!$self->checkOptions()) { |
if (!$self->checkOptions()) { |
171 |
$logger->critical( __PACKAGE__ . "->syncNodes: 'Data::Transfer::Sync::checkOptions' failed."); |
$logger->critical( __PACKAGE__ . "->syncNodes: 'Data::Transfer::Sync::checkOptions' failed."); |
188 |
# hash to sum up results |
# hash to sum up results |
189 |
# TODO: re-implement! (sync-statistics???) |
# TODO: re-implement! (sync-statistics???) |
190 |
|
|
191 |
|
#print Dumper($self->{options}->{process}); |
192 |
|
|
193 |
# detect synchronization method to determine which optical symbol (directed arrow) to use |
# detect synchronization method to determine which optical symbol (directed arrow) to use |
194 |
my $mode = $self->{args}->{mode}; # V1 |
my $mode = $self->{args}->{mode}; # V1 |
195 |
$mode ||= $self->{options}->{process}->{mode}; # V2 |
$mode ||= $self->{options}->{process}->{mode}; # V2 |
230 |
#print Dumper($self->{__bridge}); |
#print Dumper($self->{__bridge}); |
231 |
# just take the global application instance and |
# just take the global application instance and |
232 |
# throw it into the context of the mapping module - this is heavy! ;-) (but again, who cares...) |
# throw it into the context of the mapping module - this is heavy! ;-) (but again, who cares...) |
233 |
# TODO: handle this more abstract *sometimes* |
# TODO: handle this more abstract *sometime* |
234 |
#$self->{options}->{handler}->($self->{__bridge}->{parent}->{app}, $self->{options}); |
#$self->{options}->{handler}->($self->{__bridge}->{parent}->{app}, $self->{options}); |
235 |
$self->{options}->{handler}->($self->{__bridge}->{parent}->{process}, $self->{options}); |
$self->{options}->{handler}->($self->{__bridge}->{parent}->{process}, $self->{options}); |
236 |
|
|
245 |
#print Dumper($self); |
#print Dumper($self); |
246 |
#exit; |
#exit; |
247 |
|
|
248 |
$logger->info( __PACKAGE__ . "->syncNodes: source=$self->{meta}->{source}->{dbKey}/$self->{meta}->{source}->{nodeName} [$self->{meta}->{source}->{nodeType}] $direction_arrow target=$self->{meta}->{target}->{dbKey}/$self->{meta}->{target}->{nodeName} [$self->{meta}->{target}->{nodeType}]" ); |
# V1: |
249 |
|
$logger->debug( __PACKAGE__ . "->syncNodes: source=$self->{meta}->{source}->{dbKey}/$self->{meta}->{source}->{nodeName} [$self->{meta}->{source}->{nodeType}] $direction_arrow target=$self->{meta}->{target}->{dbKey}/$self->{meta}->{target}->{nodeName} [$self->{meta}->{target}->{nodeType}]" ); |
250 |
|
|
251 |
|
# V2: |
252 |
|
my $what = "$self->{meta}->{source}->{dbKey}/$self->{meta}->{source}->{nodeName} [$self->{meta}->{source}->{nodeType}] $direction_arrow $self->{meta}->{target}->{dbKey}/$self->{meta}->{target}->{nodeName} [$self->{meta}->{target}->{nodeType}]"; |
253 |
|
#my $header = ("~.." x 7) . " " . $what . " " . ("~.." x 4); |
254 |
|
#my $header = ("= " x 7) . " " . $what . " " . ("= " x 4); |
255 |
|
#my $header = ("~=-_-=" x 3) . " " . $what . " " . ("~=-_-=" x 4); |
256 |
|
my $header = ("_-=~=-" x 4) . " " . $what . " " . ("_-=~=-" x 4); |
257 |
|
$logger->notice($header); |
258 |
|
|
259 |
|
|
260 |
return if !$self->buildFieldmapping(); |
return if !$self->buildFieldmapping(); |
261 |
return if !$self->_touchNodeSet(); |
return if !$self->_touchNodeSet(); |
322 |
EOT |
EOT |
323 |
|
|
324 |
|
|
325 |
$logger->notice( $ql ); |
chomp($ql); |
326 |
|
$logger->info($ql); |
327 |
|
|
328 |
#exit; |
#exit; |
329 |
return; |
return; |
542 |
|
|
543 |
# import flag means: prepare the source node to be syncable |
# import flag means: prepare the source node to be syncable |
544 |
# this is useful if there are e.g. no "ident" or "checksum" columns yet inside a DBI like (row-based) storage |
# this is useful if there are e.g. no "ident" or "checksum" columns yet inside a DBI like (row-based) storage |
545 |
if ($self->{args}->{prepare}) { |
if ($self->{options}->{process}->{prepare}) { |
546 |
$self->_prepareNode_MetaProperties('source'); |
$self->_prepareNode_MetaProperties('source'); |
547 |
$self->_prepareNode_DummyIdent('source'); |
$self->_prepareNode_DummyIdent('source'); |
548 |
#return; |
#return; |
551 |
|
|
552 |
# erase flag means: erase the target |
# erase flag means: erase the target |
553 |
#if ($opts->{erase}) { |
#if ($opts->{erase}) { |
554 |
if ($self->{args}->{erase}) { |
if ($self->{options}->{process}->{erase}) { |
555 |
# TODO: move this method to the scope of the synchronization core and wrap it around different handlers |
# TODO: move this method to the scope of the synchronization core and wrap it around different handlers |
556 |
#print "ERASE", "\n"; |
#print "ERASE", "\n"; |
557 |
$self->_erase_all('target'); |
$self->_erase_all('target'); |