1 |
williamc |
1.1 |
#
|
2 |
|
|
# StarterDoc.pm - An active Document
|
3 |
|
|
#
|
4 |
|
|
# Originally Written by Christopher Williams
|
5 |
|
|
#
|
6 |
|
|
# Description
|
7 |
|
|
#
|
8 |
|
|
# Interface
|
9 |
|
|
# ---------
|
10 |
|
|
# new() : A new StarterDoc object
|
11 |
|
|
|
12 |
|
|
package ActiveDoc::StarterDoc;
|
13 |
|
|
require 5.001;
|
14 |
|
|
use ActiveDoc::ActiveDoc;
|
15 |
|
|
use ActiveDoc::ActiveConfig;
|
16 |
|
|
use ActiveDoc::Query;
|
17 |
|
|
use URL::URLcache;
|
18 |
|
|
use ObjectUtilities::ObjectStore;
|
19 |
|
|
|
20 |
|
|
@ISA=qw(ActiveDoc::ActiveDoc);
|
21 |
|
|
|
22 |
|
|
sub new {
|
23 |
|
|
my $class=shift;
|
24 |
|
|
$self={};
|
25 |
|
|
bless $self, $class;
|
26 |
|
|
$self->_init(@_);
|
27 |
|
|
return $self;
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
sub _init {
|
31 |
|
|
my $self=shift;
|
32 |
|
|
my $userquery=shift;
|
33 |
|
|
my $userinterface=shift;
|
34 |
|
|
|
35 |
|
|
#-- All comunication with the outside world theorugh userquery object
|
36 |
|
|
$self->{Query}=$userquery;
|
37 |
|
|
$self->userinterface($userinterface);
|
38 |
|
|
|
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 |
|
|
|
51 |
|
|
# set up default Configurations
|
52 |
|
|
$self->{ActiveConfig}=ActiveDoc::ActiveConfig->new($dir);
|
53 |
|
|
$self->init();
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
sub init {
|
57 |
|
|
# dummy to be overriden
|
58 |
|
|
}
|