25 |
|
use ActiveDoc::SimpleDoc; |
26 |
|
use URL::URLhandler; |
27 |
|
require 5.001; |
28 |
+ |
@ISA=qw(ActiveDoc::SimpleDoc); |
29 |
|
|
30 |
|
sub new { |
31 |
|
my $class=shift; |
32 |
|
my $self={}; |
33 |
|
bless $self, $class; |
34 |
|
$self->cache(shift); |
35 |
< |
$self->{switch}=ActiveDoc::SimpleDoc->new(@_); |
35 |
> |
$self->_initdoc("doc",@_); |
36 |
> |
#$self->{switch}=ActiveDoc::SimpleDoc->new(@_); |
37 |
|
return $self; |
38 |
|
} |
39 |
|
|
41 |
|
my $self=shift; |
42 |
|
my $parse=shift; |
43 |
|
|
44 |
< |
$self->{switch}->addtag($parse,"base", \&Base_start, $self, |
44 |
> |
$self->addtag($parse,"base", \&Base_start, $self, |
45 |
|
"", $self, |
46 |
|
\&Base_end,$self); |
47 |
|
} |
68 |
|
|
69 |
|
($fullurl,$filename)=$self->{urlhandler}->download($urlstring, @_); |
70 |
|
if ( ( ! defined $filename ) || ( $filename eq "" ) ) { |
71 |
< |
$self->{switch}->parseerror("Failed to get $fullurl"); |
71 |
> |
$self->parseerror("Failed to get $fullurl"); |
72 |
|
} |
73 |
|
return ($fullurl,$filename); |
74 |
|
} |
79 |
|
|
80 |
|
($fullurl,$filename)=$self->{urlhandler}->get($urlstring, @_); |
81 |
|
if ( ( ! defined $filename ) || ( $filename eq "" ) ) { |
82 |
< |
$self->{switch}->parseerror("Failed to get $fullurl"); |
82 |
> |
$self->parseerror("Failed to get $fullurl"); |
83 |
|
} |
84 |
|
return ($fullurl,$filename); |
85 |
|
} |
86 |
|
|
87 |
< |
sub AUTOLOAD { |
88 |
< |
my $self=shift; |
89 |
< |
|
87 |
> |
#sub AUTOLOAD { |
88 |
> |
# my $self=shift; |
89 |
> |
# |
90 |
|
# dont propogate destroy methods |
91 |
< |
return if $AUTOLOAD=~/::DESTROY/; |
91 |
> |
# return if $AUTOLOAD=~/::DESTROY/; |
92 |
|
|
93 |
|
# remove this package name |
94 |
< |
($name=$AUTOLOAD)=~s/ActiveDoc::SimpleURLDoc:://; |
94 |
> |
# ($name=$AUTOLOAD)=~s/ActiveDoc::SimpleURLDoc:://; |
95 |
|
|
96 |
|
# pass the message to SimpleDoc |
97 |
< |
$self->{switch}->$name(@_); |
98 |
< |
} |
97 |
> |
# $self->{switch}->$name(@_); |
98 |
> |
#} |
99 |
|
|
100 |
|
# ------------------------ Support Routines --------------------------- |
101 |
|
|
106 |
|
my $name=shift; |
107 |
|
my $hashref=shift; |
108 |
|
|
109 |
< |
$self->{switch}->checktag($name, $hashref, "url"); |
109 |
> |
$self->checktag($name, $hashref, "url"); |
110 |
|
my $url=$self->{urlhandler}->setbase($$hashref{'url'}); |
111 |
|
push @{$self->{basestack}}, $url->type(); |
112 |
|
} |
118 |
|
$self->{urlhandler}->unsetbase($type); |
119 |
|
} |
120 |
|
else { |
121 |
< |
$self->{switch}->parseerror("Unmatched <$name>"); |
121 |
> |
$self->parseerror("Unmatched <$name>"); |
122 |
|
} |
123 |
|
} |