1 |
sashby |
1.4 |
|
2 |
|
|
BEGIN
|
3 |
|
|
{
|
4 |
|
|
print " ActiveDoc::StarterDoc: I AM used!!","\n";
|
5 |
|
|
};
|
6 |
|
|
|
7 |
williamc |
1.1 |
#
|
8 |
|
|
# StarterDoc.pm - An active Document
|
9 |
|
|
#
|
10 |
|
|
# Originally Written by Christopher Williams
|
11 |
|
|
#
|
12 |
|
|
# Description
|
13 |
williamc |
1.2 |
# -----------
|
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 |
williamc |
1.1 |
#
|
17 |
|
|
# Interface
|
18 |
|
|
# ---------
|
19 |
williamc |
1.2 |
# new(ActiveConfig,userinterface,userquery) : A new StarterDoc object
|
20 |
williamc |
1.1 |
|
21 |
|
|
package ActiveDoc::StarterDoc;
|
22 |
|
|
require 5.001;
|
23 |
|
|
use ActiveDoc::ActiveDoc;
|
24 |
|
|
use ActiveDoc::ActiveConfig;
|
25 |
|
|
use ActiveDoc::Query;
|
26 |
|
|
use URL::URLcache;
|
27 |
|
|
use ObjectUtilities::ObjectStore;
|
28 |
|
|
|
29 |
|
|
@ISA=qw(ActiveDoc::ActiveDoc);
|
30 |
|
|
|
31 |
|
|
sub new {
|
32 |
|
|
my $class=shift;
|
33 |
|
|
$self={};
|
34 |
|
|
bless $self, $class;
|
35 |
|
|
$self->_init(@_);
|
36 |
|
|
return $self;
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
sub _init {
|
40 |
|
|
my $self=shift;
|
41 |
williamc |
1.2 |
my $config=shift;
|
42 |
|
|
my $userinterface=shift;
|
43 |
williamc |
1.1 |
my $userquery=shift;
|
44 |
|
|
|
45 |
williamc |
1.2 |
#-- All comunication with the outside world through userquery object
|
46 |
williamc |
1.1 |
$self->{Query}=$userquery;
|
47 |
|
|
$self->userinterface($userinterface);
|
48 |
|
|
|
49 |
|
|
# set up default Configurations
|
50 |
williamc |
1.2 |
$self->{ActiveConfig}=$config;
|
51 |
|
|
$self->{ActiveConfig}->basedoc($self); # register as the basedoc
|
52 |
|
|
$self->_init2();#add a few things all docs should have
|
53 |
williamc |
1.1 |
$self->init();
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
sub init {
|
57 |
|
|
# dummy to be overriden
|
58 |
|
|
}
|
59 |
williamc |
1.3 |
|
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 |
|
|
}
|