Preliminary use of config.metabib_field values in misc_util.tt2
authorLiam Whalen <liam@liamwhalen.com>
Sat, 10 Dec 2011 09:43:52 +0000 (04:43 -0500)
committerLiam Whalen <liam@liamwhalen.com>
Sat, 10 Dec 2011 09:43:52 +0000 (04:43 -0500)
commite92605dae1db4c5af912fd3ea238c1e7da5d3e9a
tree9b74fa0589506499be56678907acc7ab926ecc48
parentedb3de1eeb0f39b73f67c0f0e9a5619f5a526fc1
Preliminary use of config.metabib_field values in misc_util.tt2

Currently, in misc_util.tt2 various record details like isbn,
title, author, etc are loaded by using hard coded XPath expressoins.
Similar XPath expressions already exist in config.metabib_field.xpath.
This code demonstrates that the database variables can be used in place
of the hard coded XPath expressions.  Thanks to Dan Scott for providing
me with the regex needed to make the database XPath values work
within TPAC.  As the code stands now, it loads an array of values
from config.metabib_field into the ctx variable.  This gets done in
the fetch_metabib_field_xpath_and_label function within
OpenILS/WWW/EGCatLoader/Util.pm file.  This function is called in both
EGCatLoader/Record.pm and EGCatLoader/Search.pm.  In the file
misc_util.tt2 the values loaded in Util.pm are looped over until
the entry for ISBN is found.  Then, the XPath value for ISBN is
used after applying the previously mentioned regex, so the TPAC
code can grab the various ISBNs for a record.
Signed-off-by: Liam Whalen <liam@liamwhalen.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
Open-ILS/src/sql/Pg/xxx.add-display-field-to_config-metabib_field [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/misc_util.tt2