1. Create a sheet that contains an image. The identifier of the sheet is SH01.The handle of the app is 1. The URL of the image is given in the definition of the dynamic property image.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"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"
}
},
"image": {
"qStaticContentUrlDef": {
"qUrl": "/content/default/Qlik_default_feathers.png"
}
}
}
]
}
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 the image Qlik_default_feathers.png is added to the sheet. The sheet has 2 as a handle.
StaticContentUrlDef.
2. Save the app.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "DoSave",
"handle": 1,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {},
"change": [
1
]
}
The image is embedded in the qvf file.
Information noteYou must save the app for the image to be embedded in the qvf file.
3. Check that the image is embedded in the qvf file, by getting the layout of the sheet. The handle of the request is 2 because it refers to the sheet.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qLayout": {
"qInfo": {
"qId": "SH01",
"qType": "sheet"
},
"qSelectionInfo": {},
"title": "Sheet 1",
"description": "Description of sheet 1",
"qChildList": {
"qItems": []
},
"image": {
"qStaticContentUrl": {
"qUrl": "/media/e4b18409a57fb30e2ced854d828923f4/5b5b833b-443e-477a-b1b8-6370b82cc278/Qlik_default_feathers.png"
}
}
}
}
}
The URL of the image has changed and is now referring to the /media folder. It means that the image is embedded in the qvf file.
Information noteContent files located in the /content/default/ folder are outside the qvf file.