4 This module is an optional service that exposes your catalog through the [OAI2 protocol](http://www.openarchives.org/OAI/openarchivesprotocol.html).
9 There are two: one for bibliographic records and one for authority records:
11 http://your-domain/opac/extras/oai/authority
12 http://your-domain/opac/extras/oai/biblio
14 An example of a working URL on a system with an authority record with ID
17 http://your-domain/opac/extras/oai/authority?verb=GetRecord&identifier=oai:localhost:1&metadataPrefix=oai_dc
19 Setspec are not implemented
20 +++++++++++++++++++++++++++
22 This is a work in progress and not enabled. The aim is to have the owning library determine the set hierarchy. The Concerto
23 test database for example has a record with record ID #1. This record is so popular it has copies attached to library units
24 "Example Branch 1", "Example Branch 2", "Example Branch 3", "Example Bookmobile 1" which is a child of Branch 3 and
25 "Example Branch 4". This entire kinship is expressed as sets like so:
30 <setSpec>CONS</setSpec>
31 <setSpec>CONS:SYS1</setSpec>
32 <setSpec>CONS:SYS2</setSpec>
33 <setSpec>CONS:SYS1:BR1</setSpec>
34 <setSpec>CONS:SYS1:BR2</setSpec>
35 <setSpec>CONS:SYS2:BR3</setSpec>
36 <setSpec>CONS:SYS2:BR4</setSpec>
37 <setSpec>CONS:SYS2:BR3:BM1</setSpec>
40 Likewise the setSpecs of authority records are derived from their browse axis ( Title, Author, Subject and Topic ).
42 Bibliographic mapping of assets to 852 subfields
43 ++++++++++++++++++++++++++++++++++++++++++++++++
45 Certain attributes asset are placed into 852 subfields so:
48 | subfield code | asset resource
58 Thus the Concerto with record ID #1 will have it's 852 subfields expressed as:
60 <marc:datafield ind1="4" ind2=" " tag="852">
61 <marc:subfield code="a">Stacks</marc:subfield>
62 <marc:subfield code="b">BR4</marc:subfield>
63 <marc:subfield code="c">ML 60 R100</marc:subfield>
64 <marc:subfield code="d">BR4</marc:subfield>
65 <marc:subfield code="g">CONC70000435</marc:subfield>
66 <marc:subfield code="n">Checked out</marc:subfield>
69 This mapping can be customized and extended with static subfields:
71 <marc:subfield code="q">A constant value</marc:subfield>
77 See comments in opensrf.xml (in the open-ils.oai app_settings element)
78 for default configuration and customization instructions. is commented
79 in the open-ils.oai app_settings element.
84 **Activate the service**
86 Refer to the service in the opensrf.xml activeapps element:
90 <appname>open-ils.oai</appname>
93 **Register the service with the router**
95 Add the service to the public router in your opensrf_core.xml
102 <domain>public.realm</domain>
104 <service>open-ils.oai</service>
108 Optional: Setting the datestamp
109 +++++++++++++++++++++++++++++++
111 The edit date of the bibliographic and authority record is used as
112 datestamp. If you want the date for editorial updates of bibliographic
113 assets (i.e. copies, call numbers) reflected in the datestamp, then add the
114 triggers shown below.
118 CREATE OR REPLACE FUNCTION oai.datestamp(rid BIGINT)
121 UPDATE biblio.record_entry AS bre
122 SET edit_date = now()
127 CREATE OR REPLACE FUNCTION oai.call_number_datestamp()
128 RETURNS TRIGGER AS $$
132 PERFORM oai.datestamp(OLD.record);
136 PERFORM oai.datestamp(NEW.record);
142 CREATE OR REPLACE FUNCTION oai.copy_datestamp()
143 RETURNS TRIGGER AS $$
147 PERFORM oai.datestamp((SELECT acn.record FROM asset.call_number as acn WHERE acn.id = OLD.call_number));
151 PERFORM oai.datestamp((SELECT acn.record FROM asset.call_number as acn WHERE acn.id = NEW.call_number));
157 CREATE TRIGGER call_number_datestamp AFTER INSERT OR UPDATE OR DELETE ON asset.call_number FOR EACH ROW EXECUTE PROCEDURE oai.call_number_datestamp();
158 CREATE TRIGGER copy_datestamp AFTER INSERT OR UPDATE OR DELETE ON asset.copy FOR EACH ROW EXECUTE PROCEDURE oai.copy_datestamp();