sort_set

General Purpose

This service re-sorts a specific set of documents according to the parameters given.

Input Parameters

1. LIBRARY – X (5).
2. SET_NUMBER . 9 (6).
3. SORT_CODE_1 . X (2).
4. SORT_ORDER_1 . X (1).
5. SORT_CODE_2 . X (2).
6. SORT_ORDER_2 . X (1).

Library: The library which includes the set to be re-sorted.
Set_Number / Set_Num / Set_No: The number of the set to be re-sorted.
Sort_Code_1: The first sort is done based on this code.
Sort_Order_1: First sort’s direction (Ascending / Descending).
Sort_Code_2: Second sort is done based on this code.
Sort_Order_2: Second sort’s direction (Ascending / Descending).

Output XML Format

The XML output includes session-id only if the service is successful. Its purpose is to re-sort a set of documents and not to retrieve data. If the service is not successful, the XML includes an error message.

Example:
To sort set number 512 (as in Z05, Z110) as follows:

First sort, according to title (first code in tab_sort in record 03) in Ascending order.
Second sort, according to year (first code in tab_sort in record 01) in Descending order.

Under GEN01 library, enter the following URL:

http://il-dtldev02:8881/X?op=sort-set&library=gen01&set_number=512&sort_code_1=03&sort_order_1=A&sort_code_2=01&sort_order_2=D

If the input parameters are correct and the re-sorting is successful, the XML only includes session-id (included in all X-Services’ output):

<?xml version="1.0" encoding="UTF-8" ?> 
<sort-set>
<session-id>GC43YBUHVV7BY6GR1GU6S31GVIXRKU74FP1KPQ4YAB972YXAM4</session-id>
</sort-set>

Possible Error Codes

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

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

2. If no set number is given, the following error message appears in the XML output:

<error>Set number must be specified</error>

3. If one of the four parameters indicating what kind of re-sort is needed is empty, the following error message appears in the XML output:

<error>Sort instructions must be given</error>

4. If the set number given does not exist in the Z05 table (for example, 999), the following error message appears in the XML output (same message appear if the set number does not exist in Z110):

<error>Set Number: 000999 doesn't exist in Z05</error>

5. If, for some reason, the re-sorting fails (for example, for set 999):

<error>Sorting set number 000999 has been failed</error>