1. Create a sheet SH01 (qId is SH01).
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "Sheet 1",
"description": "Description of sheet 1",
"qInfo": {
"qId": "SH01",
"qType": "sheet"
},
"qChildListDef": {
"qData": {
"title": "/title",
"description": "/description",
"meta": "/meta",
"order": "/order",
"id": "/qInfo/qId",
"type": "/qInfo/qType",
"lb": "/qListObjectDef",
"hc": "/qHyperCubeDef"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "SH01",
"qType": "sheet"
}
},
"change": [
2
]
}
The sheet is created and has 2 as a handle.
2. Create a list object (qId is LB01) in the sheet Sheet01. The list object has one field Country (qFieldDefs is Country).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateChild",
"handle": 2,
"params": [
{
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 1,
"qLeft": 0,
"qWidth": 1
}
]
},
"title": "A listObject",
"description": "Description of the listObject"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
}
},
"change": [
3
]
}
The list object is created and has 3 as a handle.
3. Get the layout of the list object (handle is 3). delta is set to true to initiate the delta.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetLayout",
"handle": 3,
"delta": true,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"delta": true,
"result": {
"qLayout": [
{
"op": "add",
"path": "/",
"value": {
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
},
"qMeta": {},
"qSelectionInfo": {},
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 22
},
"qDimensionInfo": {
"qFallbackTitle": "Country label",
"qApprMaxGlyphCount": 14,
"qCardinal": 22,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"Country label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 0,
"qOption": 22,
"qDeselected": 0,
"qAlternative": 0,
"qExcluded": 0
},
"qTags": [
"$ascii",
"$text"
],
"qDimensionType": "D",
"qGrouping": "N"
},
"qExpressions": [],
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "United States",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "O"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
}
]
},
"title": "A listObject",
"description": "Description of the listObject"
}
}
]
}
}
Since there was no previous call to GetLayout with delta set to true, the delta is made between "nothing" and the current layout of the list object, which is add list object.
4. Update some properties in the list object (handle is 3).
The title is updated and the description is removed.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "ApplyPatches",
"handle": 3,
"params": [
[
{
"qPath": "/title",
"qOp": "replace",
"qValue": "\"New title\""
},
{
"qPath": "/description",
"qOp": "remove"
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {},
"change": [
3
]
}
The properties are updated.
5. Get the delta of the layout.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetLayout",
"handle": 3,
"delta": true,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"delta": true,
"result": {
"qLayout": [
{
"op": "replace",
"path": "/title",
"value": "New title"
},
{
"op": "remove",
"path": "/description"
}
]
}
}
Only the properties that have been added, updated and/or removed since the last GetLayout are displayed.