Changeset 10218 for trunk/gsdl/perllib/classify/SectionList.pm
- Timestamp:
- 2005-07-06T15:27:45+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/SectionList.pm
r8852 r10218 45 45 46 46 47 sub new { 48 my $class = shift (@_); 49 my $self = new List($class, @_); 47 sub new { 48 my ($class) = shift (@_); 49 my ($classifierslist,$inputargs,$hashArgOptLists) = @_; 50 push(@$classifierslist, $class); 50 51 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)}; 54 54 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 59 57 return bless $self, $class; 60 58 } … … 67 65 # are we sorting the list?? 68 66 my $nosort = 0; 69 if (defined $self->{'sort name'} && $self->{'sortname'} eq "nosort") {67 if (defined $self->{'sort'} && $self->{'sort'} eq "nosort") { 70 68 $nosort = 1; 71 69 } … … 83 81 84 82 my $sortmeta = ""; 85 if (!$nosort && defined $self->{'sort name'}) {86 if ($self->{'sort name'} =~ /^filename$/i) {83 if (!$nosort && defined $self->{'sort'}) { 84 if ($self->{'sort'} =~ /^filename$/i) { 87 85 $sortmeta = $doc_obj->get_source_filename(); 88 86 } else { 89 $sortmeta = $doc_obj->get_metadata_element($doc_obj->get_top_section(), $self->{'sort name'});87 $sortmeta = $doc_obj->get_metadata_element($doc_obj->get_top_section(), $self->{'sort'}); 90 88 if (defined $sortmeta) { 91 $sortmeta = &sorttools::format_metadata_for_sorting($self->{'sort name'}, $sortmeta, $doc_obj);89 $sortmeta = &sorttools::format_metadata_for_sorting($self->{'sort'}, $sortmeta, $doc_obj); 92 90 } 93 91 } … … 140 138 } 141 139 142 if (defined $self->{'sort name'}) {140 if (defined $self->{'sort'}) { 143 141 # sorting on alternative metadata 144 142 $self->{'list'}->{"$doc_OID.$section"} = $sortmeta; 145 143 } else { 146 # sorting on the classification metadata144 # sorting on the classification metadata 147 145 # do the same formatting on the meta value as for sort meta 148 146 $metavalue = &sorttools::format_metadata_for_sorting($metaname, $metavalue, $doc_obj);
Note:
See TracChangeset
for help on using the changeset viewer.