[2489] | 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 |
|
---|
[3540] | 26 | # 12/05/02 Added usage datastructure - John Thompson
|
---|
| 27 |
|
---|
[2489] | 28 | package Browse;
|
---|
| 29 |
|
---|
[10253] | 30 | use BasClas;
|
---|
[2489] | 31 | use sorttools;
|
---|
| 32 |
|
---|
[10253] | 33 | use strict;
|
---|
| 34 | no strict 'refs'; # allow filehandles to be variables and viceversa
|
---|
| 35 |
|
---|
[2489] | 36 | sub BEGIN {
|
---|
[10253] | 37 | @Browse::ISA = ('BasClas');
|
---|
[2489] | 38 | }
|
---|
| 39 |
|
---|
[10253] | 40 | my $arguments = [
|
---|
| 41 | ];
|
---|
[4759] | 42 | my $options = { 'name' => "Browse",
|
---|
[5645] | 43 | 'desc' => "{Browse.desc}",
|
---|
[6408] | 44 | 'abstract' => "yes",
|
---|
| 45 | 'inherits' => "yes" };
|
---|
[3540] | 46 |
|
---|
[2489] | 47 |
|
---|
| 48 | sub new {
|
---|
[10218] | 49 | my ($class) = shift (@_);
|
---|
| 50 | my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
|
---|
| 51 | push(@$classifierslist, $class);
|
---|
[4759] | 52 |
|
---|
[10218] | 53 | if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
|
---|
| 54 | if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
|
---|
[6968] | 55 |
|
---|
[10218] | 56 | my $self = (defined $hashArgOptLists)? new BasClas($classifierslist,$inputargs,$hashArgOptLists): new BasClas($classifierslist,$inputargs);
|
---|
[2489] | 57 |
|
---|
[10253] | 58 | if ($self->{'info_only'}) {
|
---|
| 59 | # don't worry about any options etc
|
---|
| 60 | return bless $self, $class;
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[10218] | 63 | # Manually set $self parameters.
|
---|
| 64 | $self->{'collection'} = $ENV{'GSDLCOLLECTION'}; # classifier information
|
---|
| 65 | $self->{'buttonname'} = "Browse";
|
---|
[2489] | 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',
|
---|
[10218] | 88 | 'Title'=>$self->{'buttonname'},
|
---|
[2489] | 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;
|
---|