Revision: | 1.30 |
Committed: | Tue Feb 27 11:59:42 2007 UTC (18 years, 2 months ago) by sashby |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | V1_2_1b, V1_2_1a, V1_2_3, V1_2_2, V1_2_2_relcand2, V1_2_2_relcand1, V1_2_1, V1_2_0, V1_2_0-cand11, V1_1_7, V1_1_6, V1_2_0-cand10, V1_1_5, V1_2_0-cand9, V1_2_0-cand8, V1_2_0-cand7, V1_2_0-cand6, V1_2_0-cand5, V1_2_0-cand4, V1_2_0-cand3, V1_2_0-cand2, V1_2_0-cand1, V1_1_4, V1_1_3, V1_1_2, V1_1_0_reltag8, V1_1_0_reltag7, V1_1_0_reltag6, V1_1_1, V1_1_0_reltag5, V1_1_0_reltag4, V1_1_0_reltag3, V1_1_0_reltag2, V1_1_0_reltag1, V1_1_0_reltag, V1_1_0_cand3, V1_1_0_cand2, V1_1_0_cand1, HEAD_SM_071214, V1_1_0, v110p1, V110p6, V110p5, V110p4, V110p3 |
Branch point for: | SCRAM_V2_0, forBinLess_SCRAM, HEAD_BRANCH_SM_071214, v200branch |
Changes since 1.29: | +54 -172 lines |
Log Message: | Merged from XML branch to HEAD. Start release prep. |
# | User | Rev | Content |
---|---|---|---|
1 | williamc | 1.1 | # |
2 | williamc | 1.6 | # ActiveDoc.pm |
3 | # | ||
4 | # Originally Written by Christopher Williams | ||
5 | # | ||
6 | # Description | ||
7 | williamc | 1.1 | # |
8 | # Interface | ||
9 | # --------- | ||
10 | williamc | 1.26 | # new(ActiveStore) : A new ActiveDoc object |
11 | williamc | 1.6 | # url() : Return/set the docs url - essential |
12 | # | ||
13 | # -- error methods -- | ||
14 | # error(string) : Report an general error to the user | ||
15 | # parseerror(string) : Report an error during parsing a file | ||
16 | williamc | 1.2 | package ActiveDoc::ActiveDoc; |
17 | williamc | 1.6 | require 5.004; |
18 | williamc | 1.26 | use ActiveDoc::SimpleURLDoc; |
19 | use Utilities::Verbose; | ||
20 | williamc | 1.6 | |
21 | williamc | 1.26 | @ISA = qw(ActiveDoc::SimpleURLDoc Utilities::Verbose); |
22 | williamc | 1.6 | |
23 | sashby | 1.30 | sub new() |
24 | { | ||
25 | my $class=shift; | ||
26 | my $self={}; | ||
27 | bless $self, $class; | ||
28 | $self->{Ostore}=shift; | ||
29 | $self->cache($self->{Ostore}->cache()); | ||
30 | $self->{dbstore}=$self->{Ostore}; | ||
31 | return $self; | ||
32 | } | ||
33 | |||
34 | sub url() | ||
35 | { | ||
36 | my $self=shift; | ||
37 | # get file & preprocess | ||
38 | if ( @_ ) | ||
39 | { | ||
40 | $self->{origurl}=shift; | ||
41 | ($self->{url}, $self->{file})=$self->urlget($self->{origurl}); | ||
42 | $self->filetoparse($self->{file}); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | sub included_file() | ||
47 | { | ||
48 | my $self=shift; | ||
49 | @_ ? $self->{included_file} = shift | ||
50 | : $self->{included_file}; | ||
51 | } | ||
52 | williamc | 1.2 | |
53 | sashby | 1.30 | # ------------------- Tag Routines ----------------------------------- |
54 | sub include() | ||
55 | { | ||
56 | my $self=shift; | ||
57 | my (%attributes)=@_; | ||
58 | my ($filename,$fullurl); | ||
59 | |||
60 | if ( exists $attributes{'url'} ) | ||
61 | { | ||
62 | # -- download into our cache | ||
63 | ($fullurl,$filename)=$self->urlget($attributes{'url'}); | ||
64 | } | ||
65 | else | ||
66 | { | ||
67 | $filename=$attributes{'name'}; | ||
68 | } | ||
69 | # Set the file name of the included file: | ||
70 | $self->included_file($filename); | ||
71 | } | ||
72 | |||
73 | sub include_() | ||
74 | { | ||
75 | my $self=shift; | ||
76 | williamc | 1.21 | |
77 | sashby | 1.30 | } |
78 | williamc | 1.21 | |
79 | sashby | 1.30 | 1; |