Two From the SFX Toolbox A Plugin and
Two From the SFX Toolbox: A Plugin and an Target Parser Rich Wenger, E-resource Systems Manager MIT Libraries
Agenda 1. Conditional display of Aleph print holdings on the SFX menu. 2. Differential resolution of hdl. handle. net URLs. SFX <=> Aleph | ELUNA 2014 Page 2
Part 1. Conditional display of Aleph print holdings on the SFX menu. SFX <=> Aleph | ELUNA 2014 Page 3
Context 1. We recently completed a redesign of our SFX menu. 2. Our Aleph records have print and electronic holdings on the same record: “piggybacking”. 3. A philosophical change to our handling of Aleph holdings on the SFX menu: “The American judicial system does not promise justice. It promises a chance at justice” -Paul Newman in The Verdict SFX <=> Aleph | ELUNA 2014 Page 4
Components 1. A modified version of the ALEPH. pm plugin 2. A modified version of the parser for the Aleph target 3. A modified target displayer for Aleph holdings on the SFX menu 4. A modified version of get. Holding_ALEPH. tmpl 5. Modifications to the Aleph target 6. A target threshold to avoid looping to/from Aleph SFX <=> Aleph | ELUNA 2014 Page 5
Some Simplifying Assumptions 1. No title searches in Aleph Setting in config/aleph_xserver_lookup. config 2. ISSN or ISBN only 3. Suppress “multiple records” message SFX <=> Aleph | ELUNA 2014 Page 6
Plugin ALEPHMIT. pm 1. Based on the standard ALEPH. pm plugin 2. Retrieves the document number from the first call to the Aleph x-server and stores it in the context object 3. Filters e-holdings from the holdings returned from Aleph 4. Reformats the holdings array to consolidate Location and Collection onto one line. SFX <=> Aleph | ELUNA 2014 Page 7
Holdings array Barker Library Microforms v. 92 (1970)-v. 95 (1973), v. 97 (1975)-v. 119 (1997) Library Storage Annex Journal Collection v. 81 (1959)-v. 131: no. 1 -6 (2009) SFX <=> Aleph | ELUNA 2014 Page 8
Holdings array Barker Library - Microforms v. 92 (1970)-v. 95 (1973), v. 97 (1975)-v. 119 (1997) Library Storage Annex - Journal Collection v. 81 (1959)-v. 131: no. 1 -6 (2009) SFX <=> Aleph | ELUNA 2014 Page 9
Target Parser ALEPHMIT. pm 1. Based on the standard ALEPH. pm target parser 2. Retrieves the document number from the context object and creates a URL pointing to a specific Full record in Aleph SFX <=> Aleph | ELUNA 2014 Page 10
Target Displayer ALEPHMIT. pm 1. Based on the standard ALEPH. pm target displayer 2. Modifies the holdings array by inserting a blank line ( ) between each set of holdings. SFX <=> Aleph | ELUNA 2014 Page 11
Holdings array Barker Library - Microforms v. 92 (1970)-v. 95 (1973), v. 97 (1975)-v. 119 (1997) Library Storage Annex - Journal Collection v. 81 (1959)-v. 131: no. 1 -6 (2009) SFX <=> Aleph | ELUNA 2014 Page 12
Template get. Holding_ALEPH. tmpl 1. Based on the standard get. Holding_ALEPH. tmpl 2. Adds a third variable to the template to accommodate the added line in the holdings array. 3. Example SFX <=> Aleph | ELUNA 2014 Page 13
Part 2. Differential resolution of handle URLs. SFX <=> Aleph | ELUNA 2014 Page 14
The problem Some hdl. handle. net URLs resolve to targets that should be proxied e. g. Harvard Dataverse Network, and some resolve to targets that should NOT be proxied e. g our DSpace instances. SFX <=> Aleph | ELUNA 2014 Page 15
Context 1. SFX must resolve handle URLs differently depending on the target of the resolved handle. 2. Proxying the handle server itself is too big a hammer, too far up stream. 3. We want a decision point when the handle is resolved. SFX <=> Aleph | ELUNA 2014 Page 16
Components 1. A local target, 856_URL_LCL 2. A local target parser 3. An external script 4. A Display Logic rule SFX <=> Aleph | ELUNA 2014 Page 17
Local target 856_URL_LCL 1. get. Full. Txt service 2. Global threshold: $obj->need('856_url') && $obj>need('856_url', '=~', '/hdl. handle. net/i') 3. Parser: HDL: : handle 4. Parse param: ‘external_url=http: //library. mit. edu/cgi-bin/handle_url. cgi? parm=‘ SFX <=> Aleph | ELUNA 2014 Page 18
Local target parser HDL: : handle 1. Retrieves the 856_URL from the context object 2. Retrieves the URL for external script from the parse param. 3. Returns URL for the target in the form: http: //<external script>? parm=http: hdl. handle. net/<. . > SFX <=> Aleph | ELUNA 2014 Page 19
External script handle_url. cgi 1. Get and decode the URL from the parm and isolate the handle domain e. g. http: //hdl. handle. net/1721. 1/78487 2. If it is one of our DSpace domains, redirect to the handle server. SFX <=> Aleph | ELUNA 2014 Page 20
External script handle_url. cgi… 1. Otherwise, send the handle to the handle server API: • http: //hdl. handle. net/api/1902. 1/21446 • Receive and decode the JSON response, and extract the target URL • Construct a URL for the proxy server and redirect: http: //libproxy. mit. edu/login? url=http: //thedata. harvard. edu /dvn/study? global. Id=hdl: 1902. 1/21446 SFX <=> Aleph | ELUNA 2014 Page 21
Display Logic rule If available target 856_URL_LCL, any service Do not show 856_URL, any service. SFX <=> Aleph | ELUNA 2014 Page 22
856_URL_LCL Aleph OPAC Browser Intl. Country Risk Guide Z 39. 50 MARC record fetch http: //sfx. edu/sfx_local/? title=ICRG&…. SFX 856_url: $uhttp: //hdl. handle. net/1902. 1/21446 handle_url. cgi
handle_url. cgi Parm= http: //hdl. handle. net/1902. 1/21446 http: //hdl. handle. net/api/1902. 1/21446 http: //libproxy. mit. edu/login? ur l=http: //thedata. harvard. edu hdl. handle. net/api Proxy Server http: //thedata. harvard. edu
Improvements Move the external script logic into the target parser SFX <=> Aleph | ENUG 2013 Page 25
Finis Rich Wenger Phone rwenger@mit. edu 617 -253 -0035 SFX <=> Aleph | ENUG 2013 Page 26
- Slides: 26