1 | use BasClas;
|
---|
2 | package AllList;
|
---|
3 |
|
---|
4 | sub BEGIN {
|
---|
5 | @AllList::ISA = ('BasClas');
|
---|
6 | }
|
---|
7 |
|
---|
8 | my $arguments =
|
---|
9 | [
|
---|
10 | ];
|
---|
11 |
|
---|
12 | my $options = { 'name' => "AllList",
|
---|
13 | 'abstract' => "no",
|
---|
14 | 'inherits' => "yes" };
|
---|
15 |
|
---|
16 | sub 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 |
|
---|
33 | sub init {
|
---|
34 | my $self = shift (@_);
|
---|
35 | }
|
---|
36 |
|
---|
37 | sub 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 |
|
---|
48 | sub 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 | }
|
---|