Ready to Learn?Ex Libris products all provide open APIs

publish_avail

 

General Purpose

This service supplies the current availability status of a document.

The X-Server does not change any data.

 

Interface Type

X-Service

 

Product Version Compatibility

Version 18 and later

 

Input Parameters

1. Up to 10 DOC_NUM 9(9) separated by "," (a comma).
2. LIBRARY X (5).
 

  • Doc_Num: The document number.
  • Library: BIB library to which the document belongs.

 

Output XML Format

The output XML either includes document metadata or a descriptive error code, depending on whether or not the document exists in the database.

Example:
To retrieve metadata and the availability status for document numbers 000010000 and 000010001 in the USM01 BIB library, enter the following URL:

http://il-aleph02:8134/X?op=publish_avail&doc_num=000010000,000010001&library=usm01


If successful, the output XML contains the documents requested (only 000010000 is shown):

<?xml version="1.0" encoding="UTF-8" ?>
- <publish-avail>
- <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-
PMH.xsd">
- <ListRecords>
- <record>
- <header>
  <identifier>aleph-publish:000010000</identifier>
  </header>
- <metadata>
- <record xmlns="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim
http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
  <leader>00000ncm 22002175a 4500</leader>
  <controlfield tag="FMT">MU</controlfield>
  <controlfield tag="LDR">00000ncm 22002175a 4500</controlfield>
  <controlfield tag="001">000010000</controlfield>
  <controlfield tag="005">20060918084137.0</controlfield>
  <controlfield tag="008">870923s1920 nyuzzz nn| yid|d</controlfield>
- <datafield tag="028" ind1="3" ind2="2">
  <subfield code="a">502</subfield>
  <subfield code="b">Teres</subfield>
  </datafield>
- <datafield tag="100" ind1="1" ind2="">
  <subfield code="a">Behr, Fr.</subfield>
  </datafield>
- <datafield tag="245" ind1="1" ind2="0">
  <subfield code="a">Camp of the gipsies =testagainagain :</subfield>
  <subfield code="b">Im zigeunerlager / Fr. Behr.</subfield>
  </datafield>
- <datafield tag="246" ind1="3" ind2="1">
  <subfield code="a">Im zigeunerlager</subfield>
  </datafield>
- <datafield tag="260" ind1="0" ind2="">
  <subfield code="a">New York :</subfield>
  <subfield code="b">A. Teres,</subfield>
  <subfield code="c">[192?].</subfield>
  </datafield>
- <datafield tag="300" ind1="" ind2="">
  <subfield code="a">5 p. of music ;</subfield>
  <subfield code="c">31 cm.</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">For piano.</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">Cover title.</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">"Op. 224, No. 3"--Cover</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">"Op. 424, No. 3"--Caption.</subfield>
  </datafield>
- <datafield tag="650" ind1="" ind2="4">
  <subfield code="a">Lamb Chops</subfield>
  </datafield>
- <datafield tag="650" ind1="" ind2="0">
  <subfield code="a">Piano music.</subfield>
  </datafield>
- <datafield tag="OWN" ind1="" ind2="">
  <subfield code="a">PUBLIC</subfield>
  </datafield>
  </record>
  </metadata>
  </record>
  </ListRecords>
  </OAI-PMH>
- <OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-


instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-

PMH.xsd">
- <ListRecords>
- <record>
- <header>
  <identifier>aleph-publish:000010000</identifier>
  </header>
- <metadata>
- <record xmlns="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.loc.gov/MARC21/slim

http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
  <leader>00000ncm 22002175a 4500</leader>
  <controlfield tag="FMT">MU</controlfield>
  <controlfield tag="LDR">00000ncm 22002175a 4500</controlfield>
  <controlfield tag="001">000010000</controlfield>
  <controlfield tag="005">20060918084137.0</controlfield>
  <controlfield tag="008">870923s1920 nyuzzz nn| yid|d</controlfield>
- <datafield tag="028" ind1="3" ind2="2">
  <subfield code="a">502</subfield>
  <subfield code="b">Teres</subfield>
  </datafield>
- <datafield tag="100" ind1="1" ind2="">
  <subfield code="a">Behr, Fr.</subfield>
  </datafield>
- <datafield tag="245" ind1="1" ind2="0">
  <subfield code="a">Camp of the gipsies =testagainagain :</subfield>
  <subfield code="b">Im zigeunerlager / Fr. Behr.</subfield>
  </datafield>
- <datafield tag="246" ind1="3" ind2="1">
  <subfield code="a">Im zigeunerlager</subfield>
  </datafield>
- <datafield tag="260" ind1="0" ind2="">
  <subfield code="a">New York :</subfield>
  <subfield code="b">A. Teres,</subfield>
  <subfield code="c">[192?].</subfield>
  </datafield>
- <datafield tag="300" ind1="" ind2="">
  <subfield code="a">5 p. of music ;</subfield>
  <subfield code="c">31 cm.</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">For piano.</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">Cover title.</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">"Op. 224, No. 3"--Cover</subfield>
  </datafield>
- <datafield tag="500" ind1="" ind2="">
  <subfield code="a">"Op. 424, No. 3"--Caption.</subfield>
  </datafield>
- <datafield tag="650" ind1="" ind2="4">
  <subfield code="a">Lamb Chops</subfield>
  </datafield>
- <datafield tag="650" ind1="" ind2="0">
  <subfield code="a">Piano music.</subfield>
  </datafield>
- <datafield tag="OWN" ind1="" ind2="">
  <subfield code="a">PUBLIC</subfield>
  </datafield>
  </record>
  </metadata>
  </record>
  </ListRecords>
  </OAI-PMH>
  <session-id>LIJPXEAXGD6CH29TVPX17FQVSMD9XLN49R2B7FD119VLLISRP6</session-id>
  </publish-avail>

 

Possible Error Codes

1. If the document number does not exist in the database, the following error message displays:

- <error>
< error_code>21</error_code>
< error_message>Error reading document</error_message>
< /error>

2. If the URL entered does not have a DOC_NUM, the following message is returned:

< ?xml version="1.0" encoding="UTF-8" ?>
- <publish-avail>
< session-id>BK3GTHEKU5ERDIX3GGKVS3NQY3BHH8QJFPAULFV8EN3CRISIJN</session-id>
< error>doc_num must be included in parameters</error>
< /publish-avail>

Notes

The "publish_avail" service can be configured to use the "expand_doc_bib_avail" expand procedure and with parameters.
This can be done by using the "X-AVAIL" entry - in Column 1 of "tab_expand" (in the BIB library) - and parameters in Col. 3.

For example, you can set in "tab_expand" the following:

!   1                   2                            3
!!!!!!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>

X-AVAIL    expand_doc_bib_avail           THRESHOLD=200;AVA=BP,BD,PB,GV,CA,CT,CL,MI,MS,RE

When there is no "X-AVAIL" entry in "tab_expand" (in the BIB library) - then the "publish_avail" X-service uses the "expand_doc_bib_avail" expand procedure without any parameters.