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/Hierarchy.pm

    r6761 r6968  
    2525
    2626# classifier plugin for generating hierarchical classifications
    27 
    28 # options for this classifier are:
    29 # -hfile file.txt    - classification file
    30 # -metadata Metaname - metadata field to test against file.txt
    31 # -sort Meta         - this option is optional (genious;-). by default this
    32 #                     classifier will sort documents within each section
    33 #                     alphabetically by Title. sort=nosort prevents sorting
    34 #                     (i.e. documents will end up in build order), sort=Meta
    35 #                     will sort each field alphabetically by Meta (Meta may
    36 #                     also be 'Filename' to sort by the original filename).
    37 # -buttonname Title  - another optional field. this is what will end up in the
    38 #                     Title field for this classification. if not present it
    39 #                     defaults to Metaname
    40 # -hlist_at_top      - use a horizontal list for the top level (i.e. display it
    41 #                     like an AZList classification)
    4227
    4328# 12/05/02 Added usage datastructure - John Thompson
     
    6651    'reqd' => "yes" },
    6752      { 'name' => "buttonname",
    68     'desc' => "{Hierarchy.buttonname}",
     53    'desc' => "{BasClas.buttonname}",
    6954    'type' => "string",
    7055    'deft' => "{BasClas.metadata.deft}",
     
    8772    'args'     => $arguments };
    8873
    89 #  sub print_usage {
    90 #      print STDERR "
    91 #    usage: classify Hierarchy [options]
    92 #    options:
    93 
    94 #     -buttonname X  Title field for this classification.
    95 #                    Defaults to metadata name.
    96 
    97 #     -metadata X    Metadata field used for classification,
    98 #                    list will be sorted by this element,
    99 #                    unless -sort is used.
    100 
    101 #     -hfile X       The classification structure file
    102 
    103 #     -sort X        Metadata field to sort by (defaults to -metadata)
    104 #                    use '-sort nosort' for no sorting.
    105 
    106 #     -hlist_at_top  Display the first level of the classification
    107 #                    horizontally.
    108 #  ";
    109 #  }
    110 
    11174
    11275sub new {
     
    11477    my $self = new BasClas($class, @_);
    11578 
    116     # 14-05-02 To allow for proper inheritance of arguments - John Thompson
    11779    my $option_list = $self->{'option_list'};
    11880    push( @{$option_list}, $options );
    119    
     81 
     82    if ($self->{'info_only'}) {
     83    # created from classinfo.pl - don't need to parse the arguments
     84    return bless $self, $class;
     85    }
     86 
    12087    my ($hfile, $metadata, $sortname, $title, $hlist_at_top);
    12188   
Note: See TracChangeset for help on using the changeset viewer.