Prerequisite steps are:
- Creation of a story
- Creation of a slide
- Creation of a slide item
- Creation of a list object
- Make some selections in the list object
- Create a bookmark
- Take a snapshot of the current selections and embed the snapshot in the slide item
1. Create a story: story01.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "",
"description": "",
"qInfo": {
"qId": "story01",
"qType": "story"
},
"qChildListDef": {
"qData": {
"title": "/title",
"description": "/description",
"children": "/qChildListDef"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "story01",
"qType": "story"
}
},
"change": [
2
]
}
The story story01 is created. The handle of the story is 2.
CreateObject method.
2. Create a slide slide01 in the story (qId is slide01). The handle of the request is 2 because the slide must be added to the story story01 that uses 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateChild",
"handle": 2,
"params": [
{
"title": "",
"description": "",
"qInfo": {
"qId": "slide01",
"qType": "slide"
},
"qChildListDef": {
"qData": {
"title": "/title"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "slide01",
"qType": "slide"
}
},
"change": [
3
]
}
The slide slide01 is created in the story. The handle related to this slide is 3.
3. Create a slide item slideItem01 (qId is slideItem01 ).qEmbeddedSnapshotDef is added in the definition of the slide item to be able to render the properties of the snapshot embedded in the slide item.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "CreateChild",
"handle": 3,
"params": [
{
"title": "",
"description": "",
"qInfo": {
"qId": "slideItem01",
"qType": "slideItem"
},
"qEmbeddedSnapshotDef": {
"MySelections": "First quarter"
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 4
},
"qInfo": {
"qId": "slideItem01",
"qType": "slideItem"
}
},
"change": [
4
]
}
The slide item is created and has 4 as a handle.
4. Create a list object LB01 (qId is LB01). The list object has Country (qFieldDefs) as a dimension .
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "CreateSessionObject",
"handle": 1,
"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
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 5
}
},
"change": [
5
]
}
The list object is created and has 5 as a handle.
5. Select the second value in the list object (qValues is [1]).
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "SelectListObjectValues",
"handle": 5,
"params": [
"/qListObjectDef",
[
1
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qSuccess": true
},
"change": [
5
]
}
The selection is successful.
SelectListObjectValues method.
6. Get the first three values of the list object (qHeight is 3 and qTop is 0). The handle of the request is 5 because the handle of the list object is 5.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetListObjectData",
"handle": 5,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 3,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "United States",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "X"
}
],
[
{
"qText": "Denmark",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "S"
}
],
[
{
"qText": "Spain",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "X"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 3
}
}
]
}
}
The value Denmark is selected.
7. Create a bookmark BM01 (qId is BM01) with the current selections. The bookmark has dynamic properties for Name and Title.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "CreateBookmark",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "BM01",
"qType": "Bookmark"
},
"data": {
"Name": "My Bookmark",
"Title": "My selections"
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qReturn": {
"qType": "GenericBookmark",
"qHandle": 6
},
"qInfo": {
"qId": "BM01",
"qType": "Bookmark"
}
},
"change": [
6
]
}
The bookmark is created and has 6 as a handle.
CreateBookmark method.
8. Take a snapshot of the current selections (the bookmark is BM01) and embed the snapshot in the slide item (the handle of the slide item is 4).
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "EmbedSnapshotObject",
"handle": 4,
"params": [
"BM01"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 8,
"result": {}
}
A snapshot of the current selections is created and embedded in the slide item.
EmbedSnapshotObject method.
9. Get the layout of the slide item. The handle is 4.
The client sends:
{
"jsonrpc": "2.0",
"id": 9,
"method": "GetLayout",
"handle": 4,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 9,
"result": {
"qLayout": {
"qInfo": {
"qId": "slideItem01",
"qType": "slideItem"
},
"qMeta": {},
"qSelectionInfo": {},
"title": "",
"description": "",
"qEmbeddedSnapshot": {
"data": {
"Name": "My Bookmark",
"Title": "My selections"
},
"MySelections": "First quarter"
}
}
}
}
The slide item contains a snapshot. The properties of the snapshot are returned.
10. Get the handle of the snapshot.
The client sends:
{
"jsonrpc": "2.0",
"id": 10,
"method": "GetSnapshotObject",
"handle": 4,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"qReturn": {
"qType": "GenericBookmark",
"qHandle": 7
}
}
}
The snapshot has 7 as a handle.
GetSnapshotObject method.