Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The idea is to create a master item visualisation from
- // an existing dashboard object
- // If the requirement is to create a master item from json (exported from another app)
- // the first step is to create the source object first and the use it
- // to create the master item and then drop the source (if needed)
- // Create empty object with type of masteritem
- let myMasterItem = await qDoc.createObject({
- "qInfo": {
- "qId": "my-id",
- "qType": "masterobject"
- },
- "qExtendsId": "",
- "qMetaDef": {"tite": "", "description": "", "tags": []},
- "qStateName": ""
- }
- )
- // Copy the properties from an existing object
- await myMasterItem.copyFrom("my-source-object")
- // Get the masteritem properties and update the meta definition
- // setting the title and description
- let myMasterItemProperties = await myMasterItem.getProperties()
- myMasterItemProperties.qMetaDef = {title: "My Master Item", description: "Master Item created with Engine API", tags: []}
- //Finally - update the master item properties with the changed mete def
- await myMasterItem.setProperties(myMasterItemProperties)
- // at this point is safe to drop the source object ... if required
- // await qDoc.deleteObject("my-source-object")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement