List all app objects
List the app objects, measures, dimensions, variables and bookmarks in an app by creating a transient object using the CreateSessionObject method and getting the layout of the transient object using the GetLayout method.
The transient object should contain the following definitions:
- qAppObjectListDef in order to list the app objects like sheets and stories
- qDimensionListDef if you wish to list the dimensions in the app
- qMeasureListDef if you wish to list the measures in the app
- qBookmarkListDef if you wish to list the bookmarks in the app
- qVariableListDef if you wish to list the variables in the app
Examples
Example 1:
1. Create the app overview. A transient object is used to contain the list.
The client sends:
The engine returns:
The app overview is created. The handle is 2.
This app overview contains the lists of:
- app objects (for example the list of sheets and stories)
- measures
- dimensions
2. Check the content of the app overview. The handle is 2.
The client sends:
The engine returns:
The app overview is empty. The identifier of the app overview is 54dcfa19-7627-4204-b5b8-7c60c91dc7b1.
3. Create a sheet Sheet01 (qId is Sheet01).
The client sends:
The engine returns:
The sheet is created. Its handle is 3. The member change shows that the transient object is updated, meaning that the list of app objects has been updated with the new sheet.
4. Add a dimension in the app.
The client sends:
The engine returns:
The dimension is added and has 4 as a handle.
5. Check that the app overview (handle is 2) is updated.
The client sends:
The engine returns:
The app overview has been updated with the sheet Sheet01 and the dimension DI01. No measure is defined in the app.
Example 2:
1. The first step is to create a list of bookmarks in the app. A transient object is used to contain the list.
The client sends:
The engine returns:
The list of bookmarks is created. The handle is 2.
2. Check the content of the list of bookmarks. The handle is 2.
The client sends:
The engine returns:
The list of bookmarks is empty.
3. Create a bookmark BM01.
The client sends:
The engine returns:
The bookmark BM01 is created. Its handle is 3. The member change shows that the transient object is updated, meaning that the list of bookmarks has been updated with the new bookmark.
4. Check the content of the bookmark. The handle is 3.
The client sends:
The engine returns:
The data related to the bookmark are displayed under qBookmark.
5. Check that the list of bookmarks is updated. The handle is 2.
The client sends:
The engine returns:
The list of bookmarks has been updated with the new bookmark BM01. The data related to the bookmark are returned.
Example 3:
In this example, two lists are created: one to list the variables of type variable and one to list the variables of type OtherVariable.
1. The first step is to create a transient object that can list the variables of type variable in the app. The identifier of the transient object is VL01. This list of variables should gather all variables of type variable. Therefore qVariableListDef/qType is set to variable.
The client sends:
The engine returns:
The list of variables VL01 is created and has 2 as a handle.
2. Check the content of the list of variables. The handle of the request is 2 because the handle of the list of variables is 2.
The client sends:
The engine returns:
The list of variables is empty.
3. Create the variableVariable01. The identifier of the variable is VB01. A name (in qName), a comment (in qComment) and a definition (in qDefinition) are set. The type of the variable is variable, meaning that this variable should be part of the list of variables VL01.
The client sends:
The engine returns:
The variable is created and has 3 as a handle. The member change shows that the transient object is updated (handle 2 in the list), meaning that the list of variables has been updated with the new variable.
4. Check the content of the list of variables. The handle of the request is 2 because the handle of the list of variables is 2.
The client sends:
The engine returns:
The list of variables (in qVariableList) has been updated with the new variable VB01.
5. Create the variableVariable02. The identifier of the variable is VB02. A name (in qName), a comment (in qComment) and a definition (in qDefinition) are set. The type of this variable is variable, meaning that this variable should be part of the list of variables VL01.
The client sends:
The engine returns:
The variable is created and has 4 as a handle. The member change shows that the transient object is updated (handle 2 in the list), meaning that the list of variables has been updated with the new variable.
6. Check the content of the list of variables. The handle of the request is 2 because the handle of the list of variables is 2.
The client sends:
The engine returns:
The list of variables (in qVariableList) has been updated with the new variable VB02.
7. Create two script variables: vSales and vSales2.
The client sends:
The engine returns:
The variables are created. Per default, script-defined variables have variable as type.
8. Load the script.
The client sends:
The engine returns:
The script is reloaded.
9. Check the content of the list of variables VL01. The handle of the request is 2 because the handle of the list of variables is 2.
The client sends:
The engine returns:
This list displays all user variables and all script-defined variables with the type variable in the app. The property qIsScriptCreated is set to true for the variables vSales and vSales2 because these variables have been defined through script.
10. Create the variableVariable03. The identifier of the variable is VB03. A name (in qName), a comment (in qComment) and a definition (in qDefinition) are set. The type of this variable is OtherVariable, meaning that this variable should not be part of the list of variables VL01.
The client sends:
The engine returns:
The variable is created and has 5 as a handle. The member change does not contain the handle of the transient object (handle 2), meaning that this variable is not added to the list of variables. The reason is that the type of this variable is OtherVariable and not variable, as defined in VariableListDef when creating the transient session object in the first step of this example.
11. Create another list of variables by creating a new transient object. The identifier of this transient object is VL02. This list of variables should contain all variables of type OtherVariable (in qVariableListDef/qType).
The client sends:
The engine returns:
The list of variables VL02 is created and has 6 as a handle.
12. Check the content of the list of variables VL02. The handle of the request is 6 because the handle of the list of variables is 6.
The client sends:
The engine returns:
The list of variables VL02 contains the variable VB03. The variables VB01 and VB02 are not included because they are not of type OtherVariable.