8 |
## |
## |
9 |
## ------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
10 |
## $Log$ |
## $Log$ |
11 |
|
## Revision 1.11 2004/05/11 20:03:48 jonen |
12 |
|
## bugfix[joko] related to Attribute Map |
13 |
|
## |
14 |
|
## Revision 1.10 2003/06/25 23:03:57 joko |
15 |
|
## no debugging |
16 |
|
## |
17 |
## Revision 1.9 2003/05/13 08:17:52 joko |
## Revision 1.9 2003/05/13 08:17:52 joko |
18 |
## buildAttributeMap now propagates error |
## buildAttributeMap now propagates error |
19 |
## |
## |
107 |
#use misc::HashExt; |
#use misc::HashExt; |
108 |
use Hash::Serializer; |
use Hash::Serializer; |
109 |
use Data::Mungle::Compare::Struct qw( getDifference isEmpty ); |
use Data::Mungle::Compare::Struct qw( getDifference isEmpty ); |
110 |
|
use Data::Mungle::Transform::Deep qw( deep_copy expand ); |
111 |
use Data::Storage::Container; |
use Data::Storage::Container; |
112 |
use DesignPattern::Object; |
use DesignPattern::Object; |
113 |
use shortcuts::database qw( quotesql ); |
use shortcuts::database qw( quotesql ); |
195 |
return; |
return; |
196 |
} |
} |
197 |
|
|
198 |
|
#print Dumper(@$results); |
199 |
|
#exit; |
200 |
|
|
201 |
# check if we actually *have* a synchronization method |
# check if we actually *have* a synchronization method |
202 |
if (!$self->{options}->{metadata}->{syncMethod}) { |
if (!$self->{options}->{metadata}->{syncMethod}) { |
207 |
|
|
208 |
# dereference |
# dereference |
209 |
my @results = @{$results}; |
my @results = @{$results}; |
210 |
|
#print Dumper(@results); |
211 |
|
|
212 |
# iterate through set |
# iterate through set |
213 |
foreach my $source_node_real (@results) { |
foreach my $source_node_real (@results) { |
214 |
|
|
215 |
print ":" if $self->{verbose}; |
print ":" if $self->{verbose}; |
216 |
|
|
217 |
|
#print Dumper($source_node_real); |
218 |
|
|
219 |
$tc->{total}++; |
$tc->{total}++; |
220 |
|
|
221 |
#print "======================== iter", "\n"; |
#print "======================== iter", "\n"; |
227 |
# - after all, just take care for now that this object doesn't get updated! |
# - after all, just take care for now that this object doesn't get updated! |
228 |
# - so, just use its reference for now - if some cloning is needed in future, do this here! |
# - so, just use its reference for now - if some cloning is needed in future, do this here! |
229 |
my $source_node = $source_node_real; |
my $source_node = $source_node_real; |
230 |
|
#my $source_node = expand($source_node_real); |
231 |
|
|
232 |
# modify entry - handle new style callbacks (the readers) |
# modify entry - handle new style callbacks (the readers) |
233 |
|
|
234 |
# trace |
# trace |
235 |
#print Dumper($source_node); |
#print Dumper($source_node); |
236 |
#exit; |
#exit; |
237 |
|
|
238 |
my $descent = 'source'; |
my $descent = 'source'; |
239 |
|
|
249 |
|
|
250 |
foreach my $node (keys %{$callbacks->{read}}) { |
foreach my $node (keys %{$callbacks->{read}}) { |
251 |
|
|
252 |
|
#print "cb_node: $node", "\n"; |
253 |
|
|
254 |
my $object = $source_node; |
my $object = $source_node; |
255 |
my $value; # = $source_node->{$node}; |
my $value; # = $source_node->{$node}; |
256 |
|
|
369 |
next; |
next; |
370 |
} |
} |
371 |
|
|
372 |
|
#print Dumper($self->{node}->{source}); |
373 |
|
|
374 |
# build map to actually transfer the data from source to target |
# build map to actually transfer the data from source to target |
375 |
if (!$self->buildAttributeMap()) { |
if (!$self->buildAttributeMap()) { |
376 |
#$logger->warning( __PACKAGE__ . "->_run: Attribute Map could not be created. Will not insert or modify node."); |
#$logger->warning( __PACKAGE__ . "->_run: Attribute Map could not be created. Will not insert or modify node."); |
377 |
$tc->{skip}++; |
push( @{$tc->{error_per_row}}, "Attribute Map could not be created. Will not insert or modify node $self->{node}->{source}->{ident}."); |
378 |
|
#push( @{$tc->{error_per_row}}, "Attribute Map could not be created. Will not insert or modify node " . Dumper($self->{node}->{source}) . "."); |
379 |
|
$tc->{error}++; |
380 |
print "e" if $self->{verbose}; |
print "e" if $self->{verbose}; |
381 |
next; |
next; |
382 |
} |
} |
443 |
$self->_doModifySource_IdentChecksum($self->{node}->{target}->{ident}); |
$self->_doModifySource_IdentChecksum($self->{node}->{target}->{ident}); |
444 |
} |
} |
445 |
|
|
446 |
|
#print "UNLOAD", "\n"; |
447 |
|
#$self->{meta}->{source}->{storage}->unload( $self->{node}->{source}->{payload} ); |
448 |
|
|
449 |
} |
} |
450 |
|
|
451 |
print "\n" if $self->{verbose}; |
print "\n" if $self->{verbose}; |