Ignore:
Timestamp:
2004-03-08T15:39:43+13:00 (20 years ago)
Author:
kjdon
Message:

all classifiers now use BasClas.buttonname for their buttonname option description.
removed the old print_usage methods and old usage notes.
added in a test for $self->{'info_only'} in new(): if this is set, don't try and parse the arguments cos we are only running classinfo.pl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify/Collage.pm

    r6808 r6968  
    2424###########################################################################
    2525
    26 # simple list classifier plugin
    27 # options are:
    28 # metadata=Metaname -- (optional) all documents with Metaname metadata
    29 #                      will be included in list. if not included all documents
    30 #                      will be included in list.
    31 # sort=Meta         -- (optional) sort documents in list alphabetically by
    32 #                      Meta. by default it will sort by Metaname, if neither
    33 #                      are set documents will be in build (random) order.
    34 #                      Meta may be Filename to sort by original filename or
    35 #                      nosort to force not to sort
    36 # buttonname=Title  -- (optional) the title field for this classification.
    37 #                      if not included title field will be Metaname.
    38 #                      if metadata is also not included title will be 'List'
    39 
    40 # 12/05/02 Added usage datastructure - John Thompson
     26package Collage;
    4127
    4228use BasClas;
    43 package Collage;
    44 
    4529use sorttools;
    4630
     
    5135my $arguments =
    5236    [ { 'name' => "buttonname",
    53     'desc' => "{Collage.buttonname}",
     37    'desc' => "{BasClas.buttonname}",
    5438    'type' => "string",
    55     'deft' => "Metadata element specified with -metadata",
     39    'deft' => "Collage",
    5640    'reqd' => "no" }];
    5741
     
    6145        'args'     => $arguments };
    6246
    63 #  sub print_usage {
    64 #      print STDERR "
    65 #    usage: classify List [options]
    66 #    options:
    67 
    68 #     -buttonname X  (optional) Title field for this classification.
    69 #                    if not included title field will be Metaname.
    70 #  ";
    71 #  }
    7247
    7348sub new {
     
    7550    my $self = new BasClas($class, @_);
    7651
    77     # 14-05-02 To allow for proper inheritance of arguments - John Thompson
    7852    my $option_list = $self->{'option_list'};
    7953    push( @{$option_list}, $options );
     54
     55    if ($self->{'info_only'}) {
     56    # created from classinfo.pl - don't need to parse the arguments
     57    return bless $self, $class;
     58    }   
    8059
    8160    my ($title, $list);
Note: See TracChangeset for help on using the changeset viewer.