XIQS Complexfilter
From IQsimWiki
Revision as of 09:07, 6 December 2012 by Administrator (Talk | contribs)
Complex Filter Mechanism
For some of the "getXIQS … List", a filter mechanism can be applied to reduce the list of results or reorganize the output order (sort parameter).
This parameter object can be placed anywhere in the command and is always optional.
It takes the form of an XML structure with the following fields:
- "id" : look in the database for the specified complexfilter object Id and try to apply it to filter results
- "start" : in the whole possible results, starts output list at specified index
- "limit" : limit the output list to the specified number of objects
- "DIR" : when a sorting order is specified, defines the direction order. Only two values are accepted => "ASC" : ascending order, "DESC" : descending order
- "SORT" : specifies the output list must respect the specified sorting order
The filter criteria's semantic use JSON grammar. Some input object fields need to be defined for complexfilter to work :
- field : the name of the target field for this filter criteria
- datatype : the filter's data type. Could be number (=0), string (=1), or date (=2).
- datatype2 : (optional) used by IRON web interface only. Useless at xiqs level.
- operators : a comma separated list of data operators to apply with data values
- data : a comma separated list of data values
Example of a single criteria definition :
- {"field":"status","datatype":"0","datatype2":"0","operators":["="],"data":["720896"]}
Example of a filter creation :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<command name="createXIQSUserFilter">
<param type="string">My Filter</param>
<!-- FILTER ON SIMCARD OBJECTS (type=10) -->
<param type="integer">10</param>
</command>
Example of a filter update :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<command name="updateXIQSUserFilterInfo">
<!-- FILTER OBJECT ID TO APPLY -->
<param type="long">49</param>
<!-- FILTER ON STATUS -->
<param type="string">{"field":"status","data":["851968"],"operators":["="],"datatype":0}</param>
<!-- FILTER ON ICCID 1 -->
<param type="string">{"field":"iccid","data":["1234567890"],"operators":["!"],"datatype":0}</param>
<!-- FILTER ON ICCID 2 -->
<param type="string">{"field":"iccid","data":["0987654321"],"operators":["!"],"datatype":0}</param>
</command>