4 |
## $Id$ |
## $Id$ |
5 |
## -------------------------------------------------------------------------------- |
## -------------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.5 2003/02/22 16:53:42 joko |
8 |
|
## minor update: debugging |
9 |
|
## |
10 |
|
## Revision 1.4 2003/02/20 21:11:15 joko |
11 |
|
## renamed module |
12 |
|
## modified runtime namespace hierarchy |
13 |
|
## |
14 |
## Revision 1.3 2003/02/14 14:18:36 joko |
## Revision 1.3 2003/02/14 14:18:36 joko |
15 |
## + new get-/setter-methods |
## + new get-/setter-methods |
16 |
## |
## |
32 |
#use base 'OEF::Component::Task'; |
#use base 'OEF::Component::Task'; |
33 |
use base qw( |
use base qw( |
34 |
DesignPattern::Object |
DesignPattern::Object |
35 |
DesignPattern::Object::Logger |
DesignPattern::Logger |
36 |
); |
); |
37 |
|
|
38 |
|
|
133 |
$self->_before_run(); |
$self->_before_run(); |
134 |
$self->prepare(); |
$self->prepare(); |
135 |
#$self->tellWhatIAmDoing(); |
#$self->tellWhatIAmDoing(); |
136 |
|
#$self->_tellWhatIWillDo(); |
137 |
$self->sync(); |
$self->sync(); |
138 |
} |
} |
139 |
|
|
140 |
sub prepare { |
sub prepare { |
141 |
my $self = shift; |
my $self = shift; |
142 |
|
|
143 |
|
#print Dumper($self->{opt}); |
144 |
|
#exit; |
145 |
|
|
146 |
# TODO: |
# TODO: |
147 |
# - move this to Data::Transfer::Sync::checkOptions!!! |
# - move this to Data::Transfer::Sync::checkOptions!!! |
148 |
# - use 'syncable'??? |
# - use 'syncable'??? |
183 |
# is api-version specified? |
# is api-version specified? |
184 |
my $sync_version = $self->{opt}->{sv}; |
my $sync_version = $self->{opt}->{sv}; |
185 |
$sync_version ||= 'V1'; |
$sync_version ||= 'V1'; |
186 |
|
#$sync_version = 'V2'; |
187 |
|
|
188 |
|
#print "version: $sync_version", "\n"; |
189 |
|
|
190 |
# create a new synchronization object |
# create a new synchronization object |
191 |
my $sync = Data::Transfer::Sync->new( 'sync_version' => $sync_version, __parent => $self ); |
my $sync = Data::Transfer::Sync->new( 'sync_version' => $sync_version, __parent => $self ); |
194 |
#print Dumper($self); |
#print Dumper($self); |
195 |
#print Dumper($self); |
#print Dumper($self); |
196 |
#exit; |
#exit; |
197 |
|
|
198 |
|
# checks |
199 |
|
if (!$self->{app}->{storage}->{$self->{opt}->{source}}) { |
200 |
|
$logger->critical("Sync source storage handle undefined!"); |
201 |
|
} |
202 |
|
if (!$self->{app}->{storage}->{$self->{opt}->{target}}) { |
203 |
|
$logger->critical("Sync target storage handle undefined!"); |
204 |
|
} |
205 |
|
|
206 |
# configure the synchronization-object |
# configure the synchronization-object |
207 |
$sync->configure( |
$sync->configure( |
208 |
source => { |
source => { |
209 |
storage => { |
storage => { |
210 |
#handle => $mapiStorage, |
#handle => $mapiStorage, |
211 |
handle => $self->{app}->{$self->{opt}->{source}}, |
handle => $self->{app}->{storage}->{$self->{opt}->{source}}, |
212 |
#isIdentAuthority => $self->{app}->{config}->{{$self->{opt}->{source}}, |
#isIdentAuthority => $self->{app}->{config}->{{$self->{opt}->{source}}, |
213 |
#isChecksumAuthority => 1, |
#isChecksumAuthority => 1, |
214 |
#writeProtected => 1, |
#writeProtected => 1, |
217 |
target => { |
target => { |
218 |
storage => { |
storage => { |
219 |
#handle => $ldapStorage, |
#handle => $ldapStorage, |
220 |
handle => $self->{app}->{$self->{opt}->{target}}, |
handle => $self->{app}->{storage}->{$self->{opt}->{target}}, |
221 |
#idAuthority => 1, |
#idAuthority => 1, |
222 |
#isChecksumAuthority => 1, |
#isChecksumAuthority => 1, |
223 |
#isWriteProtected => 0, |
#isWriteProtected => 0, |