26
Two From the SFX Toolbox: A Plugin and an Target Parser Rich Wenger, E-resource Systems Manager MIT Libraries

Two From the SFX Toolbox: A Plugin and an Target Parser

  • Upload
    neva

  • View
    41

  • Download
    0

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: Two From the SFX Toolbox: A Plugin and an Target Parser

Two From the SFX Toolbox:A Plugin and an Target Parser

Rich Wenger, E-resource Systems Manager

MIT Libraries

Page 2: Two From the SFX Toolbox: A Plugin and an Target Parser

Agenda

1. Conditional display of Aleph print holdings on the SFX menu.

2. Differential resolution of hdl.handle.net URLs.

SFX <=> Aleph | ELUNA 2014Page 2

Page 3: Two From the SFX Toolbox: A Plugin and an Target Parser

Part 1.

Conditional display of Aleph print holdings on the SFX menu.

SFX <=> Aleph | ELUNA 2014Page 3

Page 4: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 4

Page 5: Two From the SFX Toolbox: A Plugin and an Target Parser

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 getHolding_ALEPH.tmpl

5. Modifications to the Aleph target

6. A target threshold to avoid looping to/from Aleph

SFX <=> Aleph | ELUNA 2014Page 5

Page 6: Two From the SFX Toolbox: A Plugin and an Target Parser

Some Simplifying Assumptions

1. No title searches in AlephSetting in config/aleph_xserver_lookup.config

2. ISSN or ISBN only

3. Suppress “multiple records” message

SFX <=> Aleph | ELUNA 2014Page 6

Page 7: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 7

Page 8: Two From the SFX Toolbox: A Plugin and an Target Parser

Holdings array

SFX <=> Aleph | ELUNA 2014Page 8

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)

Page 9: Two From the SFX Toolbox: A Plugin and an Target Parser

Holdings array

SFX <=> Aleph | ELUNA 2014Page 9

Barker Library - Microformsv.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)

Page 10: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 10

Page 11: Two From the SFX Toolbox: A Plugin and an Target Parser

Target Displayer ALEPHMIT.pm

1. Based on the standard ALEPH.pm target displayer

2. Modifies the holdings array by inserting a blank line (&nbsp;) between each set of holdings.

SFX <=> Aleph | ELUNA 2014Page 11

Page 12: Two From the SFX Toolbox: A Plugin and an Target Parser

Holdings array

SFX <=> Aleph | ELUNA 2014Page 12

Barker Library - Microformsv.92 (1970)-v.95 (1973),v.97 (1975)-v.119 (1997)

&nbsp;

Library Storage Annex - Journal Collection

v.81 (1959)-v.131:no.1-6 (2009)

&nbsp;

Page 13: Two From the SFX Toolbox: A Plugin and an Target Parser

Template getHolding_ALEPH.tmpl

1. Based on the standard getHolding_ALEPH.tmpl

2. Adds a third variable to the template to accommodate the added line in the holdings array.

3. Example

SFX <=> Aleph | ELUNA 2014Page 13

Page 14: Two From the SFX Toolbox: A Plugin and an Target Parser

Part 2.

Differential resolution of handle URLs.

SFX <=> Aleph | ELUNA 2014Page 14

Page 15: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 15

Page 16: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 16

Page 17: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 17

Page 18: Two From the SFX Toolbox: A Plugin and an Target Parser

Local target 856_URL_LCL

1. getFullTxt 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 2014Page 18

Page 19: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 19

Page 20: Two From the SFX Toolbox: A Plugin and an Target Parser

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 2014Page 20

Page 21: Two From the SFX Toolbox: A Plugin and an Target Parser

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?globalId=hdl:1902.1/21446

SFX <=> Aleph | ELUNA 2014Page 21

Page 22: Two From the SFX Toolbox: A Plugin and an Target Parser

Display Logic rule

If available target 856_URL_LCL, any service

Do not show 856_URL, any service.

SFX <=> Aleph | ELUNA 2014Page 22

Page 23: Two From the SFX Toolbox: A Plugin and an Target Parser

handle_url.cgi

SFX

Aleph OPACBrowser

Z39.50 MARC record fetch

856_URL_LCL

Intl. Country Risk Guide

http://sfx.edu/sfx_local/?title=ICRG&….

856_url: $uhttp://hdl.handle.net/1902.1/21446

Page 24: Two From the SFX Toolbox: A Plugin and an Target Parser

handle_url.cgi

hdl.handle.net/api Proxy Server

http://thedata.harvard.edu

Parm=http://hdl.handle.net/1902.1/21446

http://libproxy.mit.edu/login?url=http://thedata.harvard.eduhttp://hdl.handle.net/api/1902.1/21446

Page 25: Two From the SFX Toolbox: A Plugin and an Target Parser

Improvements

SFX <=> Aleph | ENUG 2013Page 25

Move the external script logic into the target parser

Page 26: Two From the SFX Toolbox: A Plugin and an Target Parser

Finis

SFX <=> Aleph | ENUG 2013Page 26

Rich Wenger [email protected] Phone 617-253-0035