1 |
+ |
|
2 |
+ |
BEGIN |
3 |
+ |
{ |
4 |
+ |
print " ActiveDoc::StarterDoc: I AM used!!","\n"; |
5 |
+ |
}; |
6 |
+ |
|
7 |
|
# |
8 |
|
# StarterDoc.pm - An active Document |
9 |
|
# |
10 |
|
# Originally Written by Christopher Williams |
11 |
|
# |
12 |
|
# Description |
13 |
+ |
# ----------- |
14 |
+ |
# define a base document from which to get default ActiveDoc parameters |
15 |
+ |
# One of these need to be instantiated for each configuration area |
16 |
|
# |
17 |
|
# Interface |
18 |
|
# --------- |
19 |
< |
# new() : A new StarterDoc object |
19 |
> |
# new(ActiveConfig,userinterface,userquery) : A new StarterDoc object |
20 |
|
|
21 |
|
package ActiveDoc::StarterDoc; |
22 |
|
require 5.001; |
38 |
|
|
39 |
|
sub _init { |
40 |
|
my $self=shift; |
41 |
< |
my $userquery=shift; |
41 |
> |
my $config=shift; |
42 |
|
my $userinterface=shift; |
43 |
+ |
my $userquery=shift; |
44 |
|
|
45 |
< |
#-- All comunication with the outside world theorugh userquery object |
45 |
> |
#-- All comunication with the outside world through userquery object |
46 |
|
$self->{Query}=$userquery; |
47 |
|
$self->userinterface($userinterface); |
48 |
|
|
39 |
– |
#-- Minimum requirements check |
40 |
– |
$dir=$self->{Query}->getparam('ActiveConfigdir'); |
41 |
– |
while ( ! defined $dir ) { |
42 |
– |
$self->{Query}->querytype( "ActiveConfigdir", "basic"); |
43 |
– |
$self->{Query}->querymessage("ActiveConfigdir", |
44 |
– |
"No Configuration directory Has Been Specified - Please enter a". |
45 |
– |
"suitable directory to use as workspace"); |
46 |
– |
|
47 |
– |
$self->userinterface()->askuser($self->{Query}); |
48 |
– |
$dir=$self->{Query}->getparam('ActiveConfigdir'); |
49 |
– |
} |
50 |
– |
|
49 |
|
# set up default Configurations |
50 |
< |
$self->{ActiveConfig}=ActiveDoc::ActiveConfig->new($dir); |
50 |
> |
$self->{ActiveConfig}=$config; |
51 |
> |
$self->{ActiveConfig}->basedoc($self); # register as the basedoc |
52 |
> |
$self->_init2();#add a few things all docs should have |
53 |
|
$self->init(); |
54 |
|
} |
55 |
|
|
56 |
|
sub init { |
57 |
|
# dummy to be overriden |
58 |
|
} |
59 |
+ |
|
60 |
+ |
|
61 |
+ |
# |
62 |
+ |
# oveerride the parseerror method so initiating calls dont break due to no url |
63 |
+ |
# |
64 |
+ |
sub parseerror { |
65 |
+ |
my $self=shift; |
66 |
+ |
$self->error(@_); |
67 |
+ |
} |