4 |
|
# Originally Written by Christopher Williams |
5 |
|
# |
6 |
|
# Description |
7 |
+ |
# ----------- |
8 |
+ |
# define a base document from which to get default ActiveDoc parameters |
9 |
+ |
# One of these need to be instantiated for each configuration area |
10 |
|
# |
11 |
|
# Interface |
12 |
|
# --------- |
13 |
< |
# new() : A new StarterDoc object |
13 |
> |
# new(ActiveConfig,userinterface,userquery) : A new StarterDoc object |
14 |
|
|
15 |
|
package ActiveDoc::StarterDoc; |
16 |
|
require 5.001; |
32 |
|
|
33 |
|
sub _init { |
34 |
|
my $self=shift; |
35 |
< |
my $userquery=shift; |
35 |
> |
my $config=shift; |
36 |
|
my $userinterface=shift; |
37 |
+ |
my $userquery=shift; |
38 |
|
|
39 |
< |
#-- All comunication with the outside world theorugh userquery object |
39 |
> |
#-- All comunication with the outside world through userquery object |
40 |
|
$self->{Query}=$userquery; |
41 |
|
$self->userinterface($userinterface); |
42 |
|
|
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 |
– |
|
43 |
|
# set up default Configurations |
44 |
< |
$self->{ActiveConfig}=ActiveDoc::ActiveConfig->new($dir); |
44 |
> |
$self->{ActiveConfig}=$config; |
45 |
> |
$self->{ActiveConfig}->basedoc($self); # register as the basedoc |
46 |
> |
$self->_init2();#add a few things all docs should have |
47 |
|
$self->init(); |
48 |
|
} |
49 |
|
|