Skip to content

Commit 3a27cd5

Browse files
committed
Review Documents API
1 parent b0ff6a1 commit 3a27cd5

File tree

1 file changed

+11
-5
lines changed
  • content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ url: /apidocs-mxsdk/apidocs/web-extensibility-api-11/documents-api/
66

77
## Introduction
88

9-
This how-to describes how to create context menus for a document editor that execute previously registered commands.
9+
This how-to describes how to create context menus for a document editor that execute previously registered commands. In the example below, you create a menu which is shown for each entity in the domain model of Studio Pro.
1010

1111
## Prerequisites
1212

@@ -17,9 +17,15 @@ Before starting this how-to, make sure you have completed the following prerequi
1717

1818
## Creating a Context Menu
1919

20-
In the example below, you create a menu which is shown for each entity in the Domain model editor of Studio Pro. In order to specify which type of document a menu should belong to, you need to use the full name of the document type, i.e. `DomainModels$Entity` for entities, `DomainModels$Annotation` for annotations, or `DomainModels$DomainModel` for the editor canvas itself. For more information on these document types, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
20+
{{% alert color="info" %}}
21+
Use the full name of the document type (for example, `DomainModels$Entity` for entities, `DomainModels$Annotation` for annotations, or `DomainModels$DomainModel` for the editor canvas itself). 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/).
22+
{{% /alert %}}
23+
24+
The code below does the following:
2125

22-
First, a command must be registered through the [Commands API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/command-api/), then the `commandId` can be attached to the new menu. Afterwards, using the `documents` API's `addContextMenu` method, the menu can be added to an entity inside the Domain model editor.
26+
1. Registers a command through the [Commands API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/command-api/)
27+
2. Attaches the `commandId` to the new menu
28+
3. Uses the `documents` API's `addContextMenu` method to add the menu to an entity inside the domain model editor
2329

2430
```typescript
2531
import { ComponentContext, IComponent, Menu, StudioProApi, getStudioProApi } from "@mendix/extensions-api";
@@ -56,6 +62,6 @@ The command must be registered before creating the menu.
5662

5763
## Extensibility Feedback
5864

59-
If you would like to provide us with some additional feedback, please complete a short [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback)
65+
If you would like to provide additional feedback, you can complete a short [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback).
6066

61-
Any feedback is much appreciated.
67+
Any feedback is appreciated.

0 commit comments

Comments
 (0)