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.9 by williamc, Mon Nov 29 17:32:14 1999 UTC vs.
Revision 1.10 by williamc, Thu Dec 16 16:30:45 1999 UTC

# Line 24 | Line 24
24   # basequery([ActiveConfig]) : Set up/return UserQuery for the doc
25   # copydocconfig(ActiveDoc) : Copy the basic configuration from the ActiveDoc
26   # copydocquery(ActiveDoc) : Copy the basicquery from the ActiveDoc
27 + # userinterface()       : Return the defaullt userinterface
28 + # options(var)          : return the value of the option var
29   #
30   # -- error methods --
31   # error(string)       : Report an general error to the user
# Line 36 | Line 38 | require 5.004;
38   use ActiveDoc::Parse;
39   use ActiveDoc::ActiveConfig;
40   use ActiveDoc::PreProcessedFile;
41 < use ObjectUtilities::ObjectBase;
41 > use ObjectUtilities::StorableObject;
42   use URL::URLhandler;
43  
44 < @ISA = qw(ObjectUtilities::ObjectBase);
44 > @ISA = qw(ObjectUtilities::StorableObject);
45  
46   sub new {
47          my $class=shift;
# Line 50 | Line 52 | sub new {
52          # A URL handler per document
53          $self->{urlhandler}=URL::URLhandler->new($self->config()->cache());
54  
55 +        # A default UserInterface
56 +        $self->{userinterface}=ActiveDoc::UserInterface_basic->new();
57          $self->init(@_);
58          return $self;
59   }
# Line 128 | Line 132 | sub config {
132  
133   sub basequery {
134          my $self=shift;
135 <        @_ ? $self->{UserQuery}=shift
136 <           : $self->{UserQuery};
135 >        @_ ? $self->{Query}=shift
136 >           : $self->{Query};
137 > }
138 >
139 > sub options {
140 >        my $self=shift;
141 >        my $param=shift;
142 >        $self->basequery()->getparam('option_'.$param);
143   }
144  
145   sub getfile() {
# Line 166 | Line 176 | sub activatedoc {
176          my $fileob=$self->getfile($url);
177  
178          # now parse it for the <DocType> tag
179 +        $self->{doctypefound}=0;
180          $self->newparse("doctype");
181          $self->addtag("doctype","Doc", \&Doc_Start, $self,
182                                            "", $self, "", $self);
# Line 177 | Line 188 | sub activatedoc {
188          }
189          # Set up a new object of the specified type
190          my $newobj=$self->{docobject}->new($self->config());
191 +        $newobj->url($url);
192          return $newobj;
193   }
194  
# Line 206 | Line 218 | sub checktag {
218          my $hashref=shift;
219          my $param=shift;
220  
209        print keys %$hashref;
210        print "-----------------------------------\n";
221          if ( ! exists $$hashref{$param} ) {
222            $self->parseerror("Incomplete Tag <$tagname> : $param required");
223          }
# Line 281 | Line 291 | sub Doc_Start {
291          my $hashref=shift;
292          
293          $self->checktag($name, $hashref, "type");
294 <        $self->{docobject}=$$hashref{'type'};
294 >        $self->{doctypefound}++;
295 >        if ( $self->{doctypefound} == 1 ) { # only take first doctype
296 >           $self->{docobject}=$$hashref{'type'};
297 >        }
298 > }
299 >
300 > sub userinterface {
301 >        my $self=shift;
302 >        @_?$self->{userinterface}=shift
303 >          :$self->{userinterface}
304   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines