1 | package AllList;
|
---|
2 |
|
---|
3 | use BasClas;
|
---|
4 |
|
---|
5 | use strict;
|
---|
6 | no strict 'refs'; # allow filehandles to be variables and viceversa
|
---|
7 |
|
---|
8 | sub BEGIN {
|
---|
9 | @AllList::ISA = ('BasClas');
|
---|
10 | }
|
---|
11 |
|
---|
12 | my $arguments =
|
---|
13 | [
|
---|
14 | ];
|
---|
15 |
|
---|
16 | my $options = { 'name' => "AllList",
|
---|
17 | 'abstract' => "no",
|
---|
18 | 'inherits' => "yes" };
|
---|
19 |
|
---|
20 | sub 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 |
|
---|
42 | sub init {
|
---|
43 | my $self = shift (@_);
|
---|
44 | }
|
---|
45 |
|
---|
46 | sub 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 |
|
---|
57 | sub 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 | }
|
---|