Prerequisite: A non-published app is opened. The handle of the app is 1.
The steps are the following:
- Creation of a sheet in the app.
- Add a child to the sheet.
- Publish the app (the sheet is published at the same time).
- Create a draft of the sheet.
- Add a child to the draft.
- Commit the draft.
- Check that the published sheet contains two children.
1. Create a sheet of identifier Sheet01 (qId is Sheet01). qChildListDef is added to the definition of the sheet in order to be able to list the children of the sheet.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "Sheet 1",
"description": "Description of sheet 1",
"qInfo": {
"qId": "Sheet01",
"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": 3,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "Sheet01",
"qType": "sheet"
}
},
"change": [
2
]
}
The sheet Sheet01 is created and has 2 as a handle.
CreateObject method.
2. Create a child in the sheet. The child is a list object with identifier LB01 (qId is LB01). The handle of the request is 2 because the sheet has 2 as a handle. A title and a description are added. The name of the field is Country (qFieldDefs is Country).
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"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": 4,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
}
},
"change": [
3
]
}
The list object is created and has 3 as a handle.
CreateChild method.
3. Publish the app. The handle of the request is 1 because the Publish method applies at app level. The name of the published app is Golf Quest.qvf. The first parameter in the request corresponds to the identifier of the stream where the app is published.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "Publish",
"handle": 1,
"params": [
"9b9ec1f7-005c-4974-9468-3482db318087",
"Golf Quest.qvf"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {}
}
The app and all its objects are published, which means that the sheet Sheet01 is also published. The published sheet contains one object, which is the list object LB01.
Publish method.
4. Create a draft of the published sheet. The identifier of the sheet is Sheet01.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "CreateDraft",
"handle": 1,
"params": [
"Sheet01"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qDraftId": "c983fbd2-686a-4003-933d-c4979bfc1aae"
}
}
The draft is created. The identifier of the draft (qDraftId) is returned.
5. Get the handle of the draft.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "GetObject",
"handle": 1,
"params": [
"c983fbd2-686a-4003-933d-c4979bfc1aae"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 4
}
}
}
The draft has 4 as a handle.
6. Create a new list object in the draft. The identifier of the list object is LB02 (qId is LB02). A title and a description are added. The name of the field is City (qFieldDefs is City).
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "CreateChild",
"handle": 4,
"params": [
{
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"City"
],
"qFieldLabels": [
"City label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 1,
"qLeft": 0,
"qWidth": 1
}
]
},
"title": "A listObject 2",
"description": "Description of the listObject 2"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 8,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 5
},
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
}
},
"change": [
5
]
}
The list object of identifier LB02 is created (qId is LB02). It has 5 as a handle.
7. Replace the content of the published sheet by the content of the draft by using the CommitDraft method.
The client sends:
{
"jsonrpc": "2.0",
"id": 9,
"method": "CommitDraft",
"handle": 1,
"params": [
"c983fbd2-686a-4003-933d-c4979bfc1aae"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 9,
"result": {},
"change": [
2
],
"close": [
3,
4,
5
]
}
The draft is committed.
8. Get the layout of the sheet Sheet01. The handle of the sheet is 2.
The client sends:
{
"jsonrpc": "2.0",
"id": 10,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"qLayout": {
"qInfo": {
"qId": "Sheet01",
"qType": "sheet"
},
"qMeta": {
"title": "",
"description": "",
"privileges": [
"create",
"read",
"update",
"delete",
"publish",
"changeowner"
],
"modifiedDate": "2015-06-22T12:28:09.813Z",
"published": false,
"publishTime": "1753-01-01T00:00:00Z",
"approved": false,
"owner": {
"id": "66a0f0d0-bea1-416f-aae4-443a39de17fd",
"userId": "platform_tester",
"userDirectory": "QT",
"name": "platform_tester",
"privileges": null
},
"qSize": -1,
"sourceObject": "",
"draftObject": ""
},
"qSelectionInfo": {},
"title": "Sheet 1",
"description": "Description of sheet 1",
"qChildList": {
"qItems": [
{
"qInfo": {
"qId": "235cca05-2bc0-40f0-accd-6ea7fc54b37c",
"qType": "ListObject"
},
"qData": {
"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,
"qSelectedExcluded": 0,
"qLockedExcluded": 0
},
"qTags": [
"$ascii",
"$text"
],
"qDimensionType": "D",
"qGrouping": "N",
"qNumFormat": {
"qType": "R",
"qnDec": 14,
"qUseThou": 1,
"qFmt": "##############",
"qDec": ".",
"qThou": ","
},
"qIsAutoFormat": true,
"qGroupFieldDefs": [
"Country"
]
},
"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",
"meta": "",
"order": "",
"id": "",
"type": "",
"lb": {
"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": []
},
"hc": ""
}
},
{
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
},
"qData": {
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 7532
},
"qDimensionInfo": {
"qFallbackTitle": "City label",
"qApprMaxGlyphCount": 30,
"qCardinal": 7532,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"City label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 0,
"qOption": 7532,
"qDeselected": 0,
"qAlternative": 0,
"qExcluded": 0,
"qSelectedExcluded": 0,
"qLockedExcluded": 0
},
"qTags": [
"$text"
],
"qDimensionType": "D",
"qGrouping": "N",
"qNumFormat": {
"qType": "R",
"qnDec": 14,
"qUseThou": 1,
"qFmt": "##############",
"qDec": ".",
"qThou": ","
},
"qIsAutoFormat": true,
"qGroupFieldDefs": [
"City"
]
},
"qExpressions": [],
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "Addison",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "O"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
}
]
},
"title": "A listObject 2",
"description": "Description of the listObject 2",
"meta": "",
"order": "",
"id": "",
"type": "",
"lb": {
"qStateName": "$",
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"City"
],
"qFieldLabels": [
"City label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qExpression": {}
}
],
"qNumberPresentations": [],
"qActiveField": 0
},
"qFrequencyMode": "N",
"qInitialDataFetch": [
{
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
],
"qExpressions": []
},
"hc": ""
}
}
]
}
}
}
}
The published sheet contains two children that are listed in qChildList.