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

Comparing COMP/SCRAM/src/ActiveDoc/Application.pm (file contents):
Revision 1.2 by williamc, Thu Jan 27 17:50:38 2000 UTC vs.
Revision 1.4 by williamc, Wed Feb 23 14:54:01 2000 UTC

# Line 10 | Line 10
10   #
11   # Interface
12   # ---------
13 < # new(store,query)                      : A new Application object
13 > # new(store,[query])                    : A new Application object
14   # activatedoc(url[,options])    : return the oref of a doc corresponding
15   #                                 to the url
16   # userinterface([IntObj])       : set/get user interface object - defaults
# Line 19 | Line 19
19   # newdoc(type)                  : Instantiate a new ActiveDoc
20   #                                 object of the specified type
21   # find(@keys)                   : find an object in the activedoc objectdb
22 + # options()                     : Get/Set the options object - make one if
23 + #                                 not already provided
24 + # setoption(name,value)         : set an option in the current base options
25  
26   package ActiveDoc::Application;
27   require 5.004;
# Line 29 | Line 32 | sub new {
32          $self={};
33          bless $self, $class;
34          $self->{store}=shift;
35 <        $self->{options}=shift;
35 >        if ( @_ ) {
36 >          $self->options(shift);
37 >        }
38  
39          # make sure data is empty
40          undef $self->{StarterDoc};
# Line 69 | Line 74 | sub activatedoc {
74          return $self->{StarterDoc}->activatedoc($url);
75   }
76  
77 + sub setoption {
78 +        my $self=shift;
79 +
80 +        $self->options()->setparam(@_);
81 + }
82 +
83   sub options {
84          my $self=shift;
85  
86          if ( @_ ) {
87             $self->{options}=shift;
88          }
89 <        else {
90 <           (defined $self->{options})?$self->{options}:undef;
91 <        }
89 >        elsif ( ! defined $self->{options}) {
90 >                $self->{options}=ActiveDoc::Query->new();
91 >        }
92 >        return $self->{options};
93   }
94  
95   sub newdoc {
96          my $self=shift;
97          my $type=shift;
98  
99 <        return $type->new($self->{store},$self->{StarterDoc});
99 >        return $type->new($self->{store},$self->{StarterDoc}->basequery());
100   }
101  
102   # ---------------- private methods

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines