sort_set
General Purpose
The service re-sorts a specific set of documents according to parameters provided by the user.
Interface Type
X-Service
Product Version Compatibility
Version 18 and later
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 that includes the set that the user would like to re-sort.
- Set_Number/Set_Num/Set_No: The number of the set to be re-sorted.
- Sort_Code_1: The first sort is based on this code.
- Sort_Order_1: The direction of the first sort (Ascending/Descending).
- Sort_Code_2: The second sort is based on this code.
- Sort_Order_2: The direction of the second sort (Ascending/Descending).
Output XML Format
The output XML includes only the session-id if it was completed successfully, since its purpose is to re-sort a set of documents and not to retrieve data.
Example:
The user would like to sort set number 512 (as in Z05, Z110) with the following criteria:
1. First sort -By Title (First code in Tab_Sort in record 03) in ascending order.
2. Second sort – By year (First code in Tab_Sort in record 01) in descending order.
Under library USM01.
http://ram19:8995/X?op=sort-set&library=usm01& set_number=512&sort_code_1=03&sort_order_1=A&sort_code_2=01&sort_order_2=D
The following is the XML output:
<?xml version = "1.0" encoding = "UTF-8"?> <sort-set> <session-id>QFMAHJN49G63247V9QBVLNFB6617I1DD1HC6MFTMF3KDAKT2HL</session-id> </sort-set>
Possible Error Codes
1. If the user tried to activate Sort Set X-Service without giving Library as an input:
< error>Library must be included in service params.</error>
2. If the user did not provide any set_number
< error>Set number must be specified</error>
3. If one of the 4 parameters indicating what kind of re-sort is needed is empty:
< error>Sort instructions must be given</error>
4. If the set_number given by the user doesn’t exist in Z05 table (e.g. 999):
< error>Set Number: 000999 doesn’t exist in Z05</error>
5. If the re-sorting failed (e.g. for set 999):
< error>Sorting set number 000999 has been failed</error>