The first step is to create a story.
1. Create the story with identifier story01. The handle is 1 because the CreateObject method applies at app level.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "A Story",
"description": "This is the story",
"qInfo": {
"qId": "story01",
"qType": "story"
},
"qChildListDef": {
"qData": {
"title": "/title",
"description": "/description",
"children": "/qChildListDef"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "story01",
"qType": "story"
}
},
"change": [
2
]
}
The story story01 is created and has 2 as a handle.
For more information, see the CreateObject method.
2. The second step is to create the first slide slide01 in the story story01.
The handle of the request is 2 because the slide must be added to the story story01 that has 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "CreateChild",
"handle": 2,
"params": [
{
"title": "Slide 01",
"description": "This is the slide 01",
"qInfo": {
"qId": "slide01",
"qType": "slide"
},
"qChildListDef": {
"qData": {
"title": "/title"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"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. The third step is to create the second slide slide02 in the story. The handle of the request is 2 because the slide must be added to the story story01 that has 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "CreateChild",
"handle": 2,
"params": [
{
"title": "Slide 02",
"description": "This is the slide 02",
"qInfo": {
"qId": "slide02",
"qType": "slide"
},
"qChildListDef": {
"qData": {
"title": "/title"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 4
},
"qInfo": {
"qId": "slide02",
"qType": "slide"
}
},
"change": [
4
]
}
The slide slide02 is created in the story. The handle related to this slide is 4.
4. In this step, the goal is to list the slides in the story story01. The handle of the request is 2 because the goal is to get the layout of the story story01 that has 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qLayout": {
"qInfo": {
"qId": "story01",
"qType": "story"
},
"qSelectionInfo": {},
"title": "A Story",
"description": "This is the story",
"qChildList": {
"qItems": [
{
"qInfo": {
"qId": "slide01",
"qType": "slide"
},
"qData": {
"title": "Slide 01",
"description": "This is the slide 01",
"children": {
"qData": {
"title": "/title"
}
}
}
},
{
"qInfo": {
"qId": "slide02",
"qType": "slide"
},
"qData": {
"title": "Slide 02",
"description": "This is the slide 02",
"children": {
"qData": {
"title": "/title"
}
}
}
}
]
}
}
}
}
The story story01 contains two slides slide01 and slide02. The slides are listed in qChildList. The first slide in the story is the slide slide01.
5. In this step, the goal is to clone the story story01. The children of the story should be cloned as well.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "CloneObject",
"handle": 1,
"params": [
"story01"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qCloneId": "a832a8ba-fb47-4cf4-ae39-e55295a4e3d1"
}
}
The story is cloned. The identifier of the clone is returned in qCloneId.
6.Get the handle of the clone.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "GetObject",
"handle": 1,
"params": [
"a832a8ba-fb47-4cf4-ae39-e55295a4e3d1"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 5
}
}
}
The handle of the clone is 5.
7. List the slides in the clone.
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "GetLayout",
"handle": 5,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 8,
"result": {
"qLayout": {
"qInfo": {
"qId": "a832a8ba-fb47-4cf4-ae39-e55295a4e3d1",
"qType": "story"
},
"qSelectionInfo": {},
"title": "A Story",
"description": "This is the story",
"qChildList": {
"qItems": [
{
"qInfo": {
"qId": "459a0151-0dd2-4471-8a22-633f404d9a68",
"qType": "slide"
},
"qData": {
"title": "Slide 01",
"description": "This is the slide 01",
"children": {
"qData": {
"title": "/title"
}
}
}
},
{
"qInfo": {
"qId": "36ae2bba-6829-4a01-961c-b956702f8fd7",
"qType": "slide"
},
"qData": {
"title": "Slide 02",
"description": "This is the slide 02",
"children": {
"qData": {
"title": "/title"
}
}
}
}
]
}
}
}
}
The clone contains the same slides than the story story01. The data inside each slide (in qData) is identical to the original slides. The identifiers of the clones (of the story and the slides) are returned.