Making a grid request - HxGN EAM - Version 11.07.01 - Customization & Programming - Hexagon

HxGN EAM Web Services Toolkit Help

Language
English (United States)
Product
HxGN EAM
Search by Category
Customization & Programming
HxGN EAM Version
11.7.1

A regular get request returns only one specified business object. If you need to retrieve a list of values for multiple objects, a grid request is used. A grid object defines the query elements needed to retrieve the data. This includes a predefined SQL from and where clause defined by the system (which is used to enforce security requirements and join multiple physical tables). The result list of fields may come from a default definition or may be overridden by the grid request. Also, additional filter criteria can be added to the grid request. Finally, the sort criteria can be overridden as well.

A grid response can also include metadata about the list of allowed displayable fields, sortable fields, and filterable fields. This is called header data. The data portion includes definitions of each column retrieved, followed by multiple rows of data.

The response data can be returned in buffers of a given requested number of rows. A row offset can allow multiple blocks to be returned until all rows are returned, which is noted by a flag. A complete definition of all attributes and elements of the grid request and response is provided in the HxGN EAM Connector Grid Services Guide.

This example uses the grid request named MP0118_GetGridHeaderData_001to return all "Work Order" business objects.

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

<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by XMLSPY 5 Professional Ed. Release 2, Installed Multi for 7 users (Datastream Systems, Inc) -->

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">

<UsernameToken Id="MyID">

<Username>R5</Username>

<Password>R5</Password>

</UsernameToken>

</wsse:Security>

<dstm:SessionScenario xmlns:dstm="http://schemas.datastream.net/MP_functions">terminate</dstm:SessionScenario>

<dstm:Organization xmlns:dstm="http://schemas.datastream.net/MP_functions">*</dstm:Organization>

</soapenv:Header>

<soapenv:Body>

<MP0118_GetGridHeaderData_001 xsi:schemaLocation="http://schemas.datastream.net/MP_functions/MP0118_GetGridHeaderData_001" xmlns:dsg="http://schemas.datastream.net/MP_functions/GridRequest">

<FUNCTION_REQUEST_INFO REQUEST_TYPE="LOV.HEAD_DATA.STORED">

<dsg:GRID GRID_NAME="LVLOCA"/>

<dsg:GRID_TYPE TYPE="LOV"/>

<dsg:LOV>

<dsg:LOV_PARAMETERS>

<dsg:LOV_PARAMETER ALIAS_NAME="control.org" TYPE="text" VALUE="ORG1"/>

<dsg:LOV_PARAMETER ALIAS_NAME="param.safety" TYPE="checkbox" VALUE=""/>

</dsg:LOV_PARAMETERS>

</dsg:LOV>

</FUNCTION_REQUEST_INFO>

</MP0118_GetGridHeaderData_001>

</soapenv:Body>

</soapenv:Envelope>

The response includes metadata about the number of rows returned and whether more data follows. An alias for each column is defined to allow for terse row output. Finally, the data for each row is included in the DATA element.

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

<soapenv:Envelope

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<MP0118_GetGridHeaderData_001_Result

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

<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by XMLSPY 5 Professional Ed. Release 2, Installed Multi for 7 users (Datastream Systems, Inc) -->

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="">

<soapenv:Body>

<MP0118_GetGridHeaderData_001_Result xmlns="http://schemas.datastream.net/MP_results/MP0118_001" xmlns:dsg="http://schemas.datastream.net/MP_functions/GridResult">

<GRIDRESULT type="LOV.HEAD_DATA.STORED">

<dsg:DATASPY id="26" label="Location LOV"/> WEB SERVICES TOOLKIT 15

<dsg:GRID>

<dsg:METADATA>

<dsg:REQUEST_TYPE_META>LOV.HEAD_DATA.STORED</dsg:REQUEST_TYPE_META>

<dsg:RECORDS>2</dsg:RECORDS>

<dsg:CLIENTROWS>100</dsg:CLIENTROWS>

<dsg:PORTLETROWS>5</dsg:PORTLETROWS>

<dsg:MORERECORDPRESENT>-</dsg:MORERECORDPRESENT>

<dsg:CURRENTCURSORPOSITION>0</dsg:CURRENTCURSORPOSITION>

<dsg:SERVERTIMESTAMP>1049406669309</dsg:SERVERTIMESTAMP>

<dsg:PORTLETFLAG>-</dsg:PORTLETFLAG>

<dsg:HASCREATEAUTH hasauth="false"/>

<dsg:EDITABLE>+</dsg:EDITABLE>

<dsg:GRIDID>26</dsg:GRIDID>

<dsg:GRIDNAME>LVLOCA</dsg:GRIDNAME>

<dsg:GRIDLABEL>Locations</dsg:GRIDLABEL>

<dsg:DATASPYID>26</dsg:DATASPYID>

<dsg:ISTAB>-</dsg:ISTAB>

</dsg:METADATA>

<dsg:DATA>

<dsg:ROW id="1">

<dsg:D n="1">10009</dsg:D>

<dsg:D n="101">LOCATION100</dsg:D>

<dsg:D n="102">ORG1</dsg:D>

<dsg:D n="103">>location 1000</dsg:D>

<dsg:D n="478"/>

</dsg:ROW>

<dsg:ROW id="2">

<dsg:D n="101">LOCATION200</dsg:D>

<dsg:D n="102">ORG2</dsg:D>

<dsg:D n="103">>loc2000</dsg:D>

<dsg:D n="478">-1</dsg:D>

</dsg:ROW>

</dsg:DATA>

<dsg:FIELDS viewtype="LOV" visiblerowcount="">

<FIELD aliasnum="478" name="safety"/>

<FIELD aliasnum="101" name="parentlocation"/>

<FIELD aliasnum="102" name="locorganization"/>

<FIELD aliasnum="103" name="des_text"/>

</dsg:FIELDS>

</dsg:GRID>

</GRIDRESULT>

</MP0118_GetGridHeaderData_001_Result>

</soapenv:Body>

</soapenv:Envelope>

The attribute ‘RESULT_IN_SAXORDER’ may be added to the GetGridHeaderData request message as follows:

<MP0118_GetGridHeaderData_001
xmlns="http://schemas.datastream.net/MP_functions/MP0118_GetGridHeaderData_001" xmlns:dsg="http://schemas.datastream.net/MP_functions/GridRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.datastream.net/MP_functions/MP0118_GetGridHeaderData_001

C:\Shotgun\resources\build\schemas\Grid\MP0118_GetGridHeaderData_001.xsd">

<FUNCTION_REQUEST_INFO REQUEST_TYPE="LIST.HEAD_DATA.STORED">

<dsg:GRID GRID_NAME="LVMRCSALL" GRID_ID="1068" NUMBER_OF_ROWS_FIRST_RETURNED="500" CURSOR_POSITION="0" TAB_NAME=" "

RESULT_IN_SAXORDER="true" TERSERESPONSE=""> {rest of message omitted).

The effect of setting ‘RESULT_IN_SAXORDER’ to ‘true’ is that the response message contains the children of the GRID element in the order METADATA, FIELDS, DATA. When sax ordering is ‘false’ (default), the children of the GRID element are returned in the order METADATA, DATA, FIELDS. The attribute affects only the ordering of the elements in the xml response, not their content.