260 likes | 362 Views
Two From the SFX Toolbox: A Plugin and an Target Parser . Rich Wenger, E-resource Systems Manager MIT Libraries. Agenda. Conditional display of Aleph print holdings on the SFX menu. Differential resolution of hdl.handle.net URLs. Part 1.
E N D
Two From the SFX Toolbox:A Plugin and an Target Parser Rich Wenger, E-resource Systems Manager MIT Libraries
Agenda • Conditional display of Aleph print holdings on the SFX menu. • Differential resolution of hdl.handle.net URLs.
Part 1. Conditional display of Aleph print holdings on the SFX menu.
Context • We recently completed a redesign of our SFX menu. • Our Aleph records have print and electronic holdings on the same record: “piggybacking”. • 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
Components • A modified version of the ALEPH.pm plugin • A modified version of the parser for the Aleph target • A modified target displayer for Aleph holdings on the SFX menu • A modified version of getHolding_ALEPH.tmpl • Modifications to the Aleph target • A target threshold to avoid looping to/from Aleph
Some Simplifying Assumptions • No title searches in AlephSetting in config/aleph_xserver_lookup.config • ISSN or ISBN only • Suppress “multiple records” message
Plugin ALEPHMIT.pm • Based on the standard ALEPH.pm plugin • Retrieves the document number from the first call to the Aleph x-server and stores it in the context object • Filters e-holdings from the holdings returned from Aleph • Reformats the holdings array to consolidate Location and Collection onto one line.
Target Parser ALEPHMIT.pm • Based on the standard ALEPH.pm target parser • Retrieves the document number from the context object and creates a URL pointing to a specific Full record in Aleph
Target Displayer ALEPHMIT.pm • Based on the standard ALEPH.pm target displayer • Modifies the holdings array by inserting a blank line ( ) between each set of holdings.
Template getHolding_ALEPH.tmpl • Based on the standard getHolding_ALEPH.tmpl • Adds a third variable to the template to accommodate the added line in the holdings array. • Example
Part 2. Differential resolution of handle URLs.
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 proxiede.g our DSpace instances.
Context • SFX must resolve handle URLs differently depending on the target of the resolved handle. • Proxying the handle server itself is too big a hammer, too far up stream. • We want a decision point when the handle is resolved.
Components • A local target, 856_URL_LCL • A local target parser • An external script • A Display Logic rule
Local target 856_URL_LCL • getFullTxt service • Global threshold: $obj->need('856_url') && $obj->need('856_url','=~','/hdl.handle.net/i') • Parser: HDL::handle • Parse param: ‘external_url=http://library.mit.edu/cgi-bin/handle_url.cgi?parm=‘
Local target parser HDL::handle • Retrieves the 856_URL from the context object • Retrieves the URL for external script from the parse param. • Returns URL for the target in the form:http://<external script>?parm=http:hdl.handle.net/<..>
External script handle_url.cgi • Get and decode the URL from the parm and isolate the handle domain e.g. http://hdl.handle.net/1721.1/78487 • If it is one of our DSpace domains, redirect to the handle server.
External script handle_url.cgi… • 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?globalId=hdl:1902.1/21446
Display Logic rule If available target 856_URL_LCL, any serviceDo not show 856_URL, any service.
856_URL_LCL Aleph OPAC Browser Intl. Country Risk Guide Z39.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://libproxy.mit.edu/login?url=http://thedata.harvard.edu http://hdl.handle.net/api/1902.1/21446 hdl.handle.net/api Proxy Server http://thedata.harvard.edu
Improvements Move the external script logic into the target parser
Finis Rich Wenger rwenger@mit.edu Phone 617-253-0035