--- nfo/perl/scripts/outlook2ldap/bin/feed.pl 2003/01/18 18:20:45 1.1 +++ nfo/perl/scripts/outlook2ldap/bin/feed.pl 2003/01/20 16:29:48 1.3 @@ -1,9 +1,19 @@ #!/usr/bin/perl ## -------------------------------------------------------------------------------- -## $Id: feed.pl,v 1.1 2003/01/18 18:20:45 joko Exp $ +## $Id: feed.pl,v 1.3 2003/01/20 16:29:48 joko Exp $ ## -------------------------------------------------------------------------------- ## $Log: feed.pl,v $ +## Revision 1.3 2003/01/20 16:29:48 joko +## + new mechanism to pass configuration-metadata to Torus: +## > process => Torus->new( +## > config_metadata => { file => '../etc/syncOutlookContacts.ini' }, +## > ) +## and stuff .... +## +## Revision 1.2 2003/01/19 03:34:59 joko +## + new command-line-arguments +## ## Revision 1.1 2003/01/18 18:20:45 joko ## + initial check-in ## @@ -20,6 +30,8 @@ #require "$Bin/use_libs.pl"; } +use Tie::IxHash; + use lib qw( ../libs ../etc C:\home\amo\develop\netfrag.org\nfo\perl\libs ); use Torus::Logger; @@ -43,9 +55,12 @@ my $bizWorks; $context->set( app => $bizWorks, - process => Torus::Core->new(), + process => Torus->new( + config_metadata => { file => '../etc/syncOutlookContacts.ini' }, + ), logger => $logger, - config => { mappings => { 'LdapAddress' => 'xyz' } }, + #config => { mappings => { 'LdapAddress' => 'xyz' } }, + ); #print Dumper($context); #print Dumper($context->{process}->{bizWorks}->{backend}); @@ -109,10 +124,12 @@ GetOptions( 'source=s' => \$self->{opt}->{source}, - 'node=s' => \$self->{opt}->{node}, + 'source-type=s' => \$self->{opt}->{'source-type'}, + 'source-node=s' => \$self->{opt}->{'source-node'}, 'target=s' => \$self->{opt}->{target}, + 'target-node=s' => \$self->{opt}->{'target-node'}, 'action=s' => \$self->{opt}->{action}, - 'mapping=s' => \$self->{opt}->{mapping}, + 'mapping-module=s' => \$self->{opt}->{'mapping-module'}, 'prepare' => \$self->{opt}->{prepare}, 'fresh' => \$self->{opt}->{fresh}, 'help' => \&usage, @@ -177,16 +194,40 @@ $erase = 1; #$import = 1; } - $self->{process}->startSync({ - source => $self->{opt}->{source}, - source_node => $self->{opt}->{node}, - target => $self->{opt}->{target}, - mode => $mode, - erase => $erase, - import => $import, - mapping => $self->{opt}->{mapping}, - prepare => $self->{opt}->{prepare}, - }); + + +#print Dumper($self->{opt}); +#exit; + + my %syncConfig; + tie %syncConfig, 'Tie::IxHash'; + %syncConfig = ( + map => { + moduleName => $self->{opt}->{'mapping-module'}, + }, + source => { + dbKey => $self->{opt}->{source}, + nodeType => $self->{opt}->{'source-type'}, + nodeName => $self->{opt}->{'source-node'}, + }, + target => { + dbKey => $self->{opt}->{target}, + nodeName => $self->{opt}->{'target-node'}, + }, + process => { + mode => $mode, + erase => $erase, + import => $import, + prepare => $self->{opt}->{prepare}, + }, + metadata => { + config => $self->{config_metadata}, + } + ); + +#print Dumper(\%syncConfig); + + $self->{process}->startSync( \%syncConfig ); =pod } else {