ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/ActiveDoc.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/ActiveDoc.pm (file contents):
Revision 1.14 by williamc, Tue Jan 18 18:30:10 2000 UTC vs.
Revision 1.15 by williamc, Thu Jan 20 18:18:45 2000 UTC

# Line 7 | Line 7
7   #
8   # Interface
9   # ---------
10 < # new()         : A new ActiveDoc object
10 > # new(ActiveConfig[,options])           : A new ActiveDoc object
11   # url()         : Return/set the docs url - essential
12   # file()        : Return the local filename of document
13   #
# Line 55 | Line 55 | sub new {
55          bless $self, $class;
56          $self->config(shift);
57  
58 <        # --- is there a starter document?
59 <        my $basedoc=$self->config()->basedoc();
60 <        if ( defined $basedoc ) {
61 <          $self->copydocquery($basedoc);
58 >        # have some override options been passed
59 >        if ( @_ ) {
60 >           $self->basequery(shift);
61          }
62          else {
63 <          $self->error("Error : No base doc found");
63 >           # --- is there a starter document?
64 >           my $basedoc=$self->config()->basedoc();
65 >           if ( defined $basedoc ) {
66 >             $self->copydocquery($basedoc);
67 >           }
68 >           else {
69 >             $self->error("Error : No base doc found");
70 >           }
71          }
72          $self->_init2();
73   }
# Line 197 | Line 203 | sub basequery {
203   sub option {
204          my $self=shift;
205          my $param=shift;
206 <        $self->basequery()->getparam($param);
206 >        if ( defined $self->basequery()) {
207 >                return $self->basequery()->getparam($param);
208 >        }
209 >        else {
210 >                return $undef;
211 >        }
212   }
213  
214   sub requestoption {
# Line 205 | Line 216 | sub requestoption {
216          my $param=shift;
217          my $string=shift;
218  
219 <        my $par=$self->basequery()->getparam($param);
219 >        my $par=undef;
220 >        if ( defined $self->basequery()) {
221 >        $par=$self->basequery()->getparam($param);
222          while ( ! defined $par ) {
223            $self->basequery()->querytype( $param, "basic");
224            $self->basequery()->querymessage( $param, $string);
225            $self->userinterface()->askuser($self->basequery());
226 <          $par=$self->basequery()->getparam('ActiveConfigdir');
226 >          $par=$self->basequery()->getparam($param);
227          }
228 +        }
229          return $par;
230   }
231  
# Line 349 | Line 363 | sub Base_start {
363          # Keep track of base tags
364          push @{$self->{basestack}}, $$hashref{"type"};
365          # Set the base
366 +        print "BASE SET for ".$$hashref{"type"}."\n";
367          $self->{urlhandler}->setbase($$hashref{"type"},$hashref);
368 +        print "BASE SET for ".$$hashref{"type"}."\n";
369  
370   }
371  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines