Skip to content

Commit 34510b9

Browse files
committed
Runtime Constants review
1 parent 6901484 commit 34510b9

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/runtime-configuration-api.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ Before starting this how-to, make sure you have completed the following prerequi
1717

1818
## Set Up the Extension Structure
1919

20-
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/).
20+
Set up the extension structure by following the steps below:
2121

22-
In the example below, you create one menu item that will show a message box with the runtime constants from the active configuration.
23-
24-
Replace your `src/main/index.ts` file with the following:
22+
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/).
23+
2. Replace your `src/main/index.ts` file with the following:
2524

2625
```typescript
2726
import { IComponent, Menu, getStudioProApi } from "@mendix/extensions-api";
@@ -69,6 +68,8 @@ export const component: IComponent = {
6968
};
7069
```
7170

71+
In this example, you create one menu item that will show a message box with the runtime constants from the active configuration.
72+
7273
The code uses the:
7374

7475
* `menuApi` from `studioPro.ui.extensionsMenu` to allow you to use the menu API
@@ -79,15 +80,15 @@ The code uses the:
7980
{{% /alert %}}
8081

8182
The `getConstants()` function returns an array of constant objects, each with the following properties:
82-
* isPrivate a boolean indicating whether the constant value is hidden (true) or accessible (false)
83-
* constantName the fully qualified name of the constant (e.g., `MyModule.MyConstant`)
84-
* value the constant value as a string (only present when isPrivate is false)
83+
* `isPrivate` a boolean indicating whether the constant value is hidden (true) or accessible (false)
84+
* `constantName` the fully qualified name of the constant (for example, `MyModule.MyConstant`)
85+
* `value` the constant value as a string (only present when `isPrivate` is false)
8586

8687
## Accessing Private Constants
8788

88-
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.
89+
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.
8990

90-
Add the permission to your extension's package.json after the entrypoints:
91+
Add the permission to your extension's `package.json` after the entry points:
9192

9293
```json
9394
{
@@ -106,11 +107,11 @@ Add the permission to your extension's package.json after the entrypoints:
106107

107108
```
108109

109-
You have to set the permission to true if you want the permission to appear in the Overview Pane.
110+
You have to set the permission to true if you want the permission to appear in the Extensions Overview pane.
110111

111-
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.
112+
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.
112113

113-
You can read more about permissions in the [Permission Guide](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/).
114+
You can read more about permissions in [Extension Permission](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/).
114115

115116
## Extensibility Feedback
116117

0 commit comments

Comments
 (0)