Add Column Filter to Specified Field of Data Set (Overwrite the Original Column Filter)

<< Click to Display Table of Contents >>

Current:  System Integration > WebAPI 

Add Column Filter to Specified Field of Data Set (Overwrite the Original Column Filter)

Previous pageReturn to chapter overviewNext page

Version: 9.1

Request address

http://ip:port/bi/api?action=setQueryColumnFilter&token=xxxx

Request message

Request parameter

required parameter:xmlData (required)

<?xml version="1.0" encoding="UTF-8"?>

<info>

<ref>

 <type>sql</type>

 <path>test</path>

</ref>

<type>whitelist</type>

<columnFilter>

 <cols>

  <col>

   <name>PATH</name>

  </col>

  <col>

   <name>PARENT</name>

  </col>

 </cols>

 <identity>

  <ref>

 <name>test_user</name>

 <type>user</type>

  </ref>

  <ref>

 <name>test_group</name>

 <parent></parent>

 <type>group</type>

  </ref>

  <ref>

 <name>test_role</name>

 <type>role</type>

  </ref>

 </identity>

</columnFilter>

</info>

parametric description

1) ref-type (required): the type of data set.

2) ref-path (required): the path of the data set.

3) type (required): select whether to set a blacklist or a whitelist.

4) columnFilter-cols-col-name (required): The name of the column that needs to be set for column filtering.

5) columnFilter-identity-ref-name (required): set the name of the user, group, and role for column filtering.

6) columnFilter-identity-ref-type (required): Set the type of column filter node, including user, group, and role.

7) columnFilter-identity-red-parent (optional): Set the path of the group for column filtering.

Description:

1) Multiple columns can be added to cols, and column filtering is supported in batches.

2) This method will overwrite the original column filter properties of the column.

Sample

function setQueryColumnFilter() {

        var xml = getXml();

        $.post("http://" + ip + ":" + port + "/" + project + "/api?action=setQueryColumnFilter&token=xxxx",

           {xmlData : xml},

           function(result) {        

              writeXml(result);

           });

     }}

Response message

Response result

 

1) Successful operation

<?xml version="1.0" encoding="UTF-8"?>

<results>

 <result>

  <level>1</level>

  <message>Save successfully</message>

 </result>

</results>

2) Operation failed

<?xml version="1.0" encoding="UTF-8"?>

<results>

<result>

<level>6</level>

<message>\Yonghong\bihome\query\test.sqry (The system cannot find the specified file.)</message>

</result>

</results>

Result description

The response result information is xml. direct parse.

1) Level return type, different values represent different return status, see appendix.

2) Message is the interface operation result information.