Skip to content

Commit 8261f25

Browse files
committed
Review Editor and Local app files API
1 parent 3a27cd5 commit 8261f25

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ This how-to describes how to open an existing document editor in Studio Pro from
1010

1111
## Prerequisites
1212

13-
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. You should also be familiar with creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
13+
Before starting this how-to, make sure you have completed the following prerequisites:
14+
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 creating menus as described in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
1417

1518
## Opening a Document Editor
1619

17-
First, create a menu item. This is done inside the `loaded` method in the main entry point (`src/main/index.ts`). For more information, see [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
20+
Create a menu item following the steps in [Create a Menu Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu-api/).
1821

1922
This menu action will look for the `Home_Page` document in `MyFirstModule` (however, you can use any module or document in your app). It will then open it with the editor API. For more information, see [Access a Mendix Model Using Web API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/model-api/).
2023

@@ -90,6 +93,6 @@ studioPro.ui.extensionsMenu.addEventListener("menuItemActivated", async args =>
9093

9194
## Extensibility Feedback
9295

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

9598
Any feedback is appreciated.

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

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ url: /apidocs-mxsdk/apidocs/web-extensibility-api-11/local-app-files-api/
66

77
## Introduction
88

9-
This how-to shows you how to interact with local application files from within an extension. It adds three new buttons to the tab and three new event handlers for saving, loading, and deleting a file called `HelloWorld.txt`.
9+
This how-to describes how to interact with local application files from within an extension. In this example, you will:
10+
11+
* Add three new buttons to a tab
12+
* Add three new event handlers for saving, loading, and deleting a file called `HelloWorld.txt`
1013

1114
## Prerequisites
1215

13-
This how-to uses the results of [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Please complete that how-to before starting this one.
16+
This how-to uses the results of [Get Started with the Web Extensibility API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/getting-started/). Make sure to complete that how-to before starting this one.
1417

15-
## Adding Some Interactivity
18+
## Adding Interactivity
1619

17-
First, you will add all the code. The changes will then be explained so that you can understand what the code does.
20+
Implement the code described in the [Code Descriptions](#code-descriptions) section by following the steps below:
1821

1922
1. Open `src/ui/index.tsx`.
20-
1. Replace the contents of the file with the following code:
23+
2. Replace the contents of the file with the following code:
2124

2225
```typescript
2326
import React, { StrictMode } from "react";
@@ -64,13 +67,13 @@ export const component: IComponent = {
6467
};
6568
```
6669

67-
## What Does the Code Do?
70+
## Code Descriptions {code-descriptions}
6871

6972
The following sections explain the various parts of the code.
7073

7174
### saveFile
7275

73-
The `saveFile` callback calls the `putFile` API setting the filename to `HelloWorld.txt` and the content to `Hello world from a file!`.
76+
The `saveFile` callback calls the `putFile` API. It sets the file name to `HelloWorld.txt` and the content to `Hello world from a file!`.
7477

7578
```typescript
7679
const saveFile = async () => {
@@ -84,7 +87,7 @@ const saveFile = async () => {
8487

8588
### loadFile
8689

87-
The loadFile callback calls the getFile API requesting to load `HelloWorld.txt`. It then shows message box displaying the content of the file.
90+
The `loadFile` callback calls the `getFile` API. It requests to load `HelloWorld.txt`, then shows a message box that displays the content of the file.
8891

8992
```typescript
9093
const loadFile = async () => {
@@ -98,7 +101,7 @@ const loadFile = async () => {
98101

99102
### deleteFile
100103

101-
The deleteFile callback calls the deleteFile API requesting to delete `HelloWorld.txt`
104+
The `deleteFile` callback calls the `deleteFile` API. It requests to delete `HelloWorld.txt`.
102105

103106
```typescript
104107
const deleteFile = async () => {
@@ -107,7 +110,7 @@ const deleteFile = async () => {
107110
};
108111
```
109112

110-
### Adding the Buttons
113+
### Adding Buttons
111114

112115
The final part of the code adds three new buttons which, when clicked, call the callbacks described above.
113116

@@ -125,19 +128,15 @@ createRoot(document.getElementById("root")!).render(
125128
);
126129
```
127130

128-
## Some Restrictions
129-
130-
The App files API allows you to modify files within your application's folder. It will not:
131-
132-
* serve restricted files such as the `.mpr` file or the contents of some folders such as the `.git` folder.
133-
* allow access to files outside of the app folder.
131+
## Restrictions
134132

135-
## Conclusion
133+
The app files API allows you to modify files within your application's folder. It will not:
136134

137-
You can now create and extension which save, load, and delete files within the app folder.
135+
* Serve restricted files such as the `.mpr` file, or the contents of some folders, such as the `.git` folder
136+
* Allow access to files outside of the app folder
138137

139138
## Extensibility Feedback
140139

141-
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)
140+
If you would like to provide additional feedback, you can complete a small [survey](https://survey.alchemer.eu/s3/90801191/Extensibility-Feedback).
142141

143-
Any feedback is much appreciated.
142+
Any feedback is appreciated.

0 commit comments

Comments
 (0)