Skip to content

Commit 23a12f2

Browse files
authored
Merge pull request #10340 from mendix/qt-ext10update
Update Mx10 Web Extensbility docs
2 parents d37e766 + 4059987 commit 23a12f2

File tree

10 files changed

+199
-240
lines changed

10 files changed

+199
-240
lines changed

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ For information on new releases of the Extensibility API see:
2020

2121
## Introduction
2222

23-
Extensions are self-contained modules which users can add to Studio Pro. This means that with extensibility you can add new features and functionality to Studio Pro. The Extensibility API is an API that allows developers to interact with a curated list of internal systems of Studio Pro. This documentation provides guides and reference documentation for the Extensibility API.
23+
Extensions are self-contained modules that enhance Studio Pro by adding new features and functionality. The Extensibility API allows you to interact with a curated set of internal systems, extending Studio Pro’s capabilities with functionality you can define yourself.
2424

25-
The API is provided in two flavors, depending which language you are developing in. C# and web based (via Typescript):
25+
The API is provided in two versions, depending on the language you are developing in:

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/packaging-your-extension.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,32 @@ url: /apidocs-mxsdk/apidocs/extensibility-api-10/packaging-your-extension
44
weight: 30
55
---
66

7-
# Packaging your extension
7+
# Packaging Your Extension
88

9-
Once you have finished development on your extension, you might want to package it into an add-on module so that others can start using it. Once you have created the add-on module, it can then be published to the Mendix Marketplace for your extension users to download into their Studio Pro app.
9+
After completing development on your extension, you can package it into an add-on module so others can use it. Once packaged, the module can be published to the Mendix Marketplace, allowing other users to download it into their Studio Pro apps.
1010

11-
To package your extension, you will still need the `--enable-extension-development` command line option turned on. Create a new module in your Studio Pro app containing your dev extension, give it an appropriate name. Open the module's settings form and set it to be an Add-on module. In the `Extension name` dropdown, select the extension you want to package into it.
11+
To package your extension, follow the steps below:
12+
13+
1. Make sure the `--enable-extension-development` command-line option is enabled.
14+
2. In your Studio Pro app, create a new module and include your development extension.
15+
3. Give the module a name.
16+
4. Open the module's settings and in the **Export** tab, choose **Add-on module**.
17+
5. In the **Extension name** drop-down, select the extension you want to package into it.
1218

1319
![Extension Add-on Module](/attachments/apidocs-mxsdk/apidocs/extensibility-api/extensionAddOnModule.png)
1420

15-
After you've created your add-on module with its extension, you can now export it, by right-clicking the module in the App Explorer and choosing `Export add-on module package`, as shown below.
21+
After you have created your add-on module with its extension, you can export it by right-clicking the module in the App Explorer and selecting **Export add-on module package**.
1622

1723
![Export Module](/attachments/apidocs-mxsdk/apidocs/extensibility-api/exportAddOnModule.png)
1824

1925
You can now save the add-on module to a location of your choice.
2026

21-
# Importing the extension add-on module
27+
# Importing the Extension Add-on Module
2228

23-
Once the add-on module is available to a Studio Pro user, they are now able to add it in their application. They can so so by right-clicking the app in the App Explorer and choosing `Import module package`, as shown below.
29+
When the add-on module is available to a Studio Pro user, they are now able to add it in their application. This is done by right-clicking the app in the **App Explorer** and selecting **Import module package**.
2430

2531
![Import Module](/attachments/apidocs-mxsdk/apidocs/extensibility-api/importAddOnModule.png)
2632

27-
Once an add-on module containing an extension is imported in the app, Studio Pro will show a warning to the user, asking to trust the extension contained in it. If the user does not choose to trust, the module will still be imported but the extension inside it won't be loaded.
33+
When an add-on module containing an extension is imported in the app, Studio Pro will show a warning to the user, asking to trust the extension contained in it. If the user does not choose to trust, the module will still be imported but the extension inside it will not be loaded.
2834

2935
![Trust Extension](/attachments/apidocs-mxsdk/apidocs/extensibility-api/trustExtension.png)

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/web/_index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@ weight: 20
1313

1414
## Introduction
1515

16-
Extensions can be written in Typescript or other web languages, described here, or using a C# API which is documented separately in [Extensibility API for C# Developers](/apidocs-mxsdk/apidocs/csharp-extensibility-api-10/).
16+
Extensions can be written in TypeScript or other web languages, described here, or using a C# API, which is documented in [Extensibility API for C# Developers](/apidocs-mxsdk/apidocs/csharp-extensibility-api-10/).
1717

1818
For more detailed information on the web API, see the [Mendix Studio Pro Web Extensibility API reference documentation](http://apidocs.rnd.mendix.com/10/extensions-api/index.html).
1919

2020
## Prerequisites
2121

22-
* You need at least a basic understanding of the Mendix platform.
23-
* You need some understanding of the Mendix Model.
24-
* You need to have some TypeScript development experience.
22+
To use the Web Extensibility API, you must have:
23+
24+
* A basic understanding of the Mendix platform
25+
* Some understanding of the Mendix Model
26+
* Some TypeScript development experience
2527

2628
## Getting Started
2729

28-
For detailed explanation on how to get started with extensions, check out [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-10/getting-started/).
30+
For detailed information on how to get started with extensions, see [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-10/getting-started/).
2931

3032
## How-tos
3133

32-
Here is a list of how-tos for you to begin with:
34+
Below is a list of how-tos for you to begin with:
3335

3436
* [How to Create a Dockable Pane Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-10/dockable-pane-api/)
3537
* [How to Interact With Local App Files Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-10/local-app-files-api/)

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/web/get-started.md

Lines changed: 55 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ weight: 2
77

88
## Introduction
99

10-
Studio Pro extensions can be developed using typescript and use standard web development technologies to extend the Studio Pro development environment. This guide shows you how to set up a basic development environment for building an extension using the web extensibility API.
10+
Studio Pro extensions can be developed using TypeScript and use standard web development technologies to extend the Studio Pro development environment. This document describes how to set up a basic development environment for building an extension using the web extensibility API.
1111

1212
For more information see the [Mendix Studio Pro Web Extensibility API](http://apidocs.rnd.mendix.com/10/extensions-api/index.html).
1313

1414
### Prerequisites
1515

1616
You will need the following prerequisites:
1717

18-
* Mendix Studio Pro version 10.21.0 or higher [Mendix Studio Pro](https://marketplace.mendix.com/link/studiopro).
19-
* Install the latest Studio Pro version from the Mendix [Marketplace](https://marketplace.mendix.com/link/studiopro/).
20-
* A development IDE to develop your extensions. We recommend using [Visual Studio Code](https://code.visualstudio.com/).
21-
* Install the latest version 22.x.x of Node: https://nodejs.org/en/download.
18+
* [Mendix Studio Pro](https://marketplace.mendix.com/link/studiopro) version 10.21.0 or higher
19+
* A development IDE to develop your extensions. Mendix recommends using [Visual Studio Code](https://code.visualstudio.com/)
20+
* Install the latest version 22.x.x of Node: https://nodejs.org/en/download
2221

2322
{{% alert color="info" %}}
2423
Extensions can be built on any operating system as the underlying framework is cross-platform.
@@ -35,96 +34,84 @@ This section will show you how to build and test an extension.
3534

3635
### Building the Extension
3736

38-
From within Visual Studio Code:
37+
Follow the below steps from within Visual Studio Code.
3938

40-
1. Select **File** -> **Open Folder**
41-
1. Navigate to the folder you just extracted your extension source code to.
42-
1. Click **Select Folder**.
43-
1. Select **Yes** if you are asked whether you trust this folder.
44-
1. Now open a Terminal by selecting **Terminal** -> **New Terminal** from the top menu.
45-
1. From the Terminal type `npm install`. This installs all dependencies for the extension
46-
1. Build your extension using the command `npm run build` in the terminal.
39+
1. Select **File** > **Open Folder**.
40+
2. Navigate to the folder where you created your extension.
41+
3. Click **Select Folder**.
42+
4. Select **Yes** if you are asked whether you trust this folder.
43+
5. Open a Terminal from the top menu by clicking **Terminal** > **New Terminal**.
44+
6. From the Terminal, type `npm install`. This installs all dependencies for the extension.
45+
7. Build your extension using the command `npm run build` in the terminal.
4746

48-
Once completed you should now have a build artifact which we can deploy to your Mendix app.
47+
Once completed, you should now have a build artifact which we can deploy to your Mendix app.
4948

50-
You can explore the extension a bit more to understand what it will do when it is installed. Do the following:
49+
### Exploring the Created Extension
5150

52-
1. From the Explorer window navigate to `src/main/index.ts` select it to open the file.
51+
You can explore the extension to understand what it does when it is installed. Do the following:
52+
53+
1. From the Explorer window, navigate to `src/main/index.ts` and select it to open the file.
5354

5455
Reading through the source code you should see the following:
5556

56-
1. Line 7 adds a menu
57-
58-
```typescript
59-
await studioPro.ui.extensionsMenu.add({
60-
menuId: "myextension.MainMenu",
61-
caption: "MyExtension Menu",
62-
subMenus: [{ menuId: "myextension.ShowTabMenuItem", caption: "Show tab" }],
63-
});
64-
```
65-
66-
1. Line 14 opens a tab
67-
68-
```typescript
69-
// Open a tab when the menu item is clicked
70-
studioPro.ui.extensionsMenu.addEventListener("menuItemActivated", (args) => {
71-
if (args.menuId === "myextension.ShowTabMenuItem") {
72-
studioPro.ui.tabs.open(
73-
{
74-
title: "My Extension Tab",
75-
},
76-
{
77-
componentName: "extension/myextension",
78-
uiEntrypoint: "tab",
57+
a. Line 7 adds a menu
58+
59+
```typescript
60+
await studioPro.ui.extensionsMenu.add({
61+
menuId: "myextension.MainMenu",
62+
caption: "MyExtension Menu",
63+
subMenus: [{ menuId: "myextension.ShowTabMenuItem", caption: "Show tab" }],
64+
});
65+
```
66+
67+
2. Line 14 opens a tab
68+
69+
```typescript
70+
// Open a tab when the menu item is clicked
71+
studioPro.ui.extensionsMenu.addEventListener("menuItemActivated", (args) => {
72+
if (args.menuId === "myextension.ShowTabMenuItem") {
73+
studioPro.ui.tabs.open(
74+
{
75+
title: "My Extension Tab",
76+
},
77+
{
78+
componentName: "extension/myextension",
79+
uiEntrypoint: "tab",
80+
}
81+
);
7982
}
80-
);
81-
}
82-
});
83-
```
83+
});
84+
```
8485

85-
When you install the extension you will see a new menu item within Studio Pro.
86+
When you install the extension, you will see a new menu item within Studio Pro.
8687

8788
### Testing the Extension
8889

8990
To test the extension, do the following in File Explorer.
9091

9192
1. Navigate to the folder where you extracted the extension source code.
92-
1. Open the `dist` folder.
93-
1. Copy the `myextension` folder.
94-
1. Navigate to the folder where you created your app.
95-
1. Create a new folder called `webextensions`.
96-
1. Paste the `myextension` folder into the `webextensions` folder you just created.
97-
98-
The extension files have now been added to the app.
99-
100-
1. Start Studio Pro with the following command line parameters to tell it to use the extensions in the folder.
93+
2. Open the `dist` folder.
94+
3. Copy the `myextension` folder.
95+
4. Navigate to the folder where you created your app.
96+
5. Create a new folder called `webextensions`.
97+
6. Paste the `myextension` folder into the `webextensions` folder you just created. This adds the extension files to the app.
98+
7. Start Studio Pro with the following command-line parameters to tell it to use the extensions in the folder:
10199

102100
`--enable-extension-development --webview-remote-debugging`
103101

104102
These flags instruct Studio Pro to do the following:
105103

106104
* Load extensions from the `webextensions` folder
107-
* Enable web debugging tools which will be useful when developing your extension
108-
109-
1. In Studio Pro, open the new app.
105+
* Enable web debugging tools
110106

111-
You will see a new `Extensions` item in the top menu.
107+
8. In Studio Pro, open the new app. You will see a new `Extensions` item in the top menu.
112108

113109
{{% alert color="warning" %}}
114110
Extension names used in place of `myextension` must only contain digits, letters, dashes, and underscores. Extensions with an invalid name will not be loaded and will display an error.
115111
{{% /alert %}}
116112

117-
## Conclusion
118-
119-
Using this guide we have:
120-
121-
* Created a new app
122-
* Downloaded a new extension from GitHub
123-
* Built the extension and installed it in our app
124-
* Tested our extension from within Studio Pro.
125-
126113
## Extensibility Feedback
127114

128-
If you would like to provide us with some additional feedback you can complete a small [Survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback)
115+
If you would like to provide additional feedback, you can complete a small [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback).
129116

130-
Any feedback is much appreciated.
117+
Any feedback is appreciated.

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/web/web-extensions-howtos/dockable-pane-api.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ weight: 10
77

88
## Introduction
99

10-
This guide explains how to create and manage a dockable pane using the web extensions API. A Dockable pane allows you to create a web view that can be docked and moved within the Studio Pro user interface. Examples of dockable panes in Studio Pro are:
10+
This how-to describes how to create and manage a dockable pane using the web extensions API. A dockable pane allows you to create a web view that can be docked and moved within the Studio Pro user interface. Examples of dockable panes in Studio Pro are:
1111

1212
* Marketplace
1313
* Errors
@@ -16,11 +16,11 @@ This guide explains how to create and manage a dockable pane using the web exten
1616

1717
## Prerequisites
1818

19-
This guide uses the app created in [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-10/getting-started/). Please complete that how-to before starting this one.
19+
This guide uses the app created in [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-10/getting-started/). Make sure to complete that how-to before starting this one.
2020

2121
## Creating a Dockable Pane
2222

23-
To open a dockable pane you must first register the dockable pane handle with the API. To do this, add a call to register the pane to the extension loaded method in the `src/main/index.ts`.
23+
To open a dockable pane you must first register the dockable pane handle with the API. To do this, add a call to register the pane to the extension loaded method in the `src/main/index.ts`. Use the `paneHandle` you registered to interact with the dockable pane.
2424

2525
```typescript
2626
const paneHandle = await studioPro.ui.panes.register(
@@ -34,9 +34,7 @@ To open a dockable pane you must first register the dockable pane handle with th
3434
});
3535
```
3636

37-
Use the 'paneHandle' you registered to interact with the dockable pane.
38-
39-
After adding this call the `loaded()` method looks like this:
37+
After adding this call, the `loaded()` method looks like this:
4038

4139
```typescript {hl_lines=["11-19"]}
4240
async loaded() {
@@ -81,9 +79,9 @@ After adding this call the `loaded()` method looks like this:
8179

8280
## Adding a Menu To Open the Dockable Pane
8381

84-
You will now add a menu that will open the pane when it is selected.
82+
Add a menu that will open the pane when it is selected.
8583

86-
1. Add a new submenu to the existing `extensionsMenu.add()` method on line 10.
84+
1. Add a new sub-menu to the existing `extensionsMenu.add()` method on line 10.
8785

8886
```typescript {linenos=table linenostart=10}
8987
// Add a menu item to the Extensions menu
@@ -97,7 +95,7 @@ You will now add a menu that will open the pane when it is selected.
9795
});
9896
```
9997

100-
1. Add lines to the `addEventListener()` call to handle opening the dockable pane once the menu has been selected, as follows:
98+
2. Add lines to the `addEventListener()` call that will open the pane when the menu is selected.
10199

102100
```typescript
103101
// Open a tab when the menu item is clicked
@@ -173,10 +171,10 @@ Your `loaded()` method should now look like this:
173171

174172
### Adding New Endpoint Handlers
175173

176-
You must now create a new web view endpoint where the user interface to be rendered within the pane is defined. You can use the existing endpoint and rename it to something more appropriate.
174+
Create a new web view endpoint where you define the user interface that will be rendered within the pane. You can use and rename the existing endpoint. Follow the steps below:
177175

178-
1. Rename `ui/index.tsx` to `ui/tab.tsx`
179-
1. Add the new endpoint file, `ui/dockablepane.tsx` by copying `ui/tab.tsx`.
176+
1. Rename `ui/index.tsx` to `ui/tab.tsx`.
177+
1. Add the new endpoint file, `ui/dockablepane.tsx`, by copying `ui/tab.tsx`.
180178

181179
You must also alter the `vite.config.ts` and `manifest.json` files to bind to the correct endpoint, as described in the following sections:
182180

@@ -192,7 +190,7 @@ Replace the entry section of `vite.config.js` with the following:
192190
}
193191
```
194192

195-
This instructs vite that the tab endpoint is connected to `src/ui/tab.tsx` and the dockable pane endpoint is connected to `src/ui/dockablepane.tsx`.
193+
This tells vite that the tab endpoint is connected to `src/ui/tab.tsx` and the dockable pane endpoint is connected to `src/ui/dockablepane.tsx`.
196194

197195
`vite.config.js` should now look like this:
198196

@@ -219,9 +217,12 @@ export default defineConfig({
219217

220218
### Altering `public/manifest.json`
221219

222-
You also need to instruct Studio Pro to load the endpoint that you just created. To do this, modify the manifest file `public/manifest.json`.
220+
You also musr instruct Studio Pro to load the endpoint that you just created. To do this, modify the manifest file `public/manifest.json`.
221+
222+
Alter the "ui" section by:
223223

224-
Alter the "ui" section by changing the `tab` endpoint and adding the `dockablepane` endpoint.
224+
* Changing the `tab` endpoint
225+
* Adding the `dockablepane` endpoint.
225226

226227
```typescript
227228
"ui": {
@@ -248,17 +249,17 @@ The `manifest.json file` should now look like this:
248249

249250
## Closing the Dockable Pane
250251

251-
Now that you have registered a pane and can open, it would also be a good idea to close it.
252+
Now that you have registered a pane and created a way to open it, it is important to provide a way to close it, too.
252253

253-
You will close your pane using a new menu item.
254+
You will close your pane using a new menu item. Follow the steps below:
254255

255-
First add a new sub menu item to the menu on line 11.
256+
1. Add a new sub-menu item to the menu on line 11.
256257

257258
```typescript {linenos=table linenostart=11}
258259
{ menuId: "myextension.HideDockMenuItem", caption: "Hide dock pane" },
259260
```
260261

261-
You must also alter the event handler for the new menu at the end of the loaded method:
262+
2. Alter the event handler for the new menu at the end of the loaded method:
262263

263264
```typescript
264265
// Open a tab when the menu item is clicked
@@ -337,13 +338,8 @@ The loaded method should now look like this:
337338
}
338339
```
339340

340-
## Conclusion
341-
342-
You now have a new dockable pane with its own user interface which you can modify as you like.
343-
You can also open and close the dockable pane from a menu.
344-
345341
## Extensibility Feedback
346342

347-
If you would like to provide us with some additional feedback you can complete a small [Survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback)
343+
If you would like to provide additional feedback, you can complete a small [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback).
348344

349-
Any feedback is much appreciated.
345+
Any feedback is appreciated.

0 commit comments

Comments
 (0)