Ready to Learn?Ex Libris products all provide open APIs

get_sort_codes

General Purpose

This service formats the tab_sort table residing under a given library into an XML output reply.

 

Interface Type

X-Service

 

Product Version Compatibility

Version 18 and later

 

Input Parameter

1. LIBRARY - X (5).

Library: Insert the library for which you want to have an XML format tab_sort table.

 

Output XML Format

Each line in tab_sort will have an XML tag with its record number in the table (for example, <sort-01> for the first record in the table). For each record, all field codes and their subfields will also be included in the XML.
 

<get-sort-codes>
- <sort-01>
<field-code-1>008</field-code-1>
<field-code-2>260</field-code-2>
<sub-field-2>c</sub-field-2>
</sort-01>
- <sort-02>
<field-code-1>1</field-code-1>
<sub-field-1>a</sub-field-1>
<field-code-2>700</field-code-2>
<sub-field-2>a</sub-field-2>
</sort-02>
<session-id>MJ6DAKYQANKTLPV82ESV6MN7FRDKXIKBGBRIH9QIQ1H46QEHK5</session-id>



Example:
If you want to get formatted XML for the tab_sort table residing under the USM01 library, enter the following URL:

http://ram19:8991/X?op=get-sort-codes&library=usm01


In USM01, the tab_sort table looks like this:
 

1234567891011213141516171819
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0195008  260##c          0804
02011####a 700##a          0000
0311245##a2240## 2         0000
0422050##  LOC##hjl          0000
0511440##av2            0000
06 TYP##  FMT##           0000



The output will only generate the codes (fields: 3, 6, 9, 12, 15) and subfields (fields: 4,7,10,13,16):

- <get-sort-codes>
 - <sort-01>
<field-code-1>008</field-code-1>
<field-code-2>260##</field-code-2>
<sub-field-2>c</sub-field-2>
</sort-01>
 - <sort-02>
<field-code-1>1####</field-code-1>
<sub-field-1>a</sub-field-1>
<field-code-2>700##</field-code-2>
<sub-field-2>a</sub-field-2>
</sort-02>
 - <sort-03>
<field-code-1>245##</field-code-1>
<sub-field-1>a</sub-field-1>
<field-code-2>240##</field-code-2>
 </sort-03>
 - <sort-04>
<field-code-1>050##</field-code-1>
<field-code-2>LOC##</field-code-2>
<sub-field-2>hjl</sub-field-2>
</sort-04>
- <sort-05>
<field-code-1>440##</field-code-1>
<sub-field-1>av</sub-field-1>
</sort-05>
<session-id>MJ6DAKYQANKTLPV82ESV6MN7FRDKXIKBGBRIH9QIQ1H4
6QEHK5</session-id>
</get-sort-codes>

 

Possible Error Codes

1. If the Get Sort Codes X-Service is activated without a library code having been entered, the following error message appears in the XML output:

< error>Library must be included in service params.</error>

2. If, for the given library, the tab_sort table is empty, the following error message appears in the XML output:

< error>Tab_Sort table is empty for given Library.</error>