You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/runtime-configuration-api.md
This how-to describes how to create a simple menu that retrieves and displays the runtime constants from the active configuration in a message box.
9
+
This how-to describes how to create a simple menu that retrieves and displays runtime constants from the active configuration in a message box.
10
10
11
11
{{% alert color="info" %}}
12
12
Access to runtime constants using the web API was introduced in version 11.9.0.
@@ -17,13 +17,13 @@ Access to runtime constants using the web API was introduced in version 11.9.0.
17
17
Before starting this how-to, make sure you have completed the following prerequisites:
18
18
19
19
* This how-to uses the results of [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Complete that how-to before starting this one.
20
-
*Make sure you are familiar with creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/) and message boxes as described in[Show a Message Box Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/messagebox-api/).
20
+
*Familiarize yourself with creating menus and message boxes. For more details, refer to [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/) and [Show a Message Box Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/messagebox-api/).
21
21
22
-
## Set Up the Extension Structure
22
+
## Set Up the Extension Structure
23
23
24
-
Set up the extension structure by following the steps below:
24
+
Set up the extension structure by following these steps:
25
25
26
-
1. Create a menu that will display the runtime constants in the `loaded` method in the main entry point (`src/main/index.ts`). This can be done by following the steps in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
26
+
1. Create a menu that displays the runtime constants in the `loaded` method in the main entry point (`src/main/index.ts`). This can be done by following the steps in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
27
27
2. Replace the contents of your `src/main/index.ts` file with the following:
In this example, you create one menu item that will show a message box with the runtime constants from the active configuration.
75
+
In this example, you create one menu item that shows a message box with the runtime constants from the active configuration.
76
76
77
-
The code uses the:
77
+
The code uses the following:
78
78
79
-
*`menuApi` from `studioPro.ui.extensionsMenu` to allow you to use the menu API
79
+
*`menuApi` from `studioPro.ui.extensionsMenu` to use the menu API
80
80
*`messageBoxApi` from `studioPro.ui.messageBoxes` to show a dialog
81
-
*`runtimeConfigApi` from studioPro.runtime.configuration to retrieve the runtime constants
81
+
*`runtimeConfigApi` from `studioPro.runtime.configuration` to retrieve the runtime constants
82
82
83
-
{{% alert color="info" %}} The function is `async` in order for you to use `await` when executing the preview action.
83
+
{{% alert color="info" %}}
84
+
The function is `async` so you can use `await` when executing the preview action.
84
85
{{% /alert %}}
85
86
86
87
The `getConstants()` function returns an array of constant objects, each with the following properties:
87
88
88
-
*`isPrivate` – a boolean indicating whether the constant value is hidden (true) or accessible (false)
89
-
*`constantName` – the fully qualified name of the constant (for example, `MyModule.MyConstant`)
90
-
*`value` – the constant value as a string (only present when `isPrivate` is false)
89
+
*`isPrivate` – A Boolean indicating whether the constant value is hidden (true) or accessible (false)
90
+
*`constantName` – The fully qualified name of the constant (for example, `MyModule.MyConstant`)
91
+
*`value` – The constant value as a string (only present when `isPrivate` is false)
91
92
92
93
## Accessing Private Constants
93
94
94
-
By default, private constants are not accessible and will have `isPrivate` set to true with no value. To access private constant values, your extension must request the `runtime-configuration-private` permission.
95
+
By default, private constants are not accessible and have `isPrivate` set to true with no value. To access private constant values, your extension must request the `runtime-configuration-private` permission.
95
96
96
97
Add the permission to your extension's `package.json` after the entry points:
97
98
@@ -112,11 +113,11 @@ Add the permission to your extension's `package.json` after the entry points:
112
113
113
114
```
114
115
115
-
You have to set the permission to true if you want the permission to appear in the Extensions Overview pane.
116
+
Set the permission to true to make the permission appear in the Extensions Overview pane.
116
117
117
-
When a user installs your extension, they can grant this permission through the Extensions Overview pane (**View** > **Extensions**) in Studio Pro. Once granted, private constants will be returned with `isPrivate` set to false and their value included.
118
+
When a user installs your extension, they can grant this permission through the Extensions Overview pane (**View** > **Extensions**) in Studio Pro. Once granted, private constants are returned with `isPrivate` set to false and their value included.
118
119
119
-
You can read more about permissions in[Extension Permissions in Overview Pane](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/).
120
+
For more information, refer to[Extension Permissions in Overview Pane](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/).
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/runtime-controller-api.md
This how-to describes how to create a simple menu that displays when the connection changed in a message box.
9
+
This how-to describes how to create a simple menu that displays a message box when the connection changes.
10
10
11
11
{{% alert color="info" %}}
12
12
Listening for connection changes was introduced in version 11.9.0.
@@ -17,7 +17,7 @@ Listening for connection changes was introduced in version 11.9.0.
17
17
Before starting this how-to, make sure you have completed the following prerequisites:
18
18
19
19
* This how-to uses the results of [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Complete that how-to before starting this one.
20
-
*Make sure you are familiar with creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/) and message boxes as described in [Show a Message Box Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/messagebox-api/).
20
+
*Familiarize yourself with creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/) and message boxes as described in [Show a Message Box Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/messagebox-api/).
21
21
* Your app must be running locally in Studio Pro to use the Runtime Controller API.
0 commit comments