It is not uncommon to prefer descriptions to codes when exposing the library data through OAI. I propose we add a configuration option (off by default) that allows such a thing.
Created attachment 108209 [details] [review] 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 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Sounds interesting. I'll add it to my list!
Created attachment 108550 [details] [review] 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
Created attachment 119628 [details] [review] 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 Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 121495 [details] [review] 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 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
What about having it more generic? At least the naming to start. We will want to "expand" itemtypes as well for instance. Do we really need the whole Koha::AV object or do we finally only need the description? It's similar to the 'columns_to_str' methods I introduced on bug 27526 (yes Tomas, I know you told me already), where we want to have stringified values of object's attributes.
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.04 by request.
Enhancement not pushed to 20.11.x