source: trunk/gsdl/perllib/classify/AllList.pm@ 10218

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

Jeffrey's new parsing modifications, committed approx 6 July, 15.16

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