Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
evergreen-admin:sru_and_z39.50 [2009/07/11 00:32] – Better command line for running simple2zoom dbs | evergreen-admin:sru_and_z39.50 [2013/01/23 07:26] – [Setting up the Z39.50 server] wolf29 |
---|
======Evergreen: SRU and Z39.50 server support====== | ======Evergreen: SRU and Z39.50 server support====== |
[[http://www.loc.gov/standards/sru/|Search/Retrieval via URL (SRU)]] is a specification for searching resources that relies on standard Web technology (HTTP, XML) for its implementation. Evergreen 1.4 supports basic SRU access through the /opac/extras/sru service defined in the Apache ''eg_vhost.conf'' configuration file and implemented in the sru_search() method in [[http://svn.open-ils.org/trac/ILS/browser/trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm|Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm]]. | [[http://www.loc.gov/standards/sru/|Search/Retrieval via URL (SRU)]] is a specification for searching resources that relies on standard Web technology (HTTP, XML) for its implementation. Evergreen 1.4 supports basic SRU access through the /opac/extras/sru service defined in the Apache ''eg_vhost.conf'' configuration file and implemented in the sru_search() method in [[http://svn.open-ils.org/trac/ILS/browser/trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm|Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm]]. |
| |
| |
| **NOTE:** This documentation is also available in the Evergreen documentation at http://libdog.mohawkcollege.ca/evergreen_documentation/1.6/draft/html/. In github: http://github.com/rsoulliere/Evergreen-DocBook/blob/master/1.6/admin/z3950.xml. |
| |
=====Testing Evergreen SRU with yaz-client===== | =====Testing Evergreen SRU with yaz-client===== |
yaz-client is installed as a part of Index Data's YAZ software. Recent versions include support for querying SRU servers. To search Evergreen with yaz-client, choose the GET query method and issue the ''find'' command: | yaz-client is installed as a part of Index Data's YAZ software. Recent versions include support for querying SRU servers. Evergreen has shipped an SRU configuration that works out of the box since Evergreen 1.4. To search Evergreen with yaz-client, choose the GET query method and issue the ''find'' command. In the following example, we connect to the Evergreen test server "dev.gapines.org"; substitute this hostname with your own Evergreen server hostname: |
<code> | <code> |
$ yaz-client | $ yaz-client http://dev.gapines.org/opac/extras/sru |
Z> sru GET 1.1 | Z> sru GET 1.1 |
Z> find hemingway | Z> find hemingway |
<zurl>http://dev.gapines.org/opac/extras/sru</zurl> | <zurl>http://dev.gapines.org/opac/extras/sru</zurl> |
<option name="sru">get</option> | <option name="sru">get</option> |
<charset>utf8</charset> | <charset>marc-8</charset> |
<search> | <search> |
<querytype>cql</querytype> | <querytype>cql</querytype> |
</client> | </client> |
</code> You can have multiple **<database>** sections in a single file, each pointing to a different scope of your consortium. The **name** attribute on the **<database>** element is used in your Z39.50 connection string to name the database. The **<zurl>** element must point to ''http://hostname/opac/extras/sru''. As of Evergreen 1.6, you can append an optional organization unit shortname for search scoping purposes, and you can also append **/holdings** if you want to expose the holdings for any returned records. So your zurl could be ''http://dev.gapines.org/opac/extras/sru/BR1/holdings'' to limit the search scope to BR1 and its children, and to expose its holdings. | </code> You can have multiple **<database>** sections in a single file, each pointing to a different scope of your consortium. The **name** attribute on the **<database>** element is used in your Z39.50 connection string to name the database. The **<zurl>** element must point to ''http://hostname/opac/extras/sru''. As of Evergreen 1.6, you can append an optional organization unit shortname for search scoping purposes, and you can also append **/holdings** if you want to expose the holdings for any returned records. So your zurl could be ''http://dev.gapines.org/opac/extras/sru/BR1/holdings'' to limit the search scope to BR1 and its children, and to expose its holdings. |
- Then we need to create a configuration file that will tell YAZ how to transform marcxml to binary MARC21. We will call this one xml2marc-yaz.cfg:<code xml> | - Then we need to create a configuration file that will tell YAZ how to transform marcxml to binary MARC21. Along the way, we force the output character set to be MARC-8, because in the dinosaur world of library technology some major Z39.50 clients such as RefWorks and OCLC VDX still appear to be unable to support Unicode UTF-8 encoding. We will call this one ''xml2marc-yaz.cfg'':<code xml> |
<yazgfs> | <yazgfs> |
<server id="server1"> | <server id="server1"> |
<retrieval syntax="marc21"> | <retrieval syntax="marc21"> |
<backend syntax="xml"> | <backend syntax="xml"> |
<marc inputformat="xml" outputformat="marc" outputcharset="utf-8"/> | <marc inputformat="xml" outputformat="marc" inputcharset="utf-8" outputcharset="marc-8"/> |
</backend> | </backend> |
</retrieval> | </retrieval> |
</code> | </code> |
- Run simple2ZOOM as a daemon, specifying the configuration files and one or more listener addresses that the Z39.50 server will be accessible on. If you do not specify a port, it will automatically run on port 9999. In the following example, we tell it to listen both to localhost on port 2210, and on dev.gapines.org on port 210:<code bash> | - Run simple2ZOOM as a daemon, specifying the configuration files and one or more listener addresses that the Z39.50 server will be accessible on. If you do not specify a port, it will automatically run on port 9999. In the following example, we tell it to listen both to localhost on port 2210, and on dev.gapines.org on port 210:<code bash> |
simple2zoom -c dgo.conf -- -f xml2marc-yaz.cfg localhost:2210 dev.gapines.org:210</code> | simple2zoom -c dgo.conf -- -f xml2marc-yaz.cfg localhost:2210 dev.gapines.org:210 &</code> |
| |
To test the Z39.50 server, we can use yaz-client again:<code> | To test the Z39.50 server, we can use yaz-client again:<code> |
Options: search present delSet triggerResourceCtrl scan sort namedResultSets | Options: search present delSet triggerResourceCtrl scan sort namedResultSets |
Elapsed: 0.010718 | Elapsed: 0.010718 |
Z> format marcxml | Z> format xml |
Z> find "dc.title=zone and dc.author=king" | Z> find "dc.title=zone and dc.author=king" |
Sent searchRequest. | Sent searchRequest. |