Skip to content

Commit 2762803

Browse files
Merge branch 'development' into nc-olu-private-connectivity
2 parents 77a17fa + 552bfd8 commit 2762803

120 files changed

Lines changed: 2410 additions & 820 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/_default/hugo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ disableKinds = ["taxonomy", "term"]
3030
quality = 75
3131
anchor = "smart"
3232

33-
[services]
34-
[services.googleAnalytics]
35-
# Marketing Google Tag ID
36-
id = 'UA-163813-1'
37-
3833
# Language configuration
3934

4035
[languages]
@@ -161,7 +156,7 @@ replacements = "github.com/FortAwesome/Font-Awesome -> ., github.com/twbs/bootst
161156
sidebar_menu_truncate = 100
162157

163158
# Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events.
164-
# This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set.
159+
# This feature used to depend on [services.googleAnalytics],but that is now become obsolete.
165160
# If you want this feature, but occasionally need to remove the "Feedback" section from a single page,
166161
# add "hide_feedback: true" to the page's front matter.
167162
[params.ui.feedback]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ After completing development on your extension, you can package it into an add-o
1010

1111
To package your extension, follow the steps below:
1212

13-
1. Make sure the`--enable-extension-development` command-line option is enabled.
13+
1. Make sure you have enabled the [Extension Development](/refguide/preferences-dialog/#extension-development) setting in your app's Preferences. Alternatively, you can start Studio Pro with the `--enable-extension-development` command-line option.
1414
2. In your Studio Pro app, create a new module and include your development extension.
1515
3. Give the module a name.
1616
4. Open the module's settings and in the **Export** tab, choose **Add-on module**.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ For detailed information on how to get started with extensions, see [Get Started
3737

3838
Below is a list of how-tos for you to begin with:
3939

40+
* [How Menus Work](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/)
4041
* [How to Create a Dockable Pane](/apidocs-mxsdk/apidocs/web-extensibility-api-11/dockable-pane-api/)
4142
* [How to Interact With Local App Files](/apidocs-mxsdk/apidocs/web-extensibility-api-11/local-app-files-api/)
4243
* [How to Create a Menu](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/)

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

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Extensions can be built on any operating system, as the underlying framework is
2424
{{% /alert %}}
2525

2626
{{% alert color="info" %}}
27-
Extension development is only possible by starting Studio Pro with the `--enable-extension-development` feature flag.
27+
Extension development is only possible by enabling the [Extension Development](/refguide/preferences-dialog/#extension-development) setting in your app's Preferences, or by starting Studio Pro with the `--enable-extension-development` feature flag.
2828
{{% /alert %}}
2929

3030
## Creating Your First Extension
@@ -75,54 +75,47 @@ Before you begin, your extension will have to get an instance of the Studio Pro
7575

7676
In the source code, you should see the following:
7777

78-
1. Line 6 gets an instance of the Studio Pro API by calling `getStudioProApi`.
78+
1. You get an instance of the Studio Pro API by calling `getStudioProApi`.
7979

8080
```typescript
8181
export const component: IComponent = {
8282
async loaded(componentContext) {
8383
const studioPro = getStudioProApi(componentContext);
8484

85-
2. Line 7 adds a menu:
85+
2. A menu is added that opens a tab:
8686

8787
```typescript
8888
await studioPro.ui.extensionsMenu.add({
8989
menuId: "myextension.MainMenu",
9090
caption: "MyExtension Menu",
9191
subMenus: [
92-
{ menuId: "myextension.ShowMenu", caption: "Show tab" },
92+
{
93+
menuId: "myextension.ShowMenu",
94+
caption: "Show tab",
95+
// Open a tab when the menu item is clicked
96+
action: async () => {
97+
await studioPro.ui.tabs.open(
98+
{
99+
title: "MyExtension tab"
100+
},
101+
{
102+
componentName: "extension/myextension",
103+
uiEntrypoint: "tab"
104+
}
105+
)
106+
}
107+
}
93108
],
94109
});
95110
```
96111

97-
3. Line 16 opens a tab.
98-
99-
```typescript
100-
// Open a tab when the menu item is clicked
101-
studioPro.ui.extensionsMenu.addEventListener(
102-
"menuItemActivated",
103-
(args) => {
104-
if (args.menuId === "myextension.ShowMenu") {
105-
studioPro.ui.tabs.open(
106-
{
107-
title: "MyExtension Tab"
108-
},
109-
{
110-
componentName: "extension/myextension",
111-
uiEntrypoint: "tab",
112-
}
113-
);
114-
}
115-
}
116-
);
117-
```
118-
119-
4. If you navigate to `build-extension.mjs`, you can choose the directory to which the extension will be installed to after being built by changing line 6:
112+
3. If you navigate to `build-extension.mjs`, you can choose the directory where the extension will be installed to after being built by changing line 6:
120113

121114
```typescript
122115
const appDir = "C:\\TestApps\\AppTestExtensions"
123116
```
124117

125-
5. The file `.vscode\launch.json` specifies the launch configuration and enables debugging. The following lines specify how Studio Pro will be run:
118+
4. The file `.vscode\launch.json` specifies the launch configuration and enables debugging. The following lines specify how Studio Pro will be run:
126119

127120
```json
128121
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: "Migration Guide for Web Extensibility API Older Versions"
3+
linktitle: "Migration Guide"
4+
url: /apidocs-mxsdk/apidocs/web-extensibility-api-11/migration-guide/
5+
weight: 2
6+
---
7+
8+
## Introduction
9+
10+
A breaking change in the Web Extensibility API was introduced in Studio Pro 11.6, which changed the way [menus](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) are created. This guide explains how to update your extension code after upgrading to Studio Pro 11.6 from an earlier version.
11+
12+
## `MenuItemActivated` Event
13+
14+
If your extension created menus using the `menuId` and the `menuItemActivated` event to trigger actions, you can now use the action that was called when the event was triggered as the actual `action` property of your menu.
15+
16+
For example, if your code looked like this:
17+
18+
```typescript
19+
20+
const menuId = "myextension.menu";
21+
22+
await studioPro.ui.extensionsMenu.add({
23+
menuId: menuId,
24+
caption: "My Menu",
25+
});
26+
27+
studioPro.ui.extensionsMenu.addEventListener(
28+
"menuItemActivated",
29+
async (args) => {
30+
if (args.menuId === menuId) {
31+
await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
32+
}
33+
}
34+
);
35+
```
36+
37+
The action called when the event triggers for your menu can now be used directly as the menu action:
38+
39+
```typescript
40+
await studioPro.ui.extensionsMenu.add({
41+
menuId: "myextension.menu",
42+
caption: "My Menu",
43+
action: async () => await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
44+
});
45+
```
46+
47+
The `menuItemActivated` event no longer exists, so you cannot listen to it anymore.
48+
49+
## Registering Commands
50+
51+
{{%alert type="info" %}}
52+
The command registration API has been removed and is no longer available for Studio Pro 11.6 and above.
53+
{{% /alert%}}
54+
55+
If your extension created menus by using a command Id of a pre-registered command, the action that is sent to the command registration API when registering the command can now be used directly as the action of the menu.
56+
57+
For example, if your code looked like this:
58+
59+
```typescript
60+
const commandId = "myextension.menu-command";
61+
62+
await studioPro.app.commands.registerCommand(
63+
commandId,
64+
async () => await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
65+
);
66+
await studioPro.ui.extensionsMenu.add({ caption: "My Menu", menuId: "myextension.menu", commandId });
67+
```
68+
69+
The same action sent to the command registration API can now instead become the `action` property value on the menu:
70+
71+
```typescript
72+
await studioPro.ui.extensionsMenu.add({
73+
menuId: "myextension.menu",
74+
caption: "My Menu",
75+
action: async () => await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
76+
});
77+
```
78+
79+
## Action Arguments
80+
81+
Action arguments are also possible in the new Menu API. Review the [Menus documentation](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) for a detailed explanation.

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

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,52 @@ This how-to describes how to interact with the App Explorer in Studio Pro. In th
1010

1111
## Prerequisites
1212

13+
{{% alert="info" %}}
14+
If you are using Studio Pro 11.0–11.5 and your extension includes menus, your existing menu code will not work when you upgrade to Studio Pro 11.6. To restore full functionality and support, upgrade to the Extensibility API 11.6 and follow the steps in the [Migration Guide](/apidocs-mxsdk/apidocs/web-extensibility-api-11/migration-guide/).
15+
{{% /alert%}}
16+
1317
Before starting this how-to, make sure you have completed the following prerequisites:
1418

15-
* 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.
16-
* Make sure you are familiar with command registration, as described in [Register a Command Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/command-api/).
19+
* Review [how menus work](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) in the Web Extensibility API
20+
* 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.
1721

1822
## Creating a Context Menu
1923

2024
{{% alert color="info" %}}
2125
Use the full name of the document type to specify which type of document a menu should belong to (for example, `Microflows$Microflow` for microflows or `Pages$Page` for pages). For more information about these document type names, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
2226
{{% /alert %}}
2327

24-
The code below does the following:
25-
26-
1. Registers a command through the [Command API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/command-api/).
27-
2. Attaches the `commandId` to the new menu.
28-
3. Uses the `appExplorer` API's `addContextMenu` method to add the menu to all `Microflow` document nodes.
28+
The code below uses the `appExplorer` API's `addContextMenu` method to add the menu to all `Microflow` document nodes. When this menu is clicked, the document's Id is sent as an argument through the `DocumentContext` argument parameter of the menu.
2929

3030
```typescript
31-
import { ComponentContext, IComponent, Menu, StudioProApi, getStudioProApi } from "@mendix/extensions-api";
31+
import { ComponentContext, DocumentContext, IComponent, Menu, getStudioProApi } from "@mendix/extensions-api";
3232

3333
const extensionId = "myextension";
3434

3535
export const component: IComponent = {
3636
async loaded(componentContext: ComponentContext) {
3737
const studioPro = getStudioProApi(componentContext);
3838

39-
const commandId = `${extensionId}.microflow.command`;
40-
const menuId = `${commandId}.menu`;
39+
const menuId = `${extensionId}.microflow.menu`;
4140

42-
await studioPro.app.commands.registerCommand<{ documentId: string }>(commandId, async (args: { documentId: string }) => {
41+
const action = async (args: DocumentContext) => {
4342
await studioPro.ui.notifications.show({
44-
title: `Microflow command executed`,
43+
title: `Microflow action executed`,
4544
message: `You clicked a context menu for a Microflow! (${args.documentId})`,
4645
displayDurationInSeconds: 4
4746
});
48-
});
47+
};
4948

50-
const microflowMenu: Menu = { caption: `Microflow command menu`, menuId, commandId };
49+
const microflowMenu: Menu<DocumentContext> = { caption: `Microflow menu`, menuId, action };
5150

5251
await studioPro.ui.appExplorer.addContextMenu(microflowMenu, "Microflows$Microflow");
5352
}
54-
}
53+
};
5554
```
5655

57-
The payload of the command must be an object containing a document Id (`{ documentId: string }`). Registering the command requires the exact type of the payload, or your extension will not compile. The `documentId` will be the Id of the document the menu is attached to (in this scenario, the exact `Microflow` node in the App Explorer).
56+
The `DocumentContext` payload for the menu action is an object containing a document Id (`{ documentId: string }`). When creating a menu for the `appExplorer`'s `addContextMenu` method, the `DocumentContext` should be used as the context of your menu. The `documentId` will be the Id of the document the menu is attached to (in this example, the exact `Microflow` node in the App Explorer).
5857

59-
{{% alert color="warning" %}}
60-
The command must be registered before creating the menu.
61-
{{% /alert %}}
58+
As explained in the [menu documentation](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/), the `DocumentContext` is not necessary to add your menu to Studio Pro. However, if it is not used, the menu will not receive the clicked document's ID.
6259

6360
## Extensibility Feedback
6461

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

Lines changed: 0 additions & 80 deletions
This file was deleted.

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/custom-blob-document-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ To register a new document type, follow the steps below:
193193
import parseArgs from "minimist"
194194
195195
const outDir = `dist/myextension`
196-
const appDir = "/Users/petar.vukmirovic/Mendix/App-Guide-Test-Blob"
196+
const appDir = "/Users/<USERNAME>/Mendix/App-Guide-Test-Blob"
197197
const extensionDirectoryName = "extensions"
198198
199199
const entryPoints = [

0 commit comments

Comments
 (0)