--- nfo/perl/libs/Data/Transfer/Sync/Core.pm 2003/02/14 14:03:49 1.6 +++ nfo/perl/libs/Data/Transfer/Sync/Core.pm 2003/05/13 08:17:52 1.9 @@ -1,11 +1,23 @@ -## $Id: Core.pm,v 1.6 2003/02/14 14:03:49 joko Exp $ +## ------------------------------------------------------------------------- +## +## $Id: Core.pm,v 1.9 2003/05/13 08:17:52 joko Exp $ ## ## Copyright (c) 2002 Andreas Motl ## ## See COPYRIGHT section in pod text below for usage and distribution rights. ## -## ---------------------------------------------------------------------------------------- +## ------------------------------------------------------------------------- ## $Log: Core.pm,v $ +## Revision 1.9 2003/05/13 08:17:52 joko +## buildAttributeMap now propagates error +## +## Revision 1.8 2003/03/27 15:31:15 joko +## fixes to modules regarding new namespace(s) below Data::Mungle::* +## +## Revision 1.7 2003/02/21 08:01:11 joko +## debugging, logging +## renamed module +## ## Revision 1.6 2003/02/14 14:03:49 joko ## + logging, debugging ## - refactored code to sister module @@ -59,7 +71,7 @@ ## + minor cosmetics for logging ## ## Revision 1.2 2002/12/01 04:43:25 joko -## + mapping deatil entries may now be either an ARRAY or a HASH +## + mapping detail entries may now be either an ARRAY or a HASH ## + erase flag is used now (for export-operations) ## + expressions to refer to values inside deep nested structures ## - removed old mappingV2-code @@ -71,7 +83,7 @@ ## ## Revision 1.1 2002/10/10 03:44:21 cvsjoko ## + new -## ---------------------------------------------------------------------------------------- +## ------------------------------------------------------------------------- package Data::Transfer::Sync::Core; @@ -86,11 +98,12 @@ use Data::Dumper; -use misc::HashExt; -use Data::Compare::Struct qw( getDifference isEmpty ); +#use misc::HashExt; +use Hash::Serializer; +use Data::Mungle::Compare::Struct qw( getDifference isEmpty ); use Data::Storage::Container; use DesignPattern::Object; -use libdb qw( quotesql ); +use shortcuts::database qw( quotesql ); # get logger instance my $logger = Log::Dispatch::Config->instance; @@ -152,7 +165,7 @@ $logger->debug( __PACKAGE__ . "->_run" ); # for statistics - my $tc = OneLineDumpHash->new( {} ); + my $tc = Hash::Serializer->new( {} ); my $results; # set of objects is already in $self->{args} @@ -334,7 +347,6 @@ $tc->{skip}++; print "s" if $self->{verbose}; next; - } # first reaction on entry-status: continue with next entry if the current is already "in sync" @@ -344,8 +356,12 @@ } # build map to actually transfer the data from source to target - $self->buildAttributeMap(); - + if (!$self->buildAttributeMap()) { + #$logger->warning( __PACKAGE__ . "->_run: Attribute Map could not be created. Will not insert or modify node."); + $tc->{skip}++; + print "e" if $self->{verbose}; + next; + } # trace #print Dumper($self->{node}); exit; @@ -424,7 +440,8 @@ # todo!!! #sysevent( { usermsg => $msg, level => $level }, $taskEvent ); - $logger->info( __PACKAGE__ . "->_run: $msg" ); + #$logger->info( __PACKAGE__ . "->_run: $msg" ); + $logger->info($msg . "\n"); return $tc; @@ -585,7 +602,7 @@ $i++; } - print "\n" if $self->{verbose}; + #print "\n" if $self->{verbose}; if (!$i) { $logger->warning( __PACKAGE__ . "->_prepareNode_DummyIdent: no nodes touched" );