source: trunk/gsdl/perllib/classify/list.pm@ 214

Last change on this file since 214 was 214, checked in by rjmcnab, 25 years ago

Initial revision.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 919 bytes
Line 
1# an example classifier plugin
2
3package list;
4
5sub new {
6 my ($class) = @_;
7
8 return bless {
9 'OID'=>"NULL",
10 'list'=>[]
11 }, $class;
12}
13
14sub init {
15 my $self = shift (@_);
16
17 $self->{'list'} = [];
18}
19
20sub set_OID {
21 my $self = shift (@_);
22 my ($OID) = @_;
23
24 $self->{'OID'} = $OID;
25}
26
27sub get_OID {
28 my $self = shift (@_);
29 return $self->{'OID'};
30}
31
32sub classify {
33 my $self = shift (@_);
34 my ($doc_obj) = @_;
35
36 my $doc_OID = $doc_obj->get_OID();
37 push (@{$self->{'list'}}, $doc_OID);
38}
39
40sub output_classify_info {
41 my $self = shift (@_);
42 my ($handle) = @_;
43
44 print $handle "[$self->{'OID'}]\n";
45 print $handle "<doctype>classify\n";
46 print $handle "<hastxt>0\n";
47 print $handle "<title>Document Listing\n";
48 if (scalar (@{$self->{'list'}}) > 0) {
49 print $handle "<contains>", join (";", @{$self->{'list'}}), "\n";
50 }
51 print $handle '-' x 70, "\n";
52}
53
54
551;
Note: See TracBrowser for help on using the repository browser.