2 |
|
# |
3 |
|
# Interface |
4 |
|
# --------- |
5 |
< |
# new(file,URLcache,ObjectStore) : new requirements doc |
5 |
> |
# new(url,URLcache,ObjectStore) : new requirements doc |
6 |
|
# setup(toolbox): set up the requirements into the specified toolbox object |
7 |
|
# download(toolbox) : download description files (into toolbox cache) |
8 |
|
# tools() : Return list of requirements (ordered) |
60 |
|
|
61 |
|
sub init { |
62 |
|
my $self=shift; |
63 |
< |
my $file=shift; |
63 |
> |
my $url=shift; |
64 |
|
|
65 |
< |
my $switch=ActiveDoc::ActiveDoc->new($self->{cache}); |
66 |
< |
$switch->filetoparse($file); |
67 |
< |
$switch->newparse("doc"); |
68 |
< |
$switch->addtag("doc","Doc", \&Doc_start,$self,"",$self,"",$self); |
65 |
> |
my $switch=ActiveDoc::ActiveDoc->new($self->{cache},$self->{dbstore}); |
66 |
> |
#$switch->filetoparse($file); |
67 |
> |
$switch->verbosity($self->verbosity()); |
68 |
> |
$switch->url($url); |
69 |
|
$switch->newparse("ordering"); |
70 |
|
$switch->addbasetags("ordering"); |
71 |
|
$switch->addtag("ordering","Architecture", |
81 |
|
$self->{switch}=$switch; |
82 |
|
@{$self->{tools}}=(); |
83 |
|
|
84 |
< |
$self->{switch}->parse("doc"); |
84 |
> |
my($doctype,$docversion)=$switch->doctype(); |
85 |
|
# -- for backwards compatability only parse if we have a docversion |
86 |
|
# defined |
87 |
< |
if ( defined $self->{docversion} ) { |
88 |
< |
if ( $self->{docversion} eq $self->{mydocversion} ) { |
87 |
> |
if ( defined $docversion ) { |
88 |
> |
if ( $docversion eq $self->{mydocversion} ) { |
89 |
|
$self->{switch}->parse("ordering"); |
90 |
|
} |
91 |
|
} |
107 |
|
|
108 |
|
# ---- Tag routines |
109 |
|
|
110 |
– |
sub Doc_start { |
111 |
– |
my $self=shift; |
112 |
– |
my $name=shift; |
113 |
– |
my $hashref=shift; |
114 |
– |
|
115 |
– |
$self->{switch}->checktag( $name, $hashref, 'type'); |
116 |
– |
$self->{switch}->checktag( $name, $hashref, 'version'); |
117 |
– |
|
118 |
– |
$self->{docversion}=$$hashref{'version'}; |
119 |
– |
} |
120 |
– |
|
110 |
|
sub require_start { |
111 |
|
my $self=shift; |
112 |
|
my $name=shift; |