Changeset 6111


Ignore:
Timestamp:
2003-12-03T12:02:55+13:00 (20 years ago)
Author:
jmt12
Message:

Changed the description for the -metadata flag to foreshadow the coming enhancement. This commit also happens to include the prototype -ignore_arguments flag to AZList, that will never actually be used because of the aforementioned metadata enhancement.

Location:
trunk/gsdl/perllib
Files:
6 edited

Legend:

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

    r6084 r6111  
    5858my $arguments =
    5959    [ { 'name' => "metadata",
    60     'desc' => "{AZCompactList.metadata}",
     60    'desc' => "{List.metadata}",
    6161    'type' => "metadata",
    6262    'reqd' => "yes" },
  • trunk/gsdl/perllib/classify/AZList.pm

    r5646 r6111  
    3838my $arguments =
    3939    [ { 'name' => "metadata",
    40     'desc' => "{AZList.metadata}",
     40    'desc' => "{List.metadata}",
    4141    'type' => "metadata",
    4242    'reqd' => "yes" } ,
     
    135135
    136136    my $doc_OID = $doc_obj->get_OID();
    137     my $metavalue = $doc_obj->get_metadata_element ($doc_obj->get_top_section(),
    138                             $self->{'metaname'});
     137    my $metavalue = $doc_obj->get_metadata_element ($doc_obj->get_top_section(), $self->{'metaname'}, $self->{'ignore_namespace'});
    139138
    140139    # if this document doesn't contain the metadata element we're
  • trunk/gsdl/perllib/classify/AZSectionList.pm

    r5645 r6111  
    4747my $arguments =
    4848    [ { 'name' => "metadata",
    49     'desc' => "{AZList.metadata}",
     49    'desc' => "{List.metadata}",
    5050    'type' => "metadata",
    5151    'reqd' => "yes" },
  • trunk/gsdl/perllib/classify/BasClas.pm

    r5645 r6111  
    5151
    5252# 09/05/02 Added usage datastructure - John Thompson
     53# 28/11/03 Commented out verbosity argument - John Thompson
    5354
    5455use parsargv;
     
    6667    'type' => "string",
    6768    'deft' => "STDERR" },
    68       { 'name' => "verbosity",
    69     'desc' => "{BasClas.verbosity}",
    70     'type' => "enum",
    71     'deft' => "2",
    72     'reqd' => "no" } ];
     69#      { 'name' => "verbosity",
     70#   'desc' => "{BasClas.verbosity}",
     71#   'type' => "enum",
     72#   'deft' => "2",
     73#   'reqd' => "no" } ];
     74      { 'name' => "ignore_namespace",
     75    'desc' => "{BasClas.ignore_namespace}",
     76    'type' => "flag"} ];
    7377
    7478my $options = { 'name'     => "BasClas",
     
    236240             q^outhandle/.*/STDERR^, \$self->{'outhandle'},
    237241             q^verbosity/\d/2^, \$self->{'verbosity'},
     242             q^ignore_namespace^, \$self->{'ignore_namespace'},
    238243             "allow_extra_options")) {
    239244
  • trunk/gsdl/perllib/doc.pm

    r3834 r6111  
    608608
    609609# returns the first metadata value which matches field
     610
     611# This version of get metadata element works much like the one above,
     612# except it allows for the namespace portion of a metadata element to
     613# be ignored, thus if you are searching for dc.Title, the first piece
     614# of matching metadata ending with the name Title (once any namespace
     615# is removed) would be returned.
     616# 28-11-2003 John Thompson
    610617sub get_metadata_element {
    611618    my $self = shift (@_);
    612     my ($section, $field) = @_;
     619    my ($section, $field, $ignore_namespace) = @_;
    613620    my ($data);
     621
     622    $ignore_namespace = 0 unless defined $ignore_namespace;
    614623
    615624    my $section_ptr = $self->_lookup_section($section);
     
    620629    }
    621630
     631    # Remove the any namespace if we are being told to ignore them
     632    if($ignore_namespace) {
     633    $field =~ s/^\w*\.//;
     634    }
     635
    622636    foreach $data (@{$section_ptr->{'metadata'}}) {
    623     return $data->[1] if (scalar(@$data) >= 2 && $data->[0] eq $field);
     637
     638    my $data_name = $data->[0];
     639    # Remove the any namespace if we are being told to ignore them
     640    if($ignore_namespace) {
     641        $data_name =~ s/^\w*\.//;
     642    }
     643   
     644    return $data->[1] if (scalar(@$data) >= 2 && $data_name eq $field);
    624645    }
    625646   
     
    627648}
    628649
    629 
    630650# returns a list of the form [value1, value2, ...]
    631651sub get_metadata {
    632652    my $self = shift (@_);
    633     my ($section, $field) = @_;
     653    my ($section, $field, $ignore_namespace) = @_;
    634654    my ($data);
     655
     656    $ignore_namespace = 0 unless defined $ignore_namespace;
    635657
    636658    my $section_ptr = $self->_lookup_section($section);
     
    641663    }
    642664
     665    # Remove the any namespace if we are being told to ignore them
     666    if($ignore_namespace) {
     667    $field =~ s/^\w*\.//;
     668    }
     669
    643670    my @metadata = ();
    644671    foreach $data (@{$section_ptr->{'metadata'}}) {
    645         push (@metadata, $data->[1]) if ($data->[0] eq $field);
     672
     673    my $data_name = $data->[0];
     674    # Remove the any namespace if we are being told to ignore them
     675    if($ignore_namespace) {
     676        $data_name =~ s/^\w*\.//;
     677    }
     678
     679        push (@metadata, $data->[1]) if ($data_name eq $field);
    646680    }
    647681       
  • trunk/gsdl/perllib/strings.rb

    r6106 r6111  
    267267AZCompactList.freqsort:Sort by node frequency rather than alpha-numeric.
    268268
    269 AZCompactList.metadata:Metadata field used for classification. List will be sorted by this element.
    270269AZCompactList.metadata.deft:Metadata element specified with -metadata.
    271270AZCompactList.maxcompact:Maximum number of documents to be displayed per page.
     
    287286AZList.desc:Classifier plugin for sorting alphabetically
    288287
    289 AZList.metadata:Metadata field used for classification. List will be sorted by this element.
    290 
    291288AZList.removeprefix:A prefix to ignore in the Metadata values for the field when sorting.
    292289
     
    339336List.desc:Simple list classifier plugin.
    340337
    341 List.metadata:Metadata field used for classification. List will be sorted by this element.
     338List.metadata:A single Metadata field or a comma separated list of Metadata fields used for classification. Following the order indicated by the list, the first field that contains a Metadata value will be used. List will be sorted by this element.
    342339
    343340List.sort:Metadata field to sort by. If not set, sorts in build (random) order.
Note: See TracChangeset for help on using the changeset viewer.