1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Browse.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 | package Browse;
|
---|
27 |
|
---|
28 | use BaseClassifier;
|
---|
29 | use sorttools;
|
---|
30 |
|
---|
31 | use strict;
|
---|
32 | no strict 'refs'; # allow filehandles to be variables and viceversa
|
---|
33 |
|
---|
34 | sub BEGIN {
|
---|
35 | @Browse::ISA = ('BaseClassifier');
|
---|
36 | }
|
---|
37 |
|
---|
38 | my $arguments = [
|
---|
39 | ];
|
---|
40 | my $options = { 'name' => "Browse",
|
---|
41 | 'desc' => "{Browse.desc}",
|
---|
42 | 'abstract' => "yes",
|
---|
43 | 'inherits' => "yes" };
|
---|
44 |
|
---|
45 |
|
---|
46 | sub new {
|
---|
47 | my ($class) = shift (@_);
|
---|
48 | my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
|
---|
49 | push(@$classifierslist, $class);
|
---|
50 |
|
---|
51 | push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
|
---|
52 | push(@{$hashArgOptLists->{"OptList"}},$options);
|
---|
53 |
|
---|
54 | my $self = new BaseClassifier($classifierslist, $inputargs, $hashArgOptLists);
|
---|
55 |
|
---|
56 | if ($self->{'info_only'}) {
|
---|
57 | # don't worry about any options etc
|
---|
58 | return bless $self, $class;
|
---|
59 | }
|
---|
60 |
|
---|
61 | # Manually set $self parameters.
|
---|
62 | $self->{'collection'} = $ENV{'GSDLCOLLECTION'}; # classifier information
|
---|
63 | $self->{'buttonname'} = "Browse";
|
---|
64 |
|
---|
65 | return bless $self, $class;
|
---|
66 | }
|
---|
67 |
|
---|
68 | sub init {
|
---|
69 | my $self = shift (@_);
|
---|
70 |
|
---|
71 |
|
---|
72 | }
|
---|
73 |
|
---|
74 | sub classify {
|
---|
75 | my $self = shift (@_);
|
---|
76 |
|
---|
77 | }
|
---|
78 |
|
---|
79 | sub get_classify_info {
|
---|
80 | my $self = shift (@_);
|
---|
81 |
|
---|
82 |
|
---|
83 | # Return the information about the classifier that we'll later want to
|
---|
84 | # use to create macros when the Phind classifier document is displayed.
|
---|
85 | my %classifyinfo = ('thistype'=>'Invisible',
|
---|
86 | 'Title'=>$self->{'buttonname'},
|
---|
87 | 'contains'=>[]);
|
---|
88 |
|
---|
89 | my $collection = $self->{'collection'};
|
---|
90 | my $url = "library?a=br&c=collection";
|
---|
91 | push (@{$classifyinfo{'contains'}}, {'OID'=>$url});
|
---|
92 |
|
---|
93 | return \%classifyinfo;
|
---|
94 |
|
---|
95 |
|
---|
96 | }
|
---|
97 |
|
---|
98 |
|
---|
99 | 1;
|
---|