/[cvs]/nfo/perl/libs/Data/Transfer/Sync/Core.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Transfer/Sync/Core.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by joko, Wed Jun 25 23:03:57 2003 UTC revision 1.11 by jonen, Tue May 11 20:03:48 2004 UTC
# Line 8  Line 8 
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  ##    Revision 1.10  2003/06/25 23:03:57  joko
15  ##    no debugging  ##    no debugging
16  ##  ##
# Line 104  use Data::Dumper; Line 107  use Data::Dumper;
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 );
# Line 185  sub _run { Line 189  sub _run {
189    # get reference to node list from convenient method provided by CORE-HANDLE    # get reference to node list from convenient method provided by CORE-HANDLE
190    $results ||= $self->_getNodeList('source');    $results ||= $self->_getNodeList('source');
191    
   #print Dumper($results);  
   
192    # checkpoint: do we actually have a list to iterate through?    # checkpoint: do we actually have a list to iterate through?
193    if (!$results || !@{$results}) {    if (!$results || !@{$results}) {
194      $logger->notice( __PACKAGE__ . "->_run: No nodes to synchronize." );      $logger->notice( __PACKAGE__ . "->_run: No nodes to synchronize." );
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}) {
# Line 204  sub _run { Line 207  sub _run {
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";
# Line 221  sub _run { Line 227  sub _run {
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    
# Line 242  sub _run { Line 249  sub _run {
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    
# Line 360  sub _run { Line 369  sub _run {
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      }      }
# Line 430  sub _run { Line 443  sub _run {
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};

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed