Changeset 8647


Ignore:
Timestamp:
2004-11-24T11:57:29+13:00 (19 years ago)
Author:
mdewsnip
Message:

Added a "-newest_first" option to DateList for reverse chronological sorting.

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

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

    r7177 r8647  
    6565    'type' => "flag",
    6666    'reqd' => "no" },
    67 
     67      { 'name' => "newest_first",
     68    'desc' => "{DateList.newest_first}",
     69    'type' => "flag",
     70    'reqd' => "no" }
    6871      ];
    6972
     
    97100             q^metadata/.*/^, \$datemeta,
    98101             q^sort/.*/^, \$sortmeta,
     102             q^newest_first^, \$self->{'newest_first'},
    99103                         "allow_extra_options")) {
    100104    $self->print_txt_usage("");  # Use default resource bundle
     
    147151    my $self = shift (@_);
    148152
    149     my @classlist = sort {$self->{'list'}->{$a} cmp $self->{'list'}->{$b};} keys %{$self->{'list'}};
     153    my @classlist;
     154    if ($self->{'newest_first'}) {
     155    @classlist = sort {$self->{'list'}->{$b} cmp $self->{'list'}->{$a};} keys %{$self->{'list'}};
     156    }
     157    else {
     158    @classlist = sort {$self->{'list'}->{$a} cmp $self->{'list'}->{$b};} keys %{$self->{'list'}};
     159    }
    150160
    151161    return $self->splitlist (\@classlist);
  • trunk/gsdl/perllib/strings.rb

    r8516 r8647  
    405405DateList.metadata:The metadata that contains the dates to classify by. The format is expected to be yyyymmdd.
    406406
     407DateList.newest_first:Sort the documents in reverse chronological order (newest first).
     408
    407409DateList.nogroup:Make each year an individual entry in the horizontal list, instead of spanning years with few entries. (This can also be used with the -bymonth option to make each month a separate entry instead of merging).
    408410
     
    636638
    637639ISISPlug.entry_separator:The string used to separate multiple values for single metadata fields in CDS/ISIS database records.
     640
     641ISISPlug.explode_databases:Explode databases processed by this plugin into individual records with editable metadata. This is an irreversible process and the original database files will be deleted.
    638642
    639643ISISPlug.document_field:The metadata element specifying the file name of documents to obtain and include in the collection.
Note: See TracChangeset for help on using the changeset viewer.