1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # List.pm --
|
---|
4 | # A component of the Greenstone digital library software
|
---|
5 | # from the New Zealand Digital Library Project at the
|
---|
6 | # University of Waikato, New Zealand.
|
---|
7 | #
|
---|
8 | # Copyright (C) 1999 New Zealand Digital Library Project
|
---|
9 | #
|
---|
10 | # This program is free software; you can redistribute it and/or modify
|
---|
11 | # it under the terms of the GNU General Public License as published by
|
---|
12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
13 | # (at your option) any later version.
|
---|
14 | #
|
---|
15 | # This program is distributed in the hope that it will be useful,
|
---|
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
18 | # GNU General Public License for more details.
|
---|
19 | #
|
---|
20 | # You should have received a copy of the GNU General Public License
|
---|
21 | # along with this program; if not, write to the Free Software
|
---|
22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
23 | #
|
---|
24 | ###########################################################################
|
---|
25 |
|
---|
26 | # 12/05/02 Added usage datastructure - John Thompson
|
---|
27 |
|
---|
28 | package Browse;
|
---|
29 |
|
---|
30 | use BasClas;
|
---|
31 | use sorttools;
|
---|
32 |
|
---|
33 | use strict;
|
---|
34 | no strict 'refs'; # allow filehandles to be variables and viceversa
|
---|
35 |
|
---|
36 | sub BEGIN {
|
---|
37 | @Browse::ISA = ('BasClas');
|
---|
38 | }
|
---|
39 |
|
---|
40 | my $arguments = [
|
---|
41 | ];
|
---|
42 | my $options = { 'name' => "Browse",
|
---|
43 | 'desc' => "{Browse.desc}",
|
---|
44 | 'abstract' => "yes",
|
---|
45 | 'inherits' => "yes" };
|
---|
46 |
|
---|
47 |
|
---|
48 | sub new {
|
---|
49 | my ($class) = shift (@_);
|
---|
50 | my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
|
---|
51 | push(@$classifierslist, $class);
|
---|
52 |
|
---|
53 | if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
|
---|
54 | if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
|
---|
55 |
|
---|
56 | my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
|
---|
57 |
|
---|
58 | if ($self->{'info_only'}) {
|
---|
59 | # don't worry about any options etc
|
---|
60 | return bless $self, $class;
|
---|
61 | }
|
---|
62 |
|
---|
63 | # Manually set $self parameters.
|
---|
64 | $self->{'collection'} = $ENV{'GSDLCOLLECTION'}; # classifier information
|
---|
65 | $self->{'buttonname'} = "Browse";
|
---|
66 |
|
---|
67 | return bless $self, $class;
|
---|
68 | }
|
---|
69 |
|
---|
70 | sub init {
|
---|
71 | my $self = shift (@_);
|
---|
72 |
|
---|
73 |
|
---|
74 | }
|
---|
75 |
|
---|
76 | sub classify {
|
---|
77 | my $self = shift (@_);
|
---|
78 |
|
---|
79 | }
|
---|
80 |
|
---|
81 | sub get_classify_info {
|
---|
82 | my $self = shift (@_);
|
---|
83 |
|
---|
84 |
|
---|
85 | # Return the information about the classifier that we'll later want to
|
---|
86 | # use to create macros when the Phind classifier document is displayed.
|
---|
87 | my %classifyinfo = ('thistype'=>'Invisible',
|
---|
88 | 'Title'=>$self->{'buttonname'},
|
---|
89 | 'contains'=>[]);
|
---|
90 |
|
---|
91 | my $collection = $self->{'collection'};
|
---|
92 | my $url = "library?a=br&c=collection";
|
---|
93 | push (@{$classifyinfo{'contains'}}, {'OID'=>$url});
|
---|
94 |
|
---|
95 | return \%classifyinfo;
|
---|
96 |
|
---|
97 |
|
---|
98 | }
|
---|
99 |
|
---|
100 |
|
---|
101 | 1;
|
---|