1. Create a generic object with identifier (qId) SH01. qChildListDef is added to the object's definition in order to be able to list the children of the object. The object has for title Container (it is the dynamic property title). The type of the object is container (qType).
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "Container",
"description": "Description of sheet 1",
"qInfo": {
"qId": "SH01",
"qType": "container"
},
"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": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "SH01",
"qType": "container"
}
},
"change": [
2
]
}
The sheet is created and has the handle 2.
2. Create a first child with identifier (qId) CH01. The handle of the request is 2 because the handle of the sheet is 2. The title of the child is First child. The type of the child is Child (qType).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateChild",
"handle": 2,
"params": [
{
"qInfo": {
"qId": "CH01",
"qType": "Child"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 1,
"qLeft": 0,
"qWidth": 1
}
]
},
"title": "First child"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "CH01",
"qType": "Child"
}
},
"change": [
3
]
}
The child is created and has the handle 3.
3. Get the properties of the sheet and its child.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetFullPropertyTree",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qPropEntry": {
"qProperty": {
"qInfo": {
"qId": "SH01",
"qType": "container"
},
"qMetaDef": {},
"title": "Container",
"description": "Description of sheet 1",
"qChildListDef": {
"qData": {
"title": "/title",
"description": "/description",
"meta": "/meta",
"order": "/order",
"id": "/qInfo/qId",
"type": "/qInfo/qType",
"lb": "/qListObjectDef",
"hc": "/qHyperCubeDef"
}
}
},
"qChildren": [
{
"qProperty": {
"qInfo": {
"qId": "CH01",
"qType": "Child"
},
"qMetaDef": {},
"qListObjectDef": {
"qStateName": "$",
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qExpression": {}
}
],
"qNumberPresentations": [],
"qActiveField": 0
},
"qFrequencyMode": "N",
"qInitialDataFetch": [
{
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
],
"qExpressions": []
},
"title": "First child"
},
"qChildren": []
}
]
}
}
}
The properties of the container (the sheet) and its child are returned, respectively in qProperty and in qChildren.
4. Update the properties of the container (the sheet) and its child. Set some new properties for a second child (that does not exist) with identifier (qId) CH02.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "SetFullPropertyTree",
"handle": 2,
"params": [
{
"qProperty": {
"title": "New title for container",
"qInfo": {
"qId": "SH01",
"qType": "container"
},
"qChildListDef": {
"qData": {
"title": "/title"
}
}
},
"qChildren": [
{
"qProperty": {
"title": "New title for first child",
"qInfo": {
"qId": "CH01",
"qType": "child"
}
},
"qChildren": []
},
{
"qProperty": {
"title": "Title for second child",
"qInfo": {
"qId": "CH02",
"qType": "child"
}
},
"qChildren": []
}
]
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {},
"change": [
2,
3
]
}
The container has a new title and a new type. The child has a new title. New properties are added for a second child.
5. Get the properties of the sheet and its children.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetFullPropertyTree",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qPropEntry": {
"qProperty": {
"qInfo": {
"qId": "SH01",
"qType": "container"
},
"qMetaDef": {},
"title": "New title for container",
"qChildListDef": {
"qData": {
"title": "/title"
}
}
},
"qChildren": [
{
"qProperty": {
"qInfo": {
"qId": "CH01",
"qType": "child"
},
"qMetaDef": {},
"title": "New title for first child"
},
"qChildren": []
},
{
"qProperty": {
"qInfo": {
"qId": "CH02",
"qType": "child"
},
"qMetaDef": {},
"title": "Title for second child"
},
"qChildren": []
}
]
}
}
}
The properties of the container (the sheet) and its children are returned, respectively in qProperty and in qChildren. The sheet has now two children CH01 and CH02.The child CH02 has been created during the call to SetFullPropertyTree method.