24 |
|
# basequery([ActiveConfig]) : Set up/return UserQuery for the doc |
25 |
|
# copydocconfig(ActiveDoc) : Copy the basic configuration from the ActiveDoc |
26 |
|
# copydocquery(ActiveDoc) : Copy the basicquery from the ActiveDoc |
27 |
+ |
# userinterface() : Return the defaullt userinterface |
28 |
+ |
# options(var) : return the value of the option var |
29 |
|
# |
30 |
|
# -- error methods -- |
31 |
|
# error(string) : Report an general error to the user |
38 |
|
use ActiveDoc::Parse; |
39 |
|
use ActiveDoc::ActiveConfig; |
40 |
|
use ActiveDoc::PreProcessedFile; |
41 |
< |
use ObjectUtilities::ObjectBase; |
41 |
> |
use ObjectUtilities::StorableObject; |
42 |
|
use URL::URLhandler; |
43 |
|
|
44 |
< |
@ISA = qw(ObjectUtilities::ObjectBase); |
44 |
> |
@ISA = qw(ObjectUtilities::StorableObject); |
45 |
|
|
46 |
|
sub new { |
47 |
|
my $class=shift; |
52 |
|
# A URL handler per document |
53 |
|
$self->{urlhandler}=URL::URLhandler->new($self->config()->cache()); |
54 |
|
|
55 |
+ |
# A default UserInterface |
56 |
+ |
$self->{userinterface}=ActiveDoc::UserInterface_basic->new(); |
57 |
|
$self->init(@_); |
58 |
|
return $self; |
59 |
|
} |
132 |
|
|
133 |
|
sub basequery { |
134 |
|
my $self=shift; |
135 |
< |
@_ ? $self->{UserQuery}=shift |
136 |
< |
: $self->{UserQuery}; |
135 |
> |
@_ ? $self->{Query}=shift |
136 |
> |
: $self->{Query}; |
137 |
> |
} |
138 |
> |
|
139 |
> |
sub options { |
140 |
> |
my $self=shift; |
141 |
> |
my $param=shift; |
142 |
> |
$self->basequery()->getparam('option_'.$param); |
143 |
|
} |
144 |
|
|
145 |
|
sub getfile() { |
176 |
|
my $fileob=$self->getfile($url); |
177 |
|
|
178 |
|
# now parse it for the <DocType> tag |
179 |
+ |
$self->{doctypefound}=0; |
180 |
|
$self->newparse("doctype"); |
181 |
|
$self->addtag("doctype","Doc", \&Doc_Start, $self, |
182 |
|
"", $self, "", $self); |
188 |
|
} |
189 |
|
# Set up a new object of the specified type |
190 |
|
my $newobj=$self->{docobject}->new($self->config()); |
191 |
+ |
$newobj->url($url); |
192 |
|
return $newobj; |
193 |
|
} |
194 |
|
|
218 |
|
my $hashref=shift; |
219 |
|
my $param=shift; |
220 |
|
|
209 |
– |
print keys %$hashref; |
210 |
– |
print "-----------------------------------\n"; |
221 |
|
if ( ! exists $$hashref{$param} ) { |
222 |
|
$self->parseerror("Incomplete Tag <$tagname> : $param required"); |
223 |
|
} |
291 |
|
my $hashref=shift; |
292 |
|
|
293 |
|
$self->checktag($name, $hashref, "type"); |
294 |
< |
$self->{docobject}=$$hashref{'type'}; |
294 |
> |
$self->{doctypefound}++; |
295 |
> |
if ( $self->{doctypefound} == 1 ) { # only take first doctype |
296 |
> |
$self->{docobject}=$$hashref{'type'}; |
297 |
> |
} |
298 |
> |
} |
299 |
> |
|
300 |
> |
sub userinterface { |
301 |
> |
my $self=shift; |
302 |
> |
@_?$self->{userinterface}=shift |
303 |
> |
:$self->{userinterface} |
304 |
|
} |