Ignore:
Timestamp:
2005-07-06T15:27:45+12:00 (19 years ago)
Author:
kjdon
Message:

Jeffrey's new parsing modifications, committed approx 6 July, 15.16

File:
1 edited

Legend:

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

    r8852 r10218  
    4545
    4646
    47 sub new {
    48     my $class = shift (@_);
    49     my $self = new List($class, @_);
     47sub new {
     48    my ($class) = shift (@_);
     49    my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
     50    push(@$classifierslist, $class);
    5051
    51     # 14-05-02 To allow for proper inheritance of arguments - John Thompson
    52     my $option_list = $self->{'option_list'};
    53     push( @{$option_list}, $options );
     52    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
     53    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    5454
    55     #if ($self->{'info_only'}) {
    56     # created from classinfo.pl - don't need to parse the arguments
    57     #   return bless $self, $class;
    58     #}
     55    my $self = (defined $hashArgOptLists)? new List($classifierslist,$inputargs,$hashArgOptLists): new List($classifierslist,$inputargs);
     56
    5957    return bless $self, $class;
    6058}
     
    6765    # are we sorting the list??
    6866    my $nosort = 0;
    69     if (defined $self->{'sortname'} && $self->{'sortname'} eq "nosort") {
     67    if (defined $self->{'sort'} && $self->{'sort'} eq "nosort") {
    7068    $nosort = 1;
    7169    }
     
    8381
    8482    my $sortmeta = "";
    85     if (!$nosort && defined $self->{'sortname'}) {
    86     if ($self->{'sortname'} =~ /^filename$/i) {
     83    if (!$nosort && defined $self->{'sort'}) {
     84    if ($self->{'sort'} =~ /^filename$/i) {
    8785        $sortmeta = $doc_obj->get_source_filename();
    8886    } else {
    89         $sortmeta = $doc_obj->get_metadata_element($doc_obj->get_top_section(), $self->{'sortname'});
     87        $sortmeta = $doc_obj->get_metadata_element($doc_obj->get_top_section(), $self->{'sort'});
    9088        if (defined $sortmeta) {
    91         $sortmeta = &sorttools::format_metadata_for_sorting($self->{'sortname'}, $sortmeta, $doc_obj);
     89        $sortmeta = &sorttools::format_metadata_for_sorting($self->{'sort'}, $sortmeta, $doc_obj);
    9290        }
    9391    }
     
    140138    }
    141139
    142     if (defined $self->{'sortname'}) {
     140    if (defined $self->{'sort'}) {
    143141    # sorting on alternative metadata
    144142    $self->{'list'}->{"$doc_OID.$section"} = $sortmeta;
    145143    } else {
    146     # sortingon the classification metadata
     144    # sorting on the classification metadata
    147145    # do the same formatting on the meta value as for sort meta
    148146    $metavalue = &sorttools::format_metadata_for_sorting($metaname, $metavalue, $doc_obj);
Note: See TracChangeset for help on using the changeset viewer.