Bugzilla – Attachment 108550 Details for
Bug 26195
Add a way to specify authorised values should be expanded [OAI]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26195: Add a way to specify authorised values should be expanded [OAI]
Bug-26195-Add-a-way-to-specify-authorised-values-s.patch (text/plain), 3.86 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-08-18 20:08:52 UTC
(
hide
)
Description:
Bug 26195: Add a way to specify authorised values should be expanded [OAI]
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-08-18 20:08:52 UTC
Size:
3.86 KB
patch
obsolete
>From 8ce4dc678fb5a96406f1159333c9ff71e1c9b4c5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Aug 2020 14:50:16 -0300 >Subject: [PATCH] Bug 26195: Add a way to specify authorised values should be > expanded [OAI] > >This patch introduces a new configuration entry for OAI so the resulting >records include authorised value descriptions instead of codes. > >This is off by default. > >To test: >1. Create a yaml file with the extended OAI configuration >2. Visit http://kohadev.myDNSname.org:8080/cgi-bin/koha/oai.pl >3. Browse some records >=> SUCCESS: The fields tied to AV show codes. >4. Update your configuration with 'expanded_avs: 1' for one of the > defined format like in: > > --- > format: > marc21: > metadataPrefix: marc21 > metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim > schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd > include_items: 0 > marcxml: > metadataPrefix: marcxml > metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim > schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd > include_items: 1 > expanded_avs: 1 >5. restart_all >6. Repead 3 >=> SUCCESS: AV descriptions are returned! >7. Sign off :-D >--- > C4/XSLT.pm | 1 + > Koha/OAI/Server/Repository.pm | 29 ++++++++++++++++++++--------- > 2 files changed, 21 insertions(+), 9 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 1b3941c7fb..91263b3c65 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -48,6 +48,7 @@ BEGIN { > @ISA = qw(Exporter); > @EXPORT = qw( > &XSLTParse4Display >+ &transformMARCXML4XSLT > ); > $engine=Koha::XSLT::Base->new( { do_not_return_source => 1 } ); > } >diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm >index 558606d57d..724eaa0b6b 100644 >--- a/Koha/OAI/Server/Repository.pm >+++ b/Koha/OAI/Server/Repository.pm >@@ -36,6 +36,7 @@ use YAML::Syck qw( LoadFile ); > use CGI qw/:standard -oldstyle_urls/; > use C4::Context; > use C4::Biblio; >+use C4::XSLT qw( transformMARCXML4XSLT ); > use Koha::XSLT::Base; > > =head1 NAME >@@ -82,10 +83,11 @@ mode. A configuration file koha-oai.conf can look like that: > schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd > include_items: 1 > marcxml: >- metadataPrefix: marxml >+ metadataPrefix: marcxml > metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim > schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd > include_items: 1 >+ expanded_avs: 1 > oai_dc: > metadataPrefix: oai_dc > metadataNamespace: http://www.openarchives.org/OAI/2.0/oai_dc/ >@@ -166,16 +168,25 @@ sub DESTROY { > > > sub get_biblio_marcxml { >- my ($self, $biblionumber, $format) = @_; >- my $with_items = 0; >+ my ( $self, $biblionumber, $format ) = @_; >+ my $with_items = 0; >+ my $expanded_avs = 0; > if ( my $conf = $self->{conf} ) { >- $with_items = $conf->{format}->{$format}->{include_items}; >+ $with_items = $conf->{format}->{$format}->{include_items }; >+ $expanded_avs = $conf->{format}->{$format}->{expanded_avs}; > } >- my $record = GetMarcBiblio({ >- biblionumber => $biblionumber, >- embed_items => $with_items, >- opac => 1 }); >- $record ? $record->as_xml_record() : undef; >+ >+ my $record = GetMarcBiblio( >+ { >+ biblionumber => $biblionumber, >+ embed_items => $with_items, >+ opac => 1 >+ } >+ ); >+ $record = transformMARCXML4XSLT( $biblionumber, $record ) >+ if $expanded_avs; >+ >+ return $record ? $record->as_xml_record() : undef; > } > > >-- >2.28.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26195
:
108209
|
108550
|
119628
|
121495