source: main/tags/2.63/gsdl/perllib/classify/AllList.pm

Last change on this file was 10253, checked in by kjdon, 19 years ago

added 'use strict' to all classifiers, and made modifications (mostly adding 'my') to make them compile

  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1package AllList;
2
3use BasClas;
4
5use strict;
6no strict 'refs'; # allow filehandles to be variables and viceversa
7
8sub BEGIN {
9 @AllList::ISA = ('BasClas');
10}
11
12my $arguments =
13 [
14 ];
15
16my $options = { 'name' => "AllList",
17 'abstract' => "no",
18 'inherits' => "yes" };
19
20sub new {
21 my ($class) = shift (@_);
22 my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
23 push(@$classifierslist, $class);
24
25 if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
26 if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
27
28 my $self = (defined $hashArgOptLists)? new BasClas($classifierslist,$inputargs,$hashArgOptLists): new BasClas($classifierslist,$inputargs);
29
30 if ($self->{'info_only'}) {
31 # don't worry about any options etc
32 return bless $self, $class;
33 }
34
35 # Manually set $self parameters.
36 $self->{'list'} = [];
37 $self->{'buttonname'} = "All Documents";
38
39 return bless $self, $class;
40}
41
42sub init {
43 my $self = shift (@_);
44}
45
46sub classify {
47 my $self = shift (@_);
48 my ($doc_obj) = @_;
49
50 my $doc_OID = $doc_obj->get_OID();
51
52 push (@{$self->{'list'}}, $doc_OID);
53
54 return;
55}
56
57sub get_classify_info {
58 my $self = shift(@_);
59 my ($no_thistype) = @_;
60
61 my %classifyinfo = ('childtype' =>'VList',
62 'Title' =>$self->{'buttonname'},
63 'contains' =>[],
64 'classifyOID' =>"oai");
65 $classifyinfo{'thistype'} = 'Invisible';
66 my @list = @{$self->{'list'}};
67
68 my $seqNo = 0;
69 foreach my $OID (@list) {
70 my $hashref={};
71 $hashref->{'OID'}=$OID;
72
73 my %tempinfo=('childtype'=>'VList',
74 'Title'=>$self->{'buttonname'},
75 'classifyOID' =>"oai.$seqNo",
76 'contains' =>[]);
77
78 push (@{$tempinfo{'contains'}}, $hashref);
79
80 push (@{$classifyinfo{'contains'}}, \%tempinfo);
81 $seqNo ++;
82 }
83
84 return \%classifyinfo;
85}
Note: See TracBrowser for help on using the repository browser.