->request("open-ils.supercat.biblio.search_aliases")
->gather(1)};
+ my %attribute_desc = (
+ site => 'Evergreen Site Code (shortname)',
+ sort => 'Sort on relevance, title, author, pubdate, create_date or edit_date',
+ dir => 'Sort direction (asc|desc)',
+ available => 'Filter to available (true|false)',
+ );
+
# Append the non-search-alias attributes to the qualifier map
- push(@{$qualifier_map{'eg'}}, qw/
- available
- ascending
- descending
- sort
- format
- before
- after
- statuses
- locations
- site
- depth
- lasso
- offset
- limit
- preferred_language
- preferred_language_weight
- preferred_language_multiplier
- /);
+ foreach ( qw/
+ available
+ ascending
+ descending
+ sort
+ format
+ before
+ after
+ statuses
+ locations
+ site
+ depth
+ lasso
+ offset
+ limit
+ preferred_language
+ preferred_language_weight
+ preferred_language_multiplier
+ /) {
+ $qualifier_map{'eg'}{$_}{'index'} = $_;
+ if (exists $attribute_desc{$_}) {
+ $qualifier_map{'eg'}{$_}{'title'} = $attribute_desc{$_};
+ } else {
+ $qualifier_map{'eg'}{$_}{'title'} = $_;
+ }
+ }
my $list = $supercat
->request("open-ils.supercat.record.formats")
srw => ''
);
-our %nested_qualifier_map = (
- eg => {
- site => ['site','Evergreen Site Code (shortname)'],
- sort => ['sort','Sort on relevance, title, author, pubdate, create_date or edit_date'],
- direction => ['dir','Sort direction (asc|desc)'],
- available => ['available','Filter to available (true|false)'],
- title => ['title'],
- author => ['author'],
- name => ['author'],
- subject => ['subject'],
- keyword => ['keyword'],
- series => ['series'],
- },
- dc => {
- title => ['title'],
- creator => ['author'],
- contributor => ['author'],
- publisher => ['keyword'],
- subject => ['subject'],
- identifier => ['keyword'],
- type => [undef],
- format => [undef],
- language => ['lang'],
- },
- bib => {
- # Title class:
- titleAbbreviated => ['title'],
- titleUniform => ['title'],
- titleTranslated => ['title'],
- titleAlternative => ['title'],
- titleSeries => ['series'],
-
- # Author/Name class:
- name => ['author'],
- namePersonal => ['author'],
- namePersonalFamily => ['author'],
- namePersonalGiven => ['author'],
- nameCorporate => ['author'],
- nameConference => ['author'],
-
- # Subject class:
- subjectPlace => ['subject'],
- subjectTitle => ['keyword'],
- subjectName => ['subject|name'],
- subjectOccupation => ['keyword'],
-
- # Keyword class:
-
- # Dates:
- dateIssued => [undef],
- dateCreated => [undef],
- dateValid => [undef],
- dateModified => [undef],
- dateCopyright => [undef],
-
- # Genre:
- genre => ['keyword'],
-
- # Target Audience:
- audience => [undef],
-
- # Place of Origin:
- originPlace => [undef],
-
- # Edition
- edition => ['keyword'],
-
- # Part:
- volume => ['keyword'],
- issue => ['keyword'],
- startPage => ['keyword'],
- endPage => ['keyword'],
-
- # Issuance:
- issuance => ['keyword'],
- },
- srw => {
- serverChoice => ['keyword'],
- },
-);
-
# Our authority search options are currently pretty impoverished;
# just right-truncated string match on a few categories, or by
# ID number
our %nested_auth_qualifier_map = (
eg => {
- id => ['id', 'Record number'],
- name => ['author', 'Personal or corporate author, or meeting name'],
- title => ['title', 'Uniform title'],
- subject => ['subject', 'Chronological term, topical term, geographic name, or genre/form term'],
- topic => ['topic', 'Topical term'],
+ id => { index => 'id', title => 'Record number'},
+ name => { index => 'author', title => 'Personal or corporate author, or meeting name'},
+ title => { index => 'title', title => 'Uniform title'},
+ subject => { index => 'subject', title => 'Chronological term, topical term, geographic name, or genre/form term'},
+ topic => { index => 'topic', title => 'Topical term'},
},
);
if ( $qualifier ) {
my ($qset, $qname) = split(/\./, $qualifier);
- $log->debug("SRU toEvergreen: $qset, $qname $OpenILS::WWW::SuperCat::nested_qualifier_map{$qset}{$qname}[0]\n");
-
- if ( exists($OpenILS::WWW::SuperCat::nested_qualifier_map{$qset}{$qname}) ) {
- $qualifier = $OpenILS::WWW::SuperCat::nested_qualifier_map{$qset}{$qname}[0] || 'kw';
+ if ( exists($qualifier_map{$qset}{$qname}) ) {
+ $qualifier = $qualifier_map{$qset}{$qname}{'index'} || 'kw';
+ $log->debug("SRU toEvergreen: $qset, $qname $qualifier_map{$qset}{$qname}{'index'}\n");
}
my @modifiers = $relation->getModifiers();
if ( $qualifier ) {
my ($qset, $qname) = split(/\./, $qualifier);
- $log->debug("SRU toEvergreenAuth: $qset, $qname $OpenILS::WWW::SuperCat::nested_auth_qualifier_map{$qset}{$qname}[0]\n");
-
if ( exists($OpenILS::WWW::SuperCat::nested_auth_qualifier_map{$qset}{$qname}) ) {
- $qualifier = $OpenILS::WWW::SuperCat::nested_auth_qualifier_map{$qset}{$qname}[0] || 'author';
+ $qualifier = $OpenILS::WWW::SuperCat::nested_auth_qualifier_map{$qset}{$qname}{'index'} || 'author';
+ $log->debug("SRU toEvergreenAuth: $qset, $qname $OpenILS::WWW::SuperCat::nested_auth_qualifier_map{$qset}{$qname}{'index'}\n");
}
}
return { qualifier => $qualifier, term => $term };
$set_node->setAttribute( name => $name );
$e->findnodes('/z:explain/z:indexInfo')->shift->appendChild( $set_node );
- my %attribute_desc = (
- site => 'Evergreen Site Code (shortname)',
- sort => 'Sort on relevance, title, author, pubdate, create_date or edit_date',
- dir => 'Sort direction (asc|desc)',
- available => 'Filter to available (true|false)',
- );
-
- for my $index ( @{$index_map->{$name}} ) {
- my $title = $index;
- if (exists $attribute_desc{$title}) {
- $title = $attribute_desc{$title};
- }
-
+ for my $index ( sort keys %{$index_map->{$name}} ) {
my $name_node = $doc->createElementNS( 'http://explain.z3950.org/dtd/2.0/', 'name' );
my $map_node = $doc->createElementNS( 'http://explain.z3950.org/dtd/2.0/', 'map' );
$index_node->appendChild( $map_node );
$index_node->setAttribute( id => "$name.$index" );
- $title_node->appendText($title);
+ $title_node->appendText($index_map->{$name}{$index}{'title'});
$name_node->setAttribute( set => $name );
- $name_node->appendText($index);
+ $name_node->appendText($index_map->{$name}{$index}{'index'});
$e->findnodes('/z:explain/z:indexInfo')->shift->appendChild( $index_node );
}