Changeset 2954
- Timestamp:
- 2002-02-07T16:18:36+13:00 (22 years ago)
- Location:
- trunk/gsdl/perllib/classify
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZList.pm
r2022 r2954 41 41 options: 42 42 43 -metadata X (required) Metadata field used for classification. 44 List will be sorted by this element. 45 46 -buttonname X (optional) Button name for this classification. 47 defaults to metadata name. 43 -metadata X (required) Metadata field used for classification. 44 List will be sorted by this element. 45 46 -buttonname X (optional) Button name for this classification. 47 defaults to metadata name. 48 49 -removeprefix regex (optional) A prefix to ignore in the Metadata values 50 for the field when sorting. 48 51 "; 49 52 } … … 53 56 my $self = new BasClas($class, @_); 54 57 55 my ($metaname, $title );58 my ($metaname, $title, $removeprefix); 56 59 57 60 if (!parsargv::parse(\@_, 58 61 q^metadata/.*/^, \$metaname, 59 62 q^buttonname/.*/^, \$title, 63 q^removeprefix/.*/^, \$removeprefix, 60 64 "allow_extra_options")) { 61 65 … … 76 80 $self->{'metaname'} = $metaname; 77 81 $self->{'title'} = $title; 82 if (defined($removeprefix) && $removeprefix) { 83 $self->{'removeprefix'} = $removeprefix; 84 } 78 85 79 86 return bless $self, $class; … … 97 104 # sorting by we won't include it in this classification 98 105 if (defined $metavalue && $metavalue ne "") { 106 if ($self->{'removeprefix'}) { 107 $metavalue =~ s/^$self->{'removeprefix'}//; 108 } 109 99 110 if ($self->{'metaname'} eq 'Language') { 100 111 $metavalue = $iso639::fromiso639{$metavalue}; -
trunk/gsdl/perllib/classify/AZSectionList.pm
r2022 r2954 45 45 sub print_usage { 46 46 print STDERR " 47 usage: classify AZSectionList [options]47 usage: classify AZSectionList -metadata X [options] 48 48 options: 49 49 50 -metadata X Metadata field used for classification,51 list will be sorted by this element.50 -metadata X (required) Metadata field used for classification. 51 List will be sorted by this element. 52 52 53 -buttonname X (OPTIONAL) Title field for this classification. 54 if not included title field will be Metaname. 53 -buttonname X Button name for this classification. 54 defaults to metadata name. 55 56 -removeprefix regex A prefix to ignore in the Metadata values 57 for the field when sorting. 55 58 56 59 This is very similar to AZList except it sorts by section level metadata … … 89 92 # sorting by we won't include it in this classification 90 93 if (defined $metavalue && $metavalue ne "") { 94 if ($self->{'removeprefix'}) { 95 $metavalue =~ s/^$self->{'removeprefix'}//; 96 } 97 91 98 if ($self->{'metaname'} eq 'Creator') { 92 99 &sorttools::format_string_name_english (\$metavalue);
Note:
See TracChangeset
for help on using the changeset viewer.