Changeset 6111
- Timestamp:
- 2003-12-03T12:02:55+13:00 (20 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZCompactList.pm
r6084 r6111 58 58 my $arguments = 59 59 [ { 'name' => "metadata", 60 'desc' => "{ AZCompactList.metadata}",60 'desc' => "{List.metadata}", 61 61 'type' => "metadata", 62 62 'reqd' => "yes" }, -
trunk/gsdl/perllib/classify/AZList.pm
r5646 r6111 38 38 my $arguments = 39 39 [ { 'name' => "metadata", 40 'desc' => "{ AZList.metadata}",40 'desc' => "{List.metadata}", 41 41 'type' => "metadata", 42 42 'reqd' => "yes" } , … … 135 135 136 136 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'}); 139 138 140 139 # if this document doesn't contain the metadata element we're -
trunk/gsdl/perllib/classify/AZSectionList.pm
r5645 r6111 47 47 my $arguments = 48 48 [ { 'name' => "metadata", 49 'desc' => "{ AZList.metadata}",49 'desc' => "{List.metadata}", 50 50 'type' => "metadata", 51 51 'reqd' => "yes" }, -
trunk/gsdl/perllib/classify/BasClas.pm
r5645 r6111 51 51 52 52 # 09/05/02 Added usage datastructure - John Thompson 53 # 28/11/03 Commented out verbosity argument - John Thompson 53 54 54 55 use parsargv; … … 66 67 'type' => "string", 67 68 '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"} ]; 73 77 74 78 my $options = { 'name' => "BasClas", … … 236 240 q^outhandle/.*/STDERR^, \$self->{'outhandle'}, 237 241 q^verbosity/\d/2^, \$self->{'verbosity'}, 242 q^ignore_namespace^, \$self->{'ignore_namespace'}, 238 243 "allow_extra_options")) { 239 244 -
trunk/gsdl/perllib/doc.pm
r3834 r6111 608 608 609 609 # 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 610 617 sub get_metadata_element { 611 618 my $self = shift (@_); 612 my ($section, $field ) = @_;619 my ($section, $field, $ignore_namespace) = @_; 613 620 my ($data); 621 622 $ignore_namespace = 0 unless defined $ignore_namespace; 614 623 615 624 my $section_ptr = $self->_lookup_section($section); … … 620 629 } 621 630 631 # Remove the any namespace if we are being told to ignore them 632 if($ignore_namespace) { 633 $field =~ s/^\w*\.//; 634 } 635 622 636 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); 624 645 } 625 646 … … 627 648 } 628 649 629 630 650 # returns a list of the form [value1, value2, ...] 631 651 sub get_metadata { 632 652 my $self = shift (@_); 633 my ($section, $field ) = @_;653 my ($section, $field, $ignore_namespace) = @_; 634 654 my ($data); 655 656 $ignore_namespace = 0 unless defined $ignore_namespace; 635 657 636 658 my $section_ptr = $self->_lookup_section($section); … … 641 663 } 642 664 665 # Remove the any namespace if we are being told to ignore them 666 if($ignore_namespace) { 667 $field =~ s/^\w*\.//; 668 } 669 643 670 my @metadata = (); 644 671 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); 646 680 } 647 681 -
trunk/gsdl/perllib/strings.rb
r6106 r6111 267 267 AZCompactList.freqsort:Sort by node frequency rather than alpha-numeric. 268 268 269 AZCompactList.metadata:Metadata field used for classification. List will be sorted by this element.270 269 AZCompactList.metadata.deft:Metadata element specified with -metadata. 271 270 AZCompactList.maxcompact:Maximum number of documents to be displayed per page. … … 287 286 AZList.desc:Classifier plugin for sorting alphabetically 288 287 289 AZList.metadata:Metadata field used for classification. List will be sorted by this element.290 291 288 AZList.removeprefix:A prefix to ignore in the Metadata values for the field when sorting. 292 289 … … 339 336 List.desc:Simple list classifier plugin. 340 337 341 List.metadata: Metadata field used for classification. List will be sorted by this element.338 List.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. 342 339 343 340 List.sort:Metadata field to sort by. If not set, sorts in build (random) order.
Note:
See TracChangeset
for help on using the changeset viewer.