34 |
|
my $class=shift; |
35 |
|
my $self={}; |
36 |
|
bless $self, $class; |
37 |
– |
$self->{cache}=shift; |
37 |
|
$self->{dbstore}=shift; |
39 |
– |
$self->{switch}=ActiveDoc::ActiveDoc-> |
40 |
– |
new($self->{cache},$self->{dbstore}); |
41 |
– |
$self->init(); |
38 |
|
bless $self, $class; |
39 |
|
return $self; |
40 |
|
} |
41 |
|
|
42 |
+ |
sub cache { |
43 |
+ |
my $self=shift; |
44 |
+ |
if ( @_ ) { |
45 |
+ |
$self->{cache}=shift; |
46 |
+ |
$self->init(); |
47 |
+ |
} |
48 |
+ |
return $self->{cache}; |
49 |
+ |
} |
50 |
+ |
|
51 |
|
sub init { |
52 |
|
my $self=shift; |
53 |
|
$self->{lastsequence}=-1; |
54 |
+ |
$self->{switch}=ActiveDoc::ActiveDoc-> |
55 |
+ |
new($self->{cache},$self->{dbstore}); |
56 |
|
# -- Specific Tags |
57 |
|
$self->{switch}->newparse("include"); |
58 |
|
$self->{switch}->addbasetags("include"); |
197 |
|
|
198 |
|
# -- get all include objects to store themselves |
199 |
|
print $fh $self->{lastsequence}."\n"; |
200 |
+ |
print $fh ref($self->cache()).":::".$self->cache()->location()."\n"; |
201 |
|
print $fh ($self->url()?$self->url():""); |
202 |
|
print $fh "\n"; |
203 |
|
foreach $inc ( @{$self->{includesdesc}} ) { |
215 |
|
|
216 |
|
$self->{lastsequence}=<$fh>; |
217 |
|
chomp $self->{lastsequence}; |
218 |
+ |
# -- recreate the cache |
219 |
+ |
my $cacheinfo=<$fh>; |
220 |
+ |
chomp $cacheinfo; |
221 |
+ |
my ($type,$location)=split /:::/, $cacheinfo; |
222 |
+ |
my $cache=$type->new($location); |
223 |
+ |
$self->cache($cache); |
224 |
+ |
|
225 |
|
my $url=<$fh>; |
226 |
|
chomp $url; |
227 |
|
$self->url($url); |